@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,608 @@
1
+ ---
2
+ title: Slice 7b: reloading plugins in a running Chord app
3
+ cover: Slice 7b / Reload
4
+ kicker: A design brief · Chord v2 · slice 7b · 2026-10-29
5
+ subtitle: What a plugin is, how it is built and loaded, how a mini p2 is assembled from Chord, and what happens when a plugin's code changes on one host or across many
6
+ stats:
7
+ - 4 | steps of a reload on one host
8
+ - 3 | fates of a live object
9
+ - 26 | carry-over items from slices 3a to 7a
10
+ - 11 ms | to rebuild one facet after an edit
11
+ - 6 | decisions open
12
+ note: |
13
+ A brief before the slice 7b spec, written by the redesign session from `design.md` §21, the dependency model
14
+ (`dependencies/model.md`, decided and built for 7a in pi `339847eb1`), the carry-over in `slices.md` and the code at
15
+ `339847eb1`. Marks: **Decided** points cite the decision; **Open** points are the owner's, with a recommendation.
16
+ colophon: Slice 7b brief · 2026-10-29 · Chord v2
17
+ ---
18
+
19
+ # Before we begin {.preface}
20
+
21
+ Mario edits the notes plugin while a session is open: a new method, a renamed field in a document, a second state
22
+ member. He presses Reload. The server, the session's worker and two browser tabs run the old notes code; within a
23
+ second they should all run the new one, with the notes, the open views and the running export job intact, and without
24
+ restarting a single process.
25
+
26
+ Chord v2 can do everything around that today: objects, references across hosts, the store, jobs, registries, and since
27
+ 7a a dependency model in which a missing provider is a wait, not an error. What it cannot do yet is change code. `load`
28
+ runs once per host (`host.ts`: "load runs once per host"). Slice 7b adds the reload, on one host and across hosts.
29
+
30
+ ## Eight things to know
31
+
32
+ :::findings
33
+ 1. **A reload is a transaction per host.** Load the bundles, stage the new declarations, commit atomically, then let
34
+ each object follow; any code error before the commit leaves the host entirely on its old code.
35
+ 2. **A live object has three fates.** Pure objects swap in place; objects with natives drain and restart; objects of a
36
+ removed type end, and their holders wait.
37
+ 3. **Old calls finish on old code.** A pure swap keeps the running calls' old handles valid until they settle; only new
38
+ calls see the new code.
39
+ 4. **Versions are the provider's business.** A provider accepts older consumers through `accepts`; a consumer that does
40
+ not fit waits (7a), it is not ended.
41
+ 5. **7a already decided most of the hard part.** Removal, dropped versions and installs are waits woken by a
42
+ publication; a reload's commit is such a publication.
43
+ 6. **A plugin is a directory with a `package.json` and one file per surface.** Each facet is bundled alone; host
44
+ packages are passed in, never copied; a whole plugin set builds in a few hundred milliseconds.
45
+ 7. **Chord should ship the app kit** (proposed): loader, HTTP, workers, web, TUI and dev reload as optional
46
+ components, so a mini p2 is a page of code.
47
+ 8. **Six points are open:** the reload API, the rollout across hosts, a `writable` across a swap, the install
48
+ watchdog, where the loader lives, and the app kit.
49
+ :::
50
+
51
+ ## Words used throughout
52
+
53
+ A **reload** changes the code of one or more plugins on one host. A **facet** is a plugin's code for one host kind; a
54
+ **bundle** is the built JavaScript of a facet. **Staging** runs the new facets and factories against a recording
55
+ `self` without activating anything. The **commit** switches the host to the new code at once and is a **publication**
56
+ in 7a's sense. A **pure** object has no natives (`self.open`), in its old or its new code. A **rollout** is a reload
57
+ of the same code set on every host, server first.
58
+
59
+ # A Plugin, File by File {#plugin lede="What a plugin looks like on disk, and what each file is for."}
60
+
61
+ A plugin is a directory. Its name is its `package.json` name; its code is one file per host kind it runs on, a
62
+ **facet**; everything else is ordinary TypeScript the facets import. This is p2's layout today (`apps/p2/plugins/*`),
63
+ plus the `package.json` that loader D needs (p2's `plugin-loading.md` §8; p2's built-in plugins have none yet and are
64
+ named by their directory).
65
+
66
+ ```text
67
+ plugins/notes/
68
+ package.json name = the plugin's name; peerDependencies = host packages; dependencies = bundled npm deps
69
+ contract.ts the plugin's object types and registries (shared by its facets and by other plugins)
70
+ server.ts facet for the server (default export: defineFacet(...))
71
+ worker.ts facet for session workers
72
+ web.tsx facet for browser tabs
73
+ tui.ts facet for the TUI
74
+ store.ts plain modules the facets import
75
+ NoteList.tsx
76
+ notes.css
77
+ assets/
78
+ template.md files the plugin ships (read at runtime, or offered for download)
79
+ icon.svg
80
+ skills/notes/SKILL.md optional resources (p2 §4.4)
81
+ ```
82
+
83
+ ```json
84
+ {
85
+ "name": "@pi/notes",
86
+ "version": "1.4.0",
87
+ "type": "module",
88
+ "peerDependencies": {
89
+ "@earendil-works/chord": "^2",
90
+ "@earendil-works/pi-durable": "^1",
91
+ "react": "^19"
92
+ },
93
+ "dependencies": {
94
+ "marked": "16.4.1"
95
+ }
96
+ }
97
+ ```
98
+
99
+ - **`name`** identifies the plugin everywhere: its facets, its registry contributions, diagnostics, reloads.
100
+ - **`peerDependencies`** are **host packages**: the running app supplies them, one instance per process (one Chord,
101
+ one React; `instanceof ChordError` and React hooks only work that way). The bundler never copies them.
102
+ - **`dependencies`** are the plugin's own npm packages (`marked`): installed into the plugin's `node_modules` with
103
+ `--ignore-scripts` and bundled into every facet that imports them. **Decided** (owner, 2026-10-29): bundled by
104
+ default; on Node a plugin may keep named packages external by an explicit list, `"chord": { "external":
105
+ ["better-sqlite3"] }`. Server and worker facets then load them from the plugin's `node_modules` with `createRequire`,
106
+ as pi 1.0 loads extension dependencies, native addons included; they stay in Node's module cache until the process
107
+ ends, so a new version takes effect after a restart. A browser or TUI facet that imports one fails to build.
108
+ - **No `tsconfig.json` is needed.** The bundler strips types and does not type-check; JSX is compiled with the
109
+ automatic React runtime, a fixed setting of the loader. A plugin may keep a `tsconfig.json` for its editor and for
110
+ `tsc --noEmit` (the SDK ships one to extend); the loader ignores it.
111
+
112
+ A facet only declares (chapter III of the model): it serves object types, serves or contributes to registries, and
113
+ returns nothing.
114
+
115
+ ```ts
116
+ // plugins/notes/contract.ts
117
+ import { defineRegistry, local, remote, str, obj, arr, method } from "@earendil-works/chord/next";
118
+ import { Session } from "@app/core"; // the app's host kinds, a host package
119
+ export const NoteStore = local("notes.store", { version: 1, params: {}, members: { /* … */ } });
120
+ export const Notes = remote("notes", {
121
+ version: 2,
122
+ params: { session: str() },
123
+ hostAddress: ({ session }) => Session({ id: session }),
124
+ variants: { editor: { state: { list: arr(obj({ id: str(), text: str() })) }, methods: { add: method(obj({ text: str() })) } } },
125
+ });
126
+
127
+ // plugins/notes/worker.ts
128
+ import { defineFacet } from "@app/core"; // bound to the app's principal type
129
+ import { NoteStore, Notes } from "./contract.ts";
130
+ import { serveStore } from "./store.ts";
131
+ export default defineFacet((host) => {
132
+ host.serve(NoteStore, serveStore);
133
+ host.serve(Notes, ({ session }, principal, self) => { /* … */ });
134
+ });
135
+
136
+ // plugins/notes/web.tsx
137
+ import { defineFacet } from "@app/core";
138
+ import { NoteList } from "./NoteList.tsx"; // a React component, bundled
139
+ import "./notes.css"; // bundled into the facet's stylesheet
140
+ export default defineFacet((host, self) => {
141
+ self.contribute(Panels, { notes: NoteList }); // the app's UI registry
142
+ });
143
+ ```
144
+
145
+ # Building and Loading {#loading lede="How the bundler knows what to pull in, and how the code gets into a running process."}
146
+
147
+ Each facet is built on its own, as one script. The bundler starts at the facet file and follows its imports:
148
+
149
+ | An import of | Becomes |
150
+ | --- | --- |
151
+ | the plugin's own files (`./store.ts`, `./NoteList.tsx`) | inlined into the facet's script |
152
+ | another plugin's contract (`../sessions/contract.ts`, or `@pi/sessions/contract` for an installed package) | inlined too: a copy, so a plugin carries the contract version it was built against (`accepts` needs that); only contracts and side-effect-free modules may be imported across plugins |
153
+ | an npm package in `dependencies` (`marked`) | inlined, resolved from the plugin's own `node_modules` |
154
+ | an npm package listed in `chord.external` (Node facets only) | external: `require`d from the plugin's own `node_modules` at evaluation |
155
+ | a host package (`@earendil-works/chord/next`, `react`, `@app/core`, …) | **external**: a parameter of the script, the host's instance at load time |
156
+ | a Node builtin (`node:fs`) | external, through the `require` the loader passes (server and worker facets only; a web facet that imports one fails to build) |
157
+ | CSS (`import "./notes.css"`) | collected into one stylesheet per web facet |
158
+ | an asset by URL (`import iconUrl from "./assets/icon.svg?url"`) | a content-hashed file served by the app; the import is its URL |
159
+
160
+ The built script is a function of its host packages. That is the whole trick of loader D: there is no module map, no
161
+ second copy of Chord, and an old version is garbage-collected once nothing holds its closures.
162
+
163
+ ```js
164
+ // what the bundler emits for plugins/notes/worker.ts (simplified)
165
+ (function (require, __files) {
166
+ const { defineFacet } = require("@app/core"); // the host's instance
167
+ const { local, remote, str } = require("@earendil-works/chord/next");
168
+ const { marked } = /* marked's code, inlined */;
169
+ /* contract.ts, store.ts, inlined */
170
+ return defineFacet((host) => { /* … */ });
171
+ })
172
+ ```
173
+
174
+ ```ts
175
+ // the loader (proposed @earendil-works/chord/next/loader), Node side
176
+ import { buildFacet, evaluateFacet } from "@earendil-works/chord/next/loader";
177
+
178
+ const HOST_PACKAGES = { // the app's base bundle exports these
179
+ "@earendil-works/chord/next": chordNext, "@earendil-works/pi-durable": durable,
180
+ "@app/core": core, react, "react/jsx-runtime": jsxRuntime,
181
+ };
182
+ const script = await buildFacet({ plugin: "/data/plugins/notes", facet: "worker.ts", hostPackages: Object.keys(HOST_PACKAGES), platform: "node" });
183
+ const facet = evaluateFacet(script, { hostPackages: HOST_PACKAGES, require: createRequire(import.meta.url), dir: "/data/plugins/notes" });
184
+ await host.reload([{ name: "@pi/notes", facet }], ctx); // or host.load the first time
185
+ ```
186
+
187
+ - `buildFacet` is esbuild with: the facet as entry, the host packages and `node:*` external, `format: "cjs"` wrapped
188
+ as the function above, minified, an `onResolve` that refuses anything outside the plugin, its `node_modules`, a
189
+ contract of another plugin or a host package. It returns the script, its content hash and esbuild's metafile (the
190
+ dev loop knows which files a facet used).
191
+ - `evaluateFacet` runs the script with `vm.Script` and a stable filename per (facet, hash) on Node, or as a classic
192
+ `<script>` in the browser (the page fetches the script and its stylesheet by hash, which caches forever).
193
+ - **Imports a plugin cannot use:** dynamic `import()` (resolved at build, or not at all), top-level `await` (a facet is a
194
+ synchronous declaration), `require` of anything but builtins.
195
+
196
+ :::review | Open 5: where the loader lives
197
+ (a) Chord ships `chord/next/loader` (discovery, `buildFacet`, `evaluateFacet`, `pluginFile`), an app chooses its host
198
+ packages; (b) Chord knows only `host.reload(facets)` and the app bundles and evaluates. Recommended: (a); the kernel
199
+ stays free of it, and Durable Objects (no `eval`) compose statically as before.
200
+ :::
201
+
202
+ # Assets and Files {#assets lede="Files a plugin ships: bundled into the browser, read at runtime, or offered for download."}
203
+
204
+ A plugin has files that are not code. They fall into three cases.
205
+
206
+ **1. Imported by a web facet.** CSS, images, wasm. The bundler emits them as content-hashed files next to the facet's
207
+ script, and the import evaluates to their URL. The app serves the bundle's files under one path; p2 does exactly this
208
+ today for the terminal's wasm (`plugins/terminals/Terminal.tsx`: `import ghosttyWasm from
209
+ "../../vendor/ghostty/ghostty-vt.wasm?url"`, served under `/__p2_web/`).
210
+
211
+ ```tsx
212
+ import iconUrl from "./assets/icon.svg?url";
213
+ export const NoteIcon = () => <img src={iconUrl} alt="" />;
214
+ ```
215
+
216
+ **2. Read at runtime by a server or worker facet.** A template, a wasm module for a native, a script a native runs. A
217
+ bundled script has no meaningful `import.meta.url` (today's `plugins/terminals/main.ts` reads its wasm with
218
+ `new URL("../../vendor/…", import.meta.url)`). The loader passes the plugin's directory, and a helper resolves a path
219
+ inside it, refusing `..` out of it:
220
+
221
+ ```ts
222
+ // plugins/notes/worker.ts
223
+ import { pluginFile } from "@earendil-works/chord/next/loader"; // reads the directory the loader passed
224
+ const template = await readFile(pluginFile("assets/template.md"), "utf8");
225
+ ```
226
+
227
+ **3. Offered for download over HTTP.** A plugin contributes a route to the app's HTTP registry; the handler opens the
228
+ file through the same helper and streams it, with the plugin's own authorization:
229
+
230
+ ```ts
231
+ // plugins/notes/server.ts
232
+ export default defineFacet((host, self) => {
233
+ self.contribute(Http, {
234
+ routes: {
235
+ "GET /notes/template.md": async (request, ctx) => {
236
+ if (ctx.principal.kind !== "owner") return { kind: "error", status: 403 };
237
+ const path = pluginFile("assets/template.md");
238
+ const { size } = await stat(path);
239
+ return { kind: "bytes", name: "template.md", mime: "text/markdown", size, read: (offset, length) => readRange(path, offset, length) };
240
+ },
241
+ },
242
+ });
243
+ });
244
+ ```
245
+
246
+ So yes: a plugin can offer its files for download, because the loader tells it where it lives. Each facet sees only its
247
+ own plugin's directory; nothing gives it another plugin's files.
248
+
249
+ # HTTP {#http lede="What Chord provides, what p2 has, and what p3 needs."}
250
+
251
+ **Chord v2 has no HTTP server today.** Design §23 designs one (`@earendil-works/chord/next/http`) and defers it until
252
+ "the kernel fixes and a first real proof" are done. p2's HTTP is its own, about 30 lines of helpers plus the server host:
253
+
254
+ ```ts
255
+ // apps/p2/src/runtime/server.ts (p2 today, Chord v1)
256
+ export const Routes = defineRegistry<RouteHandler>("p2.routes", { conflict: "error" }); // "METHOD /path" → handler
257
+ export const Upgrades = defineRegistry<UpgradeHandler>("p2.upgrades", { conflict: "error" }); // WebSocket upgrades
258
+ export const RequestResolvers = defineRegistry<RequestResolver>("p2.request-resolvers", { conflict: "error" });
259
+ type RouteHandler = (request: IncomingMessage, response: ServerResponse, access: RequestAccess, ctx: Ctx) => void | Promise<void>;
260
+ ```
261
+
262
+ Plugins contribute handlers that write to Node's `ServerResponse` themselves; the files plugin implements ranges,
263
+ download headers and previews by hand (`plugins/files/server.ts`).
264
+
265
+ The designed component (§23) replaces raw responses with descriptions, so every plugin gets ranges (206/416), `HEAD`,
266
+ safe download headers, streaming and abort on disconnect from one place:
267
+
268
+ ```ts
269
+ export const Http = defineRegistry<HttpContribution, Router>("chord.http", { version: 1 });
270
+ type HttpContribution = { routes?: Record<string, Route>; wraps?: Wrap[] };
271
+ type Route = (req: HttpRequest, ctx: Ctx) => Promise<HttpResponse>; // ctx.principal: the request's principal
272
+ type HttpResponse =
273
+ | { kind: "json"; value: JsonValue } | { kind: "page"; title: string; body: string }
274
+ | { kind: "bytes"; name: string; mime: string; size: number; read(offset: number, length: number): Promise<Uint8Array> }
275
+ | { kind: "redirect"; to: string } | { kind: "error"; status: number };
276
+ ```
277
+
278
+ - Routes compose by `keyedEntries`: a duplicate pattern is a reported conflict, the first by plugin name wins.
279
+ - Wraps (middleware) run in phases the owner defines (`observe`, `headers`, `transform`), by default only around their
280
+ own plugin's routes.
281
+ - Request resolvers (who sent a request: cookie, loopback, relay) are hooks; WebSocket byte channels for terminals are
282
+ a separate component.
283
+
284
+ # Performance {#perf lede="Measured on slayer, Node 24, esbuild from the repo, p2's plugins as they are."}
285
+
286
+ Built with the loader D settings above (each facet alone, host packages and `apps/p2/src` external, minified), on
287
+ p2's real plugins:
288
+
289
+ | Measurement | Result |
290
+ | --- | --- |
291
+ | all 25 worker facets, one script each, cold | 237 ms, 294 KB in total, largest `models/worker.ts` 35 KB |
292
+ | all 20 server facets, cold | 167 ms, 236 KB |
293
+ | all 17 web facets, cold | 144 ms, 912 KB, of which 688 KB is the terminal's wasm |
294
+ | one facet rebuilt after an edit (esbuild context, warm) | 11 ms |
295
+ | compile and evaluate all 25 worker scripts (`vm.Script`) | 23 ms |
296
+ | worker spawn to ready, p2 today (TypeScript through the source resolver, `nodeLoader`) | 549 ms (p2's measurement, `plugin-loading.md` §14.1) |
297
+ | the same with one bundle per worker plugin set | 218 ms |
298
+ | base bundle plus one script per plugin through ESM (model B) | 254 ms; D is expected near it |
299
+
300
+ The plugins are small; the time goes into the host packages and the runtime (85% of a worker's load time, p2 §14.1),
301
+ which the base bundle loads once per process. A reload of one plugin costs one rebuild (about 11 ms warm) and one
302
+ evaluation (about 1 ms per facet), then Chord's reload. The memory caveat is V8's compilation cache: every distinct
303
+ compiled script stays cached, so scripts get a stable name per (facet, hash) and hosts that reload in place run with
304
+ the cache off (+0.1 MiB instead of +5.6 MiB per 100 reloads, p2's measurement).
305
+
306
+ # A Mini p2 from Chord {#kit lede="The owner: building a small p2 with a web and a TUI surface and plugins should be trivial from Chord; optional components should come out of the box."}
307
+
308
+ p2 has about 10,700 lines of host code in `apps/p2/src/hosts` and its runtime: the server's HTTP and WebSocket
309
+ entry, the worker supervisor, plugin discovery, the web and TUI bundles, the web shell, the TUI sandbox and launcher,
310
+ the reload control. Almost none of it is p2-specific. The proposal: Chord ships it as optional components, each a
311
+ subpath an app imports only if it wants it, none of them in Chord's kernel.
312
+
313
+ ## What it would look like
314
+
315
+ ```ts
316
+ // server.ts: a whole app with plugins, a web and a TUI surface
317
+ import { createHost } from "@earendil-works/chord/next";
318
+ import { discoverPlugins, pluginLoader } from "@earendil-works/chord/next/loader";
319
+ import { httpServer } from "@earendil-works/chord/next/http";
320
+ import { workerRoute } from "@earendil-works/chord/next/workers";
321
+ import { webSurface } from "@earendil-works/chord/next/web";
322
+ import { tuiSurface } from "@earendil-works/chord/next/tui";
323
+ import { devReload } from "@earendil-works/chord/next/dev";
324
+ import { Server, Session, core } from "./core.ts"; // the app's base code: host kinds, principals, core facet
325
+
326
+ const plugins = await discoverPlugins(["./plugins", join(dataDir, "plugins")]);
327
+ const loader = pluginLoader({ hostPackages: core.hostPackages });
328
+
329
+ const server = createHost<P>({ address: Server(), principal: { kind: "server" }, onError });
330
+ server.route(Session, workerRoute({ entry: "./worker.ts", idleMs: 300_000, authorize: core.authorize }), ctx);
331
+ await server.load([core.serverFacet, ...(await loader.facets(plugins, "server"))], ctx);
332
+
333
+ const http = httpServer(server, { port: 4321, authenticate: core.authenticate }); // routes from the Http registry
334
+ http.surface(webSurface({ loader, plugins, shell: core.webShell })); // /: the page, its bundle, its socket
335
+ http.surface(tuiSurface({ loader, plugins })); // the TUI launcher's bundle and socket
336
+ devReload({ server, loader, plugins, watch: true }); // a changed plugin reloads everywhere
337
+ ```
338
+
339
+ ```ts
340
+ // worker.ts
341
+ import { workerMain } from "@earendil-works/chord/next/workers";
342
+ await workerMain(async ({ address, init, parent }) => {
343
+ const worker = createHost<P>({ address, principal: { kind: "worker", session: init.id }, onError });
344
+ worker.connect(parent, { principal: { kind: "server" }, trusted: true }, ctx);
345
+ await worker.load([core.workerFacet(init), ...(await loader.facets(init.plugins, "worker"))], ctx);
346
+ return worker;
347
+ });
348
+ ```
349
+
350
+ ```tsx
351
+ // core.ts, the web shell: the app decides the layout; plugins fill registries
352
+ export const Panels = defineRegistry<Record<string, ComponentType>, Panel[]>("app.panels", { version: 1 });
353
+ export const webShell = ({ host }: ShellProps) => {
354
+ const panels = useRegistry(host, Panels); // from chord/next/web: a hook over a registry value
355
+ return <Tabs>{panels.map((p) => <p.component key={p.name} />)}</Tabs>;
356
+ };
357
+ ```
358
+
359
+ And a plugin is what chapter I shows: a directory, a `package.json`, facets that serve types and contribute to the
360
+ app's registries (`Http`, `Panels`, a TUI command list).
361
+
362
+ ## The components
363
+
364
+ | Subpath | What it does | Replaces in p2 |
365
+ | --- | --- | --- |
366
+ | `chord/next/loader` | `discoverPlugins` (directory listing, `package.json` names, no parsing), `buildFacet` (esbuild, host packages external), `evaluateFacet` (Node `vm`, browser `<script>`), `pluginFile`, npm/git install with `--ignore-scripts` | `src/hosts/plugins.ts`, `bundles.ts`, the source resolver, `nodeLoader` |
367
+ | `chord/next/http` | the Node HTTP server, the `Http` registry (routes, wraps, request resolvers, responses as descriptions: ranges, downloads, `HEAD`), WebSocket entry calling `host.accept` | `src/hosts/server.ts` (HTTP part), `runtime/http.ts`, `Routes`, `Upgrades`, `RequestResolvers` |
368
+ | `chord/next/workers` | `workerRoute` (fork a worker per address, IPC link, start message, idle stop from `host.activity`, crash restart with backoff), `workerMain` (the child's side) | `SessionHosts` in `runtime/server.ts`, `hosts/worker.ts` |
369
+ | `chord/next/web` | the page host (connect over a WebSocket with reconnect, load web facets from their scripts, React provider and hooks: `useObject` over `host.hold`, `useRegistry`, `useWatch`), serving the bundle by hash, reload on a new manifest | `hosts/web/*`, `runtime/web.tsx`, `src/web/reconnect.ts` |
370
+ | `chord/next/tui` | the TUI launcher and sandbox (pi-tui, the bundle download, a link over the launcher's socket), slots and commands as registries | `hosts/tui-*.ts`, `runtime/tui.ts` |
371
+ | `chord/next/dev` | the source watcher marking plugins dirty, the reload control (`reload(plugins)` on every host in order: server, workers, then a manifest bump for pages and the TUI) | `performReload` in `hosts/server.ts`, the dev protocol |
372
+
373
+ Each is ordinary code on top of Chord's public API: nothing in the kernel depends on it, a Durable Object deployment
374
+ uses none of it, and an app can replace any one (its own HTTP server, its own shell). React is a host package of the web
375
+ component, pi-tui of the TUI component; an app without them never imports them.
376
+
377
+ ## What stays the app's
378
+
379
+ The principal type and authentication; the host kinds (`Server`, `Session`) and what a worker's start message holds;
380
+ the core facet and core objects (catalog, harness); the web shell's layout and the TUI's look; which registries plugins
381
+ contribute to beyond `Http`. That is roughly what p3's base code should be: a few hundred lines, not ten thousand.
382
+
383
+ :::review | Open 6: the app kit
384
+ (a) Chord ships these six components as optional subpaths of `@earendil-works/chord`, built in this order: `loader`
385
+ and `dev` with 7b (reload needs them), `http` and `workers` next (p3 needs them first), `web` and `tui` after (lifted
386
+ from p2's code, which works today). (b) Chord ships only `loader`; the rest is p3's base code. Recommended: (a), as the
387
+ owner asked; each component gets its own slice spec and review, after 7b and before slice 9 or alongside p3's base.
388
+ :::
389
+
390
+ # One Host Reloads {#host lede="Four steps, all or nothing up to the commit."}
391
+
392
+ Design §21 fixes the shape. **Decided.**
393
+
394
+ ```text
395
+ 1. load the new bundles; an import or syntax error rejects
396
+ 2. staging facet setups and every live object's new factory run with a recording `self`
397
+ (declarations only, nothing activated); any throw rejects
398
+ 3. commit the host switches to the new code atomically: a publication (7a)
399
+ 4. after each object follows its fate (chapter II)
400
+ ```
401
+
402
+ Rollback is all or nothing per host, and only for code errors: an import error, a throwing setup or factory. A failed
403
+ `open`, a registry conflict or a failing `migrate` after the commit are runtime states of single objects, never a
404
+ reason to roll back. A host is at revision R or R−1, never in between.
405
+
406
+ Staging runs factories against a recording `self` because a factory only declares: it returns members and calls
407
+ `self.state`, `self.get`, `self.open` and so on, and the recording tells Chord what changed (a new dependency, a native
408
+ added or removed, a member gone) before anything happens.
409
+
410
+ :::sequence animate | A reload of the notes plugin on the worker. Nothing is visible to callers until the commit.
411
+ actor app "base code" "reload control"
412
+ actor host "worker W" ""
413
+ actor objs "notes objects" "live"
414
+ app -> host: reload([notes v2], ctx)
415
+ host -> host: load bundles
416
+ host -> host: staging: setups + new factories (recording self)
417
+ host => host: commit: types, registries, contributions swapped; publication
418
+ host => objs: each follows its fate
419
+ objs --> app: resolved: { reloaded, restarted, ended, failed }
420
+ :::
421
+
422
+ :::review | Open 1: the API
423
+ Today a host has `load(facets, ctx)`, once. Proposal: `host.reload(facets, ctx)` with the plugins' new facets (by
424
+ plugin name: added, changed; a plugin missing from the list is removed), resolving with a report of what each object
425
+ did, rejecting with the code error and nothing changed. `load` stays the first call. Alternative: one
426
+ `host.load` that may be called again. Recommended: the separate `reload`, because its result differs (a report, not a
427
+ barrier) and its rollback rule does not apply to the first load (a throwing first setup closes the host).
428
+ :::
429
+
430
+ # Three Fates {#fates lede="What happens to each live object at the commit."}
431
+
432
+ The commit compares each live object's old and new declarations. **Decided** (design §21, owner 2026-10-26, the
433
+ dependency model).
434
+
435
+ | The object | Fate | Calls | Documents, jobs |
436
+ | --- | --- | --- | --- |
437
+ | pure, old and new (no `self.open`) | **swapped in place**: new methods, derives and routines; references kept, new ones made | running calls finish on old handles; new calls see new code | stay |
438
+ | has natives, old or new | **restarted**: new calls park, running calls drain (`closeTimeout`), natives close (`reload`), the new factory runs, natives reopen | park during the restart | stay; running job runs end `aborted { reload }`, `finish` runs on new code |
439
+ | its type is gone | **ended**: natives close (`end`), callers rejected, handlers drain | rejected | in-memory gone; persisted stay until retired |
440
+ | a new dependency is missing (any of the above) | **parks** (decision 4): gate closed, `failed { waiting }` | reject | stay |
441
+
442
+ ```ts
443
+ // notes v1 // notes v2: pure, swapped in place
444
+ host.serve(NoteStore, (_, self) => { host.serve(NoteStore, (_, self) => {
445
+ const notes = self.state(Notes); const notes = self.state(Notes); // same document, v2 migrates it
446
+ return { const count = self.derive([notes], ([n]) => n.list.length);
447
+ notes, return {
448
+ add: (a, ctx) => self.tx(…, ctx), notes, count, // a new exposed member
449
+ }; add: (a, ctx) => self.tx(…, ctx),
450
+ }); rename: (a, ctx) => self.tx(…, ctx), // a new method
451
+ };
452
+ });
453
+ ```
454
+
455
+ Rules that come with the fates, all **decided**:
456
+
457
+ - **R15, old code and migrated documents:** an old call that touches a document whose version rose throws once; the
458
+ document stays intact; the call is not resent.
459
+ - **Derives** have no names: exposed derives are matched by their member name, internal ones are rebuilt.
460
+ - **Routines** hand over per object: the old ones are aborted, the new ones start once the old calls finished, bounded
461
+ by `closeTimeout`; calls do not wait for it.
462
+ - **Instance ids:** a restarted object gets a new instance id (an old activation chain must not match it); a swapped one
463
+ keeps it.
464
+ - **Broken objects** of a reloaded plugin are retried, as `ref.retry()` does.
465
+ - **A parked object** of a reloaded plugin is replaced by the new factory's attempt in one handover: the new requests
466
+ bind before the old ones are released (the mechanism 7a removed comes back here).
467
+ - **In-memory documents** migrate on reload through their definition's `migrate` (6a built the version check).
468
+
469
+ :::review | Open 2: a `writable` across a pure swap
470
+ A pure swap runs the new factory, so `self.writable(initial)` makes a new writable at its initial value. An object that
471
+ contributes MCP's tool list through a writable then contributes an empty list until its restarted routine sets it again:
472
+ the tools vanish for a moment. Options: (a) accept it (the routine refills it within one call); (b) keep a writable's
473
+ value across a swap when the new factory declares a writable at the same position (as members are matched by name).
474
+ Recommended: (a); writables have no names, and position matching would be the first positional rule in Chord.
475
+ :::
476
+
477
+ # Consumers Across a Reload {#consumers lede="Holds, versions and old calls; 7a decided that nothing is ended for a code change."}
478
+
479
+ A reference on another host points at an object whose code may change under it. **Decided** (design §21, §22 and the
480
+ dependency model):
481
+
482
+ | The provider's reload | The consumer's hold | It sees |
483
+ | --- | --- | --- |
484
+ | still accepts the hold's version, object swapped | kept; re-subscribed through the version's mappings | one `[["r", value]]` per changed member |
485
+ | still accepts it, object restarted | kept | `loading`, then a fresh `bound` |
486
+ | stops accepting the version | unbound `version` | `failed { waiting }`; it binds again if a later reload accepts it |
487
+ | removes the type | unbound `not_served` | `failed { waiting }`; it binds again when the type comes back |
488
+
489
+ A provider accepts older consumers through `accepts`, written once with the provider, never in the shared contract
490
+ (Q10):
491
+
492
+ ```ts
493
+ export const NotesV2 = evolve(NotesV1, (e) => e.state("editor", "notes", arr(NoteV2)).args("add", NoteV2));
494
+
495
+ host.serve(NotesV2, factory, {
496
+ accepts: {
497
+ 1: {
498
+ state: { editor: { notes: (current) => current.map(toV1) } }, // what a v1 tab sees, as a diff per commit
499
+ methods: { add: { args: (old) => toV2(old) } }, // a v1 tab's call, mapped forward
500
+ },
501
+ },
502
+ });
503
+ ```
504
+
505
+ - **Old-version calls:** `checkArgs` returns `{ kind: "method", args, result? }` or `{ kind: "call", args, call }`; Chord
506
+ runs the handler or the provider's replacement and maps the result back (L1 built the check; 7b invokes it).
507
+ - **Adapted bindings get diffs:** Chord keeps the last adapted value per binding and sends `diffRevisions`, so an old
508
+ tab never receives a whole state per commit.
509
+ - **On the wire** (7b's half of 7a's model): a `failed` on a bound hold unbinds it; the provider drops its unsent
510
+ pending work and keeps the ack slots of messages already sent; a consumer whose own code moves to a new version
511
+ releases its old hold and makes a new one.
512
+ - **A consumer reloaded itself** gets new requests from its new factory; the handover binds them before it releases the
513
+ old.
514
+
515
+ Today `host.serve` binds every provider with an empty accepts table (`host.ts`: `bindProvider(contract, {})`); 7b passes
516
+ the provider's table. Small and **decided** in shape (Q10, `bindProvider`); the option's place is `host.serve(Type,
517
+ factory, { accepts, linger })`.
518
+
519
+ # Jobs Across a Reload {#jobs lede="Runs belong to the object; their versions are mapped forward."}
520
+
521
+ **Decided** (design §15, owner 2026-10-24 and 2026-10-26):
522
+
523
+ ```ts
524
+ const ExportJob = defineJob("notes.export", {
525
+ version: 2,
526
+ args: obj({ format: oneOf("md", "html") }),
527
+ result: obj({ path: str() }),
528
+ accepts: { 1: { args: (old) => ({ format: "md" }), result: (old) => ({ path: old.file }) } },
529
+ });
530
+ ```
531
+
532
+ - A run started on an older version finishes on its old code across a pure swap; `finish` and `running` see its args
533
+ and result mapped forwards, once per run.
534
+ - Without an adapter, or for a run of a newer version (a rollback), the run is `blocked { version }` until a reload
535
+ brings matching code; blocked runs are retried on every reload. Nothing is aborted or discarded for a version change.
536
+ - A native restart aborts running runs (`aborted { reload }`) and `finish` runs on the new code.
537
+ - A job the new code no longer declares: its runs are `blocked { version }` (the same family), kept until a reload
538
+ declares it again or they are aborted.
539
+ - Persisted runs of another version or fingerprint stay blocked with their record as stored, resolved by the reload
540
+ that brings their version.
541
+
542
+ # Registries Across a Reload {#registries lede="A provider and its contributions are swapped in one batch."}
543
+
544
+ **Decided** (slice 8 §6, design §17): the commit replaces a plugin's contributions and a registry's provider in one
545
+ batch; staging composes nothing (D1). The record keeps the provider, facet contributions by plugin and object
546
+ contributions by object apart, so a reload of one plugin replaces exactly its parts (today `RegistryRecord.serve`
547
+ refuses a second serve). Older readers across a reload of the provider follow its new `accepts[old].value`. A reader
548
+ waits (7a) when the new provider no longer serves its version. `retryOn` watches are re-declared by the new factory.
549
+
550
+ # Across Hosts {#rollout lede="The same reload on every host, in an order that cannot deadlock."}
551
+
552
+ **Decided** (design §21 and the dependency model): a revision is the complete code set; the server installs first,
553
+ then workers, then clients; installs are serialized per host; a host that starts or reconnects installs the current
554
+ revision first; a revision carries a code-set digest so an unchanged server restart reinstalls nothing; an install
555
+ never waits for activations (a reverse-order rollout would deadlock); each host knows only its own install: while it
556
+ installs, holds that do not fit its running code wait `installing`, re-evaluated when the install ends; a host whose
557
+ own install was rejected fails its own requests with the reason.
558
+
559
+ :::steps | The notes contract goes from v1 to v2; the server installs first
560
+ +++ Before
561
+ S, W and T run revision R. T's notes view holds W's `Notes` v1. All live.
562
+ +++ S installs R+1
563
+ S has no notes objects of its own; its install commits. T, still on R, holds nothing on S that changed.
564
+ +++ W installs R+1 with `accepts[1]`
565
+ W's `Notes` v2 swaps in place and still accepts v1: T's hold is re-subscribed through the mapping and gets one diff.
566
+ +++ W installs R+1 without `accepts[1]`
567
+ T's hold becomes unbound `version`: `failed { waiting }`, last notes readable, calls reject with "update the page".
568
+ +++ T reloads its page
569
+ T's new code holds v2 with a new hold id; it binds; the old hold is released.
570
+ :::
571
+
572
+ :::review | Open 3: who runs the rollout
573
+ Chord's part is per host: `host.reload`, the `installing` state, and what a hold sees. The rest is distribution:
574
+ building bundles, sending them to workers, telling tabs to reload, ordering, the digest. Options: (a) Chord ships a
575
+ rollout protocol over its links (an `install` message from the server down, `installed`/`rejected` up, the digest in
576
+ `hello`); (b) distribution is the app's (p3's base code calls `host.reload` on each host and orders them), as p2 does
577
+ today (`apps/p2/src/hosts/server.ts` `performReload`: prepare every host, commit, publish bundles). Recommended: (b) for
578
+ 7b, with Chord's per-host guarantees; a protocol only if a second app needs the same code.
579
+ :::
580
+
581
+ :::review | Open 4: the install watchdog (design §26 #24)
582
+ An install that hangs (a bundle that never loads, a staging factory that awaits forever, which it may not) leaves its
583
+ holds `installing` forever. Options: (a) a watchdog: `host.reload` rejects after `installTimeout` (default 60 s) and the
584
+ host stays on its old code; (b) no Chord timer: the app's context bounds the reload. Recommended: (b): `reload` takes a
585
+ context like everything else, and the app passes its deadline; a host option would be the only timer left in reload.
586
+ :::
587
+
588
+ # Decisions {.epilogue lede="What is settled for the spec, and what the owner decides first."}
589
+
590
+ **Decided** (spec material): the four steps and rollback per host; the three fates and the parking of a swap with a
591
+ missing dependency; old calls on old handles (R15); derives matched by member name; the routine handover; new instance
592
+ ids on restart; broken objects retried on reload; the handover of a parked attempt; in-memory `migrate`; holds kept,
593
+ re-subscribed or freshly bound; unbound `version` and `not_served` instead of `gone`; old-version calls and adapted
594
+ bindings as diffs; `accepts` in `host.serve`; jobs' version mapping, `blocked { version }` and retries on reload, runs
595
+ aborted on a native restart; registries swapped in one batch; rollout order, serialized installs, the digest,
596
+ `installing`, installs never waiting for activations; loader D's design: one script per facet, host packages passed in,
597
+ contracts bundled, no module map, stable script names, plugins' npm dependencies installed with `--ignore-scripts`.
598
+
599
+ **Open** for the owner:
600
+
601
+ | # | Point | Recommended |
602
+ | --- | --- | --- |
603
+ | 1 | the API: `host.reload(facets, ctx)` returning a report, or `load` callable again | `host.reload` |
604
+ | 2 | a `writable` across a pure swap: back to its initial value, or kept by position | back to initial |
605
+ | 3 | who runs the rollout: a Chord protocol, or the app calling `host.reload` per host | the app |
606
+ | 4 | the install watchdog: a host option `installTimeout`, or the app's context | the app's context |
607
+ | 5 | where loader D lives: Chord (`chord/next/loader`), or the app | Chord |
608
+ | 6 | the app kit: Chord ships loader, HTTP, workers, web, TUI and dev reload as optional subpaths, or only the loader | Chord ships them, in that order |