@diffra-ai/chord 0.0.0-stage → 0.2.3
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 +237 -0
- package/README.md +227 -2
- package/dist/context/index.d.ts +43 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +112 -0
- package/dist/context/index.js.map +1 -0
- package/dist/contracts/accepts.d.ts +91 -0
- package/dist/contracts/accepts.d.ts.map +1 -0
- package/dist/contracts/accepts.js +145 -0
- package/dist/contracts/accepts.js.map +1 -0
- package/dist/contracts/contract.d.ts +238 -0
- package/dist/contracts/contract.d.ts.map +1 -0
- package/dist/contracts/contract.js +69 -0
- package/dist/contracts/contract.js.map +1 -0
- package/dist/contracts/declare.d.ts +144 -0
- package/dist/contracts/declare.d.ts.map +1 -0
- package/dist/contracts/declare.js +207 -0
- package/dist/contracts/declare.js.map +1 -0
- package/dist/contracts/evolve.d.ts +142 -0
- package/dist/contracts/evolve.d.ts.map +1 -0
- package/dist/contracts/evolve.js +216 -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 +61 -0
- package/dist/contracts/fingerprint.js.map +1 -0
- package/dist/contracts/history.d.ts +79 -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 +58 -0
- package/dist/contracts/host-kind.d.ts.map +1 -0
- package/dist/contracts/host-kind.js +122 -0
- package/dist/contracts/host-kind.js.map +1 -0
- package/dist/contracts/index.d.ts +8 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +7 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/internal.d.ts +12 -0
- package/dist/contracts/internal.d.ts.map +1 -0
- package/dist/contracts/internal.js +11 -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 +55 -0
- package/dist/contracts/params.js.map +1 -0
- package/dist/contracts/schema.d.ts +144 -0
- package/dist/contracts/schema.d.ts.map +1 -0
- package/dist/contracts/schema.js +144 -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 +31 -0
- package/dist/data/failure.d.ts.map +1 -0
- package/dist/data/failure.js +78 -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 +28 -0
- package/dist/data/principal.d.ts.map +1 -0
- package/dist/data/principal.js +64 -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.d.ts +4 -0
- package/dist/delta/apply-immutable-trusted.d.ts.map +1 -0
- package/dist/delta/apply-immutable-trusted.js +126 -0
- package/dist/delta/apply-immutable-trusted.js.map +1 -0
- package/dist/delta/diff.d.ts +5 -0
- package/dist/delta/diff.d.ts.map +1 -0
- package/dist/delta/diff.js +435 -0
- package/dist/delta/diff.js.map +1 -0
- package/dist/delta/draft.d.ts +5 -0
- package/dist/delta/draft.d.ts.map +1 -0
- package/dist/delta/draft.js +2 -0
- package/dist/delta/draft.js.map +1 -0
- package/dist/delta/index.d.ts +120 -0
- package/dist/delta/index.d.ts.map +1 -0
- package/dist/delta/index.js +697 -0
- package/dist/delta/index.js.map +1 -0
- 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/revision-validator.d.ts +7 -0
- package/dist/delta/revision-validator.d.ts.map +1 -0
- package/dist/delta/revision-validator.js +71 -0
- package/dist/delta/revision-validator.js.map +1 -0
- package/dist/delta/tracker.d.ts +38 -0
- package/dist/delta/tracker.d.ts.map +1 -0
- package/dist/delta/tracker.js +2175 -0
- package/dist/delta/tracker.js.map +1 -0
- 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 +92 -0
- package/dist/documents/definition.d.ts.map +1 -0
- package/dist/documents/definition.js +81 -0
- package/dist/documents/definition.js.map +1 -0
- package/dist/documents/documents.d.ts +129 -0
- package/dist/documents/documents.d.ts.map +1 -0
- package/dist/documents/documents.js +258 -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 +81 -0
- package/dist/documents/handles.d.ts.map +1 -0
- package/dist/documents/handles.js +74 -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 +139 -0
- package/dist/documents/keyed-slot.d.ts.map +1 -0
- package/dist/documents/keyed-slot.js +478 -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 +120 -0
- package/dist/documents/persistence.d.ts.map +1 -0
- package/dist/documents/persistence.js +156 -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 +112 -0
- package/dist/documents/slot.d.ts.map +1 -0
- package/dist/documents/slot.js +190 -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 +445 -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 +63 -0
- package/dist/host/adapted.d.ts.map +1 -0
- package/dist/host/adapted.js +298 -0
- package/dist/host/adapted.js.map +1 -0
- package/dist/host/admission.d.ts +137 -0
- package/dist/host/admission.d.ts.map +1 -0
- package/dist/host/admission.js +290 -0
- package/dist/host/admission.js.map +1 -0
- package/dist/host/attempt.d.ts +417 -0
- package/dist/host/attempt.d.ts.map +1 -0
- package/dist/host/attempt.js +1490 -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 +97 -0
- package/dist/host/dependencies.d.ts.map +1 -0
- package/dist/host/dependencies.js +148 -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/events.d.ts +114 -0
- package/dist/host/events.d.ts.map +1 -0
- package/dist/host/events.js +191 -0
- package/dist/host/events.js.map +1 -0
- package/dist/host/facet.d.ts +106 -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-data.d.ts +62 -0
- package/dist/host/host-data.d.ts.map +1 -0
- package/dist/host/host-data.js +229 -0
- package/dist/host/host-data.js.map +1 -0
- package/dist/host/host.d.ts +641 -0
- package/dist/host/host.d.ts.map +1 -0
- package/dist/host/host.js +1449 -0
- package/dist/host/host.js.map +1 -0
- package/dist/host/index.d.ts +20 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +7 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/internal.d.ts +13 -0
- package/dist/host/internal.d.ts.map +1 -0
- package/dist/host/internal.js +11 -0
- package/dist/host/internal.js.map +1 -0
- package/dist/host/list.d.ts +52 -0
- package/dist/host/list.d.ts.map +1 -0
- package/dist/host/list.js +149 -0
- package/dist/host/list.js.map +1 -0
- package/dist/host/members.d.ts +58 -0
- package/dist/host/members.d.ts.map +1 -0
- package/dist/host/members.js +178 -0
- package/dist/host/members.js.map +1 -0
- package/dist/host/named-query.d.ts +67 -0
- package/dist/host/named-query.d.ts.map +1 -0
- package/dist/host/named-query.js +166 -0
- package/dist/host/named-query.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 +388 -0
- package/dist/host/object.d.ts.map +1 -0
- package/dist/host/object.js +1527 -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/query-reader.d.ts +80 -0
- package/dist/host/query-reader.d.ts.map +1 -0
- package/dist/host/query-reader.js +182 -0
- package/dist/host/query-reader.js.map +1 -0
- package/dist/host/read-declarations.d.ts +75 -0
- package/dist/host/read-declarations.d.ts.map +1 -0
- package/dist/host/read-declarations.js +152 -0
- package/dist/host/read-declarations.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-events.d.ts +51 -0
- package/dist/host/reference-events.d.ts.map +1 -0
- package/dist/host/reference-events.js +133 -0
- package/dist/host/reference-events.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 +77 -0
- package/dist/host/reference-source.d.ts.map +1 -0
- package/dist/host/reference-source.js +326 -0
- package/dist/host/reference-source.js.map +1 -0
- package/dist/host/reference.d.ts +377 -0
- package/dist/host/reference.d.ts.map +1 -0
- package/dist/host/reference.js +986 -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-admission.d.ts +24 -0
- package/dist/host/route-admission.d.ts.map +1 -0
- package/dist/host/route-admission.js +238 -0
- package/dist/host/route-admission.js.map +1 -0
- package/dist/host/route.d.ts +88 -0
- package/dist/host/route.d.ts.map +1 -0
- package/dist/host/route.js +247 -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 +100 -0
- package/dist/host/staging.d.ts.map +1 -0
- package/dist/host/staging.js +413 -0
- package/dist/host/staging.js.map +1 -0
- package/dist/host/tiling.d.ts +57 -0
- package/dist/host/tiling.d.ts.map +1 -0
- package/dist/host/tiling.js +269 -0
- package/dist/host/tiling.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 +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- 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/json.d.ts +18 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +124 -0
- package/dist/json.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 +574 -0
- package/dist/link/binary.js.map +1 -0
- package/dist/link/channel.d.ts +78 -0
- package/dist/link/channel.d.ts.map +1 -0
- package/dist/link/channel.js +252 -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 +278 -0
- package/dist/link/message.d.ts.map +1 -0
- package/dist/link/message.js +179 -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 +383 -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 +283 -0
- package/dist/node/app/app.d.ts.map +1 -0
- package/dist/node/app/app.js +598 -0
- package/dist/node/app/app.js.map +1 -0
- package/dist/node/app/archive.d.ts +44 -0
- package/dist/node/app/archive.d.ts.map +1 -0
- package/dist/node/app/archive.js +212 -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 +40 -0
- package/dist/node/app/data.d.ts.map +1 -0
- package/dist/node/app/data.js +47 -0
- package/dist/node/app/data.js.map +1 -0
- package/dist/node/app/ephemeral-sign-ins.d.ts +20 -0
- package/dist/node/app/ephemeral-sign-ins.d.ts.map +1 -0
- package/dist/node/app/ephemeral-sign-ins.js +69 -0
- package/dist/node/app/ephemeral-sign-ins.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 +388 -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 +70 -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/sign-ins.d.ts +74 -0
- package/dist/node/app/sign-ins.d.ts.map +1 -0
- package/dist/node/app/sign-ins.js +222 -0
- package/dist/node/app/sign-ins.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 +39 -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 +64 -0
- package/dist/node/http/admission.d.ts.map +1 -0
- package/dist/node/http/admission.js +137 -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 +114 -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 +62 -0
- package/dist/node/http/upgrades.d.ts.map +1 -0
- package/dist/node/http/upgrades.js +194 -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 +577 -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 +40 -0
- package/dist/node/plugins/install.d.ts.map +1 -0
- package/dist/node/plugins/install.js +215 -0
- package/dist/node/plugins/install.js.map +1 -0
- package/dist/node/plugins/plugins.d.ts +165 -0
- package/dist/node/plugins/plugins.d.ts.map +1 -0
- package/dist/node/plugins/plugins.js +268 -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 +70 -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 +40 -0
- package/dist/node/surfaces/bundle.d.ts.map +1 -0
- package/dist/node/surfaces/bundle.js +121 -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 +17 -0
- package/dist/node/surfaces/served.d.ts.map +1 -0
- package/dist/node/surfaces/served.js +44 -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 +42 -0
- package/dist/node/surfaces/tui.d.ts.map +1 -0
- package/dist/node/surfaces/tui.js +59 -0
- package/dist/node/surfaces/tui.js.map +1 -0
- package/dist/node/surfaces/web.d.ts +82 -0
- package/dist/node/surfaces/web.d.ts.map +1 -0
- package/dist/node/surfaces/web.js +122 -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 +260 -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 +43 -0
- package/dist/node/workers/process.d.ts.map +1 -0
- package/dist/node/workers/process.js +137 -0
- package/dist/node/workers/process.js.map +1 -0
- package/dist/node/workers/workers.d.ts +144 -0
- package/dist/node/workers/workers.d.ts.map +1 -0
- package/dist/node/workers/workers.js +723 -0
- package/dist/node/workers/workers.js.map +1 -0
- package/dist/output.d.ts +91 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +362 -0
- package/dist/output.js.map +1 -0
- package/dist/react/hooks.d.ts +61 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +119 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/index.d.ts +4 -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 +34 -0
- package/dist/remote/calls.d.ts.map +1 -0
- package/dist/remote/calls.js +75 -0
- package/dist/remote/calls.js.map +1 -0
- package/dist/remote/consumer.d.ts +59 -0
- package/dist/remote/consumer.d.ts.map +1 -0
- package/dist/remote/consumer.js +468 -0
- package/dist/remote/consumer.js.map +1 -0
- package/dist/remote/hold.d.ts +147 -0
- package/dist/remote/hold.d.ts.map +1 -0
- package/dist/remote/hold.js +653 -0
- package/dist/remote/hold.js.map +1 -0
- package/dist/remote/host-link.d.ts +81 -0
- package/dist/remote/host-link.d.ts.map +1 -0
- package/dist/remote/host-link.js +198 -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 +105 -0
- package/dist/remote/path.d.ts.map +1 -0
- package/dist/remote/path.js +197 -0
- package/dist/remote/path.js.map +1 -0
- package/dist/remote/provider.d.ts +113 -0
- package/dist/remote/provider.d.ts.map +1 -0
- package/dist/remote/provider.js +787 -0
- package/dist/remote/provider.js.map +1 -0
- package/dist/remote/relay.d.ts +126 -0
- package/dist/remote/relay.d.ts.map +1 -0
- package/dist/remote/relay.js +334 -0
- package/dist/remote/relay.js.map +1 -0
- package/dist/remote/remote-object.d.ts +181 -0
- package/dist/remote/remote-object.d.ts.map +1 -0
- package/dist/remote/remote-object.js +683 -0
- package/dist/remote/remote-object.js.map +1 -0
- package/dist/remote/replica.d.ts +66 -0
- package/dist/remote/replica.d.ts.map +1 -0
- package/dist/remote/replica.js +148 -0
- package/dist/remote/replica.js.map +1 -0
- package/dist/sqlite/cloudflare.d.ts +54 -0
- package/dist/sqlite/cloudflare.d.ts.map +1 -0
- package/dist/sqlite/cloudflare.js +144 -0
- package/dist/sqlite/cloudflare.js.map +1 -0
- package/dist/sqlite/database.d.ts +40 -0
- package/dist/sqlite/database.d.ts.map +1 -0
- package/dist/sqlite/database.js +2 -0
- package/dist/sqlite/database.js.map +1 -0
- package/dist/sqlite/index.d.ts +4 -0
- package/dist/sqlite/index.d.ts.map +1 -0
- package/dist/sqlite/index.js +3 -0
- package/dist/sqlite/index.js.map +1 -0
- package/dist/sqlite/migrations.d.ts +10 -0
- package/dist/sqlite/migrations.d.ts.map +1 -0
- package/dist/sqlite/migrations.js +33 -0
- package/dist/sqlite/migrations.js.map +1 -0
- package/dist/sqlite/node.d.ts +49 -0
- package/dist/sqlite/node.d.ts.map +1 -0
- package/dist/sqlite/node.js +197 -0
- package/dist/sqlite/node.js.map +1 -0
- package/dist/sqlite/schema.d.ts +3 -0
- package/dist/sqlite/schema.d.ts.map +1 -0
- package/dist/sqlite/schema.js +10 -0
- package/dist/sqlite/schema.js.map +1 -0
- 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 +56 -0
- package/dist/state/derive.d.ts.map +1 -0
- package/dist/state/derive.js +192 -0
- package/dist/state/derive.js.map +1 -0
- package/dist/state/framed.d.ts +43 -0
- package/dist/state/framed.d.ts.map +1 -0
- package/dist/state/framed.js +121 -0
- package/dist/state/framed.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 +7 -0
- package/dist/state/internal.d.ts.map +1 -0
- package/dist/state/internal.js +9 -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 +390 -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 +36 -0
- package/dist/store/archive.d.ts.map +1 -0
- package/dist/store/archive.js +140 -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/column-set.d.ts +64 -0
- package/dist/store/column-set.d.ts.map +1 -0
- package/dist/store/column-set.js +96 -0
- package/dist/store/column-set.js.map +1 -0
- package/dist/store/columns.d.ts +93 -0
- package/dist/store/columns.d.ts.map +1 -0
- package/dist/store/columns.js +87 -0
- package/dist/store/columns.js.map +1 -0
- package/dist/store/engine.d.ts +182 -0
- package/dist/store/engine.d.ts.map +1 -0
- package/dist/store/engine.js +290 -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 +131 -0
- package/dist/store/evaluate.js.map +1 -0
- package/dist/store/export.d.ts +30 -0
- package/dist/store/export.d.ts.map +1 -0
- package/dist/store/export.js +221 -0
- package/dist/store/export.js.map +1 -0
- package/dist/store/expression.d.ts +254 -0
- package/dist/store/expression.d.ts.map +1 -0
- package/dist/store/expression.js +577 -0
- package/dist/store/expression.js.map +1 -0
- package/dist/store/host-column.d.ts +22 -0
- package/dist/store/host-column.d.ts.map +1 -0
- package/dist/store/host-column.js +36 -0
- package/dist/store/host-column.js.map +1 -0
- package/dist/store/host-data.d.ts +100 -0
- package/dist/store/host-data.d.ts.map +1 -0
- package/dist/store/host-data.js +397 -0
- package/dist/store/host-data.js.map +1 -0
- package/dist/store/import-migration.d.ts +19 -0
- package/dist/store/import-migration.d.ts.map +1 -0
- package/dist/store/import-migration.js +124 -0
- package/dist/store/import-migration.js.map +1 -0
- package/dist/store/import.d.ts +12 -0
- package/dist/store/import.d.ts.map +1 -0
- package/dist/store/import.js +279 -0
- package/dist/store/import.js.map +1 -0
- package/dist/store/index.d.ts +19 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +16 -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 +72 -0
- package/dist/store/live-query.d.ts.map +1 -0
- package/dist/store/live-query.js +162 -0
- package/dist/store/live-query.js.map +1 -0
- package/dist/store/open-query.d.ts +90 -0
- package/dist/store/open-query.d.ts.map +1 -0
- package/dist/store/open-query.js +201 -0
- package/dist/store/open-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/page.d.ts +14 -0
- package/dist/store/page.d.ts.map +1 -0
- package/dist/store/page.js +26 -0
- package/dist/store/page.js.map +1 -0
- package/dist/store/query.d.ts +65 -0
- package/dist/store/query.d.ts.map +1 -0
- package/dist/store/query.js +193 -0
- package/dist/store/query.js.map +1 -0
- package/dist/store/read-plan.d.ts +74 -0
- package/dist/store/read-plan.d.ts.map +1 -0
- package/dist/store/read-plan.js +324 -0
- package/dist/store/read-plan.js.map +1 -0
- package/dist/store/read.d.ts +81 -0
- package/dist/store/read.d.ts.map +1 -0
- package/dist/store/read.js +113 -0
- package/dist/store/read.js.map +1 -0
- package/dist/store/reads.d.ts +79 -0
- package/dist/store/reads.d.ts.map +1 -0
- package/dist/store/reads.js +255 -0
- package/dist/store/reads.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 +96 -0
- package/dist/store/rows.d.ts.map +1 -0
- package/dist/store/rows.js +222 -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 +123 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/skip.d.ts +26 -0
- package/dist/store/skip.d.ts.map +1 -0
- package/dist/store/skip.js +66 -0
- package/dist/store/skip.js.map +1 -0
- package/dist/store/sql.d.ts +78 -0
- package/dist/store/sql.d.ts.map +1 -0
- package/dist/store/sql.js +244 -0
- package/dist/store/sql.js.map +1 -0
- package/dist/store/step.d.ts +52 -0
- package/dist/store/step.d.ts.map +1 -0
- package/dist/store/step.js +59 -0
- package/dist/store/step.js.map +1 -0
- package/dist/store/store.d.ts +192 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +863 -0
- package/dist/store/store.js.map +1 -0
- package/dist/store/table-changes.d.ts +35 -0
- package/dist/store/table-changes.d.ts.map +1 -0
- package/dist/store/table-changes.js +127 -0
- package/dist/store/table-changes.js.map +1 -0
- package/dist/store/table-evolve.d.ts +82 -0
- package/dist/store/table-evolve.d.ts.map +1 -0
- package/dist/store/table-evolve.js +208 -0
- package/dist/store/table-evolve.js.map +1 -0
- package/dist/store/table-handle.d.ts +69 -0
- package/dist/store/table-handle.d.ts.map +1 -0
- package/dist/store/table-handle.js +92 -0
- package/dist/store/table-handle.js.map +1 -0
- package/dist/store/table-history.d.ts +78 -0
- package/dist/store/table-history.d.ts.map +1 -0
- package/dist/store/table-history.js +43 -0
- package/dist/store/table-history.js.map +1 -0
- package/dist/store/table-migration.d.ts +28 -0
- package/dist/store/table-migration.d.ts.map +1 -0
- package/dist/store/table-migration.js +212 -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 +91 -0
- package/dist/store/table.d.ts.map +1 -0
- package/dist/store/table.js +133 -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 +106 -0
- package/dist/surfaces/client.d.ts.map +1 -0
- package/dist/surfaces/client.js +280 -0
- package/dist/surfaces/client.js.map +1 -0
- package/dist/surfaces/connection.d.ts +53 -0
- package/dist/surfaces/connection.d.ts.map +1 -0
- package/dist/surfaces/connection.js +161 -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 +26 -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 +33 -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 +86 -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 +32 -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/surfaces/variant.d.ts +23 -0
- package/dist/surfaces/variant.d.ts.map +1 -0
- package/dist/surfaces/variant.js +18 -0
- package/dist/surfaces/variant.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 +169 -0
- package/dist/sync/client.d.ts.map +1 -0
- package/dist/sync/client.js +459 -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 +205 -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 +145 -0
- package/dist/sync/remote.d.ts.map +1 -0
- package/dist/sync/remote.js +59 -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 +73 -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 +26 -0
- package/dist/telemetry-ingest/facet.d.ts.map +1 -0
- package/dist/telemetry-ingest/facet.js +100 -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 +33 -0
- package/dist/telemetry-sqlite/index.d.ts.map +1 -0
- package/dist/telemetry-sqlite/index.js +113 -0
- package/dist/telemetry-sqlite/index.js.map +1 -0
- 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 +12 -0
- package/dist/telemetry-sqlite/store.d.ts.map +1 -0
- package/dist/telemetry-sqlite/store.js +121 -0
- package/dist/telemetry-sqlite/store.js.map +1 -0
- package/dist/telemetry.d.ts +1013 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +518 -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 +8 -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 +62 -0
- package/dist/tui/scope.d.ts.map +1 -0
- package/dist/tui/scope.js +173 -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 +42 -0
- package/dist/web/page.d.ts.map +1 -0
- package/dist/web/page.js +96 -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/admission/design.md +178 -0
- package/docs/benchmarks.md +1182 -0
- package/docs/decisions.md +3760 -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 +3691 -0
- package/docs/durable-observers/book.md +432 -0
- package/docs/durable-observers/index.html +517 -0
- package/docs/events/spec.md +438 -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 +958 -0
- package/docs/guide-plugins-hosts/index.html +952 -0
- package/docs/host-keyed/spec.md +343 -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 +389 -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/shared-holds/design.md +339 -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-14-design.md +213 -0
- package/docs/slice-14.md +861 -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 +380 -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 +2170 -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 +200 -5
- package/src/delta/README.md +262 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
// The consumer side of a link (§7, §22, W1): the holds this host's own remote references sent on it, by this side's
|
|
2
|
+
// ids, the calls through them within the peer's call window, and each `bound` and `state` message applied to their
|
|
3
|
+
// replicas as one batch, then acknowledged. Messages with an origin answer holds this host relays: they go to that
|
|
4
|
+
// origin's provider side; the calls this host relays for an origin wait here within the same window (one per origin).
|
|
5
|
+
// Each `event` message of its own holds is consumed (its values handed to the host's event flush, or deliberately
|
|
6
|
+
// dropped) and acknowledged with one event `ack` per inbound turn (decision "Events: fire-and-forget members"). On a
|
|
7
|
+
// host without a compressor, the deflated parts of this host's own holds and calls are inflated asynchronously first,
|
|
8
|
+
// and the message is handled once they are.
|
|
9
|
+
import { takesNoArgs } from "../contracts/internal.js";
|
|
10
|
+
import { ChordError, isChordError } from "../data/index.js";
|
|
11
|
+
import { asChordError } from "../data/internal.js";
|
|
12
|
+
import { revoked } from "../host/internal.js";
|
|
13
|
+
import { errorFromWire, parsePayload, payloadPart, } from "../link/internal.js";
|
|
14
|
+
import { carrierOf } from "../telemetry.js";
|
|
15
|
+
import { CallWindow } from "./calls.js";
|
|
16
|
+
import { actingFor } from "./hold.js";
|
|
17
|
+
/** The part a `bound` entry's member carries: its value. */
|
|
18
|
+
const boundPart = (member) => member.value;
|
|
19
|
+
/** The part a `state` entry's member carries: its ops. */
|
|
20
|
+
const statePart = (member) => member.ops;
|
|
21
|
+
/**
|
|
22
|
+
* The consumer side of one link. Ids are its own counters, from 0; a reply naming an id this side gave up is ignored
|
|
23
|
+
* (Q1). When the link closes, every call rejects `unavailable` (never resent) and its path tells every holder.
|
|
24
|
+
*/
|
|
25
|
+
export class ConsumerSide {
|
|
26
|
+
#link;
|
|
27
|
+
#entries = new Map();
|
|
28
|
+
#calls = new Map();
|
|
29
|
+
#window = new CallWindow();
|
|
30
|
+
/**
|
|
31
|
+
* The calls this host relays upstream on this link, one window per downstream origin's number here (decision "Call
|
|
32
|
+
* windows only for untrusted links": a relay honours each upstream window); made by an origin's first call.
|
|
33
|
+
*/
|
|
34
|
+
#relayed = new Map();
|
|
35
|
+
/** The peer's `hello`: its call window (`undefined`: none), once it arrived. */
|
|
36
|
+
#greeted;
|
|
37
|
+
/** The `event` messages consumed since the last event `ack` (one goes in a microtask after the first). */
|
|
38
|
+
#consumed = 0;
|
|
39
|
+
#nextHold = 0;
|
|
40
|
+
#nextCall = 0;
|
|
41
|
+
constructor(link) {
|
|
42
|
+
this.#link = link;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Holds `holder` on this link and returns its new id: its first hold, or a re-hold on a new link; `chain`: the
|
|
46
|
+
* activation chain it is held for, if any (Q5); `trace`: this hold's carrier, if any.
|
|
47
|
+
*/
|
|
48
|
+
attach(holder, chain, trace) {
|
|
49
|
+
const id = this.#nextHold++;
|
|
50
|
+
this.#entries.set(id, holder);
|
|
51
|
+
const acting = actingFor(this.#link, holder.caller);
|
|
52
|
+
this.#link.send({
|
|
53
|
+
kind: "hold",
|
|
54
|
+
hold: id,
|
|
55
|
+
...holder.request,
|
|
56
|
+
...acting,
|
|
57
|
+
...(chain === undefined ? {} : { chain }),
|
|
58
|
+
...(trace === undefined ? {} : { trace }),
|
|
59
|
+
});
|
|
60
|
+
return id;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Calls method `method` (an index into the bound variant) on hold `hold` with `args`: left out for a method without
|
|
64
|
+
* arguments, with byte segments when its argument schema has a `bytes()` leaf, deflated above the threshold except on
|
|
65
|
+
* the parent link; with the carrier of `context`'s span when its adapter propagates. The result is parsed here. The
|
|
66
|
+
* caller's cancellation rejects it at once and sends `abort` when it is in flight. `owner` is the reference making it.
|
|
67
|
+
*/
|
|
68
|
+
call(hold, method, data, args, owner, context) {
|
|
69
|
+
const signal = context.abortSignal;
|
|
70
|
+
signal?.throwIfAborted();
|
|
71
|
+
const payload = takesNoArgs(data) ? undefined : payloadPart(args, data.args.bytes);
|
|
72
|
+
// Up a parent link they travel uncompressed: the parent may have accepted this host as a child, and child links
|
|
73
|
+
// refuse compressed parts (§22).
|
|
74
|
+
const link = this.#link;
|
|
75
|
+
const part = payload === undefined ? undefined : link.role === "parent" ? payload.json : link.part(payload.json, context);
|
|
76
|
+
const { promise, resolve, reject } = Promise.withResolvers();
|
|
77
|
+
const cancel = () => {
|
|
78
|
+
this.#cancel(call);
|
|
79
|
+
reject(signal.reason);
|
|
80
|
+
};
|
|
81
|
+
const done = () => signal?.removeEventListener("abort", cancel);
|
|
82
|
+
const call = {
|
|
83
|
+
hold,
|
|
84
|
+
owner,
|
|
85
|
+
method,
|
|
86
|
+
args: part,
|
|
87
|
+
segments: payload?.segments,
|
|
88
|
+
trace: carrierOf(context.telemetry),
|
|
89
|
+
old: link.host.oldWork.of(context),
|
|
90
|
+
resolve: (value) => {
|
|
91
|
+
done();
|
|
92
|
+
resolve(value);
|
|
93
|
+
},
|
|
94
|
+
reject: (error) => {
|
|
95
|
+
done();
|
|
96
|
+
reject(error);
|
|
97
|
+
},
|
|
98
|
+
id: undefined,
|
|
99
|
+
send: () => this.#send(call),
|
|
100
|
+
};
|
|
101
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
102
|
+
this.#window.submit(call);
|
|
103
|
+
return promise;
|
|
104
|
+
}
|
|
105
|
+
/** Hold `hold` was released: the provider is told, its calls fail with `error`. */
|
|
106
|
+
release(hold, error) {
|
|
107
|
+
this.#link.send({ kind: "release", hold });
|
|
108
|
+
this.forget(hold, error);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* One of several references sharing hold `hold` released (`owner`, of the object `label`): its calls reject
|
|
112
|
+
* `released` and leave the tables, so its own end finds none (decision "References share one wire hold"). Its
|
|
113
|
+
* waiting calls leave the window unsent first, then each of its sent calls is aborted, the last sent first (a relay
|
|
114
|
+
* drops a later call still waiting in its upstream window before an earlier abort frees a slot for it); then their
|
|
115
|
+
* slots free. An owner without calls costs no error.
|
|
116
|
+
*/
|
|
117
|
+
cancelCalls(hold, owner, label) {
|
|
118
|
+
const waiting = this.#window.removeWhere((call) => call.hold === hold && call.owner === owner);
|
|
119
|
+
const sent = [];
|
|
120
|
+
for (const entry of this.#calls)
|
|
121
|
+
if (entry[1].hold === hold && entry[1].owner === owner)
|
|
122
|
+
sent.push(entry);
|
|
123
|
+
if (waiting.length === 0 && sent.length === 0)
|
|
124
|
+
return;
|
|
125
|
+
// Ids grow in the order calls were sent.
|
|
126
|
+
sent.reverse();
|
|
127
|
+
for (const [id] of sent) {
|
|
128
|
+
this.#calls.delete(id);
|
|
129
|
+
this.#link.send({ kind: "abort", call: id });
|
|
130
|
+
}
|
|
131
|
+
for (const _ of sent)
|
|
132
|
+
this.#window.freed();
|
|
133
|
+
const error = new ChordError({ code: "released", message: `${label}: released` });
|
|
134
|
+
for (const call of waiting)
|
|
135
|
+
call.reject(error);
|
|
136
|
+
for (const [, call] of sent)
|
|
137
|
+
call.reject(error);
|
|
138
|
+
}
|
|
139
|
+
/** `ref.retry()` on a failed hold, with `hops` left of its budget: the provider is asked for an attempt now. */
|
|
140
|
+
retry(hold, hops) {
|
|
141
|
+
this.#link.send({ kind: "retry", hold, hops });
|
|
142
|
+
}
|
|
143
|
+
/** Drops hold `hold` from the tables; its calls, in flight and waiting, fail with `error` and free their slots. */
|
|
144
|
+
forget(hold, error) {
|
|
145
|
+
this.#entries.delete(hold);
|
|
146
|
+
this.#failCalls(hold, error);
|
|
147
|
+
}
|
|
148
|
+
/** The peer's `hello` arrived: calls go out within its window (`undefined`: none), relayed ones too. */
|
|
149
|
+
opened(calls) {
|
|
150
|
+
this.#greeted = { calls };
|
|
151
|
+
this.#window.opened(calls);
|
|
152
|
+
for (const window of this.#relayed.values())
|
|
153
|
+
window.opened(calls);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The window of the calls this host relays on this link for the downstream origin with number `origin` here: they
|
|
157
|
+
* wait in it while the peer's N calls of that origin are in flight (before its `hello`, all of them).
|
|
158
|
+
*/
|
|
159
|
+
relayWindow(origin) {
|
|
160
|
+
let window = this.#relayed.get(origin);
|
|
161
|
+
if (window === undefined) {
|
|
162
|
+
window = new CallWindow();
|
|
163
|
+
if (this.#greeted !== undefined)
|
|
164
|
+
window.opened(this.#greeted.calls);
|
|
165
|
+
this.#relayed.set(origin, window);
|
|
166
|
+
}
|
|
167
|
+
// One window per origin, made for that origin's relayed calls only.
|
|
168
|
+
return window;
|
|
169
|
+
}
|
|
170
|
+
/** The downstream origin with number `origin` here closed: its relayed calls' window goes (`closed` aborts them). */
|
|
171
|
+
unrelay(origin) {
|
|
172
|
+
this.#relayed.delete(origin);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Handles one message from the provider: this host's own, or (with an origin) one for a relayed hold. A `bound`,
|
|
176
|
+
* `state` or `result` with deflated parts to inflate asynchronously returns that promise and is handled after it.
|
|
177
|
+
*/
|
|
178
|
+
message(message) {
|
|
179
|
+
if (message.origin !== undefined) {
|
|
180
|
+
this.#link.host.relays.get(message.origin)?.forward(message, this.#link);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
switch (message.kind) {
|
|
184
|
+
case "bound":
|
|
185
|
+
case "state": {
|
|
186
|
+
const deflated = message.kind === "bound"
|
|
187
|
+
? this.#deflated(message.holds, boundPart)
|
|
188
|
+
: this.#deflated(message.holds, statePart);
|
|
189
|
+
if (deflated !== undefined)
|
|
190
|
+
return this.#link.inflate(deflated, () => this.message(message));
|
|
191
|
+
if (message.kind === "bound")
|
|
192
|
+
this.#bound(message.holds);
|
|
193
|
+
else
|
|
194
|
+
this.#state(message.holds);
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
case "failed":
|
|
198
|
+
this.#failed(message);
|
|
199
|
+
break;
|
|
200
|
+
case "loading":
|
|
201
|
+
this.#loading(message.hold);
|
|
202
|
+
break;
|
|
203
|
+
case "result":
|
|
204
|
+
case "error":
|
|
205
|
+
return this.#reply(message);
|
|
206
|
+
case "gone":
|
|
207
|
+
this.#gone(message);
|
|
208
|
+
break;
|
|
209
|
+
case "event": {
|
|
210
|
+
const deflated = this.#deflatedEvents(message.events);
|
|
211
|
+
if (deflated !== undefined)
|
|
212
|
+
return this.#link.inflate(deflated, () => this.message(message));
|
|
213
|
+
this.#events(message.events);
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/** The link closed: calls in flight and waiting reject `unavailable` (never resent, §7); the tables are dropped. */
|
|
219
|
+
closed() {
|
|
220
|
+
const error = new ChordError({ code: "unavailable", message: "the link closed" });
|
|
221
|
+
const calls = [...this.#calls.values(), ...this.#window.clear()];
|
|
222
|
+
this.#calls.clear();
|
|
223
|
+
this.#entries.clear();
|
|
224
|
+
// The relays' upstream drops answer their calls (`ProviderSide.upstreamDropped`).
|
|
225
|
+
this.#relayed.clear();
|
|
226
|
+
for (const call of calls)
|
|
227
|
+
call.reject(error);
|
|
228
|
+
}
|
|
229
|
+
/** Sends a call that got its slot, with the next id. */
|
|
230
|
+
#send(call) {
|
|
231
|
+
const id = this.#nextCall++;
|
|
232
|
+
call.id = id;
|
|
233
|
+
this.#calls.set(id, call);
|
|
234
|
+
const { hold, method, args, segments, trace } = call;
|
|
235
|
+
this.#link.send({
|
|
236
|
+
kind: "call",
|
|
237
|
+
call: id,
|
|
238
|
+
hold,
|
|
239
|
+
method,
|
|
240
|
+
...(args === undefined ? {} : { args }),
|
|
241
|
+
...(segments === undefined ? {} : { segments }),
|
|
242
|
+
trace,
|
|
243
|
+
...(call.old ? { old: true } : {}),
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Cancels `call`: a waiting one leaves the window and nothing is sent; one in flight sends `abort` and frees its
|
|
248
|
+
* slot. Settling the caller is the caller's.
|
|
249
|
+
*/
|
|
250
|
+
#cancel(call) {
|
|
251
|
+
if (call.id === undefined) {
|
|
252
|
+
this.#window.remove(call);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (!this.#calls.delete(call.id))
|
|
256
|
+
return;
|
|
257
|
+
this.#link.send({ kind: "abort", call: call.id });
|
|
258
|
+
this.#window.freed();
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* The deflated parts of this side's own holds in `entries` that wait for an asynchronous inflate, each with the
|
|
262
|
+
* link's decoded limit; `undefined` when none does (nothing allocated). Entries of holds this side gave up are not
|
|
263
|
+
* inflated (Q1).
|
|
264
|
+
*/
|
|
265
|
+
#deflated(entries, partOf) {
|
|
266
|
+
const { limits } = this.#link;
|
|
267
|
+
let deflated;
|
|
268
|
+
for (const entry of entries) {
|
|
269
|
+
if (!this.#entries.has(entry.hold))
|
|
270
|
+
continue;
|
|
271
|
+
for (const member of entry.members) {
|
|
272
|
+
const part = partOf(member);
|
|
273
|
+
if (!this.#link.inflates(part, limits))
|
|
274
|
+
continue;
|
|
275
|
+
deflated ??= [];
|
|
276
|
+
deflated.push([part, limits.decoded]);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return deflated;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* The deflated values of this side's own holds' events waiting for an asynchronous inflate, each with the link's
|
|
283
|
+
* decoded limit; `undefined` when none does. Only values something listens to are inflated: those of holds this side
|
|
284
|
+
* gave up (Q1), of a hold not live or of a member nobody listens to are dropped unopened (an index outside the bound
|
|
285
|
+
* version throws here, a protocol error).
|
|
286
|
+
*/
|
|
287
|
+
#deflatedEvents(events) {
|
|
288
|
+
const { limits } = this.#link;
|
|
289
|
+
let deflated;
|
|
290
|
+
for (const { hold, member, value } of events) {
|
|
291
|
+
if (!this.#link.inflates(value, limits) || this.#entries.get(hold)?.eventNode(member) === undefined)
|
|
292
|
+
continue;
|
|
293
|
+
deflated ??= [];
|
|
294
|
+
deflated.push([value, limits.decoded]);
|
|
295
|
+
}
|
|
296
|
+
return deflated;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* One `event` message, its parts inflated: each entry goes to its holder (an unknown or released hold drops it), which
|
|
300
|
+
* hands it to the host's event flush or drops it; then the message is consumed: one event `ack` per inbound turn,
|
|
301
|
+
* sent after the flush delivered what it consumed (a microtask queued after the flush's).
|
|
302
|
+
*/
|
|
303
|
+
#events(events) {
|
|
304
|
+
for (const { hold, member, at, value } of events)
|
|
305
|
+
this.#entries.get(hold)?.event(member, at, value, this.#link);
|
|
306
|
+
if (this.#consumed++ > 0)
|
|
307
|
+
return;
|
|
308
|
+
queueMicrotask(() => {
|
|
309
|
+
const events = this.#consumed;
|
|
310
|
+
this.#consumed = 0;
|
|
311
|
+
this.#link.send({ kind: "ack", events });
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* One `bound` message: every entry prepared first (one that does not fit closes the link before anything changed)
|
|
316
|
+
* and applied in one batch; then the message is acknowledged, and the references go live. An entry with a part past
|
|
317
|
+
* the link's limits fails only its hold (`too_large/part`); the others apply.
|
|
318
|
+
*/
|
|
319
|
+
#bound(holds) {
|
|
320
|
+
const adoptions = [];
|
|
321
|
+
const bound = [];
|
|
322
|
+
let oversized;
|
|
323
|
+
for (const entry of holds) {
|
|
324
|
+
const holder = this.#entries.get(entry.hold);
|
|
325
|
+
if (holder === undefined)
|
|
326
|
+
continue;
|
|
327
|
+
try {
|
|
328
|
+
adoptions.push(holder.prepareBound(entry, this.#link));
|
|
329
|
+
}
|
|
330
|
+
catch (error) {
|
|
331
|
+
if (!isChordError(error, "too_large"))
|
|
332
|
+
throw error;
|
|
333
|
+
oversized ??= [];
|
|
334
|
+
oversized.push([holder, error]);
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
bound.push(holder);
|
|
338
|
+
}
|
|
339
|
+
this.#adopt(adoptions);
|
|
340
|
+
// Acknowledged before the references go live: the calls they send then (their parked ones) follow the `ack`, so
|
|
341
|
+
// the provider decodes them by this binding's indexes, never by a rebinding's previous ones.
|
|
342
|
+
this.#link.send({ kind: "ack" });
|
|
343
|
+
// After the batch: the references go live with every replica of the message in place.
|
|
344
|
+
for (const holder of bound)
|
|
345
|
+
holder.wentLive();
|
|
346
|
+
for (const [holder, error] of oversized ?? [])
|
|
347
|
+
holder.tooLarge(error);
|
|
348
|
+
}
|
|
349
|
+
/** One `state` message, as `#bound` does it. */
|
|
350
|
+
#state(holds) {
|
|
351
|
+
const adoptions = [];
|
|
352
|
+
let oversized;
|
|
353
|
+
for (const entry of holds) {
|
|
354
|
+
const holder = this.#entries.get(entry.hold);
|
|
355
|
+
if (holder === undefined)
|
|
356
|
+
continue;
|
|
357
|
+
try {
|
|
358
|
+
adoptions.push(holder.prepare(entry, this.#link));
|
|
359
|
+
}
|
|
360
|
+
catch (error) {
|
|
361
|
+
if (!isChordError(error, "too_large"))
|
|
362
|
+
throw error;
|
|
363
|
+
oversized ??= [];
|
|
364
|
+
oversized.push([holder, error]);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
this.#adopt(adoptions);
|
|
368
|
+
for (const [holder, error] of oversized ?? [])
|
|
369
|
+
holder.tooLarge(error);
|
|
370
|
+
this.#link.send({ kind: "ack" });
|
|
371
|
+
}
|
|
372
|
+
/** Applies prepared entries in one batch of this host, so no watch or derive sees half a provider commit (W1). */
|
|
373
|
+
#adopt(adoptions) {
|
|
374
|
+
if (adoptions.length === 0)
|
|
375
|
+
return;
|
|
376
|
+
this.#link.host.batch.commit(() => {
|
|
377
|
+
for (const adopt of adoptions)
|
|
378
|
+
adopt();
|
|
379
|
+
}, this.#link.context);
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* `loading`: the hold's object, or its relay's upstream, starts over; its calls still waiting for a slot reject
|
|
383
|
+
* `unavailable` (they may name a method of the old variant), its calls in flight wait for their reply (a provider's
|
|
384
|
+
* `loading` keeps them; a relay's upstream drop answered them before).
|
|
385
|
+
*/
|
|
386
|
+
#loading(hold) {
|
|
387
|
+
const holder = this.#entries.get(hold);
|
|
388
|
+
if (holder === undefined)
|
|
389
|
+
return;
|
|
390
|
+
const error = new ChordError({ code: "unavailable", message: `hold ${hold}: rebinding` });
|
|
391
|
+
for (const call of this.#window.removeHold(hold))
|
|
392
|
+
call.reject(error);
|
|
393
|
+
holder.loading();
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* `failed`: its holder fails; its calls still waiting for a slot reject with the cause (a bound hold is unbound by it,
|
|
397
|
+
* slice 7b; its calls in flight are rejected by the provider). A denial is access withdrawn under those calls as
|
|
398
|
+
* under the ones in flight (slice 14 §2.3): `forbidden/revoked` for both; a call made after it meets the denied
|
|
399
|
+
* reference and gets its plain `forbidden`.
|
|
400
|
+
*/
|
|
401
|
+
#failed(message) {
|
|
402
|
+
const holder = this.#entries.get(message.hold);
|
|
403
|
+
if (holder === undefined)
|
|
404
|
+
return;
|
|
405
|
+
const error = asChordError(errorFromWire(message.cause.error), `hold ${message.hold}`);
|
|
406
|
+
const rejected = message.cause.kind === "denied" ? revoked(holder.label, error) : error;
|
|
407
|
+
for (const call of this.#window.removeHold(message.hold))
|
|
408
|
+
call.reject(rejected);
|
|
409
|
+
holder.failed(message);
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* `gone`: one for a hold this side gave up is ignored (Q1); the holder ends, which forgets its hold here and fails
|
|
413
|
+
* its calls.
|
|
414
|
+
*/
|
|
415
|
+
#gone(message) {
|
|
416
|
+
const holder = this.#entries.get(message.hold);
|
|
417
|
+
if (holder === undefined)
|
|
418
|
+
return;
|
|
419
|
+
holder.lost(asChordError(errorFromWire(message.error), `hold ${message.hold}`));
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* A reply: its call settles with the parsed result or the error. A result past the link's limits rejects the call
|
|
423
|
+
* `too_large/part`. A malformed part rejects the call `unavailable` and throws (a protocol error: the link closes).
|
|
424
|
+
* A result to inflate asynchronously is inflated first (for a call still waiting), then handled again.
|
|
425
|
+
*/
|
|
426
|
+
#reply(reply) {
|
|
427
|
+
const call = this.#calls.get(reply.call);
|
|
428
|
+
if (call === undefined)
|
|
429
|
+
return;
|
|
430
|
+
const link = this.#link;
|
|
431
|
+
if (reply.kind === "result" && link.inflates(reply.value, link.limits)) {
|
|
432
|
+
return link.inflate([[reply.value, link.limits.decoded]], () => this.#reply(reply));
|
|
433
|
+
}
|
|
434
|
+
this.#calls.delete(reply.call);
|
|
435
|
+
this.#window.freed();
|
|
436
|
+
try {
|
|
437
|
+
if (reply.kind === "error")
|
|
438
|
+
call.reject(errorFromWire(reply.error));
|
|
439
|
+
else if (reply.value === undefined)
|
|
440
|
+
call.resolve(null);
|
|
441
|
+
else
|
|
442
|
+
call.resolve(parsePayload(link.openPart(reply.value, link.limits, link.context), reply.segments));
|
|
443
|
+
}
|
|
444
|
+
catch (error) {
|
|
445
|
+
if (isChordError(error, "too_large")) {
|
|
446
|
+
call.reject(error);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
call.reject(new ChordError({ code: "unavailable", message: `call ${reply.call}: a malformed reply` }));
|
|
450
|
+
throw error;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
/** Fails `hold`'s calls in flight and waiting with `error`; each in-flight one frees its slot. */
|
|
454
|
+
#failCalls(hold, error) {
|
|
455
|
+
// Waiting ones first: a freed slot must not send one of them.
|
|
456
|
+
const failed = this.#window.removeHold(hold);
|
|
457
|
+
for (const [id, call] of this.#calls) {
|
|
458
|
+
if (call.hold !== hold)
|
|
459
|
+
continue;
|
|
460
|
+
this.#calls.delete(id);
|
|
461
|
+
this.#window.freed();
|
|
462
|
+
failed.push(call);
|
|
463
|
+
}
|
|
464
|
+
for (const call of failed)
|
|
465
|
+
call.reject(error);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
//# sourceMappingURL=consumer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consumer.js","sourceRoot":"","sources":["../../src/remote/consumer.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,mHAAmH;AACnH,mHAAmH;AACnH,sHAAsH;AACtH,kHAAkH;AAClH,qHAAqH;AACrH,sHAAsH;AACtH,4CAA4C;AAI5C,OAAO,EAAmB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC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CAAC,IAAI,CAAC,CAAC;;gBAClD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;QACxG,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,YAAY,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,CAAC;gBACtC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACnB,OAAO;YACR,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,KAAK,CAAC,IAAI,qBAAqB,EAAE,CAAC,CAAC,CAAC;YACvG,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAED,kGAAkG;IAClG,UAAU,CAAC,IAAY,EAAE,KAAiB;QACzC,8DAA8D;QAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC7C,KAAK,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACtC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI;gBAAE,SAAS;YACjC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACvB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACrB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,MAAM;YAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;CACD","sourcesContent":["// The consumer side of a link (§7, §22, W1): the holds this host's own remote references sent on it, by this side's\n// ids, the calls through them within the peer's call window, and each `bound` and `state` message applied to their\n// replicas as one batch, then acknowledged. Messages with an origin answer holds this host relays: they go to that\n// origin's provider side; the calls this host relays for an origin wait here within the same window (one per origin).\n// Each `event` message of its own holds is consumed (its values handed to the host's event flush, or deliberately\n// dropped) and acknowledged with one event `ack` per inbound turn (decision \"Events: fire-and-forget members\"). On a\n// host without a compressor, the deflated parts of this host's own holds and calls are inflated asynchronously first,\n// and the message is handled once they are.\n\nimport type { TelemetryCarrier } from \"@diffra-ai/telemetry\";\nimport type { Context } from \"../context/index.ts\";\nimport { type MethodData, takesNoArgs } from \"../contracts/internal.ts\";\nimport { ChordError, isChordError } from \"../data/index.ts\";\nimport { asChordError } from \"../data/internal.ts\";\nimport { revoked } from \"../host/internal.ts\";\nimport {\n\ttype BoundEntry,\n\ttype ConsumerMessage,\n\ttype DeflatedPart,\n\terrorFromWire,\n\ttype Message,\n\ttype Part,\n\tparsePayload,\n\tpayloadPart,\n\ttype StateEntry,\n\ttype WireEvent,\n} from \"../link/internal.ts\";\nimport { carrierOf } from \"../telemetry.ts\";\nimport { CallWindow, type QueuedCall } from \"./calls.ts\";\nimport { actingFor } from \"./hold.ts\";\nimport type { HostLink } from \"./host-link.ts\";\nimport type { RemoteObject } from \"./remote-object.ts\";\n\n/** The part a `bound` entry's member carries: its value. */\nconst boundPart = (member: BoundEntry[\"members\"][number]): Part => member.value;\n\n/** The part a `state` entry's member carries: its ops. */\nconst statePart = (member: StateEntry[\"members\"][number]): Part => member.ops;\n\n/** A reply to a call. */\ntype Reply = Extract<Message, { readonly kind: \"result\" | \"error\" }>;\n\n/**\n * A call through this side: waiting for a slot of the call window (no id yet), then in flight under its id until its\n * reply, its abort, its hold's release or `gone`, or the link's close.\n */\ntype OutgoingCall = {\n\treadonly hold: number;\n\t/**\n\t * The reference that made it (its binding; never on the wire): releasing one of several references sharing the hold\n\t * cancels its own calls only (decision \"References share one wire hold\").\n\t */\n\treadonly owner: object;\n\t/** The method's index in the bound variant and its arguments' part. */\n\treadonly method: number;\n\treadonly args: Part | undefined;\n\treadonly segments: readonly Uint8Array[] | undefined;\n\t/** The caller's trace carrier (its `chord.call` span's), when its adapter propagates. */\n\treadonly trace: TelemetryCarrier | undefined;\n\t/** Whether the caller is old work of a reload here (`call.old`: the provider routes it to open old attempts). */\n\treadonly old: boolean;\n\treadonly resolve: (value: unknown) => void;\n\treadonly reject: (error: unknown) => void;\n\tid: number | undefined;\n\tsend(): void;\n};\n\n/**\n * The consumer side of one link. Ids are its own counters, from 0; a reply naming an id this side gave up is ignored\n * (Q1). When the link closes, every call rejects `unavailable` (never resent) and its path tells every holder.\n */\nexport class ConsumerSide {\n\treadonly #link: HostLink;\n\treadonly #entries = new Map<number, RemoteObject>();\n\treadonly #calls = new Map<number, OutgoingCall>();\n\treadonly #window = new CallWindow<OutgoingCall>();\n\t/**\n\t * The calls this host relays upstream on this link, one window per downstream origin's number here (decision \"Call\n\t * windows only for untrusted links\": a relay honours each upstream window); made by an origin's first call.\n\t */\n\treadonly #relayed = new Map<number, CallWindow<QueuedCall<unknown>>>();\n\t/** The peer's `hello`: its call window (`undefined`: none), once it arrived. */\n\t#greeted: { readonly calls: number | undefined } | undefined;\n\t/** The `event` messages consumed since the last event `ack` (one goes in a microtask after the first). */\n\t#consumed = 0;\n\t#nextHold = 0;\n\t#nextCall = 0;\n\n\tconstructor(link: HostLink) {\n\t\tthis.#link = link;\n\t}\n\n\t/**\n\t * Holds `holder` on this link and returns its new id: its first hold, or a re-hold on a new link; `chain`: the\n\t * activation chain it is held for, if any (Q5); `trace`: this hold's carrier, if any.\n\t */\n\tattach(holder: RemoteObject, chain: string[] | undefined, trace: TelemetryCarrier | undefined): number {\n\t\tconst id = this.#nextHold++;\n\t\tthis.#entries.set(id, holder);\n\t\tconst acting = actingFor(this.#link, holder.caller);\n\t\tthis.#link.send({\n\t\t\tkind: \"hold\",\n\t\t\thold: id,\n\t\t\t...holder.request,\n\t\t\t...acting,\n\t\t\t...(chain === undefined ? {} : { chain }),\n\t\t\t...(trace === undefined ? {} : { trace }),\n\t\t});\n\t\treturn id;\n\t}\n\n\t/**\n\t * Calls method `method` (an index into the bound variant) on hold `hold` with `args`: left out for a method without\n\t * arguments, with byte segments when its argument schema has a `bytes()` leaf, deflated above the threshold except on\n\t * the parent link; with the carrier of `context`'s span when its adapter propagates. The result is parsed here. The\n\t * caller's cancellation rejects it at once and sends `abort` when it is in flight. `owner` is the reference making it.\n\t */\n\tcall(\n\t\thold: number,\n\t\tmethod: number,\n\t\tdata: MethodData,\n\t\targs: unknown,\n\t\towner: object,\n\t\tcontext: Context,\n\t): Promise<unknown> {\n\t\tconst signal = context.abortSignal;\n\t\tsignal?.throwIfAborted();\n\t\tconst payload = takesNoArgs(data) ? undefined : payloadPart(args, data.args.bytes);\n\t\t// Up a parent link they travel uncompressed: the parent may have accepted this host as a child, and child links\n\t\t// refuse compressed parts (§22).\n\t\tconst link = this.#link;\n\t\tconst part =\n\t\t\tpayload === undefined ? undefined : link.role === \"parent\" ? payload.json : link.part(payload.json, context);\n\t\tconst { promise, resolve, reject } = Promise.withResolvers<unknown>();\n\t\tconst cancel = (): void => {\n\t\t\tthis.#cancel(call);\n\t\t\treject(signal!.reason);\n\t\t};\n\t\tconst done = (): void => signal?.removeEventListener(\"abort\", cancel);\n\t\tconst call: OutgoingCall = {\n\t\t\thold,\n\t\t\towner,\n\t\t\tmethod,\n\t\t\targs: part,\n\t\t\tsegments: payload?.segments,\n\t\t\ttrace: carrierOf(context.telemetry),\n\t\t\told: link.host.oldWork.of(context),\n\t\t\tresolve: (value) => {\n\t\t\t\tdone();\n\t\t\t\tresolve(value);\n\t\t\t},\n\t\t\treject: (error) => {\n\t\t\t\tdone();\n\t\t\t\treject(error);\n\t\t\t},\n\t\t\tid: undefined,\n\t\t\tsend: () => this.#send(call),\n\t\t};\n\t\tsignal?.addEventListener(\"abort\", cancel, { once: true });\n\t\tthis.#window.submit(call);\n\t\treturn promise;\n\t}\n\n\t/** Hold `hold` was released: the provider is told, its calls fail with `error`. */\n\trelease(hold: number, error: ChordError): void {\n\t\tthis.#link.send({ kind: \"release\", hold });\n\t\tthis.forget(hold, error);\n\t}\n\n\t/**\n\t * One of several references sharing hold `hold` released (`owner`, of the object `label`): its calls reject\n\t * `released` and leave the tables, so its own end finds none (decision \"References share one wire hold\"). Its\n\t * waiting calls leave the window unsent first, then each of its sent calls is aborted, the last sent first (a relay\n\t * drops a later call still waiting in its upstream window before an earlier abort frees a slot for it); then their\n\t * slots free. An owner without calls costs no error.\n\t */\n\tcancelCalls(hold: number, owner: object, label: string): void {\n\t\tconst waiting = this.#window.removeWhere((call) => call.hold === hold && call.owner === owner);\n\t\tconst sent: [number, OutgoingCall][] = [];\n\t\tfor (const entry of this.#calls) if (entry[1].hold === hold && entry[1].owner === owner) sent.push(entry);\n\t\tif (waiting.length === 0 && sent.length === 0) return;\n\t\t// Ids grow in the order calls were sent.\n\t\tsent.reverse();\n\t\tfor (const [id] of sent) {\n\t\t\tthis.#calls.delete(id);\n\t\t\tthis.#link.send({ kind: \"abort\", call: id });\n\t\t}\n\t\tfor (const _ of sent) this.#window.freed();\n\t\tconst error = new ChordError({ code: \"released\", message: `${label}: released` });\n\t\tfor (const call of waiting) call.reject(error);\n\t\tfor (const [, call] of sent) call.reject(error);\n\t}\n\n\t/** `ref.retry()` on a failed hold, with `hops` left of its budget: the provider is asked for an attempt now. */\n\tretry(hold: number, hops: number): void {\n\t\tthis.#link.send({ kind: \"retry\", hold, hops });\n\t}\n\n\t/** Drops hold `hold` from the tables; its calls, in flight and waiting, fail with `error` and free their slots. */\n\tforget(hold: number, error: ChordError): void {\n\t\tthis.#entries.delete(hold);\n\t\tthis.#failCalls(hold, error);\n\t}\n\n\t/** The peer's `hello` arrived: calls go out within its window (`undefined`: none), relayed ones too. */\n\topened(calls: number | undefined): void {\n\t\tthis.#greeted = { calls };\n\t\tthis.#window.opened(calls);\n\t\tfor (const window of this.#relayed.values()) window.opened(calls);\n\t}\n\n\t/**\n\t * The window of the calls this host relays on this link for the downstream origin with number `origin` here: they\n\t * wait in it while the peer's N calls of that origin are in flight (before its `hello`, all of them).\n\t */\n\trelayWindow<C extends QueuedCall<unknown>>(origin: number): CallWindow<C> {\n\t\tlet window = this.#relayed.get(origin);\n\t\tif (window === undefined) {\n\t\t\twindow = new CallWindow();\n\t\t\tif (this.#greeted !== undefined) window.opened(this.#greeted.calls);\n\t\t\tthis.#relayed.set(origin, window);\n\t\t}\n\t\t// One window per origin, made for that origin's relayed calls only.\n\t\treturn window as CallWindow<C>;\n\t}\n\n\t/** The downstream origin with number `origin` here closed: its relayed calls' window goes (`closed` aborts them). */\n\tunrelay(origin: number): void {\n\t\tthis.#relayed.delete(origin);\n\t}\n\n\t/**\n\t * Handles one message from the provider: this host's own, or (with an origin) one for a relayed hold. A `bound`,\n\t * `state` or `result` with deflated parts to inflate asynchronously returns that promise and is handled after it.\n\t */\n\tmessage(message: ConsumerMessage): void | Promise<void> {\n\t\tif (message.origin !== undefined) {\n\t\t\tthis.#link.host.relays.get(message.origin)?.forward(message, this.#link);\n\t\t\treturn;\n\t\t}\n\t\tswitch (message.kind) {\n\t\t\tcase \"bound\":\n\t\t\tcase \"state\": {\n\t\t\t\tconst deflated =\n\t\t\t\t\tmessage.kind === \"bound\"\n\t\t\t\t\t\t? this.#deflated(message.holds, boundPart)\n\t\t\t\t\t\t: this.#deflated(message.holds, statePart);\n\t\t\t\tif (deflated !== undefined) return this.#link.inflate(deflated, () => this.message(message));\n\t\t\t\tif (message.kind === \"bound\") this.#bound(message.holds);\n\t\t\t\telse this.#state(message.holds);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"failed\":\n\t\t\t\tthis.#failed(message);\n\t\t\t\tbreak;\n\t\t\tcase \"loading\":\n\t\t\t\tthis.#loading(message.hold);\n\t\t\t\tbreak;\n\t\t\tcase \"result\":\n\t\t\tcase \"error\":\n\t\t\t\treturn this.#reply(message);\n\t\t\tcase \"gone\":\n\t\t\t\tthis.#gone(message);\n\t\t\t\tbreak;\n\t\t\tcase \"event\": {\n\t\t\t\tconst deflated = this.#deflatedEvents(message.events);\n\t\t\t\tif (deflated !== undefined) return this.#link.inflate(deflated, () => this.message(message));\n\t\t\t\tthis.#events(message.events);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** The link closed: calls in flight and waiting reject `unavailable` (never resent, §7); the tables are dropped. */\n\tclosed(): void {\n\t\tconst error = new ChordError({ code: \"unavailable\", message: \"the link closed\" });\n\t\tconst calls = [...this.#calls.values(), ...this.#window.clear()];\n\t\tthis.#calls.clear();\n\t\tthis.#entries.clear();\n\t\t// The relays' upstream drops answer their calls (`ProviderSide.upstreamDropped`).\n\t\tthis.#relayed.clear();\n\t\tfor (const call of calls) call.reject(error);\n\t}\n\n\t/** Sends a call that got its slot, with the next id. */\n\t#send(call: OutgoingCall): void {\n\t\tconst id = this.#nextCall++;\n\t\tcall.id = id;\n\t\tthis.#calls.set(id, call);\n\t\tconst { hold, method, args, segments, trace } = call;\n\t\tthis.#link.send({\n\t\t\tkind: \"call\",\n\t\t\tcall: id,\n\t\t\thold,\n\t\t\tmethod,\n\t\t\t...(args === undefined ? {} : { args }),\n\t\t\t...(segments === undefined ? {} : { segments }),\n\t\t\ttrace,\n\t\t\t...(call.old ? { old: true as const } : {}),\n\t\t});\n\t}\n\n\t/**\n\t * Cancels `call`: a waiting one leaves the window and nothing is sent; one in flight sends `abort` and frees its\n\t * slot. Settling the caller is the caller's.\n\t */\n\t#cancel(call: OutgoingCall): void {\n\t\tif (call.id === undefined) {\n\t\t\tthis.#window.remove(call);\n\t\t\treturn;\n\t\t}\n\t\tif (!this.#calls.delete(call.id)) return;\n\t\tthis.#link.send({ kind: \"abort\", call: call.id });\n\t\tthis.#window.freed();\n\t}\n\n\t/**\n\t * The deflated parts of this side's own holds in `entries` that wait for an asynchronous inflate, each with the\n\t * link's decoded limit; `undefined` when none does (nothing allocated). Entries of holds this side gave up are not\n\t * inflated (Q1).\n\t */\n\t#deflated<E extends BoundEntry | StateEntry>(\n\t\tentries: readonly E[],\n\t\tpartOf: (member: E[\"members\"][number]) => Part,\n\t): [DeflatedPart, number][] | undefined {\n\t\tconst { limits } = this.#link;\n\t\tlet deflated: [DeflatedPart, number][] | undefined;\n\t\tfor (const entry of entries) {\n\t\t\tif (!this.#entries.has(entry.hold)) continue;\n\t\t\tfor (const member of entry.members) {\n\t\t\t\tconst part = partOf(member);\n\t\t\t\tif (!this.#link.inflates(part, limits)) continue;\n\t\t\t\tdeflated ??= [];\n\t\t\t\tdeflated.push([part, limits.decoded]);\n\t\t\t}\n\t\t}\n\t\treturn deflated;\n\t}\n\n\t/**\n\t * The deflated values of this side's own holds' events waiting for an asynchronous inflate, each with the link's\n\t * decoded limit; `undefined` when none does. Only values something listens to are inflated: those of holds this side\n\t * gave up (Q1), of a hold not live or of a member nobody listens to are dropped unopened (an index outside the bound\n\t * version throws here, a protocol error).\n\t */\n\t#deflatedEvents(events: readonly WireEvent[]): [DeflatedPart, number][] | undefined {\n\t\tconst { limits } = this.#link;\n\t\tlet deflated: [DeflatedPart, number][] | undefined;\n\t\tfor (const { hold, member, value } of events) {\n\t\t\tif (!this.#link.inflates(value, limits) || this.#entries.get(hold)?.eventNode(member) === undefined) continue;\n\t\t\tdeflated ??= [];\n\t\t\tdeflated.push([value, limits.decoded]);\n\t\t}\n\t\treturn deflated;\n\t}\n\n\t/**\n\t * One `event` message, its parts inflated: each entry goes to its holder (an unknown or released hold drops it), which\n\t * hands it to the host's event flush or drops it; then the message is consumed: one event `ack` per inbound turn,\n\t * sent after the flush delivered what it consumed (a microtask queued after the flush's).\n\t */\n\t#events(events: readonly WireEvent[]): void {\n\t\tfor (const { hold, member, at, value } of events) this.#entries.get(hold)?.event(member, at, value, this.#link);\n\t\tif (this.#consumed++ > 0) return;\n\t\tqueueMicrotask(() => {\n\t\t\tconst events = this.#consumed;\n\t\t\tthis.#consumed = 0;\n\t\t\tthis.#link.send({ kind: \"ack\", events });\n\t\t});\n\t}\n\n\t/**\n\t * One `bound` message: every entry prepared first (one that does not fit closes the link before anything changed)\n\t * and applied in one batch; then the message is acknowledged, and the references go live. An entry with a part past\n\t * the link's limits fails only its hold (`too_large/part`); the others apply.\n\t */\n\t#bound(holds: readonly BoundEntry[]): void {\n\t\tconst adoptions: (() => void)[] = [];\n\t\tconst bound: RemoteObject[] = [];\n\t\tlet oversized: [RemoteObject, ChordError][] | undefined;\n\t\tfor (const entry of holds) {\n\t\t\tconst holder = this.#entries.get(entry.hold);\n\t\t\tif (holder === undefined) continue;\n\t\t\ttry {\n\t\t\t\tadoptions.push(holder.prepareBound(entry, this.#link));\n\t\t\t} catch (error) {\n\t\t\t\tif (!isChordError(error, \"too_large\")) throw error;\n\t\t\t\toversized ??= [];\n\t\t\t\toversized.push([holder, error]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbound.push(holder);\n\t\t}\n\t\tthis.#adopt(adoptions);\n\t\t// Acknowledged before the references go live: the calls they send then (their parked ones) follow the `ack`, so\n\t\t// the provider decodes them by this binding's indexes, never by a rebinding's previous ones.\n\t\tthis.#link.send({ kind: \"ack\" });\n\t\t// After the batch: the references go live with every replica of the message in place.\n\t\tfor (const holder of bound) holder.wentLive();\n\t\tfor (const [holder, error] of oversized ?? []) holder.tooLarge(error);\n\t}\n\n\t/** One `state` message, as `#bound` does it. */\n\t#state(holds: readonly StateEntry[]): void {\n\t\tconst adoptions: (() => void)[] = [];\n\t\tlet oversized: [RemoteObject, ChordError][] | undefined;\n\t\tfor (const entry of holds) {\n\t\t\tconst holder = this.#entries.get(entry.hold);\n\t\t\tif (holder === undefined) continue;\n\t\t\ttry {\n\t\t\t\tadoptions.push(holder.prepare(entry, this.#link));\n\t\t\t} catch (error) {\n\t\t\t\tif (!isChordError(error, \"too_large\")) throw error;\n\t\t\t\toversized ??= [];\n\t\t\t\toversized.push([holder, error]);\n\t\t\t}\n\t\t}\n\t\tthis.#adopt(adoptions);\n\t\tfor (const [holder, error] of oversized ?? []) holder.tooLarge(error);\n\t\tthis.#link.send({ kind: \"ack\" });\n\t}\n\n\t/** Applies prepared entries in one batch of this host, so no watch or derive sees half a provider commit (W1). */\n\t#adopt(adoptions: readonly (() => void)[]): void {\n\t\tif (adoptions.length === 0) return;\n\t\tthis.#link.host.batch.commit(() => {\n\t\t\tfor (const adopt of adoptions) adopt();\n\t\t}, this.#link.context);\n\t}\n\n\t/**\n\t * `loading`: the hold's object, or its relay's upstream, starts over; its calls still waiting for a slot reject\n\t * `unavailable` (they may name a method of the old variant), its calls in flight wait for their reply (a provider's\n\t * `loading` keeps them; a relay's upstream drop answered them before).\n\t */\n\t#loading(hold: number): void {\n\t\tconst holder = this.#entries.get(hold);\n\t\tif (holder === undefined) return;\n\t\tconst error = new ChordError({ code: \"unavailable\", message: `hold ${hold}: rebinding` });\n\t\tfor (const call of this.#window.removeHold(hold)) call.reject(error);\n\t\tholder.loading();\n\t}\n\n\t/**\n\t * `failed`: its holder fails; its calls still waiting for a slot reject with the cause (a bound hold is unbound by it,\n\t * slice 7b; its calls in flight are rejected by the provider). A denial is access withdrawn under those calls as\n\t * under the ones in flight (slice 14 §2.3): `forbidden/revoked` for both; a call made after it meets the denied\n\t * reference and gets its plain `forbidden`.\n\t */\n\t#failed(message: Extract<Message, { readonly kind: \"failed\" }>): void {\n\t\tconst holder = this.#entries.get(message.hold);\n\t\tif (holder === undefined) return;\n\t\tconst error = asChordError(errorFromWire(message.cause.error), `hold ${message.hold}`);\n\t\tconst rejected = message.cause.kind === \"denied\" ? revoked(holder.label, error) : error;\n\t\tfor (const call of this.#window.removeHold(message.hold)) call.reject(rejected);\n\t\tholder.failed(message);\n\t}\n\n\t/**\n\t * `gone`: one for a hold this side gave up is ignored (Q1); the holder ends, which forgets its hold here and fails\n\t * its calls.\n\t */\n\t#gone(message: Extract<Message, { readonly kind: \"gone\" }>): void {\n\t\tconst holder = this.#entries.get(message.hold);\n\t\tif (holder === undefined) return;\n\t\tholder.lost(asChordError(errorFromWire(message.error), `hold ${message.hold}`));\n\t}\n\n\t/**\n\t * A reply: its call settles with the parsed result or the error. A result past the link's limits rejects the call\n\t * `too_large/part`. A malformed part rejects the call `unavailable` and throws (a protocol error: the link closes).\n\t * A result to inflate asynchronously is inflated first (for a call still waiting), then handled again.\n\t */\n\t#reply(reply: Reply): void | Promise<void> {\n\t\tconst call = this.#calls.get(reply.call);\n\t\tif (call === undefined) return;\n\t\tconst link = this.#link;\n\t\tif (reply.kind === \"result\" && link.inflates(reply.value, link.limits)) {\n\t\t\treturn link.inflate([[reply.value, link.limits.decoded]], () => this.#reply(reply));\n\t\t}\n\t\tthis.#calls.delete(reply.call);\n\t\tthis.#window.freed();\n\t\ttry {\n\t\t\tif (reply.kind === \"error\") call.reject(errorFromWire(reply.error));\n\t\t\telse if (reply.value === undefined) call.resolve(null);\n\t\t\telse call.resolve(parsePayload(link.openPart(reply.value, link.limits, link.context), reply.segments));\n\t\t} catch (error) {\n\t\t\tif (isChordError(error, \"too_large\")) {\n\t\t\t\tcall.reject(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcall.reject(new ChordError({ code: \"unavailable\", message: `call ${reply.call}: a malformed reply` }));\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/** Fails `hold`'s calls in flight and waiting with `error`; each in-flight one frees its slot. */\n\t#failCalls(hold: number, error: ChordError): void {\n\t\t// Waiting ones first: a freed slot must not send one of them.\n\t\tconst failed = this.#window.removeHold(hold);\n\t\tfor (const [id, call] of this.#calls) {\n\t\t\tif (call.hold !== hold) continue;\n\t\t\tthis.#calls.delete(id);\n\t\t\tthis.#window.freed();\n\t\t\tfailed.push(call);\n\t\t}\n\t\tfor (const call of failed) call.reject(error);\n\t}\n}\n"]}
|