@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":"workers.js","sourceRoot":"","sources":["../../../src/node/workers/workers.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,mHAAmH;AACnH,oHAAoH;AACpH,8GAA8G;AAC9G,mHAAmH;AACnH,kHAAkH;AAClH,oHAAoH;AACpH,+GAA+G;AAC/G,wHAAwH;AACxH,iBAAiB;AAGjB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAA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AAC5F,SAAS,OAAO,CAAC,SAAsC;IACtD,MAAM,KAAK,GAAgC,EAAE,CAAC;IAC9C,KAAK,MAAM,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC;QACnD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC;QAC/C,CAAC;aAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC;YACzC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;YACtC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;QAChG,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["// The workers component (slice 10 §3, §4; decision \"Slice 10's points\"): a forked worker process per address of one\n// host kind, started on demand by the route it owns, stopped when idle, never restarted by itself (R2): a crash, a\n// `fatal` or a failed start leaves the address failed until `retry` or a rollout. A running worker's lost link is a\n// stop its holders start a new worker after, once a minute (decision \"A lost worker link is recovered from\").\n// Per address, a child's events are recorded on that child as they happen; starts and stops run one after another.\n// A worker's exit is published only after its link's work ended (decision \"A worker's exit is published after its\n// link's work ended\"): no call of an exited worker runs, and no change it made lands, once `state` says it is gone.\n// Every worker is forked from the kind's worker base, bundled once by `build` (the kit: right after the server\n// listens; a start waits for it, and fails when it did not build; decision \"Workers start from the base code the server\n// booted with\").\n\nimport type { Context } from \"../../context/index.ts\";\nimport { awaitWithContext, BACKGROUND_CONTEXT, withAbortSignal } from \"../../context/index.ts\";\nimport type { Address, HostKind, KindShape } from \"../../contracts/index.ts\";\nimport type { Params } from \"../../contracts/internal.ts\";\nimport { ChordError, type Principal } from \"../../data/index.ts\";\nimport type { Host, RouteHandle, RouteOptions } from \"../../host/index.ts\";\nimport type { JsonValue } from \"../../json.ts\";\nimport { Batch, type BatchError, Source } from \"../../state/internal.ts\";\nimport type { ChordStore, Store } from \"../../store/store.ts\";\nimport type { Watchable } from \"../../watch.ts\";\nimport type { BaseInputs } from \"../plugins/base-inputs.ts\";\nimport type { Plugins, RolloutHost, RolloutStep } from \"../plugins/plugins.ts\";\nimport type { PluginScript } from \"../plugins/runtime.ts\";\nimport { buildWorkerBase, type WorkerBase } from \"./base.ts\";\nimport { type CrossedError, type CrossedReport, type FromWorker, uncrossed, uncrossedReport } from \"./control.ts\";\nimport { clearStaleLock } from \"./lock.ts\";\nimport { type Exit, WorkerProcess } from \"./process.ts\";\n\n/** What `createWorkers` takes. `kind`, `entry`, `execArgv` and `env` are bootstrap; the functions are called per use. */\nexport type WorkersOptions<P extends Principal, K extends KindShape> = {\n\t/** The facet kind its workers load (`\"worker\"`), shipped by the plugins component. */\n\treadonly kind: string;\n\t/**\n\t * The worker's entry module (it calls `workerMain`), bundled with the base code it imports by `build`; its Node flags\n\t * (their `--conditions` resolve the bundle's imports too) and its environment.\n\t */\n\treadonly entry: string;\n\treadonly execArgv?: readonly string[];\n\treadonly env?: Readonly<Record<string, string>>;\n\t/**\n\t * The private directory the worker base's files are written into at the first fork, its own while the component is\n\t * open (emptied first, removed at `close`; never touched after it, so a later start may own it then): one that stays\n\t * the same between starts lets Node's compile cache know them; none: a new temporary directory.\n\t */\n\treadonly baseDir?: string;\n\t/**\n\t * Node's compile cache for the workers (`NODE_COMPILE_CACHE` in their environment unless `env` sets it): forks load\n\t * the base and the packages it imports from compiled code; none: the server's environment decides.\n\t */\n\treadonly compileCache?: string;\n\t/** The route's `authorize`: whether `principal` may reach `address` (synchronous). */\n\treadonly authorize: (principal: P, address: Address<K>) => boolean;\n\t/**\n\t * The route's admission (`RouteOptions.admit`, slice 14 §2.3), passed through: no worker starts for a principal the\n\t * decision does not allow. It reads only contracts the app's API owns (base code never reloads).\n\t */\n\treadonly admit?: RouteOptions<P, K>[\"admit\"];\n\t/** Who the worker at `address` is (stamped on its link). */\n\treadonly principal: (address: Address<K>) => P;\n\t/** The worker's start data (JSON), before each start; abortable (`close`), a throw fails the start. */\n\treadonly start: (address: Address<K>, context: Context) => Promise<JsonValue> | JsonValue;\n\t/** The lock one live worker of `address` holds (across processes). */\n\treadonly lock: (address: Address<K>) => string;\n\t/** How long a worker idles before it is stopped: 5 minutes by default. */\n\treadonly idleMs?: () => number;\n\t/**\n\t * The server host's store, the one its `createHost` got: a worker's exit is published once the commits queued in it\n\t * before the exit settled. Required, so it is not forgotten: `undefined` only for a host without a store (nothing\n\t * is waited for then).\n\t */\n\treadonly store: Store | undefined;\n\treadonly plugins: Plugins;\n\t/** A worker's output; without it, mirrored to this process's own. */\n\treadonly onOutput?: (address: Address<K>, stream: \"stdout\" | \"stderr\", chunk: Uint8Array) => void;\n\treadonly onError: (error: WorkersError) => void;\n};\n\n/**\n * One address's worker (R5): running or on its way, or failed (until `retry` or a rollout) with a public error: a fixed\n * message (`worker failed to start`, `worker exited (SIGSEGV)`) or the child's redacted `fatal`. `incarnation` is this\n * run of the worker's host, the `ctx.incarnation` of every call it makes: there from its link's handshake on, so\n * before its first call is handled (also one its startup makes, long before `running`); absent before.\n */\nexport type WorkerState =\n\t| {\n\t\t\treadonly status: \"starting\" | \"running\" | \"stopping\";\n\t\t\treadonly pid: number;\n\t\t\treadonly startedAt: number;\n\t\t\treadonly incarnation?: string;\n\t }\n\t| { readonly status: \"failed\"; readonly error: CrossedError; readonly at: number };\n\n/** What the component reports (and the state's watch listeners that threw). */\nexport type WorkersError =\n\t| {\n\t\t\treadonly kind: \"worker_failed\";\n\t\t\treadonly address: string;\n\t\t\t/** The full error (a start's throw, a crash, the child's `fatal`): for the app's logs, never public. */\n\t\t\treadonly error: unknown;\n\t\t\treadonly stderrTail?: string;\n\t }\n\t| {\n\t\t\t/** The app's `authorize` threw: the hold is refused (`forbidden`), the error stays private. */\n\t\t\treadonly kind: \"authorize_failed\";\n\t\t\treadonly address: string;\n\t\t\treadonly error: unknown;\n\t }\n\t| {\n\t\t\treadonly kind: \"worker_exited\";\n\t\t\treadonly address: string;\n\t\t\treadonly code: number | null;\n\t\t\treadonly signal: string | null;\n\t }\n\t| {\n\t\t\t/** A running worker's link was lost (the heartbeat, a protocol error): it was stopped, its holders start anew. */\n\t\t\treadonly kind: \"worker_link_lost\";\n\t\t\treadonly address: string;\n\t\t\treadonly error: unknown;\n\t }\n\t| BatchError;\n\n/** How a worker base's build ended: built (the files it read), or failed (esbuild's failure). */\nexport type WorkersBuilt =\n\t| { readonly kind: \"built\"; readonly inputs: BaseInputs }\n\t| { readonly kind: \"failed\"; readonly error: unknown };\n\n/** The workers component. */\nexport interface Workers<K extends KindShape> {\n\t/**\n\t * Per address key its `WorkerState`; no entry when stopped or never started. A JSON watchable. A worker's entry\n\t * goes (or turns `failed`) only after its link's work ended: its link is closed first, which aborts the calls it\n\t * made (a transaction under a call's `ctx` not yet at its commit is refused) and drops what it sent and was not\n\t * handled yet, and the commits those calls had queued in `store` settled. So nothing an exited worker reported is\n\t * handled or lands after its exit shows here, and its successor starts after that: an app needs no check of its own\n\t * against reports of a worker that is gone.\n\t */\n\treadonly state: Watchable<Readonly<Record<string, WorkerState>>>;\n\t/**\n\t * Bundles the worker base, once (a start waits for it, and starts it when nothing did). Never rejects: how it ended\n\t * (`built`: the files it was built from with their bytes' hashes, the app's base code for its workers). Every start\n\t * fails while it failed.\n\t */\n\tbuild(): Promise<WorkersBuilt>;\n\t/** How the build ended, once it did. */\n\treadonly built: WorkersBuilt | undefined;\n\t/** Suspends `address` while it has holders (`RouteHandle.suspend`), then stops its worker. */\n\tstop(address: Address<K>, context: Context): Promise<void>;\n\t/** Clears `address`'s failure and suspension: it starts again now if held (`RouteHandle.retry`). */\n\tretry(address: Address<K>, context: Context): Promise<void>;\n\t/** A rollout step shipping the kind's current set to every worker, one result per worker (§4). */\n\tstep(name: string): RolloutStep;\n\t/**\n\t * Cancels starts, stops every worker, then removes the worker base's files once every worker exited (also when\n\t * `context` ends the wait first); new starts reject `released/closed`.\n\t */\n\tclose(context: Context): Promise<void>;\n}\n\n/**\n * Creates the workers component on `host`: it routes `Kind` itself (`host.route`, before `load`). Its worker base is\n * not built yet (`build`).\n */\nexport function createWorkers<P extends Principal, N extends string, Q extends Params>(\n\thost: Host<P>,\n\tKind: HostKind<N, Q>,\n\toptions: WorkersOptions<P, HostKind<N, Q>>,\n\tcontext: Context,\n): Workers<HostKind<N, Q>> {\n\t// Its addresses are `Address<HostKind<N, Q>>`, as the route hands them over.\n\tconst component = new WorkersComponent(options as unknown as WorkersOptions<Principal, HostKind>, context);\n\tconst route = host.route(\n\t\tKind,\n\t\t{\n\t\t\tauthorize: (principal, address) => {\n\t\t\t\t// A throw would reach the holder as the hold's failure: the app's error stays private.\n\t\t\t\ttry {\n\t\t\t\t\treturn options.authorize(principal, address);\n\t\t\t\t} catch (error) {\n\t\t\t\t\toptions.onError({ kind: \"authorize_failed\", address: address.key, error });\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t},\n\t\t\t// The address is the route's, of `Kind` (the component works on any kind's); the principal is\n\t\t\t// `options.principal`'s, a `P`.\n\t\t\tresolve: (address, routing) =>\n\t\t\t\tcomponent.resolve(address as unknown as Address<HostKind>, routing) as Promise<Resolved<P>>,\n\t\t\t...(options.admit === undefined ? {} : { admit: options.admit }),\n\t\t},\n\t\tcontext,\n\t);\n\tcomponent.route = route as unknown as RouteHandle<HostKind>;\n\treturn component as unknown as Workers<HostKind<N, Q>>;\n}\n\n/**\n * A failure an address keeps until `retry` or a rollout: what the public sees (a fixed message, or the child's redacted\n * `fatal`; decision \"Slice 10 fix round, worker errors in public\") and when.\n */\ntype Failure = { readonly error: CrossedError; readonly at: number };\n\n/**\n * Why a child fails when it exits, recorded as it happens: a start that failed, a `fatal`, a lost link. `error` is the\n * full error (`onError` only); `public` what holders and `state` get (a fixed one from the exit when absent).\n */\ntype Cause = {\n\treadonly error: unknown;\n\treadonly public?: CrossedError;\n\t/** The component ended the child itself (a failed start): its exit is no `worker_exited`. */\n\treadonly killed?: true;\n\t/** A running child's link was lost: its address may recover (`#recovers`) instead of failing. */\n\treadonly lost?: true;\n};\n\n/** How a child's reloads end once it is gone: stopped cleanly (a stop's exit) or with an error. */\ntype Ended = { readonly kind: \"stopped\" } | { readonly kind: \"failed\"; readonly error: unknown };\n\n/** One worker process of an address, with what its events recorded. */\ntype Child = {\n\treadonly process: WorkerProcess;\n\tstatus: \"starting\" | \"running\" | \"stopping\";\n\t/** A stop was asked for: its exit is no crash. */\n\tstopping: boolean;\n\tcause: Cause | undefined;\n\t/** `started`: the app's host listens on its link. */\n\treadonly started: PromiseWithResolvers<void>;\n\t/** `ready`: its load report; rejected when it exits before. */\n\treadonly ready: PromiseWithResolvers<CrossedReport>;\n\t/** Its exit was published (`#left`): its address's next start may go on. */\n\treadonly gone: PromiseWithResolvers<void>;\n\t/** Its host's incarnation, from its link's handshake on (`resolve`'s `opened`). */\n\tincarnation: string | undefined;\n\t/** Since when it is idle (from `ready`); `undefined` while busy or before `ready`. */\n\tidleSince: number | undefined;\n\t/** An idle stop is queued (checked again when it runs). */\n\tidleStop: boolean;\n\t/** The set its start message or its last reload that applied without failures carried. */\n\tshipped: string;\n\t/** Its reloads, one outstanding at a time; settles to nothing (a report kept as its value would stay alive). */\n\treloading: Promise<void>;\n\t/** The waiter of its outstanding reload. */\n\treloaded: ((reply: Extract<FromWorker, { readonly kind: \"reloaded\" | \"reload_failed\" }>) => void) | undefined;\n\t/** Set once its link is gone or it exited: every reload queued behind settles with it. */\n\tended: Ended | undefined;\n\t/** The grace timer of a stop or of a lost link. */\n\tgrace: ReturnType<typeof setTimeout> | undefined;\n\t/** The lock its start message named; cleared after its exit when it was killed holding it. */\n\tlock: string | undefined;\n};\n\n/** One address: its operations in a queue, its child, its failure. Kept while it has any of them. */\ntype Routed = {\n\treadonly address: Address<HostKind>;\n\tqueue: Promise<void>;\n\tpending: number;\n\tchild: Child | undefined;\n\tfailure: Failure | undefined;\n\t/** A start was queued and has not settled. */\n\tstarting: Promise<unknown> | undefined;\n\t/** When it last recovered from a lost link (`#recovers`). */\n\trecovered: number | undefined;\n};\n\n/** Starts a worker may take until `started` (fork, lock, connect): 60 s. */\nconst START_TIMEOUT = 60_000;\n\n/** How long a stopping worker (or one whose link is gone) gets before its tree is killed: 5 s. */\nconst GRACE = 5_000;\n\n/** How often idle workers are looked for: every second. */\nconst IDLE_CHECK = 1_000;\n\n/** How long a worker idles before it is stopped unless `idleMs` says otherwise: 5 minutes. */\nconst IDLE_MS = 5 * 60_000;\n\n/** How long after a recovered lost link another one fails the address: 1 minute. */\nconst RECOVERY_WINDOW = 60_000;\n\n/** The public error of a start that failed. */\nconst START_FAILED: CrossedError = { message: \"worker failed to start\", code: \"unavailable\" };\n\n/** How the worker base's build ended: its handle, or esbuild's failure. */\ntype Base =\n\t| { readonly kind: \"built\"; readonly base: WorkerBase }\n\t| { readonly kind: \"failed\"; readonly error: unknown };\n\n/** `base` as callers see it. */\nfunction builtOf(base: Base): WorkersBuilt {\n\treturn base.kind === \"built\" ? { kind: \"built\", inputs: base.base.inputs } : base;\n}\n\n/** The link type a route's `resolve` returns. */\ntype Link = WorkerProcess[\"link\"];\n\n/** What the component's `resolve` gives the route: the worker's link, who it is, and where its incarnation goes. */\ntype Resolved<P extends Principal> = {\n\treadonly link: Link;\n\treadonly principal: P;\n\treadonly trusted: true;\n\treadonly opened: (incarnation: string) => void;\n};\n\nclass WorkersComponent implements Workers<HostKind> {\n\t/** Set by `createWorkers` once the route exists. */\n\troute!: RouteHandle<HostKind>;\n\treadonly state: Watchable<Readonly<Record<string, WorkerState>>>;\n\treadonly #state: WorkersState;\n\treadonly #options: WorkersOptions<Principal, HostKind>;\n\t/** The server host's store, if it has one: `openStore`'s, the one maker of a `Store`. */\n\treadonly #store: ChordStore | undefined;\n\t/** What every fork's environment adds to the server's: the app's `env`, the compile cache's directory. */\n\treadonly #environment: Readonly<Record<string, string>> | undefined;\n\t/** The worker base's build, started once; its outcome once it ended. */\n\t#building: Promise<Base> | undefined;\n\t#base: Base | undefined;\n\treadonly #addresses = new Map<string, Routed>();\n\t/** Aborted at `close`: starts waiting in the app's `start` or for `started` end. */\n\treadonly #closing = new AbortController();\n\t/** `#closing`'s signal as a context: what a start's waits are bounded by. */\n\treadonly #closingContext = withAbortSignal(this.#closing.signal, BACKGROUND_CONTEXT);\n\t/** Whether the route's context closes it already (its first `resolve` attached that). */\n\t#routing = false;\n\t#idleTimer: ReturnType<typeof setInterval> | undefined;\n\n\tconstructor(options: WorkersOptions<Principal, HostKind>, context: Context) {\n\t\tthis.#options = options;\n\t\tthis.#store = options.store as ChordStore | undefined;\n\t\tconst { compileCache, env } = options;\n\t\tthis.#environment = compileCache === undefined ? env : { NODE_COMPILE_CACHE: compileCache, ...env };\n\t\tthis.#state = new WorkersState(this.#addresses, new Batch((error) => options.onError(error), undefined));\n\t\t// Its value is a `Record<string, WorkerState>`.\n\t\tthis.state = this.#state as unknown as Watchable<Readonly<Record<string, WorkerState>>>;\n\t\tthis.#closeWith(context);\n\t}\n\n\tbuild(): Promise<WorkersBuilt> {\n\t\treturn this.#built().then(builtOf);\n\t}\n\n\tget built(): WorkersBuilt | undefined {\n\t\treturn this.#base === undefined ? undefined : builtOf(this.#base);\n\t}\n\n\t/** The worker base's build, started once. */\n\t#built(): Promise<Base> {\n\t\tconst { entry, execArgv = [], baseDir } = this.#options;\n\t\tthis.#building ??= buildWorkerBase(entry, execArgv, baseDir)\n\t\t\t.then(\n\t\t\t\t// Nothing is written until a fork (`file()`): a build that ends after the close touches no file.\n\t\t\t\t(base): Base => ({ kind: \"built\", base }),\n\t\t\t\t(error: unknown): Base => ({ kind: \"failed\", error }),\n\t\t\t)\n\t\t\t.then((outcome) => {\n\t\t\t\tthis.#base = outcome;\n\t\t\t\treturn outcome;\n\t\t\t});\n\t\treturn this.#building;\n\t}\n\n\t/**\n\t * The route's `resolve`: a failed address rejects at once with its (public) failure, nothing forks; otherwise a\n\t * start, after the previous child's exit.\n\t */\n\tresolve(address: Address<HostKind>, routing: Context): Promise<Resolved<Principal>> {\n\t\tif (!this.#routing) {\n\t\t\tthis.#routing = true;\n\t\t\tthis.#closeWith(routing);\n\t\t}\n\t\tconst routed = this.#routed(address);\n\t\tif (routed.failure !== undefined) return Promise.reject(uncrossed(routed.failure.error));\n\t\tif (this.#closing.signal.aborted) return Promise.reject(closed());\n\t\tconst started = this.#enqueue(routed, () => this.#start(routed, routing));\n\t\trouted.starting = started;\n\t\tvoid started.then(\n\t\t\t() => this.#settled(routed, started),\n\t\t\t() => this.#settled(routed, started),\n\t\t);\n\t\treturn started;\n\t}\n\n\tasync stop(address: Address<HostKind>, context: Context): Promise<void> {\n\t\tthis.route.suspend(address);\n\t\tconst routed = this.#addresses.get(address.key);\n\t\tif (routed === undefined) return;\n\t\tawait awaitWithContext(\n\t\t\tthis.#enqueue(routed, () => this.#stop(routed)),\n\t\t\tcontext,\n\t\t);\n\t}\n\n\tasync retry(address: Address<HostKind>, _context: Context): Promise<void> {\n\t\tconst routed = this.#addresses.get(address.key);\n\t\tif (routed !== undefined) {\n\t\t\trouted.failure = undefined;\n\t\t\tthis.#state.refresh();\n\t\t\tthis.#forget(routed);\n\t\t}\n\t\tthis.route.retry(address);\n\t}\n\n\tstep(name: string): RolloutStep {\n\t\treturn { name, kinds: [this.#options.kind], reload: (_built, context) => this.#rollout(context) };\n\t}\n\n\tasync close(context: Context): Promise<void> {\n\t\tif (!this.#closing.signal.aborted) this.#closing.abort(closed());\n\t\tclearInterval(this.#idleTimer);\n\t\tthis.#idleTimer = undefined;\n\t\t// Each stop, then what its exit queued (the clear of a killed child's lock file).\n\t\tconst stops = [...this.#addresses.values()].map((routed) =>\n\t\t\tthis.#enqueue(routed, () => this.#stop(routed)).then(() => routed.queue),\n\t\t);\n\t\t// The base's files stay until every child exited or was killed (a stopping worker's closers may import a lazy\n\t\t// chunk), also when `context` ends the wait first: nothing forks once closing, and only files this component\n\t\t// wrote go. The kit releases the data directory's lock only after this close resolved.\n\t\tconst exited = Promise.all(stops).then(() => {\n\t\t\tif (this.#base?.kind === \"built\") this.#base.base.remove();\n\t\t});\n\t\tawait awaitWithContext(exited, context);\n\t}\n\n\t/** `context`'s abort closes the component (the route's is aborted when the host closes). */\n\t#closeWith(context: Context): void {\n\t\tconst signal = context.abortSignal;\n\t\tif (signal === undefined || signal.aborted) return;\n\t\tsignal.addEventListener(\"abort\", () => void this.close(BACKGROUND_CONTEXT).catch(() => {}), { once: true });\n\t}\n\n\t/** The record of `address`, made by its first use. */\n\t#routed(address: Address<HostKind>): Routed {\n\t\tlet routed = this.#addresses.get(address.key);\n\t\tif (routed === undefined) {\n\t\t\trouted = {\n\t\t\t\taddress,\n\t\t\t\tqueue: Promise.resolve(),\n\t\t\t\tpending: 0,\n\t\t\t\tchild: undefined,\n\t\t\t\tfailure: undefined,\n\t\t\t\tstarting: undefined,\n\t\t\t\trecovered: undefined,\n\t\t\t};\n\t\t\tthis.#addresses.set(address.key, routed);\n\t\t}\n\t\treturn routed;\n\t}\n\n\t/** Runs `operation` after the address's earlier ones. */\n\t#enqueue<T>(routed: Routed, operation: () => Promise<T>): Promise<T> {\n\t\trouted.pending++;\n\t\tconst run = routed.queue.then(operation);\n\t\trouted.queue = run.then(\n\t\t\t() => this.#done(routed),\n\t\t\t() => this.#done(routed),\n\t\t);\n\t\treturn run;\n\t}\n\n\t/** An operation ended. */\n\t#done(routed: Routed): void {\n\t\trouted.pending--;\n\t\tthis.#forget(routed);\n\t}\n\n\t/** A start settled: no longer starting. */\n\t#settled(routed: Routed, started: Promise<unknown>): void {\n\t\tif (routed.starting === started) routed.starting = undefined;\n\t}\n\n\t/** Forgets an address with no operation, no child and no failure. */\n\t#forget(routed: Routed): void {\n\t\tif (routed.pending === 0 && routed.child === undefined && routed.failure === undefined) {\n\t\t\tthis.#addresses.delete(routed.address.key);\n\t\t}\n\t}\n\n\t/**\n\t * A start: the app's start data, the fork, the start message with the kind's current set, then `started` within the\n\t * start timer (fork, lock and connect only). Its failure fails the address; `close` ends it at any of its waits (an\n\t * app's `start` that ignores its signal too), a forked child is stopped.\n\t */\n\tasync #start(routed: Routed, routing: Context): Promise<Resolved<Principal>> {\n\t\tconst { address } = routed;\n\t\t// After the previous child's exit was published (its link closes before, which may have asked for this start):\n\t\t// a crash recorded meanwhile rejects this start.\n\t\tawait routed.child?.gone.promise;\n\t\tconst crashed = routed.failure;\n\t\tif (crashed !== undefined) throw uncrossed(crashed.error);\n\t\tif (this.#closing.signal.aborted) throw closed();\n\t\t// The kind's worker base: a start waits for its build, and fails while it failed.\n\t\tconst base = await awaitWithContext(this.#built(), this.#closingContext).catch(() => {\n\t\t\t// `#built` never rejects: the close ended the wait.\n\t\t\tthrow closed();\n\t\t});\n\t\tif (this.#closing.signal.aborted) throw closed();\n\t\tif (base.kind === \"failed\") throw this.#fail(routed, { error: base.error, public: START_FAILED }, undefined);\n\t\tconst context = withAbortSignal(this.#closing.signal, routing);\n\t\tlet data: JsonValue;\n\t\ttry {\n\t\t\tdata = await awaitWithContext(Promise.resolve(this.#options.start(address, context)), this.#closingContext);\n\t\t} catch (error) {\n\t\t\tif (this.#closing.signal.aborted) throw closed();\n\t\t\tthrow this.#fail(routed, { error, public: START_FAILED }, undefined);\n\t\t}\n\t\t// Checked in the same synchronous step as the fork, which writes the base's files (`file()`): never after the\n\t\t// close (the kit releases the data directory's lock after it; a later start owns `baseDir` then).\n\t\tif (this.#closing.signal.aborted) throw closed();\n\t\tlet child: Child;\n\t\ttry {\n\t\t\tchild = this.#fork(routed, base.base);\n\t\t} catch (error) {\n\t\t\tthrow this.#fail(routed, { error, public: START_FAILED }, undefined);\n\t\t}\n\t\tconst timer = setTimeout(() => {\n\t\t\tconst error = new Error(`worker ${address.key}: did not start within ${START_TIMEOUT / 1000} s`);\n\t\t\tchild.cause ??= { error, killed: true };\n\t\t\tchild.process.kill();\n\t\t}, START_TIMEOUT);\n\t\t// Every app hook of the start runs in here: what one throws stays private (`worker_failed`), its holders and\n\t\t// `state` get the fixed public message (Astra's recheck R3: `principal` threw through to a guest).\n\t\ttry {\n\t\t\tconst scripts = await this.#options.plugins.scripts(this.#options.kind, context);\n\t\t\tchild.shipped = keyOf(scripts);\n\t\t\tconst lock = this.#options.lock(address);\n\t\t\t// A worker killed without its exit hooks (SIGKILL), maybe by an earlier server, left its socket file, which fails\n\t\t\t// its successors closed. The component is the one clearer of its addresses' locks, in the address's queue: one\n\t\t\t// clear at a time (decision \"Stale lock files are cleared by the starter\"). A live holder (an old worker still\n\t\t\t// exiting) is kept and waited for.\n\t\t\tawait clearStaleLock(lock, context);\n\t\t\tchild.lock = lock;\n\t\t\tchild.process.send({ kind: \"start\", address, start: data, scripts, lock });\n\t\t\tawait awaitWithContext(child.started.promise, this.#closingContext);\n\t\t\treturn {\n\t\t\t\tlink: child.process.link,\n\t\t\t\tprincipal: this.#options.principal(address),\n\t\t\t\ttrusted: true,\n\t\t\t\topened: (incarnation) => this.#opened(routed, child, incarnation),\n\t\t\t};\n\t\t} catch (error) {\n\t\t\t// Closing is a stop (no failure); anything else fails the start.\n\t\t\tif (this.#closing.signal.aborted) child.stopping = true;\n\t\t\telse child.cause ??= { error, public: START_FAILED, killed: true };\n\t\t\tchild.process.kill();\n\t\t\tawait child.gone.promise;\n\t\t\tif (this.#closing.signal.aborted) throw closed();\n\t\t\tthrow uncrossed(routed.failure?.error ?? START_FAILED);\n\t\t} finally {\n\t\t\tclearTimeout(timer);\n\t\t}\n\t}\n\n\t/** Forks the address's worker and records its events on it as they happen. */\n\t#fork(routed: Routed, base: WorkerBase): Child {\n\t\tconst { address } = routed;\n\t\tconst onOutput = this.#options.onOutput;\n\t\tlet child!: Child;\n\t\tconst process = new WorkerProcess(\n\t\t\t{\n\t\t\t\tentry: base.file(),\n\t\t\t\t// No `--enable-source-maps`: Node would parse the base's whole map at the first stack made text (Chord makes a\n\t\t\t\t// kept error's stack text at once), a p2 session worker's about 1M positions, 50 MiB of its heap for its\n\t\t\t\t// life. Stacks name the bundle's files and functions; its source maps lie beside them (an app passes the\n\t\t\t\t// flag in `execArgv` to have Node map them, at that cost).\n\t\t\t\texecArgv: this.#options.execArgv ?? [],\n\t\t\t\t...(this.#environment === undefined ? {} : { env: this.#environment }),\n\t\t\t\t...(onOutput === undefined ? {} : { onOutput: (stream, chunk) => onOutput(address, stream, chunk) }),\n\t\t\t},\n\t\t\t{\n\t\t\t\tcontrol: (message) => this.#control(routed, child, message),\n\t\t\t\tlinkLost: () => this.#linkLost(child),\n\t\t\t\tlinkClosed: () => this.#linkClosed(child),\n\t\t\t\texited: (exit) => this.#exited(routed, child, exit),\n\t\t\t},\n\t\t);\n\t\tchild = {\n\t\t\tprocess,\n\t\t\tstatus: \"starting\",\n\t\t\tstopping: false,\n\t\t\tcause: undefined,\n\t\t\tstarted: Promise.withResolvers(),\n\t\t\tready: Promise.withResolvers(),\n\t\t\tgone: Promise.withResolvers(),\n\t\t\tincarnation: undefined,\n\t\t\tidleSince: undefined,\n\t\t\tidleStop: false,\n\t\t\tshipped: \"\",\n\t\t\treloading: Promise.resolve(),\n\t\t\treloaded: undefined,\n\t\t\tended: undefined,\n\t\t\tgrace: undefined,\n\t\t\tlock: undefined,\n\t\t};\n\t\t// Nobody may wait for them.\n\t\tchild.started.promise.catch(() => {});\n\t\tchild.ready.promise.catch(() => {});\n\t\trouted.child = child;\n\t\tthis.#state.refresh();\n\t\tthis.#watchIdle();\n\t\treturn child;\n\t}\n\n\t/**\n\t * `child`'s link completed its handshake with its host's `incarnation`: in `state` before anything else that host\n\t * sent is handled, so a handler of its first call finds its `ctx.incarnation` there.\n\t */\n\t#opened(routed: Routed, child: Child, incarnation: string): void {\n\t\tchild.incarnation = incarnation;\n\t\tif (routed.child === child) this.#state.refresh();\n\t}\n\n\t/** A control message of `child`. */\n\t#control(routed: Routed, child: Child, message: FromWorker): void {\n\t\tswitch (message.kind) {\n\t\t\tcase \"started\":\n\t\t\t\tchild.started.resolve();\n\t\t\t\treturn;\n\t\t\tcase \"ready\":\n\t\t\t\tchild.status = \"running\";\n\t\t\t\tchild.idleSince = message.idle ? Date.now() : undefined;\n\t\t\t\tchild.ready.resolve(message.report);\n\t\t\t\tif (routed.child === child) this.#state.refresh();\n\t\t\t\treturn;\n\t\t\tcase \"idle\":\n\t\t\t\tchild.idleSince = message.idle ? (child.idleSince ?? Date.now()) : undefined;\n\t\t\t\treturn;\n\t\t\tcase \"fatal\":\n\t\t\t\t// Redacted by the child's `redact`: public as it is.\n\t\t\t\tchild.cause ??= { error: uncrossed(message.error), public: message.error };\n\t\t\t\tchild.started.reject(uncrossed(message.error));\n\t\t\t\tchild.process.kill();\n\t\t\t\treturn;\n\t\t\tcase \"reloaded\":\n\t\t\tcase \"reload_failed\":\n\t\t\t\tchild.reloaded?.(message);\n\t\t}\n\t}\n\n\t/** This side closed `child`'s link (the heartbeat, a protocol error): its child is stopped, its exit a lost link. */\n\t#linkLost(child: Child): void {\n\t\tthis.#ended(child);\n\t\tif (child.stopping) return;\n\t\tchild.cause ??= lostLink(child);\n\t\tthis.#shutdown(child);\n\t\tthis.#state.refresh();\n\t}\n\n\t/**\n\t * The child's side closed its link (it is exiting, or it closed its IPC and lives on): its reloads end; one that does\n\t * not exit within the grace is killed, its exit a lost link.\n\t */\n\t#linkClosed(child: Child): void {\n\t\tthis.#ended(child);\n\t\tif (child.stopping || child.grace !== undefined) return;\n\t\tconst lost = lostLink(child);\n\t\tchild.grace = setTimeout(() => {\n\t\t\tchild.cause ??= lost;\n\t\t\tchild.process.kill();\n\t\t}, GRACE);\n\t}\n\n\t/**\n\t * `child` exited, its link closed before this was told (`WorkerProcess`): what it sent and was not handled yet is\n\t * dropped and the calls it made are aborted, so a transaction of theirs not yet at its commit is refused. Its\n\t * waiters end now; its exit is published (`#left`) once the commits queued in the server's store before now\n\t * settled (the only changes of its calls that can still land: a queued commit ignores its caller's abort). Until\n\t * then `state` still shows it, and its address's next start waits (`gone`).\n\t */\n\t#exited(routed: Routed, child: Child, exit: Exit): void {\n\t\tclearTimeout(child.grace);\n\t\t// Read now: what its events recorded up to its exit.\n\t\tconst clean = child.stopping && child.cause === undefined;\n\t\tconst cause: Cause = child.cause ?? { error: exitError(routed.address, exit, child) };\n\t\tconst shown = cause.public ?? publicExit(exit, child);\n\t\tconst failure = clean ? undefined : { ...cause, public: shown };\n\t\tchild.started.reject(uncrossed(shown));\n\t\tchild.ready.reject(uncrossed(shown));\n\t\tthis.#ended(child);\n\t\tconst lock = child.lock;\n\t\t// A child a signal ended (SIGKILL) ran no exit hooks: its socket file would stay until the address's next start.\n\t\t// Cleared in the queue, like a start's clear; a failure here is the next start's to report (it clears again).\n\t\tif (lock !== undefined && exit.signal !== null) {\n\t\t\tvoid this.#enqueue(routed, () => clearStaleLock(lock, BACKGROUND_CONTEXT)).catch(() => {});\n\t\t}\n\t\t// `settled` never rejects.\n\t\tvoid (this.#store?.settled() ?? Promise.resolve()).then(() => {\n\t\t\tthis.#left(routed, child, exit, failure);\n\t\t\tchild.gone.resolve();\n\t\t});\n\t}\n\n\t/**\n\t * Publishes `child`'s exit: a stop's exit (no `failure`) forgets it, as does a lost link the address recovers from\n\t * (`worker_link_lost`: its holders' route resolves again, a start after this); any other is a crash that fails the\n\t * address (`worker_exited` and `worker_failed` once, the full error and stderr tail for the app's logs only), except\n\t * once the component closes.\n\t */\n\t#left(\n\t\trouted: Routed,\n\t\tchild: Child,\n\t\texit: Exit,\n\t\tfailure: (Cause & { readonly public: CrossedError }) | undefined,\n\t): void {\n\t\tif (routed.child !== child) return;\n\t\trouted.child = undefined;\n\t\tif (failure !== undefined && !this.#closing.signal.aborted) {\n\t\t\tif (failure.lost === true && this.#recovers(routed)) {\n\t\t\t\tthis.#options.onError({ kind: \"worker_link_lost\", address: routed.address.key, error: failure.error });\n\t\t\t} else {\n\t\t\t\tconst { code, signal } = exit;\n\t\t\t\t// A failed start's kill is the component's own act (Opus's second recheck): only `worker_failed`.\n\t\t\t\tif (failure.killed !== true) {\n\t\t\t\t\tthis.#options.onError({ kind: \"worker_exited\", address: routed.address.key, code, signal });\n\t\t\t\t}\n\t\t\t\tthis.#fail(routed, failure, child.process.stderrTail);\n\t\t\t}\n\t\t}\n\t\tthis.#state.refresh();\n\t\tthis.#forget(routed);\n\t}\n\n\t/**\n\t * Whether `routed` recovers from its running child's lost link, recorded when it does: not within a minute of the\n\t * last recovery, so a worker that loses every link fails instead of restarting in a loop.\n\t */\n\t#recovers(routed: Routed): boolean {\n\t\tconst now = Date.now();\n\t\tif (routed.recovered !== undefined && now - routed.recovered < RECOVERY_WINDOW) return false;\n\t\trouted.recovered = now;\n\t\treturn true;\n\t}\n\n\t/**\n\t * `child`'s link is gone or it exited (the first of these): its outstanding reload and every one queued behind it\n\t * settle, `stopped` when a stop asked for it, else failed.\n\t */\n\t#ended(child: Child): void {\n\t\tif (child.ended !== undefined) return;\n\t\tchild.ended =\n\t\t\tchild.stopping && child.cause === undefined\n\t\t\t\t? { kind: \"stopped\" }\n\t\t\t\t: { kind: \"failed\", error: new ChordError({ code: \"unavailable\", message: \"worker: its link is gone\" }) };\n\t\tchild.reloaded?.({ kind: \"reload_failed\", error: { message: \"worker: its link is gone\" } });\n\t}\n\n\t/**\n\t * Fails `routed` with `cause` (`worker_failed` once, with the full error and `stderrTail`); returns the public error\n\t * a start rejects with.\n\t */\n\t#fail(routed: Routed, cause: Cause & { readonly public: CrossedError }, stderrTail: string | undefined): Error {\n\t\trouted.failure = { error: cause.public, at: Date.now() };\n\t\tthis.#options.onError({\n\t\t\tkind: \"worker_failed\",\n\t\t\taddress: routed.address.key,\n\t\t\terror: cause.error,\n\t\t\t...(stderrTail === undefined ? {} : { stderrTail }),\n\t\t});\n\t\tthis.#state.refresh();\n\t\treturn uncrossed(cause.public);\n\t}\n\n\t/** A stop: `shutdown`, the grace, then the tree killed; resolves once its exit was published. */\n\tasync #stop(routed: Routed): Promise<void> {\n\t\tconst child = routed.child;\n\t\tif (child === undefined) return;\n\t\tchild.stopping = true;\n\t\tthis.#shutdown(child);\n\t\tthis.#state.refresh();\n\t\tawait child.gone.promise;\n\t}\n\n\t/** Asks `child` to shut down and kills its tree after the grace. */\n\t#shutdown(child: Child): void {\n\t\tchild.status = \"stopping\";\n\t\tchild.process.send({ kind: \"shutdown\" });\n\t\tclearTimeout(child.grace);\n\t\tchild.grace = setTimeout(() => child.process.kill(), GRACE);\n\t}\n\n\t/** Starts the idle check (every second) while any worker exists. */\n\t#watchIdle(): void {\n\t\tif (this.#idleTimer !== undefined) return;\n\t\tthis.#idleTimer = setInterval(() => this.#checkIdle(), IDLE_CHECK);\n\t\tthis.#idleTimer.unref();\n\t}\n\n\t/** Queues a stop for every worker idle since `idleMs()`; stops checking once no worker is left. */\n\t#checkIdle(): void {\n\t\tconst idleMs = this.#idleMs();\n\t\tconst now = Date.now();\n\t\tlet workers = 0;\n\t\tfor (const routed of this.#addresses.values()) {\n\t\t\tconst child = routed.child;\n\t\t\tif (child === undefined) continue;\n\t\t\tworkers++;\n\t\t\tif (child.idleStop || child.status !== \"running\") continue;\n\t\t\tif (child.idleSince === undefined || now - child.idleSince < idleMs) continue;\n\t\t\tchild.idleStop = true;\n\t\t\tvoid this.#enqueue(routed, () => this.#idleStop(routed, child));\n\t\t}\n\t\tif (workers === 0) {\n\t\t\tclearInterval(this.#idleTimer);\n\t\t\tthis.#idleTimer = undefined;\n\t\t}\n\t}\n\n\t/** An idle stop when it runs: only if `child` is still the address's and still idle (a hold may have come since). */\n\tasync #idleStop(routed: Routed, child: Child): Promise<void> {\n\t\tchild.idleStop = false;\n\t\tif (routed.child !== child || child.idleSince === undefined) return;\n\t\tif (Date.now() - child.idleSince < this.#idleMs()) return;\n\t\tawait this.#stop(routed);\n\t}\n\n\t/** How long a worker idles before it is stopped. */\n\t#idleMs(): number {\n\t\treturn this.#options.idleMs?.() ?? IDLE_MS;\n\t}\n\n\t/**\n\t * The rollout step (§4): the set as this rollout applied it, read now (before another rollout changes it); the\n\t * failures recorded before it cleared and the held ones retried (listed once ready or failed); the set shipped to\n\t * every worker whose last applied set differs, in parallel. `context`'s abort ends only this wait: the entries\n\t * still waiting are listed with its error.\n\t */\n\tasync #rollout(context: Context): Promise<{ readonly hosts: readonly RolloutHost[] }> {\n\t\tconst { kind, plugins } = this.#options;\n\t\tconst scripts = plugins.current(kind) ?? (await plugins.scripts(kind, context));\n\t\tconst key = keyOf(scripts);\n\t\tconst entries: { readonly host: string; readonly entry: Promise<RolloutHost> }[] = [];\n\t\tfor (const routed of [...this.#addresses.values()]) {\n\t\t\tif (routed.failure === undefined) continue;\n\t\t\trouted.failure = undefined;\n\t\t\tthis.#state.refresh();\n\t\t\tthis.route.retry(routed.address);\n\t\t\tconst started = routed.starting;\n\t\t\tif (started === undefined) this.#forget(routed);\n\t\t\telse entries.push({ host: routed.address.key, entry: this.#retried(routed, started) });\n\t\t}\n\t\tfor (const routed of this.#addresses.values()) {\n\t\t\tconst child = routed.child;\n\t\t\tif (child === undefined || child.status === \"stopping\" || child.shipped === key) continue;\n\t\t\tentries.push({ host: routed.address.key, entry: this.#reload(routed.address.key, child, scripts, key) });\n\t\t}\n\t\treturn { hosts: await Promise.all(entries.map(({ host, entry }) => bounded(host, entry, context))) };\n\t}\n\n\t/** A retried address's entry: its start's load report once ready, or its error. */\n\tasync #retried(routed: Routed, started: Promise<unknown>): Promise<RolloutHost> {\n\t\tconst host = routed.address.key;\n\t\ttry {\n\t\t\tawait started;\n\t\t\tconst child = routed.child;\n\t\t\tif (child === undefined) throw new Error(\"worker: exited\");\n\t\t\treturn { kind: \"reloaded\", host, report: uncrossedReport(await child.ready.promise) };\n\t\t} catch (error) {\n\t\t\treturn { kind: \"failed\", host, error };\n\t\t}\n\t}\n\n\t/**\n\t * Ships `scripts` to `child` after its outstanding reload; settles on `reloaded`, its link's loss or its exit. Only a\n\t * reload that applied without failures marks the set shipped (a failed plugin is shipped again next time).\n\t */\n\t#reload(host: string, child: Child, scripts: readonly PluginScript[], key: string): Promise<RolloutHost> {\n\t\tconst reload = child.reloading.then(\n\t\t\t() =>\n\t\t\t\tnew Promise<RolloutHost>((resolve) => {\n\t\t\t\t\tconst settle = (ended: Ended): void => {\n\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\tended.kind === \"stopped\"\n\t\t\t\t\t\t\t\t? { kind: \"stopped\", host }\n\t\t\t\t\t\t\t\t: { kind: \"failed\", host, error: ended.error },\n\t\t\t\t\t\t);\n\t\t\t\t\t};\n\t\t\t\t\tif (child.ended !== undefined) {\n\t\t\t\t\t\tsettle(child.ended);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tchild.reloaded = (reply) => {\n\t\t\t\t\t\tchild.reloaded = undefined;\n\t\t\t\t\t\tif (reply.kind === \"reloaded\") {\n\t\t\t\t\t\t\tif (reply.report.failed.length === 0) child.shipped = key;\n\t\t\t\t\t\t\tresolve({ kind: \"reloaded\", host, report: uncrossedReport(reply.report) });\n\t\t\t\t\t\t} else if (child.ended !== undefined) {\n\t\t\t\t\t\t\tsettle(child.ended);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolve({ kind: \"failed\", host, error: uncrossed(reply.error) });\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\tchild.process.send({ kind: \"reload\", scripts });\n\t\t\t\t}),\n\t\t);\n\t\tchild.reloading = reload.then(\n\t\t\t() => {},\n\t\t\t() => {},\n\t\t);\n\t\treturn reload;\n\t}\n}\n\n/** What new starts reject with once the component closes. */\nfunction closed(): ChordError {\n\treturn new ChordError({ code: \"released\", reason: \"closed\", message: \"workers: closed\" });\n}\n\n/** The public error of a running worker's lost link that fails its address (a second one within the window). */\nconst LINK_LOST: CrossedError = { message: \"worker lost its link\", code: \"unavailable\" };\n\n/**\n * The cause of `child`'s lost link (the heartbeat, a protocol error, its own close of its link) while it lives: after\n * `ready`, one its address may recover from; before it, a failed start.\n */\nfunction lostLink(child: Child): Cause {\n\tconst error = new Error(\"worker: link lost\");\n\treturn child.status === \"running\" ? { error, public: LINK_LOST, lost: true } : { error };\n}\n\n/** The full error of an exit nobody asked for (the app's logs). */\nfunction exitError(address: Address, { code, signal }: Exit, child: Child): Error {\n\tconst how = signal === null ? `code ${code}` : `signal ${signal}`;\n\tconst when = child.status === \"starting\" ? \"exited before it was ready\" : \"exited\";\n\treturn new ChordError({ code: \"unavailable\", message: `worker ${address.key}: ${when} (${how})` });\n}\n\n/** The public error of an exit: a start that failed, or the exit's code or signal. */\nfunction publicExit({ code, signal }: Exit, child: Child): CrossedError {\n\tif (child.status === \"starting\") return START_FAILED;\n\treturn { message: `worker exited (${signal ?? `code ${code}`})`, code: \"unavailable\" };\n}\n\n/** A set's identity: its plugins and digests. */\nfunction keyOf(scripts: readonly PluginScript[]): string {\n\treturn scripts\n\t\t.map(({ plugin, built }) => `${plugin.name}@${built.kind === \"script\" ? built.digest : \"failed\"}`)\n\t\t.sort()\n\t\t.join(\"\\n\");\n}\n\n/** `entry`, or `host` listed with the abort's error once `context` aborts first (the entry goes on). */\nasync function bounded(host: string, entry: Promise<RolloutHost>, context: Context): Promise<RolloutHost> {\n\ttry {\n\t\treturn await awaitWithContext(entry, context);\n\t} catch (error) {\n\t\treturn { kind: \"failed\", host, error };\n\t}\n}\n\n/** The workers' state: a JSON watchable of every address's `WorkerState`, published once per microtask turn. */\nclass WorkersState extends Source {\n\treadonly #addresses: ReadonlyMap<string, Routed>;\n\t#value: Readonly<Record<string, WorkerState>> | undefined;\n\t#scheduled = false;\n\n\tconstructor(addresses: ReadonlyMap<string, Routed>, batch: Batch) {\n\t\tsuper(batch);\n\t\tthis.#addresses = addresses;\n\t}\n\n\tget value(): JsonValue {\n\t\tthis.#value ??= stateOf(this.#addresses);\n\t\t// Plain JSON: statuses, numbers and crossed errors.\n\t\treturn this.#value as unknown as JsonValue;\n\t}\n\n\tdeliver(context: Context): void {\n\t\tconst value = this.value;\n\t\tthis.publish(value, [[\"r\", value]], false, context);\n\t}\n\n\t/** Something changed: published with the turn's other changes while someone watches or derives from it. */\n\trefresh(): void {\n\t\tthis.#value = undefined;\n\t\tif (this.#scheduled || (!this.watched && this.dependents.size === 0)) return;\n\t\tthis.#scheduled = true;\n\t\tqueueMicrotask(() => {\n\t\t\tthis.#scheduled = false;\n\t\t\tthis.batch.within(() => this.changed(), BACKGROUND_CONTEXT);\n\t\t});\n\t}\n}\n\n/** Every address's state: its child's, or its failure; none for an address with neither. */\nfunction stateOf(addresses: ReadonlyMap<string, Routed>): Record<string, WorkerState> {\n\tconst state: Record<string, WorkerState> = {};\n\tfor (const [key, { child, failure }] of addresses) {\n\t\tif (failure !== undefined) {\n\t\t\tstate[key] = { status: \"failed\", ...failure };\n\t\t} else if (child !== undefined) {\n\t\t\tconst { pid, startedAt } = child.process;\n\t\t\tconst { status, incarnation } = child;\n\t\t\tstate[key] = { status, pid, startedAt, ...(incarnation === undefined ? {} : { incarnation }) };\n\t\t}\n\t}\n\treturn state;\n}\n"]}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Bounded output streams and adaptive progress commits: `OutputBuffer` keeps a head or tail window of a stream at a cost
3
+ * proportional to each chunk, and `Progress` paces commits of a changing value by their size.
4
+ */
5
+ /** Retention limits of one output stream. */
6
+ export type OutputLimits = {
7
+ readonly maxBytes: number;
8
+ readonly maxLines: number;
9
+ readonly retain: "head" | "tail";
10
+ };
11
+ /** Retained output and what the limits dropped. */
12
+ export type BoundedOutput = {
13
+ readonly text: string;
14
+ readonly droppedBytes: number;
15
+ readonly droppedLines: number;
16
+ };
17
+ /** An exact slice of the input within the limits, and what it left out. */
18
+ export type OutputSlice = {
19
+ readonly text: string;
20
+ readonly bytes: number;
21
+ readonly droppedBytes: number;
22
+ readonly droppedLines: number;
23
+ };
24
+ /**
25
+ * Output a producer omitted before a chunk, measured on the decoded text: every U+FFFD counts as three bytes, and no
26
+ * sanitizing is applied.
27
+ */
28
+ export interface OutputSkip {
29
+ /** UTF-8 byte length of the omitted text. */
30
+ readonly bytes: number;
31
+ /** Newlines (U+000A) in the omitted text. */
32
+ readonly newlines: number;
33
+ /** Whether the omitted text ends with a newline. */
34
+ readonly endsWithNewline: boolean;
35
+ }
36
+ /** Remove escape sequences and control characters that break display and transcripts; tabs and newlines stay. */
37
+ export declare function sanitizeOutput(text: string): string;
38
+ /**
39
+ * Bound `text` to whole lines within the limits: the first lines for `head`, the last lines for `tail`. The result is an
40
+ * exact slice, trailing newline included. A single line longer than `maxBytes` is cut at the byte limit on a character
41
+ * boundary.
42
+ */
43
+ export declare function boundOutput(text: string, limits: OutputLimits): OutputSlice;
44
+ /** The last character boundary at or before `index`. */
45
+ export declare function characterEnd(bytes: Uint8Array, index: number): number;
46
+ /**
47
+ * 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
48
+ * storing once the window is full, and tail retention drops stored text the window no longer needs when it snapshots.
49
+ * Counts of the whole stream are kept so the dropped totals stay exact.
50
+ */
51
+ export declare class OutputBuffer {
52
+ #private;
53
+ constructor(limits: OutputLimits);
54
+ /** Bytes currently held; bounded by the limits plus one chunk. */
55
+ get storedBytes(): number;
56
+ /**
57
+ * Accept a chunk; returns whether anything was accepted. `skipped` is output omitted right before the chunk, which
58
+ * must be more than the tail window by at least one byte or line; only tail retention accepts it.
59
+ */
60
+ push(chunk: string | Uint8Array, skipped?: OutputSkip): boolean;
61
+ /** Flush an incomplete trailing character as a replacement character; call when the stream ends. */
62
+ end(): void;
63
+ /** Retained, sanitized output and what the limits dropped from the whole stream. */
64
+ snapshot(): BoundedOutput;
65
+ }
66
+ /** UTF-8 byte length of `content`; a lone surrogate counts as U+FFFD, three bytes. */
67
+ export declare function utf8ByteLength(content: string): number;
68
+ /** Each progress commit also buys a pause proportional to what it wrote. */
69
+ export declare const PROGRESS_BYTES_PER_SECOND: number;
70
+ /** The clock and timer progress commits pace on. */
71
+ export type ProgressClock = {
72
+ readonly now: () => number;
73
+ /** Call `callback` once after about `delayMs`; returns a function that disarms it. */
74
+ readonly setTimer: (callback: () => void, delayMs: number) => () => void;
75
+ };
76
+ /**
77
+ * Adaptive progress commits: the first change after an idle period commits at once; each commit then delays the next
78
+ * by at least `minIntervalMs` and by its written size at 100 KiB/s. At most one commit is in flight; changes made
79
+ * meanwhile coalesce into the next one. Paces on `clock`, by default `Date.now` and `setTimeout`.
80
+ */
81
+ export declare class Progress {
82
+ #private;
83
+ constructor(write: () => Promise<number>, onError: (error: unknown) => void, minIntervalMs: number, clock?: ProgressClock);
84
+ /** Schedule a commit. */
85
+ mark(): void;
86
+ /** Schedule a commit; the promise settles with the commit that includes this change. */
87
+ markAndWait(): Promise<void>;
88
+ /** Stop committing and wait for the commit in flight; returns the waiters the final commit must settle. */
89
+ stop(): Promise<PromiseWithResolvers<void>[]>;
90
+ }
91
+ //# sourceMappingURL=output.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6CAA6C;AAC7C,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEtH,mDAAmD;AACnD,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpH,2EAA2E;AAC3E,MAAM,MAAM,WAAW,GAAG;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QA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,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;CACzE,CAAC;AAUF;;;;GAIG;AACH,qBAAa,QAAQ;;IAYpB,YACC,KAAK,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EAC5B,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,EACjC,aAAa,EAAE,MAAM,EACrB,KAAK,GAAE,aAA4B,EAMnC;IAED,yBAAyB;IACzB,IAAI,IAAI,IAAI,CAGX;IAED,wFAAwF;IACxF,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAK3B;IAED,2GAA2G;IACrG,IAAI,IAAI,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,CAMlD;CAoCD"}
package/dist/output.js ADDED
@@ -0,0 +1,362 @@
1
+ /**
2
+ * Bounded output streams and adaptive progress commits: `OutputBuffer` keeps a head or tail window of a stream at a cost
3
+ * proportional to each chunk, and `Progress` paces commits of a changing value by their size.
4
+ */
5
+ const NEWLINE = 0x0a;
6
+ const INVALID_OUTPUT = /[\x00-\x08\x0b-\x1f\ufff9-\ufffb]/g;
7
+ /** Whole 7-bit escape sequences: strings (OSC, DCS, APC, PM, SOS) up to BEL or ST, CSI, and short `ESC x` forms. */
8
+ const ESCAPE_SEQUENCE = /\x1b[\]PX^_][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\x20-\x2f]*[\x30-\x7e]/g;
9
+ const encoder = new TextEncoder();
10
+ /** Slices decode exactly: a U+FEFF at a slice's start is text, not a byte-order mark. */
11
+ const decoder = new TextDecoder("utf-8", { ignoreBOM: true });
12
+ /** Remove escape sequences and control characters that break display and transcripts; tabs and newlines stay. */
13
+ export function sanitizeOutput(text) {
14
+ return text.replace(ESCAPE_SEQUENCE, "").replace(INVALID_OUTPUT, "");
15
+ }
16
+ /**
17
+ * Bound `text` to whole lines within the limits: the first lines for `head`, the last lines for `tail`. The result is an
18
+ * exact slice, trailing newline included. A single line longer than `maxBytes` is cut at the byte limit on a character
19
+ * boundary.
20
+ */
21
+ export function boundOutput(text, limits) {
22
+ const bytes = encoder.encode(text);
23
+ const [from, to] = limits.retain === "head" ? headRange(bytes, limits) : tailRange(bytes, limits);
24
+ const kept = bytes.subarray(from, to);
25
+ return {
26
+ text: kept.length === bytes.length ? text : decoder.decode(kept),
27
+ bytes: kept.length,
28
+ droppedBytes: bytes.length - kept.length,
29
+ droppedLines: lineCount(bytes) - lineCount(kept),
30
+ };
31
+ }
32
+ function headRange(bytes, limits) {
33
+ if (limits.maxLines === 0 || limits.maxBytes === 0)
34
+ return [0, 0];
35
+ let end = bytes.length;
36
+ let lines = 0;
37
+ for (let index = bytes.indexOf(NEWLINE); index !== -1; index = bytes.indexOf(NEWLINE, index + 1)) {
38
+ if (++lines === limits.maxLines) {
39
+ end = index + 1;
40
+ break;
41
+ }
42
+ }
43
+ if (end > limits.maxBytes) {
44
+ const newline = bytes.lastIndexOf(NEWLINE, limits.maxBytes - 1);
45
+ end = newline === -1 ? characterEnd(bytes, limits.maxBytes) : newline + 1;
46
+ }
47
+ return [0, end];
48
+ }
49
+ function tailRange(bytes, limits) {
50
+ if (limits.maxLines === 0 || limits.maxBytes === 0)
51
+ return [bytes.length, bytes.length];
52
+ // A trailing newline ends the last line rather than starting another.
53
+ const last = bytes[bytes.length - 1] === NEWLINE ? bytes.length - 2 : bytes.length - 1;
54
+ let start = 0;
55
+ let lines = 1;
56
+ for (let index = last < 0 ? -1 : bytes.lastIndexOf(NEWLINE, last); index !== -1;) {
57
+ if (lines === limits.maxLines) {
58
+ start = index + 1;
59
+ break;
60
+ }
61
+ lines++;
62
+ index = index === 0 ? -1 : bytes.lastIndexOf(NEWLINE, index - 1);
63
+ }
64
+ if (bytes.length - start > limits.maxBytes) {
65
+ const from = bytes.length - limits.maxBytes;
66
+ const newline = bytes.indexOf(NEWLINE, from - 1);
67
+ // The first line starting inside the byte window, or a cut of the last line when it alone is too long.
68
+ start = newline !== -1 && newline + 1 < bytes.length ? newline + 1 : characterStart(bytes, from);
69
+ }
70
+ return [start, bytes.length];
71
+ }
72
+ /** The last character boundary at or before `index`. */
73
+ export function characterEnd(bytes, index) {
74
+ let end = index;
75
+ while (end > 0 && ((bytes[end] ?? 0) & 0xc0) === 0x80)
76
+ end--;
77
+ return end;
78
+ }
79
+ /** The first character boundary at or after `index`. */
80
+ function characterStart(bytes, index) {
81
+ let start = index;
82
+ while (start < bytes.length && ((bytes[start] ?? 0) & 0xc0) === 0x80)
83
+ start++;
84
+ return start;
85
+ }
86
+ function lineCount(bytes) {
87
+ if (bytes.length === 0)
88
+ return 0;
89
+ let newlines = 0;
90
+ for (let index = bytes.indexOf(NEWLINE); index !== -1; index = bytes.indexOf(NEWLINE, index + 1))
91
+ newlines++;
92
+ return newlines + (bytes[bytes.length - 1] === NEWLINE ? 0 : 1);
93
+ }
94
+ /**
95
+ * 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
96
+ * storing once the window is full, and tail retention drops stored text the window no longer needs when it snapshots.
97
+ * Counts of the whole stream are kept so the dropped totals stay exact.
98
+ */
99
+ export class OutputBuffer {
100
+ #limits;
101
+ /**
102
+ * Decoder of byte chunks. A string chunk or a skip ends an incomplete character of earlier bytes (it becomes U+FFFD);
103
+ * the next byte chunk then starts a new character. As in `StreamDecoder`, only a byte-order mark at the very start of
104
+ * the output is dropped, never a U+FEFF later in it.
105
+ */
106
+ #decoder = new TextDecoder("utf-8", { ignoreBOM: true });
107
+ #started = false;
108
+ /** Stored chunks: for head the start of the stream, for tail a suffix that still contains the next window. */
109
+ #chunks = [];
110
+ #storedBytes = 0;
111
+ #storedNewlines = 0;
112
+ #full = false;
113
+ #totalBytes = 0;
114
+ #totalNewlines = 0;
115
+ #endsWithNewline = true;
116
+ constructor(limits) {
117
+ this.#limits = limits;
118
+ }
119
+ /** Bytes currently held; bounded by the limits plus one chunk. */
120
+ get storedBytes() {
121
+ return this.#storedBytes;
122
+ }
123
+ /**
124
+ * Accept a chunk; returns whether anything was accepted. `skipped` is output omitted right before the chunk, which
125
+ * must be more than the tail window by at least one byte or line; only tail retention accepts it.
126
+ */
127
+ push(chunk, skipped) {
128
+ // Bytes of an incomplete character from an earlier byte chunk come first.
129
+ const pending = typeof chunk === "string" || skipped !== undefined ? this.#decoder.decode() : "";
130
+ let text = typeof chunk === "string" ? chunk : this.#decoder.decode(chunk, { stream: true });
131
+ const first = !this.#started && pending === "" && skipped === undefined;
132
+ if (pending !== "" || text !== "" || skipped !== undefined)
133
+ this.#started = true;
134
+ if (first && typeof chunk !== "string" && text.startsWith("\ufeff"))
135
+ text = text.slice(1);
136
+ if (skipped === undefined)
137
+ return this.#accept(pending + text);
138
+ if (this.#limits.retain !== "tail")
139
+ throw new Error("Skipped output requires tail retention");
140
+ this.#accept(pending);
141
+ this.#skip(skipped);
142
+ this.#accept(text);
143
+ return true;
144
+ }
145
+ /** Count omitted output; nothing stored before it can be in the window once the text after it arrives. */
146
+ #skip(skipped) {
147
+ if (skipped.bytes === 0)
148
+ return;
149
+ this.#totalBytes += skipped.bytes;
150
+ this.#totalNewlines += skipped.newlines;
151
+ this.#endsWithNewline = skipped.endsWithNewline;
152
+ this.#chunks = [];
153
+ this.#storedBytes = 0;
154
+ this.#storedNewlines = 0;
155
+ }
156
+ /** Flush an incomplete trailing character as a replacement character; call when the stream ends. */
157
+ end() {
158
+ this.#accept(this.#decoder.decode());
159
+ }
160
+ #accept(text) {
161
+ if (text.length === 0)
162
+ return false;
163
+ const bytes = utf8ByteLength(text);
164
+ const newlines = countNewlines(text);
165
+ this.#totalBytes += bytes;
166
+ this.#totalNewlines += newlines;
167
+ this.#endsWithNewline = text.endsWith("\n");
168
+ if (this.#full)
169
+ return true;
170
+ this.#chunks.push({ text, bytes, newlines });
171
+ this.#storedBytes += bytes;
172
+ this.#storedNewlines += newlines;
173
+ if (this.#limits.retain === "head") {
174
+ // Nothing past a full window is ever needed.
175
+ this.#full = this.#storedBytes > this.#limits.maxBytes || this.#storedNewlines >= this.#limits.maxLines;
176
+ return true;
177
+ }
178
+ // Drop leading chunks while the rest still holds more than a window: more than `maxBytes` bytes or `maxLines`
179
+ // newlines, plus one, so the window's line start can still be found. Each chunk is dropped once.
180
+ while (this.#chunks.length > 1) {
181
+ const first = this.#chunks[0];
182
+ const bytesAfter = this.#storedBytes - first.bytes;
183
+ const newlinesAfter = this.#storedNewlines - first.newlines;
184
+ if (bytesAfter <= this.#limits.maxBytes + 1 && newlinesAfter <= this.#limits.maxLines + 1)
185
+ break;
186
+ this.#chunks.shift();
187
+ this.#storedBytes = bytesAfter;
188
+ this.#storedNewlines = newlinesAfter;
189
+ }
190
+ return true;
191
+ }
192
+ /** Retained, sanitized output and what the limits dropped from the whole stream. */
193
+ snapshot() {
194
+ const stored = this.#chunks.length === 1 ? this.#chunks[0].text : this.#chunks.map((chunk) => chunk.text).join("");
195
+ const kept = boundOutput(stored, this.#limits);
196
+ const storedLines = lines(this.#storedNewlines, stored === "" || stored.endsWith("\n"));
197
+ const keptLines = storedLines - kept.droppedLines;
198
+ // Tail windows never reach back before this one, but finding a later window's first line needs what precedes it:
199
+ // keep the shortest suffix longer than the window by a byte or a line, as `#accept` does.
200
+ if (this.#limits.retain === "tail" || this.#chunks.length > 1) {
201
+ const text = this.#limits.retain === "tail" ? tailMargin(stored, this.#limits) : stored;
202
+ const bytes = this.#limits.retain === "tail" ? utf8ByteLength(text) : this.#storedBytes;
203
+ this.#chunks = text === "" ? [] : [{ text, bytes, newlines: countNewlines(text) }];
204
+ this.#storedBytes = bytes;
205
+ this.#storedNewlines = this.#chunks[0]?.newlines ?? 0;
206
+ }
207
+ return {
208
+ text: sanitizeOutput(kept.text),
209
+ droppedBytes: this.#totalBytes - kept.bytes,
210
+ droppedLines: lines(this.#totalNewlines, this.#endsWithNewline) - keptLines,
211
+ };
212
+ }
213
+ }
214
+ /**
215
+ * The shortest suffix of `text` with more than `maxBytes` bytes or more than `maxLines` newlines, or all of it. The
216
+ * tail window of any text that ends with this suffix, followed by anything, is the same as of `text` followed by it.
217
+ */
218
+ function tailMargin(text, limits) {
219
+ const bytes = encoder.encode(text);
220
+ const byteStart = bytes.length > limits.maxBytes ? characterEnd(bytes, bytes.length - limits.maxBytes - 1) : 0;
221
+ let lineStart = 0;
222
+ let newlines = 0;
223
+ for (let index = bytes.lastIndexOf(NEWLINE); index !== -1; index = bytes.lastIndexOf(NEWLINE, index - 1)) {
224
+ if (++newlines > limits.maxLines) {
225
+ lineStart = index;
226
+ break;
227
+ }
228
+ if (index === 0)
229
+ break;
230
+ }
231
+ const start = Math.max(byteStart, lineStart);
232
+ return start === 0 ? text : decoder.decode(bytes.subarray(start));
233
+ }
234
+ /** Lines of text with `newlines` newlines; a final unterminated line counts. */
235
+ function lines(newlines, terminated) {
236
+ return newlines + (terminated ? 0 : 1);
237
+ }
238
+ const runtimeBuffer = globalThis.Buffer;
239
+ const nonAsciiPattern = /[^\x00-\x7f]/;
240
+ /** UTF-8 byte length of `content`; a lone surrogate counts as U+FFFD, three bytes. */
241
+ export function utf8ByteLength(content) {
242
+ if (runtimeBuffer)
243
+ return runtimeBuffer.byteLength(content, "utf8");
244
+ const firstNonAscii = content.search(nonAsciiPattern);
245
+ if (firstNonAscii === -1)
246
+ return content.length;
247
+ let bytes = firstNonAscii;
248
+ for (let i = firstNonAscii; i < content.length; i++) {
249
+ const code = content.charCodeAt(i);
250
+ if (code <= 0x7f)
251
+ bytes += 1;
252
+ else if (code <= 0x7ff)
253
+ bytes += 2;
254
+ else if (code >= 0xd800 && code <= 0xdbff && i + 1 < content.length) {
255
+ const next = content.charCodeAt(i + 1);
256
+ if (next >= 0xdc00 && next <= 0xdfff) {
257
+ bytes += 4;
258
+ i++;
259
+ }
260
+ else
261
+ bytes += 3;
262
+ }
263
+ else
264
+ bytes += 3;
265
+ }
266
+ return bytes;
267
+ }
268
+ function countNewlines(text) {
269
+ let count = 0;
270
+ for (let index = text.indexOf("\n"); index !== -1; index = text.indexOf("\n", index + 1))
271
+ count++;
272
+ return count;
273
+ }
274
+ /** Each progress commit also buys a pause proportional to what it wrote. */
275
+ export const PROGRESS_BYTES_PER_SECOND = 100 * 1024;
276
+ const SYSTEM_CLOCK = {
277
+ now: () => Date.now(),
278
+ setTimer: (callback, delayMs) => {
279
+ const timer = setTimeout(callback, delayMs);
280
+ return () => clearTimeout(timer);
281
+ },
282
+ };
283
+ /**
284
+ * Adaptive progress commits: the first change after an idle period commits at once; each commit then delays the next
285
+ * by at least `minIntervalMs` and by its written size at 100 KiB/s. At most one commit is in flight; changes made
286
+ * meanwhile coalesce into the next one. Paces on `clock`, by default `Date.now` and `setTimeout`.
287
+ */
288
+ export class Progress {
289
+ #write;
290
+ #onError;
291
+ #minIntervalMs;
292
+ #clock;
293
+ #waiters = [];
294
+ #timer;
295
+ #inFlight;
296
+ #nextAt = 0;
297
+ #dirty = false;
298
+ #stopped = false;
299
+ constructor(write, onError, minIntervalMs, clock = SYSTEM_CLOCK) {
300
+ this.#write = write;
301
+ this.#onError = onError;
302
+ this.#minIntervalMs = minIntervalMs;
303
+ this.#clock = clock;
304
+ }
305
+ /** Schedule a commit. */
306
+ mark() {
307
+ this.#dirty = true;
308
+ this.#schedule();
309
+ }
310
+ /** Schedule a commit; the promise settles with the commit that includes this change. */
311
+ markAndWait() {
312
+ const waiter = Promise.withResolvers();
313
+ this.#waiters.push(waiter);
314
+ this.mark();
315
+ return waiter.promise;
316
+ }
317
+ /** Stop committing and wait for the commit in flight; returns the waiters the final commit must settle. */
318
+ async stop() {
319
+ this.#stopped = true;
320
+ this.#timer?.();
321
+ this.#timer = undefined;
322
+ await this.#inFlight;
323
+ return this.#waiters.splice(0);
324
+ }
325
+ #schedule() {
326
+ if (this.#stopped || this.#timer !== undefined || this.#inFlight !== undefined)
327
+ return;
328
+ const wait = this.#nextAt - this.#clock.now();
329
+ if (wait <= 0)
330
+ this.#flush();
331
+ else
332
+ this.#timer = this.#clock.setTimer(() => {
333
+ this.#timer = undefined;
334
+ // Checks the clock again: a timer that fires early waits for the rest.
335
+ this.#schedule();
336
+ }, wait);
337
+ }
338
+ #flush() {
339
+ if (this.#stopped || !this.#dirty)
340
+ return;
341
+ this.#dirty = false;
342
+ const waiters = this.#waiters.splice(0);
343
+ const started = this.#clock.now();
344
+ this.#inFlight = this.#write()
345
+ .then((bytes) => {
346
+ this.#nextAt = started + Math.max(this.#minIntervalMs, (bytes * 1000) / PROGRESS_BYTES_PER_SECOND);
347
+ for (const waiter of waiters)
348
+ waiter.resolve();
349
+ }, (error) => {
350
+ this.#nextAt = started + this.#minIntervalMs;
351
+ for (const waiter of waiters)
352
+ waiter.reject(error);
353
+ this.#onError(error);
354
+ })
355
+ .finally(() => {
356
+ this.#inFlight = undefined;
357
+ if (this.#dirty)
358
+ this.#schedule();
359
+ });
360
+ }
361
+ }
362
+ //# sourceMappingURL=output.js.map