@diffra-ai/chord 0.0.0-stage → 0.2.2

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 (1334) hide show
  1. package/CHANGELOG.md +235 -0
  2. package/README.md +227 -2
  3. package/dist/context/index.d.ts +43 -0
  4. package/dist/context/index.d.ts.map +1 -0
  5. package/dist/context/index.js +112 -0
  6. package/dist/context/index.js.map +1 -0
  7. package/dist/contracts/accepts.d.ts +91 -0
  8. package/dist/contracts/accepts.d.ts.map +1 -0
  9. package/dist/contracts/accepts.js +145 -0
  10. package/dist/contracts/accepts.js.map +1 -0
  11. package/dist/contracts/contract.d.ts +238 -0
  12. package/dist/contracts/contract.d.ts.map +1 -0
  13. package/dist/contracts/contract.js +69 -0
  14. package/dist/contracts/contract.js.map +1 -0
  15. package/dist/contracts/declare.d.ts +144 -0
  16. package/dist/contracts/declare.d.ts.map +1 -0
  17. package/dist/contracts/declare.js +207 -0
  18. package/dist/contracts/declare.js.map +1 -0
  19. package/dist/contracts/evolve.d.ts +142 -0
  20. package/dist/contracts/evolve.d.ts.map +1 -0
  21. package/dist/contracts/evolve.js +216 -0
  22. package/dist/contracts/evolve.js.map +1 -0
  23. package/dist/contracts/fingerprint.d.ts +16 -0
  24. package/dist/contracts/fingerprint.d.ts.map +1 -0
  25. package/dist/contracts/fingerprint.js +61 -0
  26. package/dist/contracts/fingerprint.js.map +1 -0
  27. package/dist/contracts/history.d.ts +79 -0
  28. package/dist/contracts/history.d.ts.map +1 -0
  29. package/dist/contracts/history.js +3 -0
  30. package/dist/contracts/history.js.map +1 -0
  31. package/dist/contracts/host-kind.d.ts +58 -0
  32. package/dist/contracts/host-kind.d.ts.map +1 -0
  33. package/dist/contracts/host-kind.js +122 -0
  34. package/dist/contracts/host-kind.js.map +1 -0
  35. package/dist/contracts/index.d.ts +8 -0
  36. package/dist/contracts/index.d.ts.map +1 -0
  37. package/dist/contracts/index.js +7 -0
  38. package/dist/contracts/index.js.map +1 -0
  39. package/dist/contracts/internal.d.ts +12 -0
  40. package/dist/contracts/internal.d.ts.map +1 -0
  41. package/dist/contracts/internal.js +11 -0
  42. package/dist/contracts/internal.js.map +1 -0
  43. package/dist/contracts/names.d.ts +3 -0
  44. package/dist/contracts/names.d.ts.map +1 -0
  45. package/dist/contracts/names.js +13 -0
  46. package/dist/contracts/names.js.map +1 -0
  47. package/dist/contracts/params.d.ts +28 -0
  48. package/dist/contracts/params.d.ts.map +1 -0
  49. package/dist/contracts/params.js +55 -0
  50. package/dist/contracts/params.js.map +1 -0
  51. package/dist/contracts/schema.d.ts +144 -0
  52. package/dist/contracts/schema.d.ts.map +1 -0
  53. package/dist/contracts/schema.js +144 -0
  54. package/dist/contracts/schema.js.map +1 -0
  55. package/dist/contracts/snapshot.d.ts +16 -0
  56. package/dist/contracts/snapshot.d.ts.map +1 -0
  57. package/dist/contracts/snapshot.js +167 -0
  58. package/dist/contracts/snapshot.js.map +1 -0
  59. package/dist/data/args.d.ts +50 -0
  60. package/dist/data/args.d.ts.map +1 -0
  61. package/dist/data/args.js +83 -0
  62. package/dist/data/args.js.map +1 -0
  63. package/dist/data/errors.d.ts +80 -0
  64. package/dist/data/errors.d.ts.map +1 -0
  65. package/dist/data/errors.js +116 -0
  66. package/dist/data/errors.js.map +1 -0
  67. package/dist/data/failure.d.ts +31 -0
  68. package/dist/data/failure.d.ts.map +1 -0
  69. package/dist/data/failure.js +78 -0
  70. package/dist/data/failure.js.map +1 -0
  71. package/dist/data/index.d.ts +4 -0
  72. package/dist/data/index.d.ts.map +1 -0
  73. package/dist/data/index.js +5 -0
  74. package/dist/data/index.js.map +1 -0
  75. package/dist/data/internal.d.ts +7 -0
  76. package/dist/data/internal.d.ts.map +1 -0
  77. package/dist/data/internal.js +8 -0
  78. package/dist/data/internal.js.map +1 -0
  79. package/dist/data/params.d.ts +20 -0
  80. package/dist/data/params.d.ts.map +1 -0
  81. package/dist/data/params.js +31 -0
  82. package/dist/data/params.js.map +1 -0
  83. package/dist/data/principal.d.ts +28 -0
  84. package/dist/data/principal.d.ts.map +1 -0
  85. package/dist/data/principal.js +64 -0
  86. package/dist/data/principal.js.map +1 -0
  87. package/dist/data/validator.d.ts +12 -0
  88. package/dist/data/validator.d.ts.map +1 -0
  89. package/dist/data/validator.js +35 -0
  90. package/dist/data/validator.js.map +1 -0
  91. package/dist/delta/apply-immutable-trusted.d.ts +4 -0
  92. package/dist/delta/apply-immutable-trusted.d.ts.map +1 -0
  93. package/dist/delta/apply-immutable-trusted.js +126 -0
  94. package/dist/delta/apply-immutable-trusted.js.map +1 -0
  95. package/dist/delta/diff.d.ts +5 -0
  96. package/dist/delta/diff.d.ts.map +1 -0
  97. package/dist/delta/diff.js +435 -0
  98. package/dist/delta/diff.js.map +1 -0
  99. package/dist/delta/draft.d.ts +5 -0
  100. package/dist/delta/draft.d.ts.map +1 -0
  101. package/dist/delta/draft.js +2 -0
  102. package/dist/delta/draft.js.map +1 -0
  103. package/dist/delta/index.d.ts +120 -0
  104. package/dist/delta/index.d.ts.map +1 -0
  105. package/dist/delta/index.js +697 -0
  106. package/dist/delta/index.js.map +1 -0
  107. package/dist/delta/pending.d.ts +36 -0
  108. package/dist/delta/pending.d.ts.map +1 -0
  109. package/dist/delta/pending.js +143 -0
  110. package/dist/delta/pending.js.map +1 -0
  111. package/dist/delta/revision-validator.d.ts +7 -0
  112. package/dist/delta/revision-validator.d.ts.map +1 -0
  113. package/dist/delta/revision-validator.js +71 -0
  114. package/dist/delta/revision-validator.js.map +1 -0
  115. package/dist/delta/tracker.d.ts +38 -0
  116. package/dist/delta/tracker.d.ts.map +1 -0
  117. package/dist/delta/tracker.js +2175 -0
  118. package/dist/delta/tracker.js.map +1 -0
  119. package/dist/documents/address-source.d.ts +20 -0
  120. package/dist/documents/address-source.d.ts.map +1 -0
  121. package/dist/documents/address-source.js +44 -0
  122. package/dist/documents/address-source.js.map +1 -0
  123. package/dist/documents/definition.d.ts +92 -0
  124. package/dist/documents/definition.d.ts.map +1 -0
  125. package/dist/documents/definition.js +81 -0
  126. package/dist/documents/definition.js.map +1 -0
  127. package/dist/documents/documents.d.ts +129 -0
  128. package/dist/documents/documents.d.ts.map +1 -0
  129. package/dist/documents/documents.js +258 -0
  130. package/dist/documents/documents.js.map +1 -0
  131. package/dist/documents/fence.d.ts +9 -0
  132. package/dist/documents/fence.d.ts.map +1 -0
  133. package/dist/documents/fence.js +15 -0
  134. package/dist/documents/fence.js.map +1 -0
  135. package/dist/documents/handles.d.ts +81 -0
  136. package/dist/documents/handles.d.ts.map +1 -0
  137. package/dist/documents/handles.js +74 -0
  138. package/dist/documents/handles.js.map +1 -0
  139. package/dist/documents/index.d.ts +4 -0
  140. package/dist/documents/index.d.ts.map +1 -0
  141. package/dist/documents/index.js +3 -0
  142. package/dist/documents/index.js.map +1 -0
  143. package/dist/documents/internal.d.ts +9 -0
  144. package/dist/documents/internal.d.ts.map +1 -0
  145. package/dist/documents/internal.js +9 -0
  146. package/dist/documents/internal.js.map +1 -0
  147. package/dist/documents/keyed-slot.d.ts +139 -0
  148. package/dist/documents/keyed-slot.d.ts.map +1 -0
  149. package/dist/documents/keyed-slot.js +478 -0
  150. package/dist/documents/keyed-slot.js.map +1 -0
  151. package/dist/documents/line.d.ts +7 -0
  152. package/dist/documents/line.d.ts.map +1 -0
  153. package/dist/documents/line.js +14 -0
  154. package/dist/documents/line.js.map +1 -0
  155. package/dist/documents/persistence.d.ts +120 -0
  156. package/dist/documents/persistence.d.ts.map +1 -0
  157. package/dist/documents/persistence.js +156 -0
  158. package/dist/documents/persistence.js.map +1 -0
  159. package/dist/documents/residency.d.ts +31 -0
  160. package/dist/documents/residency.d.ts.map +1 -0
  161. package/dist/documents/residency.js +93 -0
  162. package/dist/documents/residency.js.map +1 -0
  163. package/dist/documents/slot.d.ts +112 -0
  164. package/dist/documents/slot.d.ts.map +1 -0
  165. package/dist/documents/slot.js +190 -0
  166. package/dist/documents/slot.js.map +1 -0
  167. package/dist/documents/transaction.d.ts +143 -0
  168. package/dist/documents/transaction.d.ts.map +1 -0
  169. package/dist/documents/transaction.js +445 -0
  170. package/dist/documents/transaction.js.map +1 -0
  171. package/dist/host/activity.d.ts +31 -0
  172. package/dist/host/activity.d.ts.map +1 -0
  173. package/dist/host/activity.js +40 -0
  174. package/dist/host/activity.js.map +1 -0
  175. package/dist/host/adapted.d.ts +63 -0
  176. package/dist/host/adapted.d.ts.map +1 -0
  177. package/dist/host/adapted.js +298 -0
  178. package/dist/host/adapted.js.map +1 -0
  179. package/dist/host/admission.d.ts +137 -0
  180. package/dist/host/admission.d.ts.map +1 -0
  181. package/dist/host/admission.js +290 -0
  182. package/dist/host/admission.js.map +1 -0
  183. package/dist/host/attempt.d.ts +417 -0
  184. package/dist/host/attempt.d.ts.map +1 -0
  185. package/dist/host/attempt.js +1490 -0
  186. package/dist/host/attempt.js.map +1 -0
  187. package/dist/host/backoff.d.ts +29 -0
  188. package/dist/host/backoff.d.ts.map +1 -0
  189. package/dist/host/backoff.js +69 -0
  190. package/dist/host/backoff.js.map +1 -0
  191. package/dist/host/ctx.d.ts +94 -0
  192. package/dist/host/ctx.d.ts.map +1 -0
  193. package/dist/host/ctx.js +200 -0
  194. package/dist/host/ctx.js.map +1 -0
  195. package/dist/host/deadline.d.ts +12 -0
  196. package/dist/host/deadline.d.ts.map +1 -0
  197. package/dist/host/deadline.js +40 -0
  198. package/dist/host/deadline.js.map +1 -0
  199. package/dist/host/dependencies.d.ts +97 -0
  200. package/dist/host/dependencies.d.ts.map +1 -0
  201. package/dist/host/dependencies.js +148 -0
  202. package/dist/host/dependencies.js.map +1 -0
  203. package/dist/host/destination.d.ts +48 -0
  204. package/dist/host/destination.d.ts.map +1 -0
  205. package/dist/host/destination.js +101 -0
  206. package/dist/host/destination.js.map +1 -0
  207. package/dist/host/events.d.ts +114 -0
  208. package/dist/host/events.d.ts.map +1 -0
  209. package/dist/host/events.js +191 -0
  210. package/dist/host/events.js.map +1 -0
  211. package/dist/host/facet.d.ts +106 -0
  212. package/dist/host/facet.d.ts.map +1 -0
  213. package/dist/host/facet.js +55 -0
  214. package/dist/host/facet.js.map +1 -0
  215. package/dist/host/follow.d.ts +52 -0
  216. package/dist/host/follow.d.ts.map +1 -0
  217. package/dist/host/follow.js +207 -0
  218. package/dist/host/follow.js.map +1 -0
  219. package/dist/host/host-data.d.ts +62 -0
  220. package/dist/host/host-data.d.ts.map +1 -0
  221. package/dist/host/host-data.js +229 -0
  222. package/dist/host/host-data.js.map +1 -0
  223. package/dist/host/host.d.ts +641 -0
  224. package/dist/host/host.d.ts.map +1 -0
  225. package/dist/host/host.js +1449 -0
  226. package/dist/host/host.js.map +1 -0
  227. package/dist/host/index.d.ts +20 -0
  228. package/dist/host/index.d.ts.map +1 -0
  229. package/dist/host/index.js +7 -0
  230. package/dist/host/index.js.map +1 -0
  231. package/dist/host/internal.d.ts +13 -0
  232. package/dist/host/internal.d.ts.map +1 -0
  233. package/dist/host/internal.js +11 -0
  234. package/dist/host/internal.js.map +1 -0
  235. package/dist/host/list.d.ts +52 -0
  236. package/dist/host/list.d.ts.map +1 -0
  237. package/dist/host/list.js +149 -0
  238. package/dist/host/list.js.map +1 -0
  239. package/dist/host/members.d.ts +58 -0
  240. package/dist/host/members.d.ts.map +1 -0
  241. package/dist/host/members.js +178 -0
  242. package/dist/host/members.js.map +1 -0
  243. package/dist/host/named-query.d.ts +67 -0
  244. package/dist/host/named-query.d.ts.map +1 -0
  245. package/dist/host/named-query.js +166 -0
  246. package/dist/host/named-query.js.map +1 -0
  247. package/dist/host/native.d.ts +64 -0
  248. package/dist/host/native.d.ts.map +1 -0
  249. package/dist/host/native.js +126 -0
  250. package/dist/host/native.js.map +1 -0
  251. package/dist/host/object.d.ts +388 -0
  252. package/dist/host/object.d.ts.map +1 -0
  253. package/dist/host/object.js +1527 -0
  254. package/dist/host/object.js.map +1 -0
  255. package/dist/host/old-work.d.ts +34 -0
  256. package/dist/host/old-work.d.ts.map +1 -0
  257. package/dist/host/old-work.js +52 -0
  258. package/dist/host/old-work.js.map +1 -0
  259. package/dist/host/parked.d.ts +23 -0
  260. package/dist/host/parked.d.ts.map +1 -0
  261. package/dist/host/parked.js +79 -0
  262. package/dist/host/parked.js.map +1 -0
  263. package/dist/host/presence.d.ts +34 -0
  264. package/dist/host/presence.d.ts.map +1 -0
  265. package/dist/host/presence.js +117 -0
  266. package/dist/host/presence.js.map +1 -0
  267. package/dist/host/query-reader.d.ts +80 -0
  268. package/dist/host/query-reader.d.ts.map +1 -0
  269. package/dist/host/query-reader.js +182 -0
  270. package/dist/host/query-reader.js.map +1 -0
  271. package/dist/host/read-declarations.d.ts +75 -0
  272. package/dist/host/read-declarations.d.ts.map +1 -0
  273. package/dist/host/read-declarations.js +152 -0
  274. package/dist/host/read-declarations.js.map +1 -0
  275. package/dist/host/readiness.d.ts +27 -0
  276. package/dist/host/readiness.d.ts.map +1 -0
  277. package/dist/host/readiness.js +134 -0
  278. package/dist/host/readiness.js.map +1 -0
  279. package/dist/host/ref-state.d.ts +53 -0
  280. package/dist/host/ref-state.d.ts.map +1 -0
  281. package/dist/host/ref-state.js +83 -0
  282. package/dist/host/ref-state.js.map +1 -0
  283. package/dist/host/reference-events.d.ts +51 -0
  284. package/dist/host/reference-events.d.ts.map +1 -0
  285. package/dist/host/reference-events.js +133 -0
  286. package/dist/host/reference-events.js.map +1 -0
  287. package/dist/host/reference-keys.d.ts +36 -0
  288. package/dist/host/reference-keys.d.ts.map +1 -0
  289. package/dist/host/reference-keys.js +168 -0
  290. package/dist/host/reference-keys.js.map +1 -0
  291. package/dist/host/reference-source.d.ts +77 -0
  292. package/dist/host/reference-source.d.ts.map +1 -0
  293. package/dist/host/reference-source.js +326 -0
  294. package/dist/host/reference-source.js.map +1 -0
  295. package/dist/host/reference.d.ts +377 -0
  296. package/dist/host/reference.d.ts.map +1 -0
  297. package/dist/host/reference.js +986 -0
  298. package/dist/host/reference.js.map +1 -0
  299. package/dist/host/reload-cycle.d.ts +16 -0
  300. package/dist/host/reload-cycle.d.ts.map +1 -0
  301. package/dist/host/reload-cycle.js +81 -0
  302. package/dist/host/reload-cycle.js.map +1 -0
  303. package/dist/host/retry-on.d.ts +28 -0
  304. package/dist/host/retry-on.d.ts.map +1 -0
  305. package/dist/host/retry-on.js +52 -0
  306. package/dist/host/retry-on.js.map +1 -0
  307. package/dist/host/revocation.d.ts +16 -0
  308. package/dist/host/revocation.d.ts.map +1 -0
  309. package/dist/host/revocation.js +27 -0
  310. package/dist/host/revocation.js.map +1 -0
  311. package/dist/host/root.d.ts +37 -0
  312. package/dist/host/root.d.ts.map +1 -0
  313. package/dist/host/root.js +68 -0
  314. package/dist/host/root.js.map +1 -0
  315. package/dist/host/route-admission.d.ts +24 -0
  316. package/dist/host/route-admission.d.ts.map +1 -0
  317. package/dist/host/route-admission.js +238 -0
  318. package/dist/host/route-admission.js.map +1 -0
  319. package/dist/host/route.d.ts +88 -0
  320. package/dist/host/route.d.ts.map +1 -0
  321. package/dist/host/route.js +247 -0
  322. package/dist/host/route.js.map +1 -0
  323. package/dist/host/routines.d.ts +78 -0
  324. package/dist/host/routines.d.ts.map +1 -0
  325. package/dist/host/routines.js +398 -0
  326. package/dist/host/routines.js.map +1 -0
  327. package/dist/host/sleep.d.ts +9 -0
  328. package/dist/host/sleep.d.ts.map +1 -0
  329. package/dist/host/sleep.js +40 -0
  330. package/dist/host/sleep.js.map +1 -0
  331. package/dist/host/staging.d.ts +100 -0
  332. package/dist/host/staging.d.ts.map +1 -0
  333. package/dist/host/staging.js +413 -0
  334. package/dist/host/staging.js.map +1 -0
  335. package/dist/host/tiling.d.ts +57 -0
  336. package/dist/host/tiling.d.ts.map +1 -0
  337. package/dist/host/tiling.js +269 -0
  338. package/dist/host/tiling.js.map +1 -0
  339. package/dist/host/unbound-clock.d.ts +23 -0
  340. package/dist/host/unbound-clock.d.ts.map +1 -0
  341. package/dist/host/unbound-clock.js +58 -0
  342. package/dist/host/unbound-clock.js.map +1 -0
  343. package/dist/host/unbound.d.ts +37 -0
  344. package/dist/host/unbound.d.ts.map +1 -0
  345. package/dist/host/unbound.js +88 -0
  346. package/dist/host/unbound.js.map +1 -0
  347. package/dist/host/uuid.d.ts +3 -0
  348. package/dist/host/uuid.d.ts.map +1 -0
  349. package/dist/host/uuid.js +38 -0
  350. package/dist/host/uuid.js.map +1 -0
  351. package/dist/index.d.ts +28 -0
  352. package/dist/index.d.ts.map +1 -0
  353. package/dist/index.js +21 -0
  354. package/dist/index.js.map +1 -0
  355. package/dist/jobs/definition.d.ts +96 -0
  356. package/dist/jobs/definition.d.ts.map +1 -0
  357. package/dist/jobs/definition.js +83 -0
  358. package/dist/jobs/definition.js.map +1 -0
  359. package/dist/jobs/index.d.ts +5 -0
  360. package/dist/jobs/index.d.ts.map +1 -0
  361. package/dist/jobs/index.js +3 -0
  362. package/dist/jobs/index.js.map +1 -0
  363. package/dist/jobs/internal.d.ts +3 -0
  364. package/dist/jobs/internal.d.ts.map +1 -0
  365. package/dist/jobs/internal.js +4 -0
  366. package/dist/jobs/internal.js.map +1 -0
  367. package/dist/jobs/job.d.ts +149 -0
  368. package/dist/jobs/job.d.ts.map +1 -0
  369. package/dist/jobs/job.js +387 -0
  370. package/dist/jobs/job.js.map +1 -0
  371. package/dist/jobs/persisted.d.ts +38 -0
  372. package/dist/jobs/persisted.d.ts.map +1 -0
  373. package/dist/jobs/persisted.js +95 -0
  374. package/dist/jobs/persisted.js.map +1 -0
  375. package/dist/jobs/records.d.ts +231 -0
  376. package/dist/jobs/records.d.ts.map +1 -0
  377. package/dist/jobs/records.js +871 -0
  378. package/dist/jobs/records.js.map +1 -0
  379. package/dist/jobs/run-states.d.ts +69 -0
  380. package/dist/jobs/run-states.d.ts.map +1 -0
  381. package/dist/jobs/run-states.js +228 -0
  382. package/dist/jobs/run-states.js.map +1 -0
  383. package/dist/jobs/run.d.ts +117 -0
  384. package/dist/jobs/run.d.ts.map +1 -0
  385. package/dist/jobs/run.js +204 -0
  386. package/dist/jobs/run.js.map +1 -0
  387. package/dist/jobs/running.d.ts +44 -0
  388. package/dist/jobs/running.d.ts.map +1 -0
  389. package/dist/jobs/running.js +117 -0
  390. package/dist/jobs/running.js.map +1 -0
  391. package/dist/jobs/stored.d.ts +63 -0
  392. package/dist/jobs/stored.d.ts.map +1 -0
  393. package/dist/jobs/stored.js +55 -0
  394. package/dist/jobs/stored.js.map +1 -0
  395. package/dist/json.d.ts +18 -0
  396. package/dist/json.d.ts.map +1 -0
  397. package/dist/json.js +124 -0
  398. package/dist/json.js.map +1 -0
  399. package/dist/link/binary.d.ts +4 -0
  400. package/dist/link/binary.d.ts.map +1 -0
  401. package/dist/link/binary.js +574 -0
  402. package/dist/link/binary.js.map +1 -0
  403. package/dist/link/channel.d.ts +78 -0
  404. package/dist/link/channel.d.ts.map +1 -0
  405. package/dist/link/channel.js +252 -0
  406. package/dist/link/channel.js.map +1 -0
  407. package/dist/link/errors.d.ts +7 -0
  408. package/dist/link/errors.d.ts.map +1 -0
  409. package/dist/link/errors.js +21 -0
  410. package/dist/link/errors.js.map +1 -0
  411. package/dist/link/index.d.ts +8 -0
  412. package/dist/link/index.d.ts.map +1 -0
  413. package/dist/link/index.js +8 -0
  414. package/dist/link/index.js.map +1 -0
  415. package/dist/link/internal.d.ts +9 -0
  416. package/dist/link/internal.d.ts.map +1 -0
  417. package/dist/link/internal.js +10 -0
  418. package/dist/link/internal.js.map +1 -0
  419. package/dist/link/ipc.d.ts +22 -0
  420. package/dist/link/ipc.d.ts.map +1 -0
  421. package/dist/link/ipc.js +64 -0
  422. package/dist/link/ipc.js.map +1 -0
  423. package/dist/link/link.d.ts +34 -0
  424. package/dist/link/link.d.ts.map +1 -0
  425. package/dist/link/link.js +87 -0
  426. package/dist/link/link.js.map +1 -0
  427. package/dist/link/message.d.ts +278 -0
  428. package/dist/link/message.d.ts.map +1 -0
  429. package/dist/link/message.js +179 -0
  430. package/dist/link/message.js.map +1 -0
  431. package/dist/link/part.d.ts +80 -0
  432. package/dist/link/part.d.ts.map +1 -0
  433. package/dist/link/part.js +165 -0
  434. package/dist/link/part.js.map +1 -0
  435. package/dist/link/text.d.ts +6 -0
  436. package/dist/link/text.d.ts.map +1 -0
  437. package/dist/link/text.js +383 -0
  438. package/dist/link/text.js.map +1 -0
  439. package/dist/link/values.d.ts +40 -0
  440. package/dist/link/values.d.ts.map +1 -0
  441. package/dist/link/values.js +121 -0
  442. package/dist/link/values.js.map +1 -0
  443. package/dist/link/websocket.d.ts +26 -0
  444. package/dist/link/websocket.d.ts.map +1 -0
  445. package/dist/link/websocket.js +91 -0
  446. package/dist/link/websocket.js.map +1 -0
  447. package/dist/node/app/app.d.ts +283 -0
  448. package/dist/node/app/app.d.ts.map +1 -0
  449. package/dist/node/app/app.js +598 -0
  450. package/dist/node/app/app.js.map +1 -0
  451. package/dist/node/app/archive.d.ts +44 -0
  452. package/dist/node/app/archive.d.ts.map +1 -0
  453. package/dist/node/app/archive.js +212 -0
  454. package/dist/node/app/archive.js.map +1 -0
  455. package/dist/node/app/blobs.d.ts +23 -0
  456. package/dist/node/app/blobs.d.ts.map +1 -0
  457. package/dist/node/app/blobs.js +64 -0
  458. package/dist/node/app/blobs.js.map +1 -0
  459. package/dist/node/app/data.d.ts +40 -0
  460. package/dist/node/app/data.d.ts.map +1 -0
  461. package/dist/node/app/data.js +47 -0
  462. package/dist/node/app/data.js.map +1 -0
  463. package/dist/node/app/ephemeral-sign-ins.d.ts +20 -0
  464. package/dist/node/app/ephemeral-sign-ins.d.ts.map +1 -0
  465. package/dist/node/app/ephemeral-sign-ins.js +69 -0
  466. package/dist/node/app/ephemeral-sign-ins.js.map +1 -0
  467. package/dist/node/app/ephemeral.d.ts +11 -0
  468. package/dist/node/app/ephemeral.d.ts.map +1 -0
  469. package/dist/node/app/ephemeral.js +34 -0
  470. package/dist/node/app/ephemeral.js.map +1 -0
  471. package/dist/node/app/files-copy.d.ts +13 -0
  472. package/dist/node/app/files-copy.d.ts.map +1 -0
  473. package/dist/node/app/files-copy.js +86 -0
  474. package/dist/node/app/files-copy.js.map +1 -0
  475. package/dist/node/app/files-entry.d.ts +4 -0
  476. package/dist/node/app/files-entry.d.ts.map +1 -0
  477. package/dist/node/app/files-entry.js +7 -0
  478. package/dist/node/app/files-entry.js.map +1 -0
  479. package/dist/node/app/files-index.d.ts +180 -0
  480. package/dist/node/app/files-index.d.ts.map +1 -0
  481. package/dist/node/app/files-index.js +535 -0
  482. package/dist/node/app/files-index.js.map +1 -0
  483. package/dist/node/app/files.d.ts +388 -0
  484. package/dist/node/app/files.d.ts.map +1 -0
  485. package/dist/node/app/files.js +368 -0
  486. package/dist/node/app/files.js.map +1 -0
  487. package/dist/node/app/folder-views.d.ts +21 -0
  488. package/dist/node/app/folder-views.d.ts.map +1 -0
  489. package/dist/node/app/folder-views.js +55 -0
  490. package/dist/node/app/folder-views.js.map +1 -0
  491. package/dist/node/app/index.d.ts +12 -0
  492. package/dist/node/app/index.d.ts.map +1 -0
  493. package/dist/node/app/index.js +15 -0
  494. package/dist/node/app/index.js.map +1 -0
  495. package/dist/node/app/info.d.ts +70 -0
  496. package/dist/node/app/info.d.ts.map +1 -0
  497. package/dist/node/app/info.js +37 -0
  498. package/dist/node/app/info.js.map +1 -0
  499. package/dist/node/app/invite.d.ts +5 -0
  500. package/dist/node/app/invite.d.ts.map +1 -0
  501. package/dist/node/app/invite.js +64 -0
  502. package/dist/node/app/invite.js.map +1 -0
  503. package/dist/node/app/layout.d.ts +36 -0
  504. package/dist/node/app/layout.d.ts.map +1 -0
  505. package/dist/node/app/layout.js +87 -0
  506. package/dist/node/app/layout.js.map +1 -0
  507. package/dist/node/app/owner.d.ts +31 -0
  508. package/dist/node/app/owner.d.ts.map +1 -0
  509. package/dist/node/app/owner.js +104 -0
  510. package/dist/node/app/owner.js.map +1 -0
  511. package/dist/node/app/pairing.d.ts +55 -0
  512. package/dist/node/app/pairing.d.ts.map +1 -0
  513. package/dist/node/app/pairing.js +183 -0
  514. package/dist/node/app/pairing.js.map +1 -0
  515. package/dist/node/app/secrets.d.ts +16 -0
  516. package/dist/node/app/secrets.d.ts.map +1 -0
  517. package/dist/node/app/secrets.js +72 -0
  518. package/dist/node/app/secrets.js.map +1 -0
  519. package/dist/node/app/sign-ins.d.ts +74 -0
  520. package/dist/node/app/sign-ins.d.ts.map +1 -0
  521. package/dist/node/app/sign-ins.js +222 -0
  522. package/dist/node/app/sign-ins.js.map +1 -0
  523. package/dist/node/app/tar.d.ts +24 -0
  524. package/dist/node/app/tar.d.ts.map +1 -0
  525. package/dist/node/app/tar.js +167 -0
  526. package/dist/node/app/tar.js.map +1 -0
  527. package/dist/node/app/uploads.d.ts +37 -0
  528. package/dist/node/app/uploads.d.ts.map +1 -0
  529. package/dist/node/app/uploads.js +157 -0
  530. package/dist/node/app/uploads.js.map +1 -0
  531. package/dist/node/app/users.d.ts +39 -0
  532. package/dist/node/app/users.d.ts.map +1 -0
  533. package/dist/node/app/users.js +62 -0
  534. package/dist/node/app/users.js.map +1 -0
  535. package/dist/node/app/worker.d.ts +18 -0
  536. package/dist/node/app/worker.d.ts.map +1 -0
  537. package/dist/node/app/worker.js +84 -0
  538. package/dist/node/app/worker.js.map +1 -0
  539. package/dist/node/compression.d.ts +7 -0
  540. package/dist/node/compression.d.ts.map +1 -0
  541. package/dist/node/compression.js +25 -0
  542. package/dist/node/compression.js.map +1 -0
  543. package/dist/node/http/admission.d.ts +64 -0
  544. package/dist/node/http/admission.d.ts.map +1 -0
  545. package/dist/node/http/admission.js +137 -0
  546. package/dist/node/http/admission.js.map +1 -0
  547. package/dist/node/http/authenticate.d.ts +21 -0
  548. package/dist/node/http/authenticate.d.ts.map +1 -0
  549. package/dist/node/http/authenticate.js +34 -0
  550. package/dist/node/http/authenticate.js.map +1 -0
  551. package/dist/node/http/cookies.d.ts +32 -0
  552. package/dist/node/http/cookies.d.ts.map +1 -0
  553. package/dist/node/http/cookies.js +70 -0
  554. package/dist/node/http/cookies.js.map +1 -0
  555. package/dist/node/http/file.d.ts +23 -0
  556. package/dist/node/http/file.d.ts.map +1 -0
  557. package/dist/node/http/file.js +94 -0
  558. package/dist/node/http/file.js.map +1 -0
  559. package/dist/node/http/headers.d.ts +37 -0
  560. package/dist/node/http/headers.d.ts.map +1 -0
  561. package/dist/node/http/headers.js +136 -0
  562. package/dist/node/http/headers.js.map +1 -0
  563. package/dist/node/http/http.d.ts +114 -0
  564. package/dist/node/http/http.d.ts.map +1 -0
  565. package/dist/node/http/http.js +524 -0
  566. package/dist/node/http/http.js.map +1 -0
  567. package/dist/node/http/incoming.d.ts +19 -0
  568. package/dist/node/http/incoming.d.ts.map +1 -0
  569. package/dist/node/http/incoming.js +31 -0
  570. package/dist/node/http/incoming.js.map +1 -0
  571. package/dist/node/http/index.d.ts +11 -0
  572. package/dist/node/http/index.d.ts.map +1 -0
  573. package/dist/node/http/index.js +12 -0
  574. package/dist/node/http/index.js.map +1 -0
  575. package/dist/node/http/node.d.ts +78 -0
  576. package/dist/node/http/node.d.ts.map +1 -0
  577. package/dist/node/http/node.js +291 -0
  578. package/dist/node/http/node.js.map +1 -0
  579. package/dist/node/http/request.d.ts +60 -0
  580. package/dist/node/http/request.d.ts.map +1 -0
  581. package/dist/node/http/request.js +118 -0
  582. package/dist/node/http/request.js.map +1 -0
  583. package/dist/node/http/response.d.ts +63 -0
  584. package/dist/node/http/response.d.ts.map +1 -0
  585. package/dist/node/http/response.js +202 -0
  586. package/dist/node/http/response.js.map +1 -0
  587. package/dist/node/http/router.d.ts +132 -0
  588. package/dist/node/http/router.d.ts.map +1 -0
  589. package/dist/node/http/router.js +267 -0
  590. package/dist/node/http/router.js.map +1 -0
  591. package/dist/node/http/upgrades.d.ts +62 -0
  592. package/dist/node/http/upgrades.d.ts.map +1 -0
  593. package/dist/node/http/upgrades.js +194 -0
  594. package/dist/node/http/upgrades.js.map +1 -0
  595. package/dist/node/plugins/base-inputs.d.ts +14 -0
  596. package/dist/node/plugins/base-inputs.d.ts.map +1 -0
  597. package/dist/node/plugins/base-inputs.js +33 -0
  598. package/dist/node/plugins/base-inputs.js.map +1 -0
  599. package/dist/node/plugins/build.d.ts +77 -0
  600. package/dist/node/plugins/build.d.ts.map +1 -0
  601. package/dist/node/plugins/build.js +577 -0
  602. package/dist/node/plugins/build.js.map +1 -0
  603. package/dist/node/plugins/css-modules.d.ts +13 -0
  604. package/dist/node/plugins/css-modules.d.ts.map +1 -0
  605. package/dist/node/plugins/css-modules.js +58 -0
  606. package/dist/node/plugins/css-modules.js.map +1 -0
  607. package/dist/node/plugins/discover.d.ts +67 -0
  608. package/dist/node/plugins/discover.d.ts.map +1 -0
  609. package/dist/node/plugins/discover.js +369 -0
  610. package/dist/node/plugins/discover.js.map +1 -0
  611. package/dist/node/plugins/evaluate.d.ts +33 -0
  612. package/dist/node/plugins/evaluate.d.ts.map +1 -0
  613. package/dist/node/plugins/evaluate.js +121 -0
  614. package/dist/node/plugins/evaluate.js.map +1 -0
  615. package/dist/node/plugins/index.d.ts +11 -0
  616. package/dist/node/plugins/index.d.ts.map +1 -0
  617. package/dist/node/plugins/index.js +13 -0
  618. package/dist/node/plugins/index.js.map +1 -0
  619. package/dist/node/plugins/install.d.ts +40 -0
  620. package/dist/node/plugins/install.d.ts.map +1 -0
  621. package/dist/node/plugins/install.js +215 -0
  622. package/dist/node/plugins/install.js.map +1 -0
  623. package/dist/node/plugins/plugins.d.ts +165 -0
  624. package/dist/node/plugins/plugins.d.ts.map +1 -0
  625. package/dist/node/plugins/plugins.js +268 -0
  626. package/dist/node/plugins/plugins.js.map +1 -0
  627. package/dist/node/plugins/runtime.d.ts +57 -0
  628. package/dist/node/plugins/runtime.d.ts.map +1 -0
  629. package/dist/node/plugins/runtime.js +92 -0
  630. package/dist/node/plugins/runtime.js.map +1 -0
  631. package/dist/node/plugins/stack.d.ts +16 -0
  632. package/dist/node/plugins/stack.d.ts.map +1 -0
  633. package/dist/node/plugins/stack.js +70 -0
  634. package/dist/node/plugins/stack.js.map +1 -0
  635. package/dist/node/plugins/testing.d.ts +58 -0
  636. package/dist/node/plugins/testing.d.ts.map +1 -0
  637. package/dist/node/plugins/testing.js +210 -0
  638. package/dist/node/plugins/testing.js.map +1 -0
  639. package/dist/node/plugins/watcher.d.ts +69 -0
  640. package/dist/node/plugins/watcher.d.ts.map +1 -0
  641. package/dist/node/plugins/watcher.js +622 -0
  642. package/dist/node/plugins/watcher.js.map +1 -0
  643. package/dist/node/surfaces/bundle.d.ts +40 -0
  644. package/dist/node/surfaces/bundle.d.ts.map +1 -0
  645. package/dist/node/surfaces/bundle.js +121 -0
  646. package/dist/node/surfaces/bundle.js.map +1 -0
  647. package/dist/node/surfaces/current.d.ts +17 -0
  648. package/dist/node/surfaces/current.d.ts.map +1 -0
  649. package/dist/node/surfaces/current.js +54 -0
  650. package/dist/node/surfaces/current.js.map +1 -0
  651. package/dist/node/surfaces/index.d.ts +6 -0
  652. package/dist/node/surfaces/index.d.ts.map +1 -0
  653. package/dist/node/surfaces/index.js +6 -0
  654. package/dist/node/surfaces/index.js.map +1 -0
  655. package/dist/node/surfaces/published.d.ts +27 -0
  656. package/dist/node/surfaces/published.d.ts.map +1 -0
  657. package/dist/node/surfaces/published.js +142 -0
  658. package/dist/node/surfaces/published.js.map +1 -0
  659. package/dist/node/surfaces/served.d.ts +17 -0
  660. package/dist/node/surfaces/served.d.ts.map +1 -0
  661. package/dist/node/surfaces/served.js +44 -0
  662. package/dist/node/surfaces/served.js.map +1 -0
  663. package/dist/node/surfaces/surface-build.d.ts +53 -0
  664. package/dist/node/surfaces/surface-build.d.ts.map +1 -0
  665. package/dist/node/surfaces/surface-build.js +105 -0
  666. package/dist/node/surfaces/surface-build.js.map +1 -0
  667. package/dist/node/surfaces/tui.d.ts +42 -0
  668. package/dist/node/surfaces/tui.d.ts.map +1 -0
  669. package/dist/node/surfaces/tui.js +59 -0
  670. package/dist/node/surfaces/tui.js.map +1 -0
  671. package/dist/node/surfaces/web.d.ts +82 -0
  672. package/dist/node/surfaces/web.d.ts.map +1 -0
  673. package/dist/node/surfaces/web.js +122 -0
  674. package/dist/node/surfaces/web.js.map +1 -0
  675. package/dist/node/tui/actions.d.ts +49 -0
  676. package/dist/node/tui/actions.d.ts.map +1 -0
  677. package/dist/node/tui/actions.js +195 -0
  678. package/dist/node/tui/actions.js.map +1 -0
  679. package/dist/node/tui/credentials.d.ts +17 -0
  680. package/dist/node/tui/credentials.d.ts.map +1 -0
  681. package/dist/node/tui/credentials.js +54 -0
  682. package/dist/node/tui/credentials.js.map +1 -0
  683. package/dist/node/tui/filter.d.ts +5 -0
  684. package/dist/node/tui/filter.d.ts.map +1 -0
  685. package/dist/node/tui/filter.js +79 -0
  686. package/dist/node/tui/filter.js.map +1 -0
  687. package/dist/node/tui/index.d.ts +6 -0
  688. package/dist/node/tui/index.d.ts.map +1 -0
  689. package/dist/node/tui/index.js +6 -0
  690. package/dist/node/tui/index.js.map +1 -0
  691. package/dist/node/tui/launcher.d.ts +40 -0
  692. package/dist/node/tui/launcher.d.ts.map +1 -0
  693. package/dist/node/tui/launcher.js +439 -0
  694. package/dist/node/tui/launcher.js.map +1 -0
  695. package/dist/node/tui/pipe.d.ts +18 -0
  696. package/dist/node/tui/pipe.d.ts.map +1 -0
  697. package/dist/node/tui/pipe.js +134 -0
  698. package/dist/node/tui/pipe.js.map +1 -0
  699. package/dist/node/tui/sandbox.d.ts +54 -0
  700. package/dist/node/tui/sandbox.d.ts.map +1 -0
  701. package/dist/node/tui/sandbox.js +431 -0
  702. package/dist/node/tui/sandbox.js.map +1 -0
  703. package/dist/node/workers/base.d.ts +30 -0
  704. package/dist/node/workers/base.d.ts.map +1 -0
  705. package/dist/node/workers/base.js +260 -0
  706. package/dist/node/workers/base.js.map +1 -0
  707. package/dist/node/workers/child.d.ts +4 -0
  708. package/dist/node/workers/child.d.ts.map +1 -0
  709. package/dist/node/workers/child.js +6 -0
  710. package/dist/node/workers/child.js.map +1 -0
  711. package/dist/node/workers/control.d.ts +83 -0
  712. package/dist/node/workers/control.d.ts.map +1 -0
  713. package/dist/node/workers/control.js +77 -0
  714. package/dist/node/workers/control.js.map +1 -0
  715. package/dist/node/workers/index.d.ts +4 -0
  716. package/dist/node/workers/index.d.ts.map +1 -0
  717. package/dist/node/workers/index.js +7 -0
  718. package/dist/node/workers/index.js.map +1 -0
  719. package/dist/node/workers/lock.d.ts +30 -0
  720. package/dist/node/workers/lock.d.ts.map +1 -0
  721. package/dist/node/workers/lock.js +180 -0
  722. package/dist/node/workers/lock.js.map +1 -0
  723. package/dist/node/workers/main.d.ts +46 -0
  724. package/dist/node/workers/main.d.ts.map +1 -0
  725. package/dist/node/workers/main.js +230 -0
  726. package/dist/node/workers/main.js.map +1 -0
  727. package/dist/node/workers/process.d.ts +43 -0
  728. package/dist/node/workers/process.d.ts.map +1 -0
  729. package/dist/node/workers/process.js +137 -0
  730. package/dist/node/workers/process.js.map +1 -0
  731. package/dist/node/workers/workers.d.ts +144 -0
  732. package/dist/node/workers/workers.d.ts.map +1 -0
  733. package/dist/node/workers/workers.js +723 -0
  734. package/dist/node/workers/workers.js.map +1 -0
  735. package/dist/output.d.ts +91 -0
  736. package/dist/output.d.ts.map +1 -0
  737. package/dist/output.js +362 -0
  738. package/dist/output.js.map +1 -0
  739. package/dist/react/hooks.d.ts +61 -0
  740. package/dist/react/hooks.d.ts.map +1 -0
  741. package/dist/react/hooks.js +119 -0
  742. package/dist/react/hooks.js.map +1 -0
  743. package/dist/react/index.d.ts +4 -0
  744. package/dist/react/index.d.ts.map +1 -0
  745. package/dist/react/index.js +4 -0
  746. package/dist/react/index.js.map +1 -0
  747. package/dist/react/stores.d.ts +9 -0
  748. package/dist/react/stores.d.ts.map +1 -0
  749. package/dist/react/stores.js +37 -0
  750. package/dist/react/stores.js.map +1 -0
  751. package/dist/registries/contribution.d.ts +50 -0
  752. package/dist/registries/contribution.d.ts.map +1 -0
  753. package/dist/registries/contribution.js +129 -0
  754. package/dist/registries/contribution.js.map +1 -0
  755. package/dist/registries/entries.d.ts +18 -0
  756. package/dist/registries/entries.d.ts.map +1 -0
  757. package/dist/registries/entries.js +42 -0
  758. package/dist/registries/entries.js.map +1 -0
  759. package/dist/registries/index.d.ts +3 -0
  760. package/dist/registries/index.d.ts.map +1 -0
  761. package/dist/registries/index.js +5 -0
  762. package/dist/registries/index.js.map +1 -0
  763. package/dist/registries/internal.d.ts +4 -0
  764. package/dist/registries/internal.d.ts.map +1 -0
  765. package/dist/registries/internal.js +5 -0
  766. package/dist/registries/internal.js.map +1 -0
  767. package/dist/registries/record.d.ts +115 -0
  768. package/dist/registries/record.d.ts.map +1 -0
  769. package/dist/registries/record.js +283 -0
  770. package/dist/registries/record.js.map +1 -0
  771. package/dist/registries/registry.d.ts +74 -0
  772. package/dist/registries/registry.d.ts.map +1 -0
  773. package/dist/registries/registry.js +14 -0
  774. package/dist/registries/registry.js.map +1 -0
  775. package/dist/registries/value.d.ts +48 -0
  776. package/dist/registries/value.d.ts.map +1 -0
  777. package/dist/registries/value.js +224 -0
  778. package/dist/registries/value.js.map +1 -0
  779. package/dist/remote/calls.d.ts +34 -0
  780. package/dist/remote/calls.d.ts.map +1 -0
  781. package/dist/remote/calls.js +75 -0
  782. package/dist/remote/calls.js.map +1 -0
  783. package/dist/remote/consumer.d.ts +59 -0
  784. package/dist/remote/consumer.d.ts.map +1 -0
  785. package/dist/remote/consumer.js +468 -0
  786. package/dist/remote/consumer.js.map +1 -0
  787. package/dist/remote/hold.d.ts +147 -0
  788. package/dist/remote/hold.d.ts.map +1 -0
  789. package/dist/remote/hold.js +653 -0
  790. package/dist/remote/hold.js.map +1 -0
  791. package/dist/remote/host-link.d.ts +81 -0
  792. package/dist/remote/host-link.d.ts.map +1 -0
  793. package/dist/remote/host-link.js +198 -0
  794. package/dist/remote/host-link.js.map +1 -0
  795. package/dist/remote/internal.d.ts +6 -0
  796. package/dist/remote/internal.d.ts.map +1 -0
  797. package/dist/remote/internal.js +6 -0
  798. package/dist/remote/internal.js.map +1 -0
  799. package/dist/remote/path.d.ts +105 -0
  800. package/dist/remote/path.d.ts.map +1 -0
  801. package/dist/remote/path.js +197 -0
  802. package/dist/remote/path.js.map +1 -0
  803. package/dist/remote/provider.d.ts +113 -0
  804. package/dist/remote/provider.d.ts.map +1 -0
  805. package/dist/remote/provider.js +787 -0
  806. package/dist/remote/provider.js.map +1 -0
  807. package/dist/remote/relay.d.ts +126 -0
  808. package/dist/remote/relay.d.ts.map +1 -0
  809. package/dist/remote/relay.js +334 -0
  810. package/dist/remote/relay.js.map +1 -0
  811. package/dist/remote/remote-object.d.ts +181 -0
  812. package/dist/remote/remote-object.d.ts.map +1 -0
  813. package/dist/remote/remote-object.js +683 -0
  814. package/dist/remote/remote-object.js.map +1 -0
  815. package/dist/remote/replica.d.ts +66 -0
  816. package/dist/remote/replica.d.ts.map +1 -0
  817. package/dist/remote/replica.js +148 -0
  818. package/dist/remote/replica.js.map +1 -0
  819. package/dist/sqlite/cloudflare.d.ts +54 -0
  820. package/dist/sqlite/cloudflare.d.ts.map +1 -0
  821. package/dist/sqlite/cloudflare.js +144 -0
  822. package/dist/sqlite/cloudflare.js.map +1 -0
  823. package/dist/sqlite/database.d.ts +40 -0
  824. package/dist/sqlite/database.d.ts.map +1 -0
  825. package/dist/sqlite/database.js +2 -0
  826. package/dist/sqlite/database.js.map +1 -0
  827. package/dist/sqlite/index.d.ts +4 -0
  828. package/dist/sqlite/index.d.ts.map +1 -0
  829. package/dist/sqlite/index.js +3 -0
  830. package/dist/sqlite/index.js.map +1 -0
  831. package/dist/sqlite/migrations.d.ts +10 -0
  832. package/dist/sqlite/migrations.d.ts.map +1 -0
  833. package/dist/sqlite/migrations.js +33 -0
  834. package/dist/sqlite/migrations.js.map +1 -0
  835. package/dist/sqlite/node.d.ts +49 -0
  836. package/dist/sqlite/node.d.ts.map +1 -0
  837. package/dist/sqlite/node.js +197 -0
  838. package/dist/sqlite/node.js.map +1 -0
  839. package/dist/sqlite/schema.d.ts +3 -0
  840. package/dist/sqlite/schema.d.ts.map +1 -0
  841. package/dist/sqlite/schema.js +10 -0
  842. package/dist/sqlite/schema.js.map +1 -0
  843. package/dist/state/batch.d.ts +64 -0
  844. package/dist/state/batch.d.ts.map +1 -0
  845. package/dist/state/batch.js +164 -0
  846. package/dist/state/batch.js.map +1 -0
  847. package/dist/state/derive.d.ts +56 -0
  848. package/dist/state/derive.d.ts.map +1 -0
  849. package/dist/state/derive.js +192 -0
  850. package/dist/state/derive.js.map +1 -0
  851. package/dist/state/framed.d.ts +43 -0
  852. package/dist/state/framed.d.ts.map +1 -0
  853. package/dist/state/framed.js +121 -0
  854. package/dist/state/framed.js.map +1 -0
  855. package/dist/state/index.d.ts +6 -0
  856. package/dist/state/index.d.ts.map +1 -0
  857. package/dist/state/index.js +4 -0
  858. package/dist/state/index.js.map +1 -0
  859. package/dist/state/internal.d.ts +7 -0
  860. package/dist/state/internal.d.ts.map +1 -0
  861. package/dist/state/internal.js +9 -0
  862. package/dist/state/internal.js.map +1 -0
  863. package/dist/state/native-source.d.ts +106 -0
  864. package/dist/state/native-source.d.ts.map +1 -0
  865. package/dist/state/native-source.js +240 -0
  866. package/dist/state/native-source.js.map +1 -0
  867. package/dist/state/watchable.d.ts +114 -0
  868. package/dist/state/watchable.d.ts.map +1 -0
  869. package/dist/state/watchable.js +156 -0
  870. package/dist/state/watchable.js.map +1 -0
  871. package/dist/state/writable.d.ts +32 -0
  872. package/dist/state/writable.d.ts.map +1 -0
  873. package/dist/state/writable.js +49 -0
  874. package/dist/state/writable.js.map +1 -0
  875. package/dist/store/adapter.d.ts +67 -0
  876. package/dist/store/adapter.d.ts.map +1 -0
  877. package/dist/store/adapter.js +118 -0
  878. package/dist/store/adapter.js.map +1 -0
  879. package/dist/store/allocator.d.ts +17 -0
  880. package/dist/store/allocator.d.ts.map +1 -0
  881. package/dist/store/allocator.js +30 -0
  882. package/dist/store/allocator.js.map +1 -0
  883. package/dist/store/applier.d.ts +8 -0
  884. package/dist/store/applier.d.ts.map +1 -0
  885. package/dist/store/applier.js +390 -0
  886. package/dist/store/applier.js.map +1 -0
  887. package/dist/store/apply-batch.d.ts +12 -0
  888. package/dist/store/apply-batch.d.ts.map +1 -0
  889. package/dist/store/apply-batch.js +83 -0
  890. package/dist/store/apply-batch.js.map +1 -0
  891. package/dist/store/archive.d.ts +36 -0
  892. package/dist/store/archive.d.ts.map +1 -0
  893. package/dist/store/archive.js +140 -0
  894. package/dist/store/archive.js.map +1 -0
  895. package/dist/store/backend.d.ts +10 -0
  896. package/dist/store/backend.d.ts.map +1 -0
  897. package/dist/store/backend.js +15 -0
  898. package/dist/store/backend.js.map +1 -0
  899. package/dist/store/catalog.d.ts +24 -0
  900. package/dist/store/catalog.d.ts.map +1 -0
  901. package/dist/store/catalog.js +17 -0
  902. package/dist/store/catalog.js.map +1 -0
  903. package/dist/store/claims.d.ts +23 -0
  904. package/dist/store/claims.d.ts.map +1 -0
  905. package/dist/store/claims.js +65 -0
  906. package/dist/store/claims.js.map +1 -0
  907. package/dist/store/column-set.d.ts +64 -0
  908. package/dist/store/column-set.d.ts.map +1 -0
  909. package/dist/store/column-set.js +96 -0
  910. package/dist/store/column-set.js.map +1 -0
  911. package/dist/store/columns.d.ts +93 -0
  912. package/dist/store/columns.d.ts.map +1 -0
  913. package/dist/store/columns.js +87 -0
  914. package/dist/store/columns.js.map +1 -0
  915. package/dist/store/engine.d.ts +182 -0
  916. package/dist/store/engine.d.ts.map +1 -0
  917. package/dist/store/engine.js +290 -0
  918. package/dist/store/engine.js.map +1 -0
  919. package/dist/store/evaluate.d.ts +17 -0
  920. package/dist/store/evaluate.d.ts.map +1 -0
  921. package/dist/store/evaluate.js +131 -0
  922. package/dist/store/evaluate.js.map +1 -0
  923. package/dist/store/export.d.ts +30 -0
  924. package/dist/store/export.d.ts.map +1 -0
  925. package/dist/store/export.js +221 -0
  926. package/dist/store/export.js.map +1 -0
  927. package/dist/store/expression.d.ts +254 -0
  928. package/dist/store/expression.d.ts.map +1 -0
  929. package/dist/store/expression.js +577 -0
  930. package/dist/store/expression.js.map +1 -0
  931. package/dist/store/host-column.d.ts +22 -0
  932. package/dist/store/host-column.d.ts.map +1 -0
  933. package/dist/store/host-column.js +36 -0
  934. package/dist/store/host-column.js.map +1 -0
  935. package/dist/store/host-data.d.ts +100 -0
  936. package/dist/store/host-data.d.ts.map +1 -0
  937. package/dist/store/host-data.js +397 -0
  938. package/dist/store/host-data.js.map +1 -0
  939. package/dist/store/import-migration.d.ts +19 -0
  940. package/dist/store/import-migration.d.ts.map +1 -0
  941. package/dist/store/import-migration.js +124 -0
  942. package/dist/store/import-migration.js.map +1 -0
  943. package/dist/store/import.d.ts +12 -0
  944. package/dist/store/import.d.ts.map +1 -0
  945. package/dist/store/import.js +279 -0
  946. package/dist/store/import.js.map +1 -0
  947. package/dist/store/index.d.ts +19 -0
  948. package/dist/store/index.d.ts.map +1 -0
  949. package/dist/store/index.js +16 -0
  950. package/dist/store/index.js.map +1 -0
  951. package/dist/store/json-column.d.ts +33 -0
  952. package/dist/store/json-column.d.ts.map +1 -0
  953. package/dist/store/json-column.js +62 -0
  954. package/dist/store/json-column.js.map +1 -0
  955. package/dist/store/jsonl.d.ts +9 -0
  956. package/dist/store/jsonl.d.ts.map +1 -0
  957. package/dist/store/jsonl.js +61 -0
  958. package/dist/store/jsonl.js.map +1 -0
  959. package/dist/store/live-query.d.ts +72 -0
  960. package/dist/store/live-query.d.ts.map +1 -0
  961. package/dist/store/live-query.js +162 -0
  962. package/dist/store/live-query.js.map +1 -0
  963. package/dist/store/open-query.d.ts +90 -0
  964. package/dist/store/open-query.d.ts.map +1 -0
  965. package/dist/store/open-query.js +201 -0
  966. package/dist/store/open-query.js.map +1 -0
  967. package/dist/store/outbox.d.ts +26 -0
  968. package/dist/store/outbox.d.ts.map +1 -0
  969. package/dist/store/outbox.js +80 -0
  970. package/dist/store/outbox.js.map +1 -0
  971. package/dist/store/page.d.ts +14 -0
  972. package/dist/store/page.d.ts.map +1 -0
  973. package/dist/store/page.js +26 -0
  974. package/dist/store/page.js.map +1 -0
  975. package/dist/store/query.d.ts +65 -0
  976. package/dist/store/query.d.ts.map +1 -0
  977. package/dist/store/query.js +193 -0
  978. package/dist/store/query.js.map +1 -0
  979. package/dist/store/read-plan.d.ts +74 -0
  980. package/dist/store/read-plan.d.ts.map +1 -0
  981. package/dist/store/read-plan.js +324 -0
  982. package/dist/store/read-plan.js.map +1 -0
  983. package/dist/store/read.d.ts +81 -0
  984. package/dist/store/read.d.ts.map +1 -0
  985. package/dist/store/read.js +113 -0
  986. package/dist/store/read.js.map +1 -0
  987. package/dist/store/reads.d.ts +79 -0
  988. package/dist/store/reads.d.ts.map +1 -0
  989. package/dist/store/reads.js +255 -0
  990. package/dist/store/reads.js.map +1 -0
  991. package/dist/store/refusal.d.ts +15 -0
  992. package/dist/store/refusal.d.ts.map +1 -0
  993. package/dist/store/refusal.js +36 -0
  994. package/dist/store/refusal.js.map +1 -0
  995. package/dist/store/rows.d.ts +96 -0
  996. package/dist/store/rows.d.ts.map +1 -0
  997. package/dist/store/rows.js +222 -0
  998. package/dist/store/rows.js.map +1 -0
  999. package/dist/store/schema.d.ts +25 -0
  1000. package/dist/store/schema.d.ts.map +1 -0
  1001. package/dist/store/schema.js +123 -0
  1002. package/dist/store/schema.js.map +1 -0
  1003. package/dist/store/skip.d.ts +26 -0
  1004. package/dist/store/skip.d.ts.map +1 -0
  1005. package/dist/store/skip.js +66 -0
  1006. package/dist/store/skip.js.map +1 -0
  1007. package/dist/store/sql.d.ts +78 -0
  1008. package/dist/store/sql.d.ts.map +1 -0
  1009. package/dist/store/sql.js +244 -0
  1010. package/dist/store/sql.js.map +1 -0
  1011. package/dist/store/step.d.ts +52 -0
  1012. package/dist/store/step.d.ts.map +1 -0
  1013. package/dist/store/step.js +59 -0
  1014. package/dist/store/step.js.map +1 -0
  1015. package/dist/store/store.d.ts +192 -0
  1016. package/dist/store/store.d.ts.map +1 -0
  1017. package/dist/store/store.js +863 -0
  1018. package/dist/store/store.js.map +1 -0
  1019. package/dist/store/table-changes.d.ts +35 -0
  1020. package/dist/store/table-changes.d.ts.map +1 -0
  1021. package/dist/store/table-changes.js +127 -0
  1022. package/dist/store/table-changes.js.map +1 -0
  1023. package/dist/store/table-evolve.d.ts +82 -0
  1024. package/dist/store/table-evolve.d.ts.map +1 -0
  1025. package/dist/store/table-evolve.js +208 -0
  1026. package/dist/store/table-evolve.js.map +1 -0
  1027. package/dist/store/table-handle.d.ts +69 -0
  1028. package/dist/store/table-handle.d.ts.map +1 -0
  1029. package/dist/store/table-handle.js +92 -0
  1030. package/dist/store/table-handle.js.map +1 -0
  1031. package/dist/store/table-history.d.ts +78 -0
  1032. package/dist/store/table-history.d.ts.map +1 -0
  1033. package/dist/store/table-history.js +43 -0
  1034. package/dist/store/table-history.js.map +1 -0
  1035. package/dist/store/table-migration.d.ts +28 -0
  1036. package/dist/store/table-migration.d.ts.map +1 -0
  1037. package/dist/store/table-migration.js +212 -0
  1038. package/dist/store/table-migration.js.map +1 -0
  1039. package/dist/store/table-writes.d.ts +125 -0
  1040. package/dist/store/table-writes.d.ts.map +1 -0
  1041. package/dist/store/table-writes.js +170 -0
  1042. package/dist/store/table-writes.js.map +1 -0
  1043. package/dist/store/table.d.ts +91 -0
  1044. package/dist/store/table.d.ts.map +1 -0
  1045. package/dist/store/table.js +133 -0
  1046. package/dist/store/table.js.map +1 -0
  1047. package/dist/store/text.d.ts +14 -0
  1048. package/dist/store/text.d.ts.map +1 -0
  1049. package/dist/store/text.js +51 -0
  1050. package/dist/store/text.js.map +1 -0
  1051. package/dist/store/writes.d.ts +5 -0
  1052. package/dist/store/writes.d.ts.map +1 -0
  1053. package/dist/store/writes.js +4 -0
  1054. package/dist/store/writes.js.map +1 -0
  1055. package/dist/surfaces/active-language.d.ts +20 -0
  1056. package/dist/surfaces/active-language.d.ts.map +1 -0
  1057. package/dist/surfaces/active-language.js +78 -0
  1058. package/dist/surfaces/active-language.js.map +1 -0
  1059. package/dist/surfaces/active-theme.d.ts +16 -0
  1060. package/dist/surfaces/active-theme.d.ts.map +1 -0
  1061. package/dist/surfaces/active-theme.js +47 -0
  1062. package/dist/surfaces/active-theme.js.map +1 -0
  1063. package/dist/surfaces/client.d.ts +106 -0
  1064. package/dist/surfaces/client.d.ts.map +1 -0
  1065. package/dist/surfaces/client.js +280 -0
  1066. package/dist/surfaces/client.js.map +1 -0
  1067. package/dist/surfaces/connection.d.ts +53 -0
  1068. package/dist/surfaces/connection.d.ts.map +1 -0
  1069. package/dist/surfaces/connection.js +161 -0
  1070. package/dist/surfaces/connection.js.map +1 -0
  1071. package/dist/surfaces/format.d.ts +5 -0
  1072. package/dist/surfaces/format.d.ts.map +1 -0
  1073. package/dist/surfaces/format.js +37 -0
  1074. package/dist/surfaces/format.js.map +1 -0
  1075. package/dist/surfaces/index.d.ts +15 -0
  1076. package/dist/surfaces/index.d.ts.map +1 -0
  1077. package/dist/surfaces/index.js +18 -0
  1078. package/dist/surfaces/index.js.map +1 -0
  1079. package/dist/surfaces/language.d.ts +53 -0
  1080. package/dist/surfaces/language.d.ts.map +1 -0
  1081. package/dist/surfaces/language.js +74 -0
  1082. package/dist/surfaces/language.js.map +1 -0
  1083. package/dist/surfaces/loaded.d.ts +42 -0
  1084. package/dist/surfaces/loaded.d.ts.map +1 -0
  1085. package/dist/surfaces/loaded.js +116 -0
  1086. package/dist/surfaces/loaded.js.map +1 -0
  1087. package/dist/surfaces/locale-choice.d.ts +26 -0
  1088. package/dist/surfaces/locale-choice.d.ts.map +1 -0
  1089. package/dist/surfaces/locale-choice.js +14 -0
  1090. package/dist/surfaces/locale-choice.js.map +1 -0
  1091. package/dist/surfaces/messages.d.ts +67 -0
  1092. package/dist/surfaces/messages.d.ts.map +1 -0
  1093. package/dist/surfaces/messages.js +112 -0
  1094. package/dist/surfaces/messages.js.map +1 -0
  1095. package/dist/surfaces/page-state.d.ts +14 -0
  1096. package/dist/surfaces/page-state.d.ts.map +1 -0
  1097. package/dist/surfaces/page-state.js +43 -0
  1098. package/dist/surfaces/page-state.js.map +1 -0
  1099. package/dist/surfaces/preference.d.ts +33 -0
  1100. package/dist/surfaces/preference.d.ts.map +1 -0
  1101. package/dist/surfaces/preference.js +72 -0
  1102. package/dist/surfaces/preference.js.map +1 -0
  1103. package/dist/surfaces/registered.d.ts +33 -0
  1104. package/dist/surfaces/registered.d.ts.map +1 -0
  1105. package/dist/surfaces/registered.js +51 -0
  1106. package/dist/surfaces/registered.js.map +1 -0
  1107. package/dist/surfaces/scripts.d.ts +86 -0
  1108. package/dist/surfaces/scripts.d.ts.map +1 -0
  1109. package/dist/surfaces/scripts.js +28 -0
  1110. package/dist/surfaces/scripts.js.map +1 -0
  1111. package/dist/surfaces/theme-choice.d.ts +32 -0
  1112. package/dist/surfaces/theme-choice.d.ts.map +1 -0
  1113. package/dist/surfaces/theme-choice.js +18 -0
  1114. package/dist/surfaces/theme-choice.js.map +1 -0
  1115. package/dist/surfaces/themes.d.ts +43 -0
  1116. package/dist/surfaces/themes.d.ts.map +1 -0
  1117. package/dist/surfaces/themes.js +110 -0
  1118. package/dist/surfaces/themes.js.map +1 -0
  1119. package/dist/surfaces/translations.d.ts +29 -0
  1120. package/dist/surfaces/translations.d.ts.map +1 -0
  1121. package/dist/surfaces/translations.js +57 -0
  1122. package/dist/surfaces/translations.js.map +1 -0
  1123. package/dist/surfaces/variant.d.ts +23 -0
  1124. package/dist/surfaces/variant.d.ts.map +1 -0
  1125. package/dist/surfaces/variant.js +18 -0
  1126. package/dist/surfaces/variant.js.map +1 -0
  1127. package/dist/sync/batch.d.ts +18 -0
  1128. package/dist/sync/batch.d.ts.map +1 -0
  1129. package/dist/sync/batch.js +125 -0
  1130. package/dist/sync/batch.js.map +1 -0
  1131. package/dist/sync/client.d.ts +169 -0
  1132. package/dist/sync/client.d.ts.map +1 -0
  1133. package/dist/sync/client.js +459 -0
  1134. package/dist/sync/client.js.map +1 -0
  1135. package/dist/sync/files.d.ts +46 -0
  1136. package/dist/sync/files.d.ts.map +1 -0
  1137. package/dist/sync/files.js +13 -0
  1138. package/dist/sync/files.js.map +1 -0
  1139. package/dist/sync/filesystem.d.ts +37 -0
  1140. package/dist/sync/filesystem.d.ts.map +1 -0
  1141. package/dist/sync/filesystem.js +205 -0
  1142. package/dist/sync/filesystem.js.map +1 -0
  1143. package/dist/sync/index.d.ts +8 -0
  1144. package/dist/sync/index.d.ts.map +1 -0
  1145. package/dist/sync/index.js +9 -0
  1146. package/dist/sync/index.js.map +1 -0
  1147. package/dist/sync/lines.d.ts +18 -0
  1148. package/dist/sync/lines.d.ts.map +1 -0
  1149. package/dist/sync/lines.js +46 -0
  1150. package/dist/sync/lines.js.map +1 -0
  1151. package/dist/sync/remote.d.ts +145 -0
  1152. package/dist/sync/remote.d.ts.map +1 -0
  1153. package/dist/sync/remote.js +59 -0
  1154. package/dist/sync/remote.js.map +1 -0
  1155. package/dist/sync/state.d.ts +17 -0
  1156. package/dist/sync/state.d.ts.map +1 -0
  1157. package/dist/sync/state.js +40 -0
  1158. package/dist/sync/state.js.map +1 -0
  1159. package/dist/telemetry-ingest/batch.d.ts +73 -0
  1160. package/dist/telemetry-ingest/batch.d.ts.map +1 -0
  1161. package/dist/telemetry-ingest/batch.js +110 -0
  1162. package/dist/telemetry-ingest/batch.js.map +1 -0
  1163. package/dist/telemetry-ingest/facet.d.ts +26 -0
  1164. package/dist/telemetry-ingest/facet.d.ts.map +1 -0
  1165. package/dist/telemetry-ingest/facet.js +100 -0
  1166. package/dist/telemetry-ingest/facet.js.map +1 -0
  1167. package/dist/telemetry-ingest/index.d.ts +5 -0
  1168. package/dist/telemetry-ingest/index.d.ts.map +1 -0
  1169. package/dist/telemetry-ingest/index.js +8 -0
  1170. package/dist/telemetry-ingest/index.js.map +1 -0
  1171. package/dist/telemetry-ingest/recorder.d.ts +50 -0
  1172. package/dist/telemetry-ingest/recorder.d.ts.map +1 -0
  1173. package/dist/telemetry-ingest/recorder.js +298 -0
  1174. package/dist/telemetry-ingest/recorder.js.map +1 -0
  1175. package/dist/telemetry-ingest/sender.d.ts +14 -0
  1176. package/dist/telemetry-ingest/sender.d.ts.map +1 -0
  1177. package/dist/telemetry-ingest/sender.js +64 -0
  1178. package/dist/telemetry-ingest/sender.js.map +1 -0
  1179. package/dist/telemetry-sqlite/index.d.ts +33 -0
  1180. package/dist/telemetry-sqlite/index.d.ts.map +1 -0
  1181. package/dist/telemetry-sqlite/index.js +113 -0
  1182. package/dist/telemetry-sqlite/index.js.map +1 -0
  1183. package/dist/telemetry-sqlite/node.d.ts +13 -0
  1184. package/dist/telemetry-sqlite/node.d.ts.map +1 -0
  1185. package/dist/telemetry-sqlite/node.js +27 -0
  1186. package/dist/telemetry-sqlite/node.js.map +1 -0
  1187. package/dist/telemetry-sqlite/schema.d.ts +9 -0
  1188. package/dist/telemetry-sqlite/schema.d.ts.map +1 -0
  1189. package/dist/telemetry-sqlite/schema.js +61 -0
  1190. package/dist/telemetry-sqlite/schema.js.map +1 -0
  1191. package/dist/telemetry-sqlite/store.d.ts +12 -0
  1192. package/dist/telemetry-sqlite/store.d.ts.map +1 -0
  1193. package/dist/telemetry-sqlite/store.js +121 -0
  1194. package/dist/telemetry-sqlite/store.js.map +1 -0
  1195. package/dist/telemetry.d.ts +1013 -0
  1196. package/dist/telemetry.d.ts.map +1 -0
  1197. package/dist/telemetry.js +518 -0
  1198. package/dist/telemetry.js.map +1 -0
  1199. package/dist/tui/bridge.d.ts +112 -0
  1200. package/dist/tui/bridge.d.ts.map +1 -0
  1201. package/dist/tui/bridge.js +9 -0
  1202. package/dist/tui/bridge.js.map +1 -0
  1203. package/dist/tui/channel.d.ts +44 -0
  1204. package/dist/tui/channel.d.ts.map +1 -0
  1205. package/dist/tui/channel.js +150 -0
  1206. package/dist/tui/channel.js.map +1 -0
  1207. package/dist/tui/frames.d.ts +5 -0
  1208. package/dist/tui/frames.d.ts.map +1 -0
  1209. package/dist/tui/frames.js +52 -0
  1210. package/dist/tui/frames.js.map +1 -0
  1211. package/dist/tui/index.d.ts +8 -0
  1212. package/dist/tui/index.d.ts.map +1 -0
  1213. package/dist/tui/index.js +8 -0
  1214. package/dist/tui/index.js.map +1 -0
  1215. package/dist/tui/runtime.d.ts +46 -0
  1216. package/dist/tui/runtime.d.ts.map +1 -0
  1217. package/dist/tui/runtime.js +101 -0
  1218. package/dist/tui/runtime.js.map +1 -0
  1219. package/dist/tui/scope.d.ts +62 -0
  1220. package/dist/tui/scope.d.ts.map +1 -0
  1221. package/dist/tui/scope.js +173 -0
  1222. package/dist/tui/scope.js.map +1 -0
  1223. package/dist/tui/terminal.d.ts +15 -0
  1224. package/dist/tui/terminal.d.ts.map +1 -0
  1225. package/dist/tui/terminal.js +37 -0
  1226. package/dist/tui/terminal.js.map +1 -0
  1227. package/dist/tui/theme.d.ts +17 -0
  1228. package/dist/tui/theme.d.ts.map +1 -0
  1229. package/dist/tui/theme.js +38 -0
  1230. package/dist/tui/theme.js.map +1 -0
  1231. package/dist/watch.d.ts +194 -0
  1232. package/dist/watch.d.ts.map +1 -0
  1233. package/dist/watch.js +383 -0
  1234. package/dist/watch.js.map +1 -0
  1235. package/dist/web/environment.d.ts +4 -0
  1236. package/dist/web/environment.d.ts.map +1 -0
  1237. package/dist/web/environment.js +37 -0
  1238. package/dist/web/environment.js.map +1 -0
  1239. package/dist/web/index.d.ts +5 -0
  1240. package/dist/web/index.d.ts.map +1 -0
  1241. package/dist/web/index.js +7 -0
  1242. package/dist/web/index.js.map +1 -0
  1243. package/dist/web/language.d.ts +7 -0
  1244. package/dist/web/language.d.ts.map +1 -0
  1245. package/dist/web/language.js +21 -0
  1246. package/dist/web/language.js.map +1 -0
  1247. package/dist/web/page.d.ts +42 -0
  1248. package/dist/web/page.d.ts.map +1 -0
  1249. package/dist/web/page.js +96 -0
  1250. package/dist/web/page.js.map +1 -0
  1251. package/dist/web/scripts.d.ts +23 -0
  1252. package/dist/web/scripts.d.ts.map +1 -0
  1253. package/dist/web/scripts.js +50 -0
  1254. package/dist/web/scripts.js.map +1 -0
  1255. package/dist/web/styles.d.ts +17 -0
  1256. package/dist/web/styles.d.ts.map +1 -0
  1257. package/dist/web/styles.js +218 -0
  1258. package/dist/web/styles.js.map +1 -0
  1259. package/dist/web/themes.d.ts +6 -0
  1260. package/dist/web/themes.d.ts.map +1 -0
  1261. package/dist/web/themes.js +31 -0
  1262. package/dist/web/themes.js.map +1 -0
  1263. package/docs/admission/design.md +178 -0
  1264. package/docs/benchmarks.md +1182 -0
  1265. package/docs/decisions.md +3760 -0
  1266. package/docs/dependencies/book.md +1671 -0
  1267. package/docs/dependencies/index.html +2641 -0
  1268. package/docs/dependencies/model.md +330 -0
  1269. package/docs/design.md +3691 -0
  1270. package/docs/durable-observers/book.md +432 -0
  1271. package/docs/durable-observers/index.html +517 -0
  1272. package/docs/events/spec.md +438 -0
  1273. package/docs/flow-control/book.md +333 -0
  1274. package/docs/flow-control/fold/index.html +265 -0
  1275. package/docs/flow-control/index.html +548 -0
  1276. package/docs/flow-control/window/index.html +228 -0
  1277. package/docs/guide-plugins-hosts/book.md +958 -0
  1278. package/docs/guide-plugins-hosts/index.html +952 -0
  1279. package/docs/host-keyed/spec.md +343 -0
  1280. package/docs/http-workers/book.md +378 -0
  1281. package/docs/http-workers/index.html +515 -0
  1282. package/docs/i18n/book.md +217 -0
  1283. package/docs/i18n/index.html +344 -0
  1284. package/docs/layer-1.md +311 -0
  1285. package/docs/layer-2.md +216 -0
  1286. package/docs/p3-features/README.md +6 -0
  1287. package/docs/p3-features/book.md +478 -0
  1288. package/docs/plugin-authoring.md +389 -0
  1289. package/docs/plugin-model/book.md +186 -0
  1290. package/docs/plugin-model/index.html +310 -0
  1291. package/docs/plugin-primer/book.md +273 -0
  1292. package/docs/plugin-primer/index.html +430 -0
  1293. package/docs/shared-holds/design.md +339 -0
  1294. package/docs/slice-1.md +236 -0
  1295. package/docs/slice-10.md +288 -0
  1296. package/docs/slice-11.md +114 -0
  1297. package/docs/slice-12.md +132 -0
  1298. package/docs/slice-13.md +121 -0
  1299. package/docs/slice-14-design.md +213 -0
  1300. package/docs/slice-14.md +861 -0
  1301. package/docs/slice-2.md +174 -0
  1302. package/docs/slice-3a.md +296 -0
  1303. package/docs/slice-3b.md +197 -0
  1304. package/docs/slice-4.md +146 -0
  1305. package/docs/slice-4a.md +418 -0
  1306. package/docs/slice-4b.md +208 -0
  1307. package/docs/slice-5.md +281 -0
  1308. package/docs/slice-6a.md +676 -0
  1309. package/docs/slice-6b.md +332 -0
  1310. package/docs/slice-7a.md +130 -0
  1311. package/docs/slice-7b/book.md +608 -0
  1312. package/docs/slice-7b/index.html +842 -0
  1313. package/docs/slice-7b.md +255 -0
  1314. package/docs/slice-7c.md +165 -0
  1315. package/docs/slice-8.md +194 -0
  1316. package/docs/slice-9.md +110 -0
  1317. package/docs/slices.md +380 -0
  1318. package/docs/store/book.md +670 -0
  1319. package/docs/store/index.html +861 -0
  1320. package/docs/store/walkthrough.md +193 -0
  1321. package/docs/theming/book.md +223 -0
  1322. package/docs/theming/index.html +371 -0
  1323. package/docs/tutorial/book.md +2170 -0
  1324. package/docs/tutorial/index.html +2112 -0
  1325. package/docs/tutorial/screens/click-after.png +0 -0
  1326. package/docs/tutorial/screens/click-before.png +0 -0
  1327. package/docs/tutorial/screens/edited.png +0 -0
  1328. package/docs/tutorial/screens/french.png +0 -0
  1329. package/docs/tutorial/screens/harbor.png +0 -0
  1330. package/docs/tutorial/screens/page.png +0 -0
  1331. package/docs/tutorial/screens/traces-ada.png +0 -0
  1332. package/docs/tutorial/screens/traces.png +0 -0
  1333. package/package.json +200 -5
  1334. package/src/delta/README.md +262 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6BH,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,cAAc,GAAG,oCAAoC,CAAC;AAC5D,oHAAoH;AACpH,MAAM,eAAe,GACpB,gHAAgH,CAAC;AAClH,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,yFAAyF;AACzF,MA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AE,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE;aAC5B,IAAI,CACJ,CAAC,KAAK,EAAE,EAAE;YACT,IAAI,CAAC,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,yBAAyB,CAAC,CAAC;YACnG,KAAK,MAAM,MAAM,IAAI,OAAO;gBAAE,MAAM,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;YAClB,IAAI,CAAC,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC;YAC7C,KAAK,MAAM,MAAM,IAAI,OAAO;gBAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CACD;aACA,OAAO,CAAC,GAAG,EAAE;YACb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,IAAI,CAAC,MAAM;gBAAE,IAAI,CAAC,SAAS,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;CACD","sourcesContent":["/**\n * Bounded output streams and adaptive progress commits: `OutputBuffer` keeps a head or tail window of a stream at a cost\n * proportional to each chunk, and `Progress` paces commits of a changing value by their size.\n */\n\n/** Retention limits of one output stream. */\nexport type OutputLimits = { readonly maxBytes: number; readonly maxLines: number; readonly retain: \"head\" | \"tail\" };\n\n/** Retained output and what the limits dropped. */\nexport type BoundedOutput = { readonly text: string; readonly droppedBytes: number; readonly droppedLines: number };\n\n/** An exact slice of the input within the limits, and what it left out. */\nexport type OutputSlice = {\n\treadonly text: string;\n\treadonly bytes: number;\n\treadonly droppedBytes: number;\n\treadonly droppedLines: number;\n};\n\n/**\n * Output a producer omitted before a chunk, measured on the decoded text: every U+FFFD counts as three bytes, and no\n * sanitizing is applied.\n */\nexport interface OutputSkip {\n\t/** UTF-8 byte length of the omitted text. */\n\treadonly bytes: number;\n\t/** Newlines (U+000A) in the omitted text. */\n\treadonly newlines: number;\n\t/** Whether the omitted text ends with a newline. */\n\treadonly endsWithNewline: boolean;\n}\n\nconst NEWLINE = 0x0a;\nconst INVALID_OUTPUT = /[\\x00-\\x08\\x0b-\\x1f\\ufff9-\\ufffb]/g;\n/** Whole 7-bit escape sequences: strings (OSC, DCS, APC, PM, SOS) up to BEL or ST, CSI, and short `ESC x` forms. */\nconst ESCAPE_SEQUENCE =\n\t/\\x1b[\\]PX^_][^\\x07\\x1b]*(?:\\x07|\\x1b\\\\)|\\x1b\\[[\\x30-\\x3f]*[\\x20-\\x2f]*[\\x40-\\x7e]|\\x1b[\\x20-\\x2f]*[\\x30-\\x7e]/g;\nconst encoder = new TextEncoder();\n/** Slices decode exactly: a U+FEFF at a slice's start is text, not a byte-order mark. */\nconst decoder = new TextDecoder(\"utf-8\", { ignoreBOM: true });\n\n/** Remove escape sequences and control characters that break display and transcripts; tabs and newlines stay. */\nexport function sanitizeOutput(text: string): string {\n\treturn text.replace(ESCAPE_SEQUENCE, \"\").replace(INVALID_OUTPUT, \"\");\n}\n\n/**\n * Bound `text` to whole lines within the limits: the first lines for `head`, the last lines for `tail`. The result is an\n * exact slice, trailing newline included. A single line longer than `maxBytes` is cut at the byte limit on a character\n * boundary.\n */\nexport function boundOutput(text: string, limits: OutputLimits): OutputSlice {\n\tconst bytes = encoder.encode(text);\n\tconst [from, to] = limits.retain === \"head\" ? headRange(bytes, limits) : tailRange(bytes, limits);\n\tconst kept = bytes.subarray(from, to);\n\treturn {\n\t\ttext: kept.length === bytes.length ? text : decoder.decode(kept),\n\t\tbytes: kept.length,\n\t\tdroppedBytes: bytes.length - kept.length,\n\t\tdroppedLines: lineCount(bytes) - lineCount(kept),\n\t};\n}\n\nfunction headRange(bytes: Uint8Array, limits: OutputLimits): [number, number] {\n\tif (limits.maxLines === 0 || limits.maxBytes === 0) return [0, 0];\n\tlet end = bytes.length;\n\tlet lines = 0;\n\tfor (let index = bytes.indexOf(NEWLINE); index !== -1; index = bytes.indexOf(NEWLINE, index + 1)) {\n\t\tif (++lines === limits.maxLines) {\n\t\t\tend = index + 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (end > limits.maxBytes) {\n\t\tconst newline = bytes.lastIndexOf(NEWLINE, limits.maxBytes - 1);\n\t\tend = newline === -1 ? characterEnd(bytes, limits.maxBytes) : newline + 1;\n\t}\n\treturn [0, end];\n}\n\nfunction tailRange(bytes: Uint8Array, limits: OutputLimits): [number, number] {\n\tif (limits.maxLines === 0 || limits.maxBytes === 0) return [bytes.length, bytes.length];\n\t// A trailing newline ends the last line rather than starting another.\n\tconst last = bytes[bytes.length - 1] === NEWLINE ? bytes.length - 2 : bytes.length - 1;\n\tlet start = 0;\n\tlet lines = 1;\n\tfor (let index = last < 0 ? -1 : bytes.lastIndexOf(NEWLINE, last); index !== -1; ) {\n\t\tif (lines === limits.maxLines) {\n\t\t\tstart = index + 1;\n\t\t\tbreak;\n\t\t}\n\t\tlines++;\n\t\tindex = index === 0 ? -1 : bytes.lastIndexOf(NEWLINE, index - 1);\n\t}\n\tif (bytes.length - start > limits.maxBytes) {\n\t\tconst from = bytes.length - limits.maxBytes;\n\t\tconst newline = bytes.indexOf(NEWLINE, from - 1);\n\t\t// The first line starting inside the byte window, or a cut of the last line when it alone is too long.\n\t\tstart = newline !== -1 && newline + 1 < bytes.length ? newline + 1 : characterStart(bytes, from);\n\t}\n\treturn [start, bytes.length];\n}\n\n/** The last character boundary at or before `index`. */\nexport function characterEnd(bytes: Uint8Array, index: number): number {\n\tlet end = index;\n\twhile (end > 0 && ((bytes[end] ?? 0) & 0xc0) === 0x80) end--;\n\treturn end;\n}\n\n/** The first character boundary at or after `index`. */\nfunction characterStart(bytes: Uint8Array, index: number): number {\n\tlet start = index;\n\twhile (start < bytes.length && ((bytes[start] ?? 0) & 0xc0) === 0x80) start++;\n\treturn start;\n}\n\nfunction lineCount(bytes: Uint8Array): number {\n\tif (bytes.length === 0) return 0;\n\tlet newlines = 0;\n\tfor (let index = bytes.indexOf(NEWLINE); index !== -1; index = bytes.indexOf(NEWLINE, index + 1)) newlines++;\n\treturn newlines + (bytes[bytes.length - 1] === NEWLINE ? 0 : 1);\n}\n\n/**\n * Bounded running output of one stream, such as a tool call's or a process's. Accepting a chunk costs time proportional to the chunk: head retention stops\n * storing once the window is full, and tail retention drops stored text the window no longer needs when it snapshots.\n * Counts of the whole stream are kept so the dropped totals stay exact.\n */\nexport class OutputBuffer {\n\treadonly #limits: OutputLimits;\n\t/**\n\t * Decoder of byte chunks. A string chunk or a skip ends an incomplete character of earlier bytes (it becomes U+FFFD);\n\t * the next byte chunk then starts a new character. As in `StreamDecoder`, only a byte-order mark at the very start of\n\t * the output is dropped, never a U+FEFF later in it.\n\t */\n\treadonly #decoder = new TextDecoder(\"utf-8\", { ignoreBOM: true });\n\t#started = false;\n\t/** Stored chunks: for head the start of the stream, for tail a suffix that still contains the next window. */\n\t#chunks: { readonly text: string; readonly bytes: number; readonly newlines: number }[] = [];\n\t#storedBytes = 0;\n\t#storedNewlines = 0;\n\t#full = false;\n\t#totalBytes = 0;\n\t#totalNewlines = 0;\n\t#endsWithNewline = true;\n\n\tconstructor(limits: OutputLimits) {\n\t\tthis.#limits = limits;\n\t}\n\n\t/** Bytes currently held; bounded by the limits plus one chunk. */\n\tget storedBytes(): number {\n\t\treturn this.#storedBytes;\n\t}\n\n\t/**\n\t * Accept a chunk; returns whether anything was accepted. `skipped` is output omitted right before the chunk, which\n\t * must be more than the tail window by at least one byte or line; only tail retention accepts it.\n\t */\n\tpush(chunk: string | Uint8Array, skipped?: OutputSkip): boolean {\n\t\t// Bytes of an incomplete character from an earlier byte chunk come first.\n\t\tconst pending = typeof chunk === \"string\" || skipped !== undefined ? this.#decoder.decode() : \"\";\n\t\tlet text = typeof chunk === \"string\" ? chunk : this.#decoder.decode(chunk, { stream: true });\n\t\tconst first = !this.#started && pending === \"\" && skipped === undefined;\n\t\tif (pending !== \"\" || text !== \"\" || skipped !== undefined) this.#started = true;\n\t\tif (first && typeof chunk !== \"string\" && text.startsWith(\"\\ufeff\")) text = text.slice(1);\n\t\tif (skipped === undefined) return this.#accept(pending + text);\n\t\tif (this.#limits.retain !== \"tail\") throw new Error(\"Skipped output requires tail retention\");\n\t\tthis.#accept(pending);\n\t\tthis.#skip(skipped);\n\t\tthis.#accept(text);\n\t\treturn true;\n\t}\n\n\t/** Count omitted output; nothing stored before it can be in the window once the text after it arrives. */\n\t#skip(skipped: OutputSkip): void {\n\t\tif (skipped.bytes === 0) return;\n\t\tthis.#totalBytes += skipped.bytes;\n\t\tthis.#totalNewlines += skipped.newlines;\n\t\tthis.#endsWithNewline = skipped.endsWithNewline;\n\t\tthis.#chunks = [];\n\t\tthis.#storedBytes = 0;\n\t\tthis.#storedNewlines = 0;\n\t}\n\n\t/** Flush an incomplete trailing character as a replacement character; call when the stream ends. */\n\tend(): void {\n\t\tthis.#accept(this.#decoder.decode());\n\t}\n\n\t#accept(text: string): boolean {\n\t\tif (text.length === 0) return false;\n\t\tconst bytes = utf8ByteLength(text);\n\t\tconst newlines = countNewlines(text);\n\t\tthis.#totalBytes += bytes;\n\t\tthis.#totalNewlines += newlines;\n\t\tthis.#endsWithNewline = text.endsWith(\"\\n\");\n\t\tif (this.#full) return true;\n\t\tthis.#chunks.push({ text, bytes, newlines });\n\t\tthis.#storedBytes += bytes;\n\t\tthis.#storedNewlines += newlines;\n\t\tif (this.#limits.retain === \"head\") {\n\t\t\t// Nothing past a full window is ever needed.\n\t\t\tthis.#full = this.#storedBytes > this.#limits.maxBytes || this.#storedNewlines >= this.#limits.maxLines;\n\t\t\treturn true;\n\t\t}\n\t\t// Drop leading chunks while the rest still holds more than a window: more than `maxBytes` bytes or `maxLines`\n\t\t// newlines, plus one, so the window's line start can still be found. Each chunk is dropped once.\n\t\twhile (this.#chunks.length > 1) {\n\t\t\tconst first = this.#chunks[0]!;\n\t\t\tconst bytesAfter = this.#storedBytes - first.bytes;\n\t\t\tconst newlinesAfter = this.#storedNewlines - first.newlines;\n\t\t\tif (bytesAfter <= this.#limits.maxBytes + 1 && newlinesAfter <= this.#limits.maxLines + 1) break;\n\t\t\tthis.#chunks.shift();\n\t\t\tthis.#storedBytes = bytesAfter;\n\t\t\tthis.#storedNewlines = newlinesAfter;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/** Retained, sanitized output and what the limits dropped from the whole stream. */\n\tsnapshot(): BoundedOutput {\n\t\tconst stored =\n\t\t\tthis.#chunks.length === 1 ? this.#chunks[0]!.text : this.#chunks.map((chunk) => chunk.text).join(\"\");\n\t\tconst kept = boundOutput(stored, this.#limits);\n\t\tconst storedLines = lines(this.#storedNewlines, stored === \"\" || stored.endsWith(\"\\n\"));\n\t\tconst keptLines = storedLines - kept.droppedLines;\n\t\t// Tail windows never reach back before this one, but finding a later window's first line needs what precedes it:\n\t\t// keep the shortest suffix longer than the window by a byte or a line, as `#accept` does.\n\t\tif (this.#limits.retain === \"tail\" || this.#chunks.length > 1) {\n\t\t\tconst text = this.#limits.retain === \"tail\" ? tailMargin(stored, this.#limits) : stored;\n\t\t\tconst bytes = this.#limits.retain === \"tail\" ? utf8ByteLength(text) : this.#storedBytes;\n\t\t\tthis.#chunks = text === \"\" ? [] : [{ text, bytes, newlines: countNewlines(text) }];\n\t\t\tthis.#storedBytes = bytes;\n\t\t\tthis.#storedNewlines = this.#chunks[0]?.newlines ?? 0;\n\t\t}\n\t\treturn {\n\t\t\ttext: sanitizeOutput(kept.text),\n\t\t\tdroppedBytes: this.#totalBytes - kept.bytes,\n\t\t\tdroppedLines: lines(this.#totalNewlines, this.#endsWithNewline) - keptLines,\n\t\t};\n\t}\n}\n\n/**\n * The shortest suffix of `text` with more than `maxBytes` bytes or more than `maxLines` newlines, or all of it. The\n * tail window of any text that ends with this suffix, followed by anything, is the same as of `text` followed by it.\n */\nfunction tailMargin(text: string, limits: OutputLimits): string {\n\tconst bytes = encoder.encode(text);\n\tconst byteStart = bytes.length > limits.maxBytes ? characterEnd(bytes, bytes.length - limits.maxBytes - 1) : 0;\n\tlet lineStart = 0;\n\tlet newlines = 0;\n\tfor (let index = bytes.lastIndexOf(NEWLINE); index !== -1; index = bytes.lastIndexOf(NEWLINE, index - 1)) {\n\t\tif (++newlines > limits.maxLines) {\n\t\t\tlineStart = index;\n\t\t\tbreak;\n\t\t}\n\t\tif (index === 0) break;\n\t}\n\tconst start = Math.max(byteStart, lineStart);\n\treturn start === 0 ? text : decoder.decode(bytes.subarray(start));\n}\n\n/** Lines of text with `newlines` newlines; a final unterminated line counts. */\nfunction lines(newlines: number, terminated: boolean): number {\n\treturn newlines + (terminated ? 0 : 1);\n}\n\ninterface RuntimeBuffer {\n\tbyteLength(content: string, encoding: \"utf8\"): number;\n}\n\nconst runtimeBuffer = (globalThis as { Buffer?: RuntimeBuffer }).Buffer;\nconst nonAsciiPattern = /[^\\x00-\\x7f]/;\n\n/** UTF-8 byte length of `content`; a lone surrogate counts as U+FFFD, three bytes. */\nexport function utf8ByteLength(content: string): number {\n\tif (runtimeBuffer) return runtimeBuffer.byteLength(content, \"utf8\");\n\tconst firstNonAscii = content.search(nonAsciiPattern);\n\tif (firstNonAscii === -1) return content.length;\n\tlet bytes = firstNonAscii;\n\tfor (let i = firstNonAscii; i < content.length; i++) {\n\t\tconst code = content.charCodeAt(i);\n\t\tif (code <= 0x7f) bytes += 1;\n\t\telse if (code <= 0x7ff) bytes += 2;\n\t\telse if (code >= 0xd800 && code <= 0xdbff && i + 1 < content.length) {\n\t\t\tconst next = content.charCodeAt(i + 1);\n\t\t\tif (next >= 0xdc00 && next <= 0xdfff) {\n\t\t\t\tbytes += 4;\n\t\t\t\ti++;\n\t\t\t} else bytes += 3;\n\t\t} else bytes += 3;\n\t}\n\treturn bytes;\n}\n\nfunction countNewlines(text: string): number {\n\tlet count = 0;\n\tfor (let index = text.indexOf(\"\\n\"); index !== -1; index = text.indexOf(\"\\n\", index + 1)) count++;\n\treturn count;\n}\n\n/** Each progress commit also buys a pause proportional to what it wrote. */\nexport const PROGRESS_BYTES_PER_SECOND = 100 * 1024;\n\n/** The clock and timer progress commits pace on. */\nexport type ProgressClock = {\n\treadonly now: () => number;\n\t/** Call `callback` once after about `delayMs`; returns a function that disarms it. */\n\treadonly setTimer: (callback: () => void, delayMs: number) => () => void;\n};\n\nconst SYSTEM_CLOCK: ProgressClock = {\n\tnow: () => Date.now(),\n\tsetTimer: (callback, delayMs) => {\n\t\tconst timer = setTimeout(callback, delayMs);\n\t\treturn () => clearTimeout(timer);\n\t},\n};\n\n/**\n * Adaptive progress commits: the first change after an idle period commits at once; each commit then delays the next\n * by at least `minIntervalMs` and by its written size at 100 KiB/s. At most one commit is in flight; changes made\n * meanwhile coalesce into the next one. Paces on `clock`, by default `Date.now` and `setTimeout`.\n */\nexport class Progress {\n\treadonly #write: () => Promise<number>;\n\treadonly #onError: (error: unknown) => void;\n\treadonly #minIntervalMs: number;\n\treadonly #clock: ProgressClock;\n\t#waiters: PromiseWithResolvers<void>[] = [];\n\t#timer: (() => void) | undefined;\n\t#inFlight: Promise<void> | undefined;\n\t#nextAt = 0;\n\t#dirty = false;\n\t#stopped = false;\n\n\tconstructor(\n\t\twrite: () => Promise<number>,\n\t\tonError: (error: unknown) => void,\n\t\tminIntervalMs: number,\n\t\tclock: ProgressClock = SYSTEM_CLOCK,\n\t) {\n\t\tthis.#write = write;\n\t\tthis.#onError = onError;\n\t\tthis.#minIntervalMs = minIntervalMs;\n\t\tthis.#clock = clock;\n\t}\n\n\t/** Schedule a commit. */\n\tmark(): void {\n\t\tthis.#dirty = true;\n\t\tthis.#schedule();\n\t}\n\n\t/** Schedule a commit; the promise settles with the commit that includes this change. */\n\tmarkAndWait(): Promise<void> {\n\t\tconst waiter = Promise.withResolvers<void>();\n\t\tthis.#waiters.push(waiter);\n\t\tthis.mark();\n\t\treturn waiter.promise;\n\t}\n\n\t/** Stop committing and wait for the commit in flight; returns the waiters the final commit must settle. */\n\tasync stop(): Promise<PromiseWithResolvers<void>[]> {\n\t\tthis.#stopped = true;\n\t\tthis.#timer?.();\n\t\tthis.#timer = undefined;\n\t\tawait this.#inFlight;\n\t\treturn this.#waiters.splice(0);\n\t}\n\n\t#schedule(): void {\n\t\tif (this.#stopped || this.#timer !== undefined || this.#inFlight !== undefined) return;\n\t\tconst wait = this.#nextAt - this.#clock.now();\n\t\tif (wait <= 0) this.#flush();\n\t\telse\n\t\t\tthis.#timer = this.#clock.setTimer(() => {\n\t\t\t\tthis.#timer = undefined;\n\t\t\t\t// Checks the clock again: a timer that fires early waits for the rest.\n\t\t\t\tthis.#schedule();\n\t\t\t}, wait);\n\t}\n\n\t#flush(): void {\n\t\tif (this.#stopped || !this.#dirty) return;\n\t\tthis.#dirty = false;\n\t\tconst waiters = this.#waiters.splice(0);\n\t\tconst started = this.#clock.now();\n\t\tthis.#inFlight = this.#write()\n\t\t\t.then(\n\t\t\t\t(bytes) => {\n\t\t\t\t\tthis.#nextAt = started + Math.max(this.#minIntervalMs, (bytes * 1000) / PROGRESS_BYTES_PER_SECOND);\n\t\t\t\t\tfor (const waiter of waiters) waiter.resolve();\n\t\t\t\t},\n\t\t\t\t(error: unknown) => {\n\t\t\t\t\tthis.#nextAt = started + this.#minIntervalMs;\n\t\t\t\t\tfor (const waiter of waiters) waiter.reject(error);\n\t\t\t\t\tthis.#onError(error);\n\t\t\t\t},\n\t\t\t)\n\t\t\t.finally(() => {\n\t\t\t\tthis.#inFlight = undefined;\n\t\t\t\tif (this.#dirty) this.#schedule();\n\t\t\t});\n\t}\n}\n"]}
@@ -0,0 +1,61 @@
1
+ import { type ReactNode } from "react";
2
+ import type { Contract, EventMember, ParamsOf } from "../contracts/index.ts";
3
+ import type { Principal } from "../data/index.ts";
4
+ import type { Held, Host, RefState } from "../host/index.ts";
5
+ import type { Registry } from "../registries/index.ts";
6
+ import { type Messages, type Translator } from "../surfaces/index.ts";
7
+ import { type InVariant, type VariantOf, type VariantRef } from "../surfaces/variant.ts";
8
+ import type { NativeWatchable, Watchable } from "../watch.ts";
9
+ /** Gives `host` to the components below. */
10
+ export declare function HostProvider<P extends Principal>(props: {
11
+ readonly host: Host<P>;
12
+ readonly children?: ReactNode;
13
+ }): import("react").FunctionComponentElement<import("react").ProviderProps<Host<Principal, import("../json.ts").JsonValue> | undefined>>;
14
+ /** The host `HostProvider` gives; throws outside one. */
15
+ export declare function useHost<P extends Principal = Principal>(): Host<P>;
16
+ /**
17
+ * A reference to `Type` with `params`, held while the component is mounted and released when it unmounts or its params
18
+ * change (compared by value); `undefined` before its first hold (the first render).
19
+ */
20
+ export declare function useHold<C extends Contract>(Type: C, params: ParamsOf<C>): Held<C> | undefined;
21
+ /** The current value of `watchable` (a state member, a derive), re-rendering on change; `undefined` while it has none. */
22
+ export declare function useWatch<T>(watchable: Watchable<T> | NativeWatchable<T> | undefined): T | undefined;
23
+ /**
24
+ * Subscribes to event member `member` (a reference's, decision "Events: fire-and-forget members") while the component
25
+ * is mounted: each event calls the latest `listener` (a new function per render does not subscribe again); nothing
26
+ * without a member. Events re-render nothing by themselves: the listener decides.
27
+ */
28
+ export declare function useEvents<T>(member: EventMember<T> | undefined, listener: (event: {
29
+ readonly value: T;
30
+ readonly at: number;
31
+ }) => void): void;
32
+ /** Registry `R`'s composed value on the component's host, re-rendering on change; `undefined` until it is usable. */
33
+ export declare function useRegistry<C, V>(R: Registry<C, V>): V | undefined;
34
+ /** The state of `ref` (loading, live, failed, ended), re-rendering on change; `undefined` without a reference. */
35
+ export declare function useRefState(ref: {
36
+ readonly state: NativeWatchable<RefState>;
37
+ } | undefined): RefState | undefined;
38
+ /**
39
+ * `ref` narrowed to `variant` while it is live in it, else `undefined` (no reference, loading, failed or denied,
40
+ * ended, another variant), re-rendering when that changes: a reference held while mounted binds later and may bind
41
+ * another variant (an admission's other allowed value), and it keeps its last variant while it loads. The UI's
42
+ * way to read a variant (decision "C15 stands; the UI bindings follow the variant"); `useRefState` says why there is
43
+ * none. True of the render that read it: a call made after an `await` may find another variant.
44
+ */
45
+ export declare function useVariant<R extends VariantRef, const V extends VariantOf<R>>(ref: R | undefined, variant: V): InVariant<R, V> | undefined;
46
+ /**
47
+ * A value the page keeps under `key` for its host's life, not the component's, with its setter (`useState`'s pair): a
48
+ * component remounted by a plugin reload, a new function, finds what it had; a new key starts at `initial`. Any value
49
+ * (it never crosses a link); gone with the page.
50
+ */
51
+ export declare function usePageState<T>(key: string, initial: T): readonly [T, (value: T) => void];
52
+ /**
53
+ * `messages` in the language of the component's host (the user's pick, else the device's, matched against the
54
+ * catalogs), with its locale; re-renders when the locale or a translation changes. Before the host follows a language
55
+ * (`startPage` does), `t` renders the first catalog and `locale` is `undefined`.
56
+ */
57
+ export declare function useMessages<N extends string, M>(messages: Messages<N, M>): {
58
+ readonly t: Translator<N, M>;
59
+ readonly locale: string | undefined;
60
+ };
61
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EAGN,KAAK,SAAS,EAQd,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAgB,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpF,OAAO,EAAE,KAAK,SAAS,EAAU,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,M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EhH;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EAC5E,GAAG,EAAE,CAAC,GAAG,SAAS,EAClB,OAAO,EAAE,CAAC,GACR,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAM7B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAGzF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAC9C,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,GACtB;IAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAIvE"}
@@ -0,0 +1,119 @@
1
+ // React bindings (slice 11 §3, decision "Slice 11, P7"; p2's `useObject`, `useReadable`, `useRegistry`): a host in
2
+ // context, references held for a component's life, watchables read with `useSyncExternalStore`, a reference read in
3
+ // one variant, event members subscribed while mounted, page state kept for the host's life, and a plugin's messages
4
+ // in the host's language. A component unmounted by a reload has not left (design §21): its releases are plain
5
+ // releases, presence is the app's. A component of a reloaded plugin is a new function and remounts, its `useState`
6
+ // starting over; what must survive is page state (decision "Tutorial gaps" (1)).
7
+ // No components, no styling.
8
+ import { createContext, createElement, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore, } from "react";
9
+ import { BACKGROUND_CONTEXT, withAbortSignal } from "../context/index.js";
10
+ import { canonicalJson } from "../data/principal.js";
11
+ import { hostLanguage } from "../surfaces/index.js";
12
+ import { pageState } from "../surfaces/page-state.js";
13
+ import { liveIn } from "../surfaces/variant.js";
14
+ import { watchStore } from "./stores.js";
15
+ /** The host components use, given by `HostProvider`. */
16
+ const HostContext = createContext(undefined);
17
+ /** Gives `host` to the components below. */
18
+ export function HostProvider(props) {
19
+ // Components hold for the app's principal type: the context keeps it as the host was given.
20
+ return createElement(HostContext.Provider, { value: props.host }, props.children);
21
+ }
22
+ /** The host `HostProvider` gives; throws outside one. */
23
+ export function useHost() {
24
+ const host = useContext(HostContext);
25
+ if (host === undefined)
26
+ throw new Error("useHost: no HostProvider above this component");
27
+ return host;
28
+ }
29
+ /**
30
+ * A reference to `Type` with `params`, held while the component is mounted and released when it unmounts or its params
31
+ * change (compared by value); `undefined` before its first hold (the first render).
32
+ */
33
+ export function useHold(Type, params) {
34
+ const host = useHost();
35
+ const key = canonicalJson(params, BACKGROUND_CONTEXT);
36
+ const [held, setHeld] = useState(undefined);
37
+ // biome-ignore lint/correctness/useExhaustiveDependencies: `key` is `params` by value: an inline object must not re-hold.
38
+ useEffect(() => {
39
+ const ref = host.hold(Type, params, BACKGROUND_CONTEXT);
40
+ setHeld({ key, ref });
41
+ return () => ref.release();
42
+ }, [host, Type, key]);
43
+ return held !== undefined && held.key === key ? held.ref : undefined;
44
+ }
45
+ /** The current value of `watchable` (a state member, a derive), re-rendering on change; `undefined` while it has none. */
46
+ export function useWatch(watchable) {
47
+ const store = useMemo(() => watchStore(watchable), [watchable]);
48
+ return useSyncExternalStore(store.subscribe, store.snapshot, store.snapshot);
49
+ }
50
+ /**
51
+ * Subscribes to event member `member` (a reference's, decision "Events: fire-and-forget members") while the component
52
+ * is mounted: each event calls the latest `listener` (a new function per render does not subscribe again); nothing
53
+ * without a member. Events re-render nothing by themselves: the listener decides.
54
+ */
55
+ export function useEvents(member, listener) {
56
+ const latest = useRef(listener);
57
+ // At the commit (a layout effect, not a passive one): an event delivered between a render's commit and its passive
58
+ // effects (the event flush is a microtask) already calls that render's listener.
59
+ useLayoutEffect(() => {
60
+ latest.current = listener;
61
+ });
62
+ useEffect(() => {
63
+ if (member === undefined)
64
+ return;
65
+ const abort = new AbortController();
66
+ // Rejected only once released or aborted: nothing to follow then.
67
+ member.on((event) => latest.current(event), withAbortSignal(abort.signal, BACKGROUND_CONTEXT)).catch(() => { });
68
+ return () => abort.abort();
69
+ }, [member]);
70
+ }
71
+ /** Registry `R`'s composed value on the component's host, re-rendering on change; `undefined` until it is usable. */
72
+ export function useRegistry(R) {
73
+ const host = useHost();
74
+ const [value, setValue] = useState(undefined);
75
+ useEffect(() => {
76
+ const abort = new AbortController();
77
+ host.registry(R, withAbortSignal(abort.signal, BACKGROUND_CONTEXT)).then(setValue, () => { });
78
+ return () => abort.abort();
79
+ }, [host, R]);
80
+ return useWatch(value);
81
+ }
82
+ /** The state of `ref` (loading, live, failed, ended), re-rendering on change; `undefined` without a reference. */
83
+ export function useRefState(ref) {
84
+ return useWatch(ref?.state);
85
+ }
86
+ /**
87
+ * `ref` narrowed to `variant` while it is live in it, else `undefined` (no reference, loading, failed or denied,
88
+ * ended, another variant), re-rendering when that changes: a reference held while mounted binds later and may bind
89
+ * another variant (an admission's other allowed value), and it keeps its last variant while it loads. The UI's
90
+ * way to read a variant (decision "C15 stands; the UI bindings follow the variant"); `useRefState` says why there is
91
+ * none. True of the render that read it: a call made after an `await` may find another variant.
92
+ */
93
+ export function useVariant(ref, variant) {
94
+ const store = useMemo(() => watchStore(ref?.state), [ref]);
95
+ // The snapshot is the narrowing, not the state: live in one variant, then live in another, is one `live` to React
96
+ // when the loading between them was never rendered.
97
+ const snapshot = () => liveIn(ref, variant);
98
+ return useSyncExternalStore(store.subscribe, snapshot, snapshot);
99
+ }
100
+ /**
101
+ * A value the page keeps under `key` for its host's life, not the component's, with its setter (`useState`'s pair): a
102
+ * component remounted by a plugin reload, a new function, finds what it had; a new key starts at `initial`. Any value
103
+ * (it never crosses a link); gone with the page.
104
+ */
105
+ export function usePageState(key, initial) {
106
+ const state = pageState(useHost(), key, initial);
107
+ return [useSyncExternalStore(state.subscribe, state.read, state.read), state.set];
108
+ }
109
+ /**
110
+ * `messages` in the language of the component's host (the user's pick, else the device's, matched against the
111
+ * catalogs), with its locale; re-renders when the locale or a translation changes. Before the host follows a language
112
+ * (`startPage` does), `t` renders the first catalog and `locale` is `undefined`.
113
+ */
114
+ export function useMessages(messages) {
115
+ const state = hostLanguage(useHost());
116
+ const language = useSyncExternalStore(state.subscribe, state.read, state.read);
117
+ return useMemo(() => ({ t: messages.in(language), locale: language?.locale }), [messages, language]);
118
+ }
119
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,oHAAoH;AACpH,oHAAoH;AACpH,8GAA8G;AAC9G,mHAAmH;AACnH,iFAAiF;AACjF,6BAA6B;AAE7B,OAAO,EACN,aAAa,EACb,aAAa,EAEb,UAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,EACR,oBAAoB,GACpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG1E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,YAAY,EAAkC,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAkB,MAAM,EAAmC,MAAM,wBAAwB,CAAC;AAEjG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,wDAAwD;AACxD,MAAM,WAAW,GAAG,aAAa,CAA8B,SAAS,CAAC,CAAC;AAE1E,4CAA4C;AAC5C,MAAM,UAAU,YAAY,CAAsB,KAAgE;IACjH,4FAA4F;IAC5F,OAAO,aAAa,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,IAAkC,EAAE,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C,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AACtG,CAAC","sourcesContent":["// React bindings (slice 11 §3, decision \"Slice 11, P7\"; p2's `useObject`, `useReadable`, `useRegistry`): a host in\n// context, references held for a component's life, watchables read with `useSyncExternalStore`, a reference read in\n// one variant, event members subscribed while mounted, page state kept for the host's life, and a plugin's messages\n// in the host's language. A component unmounted by a reload has not left (design §21): its releases are plain\n// releases, presence is the app's. A component of a reloaded plugin is a new function and remounts, its `useState`\n// starting over; what must survive is page state (decision \"Tutorial gaps\" (1)).\n// No components, no styling.\n\nimport {\n\tcreateContext,\n\tcreateElement,\n\ttype ReactNode,\n\tuseContext,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n\tuseSyncExternalStore,\n} from \"react\";\nimport { BACKGROUND_CONTEXT, withAbortSignal } from \"../context/index.ts\";\nimport type { Contract, EventMember, ParamsOf } from \"../contracts/index.ts\";\nimport type { Principal } from \"../data/index.ts\";\nimport { canonicalJson } from \"../data/principal.ts\";\nimport type { Held, Host, RefState } from \"../host/index.ts\";\nimport type { Registry } from \"../registries/index.ts\";\nimport { hostLanguage, type Messages, type Translator } from \"../surfaces/index.ts\";\nimport { pageState } from \"../surfaces/page-state.ts\";\nimport { type InVariant, liveIn, type VariantOf, type VariantRef } from \"../surfaces/variant.ts\";\nimport type { NativeWatchable, Watchable } from \"../watch.ts\";\nimport { watchStore } from \"./stores.ts\";\n\n/** The host components use, given by `HostProvider`. */\nconst HostContext = createContext<Host<Principal> | undefined>(undefined);\n\n/** Gives `host` to the components below. */\nexport function HostProvider<P extends Principal>(props: { readonly host: Host<P>; readonly children?: ReactNode }) {\n\t// Components hold for the app's principal type: the context keeps it as the host was given.\n\treturn createElement(HostContext.Provider, { value: props.host as unknown as Host<Principal> }, props.children);\n}\n\n/** The host `HostProvider` gives; throws outside one. */\nexport function useHost<P extends Principal = Principal>(): Host<P> {\n\tconst host = useContext(HostContext);\n\tif (host === undefined) throw new Error(\"useHost: no HostProvider above this component\");\n\treturn host as unknown as Host<P>;\n}\n\n/**\n * A reference to `Type` with `params`, held while the component is mounted and released when it unmounts or its params\n * change (compared by value); `undefined` before its first hold (the first render).\n */\nexport function useHold<C extends Contract>(Type: C, params: ParamsOf<C>): Held<C> | undefined {\n\tconst host = useHost();\n\tconst key = canonicalJson(params as never, BACKGROUND_CONTEXT);\n\tconst [held, setHeld] = useState<{ readonly key: string; readonly ref: Held<C> } | undefined>(undefined);\n\t// biome-ignore lint/correctness/useExhaustiveDependencies: `key` is `params` by value: an inline object must not re-hold.\n\tuseEffect(() => {\n\t\tconst ref = host.hold(Type, params, BACKGROUND_CONTEXT);\n\t\tsetHeld({ key, ref });\n\t\treturn () => ref.release();\n\t}, [host, Type, key]);\n\treturn held !== undefined && held.key === key ? held.ref : undefined;\n}\n\n/** The current value of `watchable` (a state member, a derive), re-rendering on change; `undefined` while it has none. */\nexport function useWatch<T>(watchable: Watchable<T> | NativeWatchable<T> | undefined): T | undefined {\n\tconst store = useMemo(() => watchStore(watchable), [watchable]);\n\treturn useSyncExternalStore(store.subscribe, store.snapshot, store.snapshot);\n}\n\n/**\n * Subscribes to event member `member` (a reference's, decision \"Events: fire-and-forget members\") while the component\n * is mounted: each event calls the latest `listener` (a new function per render does not subscribe again); nothing\n * without a member. Events re-render nothing by themselves: the listener decides.\n */\nexport function useEvents<T>(\n\tmember: EventMember<T> | undefined,\n\tlistener: (event: { readonly value: T; readonly at: number }) => void,\n): void {\n\tconst latest = useRef(listener);\n\t// At the commit (a layout effect, not a passive one): an event delivered between a render's commit and its passive\n\t// effects (the event flush is a microtask) already calls that render's listener.\n\tuseLayoutEffect(() => {\n\t\tlatest.current = listener;\n\t});\n\tuseEffect(() => {\n\t\tif (member === undefined) return;\n\t\tconst abort = new AbortController();\n\t\t// Rejected only once released or aborted: nothing to follow then.\n\t\tmember.on((event) => latest.current(event), withAbortSignal(abort.signal, BACKGROUND_CONTEXT)).catch(() => {});\n\t\treturn () => abort.abort();\n\t}, [member]);\n}\n\n/** Registry `R`'s composed value on the component's host, re-rendering on change; `undefined` until it is usable. */\nexport function useRegistry<C, V>(R: Registry<C, V>): V | undefined {\n\tconst host = useHost();\n\tconst [value, setValue] = useState<NativeWatchable<V> | undefined>(undefined);\n\tuseEffect(() => {\n\t\tconst abort = new AbortController();\n\t\thost.registry(R, withAbortSignal(abort.signal, BACKGROUND_CONTEXT)).then(setValue, () => {});\n\t\treturn () => abort.abort();\n\t}, [host, R]);\n\treturn useWatch(value);\n}\n\n/** The state of `ref` (loading, live, failed, ended), re-rendering on change; `undefined` without a reference. */\nexport function useRefState(ref: { readonly state: NativeWatchable<RefState> } | undefined): RefState | undefined {\n\treturn useWatch(ref?.state);\n}\n\n/**\n * `ref` narrowed to `variant` while it is live in it, else `undefined` (no reference, loading, failed or denied,\n * ended, another variant), re-rendering when that changes: a reference held while mounted binds later and may bind\n * another variant (an admission's other allowed value), and it keeps its last variant while it loads. The UI's\n * way to read a variant (decision \"C15 stands; the UI bindings follow the variant\"); `useRefState` says why there is\n * none. True of the render that read it: a call made after an `await` may find another variant.\n */\nexport function useVariant<R extends VariantRef, const V extends VariantOf<R>>(\n\tref: R | undefined,\n\tvariant: V,\n): InVariant<R, V> | undefined {\n\tconst store = useMemo(() => watchStore(ref?.state), [ref]);\n\t// The snapshot is the narrowing, not the state: live in one variant, then live in another, is one `live` to React\n\t// when the loading between them was never rendered.\n\tconst snapshot = (): InVariant<R, V> | undefined => liveIn(ref, variant);\n\treturn useSyncExternalStore(store.subscribe, snapshot, snapshot);\n}\n\n/**\n * A value the page keeps under `key` for its host's life, not the component's, with its setter (`useState`'s pair): a\n * component remounted by a plugin reload, a new function, finds what it had; a new key starts at `initial`. Any value\n * (it never crosses a link); gone with the page.\n */\nexport function usePageState<T>(key: string, initial: T): readonly [T, (value: T) => void] {\n\tconst state = pageState(useHost(), key, initial);\n\treturn [useSyncExternalStore(state.subscribe, state.read, state.read), state.set];\n}\n\n/**\n * `messages` in the language of the component's host (the user's pick, else the device's, matched against the\n * catalogs), with its locale; re-renders when the locale or a translation changes. Before the host follows a language\n * (`startPage` does), `t` renders the first catalog and `locale` is `undefined`.\n */\nexport function useMessages<N extends string, M>(\n\tmessages: Messages<N, M>,\n): { readonly t: Translator<N, M>; readonly locale: string | undefined } {\n\tconst state = hostLanguage(useHost());\n\tconst language = useSyncExternalStore(state.subscribe, state.read, state.read);\n\treturn useMemo(() => ({ t: messages.in(language), locale: language?.locale }), [messages, language]);\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export type { InVariant, VariantOf, VariantRef } from "../surfaces/variant.ts";
2
+ export { HostProvider, useEvents, useHold, useHost, useMessages, usePageState, useRefState, useRegistry, useVariant, useWatch, } from "./hooks.ts";
3
+ export { type ExternalStore, watchStore } from "./stores.ts";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EACN,YAAY,EACZ,SAAS,EACT,OAAO,EACP,OAAO,EACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,QAAQ,GACR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,aAAa,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Chord v2's React bindings (`@diffra-ai/chord/react`; slice 11 §3): optional, non-React apps never load them.
2
+ export { HostProvider, useEvents, useHold, useHost, useMessages, usePageState, useRefState, useRegistry, useVariant, useWatch, } from "./hooks.js";
3
+ export { watchStore } from "./stores.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAG/G,OAAO,EACN,YAAY,EACZ,SAAS,EACT,OAAO,EACP,OAAO,EACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,QAAQ,GACR,MAAM,YAAY,CAAC;AACpB,OAAO,EAAsB,UAAU,EAAE,MAAM,aAAa,CAAC","sourcesContent":["// Chord v2's React bindings (`@diffra-ai/chord/react`; slice 11 §3): optional, non-React apps never load them.\n\nexport type { InVariant, VariantOf, VariantRef } from \"../surfaces/variant.ts\";\nexport {\n\tHostProvider,\n\tuseEvents,\n\tuseHold,\n\tuseHost,\n\tuseMessages,\n\tusePageState,\n\tuseRefState,\n\tuseRegistry,\n\tuseVariant,\n\tuseWatch,\n} from \"./hooks.ts\";\nexport { type ExternalStore, watchStore } from \"./stores.ts\";\n"]}
@@ -0,0 +1,9 @@
1
+ import type { NativeWatchable, Watchable } from "../watch.ts";
2
+ /** What `useSyncExternalStore` takes: subscribe (returning its unsubscribe) and the current snapshot. */
3
+ export type ExternalStore<T> = {
4
+ readonly subscribe: (changed: () => void) => () => void;
5
+ readonly snapshot: () => T | undefined;
6
+ };
7
+ /** The store of `source` (a state member, a derive, a registry value, `ref.state`); none for `undefined`. */
8
+ export declare function watchStore<T>(source: Watchable<T> | NativeWatchable<T> | undefined): ExternalStore<T>;
9
+ //# sourceMappingURL=stores.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../../src/react/stores.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE9D,yGAAyG;AACzG,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC9B,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IACxD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF,6GAA6G;AAC7G,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,aAAa,CAAC,CAAC,CAAC,CA6BrG"}
@@ -0,0 +1,37 @@
1
+ // External stores over Chord's watchables (slice 11 §3): what React's `useSyncExternalStore` reads. A store's snapshot
2
+ // is the watchable's current value (`undefined` while it has none: a reference not bound yet, ended, or a member its
3
+ // variant lacks; nothing throws during a render); subscribing starts a watch whose every call notifies React, and the
4
+ // unsubscribe ends it.
5
+ import { BACKGROUND_CONTEXT, withAbortSignal } from "../context/index.js";
6
+ /** The store of `source` (a state member, a derive, a registry value, `ref.state`); none for `undefined`. */
7
+ export function watchStore(source) {
8
+ return {
9
+ subscribe: (changed) => {
10
+ if (source === undefined)
11
+ return () => { };
12
+ const abort = new AbortController();
13
+ const context = withAbortSignal(abort.signal, BACKGROUND_CONTEXT);
14
+ // A watch that cannot start (its source ended, the abort came first) only means no more changes.
15
+ source.watch(context).then((watch) => {
16
+ watch.start(async () => {
17
+ changed();
18
+ });
19
+ // A watch starts at the value it acquired, which may be newer than the snapshot React read (a
20
+ // reference's members bind after the first render): its calls bring only later changes.
21
+ changed();
22
+ }, () => { });
23
+ return () => abort.abort();
24
+ },
25
+ snapshot: () => {
26
+ if (source === undefined)
27
+ return undefined;
28
+ try {
29
+ return source.value;
30
+ }
31
+ catch {
32
+ return undefined;
33
+ }
34
+ },
35
+ };
36
+ }
37
+ //# sourceMappingURL=stores.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stores.js","sourceRoot":"","sources":["../../src/react/stores.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,qHAAqH;AACrH,sHAAsH;AACtH,uBAAuB;AAEvB,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAS1E,6GAA6G;AAC7G,MAAM,UAAU,UAAU,CAAI,MAAqD;IAClF,OAAO;QACN,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;YACtB,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;YAC1C,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;YACpC,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;YAClE,iGAAiG;YACjG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CACzB,CAAC,KAAK,EAAE,EAAE;gBACR,KAAK,CAAC,KAAiD,CAAC,KAAK,IAAI,EAAE;oBACnE,OAAO,EAAE,CAAC;gBACX,CAAC,CAAC,CAAC;gBACH,8FAA8F;gBAC9F,wFAAwF;gBACxF,OAAO,EAAE,CAAC;YACX,CAAC,EACD,GAAG,EAAE,GAAE,CAAC,CACR,CAAC;YACF,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;QACD,QAAQ,EAAE,GAAG,EAAE;YACd,IAAI,MAAM,KAAK,SAAS;gBAAE,OAAO,SAAS,CAAC;YAC3C,IAAI,CAAC;gBACJ,OAAO,MAAM,CAAC,KAAK,CAAC;YACrB,CAAC;YAAC,MAAM,CAAC;gBACR,OAAO,SAAS,CAAC;YAClB,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["// External stores over Chord's watchables (slice 11 §3): what React's `useSyncExternalStore` reads. A store's snapshot\n// is the watchable's current value (`undefined` while it has none: a reference not bound yet, ended, or a member its\n// variant lacks; nothing throws during a render); subscribing starts a watch whose every call notifies React, and the\n// unsubscribe ends it.\n\nimport { BACKGROUND_CONTEXT, withAbortSignal } from \"../context/index.ts\";\nimport type { NativeWatchable, Watchable } from \"../watch.ts\";\n\n/** What `useSyncExternalStore` takes: subscribe (returning its unsubscribe) and the current snapshot. */\nexport type ExternalStore<T> = {\n\treadonly subscribe: (changed: () => void) => () => void;\n\treadonly snapshot: () => T | undefined;\n};\n\n/** The store of `source` (a state member, a derive, a registry value, `ref.state`); none for `undefined`. */\nexport function watchStore<T>(source: Watchable<T> | NativeWatchable<T> | undefined): ExternalStore<T> {\n\treturn {\n\t\tsubscribe: (changed) => {\n\t\t\tif (source === undefined) return () => {};\n\t\t\tconst abort = new AbortController();\n\t\t\tconst context = withAbortSignal(abort.signal, BACKGROUND_CONTEXT);\n\t\t\t// A watch that cannot start (its source ended, the abort came first) only means no more changes.\n\t\t\tsource.watch(context).then(\n\t\t\t\t(watch) => {\n\t\t\t\t\t(watch.start as (listener: () => Promise<void>) => void)(async () => {\n\t\t\t\t\t\tchanged();\n\t\t\t\t\t});\n\t\t\t\t\t// A watch starts at the value it acquired, which may be newer than the snapshot React read (a\n\t\t\t\t\t// reference's members bind after the first render): its calls bring only later changes.\n\t\t\t\t\tchanged();\n\t\t\t\t},\n\t\t\t\t() => {},\n\t\t\t);\n\t\t\treturn () => abort.abort();\n\t\t},\n\t\tsnapshot: () => {\n\t\t\tif (source === undefined) return undefined;\n\t\t\ttry {\n\t\t\t\treturn source.value;\n\t\t\t} catch {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t},\n\t};\n}\n"]}
@@ -0,0 +1,50 @@
1
+ import { type Dependent, type DeriveSource, type NativeSource } from "../state/internal.ts";
2
+ import type { RegistryRecord } from "./record.ts";
3
+ import type { RegistryEntry, RegistryProvider } from "./registry.ts";
4
+ /** Who contributes: a facet (by plugin) or a host-lifetime object (by plugin and type). */
5
+ export type Contributor = {
6
+ readonly plugin: string;
7
+ readonly type: string | undefined;
8
+ };
9
+ /**
10
+ * What a contribution is: a plain value, a Chord JSON watchable (a source or a constant), or a native source; the
11
+ * watchables followed for their value.
12
+ */
13
+ export type ContributionContent = {
14
+ readonly kind: "plain";
15
+ readonly value: unknown;
16
+ } | {
17
+ readonly kind: "json";
18
+ readonly source: DeriveSource;
19
+ } | {
20
+ readonly kind: "native";
21
+ readonly source: NativeSource;
22
+ };
23
+ /**
24
+ * One contributor's contribution to a registry: a plain value, or a Chord source it follows as a dependent (a change
25
+ * marks the registry's table). Its table entry is made once per value (an older version's adapted once per value);
26
+ * a failure or refusal leaves it out, reported once per episode.
27
+ */
28
+ export declare class RegistryContribution implements Dependent {
29
+ #private;
30
+ /** The registry it contributes to. */
31
+ readonly record: RegistryRecord;
32
+ readonly contributor: Contributor;
33
+ /** The registry version its contributor was built against. */
34
+ readonly version: number;
35
+ constructor(record: RegistryRecord, contributor: Contributor, version: number, content: ContributionContent);
36
+ /** Its source changed (inside a batch): the registry's table is marked. */
37
+ invalidate(): void;
38
+ /** A retirement of its source's document changes nothing beyond the value. */
39
+ sourceRetired(): void;
40
+ /** Starts following its source, if it has one. */
41
+ follow(): void;
42
+ /** Stops following its source. */
43
+ unfollow(): void;
44
+ /**
45
+ * Its entry in a table of the provider at `version`: the same object while its value is the same; `undefined` when
46
+ * left out (a refused version, a failing source, a throwing adapter).
47
+ */
48
+ entry(version: number, provider: RegistryProvider<unknown, unknown>): RegistryEntry<unknown> | undefined;
49
+ }
50
+ //# sourceMappingURL=contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contribution.d.ts","sourceRoot":"","sources":["../../src/registries/contribution.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAa,KAAK,YAAY,EAAU,MAAM,sBAAsB,CAAC;AAC/G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAErE,2FAA2F;AAC3F,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEzF;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACxD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC;AAE9D;;;;GAIG;AACH,qBAAa,oBAAqB,YAAW,SAAS;;IACrD,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAQzB,YAAY,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAK1G;IAED,2EAA2E;IAC3E,UAAU,IAAI,IAAI,CAEjB;IAED,8EAA8E;IAC9E,aAAa,IAAI,IAAI,CAAG;IAExB,kDAAkD;IAClD,MAAM,IAAI,IAAI,CAGb;IAED,kCAAkC;IAClC,QAAQ,IAAI,IAAI,CAEf;IASD;;;OAGG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,CAqBvG;CAqDD"}
@@ -0,0 +1,129 @@
1
+ // One contributor's contribution to a registry (slice 8 §1): its table entry, made once per value (an older version's
2
+ // adapted once per value), followed when it is a Chord watchable, left out and reported when it fails or is refused.
3
+ import { handedOut, Source } from "../state/internal.js";
4
+ /**
5
+ * One contributor's contribution to a registry: a plain value, or a Chord source it follows as a dependent (a change
6
+ * marks the registry's table). Its table entry is made once per value (an older version's adapted once per value);
7
+ * a failure or refusal leaves it out, reported once per episode.
8
+ */
9
+ export class RegistryContribution {
10
+ /** The registry it contributes to. */
11
+ record;
12
+ contributor;
13
+ /** The registry version its contributor was built against. */
14
+ version;
15
+ #content;
16
+ /** The last adaptation of an older contribution: the value and adapter it was made from, and its result. */
17
+ #adapted;
18
+ #entry;
19
+ /** Left out since its last entry: failing (reported once), or refused (reported once). */
20
+ #out = "none";
21
+ constructor(record, contributor, version, content) {
22
+ this.record = record;
23
+ this.contributor = contributor;
24
+ this.version = version;
25
+ this.#content = content;
26
+ }
27
+ /** Its source changed (inside a batch): the registry's table is marked. */
28
+ invalidate() {
29
+ this.record.contributionChanged();
30
+ }
31
+ /** A retirement of its source's document changes nothing beyond the value. */
32
+ sourceRetired() { }
33
+ /** Starts following its source, if it has one. */
34
+ follow() {
35
+ const source = this.#followed();
36
+ source?.dependents.add(this);
37
+ }
38
+ /** Stops following its source. */
39
+ unfollow() {
40
+ this.#followed()?.dependents.delete(this);
41
+ }
42
+ /** Its source when it changes (a constant never does). */
43
+ #followed() {
44
+ const content = this.#content;
45
+ if (content.kind === "native")
46
+ return content.source;
47
+ return content.kind === "json" && content.source instanceof Source ? content.source : undefined;
48
+ }
49
+ /**
50
+ * Its entry in a table of the provider at `version`: the same object while its value is the same; `undefined` when
51
+ * left out (a refused version, a failing source, a throwing adapter).
52
+ */
53
+ entry(version, provider) {
54
+ const adapter = this.version < version ? provider.accepts?.[this.version]?.contribution : undefined;
55
+ if (this.version > version || (this.version < version && adapter === undefined)) {
56
+ if (this.#out !== "refused")
57
+ this.#refused();
58
+ return undefined;
59
+ }
60
+ let value;
61
+ try {
62
+ const raw = this.#raw();
63
+ value = adapter === undefined ? raw : this.#adapt(raw, adapter);
64
+ }
65
+ catch (error) {
66
+ if (this.#out !== "failed")
67
+ this.#failed(error);
68
+ return undefined;
69
+ }
70
+ this.#out = "none";
71
+ const entry = this.#entry;
72
+ // `undefined` is a value: the entry, not its field, says whether there was one.
73
+ if (entry !== undefined && entry.value === value)
74
+ return entry;
75
+ const { plugin, type } = this.contributor;
76
+ this.#entry = { plugin, ...(type === undefined ? {} : { type }), version: this.version, value };
77
+ return this.#entry;
78
+ }
79
+ /**
80
+ * The contributed value now: a JSON source's value throws while it is failed or ended; a native source that failed
81
+ * (a registry whose `compose` threw) keeps a last good value for its readers, but is left out here as failed.
82
+ */
83
+ #raw() {
84
+ const content = this.#content;
85
+ switch (content.kind) {
86
+ case "plain":
87
+ return content.value;
88
+ case "json":
89
+ return content.source.value;
90
+ case "native":
91
+ return content.source.current();
92
+ }
93
+ }
94
+ #adapt(raw, adapter) {
95
+ const adapted = this.#adapted;
96
+ if (adapted !== undefined && adapted.from === raw && adapted.adapter === adapter)
97
+ return adapted.value;
98
+ const value = this.record.adapt(() => adapter(raw));
99
+ this.#adapted = { from: raw, adapter, value };
100
+ return value;
101
+ }
102
+ #refused() {
103
+ this.#out = "refused";
104
+ const { plugin, type } = this.contributor;
105
+ const registry = this.record.name;
106
+ const where = type === undefined ? {} : { type };
107
+ this.record.reportContribution({
108
+ kind: "contribution_refused",
109
+ registry,
110
+ plugin,
111
+ ...where,
112
+ version: this.version,
113
+ });
114
+ }
115
+ #failed(error) {
116
+ this.#out = "failed";
117
+ const { plugin, type } = this.contributor;
118
+ const registry = this.record.name;
119
+ const where = type === undefined ? {} : { type };
120
+ this.record.reportContribution({
121
+ kind: "contribution_failed",
122
+ registry,
123
+ plugin,
124
+ ...where,
125
+ error: handedOut(error),
126
+ });
127
+ }
128
+ }
129
+ //# sourceMappingURL=contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contribution.js","sourceRoot":"","sources":["../../src/registries/contribution.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,qHAAqH;AAErH,OAAO,EAAqC,SAAS,EAAqB,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAgB/G;;;;GAIG;AACH,MAAM,OAAO,oBAAoB;IAChC,sCAAsC;I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sB;YAC5B,QAAQ;YACR,MAAM;YACN,GAAG,KAAK;YACR,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,KAAc;QACrB,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC;QACrB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC;QAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAClC,MAAM,KAAK,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QACjD,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC;YAC9B,IAAI,EAAE,qBAAqB;YAC3B,QAAQ;YACR,MAAM;YACN,GAAG,KAAK;YACR,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC;SACvB,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["// One contributor's contribution to a registry (slice 8 §1): its table entry, made once per value (an older version's\n// adapted once per value), followed when it is a Chord watchable, left out and reported when it fails or is refused.\n\nimport { type Dependent, type DeriveSource, handedOut, type NativeSource, Source } from \"../state/internal.ts\";\nimport type { RegistryRecord } from \"./record.ts\";\nimport type { RegistryEntry, RegistryProvider } from \"./registry.ts\";\n\n/** Who contributes: a facet (by plugin) or a host-lifetime object (by plugin and type). */\nexport type Contributor = { readonly plugin: string; readonly type: string | undefined };\n\n/**\n * What a contribution is: a plain value, a Chord JSON watchable (a source or a constant), or a native source; the\n * watchables followed for their value.\n */\nexport type ContributionContent =\n\t| { readonly kind: \"plain\"; readonly value: unknown }\n\t| { readonly kind: \"json\"; readonly source: DeriveSource }\n\t| { readonly kind: \"native\"; readonly source: NativeSource };\n\n/**\n * One contributor's contribution to a registry: a plain value, or a Chord source it follows as a dependent (a change\n * marks the registry's table). Its table entry is made once per value (an older version's adapted once per value);\n * a failure or refusal leaves it out, reported once per episode.\n */\nexport class RegistryContribution implements Dependent {\n\t/** The registry it contributes to. */\n\treadonly record: RegistryRecord;\n\treadonly contributor: Contributor;\n\t/** The registry version its contributor was built against. */\n\treadonly version: number;\n\treadonly #content: ContributionContent;\n\t/** The last adaptation of an older contribution: the value and adapter it was made from, and its result. */\n\t#adapted: { readonly from: unknown; readonly adapter: (old: never) => unknown; readonly value: unknown } | undefined;\n\t#entry: RegistryEntry<unknown> | undefined;\n\t/** Left out since its last entry: failing (reported once), or refused (reported once). */\n\t#out: \"none\" | \"failed\" | \"refused\" = \"none\";\n\n\tconstructor(record: RegistryRecord, contributor: Contributor, version: number, content: ContributionContent) {\n\t\tthis.record = record;\n\t\tthis.contributor = contributor;\n\t\tthis.version = version;\n\t\tthis.#content = content;\n\t}\n\n\t/** Its source changed (inside a batch): the registry's table is marked. */\n\tinvalidate(): void {\n\t\tthis.record.contributionChanged();\n\t}\n\n\t/** A retirement of its source's document changes nothing beyond the value. */\n\tsourceRetired(): void {}\n\n\t/** Starts following its source, if it has one. */\n\tfollow(): void {\n\t\tconst source = this.#followed();\n\t\tsource?.dependents.add(this);\n\t}\n\n\t/** Stops following its source. */\n\tunfollow(): void {\n\t\tthis.#followed()?.dependents.delete(this);\n\t}\n\n\t/** Its source when it changes (a constant never does). */\n\t#followed(): Source | NativeSource | undefined {\n\t\tconst content = this.#content;\n\t\tif (content.kind === \"native\") return content.source;\n\t\treturn content.kind === \"json\" && content.source instanceof Source ? content.source : undefined;\n\t}\n\n\t/**\n\t * Its entry in a table of the provider at `version`: the same object while its value is the same; `undefined` when\n\t * left out (a refused version, a failing source, a throwing adapter).\n\t */\n\tentry(version: number, provider: RegistryProvider<unknown, unknown>): RegistryEntry<unknown> | undefined {\n\t\tconst adapter = this.version < version ? provider.accepts?.[this.version]?.contribution : undefined;\n\t\tif (this.version > version || (this.version < version && adapter === undefined)) {\n\t\t\tif (this.#out !== \"refused\") this.#refused();\n\t\t\treturn undefined;\n\t\t}\n\t\tlet value: unknown;\n\t\ttry {\n\t\t\tconst raw = this.#raw();\n\t\t\tvalue = adapter === undefined ? raw : this.#adapt(raw, adapter);\n\t\t} catch (error) {\n\t\t\tif (this.#out !== \"failed\") this.#failed(error);\n\t\t\treturn undefined;\n\t\t}\n\t\tthis.#out = \"none\";\n\t\tconst entry = this.#entry;\n\t\t// `undefined` is a value: the entry, not its field, says whether there was one.\n\t\tif (entry !== undefined && entry.value === value) return entry;\n\t\tconst { plugin, type } = this.contributor;\n\t\tthis.#entry = { plugin, ...(type === undefined ? {} : { type }), version: this.version, value };\n\t\treturn this.#entry;\n\t}\n\n\t/**\n\t * The contributed value now: a JSON source's value throws while it is failed or ended; a native source that failed\n\t * (a registry whose `compose` threw) keeps a last good value for its readers, but is left out here as failed.\n\t */\n\t#raw(): unknown {\n\t\tconst content = this.#content;\n\t\tswitch (content.kind) {\n\t\t\tcase \"plain\":\n\t\t\t\treturn content.value;\n\t\t\tcase \"json\":\n\t\t\t\treturn content.source.value;\n\t\t\tcase \"native\":\n\t\t\t\treturn content.source.current();\n\t\t}\n\t}\n\n\t#adapt(raw: unknown, adapter: (old: never) => unknown): unknown {\n\t\tconst adapted = this.#adapted;\n\t\tif (adapted !== undefined && adapted.from === raw && adapted.adapter === adapter) return adapted.value;\n\t\tconst value = this.record.adapt(() => adapter(raw as never));\n\t\tthis.#adapted = { from: raw, adapter, value };\n\t\treturn value;\n\t}\n\n\t#refused(): void {\n\t\tthis.#out = \"refused\";\n\t\tconst { plugin, type } = this.contributor;\n\t\tconst registry = this.record.name;\n\t\tconst where = type === undefined ? {} : { type };\n\t\tthis.record.reportContribution({\n\t\t\tkind: \"contribution_refused\",\n\t\t\tregistry,\n\t\t\tplugin,\n\t\t\t...where,\n\t\t\tversion: this.version,\n\t\t});\n\t}\n\n\t#failed(error: unknown): void {\n\t\tthis.#out = \"failed\";\n\t\tconst { plugin, type } = this.contributor;\n\t\tconst registry = this.record.name;\n\t\tconst where = type === undefined ? {} : { type };\n\t\tthis.record.reportContribution({\n\t\t\tkind: \"contribution_failed\",\n\t\t\tregistry,\n\t\t\tplugin,\n\t\t\t...where,\n\t\t\terror: handedOut(error),\n\t\t});\n\t}\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import type { ComposeContext, RegistryTable } from "./registry.ts";
2
+ /** An item taken from a table, with the contributor it came from. */
3
+ export type TableItem<I> = {
4
+ readonly value: I;
5
+ readonly plugin: string;
6
+ readonly type?: string;
7
+ };
8
+ /**
9
+ * A map of every entry's keyed items (`entriesOf`, e.g. its routes), in table order: a key taken already is reported
10
+ * through `report` (`compose`'s) naming both plugins, and the first by plugin name keeps it.
11
+ */
12
+ export declare function keyedEntries<C, I>(table: RegistryTable<C>, entriesOf: (value: C) => Readonly<Record<string, I>> | undefined, report: ComposeContext["report"]): ReadonlyMap<string, TableItem<I>>;
13
+ /**
14
+ * Every entry's items (`itemsOf`) in one list: in table order, or sorted by `orderOf` (a phase's index, for example),
15
+ * table order kept among equals.
16
+ */
17
+ export declare function orderedEntries<C, I>(table: RegistryTable<C>, itemsOf: (value: C) => readonly I[] | undefined, orderOf?: (item: I) => number): readonly TableItem<I>[];
18
+ //# sourceMappingURL=entries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/registries/entries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnE,qEAAqE;AACrE,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElG;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAChC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,EAChE,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAC9B,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAenC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,EAClC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,EACvB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,SAAS,CAAC,EAAE,GAAG,SAAS,EAC/C,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAC3B,SAAS,SAAS,CAAC,CAAC,CAAC,EAAE,CAQzB"}