@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
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
// A hold arriving on a link and served here (§7, §22, W1): where it goes once the host published (waiting in the
|
|
2
|
+
// unbound index until then), why it is unbound (refused: kept in the index while it waits for a name, dependency
|
|
3
|
+
// model §1), the object it keeps, the notices of its object's failures and new attempts, the snapshot and subscription
|
|
4
|
+
// taken in one synchronous step when a slot of the window is free, and the ops of its members per batch (sent at
|
|
5
|
+
// once, or pending while the window is full), each member with its own Delta encoder. Across a reload a bound hold is
|
|
6
|
+
// kept while its object shows it live (a restart's open old attempt that binds its version, decision "Reload restarts
|
|
7
|
+
// every affected object"), then unbound (`loading` or `failed`, then a fresh `bound`; a `loading` one keeps its calls
|
|
8
|
+
// in flight and takes more by its old names); a version no longer bound or a removed type leaves it waiting unbound. A
|
|
9
|
+
// hold of an older version follows its object's adapted members (Q10).
|
|
10
|
+
import { variantNames, variantOrder, variantsAt } from "../contracts/internal.js";
|
|
11
|
+
import { ChordError, isChordError } from "../data/index.js";
|
|
12
|
+
import { asChordError } from "../data/internal.js";
|
|
13
|
+
import { encoder, PendingOps } from "../delta/index.js";
|
|
14
|
+
import { retryWalk, } from "../host/internal.js";
|
|
15
|
+
import { jsonPart, NO_RETIRED, oversized, parsePart, wireError, } from "../link/internal.js";
|
|
16
|
+
import { Source } from "../state/internal.js";
|
|
17
|
+
import { chordMetrics } from "../telemetry.js";
|
|
18
|
+
import { RelayedHold } from "./relay.js";
|
|
19
|
+
const PENDING = { kind: "pending" };
|
|
20
|
+
const BINDING = { kind: "binding" };
|
|
21
|
+
/**
|
|
22
|
+
* One hold served here: a reference to its object acting as its caller (the hold's principal). While pending, each
|
|
23
|
+
* failure of its object is sent as `failed` (with the rest of its backoff window) and the next attempt as `loading`; a
|
|
24
|
+
* hold that cannot be taken holds nothing: `failed { waiting }` (not served, another version) until a publication
|
|
25
|
+
* re-runs its start, `failed { broken }` (invalid params, a cycle) until a `retry` does. Once live it binds when its
|
|
26
|
+
* link's window has a slot, then sends a part per batch that changed its members (or keeps their ops pending while the
|
|
27
|
+
* window is full), and `gone` when its object ends. It counts as one of the host's references from its arrival to its
|
|
28
|
+
* end, bound or not.
|
|
29
|
+
*/
|
|
30
|
+
export class Hold {
|
|
31
|
+
kind = "served";
|
|
32
|
+
id;
|
|
33
|
+
/** A hold is declared by no object on this host. */
|
|
34
|
+
dependent = undefined;
|
|
35
|
+
/** Presence lists show every hold. */
|
|
36
|
+
listed = true;
|
|
37
|
+
/** Whom the hold acts for: its calls run as it, with its origin's incarnation. */
|
|
38
|
+
caller;
|
|
39
|
+
/** The limits per part of its params and its calls' arguments: its link's, the decoded one smaller when stamped (Q2). */
|
|
40
|
+
limits;
|
|
41
|
+
#provider;
|
|
42
|
+
#state = PENDING;
|
|
43
|
+
/** What it asks for (its params owned), once it started: it is placed again after a reload left it unbound. */
|
|
44
|
+
#request;
|
|
45
|
+
/** The held object, from its binding until the hold is released. */
|
|
46
|
+
#object;
|
|
47
|
+
/** The members the current batch changed, with their ops, in order. */
|
|
48
|
+
#changes = [];
|
|
49
|
+
/** The members that failed since the last message that carried this hold. */
|
|
50
|
+
#failed = [];
|
|
51
|
+
/** The members whose document was retired since the last message that carried this hold (ORed while it waits). */
|
|
52
|
+
#retired = NO_RETIRED;
|
|
53
|
+
#touched = false;
|
|
54
|
+
/** Whether the hold counts as one of the host's references (`host.activity`): from its arrival until it ends. */
|
|
55
|
+
#counted = true;
|
|
56
|
+
constructor(id, provider, caller, limits) {
|
|
57
|
+
this.id = id;
|
|
58
|
+
this.#provider = provider;
|
|
59
|
+
this.caller = caller;
|
|
60
|
+
this.limits = limits;
|
|
61
|
+
provider.link.host.count("references", 1);
|
|
62
|
+
provider.link.host.metrics.upDownCounter("chord.holds.active").add(1);
|
|
63
|
+
}
|
|
64
|
+
/** Whether the hold is bound: its members' changes are sent. */
|
|
65
|
+
get bound() {
|
|
66
|
+
return this.#state.kind === "bound";
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Whether calls on it reach its object: bound, or by the names it was bound with while it rebinds (after a `loading`
|
|
70
|
+
* unbind: its fresh `bound` not sent yet).
|
|
71
|
+
*/
|
|
72
|
+
get callable() {
|
|
73
|
+
return this.#names() !== undefined;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* What a call it does not take is refused with: the failure its consumer was told (refused, or failed while pending:
|
|
77
|
+
* the call crossed that `failed` on the wire, and its consumer shows that cause), else `not_ready` (not bound yet).
|
|
78
|
+
*/
|
|
79
|
+
get refusal() {
|
|
80
|
+
const state = this.#state;
|
|
81
|
+
if (state.kind === "refused")
|
|
82
|
+
return state.cause.error;
|
|
83
|
+
if (state.kind === "pending" && state.told !== undefined)
|
|
84
|
+
return state.told;
|
|
85
|
+
return new ChordError({ code: "not_ready", message: `hold ${this.id}: not bound yet` });
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The names its calls are decoded by: its binding's (its previous ones until its consumer acknowledged the `bound`
|
|
89
|
+
* that brought them: another variant's indexes name other methods), or the ones it was bound with while it rebinds.
|
|
90
|
+
*/
|
|
91
|
+
#names() {
|
|
92
|
+
const state = this.#state;
|
|
93
|
+
if (state.kind === "bound") {
|
|
94
|
+
const { previous } = state;
|
|
95
|
+
return previous !== undefined && !this.#provider.acknowledged(previous.until) ? previous : state;
|
|
96
|
+
}
|
|
97
|
+
return state.kind === "pending" || state.kind === "binding" ? state.previous : undefined;
|
|
98
|
+
}
|
|
99
|
+
/** Whom it acts for (the unbound index's revocation). */
|
|
100
|
+
get principal() {
|
|
101
|
+
return this.caller.principal;
|
|
102
|
+
}
|
|
103
|
+
/** Its consumer's contract version and fingerprint (its request's): the provider binds them or it waits. */
|
|
104
|
+
get contract() {
|
|
105
|
+
return this.#request;
|
|
106
|
+
}
|
|
107
|
+
/** Whether the hold holds no object: before the publication, or refused (revocation ends it, §4). */
|
|
108
|
+
get unbound() {
|
|
109
|
+
return this.#object === undefined && this.#state.kind !== "released";
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Admits the hold: before the host's publication it waits in the unbound index, placed by the publication.
|
|
113
|
+
* Then its params within the link's part limit (`too_large/part`), then relayed (it is replaced by a relayed hold),
|
|
114
|
+
* or served here, its params opened and parsed (a malformed part is a protocol error), its object taken and followed
|
|
115
|
+
* (`moved`) in the turn it arrived. A hold that cannot be served here waits refused (`#refuse`).
|
|
116
|
+
*/
|
|
117
|
+
start(request) {
|
|
118
|
+
const { link } = this.#provider;
|
|
119
|
+
if (!link.host.published) {
|
|
120
|
+
this.#state = { kind: "unplaced", request: owned(request) };
|
|
121
|
+
link.host.index(request.type, this, undefined);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
let served;
|
|
125
|
+
try {
|
|
126
|
+
const oversize = oversized(request.params, link.limits.part);
|
|
127
|
+
if (oversize !== undefined)
|
|
128
|
+
throw oversize;
|
|
129
|
+
const placed = link.host.place(request, link, this.caller, link.context);
|
|
130
|
+
if (placed.kind === "path") {
|
|
131
|
+
// Counted where it is served: a relayed hold is not this host's reference.
|
|
132
|
+
this.drop();
|
|
133
|
+
new RelayedHold(this.id, this.#provider, request, this.caller, placed.path).start();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
let params;
|
|
137
|
+
try {
|
|
138
|
+
params = parsePart(link.openPart(request.params, this.limits, link.context));
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
// Past its limits: the hold's \`too_large/part\`. No JSON: a protocol error, reported, and the link closes.
|
|
142
|
+
if (isChordError(error, "too_large"))
|
|
143
|
+
throw error;
|
|
144
|
+
link.host.report({ kind: "protocol_error", error });
|
|
145
|
+
link.close();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
served = link.host.serving(request, params, this.caller.principal, link.context);
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
this.#refuse(request, { kind: "broken", error: asChordError(error, request.type) });
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (served.kind === "waiting") {
|
|
155
|
+
this.#refuse(request, served.cause);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this.#request = owned(request);
|
|
159
|
+
const { object } = served;
|
|
160
|
+
this.#object = object;
|
|
161
|
+
object.hold(this);
|
|
162
|
+
this.moved();
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Woken by the unbound index (out of it already): before the publication, placed now; refused `waiting`, its start
|
|
166
|
+
* runs again, announced with `loading` (then `bound` or `failed`).
|
|
167
|
+
*/
|
|
168
|
+
wake() {
|
|
169
|
+
const state = this.#state;
|
|
170
|
+
if (state.kind === "unplaced") {
|
|
171
|
+
this.#state = PENDING;
|
|
172
|
+
this.start(state.request);
|
|
173
|
+
}
|
|
174
|
+
else if (state.kind === "refused") {
|
|
175
|
+
this.#restart(state.request);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The object's state changed, or the hold took it: a pending hold binds once its object shows it live (when a slot
|
|
180
|
+
* is free), sends each failure, and announces the attempt after a failure with `loading`. A bound hold (or one whose
|
|
181
|
+
* `bound` waits for a slot) whose object no longer shows it live goes back to pending (slice 7b §6).
|
|
182
|
+
*/
|
|
183
|
+
moved() {
|
|
184
|
+
const current = this.#state;
|
|
185
|
+
const object = this.#object;
|
|
186
|
+
if (object === undefined)
|
|
187
|
+
return;
|
|
188
|
+
if (current.kind === "bound" || current.kind === "binding") {
|
|
189
|
+
const shown = this.#shown(object);
|
|
190
|
+
if (shown.kind === "live")
|
|
191
|
+
return;
|
|
192
|
+
// Its instance still changes (a live failure's admitted commits, a restart's old attempt draining): it follows it
|
|
193
|
+
// on until it stopped (decision "References are the only indirection").
|
|
194
|
+
if (current.kind === "bound" && object.attachable === current.instance)
|
|
195
|
+
return;
|
|
196
|
+
this.#unbind(shown.kind === "failed" ? shown.cause.error : undefined);
|
|
197
|
+
}
|
|
198
|
+
this.#pending(object);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* What its object shows to its version and fingerprint: `live` also while a restart's open old attempt binds them
|
|
202
|
+
* (decision "Reload restarts every affected object", rule 5).
|
|
203
|
+
*/
|
|
204
|
+
#shown(object) {
|
|
205
|
+
const { version, fingerprint } = this.contract;
|
|
206
|
+
return object.stateFor(version, fingerprint);
|
|
207
|
+
}
|
|
208
|
+
/** Member `followed` failed with `error`: its failure waits to be sent, replacing one still waiting. */
|
|
209
|
+
#memberFailed(followed, error) {
|
|
210
|
+
followed.pending.take();
|
|
211
|
+
const failure = { member: followed.index, error: wireError(error) };
|
|
212
|
+
const at = this.#failed.findIndex(({ member }) => member === followed.index);
|
|
213
|
+
// A new list when one is replaced (rare): a list handed to an entry is never written to.
|
|
214
|
+
if (at === -1)
|
|
215
|
+
this.#failed.push(failure);
|
|
216
|
+
else
|
|
217
|
+
this.#failed = this.#failed.map((pending, i) => (i === at ? failure : pending));
|
|
218
|
+
}
|
|
219
|
+
/** Member `index` has a value again: a failure of it still waiting to be sent (rare) is not sent. */
|
|
220
|
+
#memberHealed(index) {
|
|
221
|
+
if (this.#failed.length > 0)
|
|
222
|
+
this.#failed = this.#failed.filter(({ member }) => member !== index);
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Its object no longer shows it live (a restart, a live failure): no longer subscribed or waiting for a slot,
|
|
226
|
+
* pending again. With `error` (a failure, sent by `#pending`, which a consumer applies to a bound hold as a rebinding
|
|
227
|
+
* too, model §5) its calls in flight are rejected. Without (`loading`, which tells the consumer it rebinds) they stay,
|
|
228
|
+
* and calls by the names it was bound with keep arriving (sent before its consumer learnt of the `loading`): each gets
|
|
229
|
+
* exactly one answer from what it waits on, the instance it already runs on (its result, or `released` at the seal)
|
|
230
|
+
* or its object's gate (the new instance's result, its failure, `park_timeout`, its end), design §22.
|
|
231
|
+
*/
|
|
232
|
+
#unbind(error) {
|
|
233
|
+
const previous = this.#names();
|
|
234
|
+
const state = this.#state;
|
|
235
|
+
if (state.kind === "bound")
|
|
236
|
+
unfollow(state);
|
|
237
|
+
this.#changes = [];
|
|
238
|
+
this.#failed = [];
|
|
239
|
+
this.#retired = NO_RETIRED;
|
|
240
|
+
this.#touched = false;
|
|
241
|
+
if (error !== undefined) {
|
|
242
|
+
this.#provider.unbound(this, error);
|
|
243
|
+
this.#state = PENDING;
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
this.#provider.unbind(this);
|
|
247
|
+
this.#state =
|
|
248
|
+
previous === undefined
|
|
249
|
+
? PENDING
|
|
250
|
+
: { kind: "pending", previous: { variant: previous.variant, names: previous.names } };
|
|
251
|
+
this.#provider.send({ kind: "loading", hold: this.id });
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* A `retry` message with `hops` left of its budget: the object is asked for an attempt now (it ignores this unless
|
|
255
|
+
* failed; parked, it passes it on, to other hosts with one hop less); a refused hold is started again (a route's
|
|
256
|
+
* `authorize` may admit it now).
|
|
257
|
+
*/
|
|
258
|
+
retry({ hops }) {
|
|
259
|
+
const state = this.#state;
|
|
260
|
+
if (state.kind !== "refused") {
|
|
261
|
+
this.#object?.retry(retryWalk(hops - 1));
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (state.cause.kind === "waiting")
|
|
265
|
+
this.#provider.link.host.unindex(state.request.type, this);
|
|
266
|
+
this.#restart(state.request);
|
|
267
|
+
}
|
|
268
|
+
/** The pending hold's part of `moved`: binds once live, sends each failure, announces the next attempt. */
|
|
269
|
+
#pending(object) {
|
|
270
|
+
const current = this.#state;
|
|
271
|
+
if (current.kind !== "pending")
|
|
272
|
+
return;
|
|
273
|
+
const state = this.#shown(object);
|
|
274
|
+
if (state.kind === "live") {
|
|
275
|
+
// Calls by the names it was bound with are still answered until the fresh `bound` is sent.
|
|
276
|
+
this.#state = current.previous === undefined ? BINDING : { kind: "binding", previous: current.previous };
|
|
277
|
+
this.#provider.bind(this, this.#provider.link.context);
|
|
278
|
+
}
|
|
279
|
+
else if (state.kind === "failed") {
|
|
280
|
+
// Each failure and each new cause (a parked object's blocker changed) is a message of its own.
|
|
281
|
+
const { cause, retryAt } = state;
|
|
282
|
+
const retryIn = retryAt === undefined ? {} : { retryIn: Math.max(0, retryAt - Date.now()) };
|
|
283
|
+
const failed = { kind: cause.kind, error: wireError(cause.error) };
|
|
284
|
+
this.#provider.send({ kind: "failed", hold: this.id, cause: failed, ...retryIn });
|
|
285
|
+
// Told a failure, its consumer rejects what it still waits on: calls by the old names are not taken any more.
|
|
286
|
+
this.#state = { kind: "pending", told: cause.error };
|
|
287
|
+
}
|
|
288
|
+
else if (state.kind === "loading" && current.told !== undefined) {
|
|
289
|
+
this.#provider.send({ kind: "loading", hold: this.id });
|
|
290
|
+
this.#state = PENDING;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/** Starts a refused hold again, announced with `loading`. */
|
|
294
|
+
#restart(request) {
|
|
295
|
+
this.#state = PENDING;
|
|
296
|
+
this.#provider.send({ kind: "loading", hold: this.id });
|
|
297
|
+
this.start(request);
|
|
298
|
+
}
|
|
299
|
+
/** Calls a method of the held object as the hold's caller, its span under `parent` (the call's carrier, extracted). */
|
|
300
|
+
call(method, args, parent, context) {
|
|
301
|
+
return this.#object.call(method, args, context, this.caller, this.contract.version, parent);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* The method at `index` of the bound variant (while it rebinds, of the names its consumer still has: its object answers
|
|
305
|
+
* by name) and whether its result carries byte segments (its schema has a `bytes()` leaf). Throws on an index outside
|
|
306
|
+
* the variant (a protocol error); a hold that is not callable has none.
|
|
307
|
+
*/
|
|
308
|
+
method(index) {
|
|
309
|
+
const bound = this.#names();
|
|
310
|
+
const name = bound?.names.methods[index];
|
|
311
|
+
if (name === undefined)
|
|
312
|
+
throw new Error(`hold ${this.id}: no method ${index}`);
|
|
313
|
+
return { name, resultBytes: bound.variant.methods.get(name).result.bytes };
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* The hold's binding, sent when a slot is free. The snapshot of every member, as a value or failed, and the
|
|
317
|
+
* subscription are taken in this synchronous step (race 2), so each member's next ops continue exactly from it.
|
|
318
|
+
* Names travel as indexes into the bound version (2b). Counts one encode (`chord.link.encodes`).
|
|
319
|
+
*/
|
|
320
|
+
boundEntry(context) {
|
|
321
|
+
const object = this.#object;
|
|
322
|
+
// It binds the instance its object shows it (`#shown` live): the live one, or a restart's open old attempt; the
|
|
323
|
+
// object tells its holds at that attempt's seal (`moved`), so a hold waiting for a slot never binds it later.
|
|
324
|
+
const instance = object.instance;
|
|
325
|
+
const { contract } = instance.served;
|
|
326
|
+
const state = this.#bindTo(instance);
|
|
327
|
+
const members = [];
|
|
328
|
+
const failed = [];
|
|
329
|
+
const { version } = this.contract;
|
|
330
|
+
const current = version === contract.version;
|
|
331
|
+
for (const [index, member] of state.names.state.entries()) {
|
|
332
|
+
// An older version's members are its instance's mapping (its refusals unbound it before: `ChordObject`).
|
|
333
|
+
const source = current ? object.stateMembers.get(member) : object.liveMember(member, version);
|
|
334
|
+
let value;
|
|
335
|
+
try {
|
|
336
|
+
value = source.value;
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
// A failed member (a derive whose compute throws) is followed: it recovers with a root replacement.
|
|
340
|
+
failed.push({ member: index, error: wireError(error) });
|
|
341
|
+
if (source instanceof Source)
|
|
342
|
+
this.#follow(state, index, source);
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
try {
|
|
346
|
+
members.push({ member: index, value: this.#provider.link.part(jsonPart(value), context) });
|
|
347
|
+
}
|
|
348
|
+
catch (error) {
|
|
349
|
+
// A value past the link's limits: failed for this hold, which takes no more of it.
|
|
350
|
+
failed.push({ member: index, error: wireError(error) });
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
// A constant never changes: nothing to follow.
|
|
354
|
+
if (source instanceof Source)
|
|
355
|
+
this.#follow(state, index, source);
|
|
356
|
+
}
|
|
357
|
+
this.#changes = [];
|
|
358
|
+
this.#failed = [];
|
|
359
|
+
this.#retired = NO_RETIRED;
|
|
360
|
+
chordMetrics(context.telemetry.metrics).counter("chord.link.encodes").add(1);
|
|
361
|
+
return { hold: this.id, variant: variantOrder(contract).indexOf(instance.variant), members, failed };
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* This batch's entry of the `state` message: the members it changed with their ops, each encoded once with its
|
|
365
|
+
* member's encoder, and the members that failed; resets both. Counts one encode per hold (`chord.link.encodes`).
|
|
366
|
+
*/
|
|
367
|
+
entry(context) {
|
|
368
|
+
const { link } = this.#provider;
|
|
369
|
+
const members = this.#take().map(([{ index, encoder }, ops]) => ({
|
|
370
|
+
member: index,
|
|
371
|
+
ops: link.part(jsonPart(encoder.encode(ops)), context),
|
|
372
|
+
}));
|
|
373
|
+
return this.#entry(members, context);
|
|
374
|
+
}
|
|
375
|
+
/** The window is full: this batch's ops join the members' pending queues (raw, never mutated). */
|
|
376
|
+
queue() {
|
|
377
|
+
for (const [{ pending }, ops] of this.#take())
|
|
378
|
+
pending.push(ops);
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* The entry of a freed slot's `state` message: each member's pending ops encoded once, or `[["r", value]]` after an
|
|
382
|
+
* overflow, all reflecting the latest commit; and the members that failed meanwhile. Counts one encode per hold.
|
|
383
|
+
*/
|
|
384
|
+
pendingEntry(context) {
|
|
385
|
+
const { link } = this.#provider;
|
|
386
|
+
const members = [];
|
|
387
|
+
// Only a bound hold has pending ops.
|
|
388
|
+
for (const { index, source, encoder, pending } of this.#state.followed) {
|
|
389
|
+
if (pending.size === 0)
|
|
390
|
+
continue;
|
|
391
|
+
const taken = pending.take();
|
|
392
|
+
const ops = taken.kind === "replace" ? [["r", source.value]] : taken.ops;
|
|
393
|
+
if (ops.length > 0)
|
|
394
|
+
members.push({ member: index, ops: link.part(jsonPart(encoder.encode(ops)), context) });
|
|
395
|
+
}
|
|
396
|
+
return this.#entry(members, context);
|
|
397
|
+
}
|
|
398
|
+
/** The consumer released the hold, or its link closed: its waits stop and its object loses this reference. */
|
|
399
|
+
release() {
|
|
400
|
+
this.drop();
|
|
401
|
+
this.#object?.unhold(this);
|
|
402
|
+
this.#object = undefined;
|
|
403
|
+
}
|
|
404
|
+
/** Ends the hold without releasing its object (the host closes and ends its objects itself). */
|
|
405
|
+
drop() {
|
|
406
|
+
const state = this.#state;
|
|
407
|
+
const { host } = this.#provider.link;
|
|
408
|
+
if (state.kind === "bound") {
|
|
409
|
+
unfollow(state);
|
|
410
|
+
}
|
|
411
|
+
else if (state.kind === "unplaced" || (state.kind === "refused" && state.cause.kind === "waiting")) {
|
|
412
|
+
host.unindex(state.request.type, this);
|
|
413
|
+
}
|
|
414
|
+
this.#state = { kind: "released" };
|
|
415
|
+
if (this.#counted) {
|
|
416
|
+
host.count("references", -1);
|
|
417
|
+
host.metrics.upDownCounter("chord.holds.active").add(-1);
|
|
418
|
+
}
|
|
419
|
+
this.#counted = false;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* The object ended while held (revocation; a reload, slice 7b), or the hold was revoked (or its host closed) while it
|
|
423
|
+
* held no object: the hold sends `gone` with `error`.
|
|
424
|
+
*/
|
|
425
|
+
end(error) {
|
|
426
|
+
if (this.#state.kind === "released")
|
|
427
|
+
return;
|
|
428
|
+
this.#provider.forget(this, error);
|
|
429
|
+
this.drop();
|
|
430
|
+
this.#object = undefined;
|
|
431
|
+
this.#provider.send({ kind: "gone", hold: this.id, error: wireError(error) });
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* The binding: its variant and names at the hold's version, with no member followed yet, and the names its consumer
|
|
435
|
+
* still has (a rebinding's) until it acknowledged this `bound`, the next of this host's own messages.
|
|
436
|
+
*/
|
|
437
|
+
#bindTo(instance) {
|
|
438
|
+
// A live remote object's instance has its variant.
|
|
439
|
+
const variant = variantsAt(instance.served.contract, this.contract.version).get(instance.variant);
|
|
440
|
+
const previous = this.#names();
|
|
441
|
+
const state = {
|
|
442
|
+
kind: "bound",
|
|
443
|
+
variant,
|
|
444
|
+
names: variantNames(variant),
|
|
445
|
+
followed: [],
|
|
446
|
+
instance,
|
|
447
|
+
...(previous === undefined
|
|
448
|
+
? {}
|
|
449
|
+
: { previous: { variant: previous.variant, names: previous.names, until: this.#provider.nextOwn } }),
|
|
450
|
+
};
|
|
451
|
+
this.#state = state;
|
|
452
|
+
return state;
|
|
453
|
+
}
|
|
454
|
+
/** A hold over a link follows its object's instances in `moved` (a fresh `bound` for a new one). */
|
|
455
|
+
retarget() { }
|
|
456
|
+
/** It moves nothing in `retarget`. */
|
|
457
|
+
following = false;
|
|
458
|
+
/**
|
|
459
|
+
* Its object left it (slice 7b §6): its type was removed (`not_served`) or its provider no longer binds the hold's
|
|
460
|
+
* version (`version`): no longer subscribed, its calls in flight rejected, it waits refused with `removal.cause` in
|
|
461
|
+
* the host's index (a publication starts it again) and the consumer is sent `failed`, which unbinds a bound hold.
|
|
462
|
+
*/
|
|
463
|
+
removed(removal) {
|
|
464
|
+
const state = this.#state;
|
|
465
|
+
if (state.kind === "released" || this.#object === undefined)
|
|
466
|
+
return;
|
|
467
|
+
if (state.kind === "bound")
|
|
468
|
+
unfollow(state);
|
|
469
|
+
this.#changes = [];
|
|
470
|
+
this.#failed = [];
|
|
471
|
+
this.#retired = NO_RETIRED;
|
|
472
|
+
this.#touched = false;
|
|
473
|
+
this.#provider.unbound(this, removal.cause.error);
|
|
474
|
+
this.#object = undefined;
|
|
475
|
+
this.#refuse(this.contract, removal.cause);
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Follows member `index` from its snapshot on (a failed one too: it may recover in this hold): its own encoder and
|
|
479
|
+
* pending queue, and a subscription feeding its calls into this hold's batch. Failures fold per member: a failure
|
|
480
|
+
* drops what was pending for it and replaces a failure not sent yet (one at most per member, however long the
|
|
481
|
+
* consumer stalls); the value after it (a root replacement) replaces the failure. A retirement waits for a value.
|
|
482
|
+
*/
|
|
483
|
+
#follow(state, index, source) {
|
|
484
|
+
const followed = {
|
|
485
|
+
index,
|
|
486
|
+
source,
|
|
487
|
+
subscriber: {
|
|
488
|
+
advance: (call) => {
|
|
489
|
+
this.#touch();
|
|
490
|
+
if (call.kind === "failed") {
|
|
491
|
+
this.#memberFailed(followed, call.error);
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
this.#memberHealed(index);
|
|
495
|
+
const { ops, retired } = call;
|
|
496
|
+
// A retired derive's frame may carry no ops (rule 21): only the flag travels.
|
|
497
|
+
if (ops.length > 0)
|
|
498
|
+
this.#changes.push([followed, ops]);
|
|
499
|
+
// A new list per retirement (rare): the shared empty one is never written to.
|
|
500
|
+
if (retired && !this.#retired.includes(index))
|
|
501
|
+
this.#retired = [...this.#retired, index];
|
|
502
|
+
},
|
|
503
|
+
// The member's source ended with its object, which ends this hold.
|
|
504
|
+
end: () => { },
|
|
505
|
+
endAfterDelivery: () => { },
|
|
506
|
+
},
|
|
507
|
+
encoder: encoder(),
|
|
508
|
+
pending: new PendingOps(),
|
|
509
|
+
};
|
|
510
|
+
// A constant never changes: nothing to subscribe to.
|
|
511
|
+
if (source instanceof Source)
|
|
512
|
+
source.subscribe(followed.subscriber);
|
|
513
|
+
state.followed.push(followed);
|
|
514
|
+
}
|
|
515
|
+
/** Takes the current batch's changes; the hold is untouched again. */
|
|
516
|
+
#take() {
|
|
517
|
+
const changes = this.#changes;
|
|
518
|
+
this.#changes = [];
|
|
519
|
+
this.#touched = false;
|
|
520
|
+
return changes;
|
|
521
|
+
}
|
|
522
|
+
/** A state entry with `members` and the failures and retirements since the last one; counts one encode. */
|
|
523
|
+
#entry(members, context) {
|
|
524
|
+
const failed = this.#failed;
|
|
525
|
+
let retired = this.#retired;
|
|
526
|
+
this.#failed = [];
|
|
527
|
+
this.#retired = NO_RETIRED;
|
|
528
|
+
if (retired.length > 0 && failed.length > 0) {
|
|
529
|
+
// A failed member's retirement travels with its next value, never with its failure.
|
|
530
|
+
const kept = retired.filter((index) => failed.some(({ member }) => member === index));
|
|
531
|
+
if (kept.length > 0) {
|
|
532
|
+
this.#retired = kept;
|
|
533
|
+
retired = retired.filter((index) => !kept.includes(index));
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
chordMetrics(context.telemetry.metrics).counter("chord.link.encodes").add(1);
|
|
537
|
+
return { hold: this.id, members, failed, retired };
|
|
538
|
+
}
|
|
539
|
+
#touch() {
|
|
540
|
+
if (this.#touched)
|
|
541
|
+
return;
|
|
542
|
+
this.#touched = true;
|
|
543
|
+
this.#provider.touched(this);
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Refuses the hold with `cause`, holding nothing: it keeps `request`, indexed under its type while `waiting` (a
|
|
547
|
+
* publication starts it again), for a `retry` otherwise.
|
|
548
|
+
*/
|
|
549
|
+
#refuse(request, cause) {
|
|
550
|
+
this.#state = { kind: "refused", request: owned(request), cause };
|
|
551
|
+
if (cause.kind === "waiting")
|
|
552
|
+
this.#provider.link.host.index(request.type, this, cause);
|
|
553
|
+
this.#provider.send({
|
|
554
|
+
kind: "failed",
|
|
555
|
+
hold: this.id,
|
|
556
|
+
cause: { kind: cause.kind, error: wireError(cause.error) },
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
/** Stops following every member of a bound hold. */
|
|
561
|
+
function unfollow(state) {
|
|
562
|
+
for (const { source, subscriber } of state.followed)
|
|
563
|
+
if (source instanceof Source)
|
|
564
|
+
source.unsubscribe(subscriber);
|
|
565
|
+
}
|
|
566
|
+
/** `request` with its params owned, not a view of the message they came in (which the link's buffers may hold). */
|
|
567
|
+
function owned(request) {
|
|
568
|
+
const { params } = request;
|
|
569
|
+
return typeof params === "string" ? request : { ...request, params: params.slice() };
|
|
570
|
+
}
|
|
571
|
+
const NOBODY = {};
|
|
572
|
+
/**
|
|
573
|
+
* The fields of a `hold` message naming whom it acts for (`caller`): sent only on a route link, whose child honours
|
|
574
|
+
* them (§4); none elsewhere.
|
|
575
|
+
*/
|
|
576
|
+
export function actingFor(link, { principal, incarnation }) {
|
|
577
|
+
return link.role === "route" && principal !== undefined ? { principal, incarnation } : NOBODY;
|
|
578
|
+
}
|
|
579
|
+
//# sourceMappingURL=hold.js.map
|