@earendil-works/chord 1.3.0 → 1.5.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 (841) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +129 -10
  3. package/dist/cell.d.ts +7 -7
  4. package/dist/cell.d.ts.map +1 -1
  5. package/dist/cell.js.map +1 -1
  6. package/dist/context/index.d.ts +8 -0
  7. package/dist/context/index.d.ts.map +1 -1
  8. package/dist/context/index.js +15 -0
  9. package/dist/context/index.js.map +1 -1
  10. package/dist/contract.d.ts +51 -52
  11. package/dist/contract.d.ts.map +1 -1
  12. package/dist/contract.js +19 -24
  13. package/dist/contract.js.map +1 -1
  14. package/dist/delta/apply-immutable-trusted.js +3 -4
  15. package/dist/delta/apply-immutable-trusted.js.map +1 -1
  16. package/dist/delta/diff.d.ts.map +1 -1
  17. package/dist/delta/diff.js +5 -3
  18. package/dist/delta/diff.js.map +1 -1
  19. package/dist/delta/index.d.ts +9 -1
  20. package/dist/delta/index.d.ts.map +1 -1
  21. package/dist/delta/index.js +15 -11
  22. package/dist/delta/index.js.map +1 -1
  23. package/dist/delta/pending.d.ts +36 -0
  24. package/dist/delta/pending.d.ts.map +1 -0
  25. package/dist/delta/pending.js +143 -0
  26. package/dist/delta/pending.js.map +1 -0
  27. package/dist/delta/tracker.d.ts +12 -0
  28. package/dist/delta/tracker.d.ts.map +1 -1
  29. package/dist/delta/tracker.js +109 -39
  30. package/dist/delta/tracker.js.map +1 -1
  31. package/dist/host.d.ts.map +1 -1
  32. package/dist/host.js +9 -7
  33. package/dist/host.js.map +1 -1
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +1 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/next/contracts/accepts.d.ts +81 -0
  39. package/dist/next/contracts/accepts.d.ts.map +1 -0
  40. package/dist/next/contracts/accepts.js +123 -0
  41. package/dist/next/contracts/accepts.js.map +1 -0
  42. package/dist/next/contracts/contract.d.ts +121 -0
  43. package/dist/next/contracts/contract.d.ts.map +1 -0
  44. package/dist/next/contracts/contract.js +50 -0
  45. package/dist/next/contracts/contract.js.map +1 -0
  46. package/dist/next/contracts/declare.d.ts +107 -0
  47. package/dist/next/contracts/declare.d.ts.map +1 -0
  48. package/dist/next/contracts/declare.js +136 -0
  49. package/dist/next/contracts/declare.js.map +1 -0
  50. package/dist/next/contracts/evolve.d.ts +92 -0
  51. package/dist/next/contracts/evolve.d.ts.map +1 -0
  52. package/dist/next/contracts/evolve.js +179 -0
  53. package/dist/next/contracts/evolve.js.map +1 -0
  54. package/dist/next/contracts/fingerprint.d.ts +16 -0
  55. package/dist/next/contracts/fingerprint.d.ts.map +1 -0
  56. package/dist/next/contracts/fingerprint.js +50 -0
  57. package/dist/next/contracts/fingerprint.js.map +1 -0
  58. package/dist/next/contracts/history.d.ts +71 -0
  59. package/dist/next/contracts/history.d.ts.map +1 -0
  60. package/dist/next/contracts/history.js +3 -0
  61. package/dist/next/contracts/history.js.map +1 -0
  62. package/dist/next/contracts/host-kind.d.ts +40 -0
  63. package/dist/next/contracts/host-kind.d.ts.map +1 -0
  64. package/dist/next/contracts/host-kind.js +37 -0
  65. package/dist/next/contracts/host-kind.js.map +1 -0
  66. package/dist/next/contracts/index.d.ts +7 -0
  67. package/dist/next/contracts/index.d.ts.map +1 -0
  68. package/dist/next/contracts/index.js +6 -0
  69. package/dist/next/contracts/index.js.map +1 -0
  70. package/dist/next/contracts/internal.d.ts +10 -0
  71. package/dist/next/contracts/internal.d.ts.map +1 -0
  72. package/dist/next/contracts/internal.js +9 -0
  73. package/dist/next/contracts/internal.js.map +1 -0
  74. package/dist/next/contracts/names.d.ts +3 -0
  75. package/dist/next/contracts/names.d.ts.map +1 -0
  76. package/dist/next/contracts/names.js +13 -0
  77. package/dist/next/contracts/names.js.map +1 -0
  78. package/dist/next/contracts/params.d.ts +28 -0
  79. package/dist/next/contracts/params.d.ts.map +1 -0
  80. package/dist/next/contracts/params.js +50 -0
  81. package/dist/next/contracts/params.js.map +1 -0
  82. package/dist/next/contracts/schema.d.ts +102 -0
  83. package/dist/next/contracts/schema.d.ts.map +1 -0
  84. package/dist/next/contracts/schema.js +103 -0
  85. package/dist/next/contracts/schema.js.map +1 -0
  86. package/dist/next/contracts/snapshot.d.ts +16 -0
  87. package/dist/next/contracts/snapshot.d.ts.map +1 -0
  88. package/dist/next/contracts/snapshot.js +167 -0
  89. package/dist/next/contracts/snapshot.js.map +1 -0
  90. package/dist/next/data/args.d.ts +50 -0
  91. package/dist/next/data/args.d.ts.map +1 -0
  92. package/dist/next/data/args.js +83 -0
  93. package/dist/next/data/args.js.map +1 -0
  94. package/dist/next/data/errors.d.ts +73 -0
  95. package/dist/next/data/errors.d.ts.map +1 -0
  96. package/dist/next/data/errors.js +107 -0
  97. package/dist/next/data/errors.js.map +1 -0
  98. package/dist/next/data/failure.d.ts +26 -0
  99. package/dist/next/data/failure.d.ts.map +1 -0
  100. package/dist/next/data/failure.js +72 -0
  101. package/dist/next/data/failure.js.map +1 -0
  102. package/dist/next/data/index.d.ts +4 -0
  103. package/dist/next/data/index.d.ts.map +1 -0
  104. package/dist/next/data/index.js +4 -0
  105. package/dist/next/data/index.js.map +1 -0
  106. package/dist/next/data/internal.d.ts +7 -0
  107. package/dist/next/data/internal.d.ts.map +1 -0
  108. package/dist/next/data/internal.js +8 -0
  109. package/dist/next/data/internal.js.map +1 -0
  110. package/dist/next/data/params.d.ts +20 -0
  111. package/dist/next/data/params.d.ts.map +1 -0
  112. package/dist/next/data/params.js +31 -0
  113. package/dist/next/data/params.js.map +1 -0
  114. package/dist/next/data/principal.d.ts +17 -0
  115. package/dist/next/data/principal.d.ts.map +1 -0
  116. package/dist/next/data/principal.js +41 -0
  117. package/dist/next/data/principal.js.map +1 -0
  118. package/dist/next/data/validator.d.ts +12 -0
  119. package/dist/next/data/validator.d.ts.map +1 -0
  120. package/dist/next/data/validator.js +34 -0
  121. package/dist/next/data/validator.js.map +1 -0
  122. package/dist/next/documents/address-source.d.ts +20 -0
  123. package/dist/next/documents/address-source.d.ts.map +1 -0
  124. package/dist/next/documents/address-source.js +44 -0
  125. package/dist/next/documents/address-source.js.map +1 -0
  126. package/dist/next/documents/definition.d.ts +84 -0
  127. package/dist/next/documents/definition.d.ts.map +1 -0
  128. package/dist/next/documents/definition.js +73 -0
  129. package/dist/next/documents/definition.js.map +1 -0
  130. package/dist/next/documents/documents.d.ts +106 -0
  131. package/dist/next/documents/documents.d.ts.map +1 -0
  132. package/dist/next/documents/documents.js +224 -0
  133. package/dist/next/documents/documents.js.map +1 -0
  134. package/dist/next/documents/fence.d.ts +9 -0
  135. package/dist/next/documents/fence.d.ts.map +1 -0
  136. package/dist/next/documents/fence.js +15 -0
  137. package/dist/next/documents/fence.js.map +1 -0
  138. package/dist/next/documents/handles.d.ts +76 -0
  139. package/dist/next/documents/handles.d.ts.map +1 -0
  140. package/dist/next/documents/handles.js +66 -0
  141. package/dist/next/documents/handles.js.map +1 -0
  142. package/dist/next/documents/index.d.ts +4 -0
  143. package/dist/next/documents/index.d.ts.map +1 -0
  144. package/dist/next/documents/index.js +3 -0
  145. package/dist/next/documents/index.js.map +1 -0
  146. package/dist/next/documents/internal.d.ts +9 -0
  147. package/dist/next/documents/internal.d.ts.map +1 -0
  148. package/dist/next/documents/internal.js +9 -0
  149. package/dist/next/documents/internal.js.map +1 -0
  150. package/dist/next/documents/keyed-slot.d.ts +103 -0
  151. package/dist/next/documents/keyed-slot.d.ts.map +1 -0
  152. package/dist/next/documents/keyed-slot.js +395 -0
  153. package/dist/next/documents/keyed-slot.js.map +1 -0
  154. package/dist/next/documents/line.d.ts +7 -0
  155. package/dist/next/documents/line.d.ts.map +1 -0
  156. package/dist/next/documents/line.js +14 -0
  157. package/dist/next/documents/line.js.map +1 -0
  158. package/dist/next/documents/persistence.d.ts +104 -0
  159. package/dist/next/documents/persistence.d.ts.map +1 -0
  160. package/dist/next/documents/persistence.js +128 -0
  161. package/dist/next/documents/persistence.js.map +1 -0
  162. package/dist/next/documents/residency.d.ts +31 -0
  163. package/dist/next/documents/residency.d.ts.map +1 -0
  164. package/dist/next/documents/residency.js +93 -0
  165. package/dist/next/documents/residency.js.map +1 -0
  166. package/dist/next/documents/slot.d.ts +109 -0
  167. package/dist/next/documents/slot.d.ts.map +1 -0
  168. package/dist/next/documents/slot.js +181 -0
  169. package/dist/next/documents/slot.js.map +1 -0
  170. package/dist/next/documents/transaction.d.ts +133 -0
  171. package/dist/next/documents/transaction.d.ts.map +1 -0
  172. package/dist/next/documents/transaction.js +409 -0
  173. package/dist/next/documents/transaction.js.map +1 -0
  174. package/dist/next/host/activity.d.ts +31 -0
  175. package/dist/next/host/activity.d.ts.map +1 -0
  176. package/dist/next/host/activity.js +40 -0
  177. package/dist/next/host/activity.js.map +1 -0
  178. package/dist/next/host/adapted.d.ts +49 -0
  179. package/dist/next/host/adapted.d.ts.map +1 -0
  180. package/dist/next/host/adapted.js +214 -0
  181. package/dist/next/host/adapted.js.map +1 -0
  182. package/dist/next/host/attempt.d.ts +278 -0
  183. package/dist/next/host/attempt.d.ts.map +1 -0
  184. package/dist/next/host/attempt.js +1072 -0
  185. package/dist/next/host/attempt.js.map +1 -0
  186. package/dist/next/host/backoff.d.ts +29 -0
  187. package/dist/next/host/backoff.d.ts.map +1 -0
  188. package/dist/next/host/backoff.js +69 -0
  189. package/dist/next/host/backoff.js.map +1 -0
  190. package/dist/next/host/ctx.d.ts +47 -0
  191. package/dist/next/host/ctx.d.ts.map +1 -0
  192. package/dist/next/host/ctx.js +108 -0
  193. package/dist/next/host/ctx.js.map +1 -0
  194. package/dist/next/host/deadline.d.ts +12 -0
  195. package/dist/next/host/deadline.d.ts.map +1 -0
  196. package/dist/next/host/deadline.js +40 -0
  197. package/dist/next/host/deadline.js.map +1 -0
  198. package/dist/next/host/dependencies.d.ts +65 -0
  199. package/dist/next/host/dependencies.d.ts.map +1 -0
  200. package/dist/next/host/dependencies.js +115 -0
  201. package/dist/next/host/dependencies.js.map +1 -0
  202. package/dist/next/host/destination.d.ts +48 -0
  203. package/dist/next/host/destination.d.ts.map +1 -0
  204. package/dist/next/host/destination.js +101 -0
  205. package/dist/next/host/destination.js.map +1 -0
  206. package/dist/next/host/facet.d.ts +79 -0
  207. package/dist/next/host/facet.d.ts.map +1 -0
  208. package/dist/next/host/facet.js +55 -0
  209. package/dist/next/host/facet.js.map +1 -0
  210. package/dist/next/host/follow.d.ts +52 -0
  211. package/dist/next/host/follow.d.ts.map +1 -0
  212. package/dist/next/host/follow.js +207 -0
  213. package/dist/next/host/follow.js.map +1 -0
  214. package/dist/next/host/host.d.ts +495 -0
  215. package/dist/next/host/host.d.ts.map +1 -0
  216. package/dist/next/host/host.js +1075 -0
  217. package/dist/next/host/host.js.map +1 -0
  218. package/dist/next/host/index.d.ts +17 -0
  219. package/dist/next/host/index.d.ts.map +1 -0
  220. package/dist/next/host/index.js +6 -0
  221. package/dist/next/host/index.js.map +1 -0
  222. package/dist/next/host/internal.d.ts +10 -0
  223. package/dist/next/host/internal.d.ts.map +1 -0
  224. package/dist/next/host/internal.js +8 -0
  225. package/dist/next/host/internal.js.map +1 -0
  226. package/dist/next/host/members.d.ts +50 -0
  227. package/dist/next/host/members.d.ts.map +1 -0
  228. package/dist/next/host/members.js +107 -0
  229. package/dist/next/host/members.js.map +1 -0
  230. package/dist/next/host/native.d.ts +55 -0
  231. package/dist/next/host/native.d.ts.map +1 -0
  232. package/dist/next/host/native.js +92 -0
  233. package/dist/next/host/native.js.map +1 -0
  234. package/dist/next/host/object.d.ts +290 -0
  235. package/dist/next/host/object.d.ts.map +1 -0
  236. package/dist/next/host/object.js +1127 -0
  237. package/dist/next/host/object.js.map +1 -0
  238. package/dist/next/host/parked.d.ts +23 -0
  239. package/dist/next/host/parked.d.ts.map +1 -0
  240. package/dist/next/host/parked.js +79 -0
  241. package/dist/next/host/parked.js.map +1 -0
  242. package/dist/next/host/presence.d.ts +34 -0
  243. package/dist/next/host/presence.d.ts.map +1 -0
  244. package/dist/next/host/presence.js +117 -0
  245. package/dist/next/host/presence.js.map +1 -0
  246. package/dist/next/host/ref-state.d.ts +53 -0
  247. package/dist/next/host/ref-state.d.ts.map +1 -0
  248. package/dist/next/host/ref-state.js +83 -0
  249. package/dist/next/host/ref-state.js.map +1 -0
  250. package/dist/next/host/reference-keys.d.ts +36 -0
  251. package/dist/next/host/reference-keys.d.ts.map +1 -0
  252. package/dist/next/host/reference-keys.js +168 -0
  253. package/dist/next/host/reference-keys.js.map +1 -0
  254. package/dist/next/host/reference-source.d.ts +65 -0
  255. package/dist/next/host/reference-source.d.ts.map +1 -0
  256. package/dist/next/host/reference-source.js +285 -0
  257. package/dist/next/host/reference-source.js.map +1 -0
  258. package/dist/next/host/reference.d.ts +308 -0
  259. package/dist/next/host/reference.d.ts.map +1 -0
  260. package/dist/next/host/reference.js +775 -0
  261. package/dist/next/host/reference.js.map +1 -0
  262. package/dist/next/host/retry-on.d.ts +28 -0
  263. package/dist/next/host/retry-on.d.ts.map +1 -0
  264. package/dist/next/host/retry-on.js +52 -0
  265. package/dist/next/host/retry-on.js.map +1 -0
  266. package/dist/next/host/revocation.d.ts +16 -0
  267. package/dist/next/host/revocation.d.ts.map +1 -0
  268. package/dist/next/host/revocation.js +27 -0
  269. package/dist/next/host/revocation.js.map +1 -0
  270. package/dist/next/host/root.d.ts +27 -0
  271. package/dist/next/host/root.d.ts.map +1 -0
  272. package/dist/next/host/root.js +68 -0
  273. package/dist/next/host/root.js.map +1 -0
  274. package/dist/next/host/route.d.ts +64 -0
  275. package/dist/next/host/route.d.ts.map +1 -0
  276. package/dist/next/host/route.js +190 -0
  277. package/dist/next/host/route.js.map +1 -0
  278. package/dist/next/host/routines.d.ts +76 -0
  279. package/dist/next/host/routines.d.ts.map +1 -0
  280. package/dist/next/host/routines.js +350 -0
  281. package/dist/next/host/routines.js.map +1 -0
  282. package/dist/next/host/sleep.d.ts +9 -0
  283. package/dist/next/host/sleep.d.ts.map +1 -0
  284. package/dist/next/host/sleep.js +40 -0
  285. package/dist/next/host/sleep.js.map +1 -0
  286. package/dist/next/host/staging.d.ts +94 -0
  287. package/dist/next/host/staging.d.ts.map +1 -0
  288. package/dist/next/host/staging.js +302 -0
  289. package/dist/next/host/staging.js.map +1 -0
  290. package/dist/next/host/unbound.d.ts +30 -0
  291. package/dist/next/host/unbound.d.ts.map +1 -0
  292. package/dist/next/host/unbound.js +67 -0
  293. package/dist/next/host/unbound.js.map +1 -0
  294. package/dist/next/host/uuid.d.ts +3 -0
  295. package/dist/next/host/uuid.d.ts.map +1 -0
  296. package/dist/next/host/uuid.js +38 -0
  297. package/dist/next/host/uuid.js.map +1 -0
  298. package/dist/next/index.d.ts +28 -0
  299. package/dist/next/index.d.ts.map +1 -0
  300. package/dist/next/index.js +18 -0
  301. package/dist/next/index.js.map +1 -0
  302. package/dist/next/jobs/definition.d.ts +96 -0
  303. package/dist/next/jobs/definition.d.ts.map +1 -0
  304. package/dist/next/jobs/definition.js +83 -0
  305. package/dist/next/jobs/definition.js.map +1 -0
  306. package/dist/next/jobs/index.d.ts +5 -0
  307. package/dist/next/jobs/index.d.ts.map +1 -0
  308. package/dist/next/jobs/index.js +3 -0
  309. package/dist/next/jobs/index.js.map +1 -0
  310. package/dist/next/jobs/internal.d.ts +3 -0
  311. package/dist/next/jobs/internal.d.ts.map +1 -0
  312. package/dist/next/jobs/internal.js +4 -0
  313. package/dist/next/jobs/internal.js.map +1 -0
  314. package/dist/next/jobs/job.d.ts +152 -0
  315. package/dist/next/jobs/job.d.ts.map +1 -0
  316. package/dist/next/jobs/job.js +320 -0
  317. package/dist/next/jobs/job.js.map +1 -0
  318. package/dist/next/jobs/persisted.d.ts +38 -0
  319. package/dist/next/jobs/persisted.d.ts.map +1 -0
  320. package/dist/next/jobs/persisted.js +95 -0
  321. package/dist/next/jobs/persisted.js.map +1 -0
  322. package/dist/next/jobs/records.d.ts +231 -0
  323. package/dist/next/jobs/records.d.ts.map +1 -0
  324. package/dist/next/jobs/records.js +869 -0
  325. package/dist/next/jobs/records.js.map +1 -0
  326. package/dist/next/jobs/run-states.d.ts +69 -0
  327. package/dist/next/jobs/run-states.d.ts.map +1 -0
  328. package/dist/next/jobs/run-states.js +228 -0
  329. package/dist/next/jobs/run-states.js.map +1 -0
  330. package/dist/next/jobs/run.d.ts +113 -0
  331. package/dist/next/jobs/run.d.ts.map +1 -0
  332. package/dist/next/jobs/run.js +200 -0
  333. package/dist/next/jobs/run.js.map +1 -0
  334. package/dist/next/jobs/running.d.ts +44 -0
  335. package/dist/next/jobs/running.d.ts.map +1 -0
  336. package/dist/next/jobs/running.js +117 -0
  337. package/dist/next/jobs/running.js.map +1 -0
  338. package/dist/next/jobs/stored.d.ts +63 -0
  339. package/dist/next/jobs/stored.d.ts.map +1 -0
  340. package/dist/next/jobs/stored.js +55 -0
  341. package/dist/next/jobs/stored.js.map +1 -0
  342. package/dist/next/link/binary.d.ts +4 -0
  343. package/dist/next/link/binary.d.ts.map +1 -0
  344. package/dist/next/link/binary.js +534 -0
  345. package/dist/next/link/binary.js.map +1 -0
  346. package/dist/next/link/channel.d.ts +63 -0
  347. package/dist/next/link/channel.d.ts.map +1 -0
  348. package/dist/next/link/channel.js +202 -0
  349. package/dist/next/link/channel.js.map +1 -0
  350. package/dist/next/link/errors.d.ts +7 -0
  351. package/dist/next/link/errors.d.ts.map +1 -0
  352. package/dist/next/link/errors.js +21 -0
  353. package/dist/next/link/errors.js.map +1 -0
  354. package/dist/next/link/index.d.ts +8 -0
  355. package/dist/next/link/index.d.ts.map +1 -0
  356. package/dist/next/link/index.js +8 -0
  357. package/dist/next/link/index.js.map +1 -0
  358. package/dist/next/link/internal.d.ts +9 -0
  359. package/dist/next/link/internal.d.ts.map +1 -0
  360. package/dist/next/link/internal.js +10 -0
  361. package/dist/next/link/internal.js.map +1 -0
  362. package/dist/next/link/ipc.d.ts +22 -0
  363. package/dist/next/link/ipc.d.ts.map +1 -0
  364. package/dist/next/link/ipc.js +64 -0
  365. package/dist/next/link/ipc.js.map +1 -0
  366. package/dist/next/link/link.d.ts +34 -0
  367. package/dist/next/link/link.d.ts.map +1 -0
  368. package/dist/next/link/link.js +87 -0
  369. package/dist/next/link/link.js.map +1 -0
  370. package/dist/next/link/message.d.ts +249 -0
  371. package/dist/next/link/message.d.ts.map +1 -0
  372. package/dist/next/link/message.js +123 -0
  373. package/dist/next/link/message.js.map +1 -0
  374. package/dist/next/link/part.d.ts +80 -0
  375. package/dist/next/link/part.d.ts.map +1 -0
  376. package/dist/next/link/part.js +164 -0
  377. package/dist/next/link/part.js.map +1 -0
  378. package/dist/next/link/text.d.ts +6 -0
  379. package/dist/next/link/text.d.ts.map +1 -0
  380. package/dist/next/link/text.js +335 -0
  381. package/dist/next/link/text.js.map +1 -0
  382. package/dist/next/link/values.d.ts +40 -0
  383. package/dist/next/link/values.d.ts.map +1 -0
  384. package/dist/next/link/values.js +117 -0
  385. package/dist/next/link/values.js.map +1 -0
  386. package/dist/next/link/websocket.d.ts +26 -0
  387. package/dist/next/link/websocket.d.ts.map +1 -0
  388. package/dist/next/link/websocket.js +91 -0
  389. package/dist/next/link/websocket.js.map +1 -0
  390. package/dist/next/registries/contribution.d.ts +50 -0
  391. package/dist/next/registries/contribution.d.ts.map +1 -0
  392. package/dist/next/registries/contribution.js +129 -0
  393. package/dist/next/registries/contribution.js.map +1 -0
  394. package/dist/next/registries/entries.d.ts +18 -0
  395. package/dist/next/registries/entries.d.ts.map +1 -0
  396. package/dist/next/registries/entries.js +42 -0
  397. package/dist/next/registries/entries.js.map +1 -0
  398. package/dist/next/registries/index.d.ts +3 -0
  399. package/dist/next/registries/index.d.ts.map +1 -0
  400. package/dist/next/registries/index.js +5 -0
  401. package/dist/next/registries/index.js.map +1 -0
  402. package/dist/next/registries/internal.d.ts +4 -0
  403. package/dist/next/registries/internal.d.ts.map +1 -0
  404. package/dist/next/registries/internal.js +5 -0
  405. package/dist/next/registries/internal.js.map +1 -0
  406. package/dist/next/registries/record.d.ts +94 -0
  407. package/dist/next/registries/record.d.ts.map +1 -0
  408. package/dist/next/registries/record.js +253 -0
  409. package/dist/next/registries/record.js.map +1 -0
  410. package/dist/next/registries/registry.d.ts +74 -0
  411. package/dist/next/registries/registry.d.ts.map +1 -0
  412. package/dist/next/registries/registry.js +14 -0
  413. package/dist/next/registries/registry.js.map +1 -0
  414. package/dist/next/registries/value.d.ts +48 -0
  415. package/dist/next/registries/value.d.ts.map +1 -0
  416. package/dist/next/registries/value.js +199 -0
  417. package/dist/next/registries/value.js.map +1 -0
  418. package/dist/next/remote/calls.d.ts +25 -0
  419. package/dist/next/remote/calls.d.ts.map +1 -0
  420. package/dist/next/remote/calls.js +62 -0
  421. package/dist/next/remote/calls.js.map +1 -0
  422. package/dist/next/remote/consumer.d.ts +42 -0
  423. package/dist/next/remote/consumer.d.ts.map +1 -0
  424. package/dist/next/remote/consumer.js +343 -0
  425. package/dist/next/remote/consumer.js.map +1 -0
  426. package/dist/next/remote/hold.d.ts +130 -0
  427. package/dist/next/remote/hold.d.ts.map +1 -0
  428. package/dist/next/remote/hold.js +537 -0
  429. package/dist/next/remote/hold.js.map +1 -0
  430. package/dist/next/remote/host-link.d.ts +77 -0
  431. package/dist/next/remote/host-link.d.ts.map +1 -0
  432. package/dist/next/remote/host-link.js +182 -0
  433. package/dist/next/remote/host-link.js.map +1 -0
  434. package/dist/next/remote/internal.d.ts +6 -0
  435. package/dist/next/remote/internal.d.ts.map +1 -0
  436. package/dist/next/remote/internal.js +6 -0
  437. package/dist/next/remote/internal.js.map +1 -0
  438. package/dist/next/remote/path.d.ts +46 -0
  439. package/dist/next/remote/path.d.ts.map +1 -0
  440. package/dist/next/remote/path.js +73 -0
  441. package/dist/next/remote/path.js.map +1 -0
  442. package/dist/next/remote/provider.d.ts +76 -0
  443. package/dist/next/remote/provider.d.ts.map +1 -0
  444. package/dist/next/remote/provider.js +506 -0
  445. package/dist/next/remote/provider.js.map +1 -0
  446. package/dist/next/remote/relay.d.ts +58 -0
  447. package/dist/next/remote/relay.d.ts.map +1 -0
  448. package/dist/next/remote/relay.js +117 -0
  449. package/dist/next/remote/relay.js.map +1 -0
  450. package/dist/next/remote/remote-object.d.ts +133 -0
  451. package/dist/next/remote/remote-object.d.ts.map +1 -0
  452. package/dist/next/remote/remote-object.js +411 -0
  453. package/dist/next/remote/remote-object.js.map +1 -0
  454. package/dist/next/remote/replica.d.ts +59 -0
  455. package/dist/next/remote/replica.d.ts.map +1 -0
  456. package/dist/next/remote/replica.js +125 -0
  457. package/dist/next/remote/replica.js.map +1 -0
  458. package/dist/next/state/batch.d.ts +64 -0
  459. package/dist/next/state/batch.d.ts.map +1 -0
  460. package/dist/next/state/batch.js +163 -0
  461. package/dist/next/state/batch.js.map +1 -0
  462. package/dist/next/state/derive.d.ts +52 -0
  463. package/dist/next/state/derive.d.ts.map +1 -0
  464. package/dist/next/state/derive.js +182 -0
  465. package/dist/next/state/derive.js.map +1 -0
  466. package/dist/next/state/index.d.ts +6 -0
  467. package/dist/next/state/index.d.ts.map +1 -0
  468. package/dist/next/state/index.js +4 -0
  469. package/dist/next/state/index.js.map +1 -0
  470. package/dist/next/state/internal.d.ts +6 -0
  471. package/dist/next/state/internal.d.ts.map +1 -0
  472. package/dist/next/state/internal.js +8 -0
  473. package/dist/next/state/internal.js.map +1 -0
  474. package/dist/next/state/native-source.d.ts +106 -0
  475. package/dist/next/state/native-source.d.ts.map +1 -0
  476. package/dist/next/state/native-source.js +240 -0
  477. package/dist/next/state/native-source.js.map +1 -0
  478. package/dist/next/state/watchable.d.ts +114 -0
  479. package/dist/next/state/watchable.d.ts.map +1 -0
  480. package/dist/next/state/watchable.js +156 -0
  481. package/dist/next/state/watchable.js.map +1 -0
  482. package/dist/next/state/writable.d.ts +32 -0
  483. package/dist/next/state/writable.d.ts.map +1 -0
  484. package/dist/next/state/writable.js +49 -0
  485. package/dist/next/state/writable.js.map +1 -0
  486. package/dist/next/store/adapter.d.ts +67 -0
  487. package/dist/next/store/adapter.d.ts.map +1 -0
  488. package/dist/next/store/adapter.js +118 -0
  489. package/dist/next/store/adapter.js.map +1 -0
  490. package/dist/next/store/allocator.d.ts +17 -0
  491. package/dist/next/store/allocator.d.ts.map +1 -0
  492. package/dist/next/store/allocator.js +30 -0
  493. package/dist/next/store/allocator.js.map +1 -0
  494. package/dist/next/store/applier.d.ts +8 -0
  495. package/dist/next/store/applier.d.ts.map +1 -0
  496. package/dist/next/store/applier.js +375 -0
  497. package/dist/next/store/applier.js.map +1 -0
  498. package/dist/next/store/apply-batch.d.ts +12 -0
  499. package/dist/next/store/apply-batch.d.ts.map +1 -0
  500. package/dist/next/store/apply-batch.js +83 -0
  501. package/dist/next/store/apply-batch.js.map +1 -0
  502. package/dist/next/store/archive.d.ts +32 -0
  503. package/dist/next/store/archive.d.ts.map +1 -0
  504. package/dist/next/store/archive.js +129 -0
  505. package/dist/next/store/archive.js.map +1 -0
  506. package/dist/next/store/backend.d.ts +10 -0
  507. package/dist/next/store/backend.d.ts.map +1 -0
  508. package/dist/next/store/backend.js +15 -0
  509. package/dist/next/store/backend.js.map +1 -0
  510. package/dist/next/store/catalog.d.ts +24 -0
  511. package/dist/next/store/catalog.d.ts.map +1 -0
  512. package/dist/next/store/catalog.js +17 -0
  513. package/dist/next/store/catalog.js.map +1 -0
  514. package/dist/next/store/claims.d.ts +23 -0
  515. package/dist/next/store/claims.d.ts.map +1 -0
  516. package/dist/next/store/claims.js +65 -0
  517. package/dist/next/store/claims.js.map +1 -0
  518. package/dist/next/store/columns.d.ts +77 -0
  519. package/dist/next/store/columns.d.ts.map +1 -0
  520. package/dist/next/store/columns.js +77 -0
  521. package/dist/next/store/columns.js.map +1 -0
  522. package/dist/next/store/engine.d.ts +176 -0
  523. package/dist/next/store/engine.d.ts.map +1 -0
  524. package/dist/next/store/engine.js +283 -0
  525. package/dist/next/store/engine.js.map +1 -0
  526. package/dist/next/store/evaluate.d.ts +17 -0
  527. package/dist/next/store/evaluate.d.ts.map +1 -0
  528. package/dist/next/store/evaluate.js +128 -0
  529. package/dist/next/store/evaluate.js.map +1 -0
  530. package/dist/next/store/export.d.ts +17 -0
  531. package/dist/next/store/export.d.ts.map +1 -0
  532. package/dist/next/store/export.js +200 -0
  533. package/dist/next/store/export.js.map +1 -0
  534. package/dist/next/store/expression.d.ts +150 -0
  535. package/dist/next/store/expression.d.ts.map +1 -0
  536. package/dist/next/store/expression.js +268 -0
  537. package/dist/next/store/expression.js.map +1 -0
  538. package/dist/next/store/import.d.ts +10 -0
  539. package/dist/next/store/import.d.ts.map +1 -0
  540. package/dist/next/store/import.js +276 -0
  541. package/dist/next/store/import.js.map +1 -0
  542. package/dist/next/store/index.d.ts +16 -0
  543. package/dist/next/store/index.d.ts.map +1 -0
  544. package/dist/next/store/index.js +13 -0
  545. package/dist/next/store/index.js.map +1 -0
  546. package/dist/next/store/json-column.d.ts +33 -0
  547. package/dist/next/store/json-column.d.ts.map +1 -0
  548. package/dist/next/store/json-column.js +61 -0
  549. package/dist/next/store/json-column.js.map +1 -0
  550. package/dist/next/store/jsonl.d.ts +9 -0
  551. package/dist/next/store/jsonl.d.ts.map +1 -0
  552. package/dist/next/store/jsonl.js +61 -0
  553. package/dist/next/store/jsonl.js.map +1 -0
  554. package/dist/next/store/outbox.d.ts +26 -0
  555. package/dist/next/store/outbox.d.ts.map +1 -0
  556. package/dist/next/store/outbox.js +80 -0
  557. package/dist/next/store/outbox.js.map +1 -0
  558. package/dist/next/store/query.d.ts +39 -0
  559. package/dist/next/store/query.d.ts.map +1 -0
  560. package/dist/next/store/query.js +97 -0
  561. package/dist/next/store/query.js.map +1 -0
  562. package/dist/next/store/refusal.d.ts +15 -0
  563. package/dist/next/store/refusal.d.ts.map +1 -0
  564. package/dist/next/store/refusal.js +36 -0
  565. package/dist/next/store/refusal.js.map +1 -0
  566. package/dist/next/store/rows.d.ts +80 -0
  567. package/dist/next/store/rows.d.ts.map +1 -0
  568. package/dist/next/store/rows.js +183 -0
  569. package/dist/next/store/rows.js.map +1 -0
  570. package/dist/next/store/schema.d.ts +25 -0
  571. package/dist/next/store/schema.d.ts.map +1 -0
  572. package/dist/next/store/schema.js +115 -0
  573. package/dist/next/store/schema.js.map +1 -0
  574. package/dist/next/store/sql.d.ts +73 -0
  575. package/dist/next/store/sql.d.ts.map +1 -0
  576. package/dist/next/store/sql.js +234 -0
  577. package/dist/next/store/sql.js.map +1 -0
  578. package/dist/next/store/step.d.ts +48 -0
  579. package/dist/next/store/step.d.ts.map +1 -0
  580. package/dist/next/store/step.js +50 -0
  581. package/dist/next/store/step.js.map +1 -0
  582. package/dist/next/store/store.d.ts +161 -0
  583. package/dist/next/store/store.d.ts.map +1 -0
  584. package/dist/next/store/store.js +627 -0
  585. package/dist/next/store/store.js.map +1 -0
  586. package/dist/next/store/table-changes.d.ts +29 -0
  587. package/dist/next/store/table-changes.d.ts.map +1 -0
  588. package/dist/next/store/table-changes.js +102 -0
  589. package/dist/next/store/table-changes.js.map +1 -0
  590. package/dist/next/store/table-evolve.d.ts +74 -0
  591. package/dist/next/store/table-evolve.d.ts.map +1 -0
  592. package/dist/next/store/table-evolve.js +201 -0
  593. package/dist/next/store/table-evolve.js.map +1 -0
  594. package/dist/next/store/table-handle.d.ts +67 -0
  595. package/dist/next/store/table-handle.d.ts.map +1 -0
  596. package/dist/next/store/table-handle.js +101 -0
  597. package/dist/next/store/table-handle.js.map +1 -0
  598. package/dist/next/store/table-history.d.ts +75 -0
  599. package/dist/next/store/table-history.d.ts.map +1 -0
  600. package/dist/next/store/table-history.js +42 -0
  601. package/dist/next/store/table-history.js.map +1 -0
  602. package/dist/next/store/table-migration.d.ts +16 -0
  603. package/dist/next/store/table-migration.d.ts.map +1 -0
  604. package/dist/next/store/table-migration.js +202 -0
  605. package/dist/next/store/table-migration.js.map +1 -0
  606. package/dist/next/store/table-writes.d.ts +125 -0
  607. package/dist/next/store/table-writes.d.ts.map +1 -0
  608. package/dist/next/store/table-writes.js +165 -0
  609. package/dist/next/store/table-writes.js.map +1 -0
  610. package/dist/next/store/table.d.ts +80 -0
  611. package/dist/next/store/table.d.ts.map +1 -0
  612. package/dist/next/store/table.js +103 -0
  613. package/dist/next/store/table.js.map +1 -0
  614. package/dist/next/store/text.d.ts +14 -0
  615. package/dist/next/store/text.d.ts.map +1 -0
  616. package/dist/next/store/text.js +51 -0
  617. package/dist/next/store/text.js.map +1 -0
  618. package/dist/next/store/writes.d.ts +5 -0
  619. package/dist/next/store/writes.d.ts.map +1 -0
  620. package/dist/next/store/writes.js +4 -0
  621. package/dist/next/store/writes.js.map +1 -0
  622. package/dist/next-node/compression.d.ts +7 -0
  623. package/dist/next-node/compression.d.ts.map +1 -0
  624. package/dist/next-node/compression.js +24 -0
  625. package/dist/next-node/compression.js.map +1 -0
  626. package/dist/next-node/http/admission.d.ts +63 -0
  627. package/dist/next-node/http/admission.d.ts.map +1 -0
  628. package/dist/next-node/http/admission.js +134 -0
  629. package/dist/next-node/http/admission.js.map +1 -0
  630. package/dist/next-node/http/authenticate.d.ts +21 -0
  631. package/dist/next-node/http/authenticate.d.ts.map +1 -0
  632. package/dist/next-node/http/authenticate.js +34 -0
  633. package/dist/next-node/http/authenticate.js.map +1 -0
  634. package/dist/next-node/http/cookies.d.ts +24 -0
  635. package/dist/next-node/http/cookies.d.ts.map +1 -0
  636. package/dist/next-node/http/cookies.js +62 -0
  637. package/dist/next-node/http/cookies.js.map +1 -0
  638. package/dist/next-node/http/file.d.ts +23 -0
  639. package/dist/next-node/http/file.d.ts.map +1 -0
  640. package/dist/next-node/http/file.js +94 -0
  641. package/dist/next-node/http/file.js.map +1 -0
  642. package/dist/next-node/http/headers.d.ts +37 -0
  643. package/dist/next-node/http/headers.d.ts.map +1 -0
  644. package/dist/next-node/http/headers.js +129 -0
  645. package/dist/next-node/http/headers.js.map +1 -0
  646. package/dist/next-node/http/http.d.ts +100 -0
  647. package/dist/next-node/http/http.d.ts.map +1 -0
  648. package/dist/next-node/http/http.js +462 -0
  649. package/dist/next-node/http/http.js.map +1 -0
  650. package/dist/next-node/http/incoming.d.ts +19 -0
  651. package/dist/next-node/http/incoming.d.ts.map +1 -0
  652. package/dist/next-node/http/incoming.js +31 -0
  653. package/dist/next-node/http/incoming.js.map +1 -0
  654. package/dist/next-node/http/index.d.ts +11 -0
  655. package/dist/next-node/http/index.d.ts.map +1 -0
  656. package/dist/next-node/http/index.js +12 -0
  657. package/dist/next-node/http/index.js.map +1 -0
  658. package/dist/next-node/http/node.d.ts +78 -0
  659. package/dist/next-node/http/node.d.ts.map +1 -0
  660. package/dist/next-node/http/node.js +291 -0
  661. package/dist/next-node/http/node.js.map +1 -0
  662. package/dist/next-node/http/request.d.ts +54 -0
  663. package/dist/next-node/http/request.d.ts.map +1 -0
  664. package/dist/next-node/http/request.js +116 -0
  665. package/dist/next-node/http/request.js.map +1 -0
  666. package/dist/next-node/http/response.d.ts +63 -0
  667. package/dist/next-node/http/response.d.ts.map +1 -0
  668. package/dist/next-node/http/response.js +202 -0
  669. package/dist/next-node/http/response.js.map +1 -0
  670. package/dist/next-node/http/router.d.ts +114 -0
  671. package/dist/next-node/http/router.d.ts.map +1 -0
  672. package/dist/next-node/http/router.js +261 -0
  673. package/dist/next-node/http/router.js.map +1 -0
  674. package/dist/next-node/http/upgrades.d.ts +58 -0
  675. package/dist/next-node/http/upgrades.d.ts.map +1 -0
  676. package/dist/next-node/http/upgrades.js +184 -0
  677. package/dist/next-node/http/upgrades.js.map +1 -0
  678. package/dist/next-node/plugins/build.d.ts +57 -0
  679. package/dist/next-node/plugins/build.d.ts.map +1 -0
  680. package/dist/next-node/plugins/build.js +334 -0
  681. package/dist/next-node/plugins/build.js.map +1 -0
  682. package/dist/next-node/plugins/discover.d.ts +36 -0
  683. package/dist/next-node/plugins/discover.d.ts.map +1 -0
  684. package/dist/next-node/plugins/discover.js +91 -0
  685. package/dist/next-node/plugins/discover.js.map +1 -0
  686. package/dist/next-node/plugins/evaluate.d.ts +33 -0
  687. package/dist/next-node/plugins/evaluate.d.ts.map +1 -0
  688. package/dist/next-node/plugins/evaluate.js +98 -0
  689. package/dist/next-node/plugins/evaluate.js.map +1 -0
  690. package/dist/next-node/plugins/index.d.ts +9 -0
  691. package/dist/next-node/plugins/index.d.ts.map +1 -0
  692. package/dist/next-node/plugins/index.js +11 -0
  693. package/dist/next-node/plugins/index.js.map +1 -0
  694. package/dist/next-node/plugins/install.d.ts +13 -0
  695. package/dist/next-node/plugins/install.d.ts.map +1 -0
  696. package/dist/next-node/plugins/install.js +37 -0
  697. package/dist/next-node/plugins/install.js.map +1 -0
  698. package/dist/next-node/plugins/plugins.d.ts +135 -0
  699. package/dist/next-node/plugins/plugins.d.ts.map +1 -0
  700. package/dist/next-node/plugins/plugins.js +206 -0
  701. package/dist/next-node/plugins/plugins.js.map +1 -0
  702. package/dist/next-node/plugins/runtime.d.ts +41 -0
  703. package/dist/next-node/plugins/runtime.d.ts.map +1 -0
  704. package/dist/next-node/plugins/runtime.js +136 -0
  705. package/dist/next-node/plugins/runtime.js.map +1 -0
  706. package/dist/next-node/plugins/stack.d.ts +16 -0
  707. package/dist/next-node/plugins/stack.d.ts.map +1 -0
  708. package/dist/next-node/plugins/stack.js +61 -0
  709. package/dist/next-node/plugins/stack.js.map +1 -0
  710. package/dist/next-node/plugins/watcher.d.ts +58 -0
  711. package/dist/next-node/plugins/watcher.d.ts.map +1 -0
  712. package/dist/next-node/plugins/watcher.js +281 -0
  713. package/dist/next-node/plugins/watcher.js.map +1 -0
  714. package/dist/next-node/workers/control.d.ts +83 -0
  715. package/dist/next-node/workers/control.d.ts.map +1 -0
  716. package/dist/next-node/workers/control.js +77 -0
  717. package/dist/next-node/workers/control.js.map +1 -0
  718. package/dist/next-node/workers/index.d.ts +5 -0
  719. package/dist/next-node/workers/index.d.ts.map +1 -0
  720. package/dist/next-node/workers/index.js +7 -0
  721. package/dist/next-node/workers/index.js.map +1 -0
  722. package/dist/next-node/workers/lock.d.ts +21 -0
  723. package/dist/next-node/workers/lock.d.ts.map +1 -0
  724. package/dist/next-node/workers/lock.js +137 -0
  725. package/dist/next-node/workers/lock.js.map +1 -0
  726. package/dist/next-node/workers/main.d.ts +46 -0
  727. package/dist/next-node/workers/main.d.ts.map +1 -0
  728. package/dist/next-node/workers/main.js +230 -0
  729. package/dist/next-node/workers/main.js.map +1 -0
  730. package/dist/next-node/workers/process.d.ts +42 -0
  731. package/dist/next-node/workers/process.d.ts.map +1 -0
  732. package/dist/next-node/workers/process.js +125 -0
  733. package/dist/next-node/workers/process.js.map +1 -0
  734. package/dist/next-node/workers/workers.d.ts +80 -0
  735. package/dist/next-node/workers/workers.d.ts.map +1 -0
  736. package/dist/next-node/workers/workers.js +572 -0
  737. package/dist/next-node/workers/workers.js.map +1 -0
  738. package/dist/object.d.ts +4 -4
  739. package/dist/object.d.ts.map +1 -1
  740. package/dist/object.js +3 -4
  741. package/dist/object.js.map +1 -1
  742. package/dist/output.d.ts +9 -3
  743. package/dist/output.d.ts.map +1 -1
  744. package/dist/output.js +21 -9
  745. package/dist/output.js.map +1 -1
  746. package/dist/remote.d.ts.map +1 -1
  747. package/dist/remote.js +2 -2
  748. package/dist/remote.js.map +1 -1
  749. package/dist/schema.d.ts +8 -4
  750. package/dist/schema.d.ts.map +1 -1
  751. package/dist/schema.js +180 -5
  752. package/dist/schema.js.map +1 -1
  753. package/dist/sqlite/cloudflare.d.ts +54 -0
  754. package/dist/sqlite/cloudflare.d.ts.map +1 -0
  755. package/dist/sqlite/cloudflare.js +144 -0
  756. package/dist/sqlite/cloudflare.js.map +1 -0
  757. package/dist/sqlite/database.d.ts +40 -0
  758. package/dist/sqlite/database.d.ts.map +1 -0
  759. package/dist/sqlite/database.js +2 -0
  760. package/dist/sqlite/database.js.map +1 -0
  761. package/dist/sqlite/index.d.ts +4 -0
  762. package/dist/sqlite/index.d.ts.map +1 -0
  763. package/dist/sqlite/index.js +3 -0
  764. package/dist/sqlite/index.js.map +1 -0
  765. package/dist/sqlite/migrations.d.ts +10 -0
  766. package/dist/sqlite/migrations.d.ts.map +1 -0
  767. package/dist/sqlite/migrations.js +33 -0
  768. package/dist/sqlite/migrations.js.map +1 -0
  769. package/dist/sqlite/node.d.ts +41 -0
  770. package/dist/sqlite/node.d.ts.map +1 -0
  771. package/dist/sqlite/node.js +191 -0
  772. package/dist/sqlite/node.js.map +1 -0
  773. package/dist/sqlite/schema.d.ts +3 -0
  774. package/dist/sqlite/schema.d.ts.map +1 -0
  775. package/dist/sqlite/schema.js +10 -0
  776. package/dist/sqlite/schema.js.map +1 -0
  777. package/dist/telemetry-sqlite/index.d.ts +24 -0
  778. package/dist/telemetry-sqlite/index.d.ts.map +1 -0
  779. package/dist/telemetry-sqlite/index.js +273 -0
  780. package/dist/telemetry-sqlite/index.js.map +1 -0
  781. package/dist/telemetry-sqlite/store.d.ts +9 -0
  782. package/dist/telemetry-sqlite/store.d.ts.map +1 -0
  783. package/dist/telemetry-sqlite/store.js +110 -0
  784. package/dist/telemetry-sqlite/store.js.map +1 -0
  785. package/dist/watch.d.ts +194 -0
  786. package/dist/watch.d.ts.map +1 -0
  787. package/dist/watch.js +383 -0
  788. package/dist/watch.js.map +1 -0
  789. package/dist/wire.d.ts +174 -193
  790. package/dist/wire.d.ts.map +1 -1
  791. package/dist/wire.js +81 -80
  792. package/dist/wire.js.map +1 -1
  793. package/docs/guide.md +15 -15
  794. package/docs/next/benchmarks.md +959 -0
  795. package/docs/next/decisions.md +2957 -0
  796. package/docs/next/dependencies/book.md +1671 -0
  797. package/docs/next/dependencies/index.html +2641 -0
  798. package/docs/next/dependencies/model.md +330 -0
  799. package/docs/next/design.md +2554 -0
  800. package/docs/next/durable-observers/book.md +432 -0
  801. package/docs/next/durable-observers/index.html +517 -0
  802. package/docs/next/flow-control/book.md +333 -0
  803. package/docs/next/flow-control/fold/index.html +265 -0
  804. package/docs/next/flow-control/index.html +548 -0
  805. package/docs/next/flow-control/window/index.html +228 -0
  806. package/docs/next/guide-plugins-hosts/book.md +607 -0
  807. package/docs/next/guide-plugins-hosts/index.html +652 -0
  808. package/docs/next/http-workers/book.md +378 -0
  809. package/docs/next/http-workers/index.html +515 -0
  810. package/docs/next/layer-1.md +311 -0
  811. package/docs/next/layer-2.md +216 -0
  812. package/docs/next/plugin-model/book.md +186 -0
  813. package/docs/next/plugin-model/index.html +310 -0
  814. package/docs/next/plugin-primer/book.md +273 -0
  815. package/docs/next/plugin-primer/index.html +430 -0
  816. package/docs/next/slice-1.md +236 -0
  817. package/docs/next/slice-10.md +285 -0
  818. package/docs/next/slice-11.md +93 -0
  819. package/docs/next/slice-2.md +174 -0
  820. package/docs/next/slice-3a.md +296 -0
  821. package/docs/next/slice-3b.md +197 -0
  822. package/docs/next/slice-4.md +146 -0
  823. package/docs/next/slice-4a.md +418 -0
  824. package/docs/next/slice-4b.md +208 -0
  825. package/docs/next/slice-5.md +281 -0
  826. package/docs/next/slice-6a.md +676 -0
  827. package/docs/next/slice-6b.md +332 -0
  828. package/docs/next/slice-7a.md +130 -0
  829. package/docs/next/slice-7b/book.md +608 -0
  830. package/docs/next/slice-7b/index.html +842 -0
  831. package/docs/next/slice-7b.md +255 -0
  832. package/docs/next/slice-7c.md +165 -0
  833. package/docs/next/slice-8.md +194 -0
  834. package/docs/next/slices.md +230 -0
  835. package/docs/next/store/book.md +665 -0
  836. package/docs/next/store/index.html +861 -0
  837. package/docs/next/store/walkthrough.md +193 -0
  838. package/docs/spec.md +9 -9
  839. package/docs/tutorial.md +26 -25
  840. package/package.json +42 -5
  841. package/src/delta/README.md +69 -0
@@ -0,0 +1,94 @@
1
+ import { type Batch, type NativeStart } from "../state/internal.ts";
2
+ import type { RegistryContribution } from "./contribution.ts";
3
+ import type { RegistryProvider } from "./registry.ts";
4
+ import { RegistryValueSource } from "./value.ts";
5
+ /** What a registry reports to its host's `onError`, by kind; each once per episode. */
6
+ export type RegistryError =
7
+ /** `compose` reported a conflict it resolved. */
8
+ {
9
+ readonly kind: "registry_conflict";
10
+ readonly registry: string;
11
+ readonly message: string;
12
+ readonly plugins: readonly string[];
13
+ }
14
+ /** `compose` (or an older version's `value` adapter) threw: the last good composition stays. */
15
+ | {
16
+ readonly kind: "registry_failed";
17
+ readonly registry: string;
18
+ readonly error: unknown;
19
+ }
20
+ /** A watchable contribution failed or ended, or its `contribution` adapter threw: it is left out until it heals. */
21
+ | {
22
+ readonly kind: "contribution_failed";
23
+ readonly registry: string;
24
+ readonly plugin: string;
25
+ readonly type?: string;
26
+ readonly error: unknown;
27
+ }
28
+ /** A contribution of a version the provider does not accept (newer, or older without an adapter) is left out. */
29
+ | {
30
+ readonly kind: "contribution_refused";
31
+ readonly registry: string;
32
+ readonly plugin: string;
33
+ readonly type?: string;
34
+ readonly version: number;
35
+ };
36
+ /**
37
+ * Checks a registry provider as a setup served it (declaration policy: plugin code is bundled without type checks):
38
+ * `compose` is a function.
39
+ */
40
+ export declare function checkProvider(name: string, provider: RegistryProvider<unknown, unknown>): void;
41
+ /** One registry of a host. */
42
+ export declare class RegistryRecord {
43
+ #private;
44
+ readonly name: string;
45
+ constructor(name: string, batch: Batch, report: (error: RegistryError) => void);
46
+ /** The provider's version; `undefined` while none serves it. */
47
+ get providedVersion(): number | undefined;
48
+ /** The value readers of `version` follow. */
49
+ value(version: number): RegistryValueSource;
50
+ /**
51
+ * Serves the registry with `provider` at `version` (the defining plugin's facet, checked by `checkProvider` when
52
+ * its setup ran), replacing the provider a reload changed, inside a batch: the table composes again (lazily).
53
+ */
54
+ serve(version: number, provider: RegistryProvider<unknown, unknown>): void;
55
+ /**
56
+ * A reload removed the defining plugin, inside a batch: no provider serves it; its readers' values fail
57
+ * `unavailable/undeclared` (a reader parked on it waits `not_served`), its contributions stay in the table.
58
+ */
59
+ unserve(): void;
60
+ /** The first composition of a served registry, at `load`'s publication or a reload's commit, inside its batch. */
61
+ composeServed(): void;
62
+ /** Adds a live contributor's contribution, inside a batch: the table changes. */
63
+ add(contribution: RegistryContribution): void;
64
+ /** Removes an ending contributor's contribution, inside a batch: the table changes. */
65
+ remove(contribution: RegistryContribution): void;
66
+ /** A followed contribution changed, inside a batch: the table is marked, composed when read or followed. */
67
+ contributionChanged(): void;
68
+ /**
69
+ * The current composition, composed now when the table changed: the value, or `compose`'s failure with the last
70
+ * good one; `unavailable/undeclared` while no provider serves it. A read while it composes is a cycle.
71
+ */
72
+ start(): NativeStart<unknown>;
73
+ /** The contributions the current good composition was built from; `undefined` while there is none. */
74
+ get composedFrom(): readonly RegistryContribution[] | undefined;
75
+ /**
76
+ * Whether every contribution of `from` (what a composition, or a mapping of it, was built from) is still in the
77
+ * table (decision 5: one that left may have closed the native its entry held).
78
+ */
79
+ inTable(from: readonly RegistryContribution[]): boolean;
80
+ /** The adapter mapping the composed value back for readers of `version`; `undefined` when there is none. */
81
+ valueAdapter(version: number): ((current: never) => unknown) | undefined;
82
+ /** Runs an adapter of the provider as a pure compute, counted. */
83
+ adapt<T>(adapter: () => T): T;
84
+ /** Reports a contribution left out (`contribution_failed`, `contribution_refused`; the caller keeps the episode). */
85
+ reportContribution(error: RegistryError): void;
86
+ /** Reports a throw of `compose` or of a value adapter (`registry_failed`; the caller keeps the episode). */
87
+ failed(error: unknown): void;
88
+ /**
89
+ * The host closed: the contributions stop following their sources, the values end (a value kept by a reader still
90
+ * reads the last composition).
91
+ */
92
+ close(): void;
93
+ }
94
+ //# sourceMappingURL=record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/next/registries/record.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,KAAK,EAAa,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAmD,gBAAgB,EAAiB,MAAM,eAAe,CAAC;AACtH,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,uFAAuF;AACvF,MAAM,MAAM,aAAa;AACxB,iDAAiD;AAC/C;IACA,QAAQ,CAAC,IA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AS,CAExC;IAED,6CAA6C;IAC7C,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAO1C;IAED;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,IAAI,CAIzE;IAED;;;OAGG;IACH,OAAO,IAAI,IAAI,CAKd;IAED,kHAAkH;IAClH,aAAa,IAAI,IAAI,CAGpB;IAED,iFAAiF;IACjF,GAAG,CAAC,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAM5C;IAED,uFAAuF;IACvF,MAAM,CAAC,YAAY,EAAE,oBAAoB,GAAG,IAAI,CAM/C;IAED,4GAA4G;IAC5G,mBAAmB,IAAI,IAAI,CAE1B;IAED;;;OAGG;IACH,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC,CAe5B;IAED,sGAAsG;IACtG,IAAI,YAAY,IAAI,SAAS,oBAAoB,EAAE,GAAG,SAAS,CAE9D;IAED;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,SAAS,oBAAoB,EAAE,GAAG,OAAO,CAGtD;IAED,4GAA4G;IAC5G,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,KAAK,OAAO,CAAC,GAAG,SAAS,CAEvE;IAED,kEAAkE;IAClE,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAG5B;IAED,qHAAqH;IACrH,kBAAkB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAE7C;IAED,4GAA4G;IAC5G,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE3B;IAED;;;OAGG;IACH,KAAK,IAAI,IAAI,CAOZ;CAsED"}
@@ -0,0 +1,253 @@
1
+ // A registry on a host (slice 8 §1): its provider (replaced or removed by a reload, slice 7b §3), its contributions in table order (`contribution.ts`), the table
2
+ // and its lazy composition (marked when the table changes, composed when read or followed, in the batch's
3
+ // deliveries), the reports of conflicts and failures (once per episode), and the values its readers follow by
4
+ // version.
5
+ import { ChordError } from "../data/index.js";
6
+ import { invalid } from "../data/internal.js";
7
+ import { handedOut } from "../state/internal.js";
8
+ import { RegistryValueSource } from "./value.js";
9
+ const NEVER = { good: undefined, failure: undefined };
10
+ /**
11
+ * Checks a registry provider as a setup served it (declaration policy: plugin code is bundled without type checks):
12
+ * `compose` is a function.
13
+ */
14
+ export function checkProvider(name, provider) {
15
+ if (typeof provider?.compose !== "function")
16
+ throw new Error(`registry ${name}: compose is a function`);
17
+ }
18
+ /** One registry of a host. */
19
+ export class RegistryRecord {
20
+ name;
21
+ #batch;
22
+ #report;
23
+ #provider;
24
+ /** The contributions of live contributors, sorted by plugin, then type (a facet's first). */
25
+ #contributions = [];
26
+ /** The last table composed, kept so an unchanged table composes nothing. */
27
+ #table;
28
+ #dirty = true;
29
+ #composition = NEVER;
30
+ /** Set while its table is built and composed: a read then is a cycle of registries. */
31
+ #composing = false;
32
+ /** The conflicts the last good composition reported, by key: a conflict is reported once per episode. */
33
+ #conflicts = new Set();
34
+ /** The values readers follow, by version; made by the first reader of a version. */
35
+ #values = new Map();
36
+ constructor(name, batch, report) {
37
+ this.name = name;
38
+ this.#batch = batch;
39
+ this.#report = report;
40
+ }
41
+ /** The provider's version; `undefined` while none serves it. */
42
+ get providedVersion() {
43
+ return this.#provider?.version;
44
+ }
45
+ /** The value readers of `version` follow. */
46
+ value(version) {
47
+ let value = this.#values.get(version);
48
+ if (value === undefined) {
49
+ value = new RegistryValueSource(this, version, this.#batch);
50
+ this.#values.set(version, value);
51
+ }
52
+ return value;
53
+ }
54
+ /**
55
+ * Serves the registry with `provider` at `version` (the defining plugin's facet, checked by `checkProvider` when
56
+ * its setup ran), replacing the provider a reload changed, inside a batch: the table composes again (lazily).
57
+ */
58
+ serve(version, provider) {
59
+ this.#provider = { version, provider };
60
+ this.#table = undefined;
61
+ this.#invalidate();
62
+ }
63
+ /**
64
+ * A reload removed the defining plugin, inside a batch: no provider serves it; its readers' values fail
65
+ * `unavailable/undeclared` (a reader parked on it waits `not_served`), its contributions stay in the table.
66
+ */
67
+ unserve() {
68
+ this.#provider = undefined;
69
+ this.#table = undefined;
70
+ this.#composition = NEVER;
71
+ this.#invalidate();
72
+ }
73
+ /** The first composition of a served registry, at `load`'s publication or a reload's commit, inside its batch. */
74
+ composeServed() {
75
+ if (this.#provider === undefined)
76
+ return;
77
+ this.start();
78
+ }
79
+ /** Adds a live contributor's contribution, inside a batch: the table changes. */
80
+ add(contribution) {
81
+ const at = this.#contributions.findIndex((other) => compareContributors(contribution, other) < 0);
82
+ // A new list per change (contributors come and go rarely): a composition keeps the one it was built from.
83
+ this.#contributions = this.#contributions.toSpliced(at < 0 ? this.#contributions.length : at, 0, contribution);
84
+ contribution.follow();
85
+ this.#invalidate();
86
+ }
87
+ /** Removes an ending contributor's contribution, inside a batch: the table changes. */
88
+ remove(contribution) {
89
+ const at = this.#contributions.indexOf(contribution);
90
+ if (at < 0)
91
+ return;
92
+ this.#contributions = this.#contributions.toSpliced(at, 1);
93
+ contribution.unfollow();
94
+ this.#invalidate();
95
+ }
96
+ /** A followed contribution changed, inside a batch: the table is marked, composed when read or followed. */
97
+ contributionChanged() {
98
+ this.#invalidate();
99
+ }
100
+ /**
101
+ * The current composition, composed now when the table changed: the value, or `compose`'s failure with the last
102
+ * good one; `unavailable/undeclared` while no provider serves it. A read while it composes is a cycle.
103
+ */
104
+ start() {
105
+ if (this.#composing)
106
+ throw invalid("cycle", `registry ${this.name} is read while it composes`);
107
+ if (this.#provider === undefined) {
108
+ const error = new ChordError({
109
+ code: "unavailable",
110
+ reason: "undeclared",
111
+ message: `registry ${this.name}: no plugin serves it here`,
112
+ });
113
+ return { kind: "failed", error, last: undefined };
114
+ }
115
+ if (this.#dirty)
116
+ this.#recompose(this.#provider);
117
+ const { good, failure } = this.#composition;
118
+ if (failure !== undefined)
119
+ return { kind: "failed", error: failure.error, last: good };
120
+ // A composition without a failure has a value.
121
+ return { kind: "value", value: good.value };
122
+ }
123
+ /** The contributions the current good composition was built from; `undefined` while there is none. */
124
+ get composedFrom() {
125
+ return this.#composition.good?.from;
126
+ }
127
+ /**
128
+ * Whether every contribution of `from` (what a composition, or a mapping of it, was built from) is still in the
129
+ * table (decision 5: one that left may have closed the native its entry held).
130
+ */
131
+ inTable(from) {
132
+ const current = this.#contributions;
133
+ return from === current || from.every((each) => current.includes(each));
134
+ }
135
+ /** The adapter mapping the composed value back for readers of `version`; `undefined` when there is none. */
136
+ valueAdapter(version) {
137
+ return this.#provider?.provider.accepts?.[version]?.value;
138
+ }
139
+ /** Runs an adapter of the provider as a pure compute, counted. */
140
+ adapt(adapter) {
141
+ this.#batch.count("chord.registry.adapts");
142
+ return this.#batch.compute(adapter);
143
+ }
144
+ /** Reports a contribution left out (`contribution_failed`, `contribution_refused`; the caller keeps the episode). */
145
+ reportContribution(error) {
146
+ this.#report(error);
147
+ }
148
+ /** Reports a throw of `compose` or of a value adapter (`registry_failed`; the caller keeps the episode). */
149
+ failed(error) {
150
+ this.#report({ kind: "registry_failed", registry: this.name, error: handedOut(error) });
151
+ }
152
+ /**
153
+ * The host closed: the contributions stop following their sources, the values end (a value kept by a reader still
154
+ * reads the last composition).
155
+ */
156
+ close() {
157
+ for (const contribution of this.#contributions)
158
+ contribution.unfollow();
159
+ this.#contributions = [];
160
+ this.#table = undefined;
161
+ this.#dirty = false;
162
+ for (const value of this.#values.values())
163
+ value.close();
164
+ this.#values.clear();
165
+ }
166
+ /**
167
+ * The table changed: every version's value is marked and listed (each lists itself once per batch); while it is
168
+ * not composed since an earlier change, only listed (its dependents are marked already).
169
+ */
170
+ #invalidate() {
171
+ if (this.#dirty) {
172
+ for (const value of this.#values.values())
173
+ value.relisted();
174
+ return;
175
+ }
176
+ this.#dirty = true;
177
+ for (const value of this.#values.values())
178
+ value.recomposed();
179
+ }
180
+ /**
181
+ * Builds the table and composes it, unless it is the last one composed, entry for entry (`compose` is pure). A
182
+ * throw is a failure episode: reported once, the last good composition kept while every contribution it was built
183
+ * from is still in the table (decision 5: one whose contributor ended may hold a closed native); conflicts are
184
+ * reported once per episode, as their message and plugins.
185
+ */
186
+ #recompose({ version, provider }) {
187
+ this.#dirty = false;
188
+ this.#composing = true;
189
+ try {
190
+ const table = this.#build(version, provider);
191
+ if (table === this.#table && this.#composition !== NEVER)
192
+ return;
193
+ this.#table = table;
194
+ const conflicts = new Map();
195
+ const context = {
196
+ report: (conflict) => conflicts.set(`${conflict.message}\u0000${conflict.plugins.join("\u0000")}`, conflict),
197
+ };
198
+ let value;
199
+ try {
200
+ this.#batch.count("chord.registry.composes");
201
+ value = this.#batch.compute(() => provider.compose(table, context));
202
+ }
203
+ catch (error) {
204
+ if (this.#composition.failure === undefined)
205
+ this.failed(error);
206
+ const { good } = this.#composition;
207
+ this.#composition = {
208
+ good: good !== undefined && this.inTable(good.from) ? good : undefined,
209
+ failure: { error },
210
+ };
211
+ return;
212
+ }
213
+ this.#composition = { good: { value, from: this.#contributions }, failure: undefined };
214
+ for (const [key, conflict] of conflicts) {
215
+ if (this.#conflicts.has(key))
216
+ continue;
217
+ this.#report({ kind: "registry_conflict", registry: this.name, ...conflict });
218
+ }
219
+ this.#conflicts = new Set(conflicts.keys());
220
+ }
221
+ finally {
222
+ this.#composing = false;
223
+ }
224
+ }
225
+ /** The table of the live contributions now; the last one itself when every entry is the same object. */
226
+ #build(version, provider) {
227
+ const previous = this.#table;
228
+ const table = [];
229
+ let same = previous !== undefined;
230
+ for (const contribution of this.#contributions) {
231
+ const entry = contribution.entry(version, provider);
232
+ if (entry === undefined)
233
+ continue;
234
+ if (same && previous[table.length] !== entry)
235
+ same = false;
236
+ table.push(entry);
237
+ }
238
+ return same && previous.length === table.length ? previous : table;
239
+ }
240
+ }
241
+ /** Table order: by plugin name, then type, a facet (no type) first; code point order, never load order. */
242
+ function compareContributors(a, b) {
243
+ const left = a.contributor;
244
+ const right = b.contributor;
245
+ if (left.plugin !== right.plugin)
246
+ return left.plugin < right.plugin ? -1 : 1;
247
+ const leftType = left.type ?? "";
248
+ const rightType = right.type ?? "";
249
+ if (leftType === rightType)
250
+ return 0;
251
+ return leftType < rightType ? -1 : 1;
252
+ }
253
+ //# sourceMappingURL=record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record.js","sourceRoot":"","sources":["../../../src/next/registries/record.ts"],"names":[],"mappings":"AAAA,kKAAkK;AAClK,0GAA0G;AAC1G,8GAA8G;AAC9G,WAAW;AAEX,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAc,SAAS,EAAoB,MAAM,sBAAsB,CAAC;AAG/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA0CjD,MAAM,KAAK,GAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAEnE;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,QAA4C;IACvF,IAAI,OAAO,QAAQ,EAAE,OAAO,KAAK,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,yBAAyB,CAAC,CAAC;AACzG,CAAC;AAED,8BAA8B;AAC9B,MAAM,OAAO,cAAc;IACjB,IAAI,CAAS;IACb,MAAM,CAAQ;IACd,OAAO,CAAiC;IACjD,SAAS,CAAuB;IAChC,6FAA6F;IAC7F,cAAc,GAAoC,EAAE,CAAC;IACrD,4EAA4E;IAC5E,MAAM,CAAqC;IAC3C,MAAM,GAAG,IAAI,CAAC;IACd,YAAY,GAAgB,KAAK,CAAC;IAClC,uFAAuF;IACvF,UAAU,GAAG,KAAK,CAAC;IACnB,yGAAyG;IACzG,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,oFAAoF;IAC3E,OAAO,GAAG,IAAI,GAAG,EAA+B,CAAC;IAE1D,YAAY,IAAY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,MAAM,KAAK,GAAG,CAAC,CAAC,WAAW,CAAC;IAC5B,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;IACjC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;IACnC,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,CAAC,CAAC;IACrC,OAAO,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// A registry on a host (slice 8 §1): its provider (replaced or removed by a reload, slice 7b §3), its contributions in table order (`contribution.ts`), the table\n// and its lazy composition (marked when the table changes, composed when read or followed, in the batch's\n// deliveries), the reports of conflicts and failures (once per episode), and the values its readers follow by\n// version.\n\nimport { ChordError } from \"../data/index.ts\";\nimport { invalid } from \"../data/internal.ts\";\nimport { type Batch, handedOut, type NativeStart } from \"../state/internal.ts\";\nimport type { RegistryContribution } from \"./contribution.ts\";\nimport type { ComposeContext, RegistryConflict, RegistryEntry, RegistryProvider, RegistryTable } from \"./registry.ts\";\nimport { RegistryValueSource } from \"./value.ts\";\n\n/** What a registry reports to its host's `onError`, by kind; each once per episode. */\nexport type RegistryError =\n\t/** `compose` reported a conflict it resolved. */\n\t| {\n\t\t\treadonly kind: \"registry_conflict\";\n\t\t\treadonly registry: string;\n\t\t\treadonly message: string;\n\t\t\treadonly plugins: readonly string[];\n\t }\n\t/** `compose` (or an older version's `value` adapter) threw: the last good composition stays. */\n\t| { readonly kind: \"registry_failed\"; readonly registry: string; readonly error: unknown }\n\t/** A watchable contribution failed or ended, or its `contribution` adapter threw: it is left out until it heals. */\n\t| {\n\t\t\treadonly kind: \"contribution_failed\";\n\t\t\treadonly registry: string;\n\t\t\treadonly plugin: string;\n\t\t\treadonly type?: string;\n\t\t\treadonly error: unknown;\n\t }\n\t/** A contribution of a version the provider does not accept (newer, or older without an adapter) is left out. */\n\t| {\n\t\t\treadonly kind: \"contribution_refused\";\n\t\t\treadonly registry: string;\n\t\t\treadonly plugin: string;\n\t\t\treadonly type?: string;\n\t\t\treadonly version: number;\n\t };\n\n/** The provider as served: the defining plugin's version, `compose` and adapters. */\ntype Provider = { readonly version: number; readonly provider: RegistryProvider<unknown, unknown> };\n\n/**\n * Where a composition stands: never composed, its last good value (with the contributions it was built from), and its\n * failure while `compose` throws.\n */\ntype Composition = {\n\treadonly good: { readonly value: unknown; readonly from: readonly RegistryContribution[] } | undefined;\n\treadonly failure: { readonly error: unknown } | undefined;\n};\n\nconst NEVER: Composition = { good: undefined, failure: undefined };\n\n/**\n * Checks a registry provider as a setup served it (declaration policy: plugin code is bundled without type checks):\n * `compose` is a function.\n */\nexport function checkProvider(name: string, provider: RegistryProvider<unknown, unknown>): void {\n\tif (typeof provider?.compose !== \"function\") throw new Error(`registry ${name}: compose is a function`);\n}\n\n/** One registry of a host. */\nexport class RegistryRecord {\n\treadonly name: string;\n\treadonly #batch: Batch;\n\treadonly #report: (error: RegistryError) => void;\n\t#provider: Provider | undefined;\n\t/** The contributions of live contributors, sorted by plugin, then type (a facet's first). */\n\t#contributions: readonly RegistryContribution[] = [];\n\t/** The last table composed, kept so an unchanged table composes nothing. */\n\t#table: RegistryTable<unknown> | undefined;\n\t#dirty = true;\n\t#composition: Composition = NEVER;\n\t/** Set while its table is built and composed: a read then is a cycle of registries. */\n\t#composing = false;\n\t/** The conflicts the last good composition reported, by key: a conflict is reported once per episode. */\n\t#conflicts = new Set<string>();\n\t/** The values readers follow, by version; made by the first reader of a version. */\n\treadonly #values = new Map<number, RegistryValueSource>();\n\n\tconstructor(name: string, batch: Batch, report: (error: RegistryError) => void) {\n\t\tthis.name = name;\n\t\tthis.#batch = batch;\n\t\tthis.#report = report;\n\t}\n\n\t/** The provider's version; `undefined` while none serves it. */\n\tget providedVersion(): number | undefined {\n\t\treturn this.#provider?.version;\n\t}\n\n\t/** The value readers of `version` follow. */\n\tvalue(version: number): RegistryValueSource {\n\t\tlet value = this.#values.get(version);\n\t\tif (value === undefined) {\n\t\t\tvalue = new RegistryValueSource(this, version, this.#batch);\n\t\t\tthis.#values.set(version, value);\n\t\t}\n\t\treturn value;\n\t}\n\n\t/**\n\t * Serves the registry with `provider` at `version` (the defining plugin's facet, checked by `checkProvider` when\n\t * its setup ran), replacing the provider a reload changed, inside a batch: the table composes again (lazily).\n\t */\n\tserve(version: number, provider: RegistryProvider<unknown, unknown>): void {\n\t\tthis.#provider = { version, provider };\n\t\tthis.#table = undefined;\n\t\tthis.#invalidate();\n\t}\n\n\t/**\n\t * A reload removed the defining plugin, inside a batch: no provider serves it; its readers' values fail\n\t * `unavailable/undeclared` (a reader parked on it waits `not_served`), its contributions stay in the table.\n\t */\n\tunserve(): void {\n\t\tthis.#provider = undefined;\n\t\tthis.#table = undefined;\n\t\tthis.#composition = NEVER;\n\t\tthis.#invalidate();\n\t}\n\n\t/** The first composition of a served registry, at `load`'s publication or a reload's commit, inside its batch. */\n\tcomposeServed(): void {\n\t\tif (this.#provider === undefined) return;\n\t\tthis.start();\n\t}\n\n\t/** Adds a live contributor's contribution, inside a batch: the table changes. */\n\tadd(contribution: RegistryContribution): void {\n\t\tconst at = this.#contributions.findIndex((other) => compareContributors(contribution, other) < 0);\n\t\t// A new list per change (contributors come and go rarely): a composition keeps the one it was built from.\n\t\tthis.#contributions = this.#contributions.toSpliced(at < 0 ? this.#contributions.length : at, 0, contribution);\n\t\tcontribution.follow();\n\t\tthis.#invalidate();\n\t}\n\n\t/** Removes an ending contributor's contribution, inside a batch: the table changes. */\n\tremove(contribution: RegistryContribution): void {\n\t\tconst at = this.#contributions.indexOf(contribution);\n\t\tif (at < 0) return;\n\t\tthis.#contributions = this.#contributions.toSpliced(at, 1);\n\t\tcontribution.unfollow();\n\t\tthis.#invalidate();\n\t}\n\n\t/** A followed contribution changed, inside a batch: the table is marked, composed when read or followed. */\n\tcontributionChanged(): void {\n\t\tthis.#invalidate();\n\t}\n\n\t/**\n\t * The current composition, composed now when the table changed: the value, or `compose`'s failure with the last\n\t * good one; `unavailable/undeclared` while no provider serves it. A read while it composes is a cycle.\n\t */\n\tstart(): NativeStart<unknown> {\n\t\tif (this.#composing) throw invalid(\"cycle\", `registry ${this.name} is read while it composes`);\n\t\tif (this.#provider === undefined) {\n\t\t\tconst error = new ChordError({\n\t\t\t\tcode: \"unavailable\",\n\t\t\t\treason: \"undeclared\",\n\t\t\t\tmessage: `registry ${this.name}: no plugin serves it here`,\n\t\t\t});\n\t\t\treturn { kind: \"failed\", error, last: undefined };\n\t\t}\n\t\tif (this.#dirty) this.#recompose(this.#provider);\n\t\tconst { good, failure } = this.#composition;\n\t\tif (failure !== undefined) return { kind: \"failed\", error: failure.error, last: good };\n\t\t// A composition without a failure has a value.\n\t\treturn { kind: \"value\", value: good!.value };\n\t}\n\n\t/** The contributions the current good composition was built from; `undefined` while there is none. */\n\tget composedFrom(): readonly RegistryContribution[] | undefined {\n\t\treturn this.#composition.good?.from;\n\t}\n\n\t/**\n\t * Whether every contribution of `from` (what a composition, or a mapping of it, was built from) is still in the\n\t * table (decision 5: one that left may have closed the native its entry held).\n\t */\n\tinTable(from: readonly RegistryContribution[]): boolean {\n\t\tconst current = this.#contributions;\n\t\treturn from === current || from.every((each) => current.includes(each));\n\t}\n\n\t/** The adapter mapping the composed value back for readers of `version`; `undefined` when there is none. */\n\tvalueAdapter(version: number): ((current: never) => unknown) | undefined {\n\t\treturn this.#provider?.provider.accepts?.[version]?.value;\n\t}\n\n\t/** Runs an adapter of the provider as a pure compute, counted. */\n\tadapt<T>(adapter: () => T): T {\n\t\tthis.#batch.count(\"chord.registry.adapts\");\n\t\treturn this.#batch.compute(adapter);\n\t}\n\n\t/** Reports a contribution left out (`contribution_failed`, `contribution_refused`; the caller keeps the episode). */\n\treportContribution(error: RegistryError): void {\n\t\tthis.#report(error);\n\t}\n\n\t/** Reports a throw of `compose` or of a value adapter (`registry_failed`; the caller keeps the episode). */\n\tfailed(error: unknown): void {\n\t\tthis.#report({ kind: \"registry_failed\", registry: this.name, error: handedOut(error) });\n\t}\n\n\t/**\n\t * The host closed: the contributions stop following their sources, the values end (a value kept by a reader still\n\t * reads the last composition).\n\t */\n\tclose(): void {\n\t\tfor (const contribution of this.#contributions) contribution.unfollow();\n\t\tthis.#contributions = [];\n\t\tthis.#table = undefined;\n\t\tthis.#dirty = false;\n\t\tfor (const value of this.#values.values()) value.close();\n\t\tthis.#values.clear();\n\t}\n\n\t/**\n\t * The table changed: every version's value is marked and listed (each lists itself once per batch); while it is\n\t * not composed since an earlier change, only listed (its dependents are marked already).\n\t */\n\t#invalidate(): void {\n\t\tif (this.#dirty) {\n\t\t\tfor (const value of this.#values.values()) value.relisted();\n\t\t\treturn;\n\t\t}\n\t\tthis.#dirty = true;\n\t\tfor (const value of this.#values.values()) value.recomposed();\n\t}\n\n\t/**\n\t * Builds the table and composes it, unless it is the last one composed, entry for entry (`compose` is pure). A\n\t * throw is a failure episode: reported once, the last good composition kept while every contribution it was built\n\t * from is still in the table (decision 5: one whose contributor ended may hold a closed native); conflicts are\n\t * reported once per episode, as their message and plugins.\n\t */\n\t#recompose({ version, provider }: Provider): void {\n\t\tthis.#dirty = false;\n\t\tthis.#composing = true;\n\t\ttry {\n\t\t\tconst table = this.#build(version, provider);\n\t\t\tif (table === this.#table && this.#composition !== NEVER) return;\n\t\t\tthis.#table = table;\n\t\t\tconst conflicts = new Map<string, RegistryConflict>();\n\t\t\tconst context: ComposeContext = {\n\t\t\t\treport: (conflict) =>\n\t\t\t\t\tconflicts.set(`${conflict.message}\\u0000${conflict.plugins.join(\"\\u0000\")}`, conflict),\n\t\t\t};\n\t\t\tlet value: unknown;\n\t\t\ttry {\n\t\t\t\tthis.#batch.count(\"chord.registry.composes\");\n\t\t\t\tvalue = this.#batch.compute(() => provider.compose(table, context));\n\t\t\t} catch (error) {\n\t\t\t\tif (this.#composition.failure === undefined) this.failed(error);\n\t\t\t\tconst { good } = this.#composition;\n\t\t\t\tthis.#composition = {\n\t\t\t\t\tgood: good !== undefined && this.inTable(good.from) ? good : undefined,\n\t\t\t\t\tfailure: { error },\n\t\t\t\t};\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#composition = { good: { value, from: this.#contributions }, failure: undefined };\n\t\t\tfor (const [key, conflict] of conflicts) {\n\t\t\t\tif (this.#conflicts.has(key)) continue;\n\t\t\t\tthis.#report({ kind: \"registry_conflict\", registry: this.name, ...conflict });\n\t\t\t}\n\t\t\tthis.#conflicts = new Set(conflicts.keys());\n\t\t} finally {\n\t\t\tthis.#composing = false;\n\t\t}\n\t}\n\n\t/** The table of the live contributions now; the last one itself when every entry is the same object. */\n\t#build(version: number, provider: RegistryProvider<unknown, unknown>): RegistryTable<unknown> {\n\t\tconst previous = this.#table;\n\t\tconst table: RegistryEntry<unknown>[] = [];\n\t\tlet same = previous !== undefined;\n\t\tfor (const contribution of this.#contributions) {\n\t\t\tconst entry = contribution.entry(version, provider);\n\t\t\tif (entry === undefined) continue;\n\t\t\tif (same && previous![table.length] !== entry) same = false;\n\t\t\ttable.push(entry);\n\t\t}\n\t\treturn same && previous!.length === table.length ? previous! : table;\n\t}\n}\n\n/** Table order: by plugin name, then type, a facet (no type) first; code point order, never load order. */\nfunction compareContributors(a: RegistryContribution, b: RegistryContribution): number {\n\tconst left = a.contributor;\n\tconst right = b.contributor;\n\tif (left.plugin !== right.plugin) return left.plugin < right.plugin ? -1 : 1;\n\tconst leftType = left.type ?? \"\";\n\tconst rightType = right.type ?? \"\";\n\tif (leftType === rightType) return 0;\n\treturn leftType < rightType ? -1 : 1;\n}\n"]}
@@ -0,0 +1,74 @@
1
+ import type { Context } from "../../context/index.ts";
2
+ import type { NativeWatchable, Watchable } from "../../watch.ts";
3
+ import type { NativeObservation, NativeObserver } from "../state/index.ts";
4
+ /**
5
+ * A registry token: its name (as type names, `[a-z0-9@/._~-]`), the version the bundling plugin was built against, the
6
+ * contribution type `C` and the composed value type `V`. Shared: every contributor and reader bundles its own copy.
7
+ */
8
+ export type Registry<C, V> = {
9
+ readonly kind: "registry";
10
+ readonly name: string;
11
+ readonly version: number;
12
+ /** Type only: `C` in, `V` out. */
13
+ readonly "~types"?: (contribution: C) => V;
14
+ };
15
+ /** One contribution in a registry's table: its plugin, its object type for an object contributor, its version. */
16
+ export type RegistryEntry<C> = {
17
+ readonly plugin: string;
18
+ /** The contributing object's type; absent for a facet. */
19
+ readonly type?: string;
20
+ /** The registry version its contributor was built against (an older one adapted to `C`). */
21
+ readonly version: number;
22
+ readonly value: C;
23
+ };
24
+ /** A registry's table: one entry per live contributor, sorted by plugin name, then type (a facet's first). */
25
+ export type RegistryTable<C> = readonly RegistryEntry<C>[];
26
+ /** A conflict `compose` resolved with its fallback: reported as `registry_conflict`, once per conflict episode. */
27
+ export type RegistryConflict = {
28
+ readonly message: string;
29
+ readonly plugins: readonly string[];
30
+ };
31
+ /** What `compose` gets besides the table. */
32
+ export type ComposeContext = {
33
+ /** Reports a conflict `compose` resolved (the first by plugin name wins, for example). */
34
+ report(conflict: RegistryConflict): void;
35
+ };
36
+ /**
37
+ * Adapters of older versions, by version, the provider's code: `contribution` maps an older contribution to `C` (once
38
+ * per contribution value), `value` maps the composed value back for a reader of that version (once per composition).
39
+ * A plugin annotates the old contribution's type (`(old: HttpV1) => upgrade(old)`).
40
+ */
41
+ export type RegistryAccepts<C, V> = {
42
+ readonly [version: number]: {
43
+ readonly contribution?: (old: never) => C;
44
+ readonly value?: (current: V) => unknown;
45
+ };
46
+ };
47
+ /** What the defining plugin's facet serves a registry with (`host.serve(R, provider)`). */
48
+ export type RegistryProvider<C, V> = {
49
+ /**
50
+ * Composes the table: pure and synchronous, always a value (a fallback built in), conflicts reported. Runs when the
51
+ * table changed and someone reads or follows the value; a throw is the owner's bug (`registry_failed`, the last
52
+ * good composition stays).
53
+ */
54
+ readonly compose: (table: RegistryTable<C>, context: ComposeContext) => V;
55
+ readonly accepts?: RegistryAccepts<C, V>;
56
+ };
57
+ /** What a contributor contributes: a plain value, or a Chord watchable of one (followed: its change recomposes). */
58
+ export type Contribution<C> = C | Watchable<C> | NativeWatchable<C>;
59
+ /**
60
+ * A registry's composed value as a reader of one version sees it (`self.registry`, `host.registry`): a native
61
+ * watchable; `.value` is the last good composition (a later throwing `compose` keeps it), a watch gets each new one.
62
+ */
63
+ export interface RegistryValue<V> extends NativeWatchable<V> {
64
+ /**
65
+ * A synchronous observer of its compositions (as Durable's `observeXXX`): `advance` runs inside the batch that
66
+ * composed, so it only records; an attached observer counts as watching, so the composition runs for it.
67
+ */
68
+ observe(observer: NativeObserver<V>, context: Context): NativeObservation<V>;
69
+ }
70
+ /** Declares a registry token: `name` and the `version` this plugin is built against. */
71
+ export declare function defineRegistry<C, V>(name: string, options: {
72
+ readonly version: number;
73
+ }): Registry<C, V>;
74
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/next/registries/registry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE3E;;;GAGG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI;IAC5B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,kCAAkC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,YAAY,EAA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AAO,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACzC,CAAC;AAEF,oHAAoH;AACpH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IAC3D;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;CAC7E;AAED,wFAAwF;AACxF,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAMxG"}
@@ -0,0 +1,14 @@
1
+ // Registry tokens (design §17, slice 8 D1): `defineRegistry`, shared by every plugin as a contract is (identity and
2
+ // types only), and what the defining plugin's facet serves it with (`compose`, `accepts`); the table `compose` gets and
3
+ // the composed value readers follow.
4
+ import { checkName } from "../contracts/names.js";
5
+ /** Declares a registry token: `name` and the `version` this plugin is built against. */
6
+ export function defineRegistry(name, options) {
7
+ checkName(name, "registry");
8
+ const { version } = options;
9
+ // Declaration policy: JavaScript callers reach this check.
10
+ if (!Number.isSafeInteger(version) || version < 1)
11
+ throw new Error(`${name}.version: expected a positive integer`);
12
+ return { kind: "registry", name, version };
13
+ }
14
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/next/registries/registry.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,wHAAwH;AACxH,qCAAqC;AAIrC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AA2ElD,wFAAwF;AACxF,MAAM,UAAU,cAAc,CAAO,IAAY,EAAE,OAAqC;IACvF,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC5B,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5B,2DAA2D;IAC3D,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,uCAAuC,CAAC,CAAC;IACnH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC5C,CAAC","sourcesContent":["// Registry tokens (design §17, slice 8 D1): `defineRegistry`, shared by every plugin as a contract is (identity and\n// types only), and what the defining plugin's facet serves it with (`compose`, `accepts`); the table `compose` gets and\n// the composed value readers follow.\n\nimport type { Context } from \"../../context/index.ts\";\nimport type { NativeWatchable, Watchable } from \"../../watch.ts\";\nimport { checkName } from \"../contracts/names.ts\";\nimport type { NativeObservation, NativeObserver } from \"../state/index.ts\";\n\n/**\n * A registry token: its name (as type names, `[a-z0-9@/._~-]`), the version the bundling plugin was built against, the\n * contribution type `C` and the composed value type `V`. Shared: every contributor and reader bundles its own copy.\n */\nexport type Registry<C, V> = {\n\treadonly kind: \"registry\";\n\treadonly name: string;\n\treadonly version: number;\n\t/** Type only: `C` in, `V` out. */\n\treadonly \"~types\"?: (contribution: C) => V;\n};\n\n/** One contribution in a registry's table: its plugin, its object type for an object contributor, its version. */\nexport type RegistryEntry<C> = {\n\treadonly plugin: string;\n\t/** The contributing object's type; absent for a facet. */\n\treadonly type?: string;\n\t/** The registry version its contributor was built against (an older one adapted to `C`). */\n\treadonly version: number;\n\treadonly value: C;\n};\n\n/** A registry's table: one entry per live contributor, sorted by plugin name, then type (a facet's first). */\nexport type RegistryTable<C> = readonly RegistryEntry<C>[];\n\n/** A conflict `compose` resolved with its fallback: reported as `registry_conflict`, once per conflict episode. */\nexport type RegistryConflict = { readonly message: string; readonly plugins: readonly string[] };\n\n/** What `compose` gets besides the table. */\nexport type ComposeContext = {\n\t/** Reports a conflict `compose` resolved (the first by plugin name wins, for example). */\n\treport(conflict: RegistryConflict): void;\n};\n\n/**\n * Adapters of older versions, by version, the provider's code: `contribution` maps an older contribution to `C` (once\n * per contribution value), `value` maps the composed value back for a reader of that version (once per composition).\n * A plugin annotates the old contribution's type (`(old: HttpV1) => upgrade(old)`).\n */\nexport type RegistryAccepts<C, V> = {\n\treadonly [version: number]: {\n\t\treadonly contribution?: (old: never) => C;\n\t\treadonly value?: (current: V) => unknown;\n\t};\n};\n\n/** What the defining plugin's facet serves a registry with (`host.serve(R, provider)`). */\nexport type RegistryProvider<C, V> = {\n\t/**\n\t * Composes the table: pure and synchronous, always a value (a fallback built in), conflicts reported. Runs when the\n\t * table changed and someone reads or follows the value; a throw is the owner's bug (`registry_failed`, the last\n\t * good composition stays).\n\t */\n\treadonly compose: (table: RegistryTable<C>, context: ComposeContext) => V;\n\treadonly accepts?: RegistryAccepts<C, V>;\n};\n\n/** What a contributor contributes: a plain value, or a Chord watchable of one (followed: its change recomposes). */\nexport type Contribution<C> = C | Watchable<C> | NativeWatchable<C>;\n\n/**\n * A registry's composed value as a reader of one version sees it (`self.registry`, `host.registry`): a native\n * watchable; `.value` is the last good composition (a later throwing `compose` keeps it), a watch gets each new one.\n */\nexport interface RegistryValue<V> extends NativeWatchable<V> {\n\t/**\n\t * A synchronous observer of its compositions (as Durable's `observeXXX`): `advance` runs inside the batch that\n\t * composed, so it only records; an attached observer counts as watching, so the composition runs for it.\n\t */\n\tobserve(observer: NativeObserver<V>, context: Context): NativeObservation<V>;\n}\n\n/** Declares a registry token: `name` and the `version` this plugin is built against. */\nexport function defineRegistry<C, V>(name: string, options: { readonly version: number }): Registry<C, V> {\n\tcheckName(name, \"registry\");\n\tconst { version } = options;\n\t// Declaration policy: JavaScript callers reach this check.\n\tif (!Number.isSafeInteger(version) || version < 1) throw new Error(`${name}.version: expected a positive integer`);\n\treturn { kind: \"registry\", name, version };\n}\n"]}
@@ -0,0 +1,48 @@
1
+ import { ChordError } from "../data/index.ts";
2
+ import { type Batch, FollowedSource, type NativeStart } from "../state/internal.ts";
3
+ import type { RegistryRecord } from "./record.ts";
4
+ /** Who waits for a registry's value (a parked attempt, a `host.registry`): told when it may have changed. */
5
+ export interface RegistryWaiter {
6
+ /** The value may have changed (inside its batch: it only records). */
7
+ dependencyMoved(): void;
8
+ /** The value closed with its host: the wait ends with `error` (`released/closed`). */
9
+ closed(error: ChordError): void;
10
+ }
11
+ /** One version's view of a registry's composed value. */
12
+ export declare class RegistryValueSource extends FollowedSource<unknown> {
13
+ #private;
14
+ readonly name: string;
15
+ readonly version: number;
16
+ constructor(record: RegistryRecord, version: number, batch: Batch);
17
+ /** The composition (or its mapping) at its last good value; throws the failure when there is none. */
18
+ get value(): unknown;
19
+ /**
20
+ * Its composition (mapped for an older version), composed now if its table changed; a change of whether it is
21
+ * usable, or of its failure while it is not, wakes its waiters.
22
+ */
23
+ start(): NativeStart<unknown>;
24
+ /** Its composition (or mapping) now; throws while it is failed, though `.value` keeps the last good one. */
25
+ current(): unknown;
26
+ /** Followed while someone watches or observes it, and while waiters wait on it. */
27
+ get watched(): boolean;
28
+ /** Registers a reader (an attempt that declared it) until the returned release: its mapping is kept meanwhile. */
29
+ read(): () => void;
30
+ /**
31
+ * Registers `waiter` (a parked attempt's object, a waiting `host.registry`) until the returned release: it is told
32
+ * of every change of whether this value is usable (inside the batch that made it: it only records).
33
+ */
34
+ wait(waiter: RegistryWaiter): () => void;
35
+ /** The registry's table changed (inside a batch): its dependents are marked, its followers get the next frame. */
36
+ recomposed(): void;
37
+ /**
38
+ * The registry's table changed again while not composed since (inside a batch): its dependents are marked already
39
+ * (none read it meanwhile, or it would be composed); its followers get the next frame. Marking stops here, so a
40
+ * cycle of registries through their values ends.
41
+ */
42
+ relisted(): void;
43
+ /** The host closed: its watches and observers end, its readers and mapping go; it keeps its last start only. */
44
+ close(): void;
45
+ /** Nobody follows it: without readers, its mapping goes (computed again on the next read). */
46
+ protected unfollowed(): void;
47
+ }
48
+ //# sourceMappingURL=value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../../src/next/registries/value.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAgB,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,KAAK,KAAK,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,6GAA6G;AAC7G,MAAM,WAAW,cAAc;IAC9B,sEAAsE;IACtE,eAAe,IAAI,IAAI,CAAC;IACxB,sFAAsF;IACtF,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CAChC;AAiCD,yDAAyD;AACzD,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,OAAO,CAAC;;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAczB,YAAY,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAKhE;IAED,sGAAsG;IACtG,IAAI,KAAK,IAAI,OAAO,CAKnB;IAED;;;OAGG;IACM,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC,CAMrC;IAED,4GAA4G;IACnG,OAAO,IAAI,OAAO,CAI1B;IAED,mFAAmF;IACnF,IAAa,OAAO,IAAI,OAAO,CAE9B;IAED,kHAAkH;IAClH,IAAI,IAAI,MAAM,IAAI,CAOjB;IAED;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,CAQvC;IAED,kHAAkH;IAClH,UAAU,IAAI,IAAI,CAEjB;IAED;;;;OAIG;IACH,QAAQ,IAAI,IAAI,CAEf;IAED,g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