@earendil-works/chord 1.4.0 → 1.5.1
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.
- package/CHANGELOG.md +92 -0
- package/README.md +115 -90
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/contracts/accepts.d.ts +81 -0
- package/dist/contracts/accepts.d.ts.map +1 -0
- package/dist/contracts/accepts.js +123 -0
- package/dist/contracts/accepts.js.map +1 -0
- package/dist/contracts/contract.d.ts +121 -0
- package/dist/contracts/contract.d.ts.map +1 -0
- package/dist/contracts/contract.js +50 -0
- package/dist/contracts/contract.js.map +1 -0
- package/dist/contracts/declare.d.ts +107 -0
- package/dist/contracts/declare.d.ts.map +1 -0
- package/dist/contracts/declare.js +136 -0
- package/dist/contracts/declare.js.map +1 -0
- package/dist/contracts/evolve.d.ts +92 -0
- package/dist/contracts/evolve.d.ts.map +1 -0
- package/dist/contracts/evolve.js +179 -0
- package/dist/contracts/evolve.js.map +1 -0
- package/dist/contracts/fingerprint.d.ts +16 -0
- package/dist/contracts/fingerprint.d.ts.map +1 -0
- package/dist/contracts/fingerprint.js +50 -0
- package/dist/contracts/fingerprint.js.map +1 -0
- package/dist/contracts/history.d.ts +71 -0
- package/dist/contracts/history.d.ts.map +1 -0
- package/dist/contracts/history.js +3 -0
- package/dist/contracts/history.js.map +1 -0
- package/dist/contracts/host-kind.d.ts +40 -0
- package/dist/contracts/host-kind.d.ts.map +1 -0
- package/dist/contracts/host-kind.js +37 -0
- package/dist/contracts/host-kind.js.map +1 -0
- package/dist/contracts/index.d.ts +7 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +6 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/internal.d.ts +10 -0
- package/dist/contracts/internal.d.ts.map +1 -0
- package/dist/contracts/internal.js +9 -0
- package/dist/contracts/internal.js.map +1 -0
- package/dist/contracts/names.d.ts +3 -0
- package/dist/contracts/names.d.ts.map +1 -0
- package/dist/contracts/names.js +13 -0
- package/dist/contracts/names.js.map +1 -0
- package/dist/contracts/params.d.ts +28 -0
- package/dist/contracts/params.d.ts.map +1 -0
- package/dist/contracts/params.js +50 -0
- package/dist/contracts/params.js.map +1 -0
- package/dist/contracts/schema.d.ts +102 -0
- package/dist/contracts/schema.d.ts.map +1 -0
- package/dist/contracts/schema.js +103 -0
- package/dist/contracts/schema.js.map +1 -0
- package/dist/contracts/snapshot.d.ts +16 -0
- package/dist/contracts/snapshot.d.ts.map +1 -0
- package/dist/contracts/snapshot.js +167 -0
- package/dist/contracts/snapshot.js.map +1 -0
- package/dist/data/args.d.ts +50 -0
- package/dist/data/args.d.ts.map +1 -0
- package/dist/data/args.js +83 -0
- package/dist/data/args.js.map +1 -0
- package/dist/data/errors.d.ts +80 -0
- package/dist/data/errors.d.ts.map +1 -0
- package/dist/data/errors.js +116 -0
- package/dist/data/errors.js.map +1 -0
- package/dist/data/failure.d.ts +26 -0
- package/dist/data/failure.d.ts.map +1 -0
- package/dist/data/failure.js +77 -0
- package/dist/data/failure.js.map +1 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +5 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/internal.d.ts +7 -0
- package/dist/data/internal.d.ts.map +1 -0
- package/dist/data/internal.js +8 -0
- package/dist/data/internal.js.map +1 -0
- package/dist/data/params.d.ts +20 -0
- package/dist/data/params.d.ts.map +1 -0
- package/dist/data/params.js +31 -0
- package/dist/data/params.js.map +1 -0
- package/dist/data/principal.d.ts +22 -0
- package/dist/data/principal.d.ts.map +1 -0
- package/dist/data/principal.js +49 -0
- package/dist/data/principal.js.map +1 -0
- package/dist/data/validator.d.ts +12 -0
- package/dist/data/validator.d.ts.map +1 -0
- package/dist/data/validator.js +35 -0
- package/dist/data/validator.js.map +1 -0
- package/dist/delta/apply-immutable-trusted.js +3 -4
- package/dist/delta/apply-immutable-trusted.js.map +1 -1
- package/dist/delta/diff.d.ts.map +1 -1
- package/dist/delta/diff.js +5 -3
- package/dist/delta/diff.js.map +1 -1
- package/dist/delta/index.d.ts +9 -1
- package/dist/delta/index.d.ts.map +1 -1
- package/dist/delta/index.js +15 -11
- package/dist/delta/index.js.map +1 -1
- package/dist/delta/pending.d.ts +36 -0
- package/dist/delta/pending.d.ts.map +1 -0
- package/dist/delta/pending.js +143 -0
- package/dist/delta/pending.js.map +1 -0
- package/dist/delta/tracker.d.ts +12 -0
- package/dist/delta/tracker.d.ts.map +1 -1
- package/dist/delta/tracker.js +109 -39
- package/dist/delta/tracker.js.map +1 -1
- package/dist/documents/address-source.d.ts +20 -0
- package/dist/documents/address-source.d.ts.map +1 -0
- package/dist/documents/address-source.js +44 -0
- package/dist/documents/address-source.js.map +1 -0
- package/dist/documents/definition.d.ts +84 -0
- package/dist/documents/definition.d.ts.map +1 -0
- package/dist/documents/definition.js +74 -0
- package/dist/documents/definition.js.map +1 -0
- package/dist/documents/documents.d.ts +126 -0
- package/dist/documents/documents.d.ts.map +1 -0
- package/dist/documents/documents.js +248 -0
- package/dist/documents/documents.js.map +1 -0
- package/dist/documents/fence.d.ts +9 -0
- package/dist/documents/fence.d.ts.map +1 -0
- package/dist/documents/fence.js +15 -0
- package/dist/documents/fence.js.map +1 -0
- package/dist/documents/handles.d.ts +76 -0
- package/dist/documents/handles.d.ts.map +1 -0
- package/dist/documents/handles.js +66 -0
- package/dist/documents/handles.js.map +1 -0
- package/dist/documents/index.d.ts +4 -0
- package/dist/documents/index.d.ts.map +1 -0
- package/dist/documents/index.js +3 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/documents/internal.d.ts +9 -0
- package/dist/documents/internal.d.ts.map +1 -0
- package/dist/documents/internal.js +9 -0
- package/dist/documents/internal.js.map +1 -0
- package/dist/documents/keyed-slot.d.ts +103 -0
- package/dist/documents/keyed-slot.d.ts.map +1 -0
- package/dist/documents/keyed-slot.js +395 -0
- package/dist/documents/keyed-slot.js.map +1 -0
- package/dist/documents/line.d.ts +7 -0
- package/dist/documents/line.d.ts.map +1 -0
- package/dist/documents/line.js +14 -0
- package/dist/documents/line.js.map +1 -0
- package/dist/documents/persistence.d.ts +104 -0
- package/dist/documents/persistence.d.ts.map +1 -0
- package/dist/documents/persistence.js +129 -0
- package/dist/documents/persistence.js.map +1 -0
- package/dist/documents/residency.d.ts +31 -0
- package/dist/documents/residency.d.ts.map +1 -0
- package/dist/documents/residency.js +93 -0
- package/dist/documents/residency.js.map +1 -0
- package/dist/documents/slot.d.ts +109 -0
- package/dist/documents/slot.d.ts.map +1 -0
- package/dist/documents/slot.js +181 -0
- package/dist/documents/slot.js.map +1 -0
- package/dist/documents/transaction.d.ts +143 -0
- package/dist/documents/transaction.d.ts.map +1 -0
- package/dist/documents/transaction.js +442 -0
- package/dist/documents/transaction.js.map +1 -0
- package/dist/host/activity.d.ts +31 -0
- package/dist/host/activity.d.ts.map +1 -0
- package/dist/host/activity.js +40 -0
- package/dist/host/activity.js.map +1 -0
- package/dist/host/adapted.d.ts +49 -0
- package/dist/host/adapted.d.ts.map +1 -0
- package/dist/host/adapted.js +214 -0
- package/dist/host/adapted.js.map +1 -0
- package/dist/host/attempt.d.ts +308 -0
- package/dist/host/attempt.d.ts.map +1 -0
- package/dist/host/attempt.js +1199 -0
- package/dist/host/attempt.js.map +1 -0
- package/dist/host/backoff.d.ts +29 -0
- package/dist/host/backoff.d.ts.map +1 -0
- package/dist/host/backoff.js +69 -0
- package/dist/host/backoff.js.map +1 -0
- package/dist/host/ctx.d.ts +94 -0
- package/dist/host/ctx.d.ts.map +1 -0
- package/dist/host/ctx.js +200 -0
- package/dist/host/ctx.js.map +1 -0
- package/dist/host/deadline.d.ts +12 -0
- package/dist/host/deadline.d.ts.map +1 -0
- package/dist/host/deadline.js +40 -0
- package/dist/host/deadline.js.map +1 -0
- package/dist/host/dependencies.d.ts +65 -0
- package/dist/host/dependencies.d.ts.map +1 -0
- package/dist/host/dependencies.js +115 -0
- package/dist/host/dependencies.js.map +1 -0
- package/dist/host/destination.d.ts +48 -0
- package/dist/host/destination.d.ts.map +1 -0
- package/dist/host/destination.js +101 -0
- package/dist/host/destination.js.map +1 -0
- package/dist/host/facet.d.ts +84 -0
- package/dist/host/facet.d.ts.map +1 -0
- package/dist/host/facet.js +55 -0
- package/dist/host/facet.js.map +1 -0
- package/dist/host/follow.d.ts +52 -0
- package/dist/host/follow.d.ts.map +1 -0
- package/dist/host/follow.js +207 -0
- package/dist/host/follow.js.map +1 -0
- package/dist/host/host.d.ts +571 -0
- package/dist/host/host.d.ts.map +1 -0
- package/dist/host/host.js +1318 -0
- package/dist/host/host.js.map +1 -0
- package/dist/host/index.d.ts +17 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +6 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/internal.d.ts +11 -0
- package/dist/host/internal.d.ts.map +1 -0
- package/dist/host/internal.js +9 -0
- package/dist/host/internal.js.map +1 -0
- package/dist/host/members.d.ts +50 -0
- package/dist/host/members.d.ts.map +1 -0
- package/dist/host/members.js +107 -0
- package/dist/host/members.js.map +1 -0
- package/dist/host/native.d.ts +64 -0
- package/dist/host/native.d.ts.map +1 -0
- package/dist/host/native.js +126 -0
- package/dist/host/native.js.map +1 -0
- package/dist/host/object.d.ts +331 -0
- package/dist/host/object.d.ts.map +1 -0
- package/dist/host/object.js +1296 -0
- package/dist/host/object.js.map +1 -0
- package/dist/host/old-work.d.ts +34 -0
- package/dist/host/old-work.d.ts.map +1 -0
- package/dist/host/old-work.js +52 -0
- package/dist/host/old-work.js.map +1 -0
- package/dist/host/parked.d.ts +23 -0
- package/dist/host/parked.d.ts.map +1 -0
- package/dist/host/parked.js +79 -0
- package/dist/host/parked.js.map +1 -0
- package/dist/host/presence.d.ts +34 -0
- package/dist/host/presence.d.ts.map +1 -0
- package/dist/host/presence.js +117 -0
- package/dist/host/presence.js.map +1 -0
- package/dist/host/readiness.d.ts +27 -0
- package/dist/host/readiness.d.ts.map +1 -0
- package/dist/host/readiness.js +134 -0
- package/dist/host/readiness.js.map +1 -0
- package/dist/host/ref-state.d.ts +53 -0
- package/dist/host/ref-state.d.ts.map +1 -0
- package/dist/host/ref-state.js +83 -0
- package/dist/host/ref-state.js.map +1 -0
- package/dist/host/reference-keys.d.ts +36 -0
- package/dist/host/reference-keys.d.ts.map +1 -0
- package/dist/host/reference-keys.js +168 -0
- package/dist/host/reference-keys.js.map +1 -0
- package/dist/host/reference-source.d.ts +65 -0
- package/dist/host/reference-source.d.ts.map +1 -0
- package/dist/host/reference-source.js +285 -0
- package/dist/host/reference-source.js.map +1 -0
- package/dist/host/reference.d.ts +321 -0
- package/dist/host/reference.d.ts.map +1 -0
- package/dist/host/reference.js +797 -0
- package/dist/host/reference.js.map +1 -0
- package/dist/host/reload-cycle.d.ts +16 -0
- package/dist/host/reload-cycle.d.ts.map +1 -0
- package/dist/host/reload-cycle.js +81 -0
- package/dist/host/reload-cycle.js.map +1 -0
- package/dist/host/retry-on.d.ts +28 -0
- package/dist/host/retry-on.d.ts.map +1 -0
- package/dist/host/retry-on.js +52 -0
- package/dist/host/retry-on.js.map +1 -0
- package/dist/host/revocation.d.ts +16 -0
- package/dist/host/revocation.d.ts.map +1 -0
- package/dist/host/revocation.js +27 -0
- package/dist/host/revocation.js.map +1 -0
- package/dist/host/root.d.ts +37 -0
- package/dist/host/root.d.ts.map +1 -0
- package/dist/host/root.js +68 -0
- package/dist/host/root.js.map +1 -0
- package/dist/host/route.d.ts +64 -0
- package/dist/host/route.d.ts.map +1 -0
- package/dist/host/route.js +227 -0
- package/dist/host/route.js.map +1 -0
- package/dist/host/routines.d.ts +78 -0
- package/dist/host/routines.d.ts.map +1 -0
- package/dist/host/routines.js +398 -0
- package/dist/host/routines.js.map +1 -0
- package/dist/host/sleep.d.ts +9 -0
- package/dist/host/sleep.d.ts.map +1 -0
- package/dist/host/sleep.js +40 -0
- package/dist/host/sleep.js.map +1 -0
- package/dist/host/staging.d.ts +94 -0
- package/dist/host/staging.d.ts.map +1 -0
- package/dist/host/staging.js +304 -0
- package/dist/host/staging.js.map +1 -0
- package/dist/host/unbound-clock.d.ts +23 -0
- package/dist/host/unbound-clock.d.ts.map +1 -0
- package/dist/host/unbound-clock.js +58 -0
- package/dist/host/unbound-clock.js.map +1 -0
- package/dist/host/unbound.d.ts +37 -0
- package/dist/host/unbound.d.ts.map +1 -0
- package/dist/host/unbound.js +88 -0
- package/dist/host/unbound.js.map +1 -0
- package/dist/host/uuid.d.ts +3 -0
- package/dist/host/uuid.d.ts.map +1 -0
- package/dist/host/uuid.js +38 -0
- package/dist/host/uuid.js.map +1 -0
- package/dist/index.d.ts +29 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -9
- package/dist/index.js.map +1 -1
- package/dist/jobs/definition.d.ts +96 -0
- package/dist/jobs/definition.d.ts.map +1 -0
- package/dist/jobs/definition.js +83 -0
- package/dist/jobs/definition.js.map +1 -0
- package/dist/jobs/index.d.ts +5 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +3 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/internal.d.ts +3 -0
- package/dist/jobs/internal.d.ts.map +1 -0
- package/dist/jobs/internal.js +4 -0
- package/dist/jobs/internal.js.map +1 -0
- package/dist/jobs/job.d.ts +149 -0
- package/dist/jobs/job.d.ts.map +1 -0
- package/dist/jobs/job.js +387 -0
- package/dist/jobs/job.js.map +1 -0
- package/dist/jobs/persisted.d.ts +38 -0
- package/dist/jobs/persisted.d.ts.map +1 -0
- package/dist/jobs/persisted.js +95 -0
- package/dist/jobs/persisted.js.map +1 -0
- package/dist/jobs/records.d.ts +231 -0
- package/dist/jobs/records.d.ts.map +1 -0
- package/dist/jobs/records.js +871 -0
- package/dist/jobs/records.js.map +1 -0
- package/dist/jobs/run-states.d.ts +69 -0
- package/dist/jobs/run-states.d.ts.map +1 -0
- package/dist/jobs/run-states.js +228 -0
- package/dist/jobs/run-states.js.map +1 -0
- package/dist/jobs/run.d.ts +117 -0
- package/dist/jobs/run.d.ts.map +1 -0
- package/dist/jobs/run.js +204 -0
- package/dist/jobs/run.js.map +1 -0
- package/dist/jobs/running.d.ts +44 -0
- package/dist/jobs/running.d.ts.map +1 -0
- package/dist/jobs/running.js +117 -0
- package/dist/jobs/running.js.map +1 -0
- package/dist/jobs/stored.d.ts +63 -0
- package/dist/jobs/stored.d.ts.map +1 -0
- package/dist/jobs/stored.js +55 -0
- package/dist/jobs/stored.js.map +1 -0
- package/dist/link/binary.d.ts +4 -0
- package/dist/link/binary.d.ts.map +1 -0
- package/dist/link/binary.js +544 -0
- package/dist/link/binary.js.map +1 -0
- package/dist/link/channel.d.ts +68 -0
- package/dist/link/channel.d.ts.map +1 -0
- package/dist/link/channel.js +215 -0
- package/dist/link/channel.js.map +1 -0
- package/dist/link/errors.d.ts +7 -0
- package/dist/link/errors.d.ts.map +1 -0
- package/dist/link/errors.js +21 -0
- package/dist/link/errors.js.map +1 -0
- package/dist/link/index.d.ts +8 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +8 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/internal.d.ts +9 -0
- package/dist/link/internal.d.ts.map +1 -0
- package/dist/link/internal.js +10 -0
- package/dist/link/internal.js.map +1 -0
- package/dist/link/ipc.d.ts +22 -0
- package/dist/link/ipc.d.ts.map +1 -0
- package/dist/link/ipc.js +64 -0
- package/dist/link/ipc.js.map +1 -0
- package/dist/link/link.d.ts +34 -0
- package/dist/link/link.d.ts.map +1 -0
- package/dist/link/link.js +87 -0
- package/dist/link/link.js.map +1 -0
- package/dist/link/message.d.ts +262 -0
- package/dist/link/message.d.ts.map +1 -0
- package/dist/link/message.js +156 -0
- package/dist/link/message.js.map +1 -0
- package/dist/link/part.d.ts +80 -0
- package/dist/link/part.d.ts.map +1 -0
- package/dist/link/part.js +165 -0
- package/dist/link/part.js.map +1 -0
- package/dist/link/text.d.ts +6 -0
- package/dist/link/text.d.ts.map +1 -0
- package/dist/link/text.js +355 -0
- package/dist/link/text.js.map +1 -0
- package/dist/link/values.d.ts +40 -0
- package/dist/link/values.d.ts.map +1 -0
- package/dist/link/values.js +121 -0
- package/dist/link/values.js.map +1 -0
- package/dist/link/websocket.d.ts +26 -0
- package/dist/link/websocket.d.ts.map +1 -0
- package/dist/link/websocket.js +91 -0
- package/dist/link/websocket.js.map +1 -0
- package/dist/node/app/app.d.ts +269 -0
- package/dist/node/app/app.d.ts.map +1 -0
- package/dist/node/app/app.js +513 -0
- package/dist/node/app/app.js.map +1 -0
- package/dist/node/app/archive.d.ts +37 -0
- package/dist/node/app/archive.d.ts.map +1 -0
- package/dist/node/app/archive.js +204 -0
- package/dist/node/app/archive.js.map +1 -0
- package/dist/node/app/blobs.d.ts +23 -0
- package/dist/node/app/blobs.d.ts.map +1 -0
- package/dist/node/app/blobs.js +64 -0
- package/dist/node/app/blobs.js.map +1 -0
- package/dist/node/app/data.d.ts +35 -0
- package/dist/node/app/data.d.ts.map +1 -0
- package/dist/node/app/data.js +44 -0
- package/dist/node/app/data.js.map +1 -0
- package/dist/node/app/ephemeral-sessions.d.ts +20 -0
- package/dist/node/app/ephemeral-sessions.d.ts.map +1 -0
- package/dist/node/app/ephemeral-sessions.js +69 -0
- package/dist/node/app/ephemeral-sessions.js.map +1 -0
- package/dist/node/app/ephemeral.d.ts +11 -0
- package/dist/node/app/ephemeral.d.ts.map +1 -0
- package/dist/node/app/ephemeral.js +34 -0
- package/dist/node/app/ephemeral.js.map +1 -0
- package/dist/node/app/files-copy.d.ts +13 -0
- package/dist/node/app/files-copy.d.ts.map +1 -0
- package/dist/node/app/files-copy.js +86 -0
- package/dist/node/app/files-copy.js.map +1 -0
- package/dist/node/app/files-entry.d.ts +4 -0
- package/dist/node/app/files-entry.d.ts.map +1 -0
- package/dist/node/app/files-entry.js +7 -0
- package/dist/node/app/files-entry.js.map +1 -0
- package/dist/node/app/files-index.d.ts +180 -0
- package/dist/node/app/files-index.d.ts.map +1 -0
- package/dist/node/app/files-index.js +535 -0
- package/dist/node/app/files-index.js.map +1 -0
- package/dist/node/app/files.d.ts +363 -0
- package/dist/node/app/files.d.ts.map +1 -0
- package/dist/node/app/files.js +368 -0
- package/dist/node/app/files.js.map +1 -0
- package/dist/node/app/folder-views.d.ts +21 -0
- package/dist/node/app/folder-views.d.ts.map +1 -0
- package/dist/node/app/folder-views.js +55 -0
- package/dist/node/app/folder-views.js.map +1 -0
- package/dist/node/app/index.d.ts +12 -0
- package/dist/node/app/index.d.ts.map +1 -0
- package/dist/node/app/index.js +15 -0
- package/dist/node/app/index.js.map +1 -0
- package/dist/node/app/info.d.ts +66 -0
- package/dist/node/app/info.d.ts.map +1 -0
- package/dist/node/app/info.js +37 -0
- package/dist/node/app/info.js.map +1 -0
- package/dist/node/app/invite.d.ts +5 -0
- package/dist/node/app/invite.d.ts.map +1 -0
- package/dist/node/app/invite.js +64 -0
- package/dist/node/app/invite.js.map +1 -0
- package/dist/node/app/layout.d.ts +36 -0
- package/dist/node/app/layout.d.ts.map +1 -0
- package/dist/node/app/layout.js +87 -0
- package/dist/node/app/layout.js.map +1 -0
- package/dist/node/app/owner.d.ts +31 -0
- package/dist/node/app/owner.d.ts.map +1 -0
- package/dist/node/app/owner.js +104 -0
- package/dist/node/app/owner.js.map +1 -0
- package/dist/node/app/pairing.d.ts +55 -0
- package/dist/node/app/pairing.d.ts.map +1 -0
- package/dist/node/app/pairing.js +183 -0
- package/dist/node/app/pairing.js.map +1 -0
- package/dist/node/app/secrets.d.ts +16 -0
- package/dist/node/app/secrets.d.ts.map +1 -0
- package/dist/node/app/secrets.js +72 -0
- package/dist/node/app/secrets.js.map +1 -0
- package/dist/node/app/sessions.d.ts +72 -0
- package/dist/node/app/sessions.d.ts.map +1 -0
- package/dist/node/app/sessions.js +222 -0
- package/dist/node/app/sessions.js.map +1 -0
- package/dist/node/app/tar.d.ts +24 -0
- package/dist/node/app/tar.d.ts.map +1 -0
- package/dist/node/app/tar.js +167 -0
- package/dist/node/app/tar.js.map +1 -0
- package/dist/node/app/uploads.d.ts +37 -0
- package/dist/node/app/uploads.d.ts.map +1 -0
- package/dist/node/app/uploads.js +157 -0
- package/dist/node/app/uploads.js.map +1 -0
- package/dist/node/app/users.d.ts +37 -0
- package/dist/node/app/users.d.ts.map +1 -0
- package/dist/node/app/users.js +62 -0
- package/dist/node/app/users.js.map +1 -0
- package/dist/node/app/worker.d.ts +18 -0
- package/dist/node/app/worker.d.ts.map +1 -0
- package/dist/node/app/worker.js +84 -0
- package/dist/node/app/worker.js.map +1 -0
- package/dist/node/compression.d.ts +7 -0
- package/dist/node/compression.d.ts.map +1 -0
- package/dist/node/compression.js +25 -0
- package/dist/node/compression.js.map +1 -0
- package/dist/node/http/admission.d.ts +63 -0
- package/dist/node/http/admission.d.ts.map +1 -0
- package/dist/node/http/admission.js +134 -0
- package/dist/node/http/admission.js.map +1 -0
- package/dist/node/http/authenticate.d.ts +21 -0
- package/dist/node/http/authenticate.d.ts.map +1 -0
- package/dist/node/http/authenticate.js +34 -0
- package/dist/node/http/authenticate.js.map +1 -0
- package/dist/node/http/cookies.d.ts +32 -0
- package/dist/node/http/cookies.d.ts.map +1 -0
- package/dist/node/http/cookies.js +70 -0
- package/dist/node/http/cookies.js.map +1 -0
- package/dist/node/http/file.d.ts +23 -0
- package/dist/node/http/file.d.ts.map +1 -0
- package/dist/node/http/file.js +94 -0
- package/dist/node/http/file.js.map +1 -0
- package/dist/node/http/headers.d.ts +37 -0
- package/dist/node/http/headers.d.ts.map +1 -0
- package/dist/node/http/headers.js +136 -0
- package/dist/node/http/headers.js.map +1 -0
- package/dist/node/http/http.d.ts +111 -0
- package/dist/node/http/http.d.ts.map +1 -0
- package/dist/node/http/http.js +524 -0
- package/dist/node/http/http.js.map +1 -0
- package/dist/node/http/incoming.d.ts +19 -0
- package/dist/node/http/incoming.d.ts.map +1 -0
- package/dist/node/http/incoming.js +31 -0
- package/dist/node/http/incoming.js.map +1 -0
- package/dist/node/http/index.d.ts +11 -0
- package/dist/node/http/index.d.ts.map +1 -0
- package/dist/node/http/index.js +12 -0
- package/dist/node/http/index.js.map +1 -0
- package/dist/node/http/node.d.ts +78 -0
- package/dist/node/http/node.d.ts.map +1 -0
- package/dist/node/http/node.js +291 -0
- package/dist/node/http/node.js.map +1 -0
- package/dist/node/http/request.d.ts +60 -0
- package/dist/node/http/request.d.ts.map +1 -0
- package/dist/node/http/request.js +118 -0
- package/dist/node/http/request.js.map +1 -0
- package/dist/node/http/response.d.ts +63 -0
- package/dist/node/http/response.d.ts.map +1 -0
- package/dist/node/http/response.js +202 -0
- package/dist/node/http/response.js.map +1 -0
- package/dist/node/http/router.d.ts +132 -0
- package/dist/node/http/router.d.ts.map +1 -0
- package/dist/node/http/router.js +267 -0
- package/dist/node/http/router.js.map +1 -0
- package/dist/node/http/upgrades.d.ts +61 -0
- package/dist/node/http/upgrades.d.ts.map +1 -0
- package/dist/node/http/upgrades.js +192 -0
- package/dist/node/http/upgrades.js.map +1 -0
- package/dist/node/plugins/base-inputs.d.ts +14 -0
- package/dist/node/plugins/base-inputs.d.ts.map +1 -0
- package/dist/node/plugins/base-inputs.js +33 -0
- package/dist/node/plugins/base-inputs.js.map +1 -0
- package/dist/node/plugins/build.d.ts +77 -0
- package/dist/node/plugins/build.d.ts.map +1 -0
- package/dist/node/plugins/build.js +576 -0
- package/dist/node/plugins/build.js.map +1 -0
- package/dist/node/plugins/css-modules.d.ts +13 -0
- package/dist/node/plugins/css-modules.d.ts.map +1 -0
- package/dist/node/plugins/css-modules.js +58 -0
- package/dist/node/plugins/css-modules.js.map +1 -0
- package/dist/node/plugins/discover.d.ts +67 -0
- package/dist/node/plugins/discover.d.ts.map +1 -0
- package/dist/node/plugins/discover.js +369 -0
- package/dist/node/plugins/discover.js.map +1 -0
- package/dist/node/plugins/evaluate.d.ts +33 -0
- package/dist/node/plugins/evaluate.d.ts.map +1 -0
- package/dist/node/plugins/evaluate.js +121 -0
- package/dist/node/plugins/evaluate.js.map +1 -0
- package/dist/node/plugins/index.d.ts +11 -0
- package/dist/node/plugins/index.d.ts.map +1 -0
- package/dist/node/plugins/index.js +13 -0
- package/dist/node/plugins/index.js.map +1 -0
- package/dist/node/plugins/install.d.ts +38 -0
- package/dist/node/plugins/install.d.ts.map +1 -0
- package/dist/node/plugins/install.js +213 -0
- package/dist/node/plugins/install.js.map +1 -0
- package/dist/node/plugins/plugins.d.ts +162 -0
- package/dist/node/plugins/plugins.d.ts.map +1 -0
- package/dist/node/plugins/plugins.js +244 -0
- package/dist/node/plugins/plugins.js.map +1 -0
- package/dist/node/plugins/runtime.d.ts +57 -0
- package/dist/node/plugins/runtime.d.ts.map +1 -0
- package/dist/node/plugins/runtime.js +92 -0
- package/dist/node/plugins/runtime.js.map +1 -0
- package/dist/node/plugins/stack.d.ts +16 -0
- package/dist/node/plugins/stack.d.ts.map +1 -0
- package/dist/node/plugins/stack.js +61 -0
- package/dist/node/plugins/stack.js.map +1 -0
- package/dist/node/plugins/testing.d.ts +58 -0
- package/dist/node/plugins/testing.d.ts.map +1 -0
- package/dist/node/plugins/testing.js +210 -0
- package/dist/node/plugins/testing.js.map +1 -0
- package/dist/node/plugins/watcher.d.ts +69 -0
- package/dist/node/plugins/watcher.d.ts.map +1 -0
- package/dist/node/plugins/watcher.js +622 -0
- package/dist/node/plugins/watcher.js.map +1 -0
- package/dist/node/surfaces/bundle.d.ts +31 -0
- package/dist/node/surfaces/bundle.d.ts.map +1 -0
- package/dist/node/surfaces/bundle.js +118 -0
- package/dist/node/surfaces/bundle.js.map +1 -0
- package/dist/node/surfaces/current.d.ts +17 -0
- package/dist/node/surfaces/current.d.ts.map +1 -0
- package/dist/node/surfaces/current.js +54 -0
- package/dist/node/surfaces/current.js.map +1 -0
- package/dist/node/surfaces/index.d.ts +6 -0
- package/dist/node/surfaces/index.d.ts.map +1 -0
- package/dist/node/surfaces/index.js +6 -0
- package/dist/node/surfaces/index.js.map +1 -0
- package/dist/node/surfaces/published.d.ts +27 -0
- package/dist/node/surfaces/published.d.ts.map +1 -0
- package/dist/node/surfaces/published.js +142 -0
- package/dist/node/surfaces/published.js.map +1 -0
- package/dist/node/surfaces/served.d.ts +15 -0
- package/dist/node/surfaces/served.d.ts.map +1 -0
- package/dist/node/surfaces/served.js +42 -0
- package/dist/node/surfaces/served.js.map +1 -0
- package/dist/node/surfaces/surface-build.d.ts +53 -0
- package/dist/node/surfaces/surface-build.d.ts.map +1 -0
- package/dist/node/surfaces/surface-build.js +105 -0
- package/dist/node/surfaces/surface-build.js.map +1 -0
- package/dist/node/surfaces/tui.d.ts +40 -0
- package/dist/node/surfaces/tui.d.ts.map +1 -0
- package/dist/node/surfaces/tui.js +55 -0
- package/dist/node/surfaces/tui.js.map +1 -0
- package/dist/node/surfaces/web.d.ts +56 -0
- package/dist/node/surfaces/web.d.ts.map +1 -0
- package/dist/node/surfaces/web.js +108 -0
- package/dist/node/surfaces/web.js.map +1 -0
- package/dist/node/tui/actions.d.ts +49 -0
- package/dist/node/tui/actions.d.ts.map +1 -0
- package/dist/node/tui/actions.js +195 -0
- package/dist/node/tui/actions.js.map +1 -0
- package/dist/node/tui/credentials.d.ts +17 -0
- package/dist/node/tui/credentials.d.ts.map +1 -0
- package/dist/node/tui/credentials.js +54 -0
- package/dist/node/tui/credentials.js.map +1 -0
- package/dist/node/tui/filter.d.ts +5 -0
- package/dist/node/tui/filter.d.ts.map +1 -0
- package/dist/node/tui/filter.js +79 -0
- package/dist/node/tui/filter.js.map +1 -0
- package/dist/node/tui/index.d.ts +6 -0
- package/dist/node/tui/index.d.ts.map +1 -0
- package/dist/node/tui/index.js +6 -0
- package/dist/node/tui/index.js.map +1 -0
- package/dist/node/tui/launcher.d.ts +40 -0
- package/dist/node/tui/launcher.d.ts.map +1 -0
- package/dist/node/tui/launcher.js +439 -0
- package/dist/node/tui/launcher.js.map +1 -0
- package/dist/node/tui/pipe.d.ts +18 -0
- package/dist/node/tui/pipe.d.ts.map +1 -0
- package/dist/node/tui/pipe.js +134 -0
- package/dist/node/tui/pipe.js.map +1 -0
- package/dist/node/tui/sandbox.d.ts +54 -0
- package/dist/node/tui/sandbox.d.ts.map +1 -0
- package/dist/node/tui/sandbox.js +431 -0
- package/dist/node/tui/sandbox.js.map +1 -0
- package/dist/node/workers/base.d.ts +30 -0
- package/dist/node/workers/base.d.ts.map +1 -0
- package/dist/node/workers/base.js +255 -0
- package/dist/node/workers/base.js.map +1 -0
- package/dist/node/workers/child.d.ts +4 -0
- package/dist/node/workers/child.d.ts.map +1 -0
- package/dist/node/workers/child.js +6 -0
- package/dist/node/workers/child.js.map +1 -0
- package/dist/node/workers/control.d.ts +83 -0
- package/dist/node/workers/control.d.ts.map +1 -0
- package/dist/node/workers/control.js +77 -0
- package/dist/node/workers/control.js.map +1 -0
- package/dist/node/workers/index.d.ts +4 -0
- package/dist/node/workers/index.d.ts.map +1 -0
- package/dist/node/workers/index.js +7 -0
- package/dist/node/workers/index.js.map +1 -0
- package/dist/node/workers/lock.d.ts +30 -0
- package/dist/node/workers/lock.d.ts.map +1 -0
- package/dist/node/workers/lock.js +180 -0
- package/dist/node/workers/lock.js.map +1 -0
- package/dist/node/workers/main.d.ts +46 -0
- package/dist/node/workers/main.d.ts.map +1 -0
- package/dist/node/workers/main.js +230 -0
- package/dist/node/workers/main.js.map +1 -0
- package/dist/node/workers/process.d.ts +42 -0
- package/dist/node/workers/process.d.ts.map +1 -0
- package/dist/node/workers/process.js +125 -0
- package/dist/node/workers/process.js.map +1 -0
- package/dist/node/workers/workers.d.ts +122 -0
- package/dist/node/workers/workers.d.ts.map +1 -0
- package/dist/node/workers/workers.js +677 -0
- package/dist/node/workers/workers.js.map +1 -0
- package/dist/output.d.ts +1 -1
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +4 -2
- package/dist/output.js.map +1 -1
- package/dist/react/hooks.d.ts +43 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +82 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +4 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/stores.d.ts +9 -0
- package/dist/react/stores.d.ts.map +1 -0
- package/dist/react/stores.js +37 -0
- package/dist/react/stores.js.map +1 -0
- package/dist/registries/contribution.d.ts +50 -0
- package/dist/registries/contribution.d.ts.map +1 -0
- package/dist/registries/contribution.js +129 -0
- package/dist/registries/contribution.js.map +1 -0
- package/dist/registries/entries.d.ts +18 -0
- package/dist/registries/entries.d.ts.map +1 -0
- package/dist/registries/entries.js +42 -0
- package/dist/registries/entries.js.map +1 -0
- package/dist/registries/index.d.ts +3 -0
- package/dist/registries/index.d.ts.map +1 -0
- package/dist/registries/index.js +5 -0
- package/dist/registries/index.js.map +1 -0
- package/dist/registries/internal.d.ts +4 -0
- package/dist/registries/internal.d.ts.map +1 -0
- package/dist/registries/internal.js +5 -0
- package/dist/registries/internal.js.map +1 -0
- package/dist/registries/record.d.ts +115 -0
- package/dist/registries/record.d.ts.map +1 -0
- package/dist/registries/record.js +283 -0
- package/dist/registries/record.js.map +1 -0
- package/dist/registries/registry.d.ts +74 -0
- package/dist/registries/registry.d.ts.map +1 -0
- package/dist/registries/registry.js +14 -0
- package/dist/registries/registry.js.map +1 -0
- package/dist/registries/value.d.ts +48 -0
- package/dist/registries/value.d.ts.map +1 -0
- package/dist/registries/value.js +224 -0
- package/dist/registries/value.js.map +1 -0
- package/dist/remote/calls.d.ts +25 -0
- package/dist/remote/calls.d.ts.map +1 -0
- package/dist/remote/calls.js +62 -0
- package/dist/remote/calls.js.map +1 -0
- package/dist/remote/consumer.d.ts +43 -0
- package/dist/remote/consumer.d.ts.map +1 -0
- package/dist/remote/consumer.js +350 -0
- package/dist/remote/consumer.js.map +1 -0
- package/dist/remote/hold.d.ts +141 -0
- package/dist/remote/hold.d.ts.map +1 -0
- package/dist/remote/hold.js +579 -0
- package/dist/remote/hold.js.map +1 -0
- package/dist/remote/host-link.d.ts +77 -0
- package/dist/remote/host-link.d.ts.map +1 -0
- package/dist/remote/host-link.js +184 -0
- package/dist/remote/host-link.js.map +1 -0
- package/dist/remote/internal.d.ts +6 -0
- package/dist/remote/internal.d.ts.map +1 -0
- package/dist/remote/internal.js +6 -0
- package/dist/remote/internal.js.map +1 -0
- package/dist/remote/path.d.ts +46 -0
- package/dist/remote/path.d.ts.map +1 -0
- package/dist/remote/path.js +73 -0
- package/dist/remote/path.js.map +1 -0
- package/dist/remote/provider.d.ts +89 -0
- package/dist/remote/provider.d.ts.map +1 -0
- package/dist/remote/provider.js +597 -0
- package/dist/remote/provider.js.map +1 -0
- package/dist/remote/relay.d.ts +69 -0
- package/dist/remote/relay.d.ts.map +1 -0
- package/dist/remote/relay.js +219 -0
- package/dist/remote/relay.js.map +1 -0
- package/dist/remote/remote-object.d.ts +138 -0
- package/dist/remote/remote-object.d.ts.map +1 -0
- package/dist/remote/remote-object.js +492 -0
- package/dist/remote/remote-object.js.map +1 -0
- package/dist/remote/replica.d.ts +59 -0
- package/dist/remote/replica.d.ts.map +1 -0
- package/dist/remote/replica.js +125 -0
- package/dist/remote/replica.js.map +1 -0
- package/dist/sqlite/cloudflare.d.ts +2 -0
- package/dist/sqlite/cloudflare.d.ts.map +1 -1
- package/dist/sqlite/cloudflare.js +10 -0
- package/dist/sqlite/cloudflare.js.map +1 -1
- package/dist/sqlite/database.d.ts +5 -2
- package/dist/sqlite/database.d.ts.map +1 -1
- package/dist/sqlite/database.js.map +1 -1
- package/dist/sqlite/node.d.ts +13 -2
- package/dist/sqlite/node.d.ts.map +1 -1
- package/dist/sqlite/node.js +31 -8
- package/dist/sqlite/node.js.map +1 -1
- package/dist/state/batch.d.ts +64 -0
- package/dist/state/batch.d.ts.map +1 -0
- package/dist/state/batch.js +164 -0
- package/dist/state/batch.js.map +1 -0
- package/dist/state/derive.d.ts +52 -0
- package/dist/state/derive.d.ts.map +1 -0
- package/dist/state/derive.js +182 -0
- package/dist/state/derive.js.map +1 -0
- package/dist/state/index.d.ts +6 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +4 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/internal.d.ts +6 -0
- package/dist/state/internal.d.ts.map +1 -0
- package/dist/state/internal.js +8 -0
- package/dist/state/internal.js.map +1 -0
- package/dist/state/native-source.d.ts +106 -0
- package/dist/state/native-source.d.ts.map +1 -0
- package/dist/state/native-source.js +240 -0
- package/dist/state/native-source.js.map +1 -0
- package/dist/state/watchable.d.ts +114 -0
- package/dist/state/watchable.d.ts.map +1 -0
- package/dist/state/watchable.js +156 -0
- package/dist/state/watchable.js.map +1 -0
- package/dist/state/writable.d.ts +32 -0
- package/dist/state/writable.d.ts.map +1 -0
- package/dist/state/writable.js +49 -0
- package/dist/state/writable.js.map +1 -0
- package/dist/store/adapter.d.ts +67 -0
- package/dist/store/adapter.d.ts.map +1 -0
- package/dist/store/adapter.js +118 -0
- package/dist/store/adapter.js.map +1 -0
- package/dist/store/allocator.d.ts +17 -0
- package/dist/store/allocator.d.ts.map +1 -0
- package/dist/store/allocator.js +30 -0
- package/dist/store/allocator.js.map +1 -0
- package/dist/store/applier.d.ts +8 -0
- package/dist/store/applier.d.ts.map +1 -0
- package/dist/store/applier.js +375 -0
- package/dist/store/applier.js.map +1 -0
- package/dist/store/apply-batch.d.ts +12 -0
- package/dist/store/apply-batch.d.ts.map +1 -0
- package/dist/store/apply-batch.js +83 -0
- package/dist/store/apply-batch.js.map +1 -0
- package/dist/store/archive.d.ts +32 -0
- package/dist/store/archive.d.ts.map +1 -0
- package/dist/store/archive.js +130 -0
- package/dist/store/archive.js.map +1 -0
- package/dist/store/backend.d.ts +10 -0
- package/dist/store/backend.d.ts.map +1 -0
- package/dist/store/backend.js +15 -0
- package/dist/store/backend.js.map +1 -0
- package/dist/store/catalog.d.ts +24 -0
- package/dist/store/catalog.d.ts.map +1 -0
- package/dist/store/catalog.js +17 -0
- package/dist/store/catalog.js.map +1 -0
- package/dist/store/claims.d.ts +23 -0
- package/dist/store/claims.d.ts.map +1 -0
- package/dist/store/claims.js +65 -0
- package/dist/store/claims.js.map +1 -0
- package/dist/store/columns.d.ts +77 -0
- package/dist/store/columns.d.ts.map +1 -0
- package/dist/store/columns.js +77 -0
- package/dist/store/columns.js.map +1 -0
- package/dist/store/engine.d.ts +176 -0
- package/dist/store/engine.d.ts.map +1 -0
- package/dist/store/engine.js +283 -0
- package/dist/store/engine.js.map +1 -0
- package/dist/store/evaluate.d.ts +17 -0
- package/dist/store/evaluate.d.ts.map +1 -0
- package/dist/store/evaluate.js +128 -0
- package/dist/store/evaluate.js.map +1 -0
- package/dist/store/export.d.ts +17 -0
- package/dist/store/export.d.ts.map +1 -0
- package/dist/store/export.js +200 -0
- package/dist/store/export.js.map +1 -0
- package/dist/store/expression.d.ts +150 -0
- package/dist/store/expression.d.ts.map +1 -0
- package/dist/store/expression.js +268 -0
- package/dist/store/expression.js.map +1 -0
- package/dist/store/import.d.ts +10 -0
- package/dist/store/import.d.ts.map +1 -0
- package/dist/store/import.js +276 -0
- package/dist/store/import.js.map +1 -0
- package/dist/store/index.d.ts +16 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +13 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/json-column.d.ts +33 -0
- package/dist/store/json-column.d.ts.map +1 -0
- package/dist/store/json-column.js +62 -0
- package/dist/store/json-column.js.map +1 -0
- package/dist/store/jsonl.d.ts +9 -0
- package/dist/store/jsonl.d.ts.map +1 -0
- package/dist/store/jsonl.js +61 -0
- package/dist/store/jsonl.js.map +1 -0
- package/dist/store/live-query.d.ts +108 -0
- package/dist/store/live-query.d.ts.map +1 -0
- package/dist/store/live-query.js +254 -0
- package/dist/store/live-query.js.map +1 -0
- package/dist/store/outbox.d.ts +26 -0
- package/dist/store/outbox.d.ts.map +1 -0
- package/dist/store/outbox.js +80 -0
- package/dist/store/outbox.js.map +1 -0
- package/dist/store/query.d.ts +39 -0
- package/dist/store/query.d.ts.map +1 -0
- package/dist/store/query.js +97 -0
- package/dist/store/query.js.map +1 -0
- package/dist/store/refusal.d.ts +15 -0
- package/dist/store/refusal.d.ts.map +1 -0
- package/dist/store/refusal.js +36 -0
- package/dist/store/refusal.js.map +1 -0
- package/dist/store/rows.d.ts +80 -0
- package/dist/store/rows.d.ts.map +1 -0
- package/dist/store/rows.js +183 -0
- package/dist/store/rows.js.map +1 -0
- package/dist/store/schema.d.ts +25 -0
- package/dist/store/schema.d.ts.map +1 -0
- package/dist/store/schema.js +115 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/sql.d.ts +73 -0
- package/dist/store/sql.d.ts.map +1 -0
- package/dist/store/sql.js +234 -0
- package/dist/store/sql.js.map +1 -0
- package/dist/store/step.d.ts +50 -0
- package/dist/store/step.d.ts.map +1 -0
- package/dist/store/step.js +52 -0
- package/dist/store/step.js.map +1 -0
- package/dist/store/store.d.ts +171 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +818 -0
- package/dist/store/store.js.map +1 -0
- package/dist/store/table-changes.d.ts +29 -0
- package/dist/store/table-changes.d.ts.map +1 -0
- package/dist/store/table-changes.js +102 -0
- package/dist/store/table-changes.js.map +1 -0
- package/dist/store/table-evolve.d.ts +74 -0
- package/dist/store/table-evolve.d.ts.map +1 -0
- package/dist/store/table-evolve.js +201 -0
- package/dist/store/table-evolve.js.map +1 -0
- package/dist/store/table-handle.d.ts +73 -0
- package/dist/store/table-handle.d.ts.map +1 -0
- package/dist/store/table-handle.js +101 -0
- package/dist/store/table-handle.js.map +1 -0
- package/dist/store/table-history.d.ts +75 -0
- package/dist/store/table-history.d.ts.map +1 -0
- package/dist/store/table-history.js +42 -0
- package/dist/store/table-history.js.map +1 -0
- package/dist/store/table-migration.d.ts +16 -0
- package/dist/store/table-migration.d.ts.map +1 -0
- package/dist/store/table-migration.js +202 -0
- package/dist/store/table-migration.js.map +1 -0
- package/dist/store/table-writes.d.ts +125 -0
- package/dist/store/table-writes.d.ts.map +1 -0
- package/dist/store/table-writes.js +170 -0
- package/dist/store/table-writes.js.map +1 -0
- package/dist/store/table.d.ts +80 -0
- package/dist/store/table.d.ts.map +1 -0
- package/dist/store/table.js +103 -0
- package/dist/store/table.js.map +1 -0
- package/dist/store/text.d.ts +14 -0
- package/dist/store/text.d.ts.map +1 -0
- package/dist/store/text.js +51 -0
- package/dist/store/text.js.map +1 -0
- package/dist/store/writes.d.ts +5 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +4 -0
- package/dist/store/writes.js.map +1 -0
- package/dist/surfaces/active-language.d.ts +20 -0
- package/dist/surfaces/active-language.d.ts.map +1 -0
- package/dist/surfaces/active-language.js +78 -0
- package/dist/surfaces/active-language.js.map +1 -0
- package/dist/surfaces/active-theme.d.ts +16 -0
- package/dist/surfaces/active-theme.d.ts.map +1 -0
- package/dist/surfaces/active-theme.js +47 -0
- package/dist/surfaces/active-theme.js.map +1 -0
- package/dist/surfaces/client.d.ts +96 -0
- package/dist/surfaces/client.d.ts.map +1 -0
- package/dist/surfaces/client.js +264 -0
- package/dist/surfaces/client.js.map +1 -0
- package/dist/surfaces/connection.d.ts +49 -0
- package/dist/surfaces/connection.d.ts.map +1 -0
- package/dist/surfaces/connection.js +142 -0
- package/dist/surfaces/connection.js.map +1 -0
- package/dist/surfaces/format.d.ts +5 -0
- package/dist/surfaces/format.d.ts.map +1 -0
- package/dist/surfaces/format.js +37 -0
- package/dist/surfaces/format.js.map +1 -0
- package/dist/surfaces/index.d.ts +15 -0
- package/dist/surfaces/index.d.ts.map +1 -0
- package/dist/surfaces/index.js +18 -0
- package/dist/surfaces/index.js.map +1 -0
- package/dist/surfaces/language.d.ts +53 -0
- package/dist/surfaces/language.d.ts.map +1 -0
- package/dist/surfaces/language.js +74 -0
- package/dist/surfaces/language.js.map +1 -0
- package/dist/surfaces/loaded.d.ts +42 -0
- package/dist/surfaces/loaded.d.ts.map +1 -0
- package/dist/surfaces/loaded.js +116 -0
- package/dist/surfaces/loaded.js.map +1 -0
- package/dist/surfaces/locale-choice.d.ts +25 -0
- package/dist/surfaces/locale-choice.d.ts.map +1 -0
- package/dist/surfaces/locale-choice.js +14 -0
- package/dist/surfaces/locale-choice.js.map +1 -0
- package/dist/surfaces/messages.d.ts +67 -0
- package/dist/surfaces/messages.d.ts.map +1 -0
- package/dist/surfaces/messages.js +112 -0
- package/dist/surfaces/messages.js.map +1 -0
- package/dist/surfaces/page-state.d.ts +14 -0
- package/dist/surfaces/page-state.d.ts.map +1 -0
- package/dist/surfaces/page-state.js +43 -0
- package/dist/surfaces/page-state.js.map +1 -0
- package/dist/surfaces/preference.d.ts +32 -0
- package/dist/surfaces/preference.d.ts.map +1 -0
- package/dist/surfaces/preference.js +72 -0
- package/dist/surfaces/preference.js.map +1 -0
- package/dist/surfaces/registered.d.ts +33 -0
- package/dist/surfaces/registered.d.ts.map +1 -0
- package/dist/surfaces/registered.js +51 -0
- package/dist/surfaces/registered.js.map +1 -0
- package/dist/surfaces/scripts.d.ts +84 -0
- package/dist/surfaces/scripts.d.ts.map +1 -0
- package/dist/surfaces/scripts.js +28 -0
- package/dist/surfaces/scripts.js.map +1 -0
- package/dist/surfaces/theme-choice.d.ts +31 -0
- package/dist/surfaces/theme-choice.d.ts.map +1 -0
- package/dist/surfaces/theme-choice.js +18 -0
- package/dist/surfaces/theme-choice.js.map +1 -0
- package/dist/surfaces/themes.d.ts +43 -0
- package/dist/surfaces/themes.d.ts.map +1 -0
- package/dist/surfaces/themes.js +110 -0
- package/dist/surfaces/themes.js.map +1 -0
- package/dist/surfaces/translations.d.ts +29 -0
- package/dist/surfaces/translations.d.ts.map +1 -0
- package/dist/surfaces/translations.js +57 -0
- package/dist/surfaces/translations.js.map +1 -0
- package/dist/sync/batch.d.ts +18 -0
- package/dist/sync/batch.d.ts.map +1 -0
- package/dist/sync/batch.js +125 -0
- package/dist/sync/batch.js.map +1 -0
- package/dist/sync/client.d.ts +166 -0
- package/dist/sync/client.d.ts.map +1 -0
- package/dist/sync/client.js +438 -0
- package/dist/sync/client.js.map +1 -0
- package/dist/sync/files.d.ts +46 -0
- package/dist/sync/files.d.ts.map +1 -0
- package/dist/sync/files.js +13 -0
- package/dist/sync/files.js.map +1 -0
- package/dist/sync/filesystem.d.ts +37 -0
- package/dist/sync/filesystem.d.ts.map +1 -0
- package/dist/sync/filesystem.js +185 -0
- package/dist/sync/filesystem.js.map +1 -0
- package/dist/sync/index.d.ts +8 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +9 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/lines.d.ts +18 -0
- package/dist/sync/lines.d.ts.map +1 -0
- package/dist/sync/lines.js +46 -0
- package/dist/sync/lines.js.map +1 -0
- package/dist/sync/remote.d.ts +130 -0
- package/dist/sync/remote.d.ts.map +1 -0
- package/dist/sync/remote.js +46 -0
- package/dist/sync/remote.js.map +1 -0
- package/dist/sync/state.d.ts +17 -0
- package/dist/sync/state.d.ts.map +1 -0
- package/dist/sync/state.js +40 -0
- package/dist/sync/state.js.map +1 -0
- package/dist/telemetry-ingest/batch.d.ts +70 -0
- package/dist/telemetry-ingest/batch.d.ts.map +1 -0
- package/dist/telemetry-ingest/batch.js +110 -0
- package/dist/telemetry-ingest/batch.js.map +1 -0
- package/dist/telemetry-ingest/facet.d.ts +21 -0
- package/dist/telemetry-ingest/facet.d.ts.map +1 -0
- package/dist/telemetry-ingest/facet.js +96 -0
- package/dist/telemetry-ingest/facet.js.map +1 -0
- package/dist/telemetry-ingest/index.d.ts +5 -0
- package/dist/telemetry-ingest/index.d.ts.map +1 -0
- package/dist/telemetry-ingest/index.js +8 -0
- package/dist/telemetry-ingest/index.js.map +1 -0
- package/dist/telemetry-ingest/recorder.d.ts +50 -0
- package/dist/telemetry-ingest/recorder.d.ts.map +1 -0
- package/dist/telemetry-ingest/recorder.js +298 -0
- package/dist/telemetry-ingest/recorder.js.map +1 -0
- package/dist/telemetry-ingest/sender.d.ts +14 -0
- package/dist/telemetry-ingest/sender.d.ts.map +1 -0
- package/dist/telemetry-ingest/sender.js +64 -0
- package/dist/telemetry-ingest/sender.js.map +1 -0
- package/dist/telemetry-sqlite/index.d.ts +13 -4
- package/dist/telemetry-sqlite/index.d.ts.map +1 -1
- package/dist/telemetry-sqlite/index.js +81 -241
- package/dist/telemetry-sqlite/index.js.map +1 -1
- package/dist/telemetry-sqlite/node.d.ts +13 -0
- package/dist/telemetry-sqlite/node.d.ts.map +1 -0
- package/dist/telemetry-sqlite/node.js +27 -0
- package/dist/telemetry-sqlite/node.js.map +1 -0
- package/dist/telemetry-sqlite/schema.d.ts +9 -0
- package/dist/telemetry-sqlite/schema.d.ts.map +1 -0
- package/dist/telemetry-sqlite/schema.js +61 -0
- package/dist/telemetry-sqlite/schema.js.map +1 -0
- package/dist/telemetry-sqlite/store.d.ts +3 -0
- package/dist/telemetry-sqlite/store.d.ts.map +1 -1
- package/dist/telemetry-sqlite/store.js +24 -13
- package/dist/telemetry-sqlite/store.js.map +1 -1
- package/dist/telemetry.d.ts +937 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +470 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/tui/bridge.d.ts +112 -0
- package/dist/tui/bridge.d.ts.map +1 -0
- package/dist/tui/bridge.js +9 -0
- package/dist/tui/bridge.js.map +1 -0
- package/dist/tui/channel.d.ts +44 -0
- package/dist/tui/channel.d.ts.map +1 -0
- package/dist/tui/channel.js +150 -0
- package/dist/tui/channel.js.map +1 -0
- package/dist/tui/frames.d.ts +5 -0
- package/dist/tui/frames.d.ts.map +1 -0
- package/dist/tui/frames.js +52 -0
- package/dist/tui/frames.js.map +1 -0
- package/dist/tui/index.d.ts +7 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +8 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/runtime.d.ts +46 -0
- package/dist/tui/runtime.d.ts.map +1 -0
- package/dist/tui/runtime.js +101 -0
- package/dist/tui/runtime.js.map +1 -0
- package/dist/tui/scope.d.ts +46 -0
- package/dist/tui/scope.d.ts.map +1 -0
- package/dist/tui/scope.js +141 -0
- package/dist/tui/scope.js.map +1 -0
- package/dist/tui/terminal.d.ts +15 -0
- package/dist/tui/terminal.d.ts.map +1 -0
- package/dist/tui/terminal.js +37 -0
- package/dist/tui/terminal.js.map +1 -0
- package/dist/tui/theme.d.ts +17 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +38 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/watch.d.ts +194 -0
- package/dist/watch.d.ts.map +1 -0
- package/dist/watch.js +383 -0
- package/dist/watch.js.map +1 -0
- package/dist/web/environment.d.ts +4 -0
- package/dist/web/environment.d.ts.map +1 -0
- package/dist/web/environment.js +37 -0
- package/dist/web/environment.js.map +1 -0
- package/dist/web/index.d.ts +5 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +7 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/language.d.ts +7 -0
- package/dist/web/language.d.ts.map +1 -0
- package/dist/web/language.js +21 -0
- package/dist/web/language.js.map +1 -0
- package/dist/web/page.d.ts +29 -0
- package/dist/web/page.d.ts.map +1 -0
- package/dist/web/page.js +92 -0
- package/dist/web/page.js.map +1 -0
- package/dist/web/scripts.d.ts +23 -0
- package/dist/web/scripts.d.ts.map +1 -0
- package/dist/web/scripts.js +50 -0
- package/dist/web/scripts.js.map +1 -0
- package/dist/web/styles.d.ts +17 -0
- package/dist/web/styles.d.ts.map +1 -0
- package/dist/web/styles.js +218 -0
- package/dist/web/styles.js.map +1 -0
- package/dist/web/themes.d.ts +6 -0
- package/dist/web/themes.d.ts.map +1 -0
- package/dist/web/themes.js +31 -0
- package/dist/web/themes.js.map +1 -0
- package/docs/benchmarks.md +1036 -0
- package/docs/decisions.md +3436 -0
- package/docs/dependencies/book.md +1671 -0
- package/docs/dependencies/index.html +2641 -0
- package/docs/dependencies/model.md +330 -0
- package/docs/design.md +3065 -0
- package/docs/durable-observers/book.md +432 -0
- package/docs/durable-observers/index.html +517 -0
- package/docs/flow-control/book.md +333 -0
- package/docs/flow-control/fold/index.html +265 -0
- package/docs/flow-control/index.html +548 -0
- package/docs/flow-control/window/index.html +228 -0
- package/docs/guide-plugins-hosts/book.md +957 -0
- package/docs/guide-plugins-hosts/index.html +952 -0
- package/docs/http-workers/book.md +378 -0
- package/docs/http-workers/index.html +515 -0
- package/docs/i18n/book.md +217 -0
- package/docs/i18n/index.html +344 -0
- package/docs/layer-1.md +311 -0
- package/docs/layer-2.md +216 -0
- package/docs/p3-features/README.md +6 -0
- package/docs/p3-features/book.md +478 -0
- package/docs/plugin-authoring.md +276 -0
- package/docs/plugin-model/book.md +186 -0
- package/docs/plugin-model/index.html +310 -0
- package/docs/plugin-primer/book.md +273 -0
- package/docs/plugin-primer/index.html +430 -0
- package/docs/slice-1.md +236 -0
- package/docs/slice-10.md +288 -0
- package/docs/slice-11.md +114 -0
- package/docs/slice-12.md +132 -0
- package/docs/slice-13.md +121 -0
- package/docs/slice-2.md +174 -0
- package/docs/slice-3a.md +296 -0
- package/docs/slice-3b.md +197 -0
- package/docs/slice-4.md +146 -0
- package/docs/slice-4a.md +418 -0
- package/docs/slice-4b.md +208 -0
- package/docs/slice-5.md +281 -0
- package/docs/slice-6a.md +676 -0
- package/docs/slice-6b.md +332 -0
- package/docs/slice-7a.md +130 -0
- package/docs/slice-7b/book.md +608 -0
- package/docs/slice-7b/index.html +842 -0
- package/docs/slice-7b.md +255 -0
- package/docs/slice-7c.md +165 -0
- package/docs/slice-8.md +194 -0
- package/docs/slice-9.md +110 -0
- package/docs/slices.md +241 -0
- package/docs/store/book.md +670 -0
- package/docs/store/index.html +861 -0
- package/docs/store/walkthrough.md +193 -0
- package/docs/theming/book.md +223 -0
- package/docs/theming/index.html +371 -0
- package/docs/tutorial/book.md +2169 -0
- package/docs/tutorial/index.html +2112 -0
- package/docs/tutorial/screens/click-after.png +0 -0
- package/docs/tutorial/screens/click-before.png +0 -0
- package/docs/tutorial/screens/edited.png +0 -0
- package/docs/tutorial/screens/french.png +0 -0
- package/docs/tutorial/screens/harbor.png +0 -0
- package/docs/tutorial/screens/page.png +0 -0
- package/docs/tutorial/screens/traces-ada.png +0 -0
- package/docs/tutorial/screens/traces.png +0 -0
- package/package.json +114 -20
- package/src/delta/README.md +69 -0
- package/dist/cell.d.ts +0 -122
- package/dist/cell.d.ts.map +0 -1
- package/dist/cell.js +0 -356
- package/dist/cell.js.map +0 -1
- package/dist/cluster.d.ts +0 -27
- package/dist/cluster.d.ts.map +0 -1
- package/dist/cluster.js +0 -230
- package/dist/cluster.js.map +0 -1
- package/dist/connection.d.ts +0 -270
- package/dist/connection.d.ts.map +0 -1
- package/dist/connection.js +0 -1216
- package/dist/connection.js.map +0 -1
- package/dist/contract.d.ts +0 -208
- package/dist/contract.d.ts.map +0 -1
- package/dist/contract.js +0 -246
- package/dist/contract.js.map +0 -1
- package/dist/declare.d.ts +0 -33
- package/dist/declare.d.ts.map +0 -1
- package/dist/declare.js +0 -2
- package/dist/declare.js.map +0 -1
- package/dist/errors.d.ts +0 -28
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -59
- package/dist/errors.js.map +0 -1
- package/dist/host.d.ts +0 -348
- package/dist/host.d.ts.map +0 -1
- package/dist/host.js +0 -1000
- package/dist/host.js.map +0 -1
- package/dist/link.d.ts +0 -107
- package/dist/link.d.ts.map +0 -1
- package/dist/link.js +0 -355
- package/dist/link.js.map +0 -1
- package/dist/loader.d.ts +0 -4
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js +0 -73
- package/dist/loader.js.map +0 -1
- package/dist/manager.d.ts +0 -115
- package/dist/manager.d.ts.map +0 -1
- package/dist/manager.js +0 -345
- package/dist/manager.js.map +0 -1
- package/dist/node.d.ts +0 -4
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -4
- package/dist/node.js.map +0 -1
- package/dist/object.d.ts +0 -438
- package/dist/object.d.ts.map +0 -1
- package/dist/object.js +0 -1571
- package/dist/object.js.map +0 -1
- package/dist/publish.d.ts +0 -5
- package/dist/publish.d.ts.map +0 -1
- package/dist/publish.js +0 -40
- package/dist/publish.js.map +0 -1
- package/dist/registry.d.ts +0 -25
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -6
- package/dist/registry.js.map +0 -1
- package/dist/reload.d.ts +0 -126
- package/dist/reload.d.ts.map +0 -1
- package/dist/reload.js +0 -653
- package/dist/reload.js.map +0 -1
- package/dist/remote.d.ts +0 -165
- package/dist/remote.d.ts.map +0 -1
- package/dist/remote.js +0 -612
- package/dist/remote.js.map +0 -1
- package/dist/schema.d.ts +0 -21
- package/dist/schema.d.ts.map +0 -1
- package/dist/schema.js +0 -228
- package/dist/schema.js.map +0 -1
- package/dist/state.d.ts +0 -92
- package/dist/state.d.ts.map +0 -1
- package/dist/state.js +0 -287
- package/dist/state.js.map +0 -1
- package/dist/types.d.ts +0 -88
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/websocket.d.ts +0 -15
- package/dist/websocket.d.ts.map +0 -1
- package/dist/websocket.js +0 -16
- package/dist/websocket.js.map +0 -1
- package/dist/wire.d.ts +0 -216
- package/dist/wire.d.ts.map +0 -1
- package/dist/wire.js +0 -165
- package/dist/wire.js.map +0 -1
- package/docs/guide.md +0 -814
- package/docs/spec.md +0 -288
- package/docs/tutorial.md +0 -931
package/dist/cluster.js
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { ChordError } from "./errors.js";
|
|
2
|
-
import { beginReload, endReload, reloadError } from "./reload.js";
|
|
3
|
-
import { toWireError } from "./wire.js";
|
|
4
|
-
// Cross-host reload, coordinated by the server (the host without a parent):
|
|
5
|
-
// server: prepare itself and send `prepare` to every synced child host; collect votes
|
|
6
|
-
// all ok: the server installs its new code version, sends `commit` to every child, and only then starts what may make
|
|
7
|
-
// new-code-version calls (tasks, listener and registry callbacks). Links are FIFO, so a child commits before it
|
|
8
|
-
// can receive any frame of a root started in the new code version.
|
|
9
|
-
// any failure or missed vote deadline: `abort` everywhere; each host rolls back to where it was.
|
|
10
|
-
// Clients (browsers) are not participants: they see shape/reset pushes, or `upgrade_required`.
|
|
11
|
-
// A child that connects behind the server's code version is fenced and reconciled with the same protocol.
|
|
12
|
-
let reloadSeq = 0;
|
|
13
|
-
const modulesFor = (remote, hostName) => {
|
|
14
|
-
let best;
|
|
15
|
-
for (const entry of Object.entries(remote ?? {})) {
|
|
16
|
-
if (hostName?.startsWith(entry[0]) && (best === undefined || entry[0].length > best[0].length))
|
|
17
|
-
best = entry;
|
|
18
|
-
}
|
|
19
|
-
return [...(best?.[1] ?? [])];
|
|
20
|
-
};
|
|
21
|
-
/** A vote, or its rejection after `deadline` milliseconds. */
|
|
22
|
-
function awaitVote(connection, id, deadline) {
|
|
23
|
-
let timer;
|
|
24
|
-
const vote = new Promise((resolve, reject) => {
|
|
25
|
-
connection.votes.set(id, { resolve, reject });
|
|
26
|
-
timer = setTimeout(() => {
|
|
27
|
-
connection.votes.delete(id);
|
|
28
|
-
reject(new ChordError("aborted", `votes missing after ${deadline} ms`, { reason: "vote_deadline" }));
|
|
29
|
-
}, deadline);
|
|
30
|
-
});
|
|
31
|
-
return vote.finally(() => clearTimeout(timer));
|
|
32
|
-
}
|
|
33
|
-
export async function runClusterReload(host, plugins, options) {
|
|
34
|
-
// Participants are the children in step now. Fenced children (behind, being reconciled) reconcile to the new code
|
|
35
|
-
// version afterwards; a child whose hello arrives while the reload runs is synced or reconciled once it ends
|
|
36
|
-
// (`HostImpl.peerHello`).
|
|
37
|
-
const synced = [...host.connections].filter((connection) => connection.role === "downstream" && connection.peer.kind === "host" && connection.open && connection.synced);
|
|
38
|
-
const codeVersion = host.peekNextCodeVersion();
|
|
39
|
-
const reload = await beginReload(host, plugins, options, codeVersion);
|
|
40
|
-
try {
|
|
41
|
-
// Retire first: its `retire` frames reach every child before `prepare` (FIFO), so a child never retires a code
|
|
42
|
-
// version this host still runs roots of.
|
|
43
|
-
await reload.waitForRetirement();
|
|
44
|
-
const participants = synced.filter((connection) => connection.open);
|
|
45
|
-
const id = ++reloadSeq;
|
|
46
|
-
const deadline = options.voteDeadline ?? (options.gateDeadline ?? 5000) + (options.retireDeadline ?? 5000) + 5000;
|
|
47
|
-
const votes = participants.map((connection) => {
|
|
48
|
-
const name = connection.name ?? "child";
|
|
49
|
-
const vote = awaitVote(connection, id, deadline);
|
|
50
|
-
connection.send({
|
|
51
|
-
t: "prepare",
|
|
52
|
-
reload: id,
|
|
53
|
-
codeVersion,
|
|
54
|
-
plugins: modulesFor(options.remote, name),
|
|
55
|
-
options: {
|
|
56
|
-
remove: modulesFor(options.remoteRemove, name),
|
|
57
|
-
gateDeadline: options.gateDeadline,
|
|
58
|
-
retireDeadline: options.retireDeadline,
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
return vote.then((report) => [name, report], (error) => {
|
|
62
|
-
const cause = reloadError(error);
|
|
63
|
-
throw new ChordError(cause.code, `${name}: ${cause.message}`, { cause, reason: cause.reason });
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
let local = false;
|
|
67
|
-
const results = await Promise.allSettled([
|
|
68
|
-
reload.prepare().then(() => {
|
|
69
|
-
local = true;
|
|
70
|
-
}),
|
|
71
|
-
...votes,
|
|
72
|
-
]);
|
|
73
|
-
const failed = results.find((result) => result.status === "rejected");
|
|
74
|
-
if (failed !== undefined) {
|
|
75
|
-
for (const connection of participants) {
|
|
76
|
-
connection.votes.delete(id);
|
|
77
|
-
connection.send({ t: "abort", reload: id });
|
|
78
|
-
}
|
|
79
|
-
if (local)
|
|
80
|
-
await reload.rollback();
|
|
81
|
-
throw failed.reason;
|
|
82
|
-
}
|
|
83
|
-
const report = reload.commit(() => {
|
|
84
|
-
for (const connection of participants) {
|
|
85
|
-
connection.send({ t: "commit", reload: id });
|
|
86
|
-
connection.peerCodeVersion = codeVersion;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
host.rememberRemoteModules(options.remote, options.remoteRemove);
|
|
90
|
-
const children = {};
|
|
91
|
-
for (const result of results.slice(1)) {
|
|
92
|
-
if (result.status !== "fulfilled")
|
|
93
|
-
continue;
|
|
94
|
-
const [name, child] = result.value;
|
|
95
|
-
if (child !== undefined)
|
|
96
|
-
children[name] = child;
|
|
97
|
-
}
|
|
98
|
-
return { ...report, children };
|
|
99
|
-
}
|
|
100
|
-
finally {
|
|
101
|
-
endReload(host);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Brings a child that connected behind this host's code version up to it: a reload of the child's modules (the ones
|
|
106
|
-
* cluster reloads gave its name) to this host's current code version, prepared, voted and committed like a cluster
|
|
107
|
-
* reload. Until then the child is fenced: nothing is routed to it. The child's old code is never relabeled as a newer
|
|
108
|
-
* code version.
|
|
109
|
-
*/
|
|
110
|
-
export async function reconcileChild(host, connection) {
|
|
111
|
-
for (;;) {
|
|
112
|
-
if (!connection.open)
|
|
113
|
-
return;
|
|
114
|
-
// Not during a reload of this host: the child is not one of its participants, so whatever it would be synced to
|
|
115
|
-
// now may be superseded by that reload's commit. Recheck once it ended.
|
|
116
|
-
if (host.reloading) {
|
|
117
|
-
await host.whenReloadEnded();
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
const codeVersion = host.current.id;
|
|
121
|
-
if (connection.peerCodeVersion === codeVersion) {
|
|
122
|
-
connection.markSynced(codeVersion);
|
|
123
|
-
host.announceRetired(connection);
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
// Before `prepare`: the child's prepare first retires its previous code version, which waits for this permission.
|
|
127
|
-
host.announceRetired(connection);
|
|
128
|
-
const id = ++reloadSeq;
|
|
129
|
-
const vote = awaitVote(connection, id, 30_000);
|
|
130
|
-
connection.send({
|
|
131
|
-
t: "prepare",
|
|
132
|
-
reload: id,
|
|
133
|
-
codeVersion,
|
|
134
|
-
plugins: modulesFor(host.remoteModules, connection.name),
|
|
135
|
-
options: { remove: modulesFor(host.remoteRemoved, connection.name) },
|
|
136
|
-
});
|
|
137
|
-
await vote;
|
|
138
|
-
if (host.current.id !== codeVersion) {
|
|
139
|
-
// This host moved on meanwhile: abort and try again with the newer code version.
|
|
140
|
-
connection.send({ t: "abort", reload: id });
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
connection.send({ t: "commit", reload: id });
|
|
144
|
-
connection.peerCodeVersion = codeVersion;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* The child side: prepare and vote, then wait for the server's commit or abort. An abort or a lost parent link can
|
|
149
|
-
* arrive at any point: while loading modules, while preparing (pending opens close themselves when they complete),
|
|
150
|
-
* or after the vote. The operation is unwound once its pending work settles, and the reload slot is freed.
|
|
151
|
-
*/
|
|
152
|
-
export class ChildReloads {
|
|
153
|
-
#host;
|
|
154
|
-
#operation;
|
|
155
|
-
constructor(host) {
|
|
156
|
-
this.#host = host;
|
|
157
|
-
}
|
|
158
|
-
handle(connection, frame) {
|
|
159
|
-
if (frame.t === "prepare") {
|
|
160
|
-
if (this.#operation !== undefined) {
|
|
161
|
-
const error = new ChordError("unavailable", "a reload is already running", { reason: "reload_running" });
|
|
162
|
-
connection.send({ t: "vote", reload: frame.reload, error: toWireError(error) });
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
const operation = { id: frame.reload, reload: undefined, state: "loading", cancelled: false };
|
|
166
|
-
this.#operation = operation;
|
|
167
|
-
this.#run(operation, connection, frame).catch((error) => this.#host.report(error));
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
const operation = this.#operation;
|
|
171
|
-
if (operation === undefined || operation.id !== frame.reload)
|
|
172
|
-
return;
|
|
173
|
-
if (frame.t === "abort") {
|
|
174
|
-
this.#cancel(operation);
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
if (operation.state !== "prepared")
|
|
178
|
-
return;
|
|
179
|
-
this.#operation = undefined;
|
|
180
|
-
try {
|
|
181
|
-
operation.reload?.commit();
|
|
182
|
-
}
|
|
183
|
-
finally {
|
|
184
|
-
endReload(this.#host);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
/** The parent link died: nobody will commit, so roll back (now, or once pending work settles). */
|
|
188
|
-
parentLost() {
|
|
189
|
-
if (this.#operation !== undefined)
|
|
190
|
-
this.#cancel(this.#operation);
|
|
191
|
-
}
|
|
192
|
-
#cancel(operation) {
|
|
193
|
-
operation.cancelled = true;
|
|
194
|
-
if (operation.state !== "prepared") {
|
|
195
|
-
// Loading or preparing: make prepare fail now; #run unwinds when it settles.
|
|
196
|
-
operation.reload?.rollback().catch((error) => this.#host.report(error));
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
this.#operation = undefined;
|
|
200
|
-
operation.reload
|
|
201
|
-
?.rollback()
|
|
202
|
-
.catch((error) => this.#host.report(error))
|
|
203
|
-
.finally(() => endReload(this.#host));
|
|
204
|
-
}
|
|
205
|
-
async #run(operation, connection, frame) {
|
|
206
|
-
const cancelled = () => new ChordError("aborted", "reload aborted by the server", { reason: "aborted" });
|
|
207
|
-
try {
|
|
208
|
-
operation.reload = await beginReload(this.#host, frame.plugins, frame.options, frame.codeVersion);
|
|
209
|
-
if (operation.cancelled)
|
|
210
|
-
throw cancelled();
|
|
211
|
-
operation.state = "preparing";
|
|
212
|
-
await operation.reload.prepare();
|
|
213
|
-
if (operation.cancelled)
|
|
214
|
-
throw cancelled();
|
|
215
|
-
operation.state = "prepared";
|
|
216
|
-
connection.send({ t: "vote", reload: frame.reload, report: operation.reload.summary() });
|
|
217
|
-
}
|
|
218
|
-
catch (error) {
|
|
219
|
-
if (operation.reload !== undefined) {
|
|
220
|
-
await operation.reload.rollback().catch((cleanup) => this.#host.report(cleanup));
|
|
221
|
-
endReload(this.#host);
|
|
222
|
-
}
|
|
223
|
-
if (this.#operation === operation)
|
|
224
|
-
this.#operation = undefined;
|
|
225
|
-
if (!operation.cancelled)
|
|
226
|
-
connection.send({ t: "vote", reload: frame.reload, error: toWireError(error) });
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
//# sourceMappingURL=cluster.js.map
|
package/dist/cluster.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cluster.js","sourceRoot":"","sources":["../src/cluster.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAsD,WAAW,EAAE,MAAM,aAAa,CAAC;AACtH,OAAO,EAAc,WAAW,EAAE,MAAM,WAAW,CAAC;AAEpD,4EAA4E;AAC5E,wFAAwF;AACxF,wHAAwH;AACxH,gHAAgH;AAChH,6EAA6E;AAC7E,mGAAmG;AACnG,+FAA+F;AAC/F,0GAA0G;AAE1G,IAAI,SAAS,GAAG,CAAC,CAAC;AAElB,MAAM,UAAU,GAAG,CAAC,MAA+B,EAAE,QAA4B,EAAY,EAAE;IAC9F,IAAI,IAA6C,CAAC;IAClD,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE,CAAC;QAClD,IAAI,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAAE,IAAI,GAAG,KAAK,CAAC;IAC9G,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,8DAA8D;AAC9D,SAAS,SAAS,CAAC,UAAsB,EAAE,EAAU,EAAE,QAAgB;I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AAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC1F,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACvB,CAAC;YACD,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS;gBAAE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;YAC/D,IAAI,CAAC,SAAS,CAAC,SAAS;gBAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC3G,CAAC;IACF,CAAC;CACD","sourcesContent":["import type { Connection } from \"./connection.ts\";\nimport { ChordError } from \"./errors.ts\";\nimport type { HostImpl, PluginRef } from \"./host.ts\";\nimport { beginReload, endReload, type Reload, type ReloadOptions, type ReloadReport, reloadError } from \"./reload.ts\";\nimport { type Frame, toWireError } from \"./wire.ts\";\n\n// Cross-host reload, coordinated by the server (the host without a parent):\n// server: prepare itself and send `prepare` to every synced child host; collect votes\n// all ok: the server installs its new code version, sends `commit` to every child, and only then starts what may make\n// new-code-version calls (tasks, listener and registry callbacks). Links are FIFO, so a child commits before it\n// can receive any frame of a root started in the new code version.\n// any failure or missed vote deadline: `abort` everywhere; each host rolls back to where it was.\n// Clients (browsers) are not participants: they see shape/reset pushes, or `upgrade_required`.\n// A child that connects behind the server's code version is fenced and reconciled with the same protocol.\n\nlet reloadSeq = 0;\n\nconst modulesFor = (remote: ReloadOptions[\"remote\"], hostName: string | undefined): string[] => {\n\tlet best: [string, readonly string[]] | undefined;\n\tfor (const entry of Object.entries(remote ?? {})) {\n\t\tif (hostName?.startsWith(entry[0]) && (best === undefined || entry[0].length > best[0].length)) best = entry;\n\t}\n\treturn [...(best?.[1] ?? [])];\n};\n\n/** A vote, or its rejection after `deadline` milliseconds. */\nfunction awaitVote(connection: Connection, id: number, deadline: number): Promise<unknown> {\n\tlet timer: ReturnType<typeof setTimeout> | undefined;\n\tconst vote = new Promise<unknown>((resolve, reject) => {\n\t\tconnection.votes.set(id, { resolve, reject });\n\t\ttimer = setTimeout(() => {\n\t\t\tconnection.votes.delete(id);\n\t\t\treject(new ChordError(\"aborted\", `votes missing after ${deadline} ms`, { reason: \"vote_deadline\" }));\n\t\t}, deadline);\n\t});\n\treturn vote.finally(() => clearTimeout(timer));\n}\n\nexport async function runClusterReload(\n\thost: HostImpl,\n\tplugins: readonly PluginRef[],\n\toptions: ReloadOptions,\n): Promise<ReloadReport> {\n\t// Participants are the children in step now. Fenced children (behind, being reconciled) reconcile to the new code\n\t// version afterwards; a child whose hello arrives while the reload runs is synced or reconciled once it ends\n\t// (`HostImpl.peerHello`).\n\tconst synced = [...host.connections].filter(\n\t\t(connection) =>\n\t\t\tconnection.role === \"downstream\" && connection.peer.kind === \"host\" && connection.open && connection.synced,\n\t);\n\tconst codeVersion = host.peekNextCodeVersion();\n\tconst reload = await beginReload(host, plugins, options, codeVersion);\n\ttry {\n\t\t// Retire first: its `retire` frames reach every child before `prepare` (FIFO), so a child never retires a code\n\t\t// version this host still runs roots of.\n\t\tawait reload.waitForRetirement();\n\t\tconst participants = synced.filter((connection) => connection.open);\n\t\tconst id = ++reloadSeq;\n\t\tconst deadline = options.voteDeadline ?? (options.gateDeadline ?? 5000) + (options.retireDeadline ?? 5000) + 5000;\n\t\tconst votes = participants.map((connection) => {\n\t\t\tconst name = connection.name ?? \"child\";\n\t\t\tconst vote = awaitVote(connection, id, deadline);\n\t\t\tconnection.send({\n\t\t\t\tt: \"prepare\",\n\t\t\t\treload: id,\n\t\t\t\tcodeVersion,\n\t\t\t\tplugins: modulesFor(options.remote, name),\n\t\t\t\toptions: {\n\t\t\t\t\tremove: modulesFor(options.remoteRemove, name),\n\t\t\t\t\tgateDeadline: options.gateDeadline,\n\t\t\t\t\tretireDeadline: options.retireDeadline,\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn vote.then(\n\t\t\t\t(report) => [name, report as ReloadReport | undefined] as const,\n\t\t\t\t(error: unknown) => {\n\t\t\t\t\tconst cause = reloadError(error);\n\t\t\t\t\tthrow new ChordError(cause.code, `${name}: ${cause.message}`, { cause, reason: cause.reason });\n\t\t\t\t},\n\t\t\t);\n\t\t});\n\t\tlet local = false;\n\t\tconst results = await Promise.allSettled([\n\t\t\treload.prepare().then(() => {\n\t\t\t\tlocal = true;\n\t\t\t}),\n\t\t\t...votes,\n\t\t]);\n\t\tconst failed = results.find((result) => result.status === \"rejected\");\n\t\tif (failed !== undefined) {\n\t\t\tfor (const connection of participants) {\n\t\t\t\tconnection.votes.delete(id);\n\t\t\t\tconnection.send({ t: \"abort\", reload: id });\n\t\t\t}\n\t\t\tif (local) await reload.rollback();\n\t\t\tthrow failed.reason;\n\t\t}\n\t\tconst report = reload.commit(() => {\n\t\t\tfor (const connection of participants) {\n\t\t\t\tconnection.send({ t: \"commit\", reload: id });\n\t\t\t\tconnection.peerCodeVersion = codeVersion;\n\t\t\t}\n\t\t});\n\t\thost.rememberRemoteModules(options.remote, options.remoteRemove);\n\t\tconst children: Record<string, ReloadReport> = {};\n\t\tfor (const result of results.slice(1)) {\n\t\t\tif (result.status !== \"fulfilled\") continue;\n\t\t\tconst [name, child] = result.value as readonly [string, ReloadReport | undefined];\n\t\t\tif (child !== undefined) children[name] = child;\n\t\t}\n\t\treturn { ...report, children };\n\t} finally {\n\t\tendReload(host);\n\t}\n}\n\n/**\n * Brings a child that connected behind this host's code version up to it: a reload of the child's modules (the ones\n * cluster reloads gave its name) to this host's current code version, prepared, voted and committed like a cluster\n * reload. Until then the child is fenced: nothing is routed to it. The child's old code is never relabeled as a newer\n * code version.\n */\nexport async function reconcileChild(host: HostImpl, connection: Connection): Promise<void> {\n\tfor (;;) {\n\t\tif (!connection.open) return;\n\t\t// Not during a reload of this host: the child is not one of its participants, so whatever it would be synced to\n\t\t// now may be superseded by that reload's commit. Recheck once it ended.\n\t\tif (host.reloading) {\n\t\t\tawait host.whenReloadEnded();\n\t\t\tcontinue;\n\t\t}\n\t\tconst codeVersion = host.current.id;\n\t\tif (connection.peerCodeVersion === codeVersion) {\n\t\t\tconnection.markSynced(codeVersion);\n\t\t\thost.announceRetired(connection);\n\t\t\treturn;\n\t\t}\n\t\t// Before `prepare`: the child's prepare first retires its previous code version, which waits for this permission.\n\t\thost.announceRetired(connection);\n\t\tconst id = ++reloadSeq;\n\t\tconst vote = awaitVote(connection, id, 30_000);\n\t\tconnection.send({\n\t\t\tt: \"prepare\",\n\t\t\treload: id,\n\t\t\tcodeVersion,\n\t\t\tplugins: modulesFor(host.remoteModules, connection.name),\n\t\t\toptions: { remove: modulesFor(host.remoteRemoved, connection.name) },\n\t\t});\n\t\tawait vote;\n\t\tif (host.current.id !== codeVersion) {\n\t\t\t// This host moved on meanwhile: abort and try again with the newer code version.\n\t\t\tconnection.send({ t: \"abort\", reload: id });\n\t\t\tcontinue;\n\t\t}\n\t\tconnection.send({ t: \"commit\", reload: id });\n\t\tconnection.peerCodeVersion = codeVersion;\n\t}\n}\n\n/** One prepare the child received, registered before its first await so an abort or disconnect is never lost. */\ninterface ChildOperation {\n\treadonly id: number;\n\treload: Reload | undefined;\n\tstate: \"loading\" | \"preparing\" | \"prepared\";\n\tcancelled: boolean;\n}\n\n/**\n * The child side: prepare and vote, then wait for the server's commit or abort. An abort or a lost parent link can\n * arrive at any point: while loading modules, while preparing (pending opens close themselves when they complete),\n * or after the vote. The operation is unwound once its pending work settles, and the reload slot is freed.\n */\nexport class ChildReloads {\n\treadonly #host: HostImpl;\n\t#operation: ChildOperation | undefined;\n\n\tconstructor(host: HostImpl) {\n\t\tthis.#host = host;\n\t}\n\n\thandle(connection: Connection, frame: Extract<Frame, { t: \"prepare\" | \"commit\" | \"abort\" }>): void {\n\t\tif (frame.t === \"prepare\") {\n\t\t\tif (this.#operation !== undefined) {\n\t\t\t\tconst error = new ChordError(\"unavailable\", \"a reload is already running\", { reason: \"reload_running\" });\n\t\t\t\tconnection.send({ t: \"vote\", reload: frame.reload, error: toWireError(error) });\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst operation: ChildOperation = { id: frame.reload, reload: undefined, state: \"loading\", cancelled: false };\n\t\t\tthis.#operation = operation;\n\t\t\tthis.#run(operation, connection, frame).catch((error: unknown) => this.#host.report(error));\n\t\t\treturn;\n\t\t}\n\t\tconst operation = this.#operation;\n\t\tif (operation === undefined || operation.id !== frame.reload) return;\n\t\tif (frame.t === \"abort\") {\n\t\t\tthis.#cancel(operation);\n\t\t\treturn;\n\t\t}\n\t\tif (operation.state !== \"prepared\") return;\n\t\tthis.#operation = undefined;\n\t\ttry {\n\t\t\toperation.reload?.commit();\n\t\t} finally {\n\t\t\tendReload(this.#host);\n\t\t}\n\t}\n\n\t/** The parent link died: nobody will commit, so roll back (now, or once pending work settles). */\n\tparentLost(): void {\n\t\tif (this.#operation !== undefined) this.#cancel(this.#operation);\n\t}\n\n\t#cancel(operation: ChildOperation): void {\n\t\toperation.cancelled = true;\n\t\tif (operation.state !== \"prepared\") {\n\t\t\t// Loading or preparing: make prepare fail now; #run unwinds when it settles.\n\t\t\toperation.reload?.rollback().catch((error: unknown) => this.#host.report(error));\n\t\t\treturn;\n\t\t}\n\t\tthis.#operation = undefined;\n\t\toperation.reload\n\t\t\t?.rollback()\n\t\t\t.catch((error: unknown) => this.#host.report(error))\n\t\t\t.finally(() => endReload(this.#host));\n\t}\n\n\tasync #run(\n\t\toperation: ChildOperation,\n\t\tconnection: Connection,\n\t\tframe: Extract<Frame, { t: \"prepare\" }>,\n\t): Promise<void> {\n\t\tconst cancelled = (): ChordError =>\n\t\t\tnew ChordError(\"aborted\", \"reload aborted by the server\", { reason: \"aborted\" });\n\t\ttry {\n\t\t\toperation.reload = await beginReload(this.#host, frame.plugins, frame.options, frame.codeVersion);\n\t\t\tif (operation.cancelled) throw cancelled();\n\t\t\toperation.state = \"preparing\";\n\t\t\tawait operation.reload.prepare();\n\t\t\tif (operation.cancelled) throw cancelled();\n\t\t\toperation.state = \"prepared\";\n\t\t\tconnection.send({ t: \"vote\", reload: frame.reload, report: operation.reload.summary() });\n\t\t} catch (error) {\n\t\t\tif (operation.reload !== undefined) {\n\t\t\t\tawait operation.reload.rollback().catch((cleanup: unknown) => this.#host.report(cleanup));\n\t\t\t\tendReload(this.#host);\n\t\t\t}\n\t\t\tif (this.#operation === operation) this.#operation = undefined;\n\t\t\tif (!operation.cancelled) connection.send({ t: \"vote\", reload: frame.reload, error: toWireError(error) });\n\t\t}\n\t}\n}\n"]}
|
package/dist/connection.d.ts
DELETED
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import { type Encoder } from "./delta/index.ts";
|
|
2
|
-
import type { HostImpl } from "./host.ts";
|
|
3
|
-
import { type Link } from "./link.ts";
|
|
4
|
-
import { RefImpl } from "./object.ts";
|
|
5
|
-
import type { RemoteBinding, RemoteChannel } from "./remote.ts";
|
|
6
|
-
import type { StateEvent } from "./types.ts";
|
|
7
|
-
import { type Frame, type RootRef } from "./wire.ts";
|
|
8
|
-
export interface LinkOptions {
|
|
9
|
-
/** Milliseconds between pings (default 15000). */
|
|
10
|
-
readonly pingInterval?: number;
|
|
11
|
-
/** Close the link when nothing arrived for this long (default 45000). Everything held through it is released. */
|
|
12
|
-
readonly pingTimeout?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Unacknowledged frame bytes (JSON text length) beyond which state frames wait for the peer (default 256 KiB). Only
|
|
15
|
-
* applies when both ends acknowledge frames and the link reports sizes; `Infinity` never holds state back.
|
|
16
|
-
*/
|
|
17
|
-
readonly window?: number;
|
|
18
|
-
/**
|
|
19
|
-
* Bytes of state ops that may wait for the peer on this link (default 4 windows). Beyond, the oldest waiting streams
|
|
20
|
-
* are replaced by their current value (a reset), so memory stays bounded however long the peer stalls.
|
|
21
|
-
*/
|
|
22
|
-
readonly pendingCap?: number;
|
|
23
|
-
/**
|
|
24
|
-
* The peer speaks another link protocol version (`peer`: undefined if it did not say): the link closes, and should
|
|
25
|
-
* not be reconnected with the same code. A browser reloads its page, for instance.
|
|
26
|
-
*/
|
|
27
|
-
readonly onProtocolMismatch?: (versions: {
|
|
28
|
-
readonly local: number;
|
|
29
|
-
readonly peer: number | undefined;
|
|
30
|
-
}) => void;
|
|
31
|
-
}
|
|
32
|
-
type StateFrame = Extract<Frame, {
|
|
33
|
-
t: "state";
|
|
34
|
-
}>;
|
|
35
|
-
/**
|
|
36
|
-
* How a waiting stream recovers when its ops must be dropped: the provider resends the current value as a reset at
|
|
37
|
-
* flush; a relay (which has no value) asks downstream for one.
|
|
38
|
-
*/
|
|
39
|
-
type Overflow = {
|
|
40
|
-
readonly resend: () => void;
|
|
41
|
-
} | {
|
|
42
|
-
readonly resync: () => void;
|
|
43
|
-
};
|
|
44
|
-
export interface AcceptOptions<P = unknown> extends LinkOptions {
|
|
45
|
-
/** The principal of whatever connects, from the app's authenticator. Every request on the link acts as it. */
|
|
46
|
-
readonly principal: P;
|
|
47
|
-
/**
|
|
48
|
-
* What the peer is, decided here and never by its `hello`: `client` (default; a browser: no roots, no code versions,
|
|
49
|
-
* not a reload participant, not addressable) or `host` (a child host; needs `name`).
|
|
50
|
-
*/
|
|
51
|
-
readonly kind?: "host" | "client";
|
|
52
|
-
/** A child host's name: its hello must match, and it is reachable `at` this name. */
|
|
53
|
-
readonly name?: string;
|
|
54
|
-
/** On `invalidatePrincipal`: a new principal keeps the link, `undefined` closes it (default: close). */
|
|
55
|
-
restamp?(principal: P): P | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* Calls the peer may have in progress on this link (default: no limit). Further ones never run: they are answered
|
|
58
|
-
* at once with `unavailable` (reason `too_many_calls`), and the link stays open.
|
|
59
|
-
*/
|
|
60
|
-
readonly maxCalls?: number;
|
|
61
|
-
}
|
|
62
|
-
export interface Peer {
|
|
63
|
-
readonly kind: "host" | "client";
|
|
64
|
-
/** Configured (downstream hosts) or announced by the trusted parent (upstream). */
|
|
65
|
-
readonly name: string | undefined;
|
|
66
|
-
}
|
|
67
|
-
/** A state member's stream to the consumer: its subscription and delta encoder. */
|
|
68
|
-
interface Feed {
|
|
69
|
-
unsubscribe: () => void;
|
|
70
|
-
encoder: Encoder;
|
|
71
|
-
/** Events that arrived while a unit or reset was being built (replayed after it is sent). */
|
|
72
|
-
buffer: StateEvent<unknown>[] | undefined;
|
|
73
|
-
}
|
|
74
|
-
/** A hold the peer made on this host and serves locally. */
|
|
75
|
-
interface ServedLocal {
|
|
76
|
-
readonly kind: "local";
|
|
77
|
-
readonly id: number;
|
|
78
|
-
readonly ref: RefImpl;
|
|
79
|
-
readonly principal: unknown;
|
|
80
|
-
/** The client connection it comes from (see `Frame` hold `origin`); undefined for a host's own holds. */
|
|
81
|
-
readonly origin: string | undefined;
|
|
82
|
-
/** The consumer wants state (hold without `state: false`, or `sub`). */
|
|
83
|
-
wantsState: boolean;
|
|
84
|
-
/** The consumer had values before (re-hold): its first unit waits for the window like any other. */
|
|
85
|
-
readonly again: boolean;
|
|
86
|
-
/** A unit was sent. */
|
|
87
|
-
unitSent: boolean;
|
|
88
|
-
/** The members whose snapshot the consumer has, with their streams. */
|
|
89
|
-
readonly feeds: Map<string, Feed>;
|
|
90
|
-
}
|
|
91
|
-
/** A hold the peer made on this host: served locally or relayed to another link. */
|
|
92
|
-
type Served = ServedLocal | {
|
|
93
|
-
readonly kind: "relay";
|
|
94
|
-
readonly relay: RelayRef;
|
|
95
|
-
};
|
|
96
|
-
type Pending = {
|
|
97
|
-
readonly resolve: (value: unknown) => void;
|
|
98
|
-
readonly reject: (error: unknown) => void;
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* A hold relayed from an origin link to a downstream link. It owns everything done through it: state and calls queued
|
|
102
|
-
* while the route resolves, and the downstream twins once forwarded. `close` undoes all of it exactly once (cancels
|
|
103
|
-
* calls downstream, drops what waits for the origin, releases the downstream hold, rejects waiters).
|
|
104
|
-
*/
|
|
105
|
-
export declare class RelayRef {
|
|
106
|
-
#private;
|
|
107
|
-
readonly origin: Connection;
|
|
108
|
-
readonly frame: Extract<Frame, {
|
|
109
|
-
t: "hold";
|
|
110
|
-
}>;
|
|
111
|
-
readonly principal: unknown;
|
|
112
|
-
/** The client connection the hold comes from (forwarded downstream); undefined for a host's own holds. */
|
|
113
|
-
readonly originTag: string | undefined;
|
|
114
|
-
/** The origin's authorization generation when the hold arrived; a revocation bumps it. */
|
|
115
|
-
readonly generation: number;
|
|
116
|
-
down: Connection | undefined;
|
|
117
|
-
downId: number;
|
|
118
|
-
closed: boolean;
|
|
119
|
-
/** The origin wants state (forwarded as `state: false`, `sub`, `unsub`). */
|
|
120
|
-
stateWanted: boolean;
|
|
121
|
-
/** The members of the first unit, still to forward past the origin's window. */
|
|
122
|
-
urgent: Set<string> | undefined;
|
|
123
|
-
/** Members whose ops this relay dropped: downstream ops are ignored until their reset arrives. */
|
|
124
|
-
readonly awaiting: Set<string>;
|
|
125
|
-
readonly calls: Map<number, RelayCall>;
|
|
126
|
-
constructor(origin: Connection, frame: Extract<Frame, {
|
|
127
|
-
t: "hold";
|
|
128
|
-
}>, principal: unknown, originTag: string | undefined);
|
|
129
|
-
get originId(): number;
|
|
130
|
-
get client(): boolean;
|
|
131
|
-
/** Still authorized as it was when it arrived. */
|
|
132
|
-
get current(): boolean;
|
|
133
|
-
/** The downstream connection once the route resolved; rejects if the relay closes first. */
|
|
134
|
-
ready(): Promise<Connection>;
|
|
135
|
-
/** Forwards the hold to `down`. */
|
|
136
|
-
open(down: Connection): void;
|
|
137
|
-
/** The origin starts or stops the hold's state. */
|
|
138
|
-
wantState(wanted: boolean): void;
|
|
139
|
-
/**
|
|
140
|
-
* The origin could not keep up and dropped what waited for member `m` (or asked for it again): ask downstream for a
|
|
141
|
-
* reset, and ignore its ops until the reset arrives.
|
|
142
|
-
*/
|
|
143
|
-
resync(m: string): void;
|
|
144
|
-
/** A shape from downstream: forwarded at once; the members of the first unit then skip the origin's window. */
|
|
145
|
-
shape(frame: Extract<Frame, {
|
|
146
|
-
t: "shape";
|
|
147
|
-
}>): void;
|
|
148
|
-
/** A state frame from downstream. */
|
|
149
|
-
state(frame: StateFrame): void;
|
|
150
|
-
/**
|
|
151
|
-
* Closes the relay. `releaseDown`: the downstream hold is still there (origin released, disconnected, or was
|
|
152
|
-
* revoked): cancel its calls and release it. `notify`: tell the origin the hold is gone.
|
|
153
|
-
*/
|
|
154
|
-
close(error: unknown, options: {
|
|
155
|
-
readonly releaseDown: boolean;
|
|
156
|
-
readonly notify: boolean;
|
|
157
|
-
}): void;
|
|
158
|
-
}
|
|
159
|
-
/** One relayed call: settles once, by result, cancellation or the relay closing; removes both mappings. */
|
|
160
|
-
export declare class RelayCall {
|
|
161
|
-
#private;
|
|
162
|
-
readonly relay: RelayRef;
|
|
163
|
-
readonly originId: number;
|
|
164
|
-
readonly downId: number;
|
|
165
|
-
constructor(relay: RelayRef, originId: number, downId: number, pending: Pending);
|
|
166
|
-
finish(error: unknown, value?: unknown): void;
|
|
167
|
-
/** Cancels downstream (when the downstream hold still exists) and settles with `error`. */
|
|
168
|
-
cancel(error: unknown, forward: boolean): void;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* One end of a link on a host: consumer of remote references, provider for the peer's holds, and relay.
|
|
172
|
-
*
|
|
173
|
-
* State
|
|
174
|
-
* -----
|
|
175
|
-
*
|
|
176
|
-
* A hold implies the state of its variant (unless it says `state: false`). The provider answers with a unit: the shape,
|
|
177
|
-
* then a snapshot of each state member the consumer does not have yet (`shape.state` lists them), then the members'
|
|
178
|
-
* ops and resets. A reload or a variant change sends another unit with the members that are new; members that left the
|
|
179
|
-
* variant stop. The consumer applies a shape once its snapshots are here (`RemoteBinding`).
|
|
180
|
-
*
|
|
181
|
-
* Flow control
|
|
182
|
-
* ------------
|
|
183
|
-
*
|
|
184
|
-
* Problem: state is pushed as fast as it changes, but a peer may read slowly (a phone behind a relay), and a relay may
|
|
185
|
-
* hide that: Cloudflare forwards to browsers without backpressure. Everything sent then queues in front of the next
|
|
186
|
-
* call result. Example: a browser opens three long transcripts (500 KiB of snapshots each) over a 5 Mbit/s path; a
|
|
187
|
-
* result sent next waits 2.4 s, and the snapshot of a transcript the user already left is still sent in full.
|
|
188
|
-
*
|
|
189
|
-
* Solution: the peer acknowledges what it processed (`ack`, a cumulative frame count), and the sender counts the sizes
|
|
190
|
-
* of the frames not yet acknowledged. While they exceed the window, state waits here in slots, flushed in creation
|
|
191
|
-
* order as acknowledgements come:
|
|
192
|
-
* - a member's stream has one slot: ops are appended (encoded batches of one stream may be concatenated, see
|
|
193
|
-
* `encoder`), a snapshot, reset or error replaces it;
|
|
194
|
-
* - a hold's unit has one slot, built lazily from the current values when it is sent, so a newer unit merges into it;
|
|
195
|
-
* while it waits, the members it introduces have no stream yet.
|
|
196
|
-
*
|
|
197
|
-
* The first unit of a hold that is not a re-hold (`again`) is sent at once, past the window: a `get` waits for it, and
|
|
198
|
-
* must not wait behind other holds' state. Results, shapes, gone, reload control and pings are sent at once too: they
|
|
199
|
-
* are bounded by the requests the peer makes. Hence the one ordering exception of a link: while state waits, a result
|
|
200
|
-
* can arrive before state changes made before it. Frames of one stream stay in order.
|
|
201
|
-
*
|
|
202
|
-
* Waiting ops are capped per link (`pendingCap`): beyond, the oldest streams are replaced by their current value (a
|
|
203
|
-
* reset built at flush), or, on a relay, by a reset asked of the provider (`resync`), so memory stays bounded however
|
|
204
|
-
* long the peer stalls. The window bounds what is unacknowledged when a frame is sent, so one frame (a large snapshot)
|
|
205
|
-
* may exceed it. Both hellos must announce `acks`; with an older peer nothing is acknowledged and nothing waits. Links
|
|
206
|
-
* that do not report sizes (IPC) never fill the window.
|
|
207
|
-
*/
|
|
208
|
-
export declare class Connection implements RemoteChannel {
|
|
209
|
-
#private;
|
|
210
|
-
readonly host: HostImpl;
|
|
211
|
-
readonly link: Link;
|
|
212
|
-
/** `upstream`: the link to this host's parent. `downstream`: a link this host accepted. */
|
|
213
|
-
readonly role: "upstream" | "downstream";
|
|
214
|
-
readonly peer: Peer;
|
|
215
|
-
/** A client connection's opaque id: holds that come over it (directly or relayed) carry it as their `origin`. */
|
|
216
|
-
readonly originId: string | undefined;
|
|
217
|
-
principal: unknown;
|
|
218
|
-
readonly restamp: ((principal: unknown) => unknown | undefined) | undefined;
|
|
219
|
-
/** Bumped when the stamped principal is revoked or re-stamped: relays from before are refused. */
|
|
220
|
-
generation: number;
|
|
221
|
-
/** The code version a downstream host peer runs (from its hello, then from commits). */
|
|
222
|
-
peerCodeVersion: number | undefined;
|
|
223
|
-
/** A downstream host peer is usable once it runs this host's current code version (see `HostImpl.peerHello`). */
|
|
224
|
-
synced: boolean;
|
|
225
|
-
/** Code versions this child announced while behind this host (fenced): this host never ran them. */
|
|
226
|
-
readonly fencedCodeVersions: Set<number>;
|
|
227
|
-
readonly remotes: Map<number, RemoteBinding>;
|
|
228
|
-
readonly calls: Map<number, Pending>;
|
|
229
|
-
readonly served: Map<number, Served>;
|
|
230
|
-
readonly incoming: Map<number, AbortController>;
|
|
231
|
-
readonly relayedRefs: Map<number, RelayRef>;
|
|
232
|
-
readonly relayedCalls: Map<number, RelayCall>;
|
|
233
|
-
/** Reload votes awaited from this (child) peer. */
|
|
234
|
-
readonly votes: Map<number, Pending>;
|
|
235
|
-
constructor(host: HostImpl, link: Link, config: {
|
|
236
|
-
readonly role: "upstream" | "downstream";
|
|
237
|
-
readonly principal: unknown;
|
|
238
|
-
readonly peer: Peer;
|
|
239
|
-
readonly originId?: string;
|
|
240
|
-
readonly restamp?: (principal: unknown) => unknown | undefined;
|
|
241
|
-
readonly maxCalls?: number;
|
|
242
|
-
} & LinkOptions);
|
|
243
|
-
get open(): boolean;
|
|
244
|
-
/** The peer's name: configured for downstream hosts, announced by the parent upstream. */
|
|
245
|
-
get name(): string | undefined;
|
|
246
|
-
send(frame: Frame): void;
|
|
247
|
-
/** Sends a state frame, or keeps it waiting (see the class comment). */
|
|
248
|
-
sendState(frame: StateFrame, overflow: Overflow): void;
|
|
249
|
-
/** Forgets what waits for a stream that ended. */
|
|
250
|
-
dropState(hold: number, m: string): void;
|
|
251
|
-
/** Forgets everything that waits for a hold (released, closed, or its state stopped). */
|
|
252
|
-
dropHoldState(hold: number): void;
|
|
253
|
-
/** What waits for the peer: slots and bytes of ops (for tests and diagnostics). */
|
|
254
|
-
get waiting(): {
|
|
255
|
-
readonly slots: number;
|
|
256
|
-
readonly bytes: number;
|
|
257
|
-
};
|
|
258
|
-
nextId(): number;
|
|
259
|
-
/** Resolves once the peer is usable (a host peer runs this host's code version); rejects if the link closes first. */
|
|
260
|
-
whenSynced(): Promise<void>;
|
|
261
|
-
markSynced(codeVersion: number): void;
|
|
262
|
-
/** Revokes the stamped principal: relays made under it close at once (also those still resolving a route). */
|
|
263
|
-
revoke(next: unknown | undefined): void;
|
|
264
|
-
hold(binding: RemoteBinding, again: boolean): number;
|
|
265
|
-
release(id: number): void;
|
|
266
|
-
wantState(hold: number, wanted: boolean): void;
|
|
267
|
-
call(hold: number, member: string, args: unknown, root: RootRef | undefined, signal: AbortSignal): Promise<unknown>;
|
|
268
|
-
}
|
|
269
|
-
export {};
|
|
270
|
-
//# sourceMappingURL=connection.d.ts.map
|
package/dist/connection.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAW,MAAM,kBAAkB,CAAC;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,IAAI,EAAkB,MAAM,WAAW,CAAC;AACtD,OAAO,EAAgB,OAAO,EAAa,MAAM,aAAa,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE,OAAO,KAAK,EAAwB,UAAU,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,KAAK,KAAK,EAA4C,KAAK,OAAO,EAAe,MAAM,WAAW,CAAC;AAE5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