@earendil-works/chord 1.4.0 → 1.5.0
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 +41 -0
- package/README.md +79 -14
- package/dist/cell.d.ts +7 -7
- package/dist/cell.d.ts.map +1 -1
- package/dist/cell.js.map +1 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/index.js.map +1 -1
- package/dist/contract.d.ts +51 -52
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +19 -24
- package/dist/contract.js.map +1 -1
- package/dist/delta/apply-immutable-trusted.js +3 -4
- package/dist/delta/apply-immutable-trusted.js.map +1 -1
- package/dist/delta/diff.d.ts.map +1 -1
- package/dist/delta/diff.js +5 -3
- package/dist/delta/diff.js.map +1 -1
- package/dist/delta/index.d.ts +9 -1
- package/dist/delta/index.d.ts.map +1 -1
- package/dist/delta/index.js +15 -11
- package/dist/delta/index.js.map +1 -1
- package/dist/delta/pending.d.ts +36 -0
- package/dist/delta/pending.d.ts.map +1 -0
- package/dist/delta/pending.js +143 -0
- package/dist/delta/pending.js.map +1 -0
- package/dist/delta/tracker.d.ts +12 -0
- package/dist/delta/tracker.d.ts.map +1 -1
- package/dist/delta/tracker.js +109 -39
- package/dist/delta/tracker.js.map +1 -1
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +9 -7
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/next/contracts/accepts.d.ts +81 -0
- package/dist/next/contracts/accepts.d.ts.map +1 -0
- package/dist/next/contracts/accepts.js +123 -0
- package/dist/next/contracts/accepts.js.map +1 -0
- package/dist/next/contracts/contract.d.ts +121 -0
- package/dist/next/contracts/contract.d.ts.map +1 -0
- package/dist/next/contracts/contract.js +50 -0
- package/dist/next/contracts/contract.js.map +1 -0
- package/dist/next/contracts/declare.d.ts +107 -0
- package/dist/next/contracts/declare.d.ts.map +1 -0
- package/dist/next/contracts/declare.js +136 -0
- package/dist/next/contracts/declare.js.map +1 -0
- package/dist/next/contracts/evolve.d.ts +92 -0
- package/dist/next/contracts/evolve.d.ts.map +1 -0
- package/dist/next/contracts/evolve.js +179 -0
- package/dist/next/contracts/evolve.js.map +1 -0
- package/dist/next/contracts/fingerprint.d.ts +16 -0
- package/dist/next/contracts/fingerprint.d.ts.map +1 -0
- package/dist/next/contracts/fingerprint.js +50 -0
- package/dist/next/contracts/fingerprint.js.map +1 -0
- package/dist/next/contracts/history.d.ts +71 -0
- package/dist/next/contracts/history.d.ts.map +1 -0
- package/dist/next/contracts/history.js +3 -0
- package/dist/next/contracts/history.js.map +1 -0
- package/dist/next/contracts/host-kind.d.ts +40 -0
- package/dist/next/contracts/host-kind.d.ts.map +1 -0
- package/dist/next/contracts/host-kind.js +37 -0
- package/dist/next/contracts/host-kind.js.map +1 -0
- package/dist/next/contracts/index.d.ts +7 -0
- package/dist/next/contracts/index.d.ts.map +1 -0
- package/dist/next/contracts/index.js +6 -0
- package/dist/next/contracts/index.js.map +1 -0
- package/dist/next/contracts/internal.d.ts +10 -0
- package/dist/next/contracts/internal.d.ts.map +1 -0
- package/dist/next/contracts/internal.js +9 -0
- package/dist/next/contracts/internal.js.map +1 -0
- package/dist/next/contracts/names.d.ts +3 -0
- package/dist/next/contracts/names.d.ts.map +1 -0
- package/dist/next/contracts/names.js +13 -0
- package/dist/next/contracts/names.js.map +1 -0
- package/dist/next/contracts/params.d.ts +28 -0
- package/dist/next/contracts/params.d.ts.map +1 -0
- package/dist/next/contracts/params.js +50 -0
- package/dist/next/contracts/params.js.map +1 -0
- package/dist/next/contracts/schema.d.ts +102 -0
- package/dist/next/contracts/schema.d.ts.map +1 -0
- package/dist/next/contracts/schema.js +103 -0
- package/dist/next/contracts/schema.js.map +1 -0
- package/dist/next/contracts/snapshot.d.ts +16 -0
- package/dist/next/contracts/snapshot.d.ts.map +1 -0
- package/dist/next/contracts/snapshot.js +167 -0
- package/dist/next/contracts/snapshot.js.map +1 -0
- package/dist/next/data/args.d.ts +50 -0
- package/dist/next/data/args.d.ts.map +1 -0
- package/dist/next/data/args.js +83 -0
- package/dist/next/data/args.js.map +1 -0
- package/dist/next/data/errors.d.ts +73 -0
- package/dist/next/data/errors.d.ts.map +1 -0
- package/dist/next/data/errors.js +107 -0
- package/dist/next/data/errors.js.map +1 -0
- package/dist/next/data/failure.d.ts +26 -0
- package/dist/next/data/failure.d.ts.map +1 -0
- package/dist/next/data/failure.js +72 -0
- package/dist/next/data/failure.js.map +1 -0
- package/dist/next/data/index.d.ts +4 -0
- package/dist/next/data/index.d.ts.map +1 -0
- package/dist/next/data/index.js +4 -0
- package/dist/next/data/index.js.map +1 -0
- package/dist/next/data/internal.d.ts +7 -0
- package/dist/next/data/internal.d.ts.map +1 -0
- package/dist/next/data/internal.js +8 -0
- package/dist/next/data/internal.js.map +1 -0
- package/dist/next/data/params.d.ts +20 -0
- package/dist/next/data/params.d.ts.map +1 -0
- package/dist/next/data/params.js +31 -0
- package/dist/next/data/params.js.map +1 -0
- package/dist/next/data/principal.d.ts +17 -0
- package/dist/next/data/principal.d.ts.map +1 -0
- package/dist/next/data/principal.js +41 -0
- package/dist/next/data/principal.js.map +1 -0
- package/dist/next/data/validator.d.ts +12 -0
- package/dist/next/data/validator.d.ts.map +1 -0
- package/dist/next/data/validator.js +34 -0
- package/dist/next/data/validator.js.map +1 -0
- package/dist/next/documents/address-source.d.ts +20 -0
- package/dist/next/documents/address-source.d.ts.map +1 -0
- package/dist/next/documents/address-source.js +44 -0
- package/dist/next/documents/address-source.js.map +1 -0
- package/dist/next/documents/definition.d.ts +84 -0
- package/dist/next/documents/definition.d.ts.map +1 -0
- package/dist/next/documents/definition.js +73 -0
- package/dist/next/documents/definition.js.map +1 -0
- package/dist/next/documents/documents.d.ts +106 -0
- package/dist/next/documents/documents.d.ts.map +1 -0
- package/dist/next/documents/documents.js +224 -0
- package/dist/next/documents/documents.js.map +1 -0
- package/dist/next/documents/fence.d.ts +9 -0
- package/dist/next/documents/fence.d.ts.map +1 -0
- package/dist/next/documents/fence.js +15 -0
- package/dist/next/documents/fence.js.map +1 -0
- package/dist/next/documents/handles.d.ts +76 -0
- package/dist/next/documents/handles.d.ts.map +1 -0
- package/dist/next/documents/handles.js +66 -0
- package/dist/next/documents/handles.js.map +1 -0
- package/dist/next/documents/index.d.ts +4 -0
- package/dist/next/documents/index.d.ts.map +1 -0
- package/dist/next/documents/index.js +3 -0
- package/dist/next/documents/index.js.map +1 -0
- package/dist/next/documents/internal.d.ts +9 -0
- package/dist/next/documents/internal.d.ts.map +1 -0
- package/dist/next/documents/internal.js +9 -0
- package/dist/next/documents/internal.js.map +1 -0
- package/dist/next/documents/keyed-slot.d.ts +103 -0
- package/dist/next/documents/keyed-slot.d.ts.map +1 -0
- package/dist/next/documents/keyed-slot.js +395 -0
- package/dist/next/documents/keyed-slot.js.map +1 -0
- package/dist/next/documents/line.d.ts +7 -0
- package/dist/next/documents/line.d.ts.map +1 -0
- package/dist/next/documents/line.js +14 -0
- package/dist/next/documents/line.js.map +1 -0
- package/dist/next/documents/persistence.d.ts +104 -0
- package/dist/next/documents/persistence.d.ts.map +1 -0
- package/dist/next/documents/persistence.js +128 -0
- package/dist/next/documents/persistence.js.map +1 -0
- package/dist/next/documents/residency.d.ts +31 -0
- package/dist/next/documents/residency.d.ts.map +1 -0
- package/dist/next/documents/residency.js +93 -0
- package/dist/next/documents/residency.js.map +1 -0
- package/dist/next/documents/slot.d.ts +109 -0
- package/dist/next/documents/slot.d.ts.map +1 -0
- package/dist/next/documents/slot.js +181 -0
- package/dist/next/documents/slot.js.map +1 -0
- package/dist/next/documents/transaction.d.ts +133 -0
- package/dist/next/documents/transaction.d.ts.map +1 -0
- package/dist/next/documents/transaction.js +409 -0
- package/dist/next/documents/transaction.js.map +1 -0
- package/dist/next/host/activity.d.ts +31 -0
- package/dist/next/host/activity.d.ts.map +1 -0
- package/dist/next/host/activity.js +40 -0
- package/dist/next/host/activity.js.map +1 -0
- package/dist/next/host/adapted.d.ts +49 -0
- package/dist/next/host/adapted.d.ts.map +1 -0
- package/dist/next/host/adapted.js +214 -0
- package/dist/next/host/adapted.js.map +1 -0
- package/dist/next/host/attempt.d.ts +278 -0
- package/dist/next/host/attempt.d.ts.map +1 -0
- package/dist/next/host/attempt.js +1072 -0
- package/dist/next/host/attempt.js.map +1 -0
- package/dist/next/host/backoff.d.ts +29 -0
- package/dist/next/host/backoff.d.ts.map +1 -0
- package/dist/next/host/backoff.js +69 -0
- package/dist/next/host/backoff.js.map +1 -0
- package/dist/next/host/ctx.d.ts +47 -0
- package/dist/next/host/ctx.d.ts.map +1 -0
- package/dist/next/host/ctx.js +108 -0
- package/dist/next/host/ctx.js.map +1 -0
- package/dist/next/host/deadline.d.ts +12 -0
- package/dist/next/host/deadline.d.ts.map +1 -0
- package/dist/next/host/deadline.js +40 -0
- package/dist/next/host/deadline.js.map +1 -0
- package/dist/next/host/dependencies.d.ts +65 -0
- package/dist/next/host/dependencies.d.ts.map +1 -0
- package/dist/next/host/dependencies.js +115 -0
- package/dist/next/host/dependencies.js.map +1 -0
- package/dist/next/host/destination.d.ts +48 -0
- package/dist/next/host/destination.d.ts.map +1 -0
- package/dist/next/host/destination.js +101 -0
- package/dist/next/host/destination.js.map +1 -0
- package/dist/next/host/facet.d.ts +79 -0
- package/dist/next/host/facet.d.ts.map +1 -0
- package/dist/next/host/facet.js +55 -0
- package/dist/next/host/facet.js.map +1 -0
- package/dist/next/host/follow.d.ts +52 -0
- package/dist/next/host/follow.d.ts.map +1 -0
- package/dist/next/host/follow.js +207 -0
- package/dist/next/host/follow.js.map +1 -0
- package/dist/next/host/host.d.ts +495 -0
- package/dist/next/host/host.d.ts.map +1 -0
- package/dist/next/host/host.js +1075 -0
- package/dist/next/host/host.js.map +1 -0
- package/dist/next/host/index.d.ts +17 -0
- package/dist/next/host/index.d.ts.map +1 -0
- package/dist/next/host/index.js +6 -0
- package/dist/next/host/index.js.map +1 -0
- package/dist/next/host/internal.d.ts +10 -0
- package/dist/next/host/internal.d.ts.map +1 -0
- package/dist/next/host/internal.js +8 -0
- package/dist/next/host/internal.js.map +1 -0
- package/dist/next/host/members.d.ts +50 -0
- package/dist/next/host/members.d.ts.map +1 -0
- package/dist/next/host/members.js +107 -0
- package/dist/next/host/members.js.map +1 -0
- package/dist/next/host/native.d.ts +55 -0
- package/dist/next/host/native.d.ts.map +1 -0
- package/dist/next/host/native.js +92 -0
- package/dist/next/host/native.js.map +1 -0
- package/dist/next/host/object.d.ts +290 -0
- package/dist/next/host/object.d.ts.map +1 -0
- package/dist/next/host/object.js +1127 -0
- package/dist/next/host/object.js.map +1 -0
- package/dist/next/host/parked.d.ts +23 -0
- package/dist/next/host/parked.d.ts.map +1 -0
- package/dist/next/host/parked.js +79 -0
- package/dist/next/host/parked.js.map +1 -0
- package/dist/next/host/presence.d.ts +34 -0
- package/dist/next/host/presence.d.ts.map +1 -0
- package/dist/next/host/presence.js +117 -0
- package/dist/next/host/presence.js.map +1 -0
- package/dist/next/host/ref-state.d.ts +53 -0
- package/dist/next/host/ref-state.d.ts.map +1 -0
- package/dist/next/host/ref-state.js +83 -0
- package/dist/next/host/ref-state.js.map +1 -0
- package/dist/next/host/reference-keys.d.ts +36 -0
- package/dist/next/host/reference-keys.d.ts.map +1 -0
- package/dist/next/host/reference-keys.js +168 -0
- package/dist/next/host/reference-keys.js.map +1 -0
- package/dist/next/host/reference-source.d.ts +65 -0
- package/dist/next/host/reference-source.d.ts.map +1 -0
- package/dist/next/host/reference-source.js +285 -0
- package/dist/next/host/reference-source.js.map +1 -0
- package/dist/next/host/reference.d.ts +308 -0
- package/dist/next/host/reference.d.ts.map +1 -0
- package/dist/next/host/reference.js +775 -0
- package/dist/next/host/reference.js.map +1 -0
- package/dist/next/host/retry-on.d.ts +28 -0
- package/dist/next/host/retry-on.d.ts.map +1 -0
- package/dist/next/host/retry-on.js +52 -0
- package/dist/next/host/retry-on.js.map +1 -0
- package/dist/next/host/revocation.d.ts +16 -0
- package/dist/next/host/revocation.d.ts.map +1 -0
- package/dist/next/host/revocation.js +27 -0
- package/dist/next/host/revocation.js.map +1 -0
- package/dist/next/host/root.d.ts +27 -0
- package/dist/next/host/root.d.ts.map +1 -0
- package/dist/next/host/root.js +68 -0
- package/dist/next/host/root.js.map +1 -0
- package/dist/next/host/route.d.ts +64 -0
- package/dist/next/host/route.d.ts.map +1 -0
- package/dist/next/host/route.js +190 -0
- package/dist/next/host/route.js.map +1 -0
- package/dist/next/host/routines.d.ts +76 -0
- package/dist/next/host/routines.d.ts.map +1 -0
- package/dist/next/host/routines.js +350 -0
- package/dist/next/host/routines.js.map +1 -0
- package/dist/next/host/sleep.d.ts +9 -0
- package/dist/next/host/sleep.d.ts.map +1 -0
- package/dist/next/host/sleep.js +40 -0
- package/dist/next/host/sleep.js.map +1 -0
- package/dist/next/host/staging.d.ts +94 -0
- package/dist/next/host/staging.d.ts.map +1 -0
- package/dist/next/host/staging.js +302 -0
- package/dist/next/host/staging.js.map +1 -0
- package/dist/next/host/unbound.d.ts +30 -0
- package/dist/next/host/unbound.d.ts.map +1 -0
- package/dist/next/host/unbound.js +67 -0
- package/dist/next/host/unbound.js.map +1 -0
- package/dist/next/host/uuid.d.ts +3 -0
- package/dist/next/host/uuid.d.ts.map +1 -0
- package/dist/next/host/uuid.js +38 -0
- package/dist/next/host/uuid.js.map +1 -0
- package/dist/next/index.d.ts +28 -0
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +18 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/jobs/definition.d.ts +96 -0
- package/dist/next/jobs/definition.d.ts.map +1 -0
- package/dist/next/jobs/definition.js +83 -0
- package/dist/next/jobs/definition.js.map +1 -0
- package/dist/next/jobs/index.d.ts +5 -0
- package/dist/next/jobs/index.d.ts.map +1 -0
- package/dist/next/jobs/index.js +3 -0
- package/dist/next/jobs/index.js.map +1 -0
- package/dist/next/jobs/internal.d.ts +3 -0
- package/dist/next/jobs/internal.d.ts.map +1 -0
- package/dist/next/jobs/internal.js +4 -0
- package/dist/next/jobs/internal.js.map +1 -0
- package/dist/next/jobs/job.d.ts +152 -0
- package/dist/next/jobs/job.d.ts.map +1 -0
- package/dist/next/jobs/job.js +320 -0
- package/dist/next/jobs/job.js.map +1 -0
- package/dist/next/jobs/persisted.d.ts +38 -0
- package/dist/next/jobs/persisted.d.ts.map +1 -0
- package/dist/next/jobs/persisted.js +95 -0
- package/dist/next/jobs/persisted.js.map +1 -0
- package/dist/next/jobs/records.d.ts +231 -0
- package/dist/next/jobs/records.d.ts.map +1 -0
- package/dist/next/jobs/records.js +869 -0
- package/dist/next/jobs/records.js.map +1 -0
- package/dist/next/jobs/run-states.d.ts +69 -0
- package/dist/next/jobs/run-states.d.ts.map +1 -0
- package/dist/next/jobs/run-states.js +228 -0
- package/dist/next/jobs/run-states.js.map +1 -0
- package/dist/next/jobs/run.d.ts +113 -0
- package/dist/next/jobs/run.d.ts.map +1 -0
- package/dist/next/jobs/run.js +200 -0
- package/dist/next/jobs/run.js.map +1 -0
- package/dist/next/jobs/running.d.ts +44 -0
- package/dist/next/jobs/running.d.ts.map +1 -0
- package/dist/next/jobs/running.js +117 -0
- package/dist/next/jobs/running.js.map +1 -0
- package/dist/next/jobs/stored.d.ts +63 -0
- package/dist/next/jobs/stored.d.ts.map +1 -0
- package/dist/next/jobs/stored.js +55 -0
- package/dist/next/jobs/stored.js.map +1 -0
- package/dist/next/link/binary.d.ts +4 -0
- package/dist/next/link/binary.d.ts.map +1 -0
- package/dist/next/link/binary.js +534 -0
- package/dist/next/link/binary.js.map +1 -0
- package/dist/next/link/channel.d.ts +63 -0
- package/dist/next/link/channel.d.ts.map +1 -0
- package/dist/next/link/channel.js +202 -0
- package/dist/next/link/channel.js.map +1 -0
- package/dist/next/link/errors.d.ts +7 -0
- package/dist/next/link/errors.d.ts.map +1 -0
- package/dist/next/link/errors.js +21 -0
- package/dist/next/link/errors.js.map +1 -0
- package/dist/next/link/index.d.ts +8 -0
- package/dist/next/link/index.d.ts.map +1 -0
- package/dist/next/link/index.js +8 -0
- package/dist/next/link/index.js.map +1 -0
- package/dist/next/link/internal.d.ts +9 -0
- package/dist/next/link/internal.d.ts.map +1 -0
- package/dist/next/link/internal.js +10 -0
- package/dist/next/link/internal.js.map +1 -0
- package/dist/next/link/ipc.d.ts +22 -0
- package/dist/next/link/ipc.d.ts.map +1 -0
- package/dist/next/link/ipc.js +64 -0
- package/dist/next/link/ipc.js.map +1 -0
- package/dist/next/link/link.d.ts +34 -0
- package/dist/next/link/link.d.ts.map +1 -0
- package/dist/next/link/link.js +87 -0
- package/dist/next/link/link.js.map +1 -0
- package/dist/next/link/message.d.ts +249 -0
- package/dist/next/link/message.d.ts.map +1 -0
- package/dist/next/link/message.js +123 -0
- package/dist/next/link/message.js.map +1 -0
- package/dist/next/link/part.d.ts +80 -0
- package/dist/next/link/part.d.ts.map +1 -0
- package/dist/next/link/part.js +164 -0
- package/dist/next/link/part.js.map +1 -0
- package/dist/next/link/text.d.ts +6 -0
- package/dist/next/link/text.d.ts.map +1 -0
- package/dist/next/link/text.js +335 -0
- package/dist/next/link/text.js.map +1 -0
- package/dist/next/link/values.d.ts +40 -0
- package/dist/next/link/values.d.ts.map +1 -0
- package/dist/next/link/values.js +117 -0
- package/dist/next/link/values.js.map +1 -0
- package/dist/next/link/websocket.d.ts +26 -0
- package/dist/next/link/websocket.d.ts.map +1 -0
- package/dist/next/link/websocket.js +91 -0
- package/dist/next/link/websocket.js.map +1 -0
- package/dist/next/registries/contribution.d.ts +50 -0
- package/dist/next/registries/contribution.d.ts.map +1 -0
- package/dist/next/registries/contribution.js +129 -0
- package/dist/next/registries/contribution.js.map +1 -0
- package/dist/next/registries/entries.d.ts +18 -0
- package/dist/next/registries/entries.d.ts.map +1 -0
- package/dist/next/registries/entries.js +42 -0
- package/dist/next/registries/entries.js.map +1 -0
- package/dist/next/registries/index.d.ts +3 -0
- package/dist/next/registries/index.d.ts.map +1 -0
- package/dist/next/registries/index.js +5 -0
- package/dist/next/registries/index.js.map +1 -0
- package/dist/next/registries/internal.d.ts +4 -0
- package/dist/next/registries/internal.d.ts.map +1 -0
- package/dist/next/registries/internal.js +5 -0
- package/dist/next/registries/internal.js.map +1 -0
- package/dist/next/registries/record.d.ts +94 -0
- package/dist/next/registries/record.d.ts.map +1 -0
- package/dist/next/registries/record.js +253 -0
- package/dist/next/registries/record.js.map +1 -0
- package/dist/next/registries/registry.d.ts +74 -0
- package/dist/next/registries/registry.d.ts.map +1 -0
- package/dist/next/registries/registry.js +14 -0
- package/dist/next/registries/registry.js.map +1 -0
- package/dist/next/registries/value.d.ts +48 -0
- package/dist/next/registries/value.d.ts.map +1 -0
- package/dist/next/registries/value.js +199 -0
- package/dist/next/registries/value.js.map +1 -0
- package/dist/next/remote/calls.d.ts +25 -0
- package/dist/next/remote/calls.d.ts.map +1 -0
- package/dist/next/remote/calls.js +62 -0
- package/dist/next/remote/calls.js.map +1 -0
- package/dist/next/remote/consumer.d.ts +42 -0
- package/dist/next/remote/consumer.d.ts.map +1 -0
- package/dist/next/remote/consumer.js +343 -0
- package/dist/next/remote/consumer.js.map +1 -0
- package/dist/next/remote/hold.d.ts +130 -0
- package/dist/next/remote/hold.d.ts.map +1 -0
- package/dist/next/remote/hold.js +537 -0
- package/dist/next/remote/hold.js.map +1 -0
- package/dist/next/remote/host-link.d.ts +77 -0
- package/dist/next/remote/host-link.d.ts.map +1 -0
- package/dist/next/remote/host-link.js +182 -0
- package/dist/next/remote/host-link.js.map +1 -0
- package/dist/next/remote/internal.d.ts +6 -0
- package/dist/next/remote/internal.d.ts.map +1 -0
- package/dist/next/remote/internal.js +6 -0
- package/dist/next/remote/internal.js.map +1 -0
- package/dist/next/remote/path.d.ts +46 -0
- package/dist/next/remote/path.d.ts.map +1 -0
- package/dist/next/remote/path.js +73 -0
- package/dist/next/remote/path.js.map +1 -0
- package/dist/next/remote/provider.d.ts +76 -0
- package/dist/next/remote/provider.d.ts.map +1 -0
- package/dist/next/remote/provider.js +506 -0
- package/dist/next/remote/provider.js.map +1 -0
- package/dist/next/remote/relay.d.ts +58 -0
- package/dist/next/remote/relay.d.ts.map +1 -0
- package/dist/next/remote/relay.js +117 -0
- package/dist/next/remote/relay.js.map +1 -0
- package/dist/next/remote/remote-object.d.ts +133 -0
- package/dist/next/remote/remote-object.d.ts.map +1 -0
- package/dist/next/remote/remote-object.js +411 -0
- package/dist/next/remote/remote-object.js.map +1 -0
- package/dist/next/remote/replica.d.ts +59 -0
- package/dist/next/remote/replica.d.ts.map +1 -0
- package/dist/next/remote/replica.js +125 -0
- package/dist/next/remote/replica.js.map +1 -0
- package/dist/next/state/batch.d.ts +64 -0
- package/dist/next/state/batch.d.ts.map +1 -0
- package/dist/next/state/batch.js +163 -0
- package/dist/next/state/batch.js.map +1 -0
- package/dist/next/state/derive.d.ts +52 -0
- package/dist/next/state/derive.d.ts.map +1 -0
- package/dist/next/state/derive.js +182 -0
- package/dist/next/state/derive.js.map +1 -0
- package/dist/next/state/index.d.ts +6 -0
- package/dist/next/state/index.d.ts.map +1 -0
- package/dist/next/state/index.js +4 -0
- package/dist/next/state/index.js.map +1 -0
- package/dist/next/state/internal.d.ts +6 -0
- package/dist/next/state/internal.d.ts.map +1 -0
- package/dist/next/state/internal.js +8 -0
- package/dist/next/state/internal.js.map +1 -0
- package/dist/next/state/native-source.d.ts +106 -0
- package/dist/next/state/native-source.d.ts.map +1 -0
- package/dist/next/state/native-source.js +240 -0
- package/dist/next/state/native-source.js.map +1 -0
- package/dist/next/state/watchable.d.ts +114 -0
- package/dist/next/state/watchable.d.ts.map +1 -0
- package/dist/next/state/watchable.js +156 -0
- package/dist/next/state/watchable.js.map +1 -0
- package/dist/next/state/writable.d.ts +32 -0
- package/dist/next/state/writable.d.ts.map +1 -0
- package/dist/next/state/writable.js +49 -0
- package/dist/next/state/writable.js.map +1 -0
- package/dist/next/store/adapter.d.ts +67 -0
- package/dist/next/store/adapter.d.ts.map +1 -0
- package/dist/next/store/adapter.js +118 -0
- package/dist/next/store/adapter.js.map +1 -0
- package/dist/next/store/allocator.d.ts +17 -0
- package/dist/next/store/allocator.d.ts.map +1 -0
- package/dist/next/store/allocator.js +30 -0
- package/dist/next/store/allocator.js.map +1 -0
- package/dist/next/store/applier.d.ts +8 -0
- package/dist/next/store/applier.d.ts.map +1 -0
- package/dist/next/store/applier.js +375 -0
- package/dist/next/store/applier.js.map +1 -0
- package/dist/next/store/apply-batch.d.ts +12 -0
- package/dist/next/store/apply-batch.d.ts.map +1 -0
- package/dist/next/store/apply-batch.js +83 -0
- package/dist/next/store/apply-batch.js.map +1 -0
- package/dist/next/store/archive.d.ts +32 -0
- package/dist/next/store/archive.d.ts.map +1 -0
- package/dist/next/store/archive.js +129 -0
- package/dist/next/store/archive.js.map +1 -0
- package/dist/next/store/backend.d.ts +10 -0
- package/dist/next/store/backend.d.ts.map +1 -0
- package/dist/next/store/backend.js +15 -0
- package/dist/next/store/backend.js.map +1 -0
- package/dist/next/store/catalog.d.ts +24 -0
- package/dist/next/store/catalog.d.ts.map +1 -0
- package/dist/next/store/catalog.js +17 -0
- package/dist/next/store/catalog.js.map +1 -0
- package/dist/next/store/claims.d.ts +23 -0
- package/dist/next/store/claims.d.ts.map +1 -0
- package/dist/next/store/claims.js +65 -0
- package/dist/next/store/claims.js.map +1 -0
- package/dist/next/store/columns.d.ts +77 -0
- package/dist/next/store/columns.d.ts.map +1 -0
- package/dist/next/store/columns.js +77 -0
- package/dist/next/store/columns.js.map +1 -0
- package/dist/next/store/engine.d.ts +176 -0
- package/dist/next/store/engine.d.ts.map +1 -0
- package/dist/next/store/engine.js +283 -0
- package/dist/next/store/engine.js.map +1 -0
- package/dist/next/store/evaluate.d.ts +17 -0
- package/dist/next/store/evaluate.d.ts.map +1 -0
- package/dist/next/store/evaluate.js +128 -0
- package/dist/next/store/evaluate.js.map +1 -0
- package/dist/next/store/export.d.ts +17 -0
- package/dist/next/store/export.d.ts.map +1 -0
- package/dist/next/store/export.js +200 -0
- package/dist/next/store/export.js.map +1 -0
- package/dist/next/store/expression.d.ts +150 -0
- package/dist/next/store/expression.d.ts.map +1 -0
- package/dist/next/store/expression.js +268 -0
- package/dist/next/store/expression.js.map +1 -0
- package/dist/next/store/import.d.ts +10 -0
- package/dist/next/store/import.d.ts.map +1 -0
- package/dist/next/store/import.js +276 -0
- package/dist/next/store/import.js.map +1 -0
- package/dist/next/store/index.d.ts +16 -0
- package/dist/next/store/index.d.ts.map +1 -0
- package/dist/next/store/index.js +13 -0
- package/dist/next/store/index.js.map +1 -0
- package/dist/next/store/json-column.d.ts +33 -0
- package/dist/next/store/json-column.d.ts.map +1 -0
- package/dist/next/store/json-column.js +61 -0
- package/dist/next/store/json-column.js.map +1 -0
- package/dist/next/store/jsonl.d.ts +9 -0
- package/dist/next/store/jsonl.d.ts.map +1 -0
- package/dist/next/store/jsonl.js +61 -0
- package/dist/next/store/jsonl.js.map +1 -0
- package/dist/next/store/outbox.d.ts +26 -0
- package/dist/next/store/outbox.d.ts.map +1 -0
- package/dist/next/store/outbox.js +80 -0
- package/dist/next/store/outbox.js.map +1 -0
- package/dist/next/store/query.d.ts +39 -0
- package/dist/next/store/query.d.ts.map +1 -0
- package/dist/next/store/query.js +97 -0
- package/dist/next/store/query.js.map +1 -0
- package/dist/next/store/refusal.d.ts +15 -0
- package/dist/next/store/refusal.d.ts.map +1 -0
- package/dist/next/store/refusal.js +36 -0
- package/dist/next/store/refusal.js.map +1 -0
- package/dist/next/store/rows.d.ts +80 -0
- package/dist/next/store/rows.d.ts.map +1 -0
- package/dist/next/store/rows.js +183 -0
- package/dist/next/store/rows.js.map +1 -0
- package/dist/next/store/schema.d.ts +25 -0
- package/dist/next/store/schema.d.ts.map +1 -0
- package/dist/next/store/schema.js +115 -0
- package/dist/next/store/schema.js.map +1 -0
- package/dist/next/store/sql.d.ts +73 -0
- package/dist/next/store/sql.d.ts.map +1 -0
- package/dist/next/store/sql.js +234 -0
- package/dist/next/store/sql.js.map +1 -0
- package/dist/next/store/step.d.ts +48 -0
- package/dist/next/store/step.d.ts.map +1 -0
- package/dist/next/store/step.js +50 -0
- package/dist/next/store/step.js.map +1 -0
- package/dist/next/store/store.d.ts +161 -0
- package/dist/next/store/store.d.ts.map +1 -0
- package/dist/next/store/store.js +627 -0
- package/dist/next/store/store.js.map +1 -0
- package/dist/next/store/table-changes.d.ts +29 -0
- package/dist/next/store/table-changes.d.ts.map +1 -0
- package/dist/next/store/table-changes.js +102 -0
- package/dist/next/store/table-changes.js.map +1 -0
- package/dist/next/store/table-evolve.d.ts +74 -0
- package/dist/next/store/table-evolve.d.ts.map +1 -0
- package/dist/next/store/table-evolve.js +201 -0
- package/dist/next/store/table-evolve.js.map +1 -0
- package/dist/next/store/table-handle.d.ts +67 -0
- package/dist/next/store/table-handle.d.ts.map +1 -0
- package/dist/next/store/table-handle.js +101 -0
- package/dist/next/store/table-handle.js.map +1 -0
- package/dist/next/store/table-history.d.ts +75 -0
- package/dist/next/store/table-history.d.ts.map +1 -0
- package/dist/next/store/table-history.js +42 -0
- package/dist/next/store/table-history.js.map +1 -0
- package/dist/next/store/table-migration.d.ts +16 -0
- package/dist/next/store/table-migration.d.ts.map +1 -0
- package/dist/next/store/table-migration.js +202 -0
- package/dist/next/store/table-migration.js.map +1 -0
- package/dist/next/store/table-writes.d.ts +125 -0
- package/dist/next/store/table-writes.d.ts.map +1 -0
- package/dist/next/store/table-writes.js +165 -0
- package/dist/next/store/table-writes.js.map +1 -0
- package/dist/next/store/table.d.ts +80 -0
- package/dist/next/store/table.d.ts.map +1 -0
- package/dist/next/store/table.js +103 -0
- package/dist/next/store/table.js.map +1 -0
- package/dist/next/store/text.d.ts +14 -0
- package/dist/next/store/text.d.ts.map +1 -0
- package/dist/next/store/text.js +51 -0
- package/dist/next/store/text.js.map +1 -0
- package/dist/next/store/writes.d.ts +5 -0
- package/dist/next/store/writes.d.ts.map +1 -0
- package/dist/next/store/writes.js +4 -0
- package/dist/next/store/writes.js.map +1 -0
- package/dist/next-node/compression.d.ts +7 -0
- package/dist/next-node/compression.d.ts.map +1 -0
- package/dist/next-node/compression.js +24 -0
- package/dist/next-node/compression.js.map +1 -0
- package/dist/next-node/http/admission.d.ts +63 -0
- package/dist/next-node/http/admission.d.ts.map +1 -0
- package/dist/next-node/http/admission.js +134 -0
- package/dist/next-node/http/admission.js.map +1 -0
- package/dist/next-node/http/authenticate.d.ts +21 -0
- package/dist/next-node/http/authenticate.d.ts.map +1 -0
- package/dist/next-node/http/authenticate.js +34 -0
- package/dist/next-node/http/authenticate.js.map +1 -0
- package/dist/next-node/http/cookies.d.ts +24 -0
- package/dist/next-node/http/cookies.d.ts.map +1 -0
- package/dist/next-node/http/cookies.js +62 -0
- package/dist/next-node/http/cookies.js.map +1 -0
- package/dist/next-node/http/file.d.ts +23 -0
- package/dist/next-node/http/file.d.ts.map +1 -0
- package/dist/next-node/http/file.js +94 -0
- package/dist/next-node/http/file.js.map +1 -0
- package/dist/next-node/http/headers.d.ts +37 -0
- package/dist/next-node/http/headers.d.ts.map +1 -0
- package/dist/next-node/http/headers.js +129 -0
- package/dist/next-node/http/headers.js.map +1 -0
- package/dist/next-node/http/http.d.ts +100 -0
- package/dist/next-node/http/http.d.ts.map +1 -0
- package/dist/next-node/http/http.js +462 -0
- package/dist/next-node/http/http.js.map +1 -0
- package/dist/next-node/http/incoming.d.ts +19 -0
- package/dist/next-node/http/incoming.d.ts.map +1 -0
- package/dist/next-node/http/incoming.js +31 -0
- package/dist/next-node/http/incoming.js.map +1 -0
- package/dist/next-node/http/index.d.ts +11 -0
- package/dist/next-node/http/index.d.ts.map +1 -0
- package/dist/next-node/http/index.js +12 -0
- package/dist/next-node/http/index.js.map +1 -0
- package/dist/next-node/http/node.d.ts +78 -0
- package/dist/next-node/http/node.d.ts.map +1 -0
- package/dist/next-node/http/node.js +291 -0
- package/dist/next-node/http/node.js.map +1 -0
- package/dist/next-node/http/request.d.ts +54 -0
- package/dist/next-node/http/request.d.ts.map +1 -0
- package/dist/next-node/http/request.js +116 -0
- package/dist/next-node/http/request.js.map +1 -0
- package/dist/next-node/http/response.d.ts +63 -0
- package/dist/next-node/http/response.d.ts.map +1 -0
- package/dist/next-node/http/response.js +202 -0
- package/dist/next-node/http/response.js.map +1 -0
- package/dist/next-node/http/router.d.ts +114 -0
- package/dist/next-node/http/router.d.ts.map +1 -0
- package/dist/next-node/http/router.js +261 -0
- package/dist/next-node/http/router.js.map +1 -0
- package/dist/next-node/http/upgrades.d.ts +58 -0
- package/dist/next-node/http/upgrades.d.ts.map +1 -0
- package/dist/next-node/http/upgrades.js +184 -0
- package/dist/next-node/http/upgrades.js.map +1 -0
- package/dist/next-node/plugins/build.d.ts +57 -0
- package/dist/next-node/plugins/build.d.ts.map +1 -0
- package/dist/next-node/plugins/build.js +334 -0
- package/dist/next-node/plugins/build.js.map +1 -0
- package/dist/next-node/plugins/discover.d.ts +36 -0
- package/dist/next-node/plugins/discover.d.ts.map +1 -0
- package/dist/next-node/plugins/discover.js +91 -0
- package/dist/next-node/plugins/discover.js.map +1 -0
- package/dist/next-node/plugins/evaluate.d.ts +33 -0
- package/dist/next-node/plugins/evaluate.d.ts.map +1 -0
- package/dist/next-node/plugins/evaluate.js +98 -0
- package/dist/next-node/plugins/evaluate.js.map +1 -0
- package/dist/next-node/plugins/index.d.ts +9 -0
- package/dist/next-node/plugins/index.d.ts.map +1 -0
- package/dist/next-node/plugins/index.js +11 -0
- package/dist/next-node/plugins/index.js.map +1 -0
- package/dist/next-node/plugins/install.d.ts +13 -0
- package/dist/next-node/plugins/install.d.ts.map +1 -0
- package/dist/next-node/plugins/install.js +37 -0
- package/dist/next-node/plugins/install.js.map +1 -0
- package/dist/next-node/plugins/plugins.d.ts +135 -0
- package/dist/next-node/plugins/plugins.d.ts.map +1 -0
- package/dist/next-node/plugins/plugins.js +206 -0
- package/dist/next-node/plugins/plugins.js.map +1 -0
- package/dist/next-node/plugins/runtime.d.ts +41 -0
- package/dist/next-node/plugins/runtime.d.ts.map +1 -0
- package/dist/next-node/plugins/runtime.js +136 -0
- package/dist/next-node/plugins/runtime.js.map +1 -0
- package/dist/next-node/plugins/stack.d.ts +16 -0
- package/dist/next-node/plugins/stack.d.ts.map +1 -0
- package/dist/next-node/plugins/stack.js +61 -0
- package/dist/next-node/plugins/stack.js.map +1 -0
- package/dist/next-node/plugins/watcher.d.ts +58 -0
- package/dist/next-node/plugins/watcher.d.ts.map +1 -0
- package/dist/next-node/plugins/watcher.js +281 -0
- package/dist/next-node/plugins/watcher.js.map +1 -0
- package/dist/next-node/workers/control.d.ts +83 -0
- package/dist/next-node/workers/control.d.ts.map +1 -0
- package/dist/next-node/workers/control.js +77 -0
- package/dist/next-node/workers/control.js.map +1 -0
- package/dist/next-node/workers/index.d.ts +5 -0
- package/dist/next-node/workers/index.d.ts.map +1 -0
- package/dist/next-node/workers/index.js +7 -0
- package/dist/next-node/workers/index.js.map +1 -0
- package/dist/next-node/workers/lock.d.ts +21 -0
- package/dist/next-node/workers/lock.d.ts.map +1 -0
- package/dist/next-node/workers/lock.js +137 -0
- package/dist/next-node/workers/lock.js.map +1 -0
- package/dist/next-node/workers/main.d.ts +46 -0
- package/dist/next-node/workers/main.d.ts.map +1 -0
- package/dist/next-node/workers/main.js +230 -0
- package/dist/next-node/workers/main.js.map +1 -0
- package/dist/next-node/workers/process.d.ts +42 -0
- package/dist/next-node/workers/process.d.ts.map +1 -0
- package/dist/next-node/workers/process.js +125 -0
- package/dist/next-node/workers/process.js.map +1 -0
- package/dist/next-node/workers/workers.d.ts +80 -0
- package/dist/next-node/workers/workers.d.ts.map +1 -0
- package/dist/next-node/workers/workers.js +572 -0
- package/dist/next-node/workers/workers.js.map +1 -0
- package/dist/object.d.ts +4 -4
- package/dist/object.d.ts.map +1 -1
- package/dist/object.js +3 -4
- package/dist/object.js.map +1 -1
- package/dist/output.d.ts +1 -1
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +4 -2
- package/dist/output.js.map +1 -1
- package/dist/remote.d.ts.map +1 -1
- package/dist/remote.js +2 -2
- package/dist/remote.js.map +1 -1
- package/dist/schema.d.ts +8 -4
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +180 -5
- package/dist/schema.js.map +1 -1
- package/dist/sqlite/cloudflare.d.ts +2 -0
- package/dist/sqlite/cloudflare.d.ts.map +1 -1
- package/dist/sqlite/cloudflare.js +10 -0
- package/dist/sqlite/cloudflare.js.map +1 -1
- package/dist/sqlite/database.d.ts +5 -2
- package/dist/sqlite/database.d.ts.map +1 -1
- package/dist/sqlite/database.js.map +1 -1
- package/dist/sqlite/node.d.ts +4 -1
- package/dist/sqlite/node.d.ts.map +1 -1
- package/dist/sqlite/node.js +22 -5
- package/dist/sqlite/node.js.map +1 -1
- 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/wire.d.ts +174 -193
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +81 -80
- package/dist/wire.js.map +1 -1
- package/docs/guide.md +15 -15
- package/docs/next/benchmarks.md +959 -0
- package/docs/next/decisions.md +2957 -0
- package/docs/next/dependencies/book.md +1671 -0
- package/docs/next/dependencies/index.html +2641 -0
- package/docs/next/dependencies/model.md +330 -0
- package/docs/next/design.md +2554 -0
- package/docs/next/durable-observers/book.md +432 -0
- package/docs/next/durable-observers/index.html +517 -0
- package/docs/next/flow-control/book.md +333 -0
- package/docs/next/flow-control/fold/index.html +265 -0
- package/docs/next/flow-control/index.html +548 -0
- package/docs/next/flow-control/window/index.html +228 -0
- package/docs/next/guide-plugins-hosts/book.md +607 -0
- package/docs/next/guide-plugins-hosts/index.html +652 -0
- package/docs/next/http-workers/book.md +378 -0
- package/docs/next/http-workers/index.html +515 -0
- package/docs/next/layer-1.md +311 -0
- package/docs/next/layer-2.md +216 -0
- package/docs/next/plugin-model/book.md +186 -0
- package/docs/next/plugin-model/index.html +310 -0
- package/docs/next/plugin-primer/book.md +273 -0
- package/docs/next/plugin-primer/index.html +430 -0
- package/docs/next/slice-1.md +236 -0
- package/docs/next/slice-10.md +285 -0
- package/docs/next/slice-11.md +93 -0
- package/docs/next/slice-2.md +174 -0
- package/docs/next/slice-3a.md +296 -0
- package/docs/next/slice-3b.md +197 -0
- package/docs/next/slice-4.md +146 -0
- package/docs/next/slice-4a.md +418 -0
- package/docs/next/slice-4b.md +208 -0
- package/docs/next/slice-5.md +281 -0
- package/docs/next/slice-6a.md +676 -0
- package/docs/next/slice-6b.md +332 -0
- package/docs/next/slice-7a.md +130 -0
- package/docs/next/slice-7b/book.md +608 -0
- package/docs/next/slice-7b/index.html +842 -0
- package/docs/next/slice-7b.md +255 -0
- package/docs/next/slice-7c.md +165 -0
- package/docs/next/slice-8.md +194 -0
- package/docs/next/slices.md +230 -0
- package/docs/next/store/book.md +665 -0
- package/docs/next/store/index.html +861 -0
- package/docs/next/store/walkthrough.md +193 -0
- package/docs/spec.md +9 -9
- package/docs/tutorial.md +26 -25
- package/package.json +22 -6
- package/src/delta/README.md +69 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// A persisted job's run records in its object's store (slice 6b §4.1, D5): the record document of each unsettled run
|
|
2
|
+
// (namespace `chord.jobs`, kind the job name, key the run id, `history: none`), written whole in the transactions that
|
|
3
|
+
// change the run, and read once per object when it first activates; for a run of another job version, also what is
|
|
4
|
+
// stored of its state document (`chord.job-states`), never decoded, so its drop retires it whatever the code declares.
|
|
5
|
+
import { changeDocument, createDocument, retireDocument } from "../store/engine.js";
|
|
6
|
+
import { RUN_RECORD, recordOf } from "./stored.js";
|
|
7
|
+
/** The keys a load reads per page. */
|
|
8
|
+
const KEYS_PAGE = 100;
|
|
9
|
+
/** The record documents of one persisted job's runs, and what is stored of each. */
|
|
10
|
+
export class PersistedRuns {
|
|
11
|
+
#records;
|
|
12
|
+
#states;
|
|
13
|
+
#stored = new Map();
|
|
14
|
+
/** What is stored of the state documents of runs of another job version, by run id. */
|
|
15
|
+
#blockedStates = new Map();
|
|
16
|
+
/** `records` and `states` are the job's record and state documents' store sides (`chord.jobs`, `chord.job-states`). */
|
|
17
|
+
constructor(records, states) {
|
|
18
|
+
this.#records = records;
|
|
19
|
+
this.#states = states;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Stages run `id`'s record `record` into `writes` (rule 8: serialized now): its creation, or a new base of what is
|
|
23
|
+
* stored; returns the adoption, which takes what the commit stored.
|
|
24
|
+
*/
|
|
25
|
+
stage(id, record, writes) {
|
|
26
|
+
const text = JSON.stringify(record);
|
|
27
|
+
const stored = this.#stored.get(id);
|
|
28
|
+
const { version, fingerprint } = RUN_RECORD;
|
|
29
|
+
const value = record;
|
|
30
|
+
if (stored === undefined) {
|
|
31
|
+
const created = { id: 0 };
|
|
32
|
+
writes.push(createDocument(this.#records.at(id), { version, fingerprint, value }, text, (made) => {
|
|
33
|
+
created.id = made;
|
|
34
|
+
}));
|
|
35
|
+
return () => this.#stored.set(id, { id: created.id, revision: 1, version, deltasSinceBase: 0 });
|
|
36
|
+
}
|
|
37
|
+
writes.push(changeDocument(stored.id, stored.revision, { kind: "base", version, fingerprint, value }, text));
|
|
38
|
+
return () => this.#stored.set(id, { ...stored, revision: stored.revision + 1 });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Stages the retirement of run `id`'s record into `writes` (the run settled or was dropped), and of its state
|
|
42
|
+
* document when the run is of another job version; the adoption forgets them.
|
|
43
|
+
*/
|
|
44
|
+
stageRetire(id, writes) {
|
|
45
|
+
const stored = this.#stored.get(id);
|
|
46
|
+
if (stored !== undefined)
|
|
47
|
+
writes.push(retireDocument(stored.id, stored.revision));
|
|
48
|
+
const state = this.#blockedStates.get(id);
|
|
49
|
+
if (state !== undefined)
|
|
50
|
+
writes.push(retireDocument(state.id, state.revision));
|
|
51
|
+
return () => {
|
|
52
|
+
this.#stored.delete(id);
|
|
53
|
+
this.#blockedStates.delete(id);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Finds what is stored of run `id`'s state document (a run of another job version), keeping it for the drop. */
|
|
57
|
+
async findBlockedState(id, context) {
|
|
58
|
+
const found = await this.#states.find(id, context);
|
|
59
|
+
if (found !== undefined)
|
|
60
|
+
this.#blockedStates.set(id, found.stored);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A run of another job version that a reload's code now takes (`retryBlocked`): its state document is the job's
|
|
64
|
+
* again (read, decoded and retired with its record as any run's), no longer one to retire undecoded.
|
|
65
|
+
*/
|
|
66
|
+
forgetBlockedState(id) {
|
|
67
|
+
this.#blockedStates.delete(id);
|
|
68
|
+
}
|
|
69
|
+
/** Every stored record of the job, in run id order, page by page with plain reads (activation holds the line). */
|
|
70
|
+
async load(context) {
|
|
71
|
+
const loaded = [];
|
|
72
|
+
let after;
|
|
73
|
+
for (;;) {
|
|
74
|
+
const keys = await this.#records.keys(after, KEYS_PAGE, context);
|
|
75
|
+
for (const id of keys) {
|
|
76
|
+
const document = await this.#records.read(id, context);
|
|
77
|
+
if (document === undefined)
|
|
78
|
+
continue;
|
|
79
|
+
const { record: stored, value, deltasSinceBase } = document;
|
|
80
|
+
const found = { id: stored.id, revision: stored.revision, version: stored.version, deltasSinceBase };
|
|
81
|
+
this.#stored.set(id, found);
|
|
82
|
+
loaded.push({ id, record: recordOf(value), stored: found });
|
|
83
|
+
}
|
|
84
|
+
if (keys.length < KEYS_PAGE)
|
|
85
|
+
return loaded;
|
|
86
|
+
after = keys.at(-1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/** The object's documents are dropped: nothing is known of the store any more. */
|
|
90
|
+
drop() {
|
|
91
|
+
this.#stored.clear();
|
|
92
|
+
this.#blockedStates.clear();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=persisted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAmB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;YAC3E,CAAC;YACD,IAAI,IAAI,CAAC,MAAM,GAAG,SAAS;gBAAE,OAAO,MAAM,CAAC;YAC3C,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACrB,CAAC;IACF,CAAC;IAED,kFAAkF;IAClF,IAAI;QACH,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;CACD","sourcesContent":["// A persisted job's run records in its object's store (slice 6b §4.1, D5): the record document of each unsettled run\n// (namespace `chord.jobs`, kind the job name, key the run id, `history: none`), written whole in the transactions that\n// change the run, and read once per object when it first activates; for a run of another job version, also what is\n// stored of its state document (`chord.job-states`), never decoded, so its drop retires it whatever the code declares.\n\nimport type { Context } from \"../../context/index.ts\";\nimport type { JsonObject } from \"../documents/index.ts\";\nimport type { Persistence, Stored } from \"../documents/internal.ts\";\nimport { changeDocument, createDocument, retireDocument } from \"../store/engine.ts\";\nimport type { StagedWrite } from \"../store/step.ts\";\nimport { RUN_RECORD, recordOf, type StoredRun } from \"./stored.ts\";\n\n/** A run record as a load found it: its run id, the record and what is stored of it. */\nexport type LoadedRecord = { readonly id: string; readonly record: StoredRun; readonly stored: Stored };\n\n/** The keys a load reads per page. */\nconst KEYS_PAGE = 100;\n\n/** The record documents of one persisted job's runs, and what is stored of each. */\nexport class PersistedRuns {\n\treadonly #records: Persistence;\n\treadonly #states: Persistence;\n\treadonly #stored = new Map<string, Stored>();\n\t/** What is stored of the state documents of runs of another job version, by run id. */\n\treadonly #blockedStates = new Map<string, Stored>();\n\n\t/** `records` and `states` are the job's record and state documents' store sides (`chord.jobs`, `chord.job-states`). */\n\tconstructor(records: Persistence, states: Persistence) {\n\t\tthis.#records = records;\n\t\tthis.#states = states;\n\t}\n\n\t/**\n\t * Stages run `id`'s record `record` into `writes` (rule 8: serialized now): its creation, or a new base of what is\n\t * stored; returns the adoption, which takes what the commit stored.\n\t */\n\tstage(id: string, record: StoredRun, writes: StagedWrite[]): () => void {\n\t\tconst text = JSON.stringify(record);\n\t\tconst stored = this.#stored.get(id);\n\t\tconst { version, fingerprint } = RUN_RECORD;\n\t\tconst value = record as unknown as JsonObject;\n\t\tif (stored === undefined) {\n\t\t\tconst created = { id: 0 };\n\t\t\twrites.push(\n\t\t\t\tcreateDocument(this.#records.at(id), { version, fingerprint, value }, text, (made) => {\n\t\t\t\t\tcreated.id = made;\n\t\t\t\t}),\n\t\t\t);\n\t\t\treturn () => this.#stored.set(id, { id: created.id, revision: 1, version, deltasSinceBase: 0 });\n\t\t}\n\t\twrites.push(changeDocument(stored.id, stored.revision, { kind: \"base\", version, fingerprint, value }, text));\n\t\treturn () => this.#stored.set(id, { ...stored, revision: stored.revision + 1 });\n\t}\n\n\t/**\n\t * Stages the retirement of run `id`'s record into `writes` (the run settled or was dropped), and of its state\n\t * document when the run is of another job version; the adoption forgets them.\n\t */\n\tstageRetire(id: string, writes: StagedWrite[]): () => void {\n\t\tconst stored = this.#stored.get(id);\n\t\tif (stored !== undefined) writes.push(retireDocument(stored.id, stored.revision));\n\t\tconst state = this.#blockedStates.get(id);\n\t\tif (state !== undefined) writes.push(retireDocument(state.id, state.revision));\n\t\treturn () => {\n\t\t\tthis.#stored.delete(id);\n\t\t\tthis.#blockedStates.delete(id);\n\t\t};\n\t}\n\n\t/** Finds what is stored of run `id`'s state document (a run of another job version), keeping it for the drop. */\n\tasync findBlockedState(id: string, context: Context): Promise<void> {\n\t\tconst found = await this.#states.find(id, context);\n\t\tif (found !== undefined) this.#blockedStates.set(id, found.stored);\n\t}\n\n\t/**\n\t * A run of another job version that a reload's code now takes (`retryBlocked`): its state document is the job's\n\t * again (read, decoded and retired with its record as any run's), no longer one to retire undecoded.\n\t */\n\tforgetBlockedState(id: string): void {\n\t\tthis.#blockedStates.delete(id);\n\t}\n\n\t/** Every stored record of the job, in run id order, page by page with plain reads (activation holds the line). */\n\tasync load(context: Context): Promise<LoadedRecord[]> {\n\t\tconst loaded: LoadedRecord[] = [];\n\t\tlet after: string | undefined;\n\t\tfor (;;) {\n\t\t\tconst keys = await this.#records.keys(after, KEYS_PAGE, context);\n\t\t\tfor (const id of keys) {\n\t\t\t\tconst document = await this.#records.read(id, context);\n\t\t\t\tif (document === undefined) continue;\n\t\t\t\tconst { record: stored, value, deltasSinceBase } = document;\n\t\t\t\tconst found = { id: stored.id, revision: stored.revision, version: stored.version, deltasSinceBase };\n\t\t\t\tthis.#stored.set(id, found);\n\t\t\t\tloaded.push({ id, record: recordOf(value as JsonObject), stored: found });\n\t\t\t}\n\t\t\tif (keys.length < KEYS_PAGE) return loaded;\n\t\t\tafter = keys.at(-1);\n\t\t}\n\t}\n\n\t/** The object's documents are dropped: nothing is known of the store any more. */\n\tdrop(): void {\n\t\tthis.#stored.clear();\n\t\tthis.#blockedStates.clear();\n\t}\n}\n"]}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { type Context } from "../../context/index.ts";
|
|
2
|
+
import type { JsonValue } from "../../json.ts";
|
|
3
|
+
import { ChordError } from "../data/index.ts";
|
|
4
|
+
import type { JsonObject } from "../documents/index.ts";
|
|
5
|
+
import { type Documents, type Staged, type Transaction } from "../documents/internal.ts";
|
|
6
|
+
import type { AnyHost } from "../host/internal.ts";
|
|
7
|
+
import type { ChordStore } from "../store/store.ts";
|
|
8
|
+
import type { JobDefinition, JobError } from "./definition.ts";
|
|
9
|
+
import type { CutReason, Job, StartOptions } from "./job.ts";
|
|
10
|
+
import { type AnyOutcome, type BlockedReason, JobRun, type Phase, type Run } from "./run.ts";
|
|
11
|
+
import { RunStates } from "./run-states.ts";
|
|
12
|
+
import { Running } from "./running.ts";
|
|
13
|
+
/** What a job's records need of their object. */
|
|
14
|
+
export type RecordsOwner = {
|
|
15
|
+
readonly label: string;
|
|
16
|
+
readonly host: AnyHost;
|
|
17
|
+
/** The object's context, without an abort signal: outcomes are recorded under it. */
|
|
18
|
+
readonly context: Context;
|
|
19
|
+
readonly documents: Documents;
|
|
20
|
+
/** The host's store and the object's owner name in it, when the object may persist (P3). */
|
|
21
|
+
readonly store: {
|
|
22
|
+
readonly store: ChordStore;
|
|
23
|
+
readonly owner: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
/** Counts running and finishing runs: they keep the object alive (`host.activity.jobs`). */
|
|
26
|
+
countRuns(delta: number): void;
|
|
27
|
+
/** A held state change must be stored by `deadline`: the object's one timer flushes it (D8). */
|
|
28
|
+
held(deadline: number): void;
|
|
29
|
+
};
|
|
30
|
+
/** How a run's invocation ended, before its outcome is recorded. */
|
|
31
|
+
export type Settled = {
|
|
32
|
+
readonly kind: "done";
|
|
33
|
+
readonly result: unknown;
|
|
34
|
+
} | {
|
|
35
|
+
readonly kind: "failed";
|
|
36
|
+
readonly error: JobError;
|
|
37
|
+
};
|
|
38
|
+
/** What a change sets on a run's record besides its phase transitions below (D6, D7, the finish failure count). */
|
|
39
|
+
type RunFields = {
|
|
40
|
+
readonly phase?: Phase;
|
|
41
|
+
readonly restarts?: number;
|
|
42
|
+
readonly finishFailures?: number;
|
|
43
|
+
readonly abortMarked?: true;
|
|
44
|
+
};
|
|
45
|
+
/** A change of the records, staged in a transaction and adopted in its commit step. */
|
|
46
|
+
type RecordChange = {
|
|
47
|
+
readonly kind: "create";
|
|
48
|
+
readonly run: JobRun;
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: "update";
|
|
51
|
+
readonly run: JobRun;
|
|
52
|
+
readonly fields: RunFields;
|
|
53
|
+
} | {
|
|
54
|
+
readonly kind: "outcome";
|
|
55
|
+
readonly run: JobRun;
|
|
56
|
+
readonly outcome: AnyOutcome;
|
|
57
|
+
} | {
|
|
58
|
+
readonly kind: "block";
|
|
59
|
+
readonly run: JobRun;
|
|
60
|
+
readonly reason: BlockedReason;
|
|
61
|
+
}
|
|
62
|
+
/** A blocked run is retried (a reload): back to `phase` (finishing with its outcome, or to be invoked). */
|
|
63
|
+
| {
|
|
64
|
+
readonly kind: "unblock";
|
|
65
|
+
readonly run: JobRun;
|
|
66
|
+
readonly phase: Phase;
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: "delete";
|
|
69
|
+
readonly run: JobRun;
|
|
70
|
+
} | {
|
|
71
|
+
readonly kind: "drop";
|
|
72
|
+
readonly run: JobRun;
|
|
73
|
+
};
|
|
74
|
+
/** What a commit step adopts of the records: a change, or a loaded run taken into memory as stored. */
|
|
75
|
+
type Adopted = RecordChange | {
|
|
76
|
+
readonly kind: "restore";
|
|
77
|
+
readonly run: JobRun;
|
|
78
|
+
};
|
|
79
|
+
/** One transaction's changes of one job: the runs it started (dedupe, concurrency) and whose finish it is. */
|
|
80
|
+
export type Staging = Staged & {
|
|
81
|
+
readonly started: JobRun[];
|
|
82
|
+
readonly changes: Adopted[];
|
|
83
|
+
/** What the transaction's store writes leave in memory, adopted with the changes. */
|
|
84
|
+
readonly adopts: (() => void)[];
|
|
85
|
+
finishing: JobRun | undefined;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* The records of one job name on one object. The live attempt's `Job` invokes and finishes its runs; between live
|
|
89
|
+
* attempts, committed runs not yet invoked and runs whose outcome is recorded wait for the next one.
|
|
90
|
+
*/
|
|
91
|
+
export declare class JobRecords {
|
|
92
|
+
#private;
|
|
93
|
+
/** The latest declaration's definition: a reload's new attempt redefines it; each run keeps its own version. */
|
|
94
|
+
definition: JobDefinition<unknown, unknown, unknown>;
|
|
95
|
+
readonly running: Running;
|
|
96
|
+
constructor(definition: JobDefinition<unknown, unknown, unknown>, owner: RecordsOwner);
|
|
97
|
+
/**
|
|
98
|
+
* Refuses a declaration of this job that its records cannot take (slice 7b §8): the same version with another
|
|
99
|
+
* fingerprint (its args, result or state schema changed without a version bump), or a state document definition
|
|
100
|
+
* the run documents refuse (`SlotDefinition.check`). A reload's staging checks it too.
|
|
101
|
+
*/
|
|
102
|
+
check(definition: JobDefinition<unknown, unknown, unknown>): void;
|
|
103
|
+
/**
|
|
104
|
+
* Takes a new attempt's declaration `definition` (another version after a reload, `ChordObject.checkJob` refused
|
|
105
|
+
* the same version with another fingerprint): new runs are of its version; the runs of others keep theirs, their
|
|
106
|
+
* `running` entries show their args mapped forwards (or blocked); their state documents keep their version until
|
|
107
|
+
* their run settles or moves to the new code.
|
|
108
|
+
*/
|
|
109
|
+
redefine(definition: JobDefinition<unknown, unknown, unknown>): void;
|
|
110
|
+
/**
|
|
111
|
+
* The latest live attempt does not declare the job (slice 7b §8): its runs not invoked and its finishing runs are
|
|
112
|
+
* blocked `version` (kept, not invoked) until a reload declares it again or they are aborted; a running
|
|
113
|
+
* invocation finishes and is blocked then.
|
|
114
|
+
*/
|
|
115
|
+
undeclare(): void;
|
|
116
|
+
/**
|
|
117
|
+
* A reload brought new code (its attempt is live): blocked runs are retried, once: a `finish_failed` one finishes
|
|
118
|
+
* again, a `version` one whose version the code now takes (its own, or an older one with an adapter) is invoked or
|
|
119
|
+
* finished; the others stay blocked. A persisted run blocked at its load has its state document read first.
|
|
120
|
+
*/
|
|
121
|
+
retryBlocked(context: Context): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* `run`'s args as the code of `definition` takes them (the current code's, or an invoking attempt's own): mapped
|
|
124
|
+
* forwards once per run and version when older.
|
|
125
|
+
*/
|
|
126
|
+
argsOf(run: JobRun, definition: JobDefinition<unknown, unknown, unknown>): JsonValue;
|
|
127
|
+
/**
|
|
128
|
+
* `run`'s outcome as the current code's `finish` gets it: an older run's args and result mapped forwards (once per
|
|
129
|
+
* run), its state document migrated to the current state definition.
|
|
130
|
+
*/
|
|
131
|
+
outcomeOf(run: JobRun, context: Context): AnyOutcome;
|
|
132
|
+
/** The job in errors: its object and its name. */
|
|
133
|
+
get name(): string;
|
|
134
|
+
/** Waits for the outcome of the unsettled run `id`; a settled or unknown id rejects `gone`. */
|
|
135
|
+
outcome(id: string, context: Context): Promise<AnyOutcome>;
|
|
136
|
+
/**
|
|
137
|
+
* Aborts run `id` (D7, Durable's `abortTask`): a blocked run is dropped; a finishing one is only marked; any other
|
|
138
|
+
* is marked (stored for a persisted job) in a transaction, its signal fired after the commit, outside the batch and
|
|
139
|
+
* the line, and the abort joins its invocation. `"marked"`, or `"terminal"` when no unsettled run has that id.
|
|
140
|
+
*/
|
|
141
|
+
abort(id: string, context: Context): Promise<"marked" | "terminal">;
|
|
142
|
+
/** See `Job.stage`: the checks and the staged creation, against the object's runs. */
|
|
143
|
+
stage(tx: Transaction, args: unknown, context: Context, options: StartOptions): Run<AnyOutcome>;
|
|
144
|
+
/**
|
|
145
|
+
* Stages `change` in `tx`: in the job's staging, adopted in the commit step, and for a persisted job the run's record
|
|
146
|
+
* written with it (rule 8: serialized now), and for a settled run its state document retired.
|
|
147
|
+
*/
|
|
148
|
+
change(tx: Transaction, change: RecordChange): void;
|
|
149
|
+
/** This job's changes in `tx`, made on the first. */
|
|
150
|
+
staging(tx: Transaction): Staging;
|
|
151
|
+
/**
|
|
152
|
+
* A persisted job's runs, loaded once per object at its first activation (slice 6b §4.2), again only after a load
|
|
153
|
+
* failed (design §9): each record read; a record of another version or fingerprint blocked (`version`) as stored,
|
|
154
|
+
* its state document left undecoded; the others' state documents read and decoded, a run cut off while `running`
|
|
155
|
+
* counted (`restarts + 1`; at the limit it ends `restart_limit`, reported `job_interrupted`), `stopped` and
|
|
156
|
+
* `pending` ones made `pending` again. The runs and their activation changes are adopted in one commit, all before
|
|
157
|
+
* anything runs; a failure leaves nothing loaded.
|
|
158
|
+
*/
|
|
159
|
+
load(context: Context): Promise<void>;
|
|
160
|
+
/** `job`, of the attempt that went live, invokes and finishes the runs from now on; the waiting ones first. */
|
|
161
|
+
attach(job: Job): void;
|
|
162
|
+
/**
|
|
163
|
+
* `job`'s attempt was sealed: its running invocations are cut off (`cut`), the runs it was finishing wait for the
|
|
164
|
+
* next live attempt.
|
|
165
|
+
*/
|
|
166
|
+
detach(job: Job, finishing: Iterable<JobRun>): void;
|
|
167
|
+
/**
|
|
168
|
+
* A run whose reservation its sealed attempt never committed waits for the next live attempt (dispatched now when one
|
|
169
|
+
* is attached already: the sealed attempt was detached at its seal).
|
|
170
|
+
*/
|
|
171
|
+
requeue(run: JobRun): void;
|
|
172
|
+
/** Records `run` running before its `run` is invoked (a persisted run's reservation: a crash after it counts). */
|
|
173
|
+
reserve(tx: Transaction, run: JobRun): void;
|
|
174
|
+
/** A state change of a run with restarts counted resets them in its commit (progress, D6). */
|
|
175
|
+
progressed(tx: Transaction, run: JobRun): void;
|
|
176
|
+
/**
|
|
177
|
+
* A run's invocation settled: its outcome is recorded (phase `finishing`) in a transaction of the object behind the
|
|
178
|
+
* state changes admitted before, so `outcome.state` has them; then it is finished on the live attempt.
|
|
179
|
+
*/
|
|
180
|
+
settled(run: JobRun, ended: Settled): void;
|
|
181
|
+
/**
|
|
182
|
+
* A running run whose attempt was sealed: its signal fires with `error`, its invocation is fenced (later state
|
|
183
|
+
* changes refused, the open one discarded, its settling ignored). In memory it ends `failed { aborted }` with
|
|
184
|
+
* `reason` (`reload` for a native restart, slice 7b §8), finished on the next live attempt; persisted it is stopped (R3), written back by the close writer and
|
|
185
|
+
* resumed by the next live attempt as after a clean close.
|
|
186
|
+
*/
|
|
187
|
+
cut(run: JobRun, error: ChordError, reason: CutReason): void;
|
|
188
|
+
/**
|
|
189
|
+
* Records `change` (a run's finish failure, its block, its drop) in a transaction of the object, if `run` is still
|
|
190
|
+
* one of its runs there. The object's end ends it.
|
|
191
|
+
*/
|
|
192
|
+
record(run: JobRun, change: RecordChange): Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* The close writer (slice 6b §4.2, Durable's `writeAtClose`): one commit past the seal writing the runs a clean stop
|
|
195
|
+
* cut off `stopped` and every held state change, straight to the store (the object's transactions are refused by
|
|
196
|
+
* now). Its failure is the store's; the records stay as they were (a crash counts them).
|
|
197
|
+
*/
|
|
198
|
+
writeAtClose(context: Context): Promise<void>;
|
|
199
|
+
/** Stores every held state change whose deadline passed (`now`), in one transaction of the object (D8). */
|
|
200
|
+
flushHeld(now: number): Promise<void>;
|
|
201
|
+
/** The earliest deadline of a held state change (`Infinity`: none). */
|
|
202
|
+
nextDeadline(): number;
|
|
203
|
+
/** The value of run `id`'s state document, `undefined` without one or once retired. */
|
|
204
|
+
stateOf(id: string): JsonObject | undefined;
|
|
205
|
+
/** The run state documents, for `ctx.state.change`; `undefined` without a state definition. */
|
|
206
|
+
get states(): RunStates | undefined;
|
|
207
|
+
/** Whether the job persists its runs. */
|
|
208
|
+
get persisted(): boolean;
|
|
209
|
+
/**
|
|
210
|
+
* The object ends: running runs' signals fire, every waiter rejects with `error`; blocked in-memory runs are
|
|
211
|
+
* dropped (reported), persisted ones keep their records; nothing finishes. The records stay readable until `drop`.
|
|
212
|
+
*/
|
|
213
|
+
end(error: ChordError): void;
|
|
214
|
+
/** Its object's documents are dropped: the runs, their state documents and `running`'s watches go. */
|
|
215
|
+
drop(): void;
|
|
216
|
+
/** Reports a run's failure, drop or interruption to the host. */
|
|
217
|
+
report(error: {
|
|
218
|
+
readonly kind: "job_failed" | "job_finish_failed";
|
|
219
|
+
readonly id: string;
|
|
220
|
+
readonly error: unknown;
|
|
221
|
+
} | {
|
|
222
|
+
readonly kind: "job_dropped";
|
|
223
|
+
readonly id: string;
|
|
224
|
+
} | {
|
|
225
|
+
readonly kind: "job_interrupted";
|
|
226
|
+
readonly id: string;
|
|
227
|
+
readonly restarts: number;
|
|
228
|
+
}): void;
|
|
229
|
+
}
|
|
230
|
+
export {};
|
|
231
|
+
//# sourceMappingURL=records.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../src/next/jobs/records.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,OAAO,EAAsB,MAAM,wBAAwB,CAAC;AAE1E,OAA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