@earendil-works/chord 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/README.md +50 -90
- package/dist/contracts/accepts.d.ts +81 -0
- package/dist/contracts/accepts.d.ts.map +1 -0
- package/dist/contracts/accepts.js.map +1 -0
- package/dist/contracts/contract.d.ts +121 -0
- package/dist/contracts/contract.d.ts.map +1 -0
- package/dist/contracts/contract.js.map +1 -0
- package/dist/contracts/declare.d.ts.map +1 -0
- package/dist/contracts/declare.js.map +1 -0
- package/dist/contracts/evolve.d.ts.map +1 -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.map +1 -0
- package/dist/contracts/history.d.ts.map +1 -0
- package/dist/contracts/history.js.map +1 -0
- package/dist/contracts/host-kind.d.ts.map +1 -0
- package/dist/contracts/host-kind.js.map +1 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/internal.d.ts.map +1 -0
- package/dist/contracts/internal.js.map +1 -0
- package/dist/contracts/names.d.ts.map +1 -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.map +1 -0
- package/dist/contracts/schema.d.ts.map +1 -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.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.map +1 -0
- package/dist/data/failure.js +77 -0
- package/dist/data/failure.js.map +1 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +5 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/internal.d.ts +7 -0
- package/dist/data/internal.d.ts.map +1 -0
- package/dist/data/internal.js +8 -0
- package/dist/data/internal.js.map +1 -0
- package/dist/data/params.d.ts +20 -0
- package/dist/data/params.d.ts.map +1 -0
- package/dist/data/params.js.map +1 -0
- package/dist/data/principal.d.ts +22 -0
- package/dist/data/principal.d.ts.map +1 -0
- package/dist/data/principal.js +49 -0
- package/dist/data/principal.js.map +1 -0
- package/dist/data/validator.d.ts +12 -0
- package/dist/data/validator.d.ts.map +1 -0
- package/dist/data/validator.js +35 -0
- package/dist/data/validator.js.map +1 -0
- package/dist/documents/address-source.d.ts +20 -0
- package/dist/documents/address-source.d.ts.map +1 -0
- package/dist/documents/address-source.js.map +1 -0
- package/dist/documents/definition.d.ts +84 -0
- package/dist/documents/definition.d.ts.map +1 -0
- package/dist/documents/definition.js +74 -0
- package/dist/documents/definition.js.map +1 -0
- package/dist/documents/documents.d.ts +126 -0
- package/dist/documents/documents.d.ts.map +1 -0
- package/dist/documents/documents.js +248 -0
- package/dist/documents/documents.js.map +1 -0
- package/dist/documents/fence.d.ts.map +1 -0
- package/dist/documents/fence.js.map +1 -0
- package/dist/documents/handles.d.ts +76 -0
- package/dist/documents/handles.d.ts.map +1 -0
- package/dist/documents/handles.js.map +1 -0
- package/dist/documents/index.d.ts.map +1 -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.map +1 -0
- package/dist/documents/keyed-slot.d.ts +103 -0
- package/dist/documents/keyed-slot.d.ts.map +1 -0
- package/dist/documents/keyed-slot.js +395 -0
- package/dist/documents/keyed-slot.js.map +1 -0
- package/dist/documents/line.d.ts.map +1 -0
- package/dist/documents/line.js.map +1 -0
- package/dist/documents/persistence.d.ts +104 -0
- package/dist/documents/persistence.d.ts.map +1 -0
- package/dist/documents/persistence.js +129 -0
- package/dist/documents/persistence.js.map +1 -0
- package/dist/documents/residency.d.ts +31 -0
- package/dist/documents/residency.d.ts.map +1 -0
- package/dist/documents/residency.js.map +1 -0
- package/dist/documents/slot.d.ts +109 -0
- package/dist/documents/slot.d.ts.map +1 -0
- package/dist/documents/slot.js +181 -0
- package/dist/documents/slot.js.map +1 -0
- package/dist/documents/transaction.d.ts +143 -0
- package/dist/documents/transaction.d.ts.map +1 -0
- package/dist/documents/transaction.js +442 -0
- package/dist/documents/transaction.js.map +1 -0
- package/dist/host/activity.d.ts +31 -0
- package/dist/host/activity.d.ts.map +1 -0
- package/dist/host/activity.js +40 -0
- package/dist/host/activity.js.map +1 -0
- package/dist/host/adapted.d.ts +49 -0
- package/dist/host/adapted.d.ts.map +1 -0
- package/dist/host/adapted.js.map +1 -0
- package/dist/host/attempt.d.ts +308 -0
- package/dist/host/attempt.d.ts.map +1 -0
- package/dist/host/attempt.js +1199 -0
- package/dist/host/attempt.js.map +1 -0
- package/dist/host/backoff.d.ts.map +1 -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.map +1 -0
- package/dist/host/deadline.js.map +1 -0
- package/dist/host/dependencies.d.ts.map +1 -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.map +1 -0
- package/dist/host/facet.d.ts +84 -0
- package/dist/host/facet.d.ts.map +1 -0
- package/dist/host/facet.js.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.map +1 -0
- package/dist/host/host.d.ts +571 -0
- package/dist/host/host.d.ts.map +1 -0
- package/dist/host/host.js +1318 -0
- package/dist/host/host.js.map +1 -0
- package/dist/host/index.d.ts +17 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/internal.d.ts +11 -0
- package/dist/host/internal.d.ts.map +1 -0
- package/dist/host/internal.js +9 -0
- package/dist/host/internal.js.map +1 -0
- package/dist/host/members.d.ts +50 -0
- package/dist/host/members.d.ts.map +1 -0
- package/dist/host/members.js.map +1 -0
- package/dist/host/native.d.ts +64 -0
- package/dist/host/native.d.ts.map +1 -0
- package/dist/host/native.js +126 -0
- package/dist/host/native.js.map +1 -0
- package/dist/host/object.d.ts +331 -0
- package/dist/host/object.d.ts.map +1 -0
- package/dist/host/object.js +1296 -0
- package/dist/host/object.js.map +1 -0
- package/dist/host/old-work.d.ts +34 -0
- package/dist/host/old-work.d.ts.map +1 -0
- package/dist/host/old-work.js +52 -0
- package/dist/host/old-work.js.map +1 -0
- package/dist/host/parked.d.ts +23 -0
- package/dist/host/parked.d.ts.map +1 -0
- package/dist/host/parked.js.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.map +1 -0
- package/dist/host/readiness.d.ts +27 -0
- package/dist/host/readiness.d.ts.map +1 -0
- package/dist/host/readiness.js +134 -0
- package/dist/host/readiness.js.map +1 -0
- package/dist/host/ref-state.d.ts +53 -0
- package/dist/host/ref-state.d.ts.map +1 -0
- package/dist/host/ref-state.js +83 -0
- package/dist/host/ref-state.js.map +1 -0
- package/dist/host/reference-keys.d.ts +36 -0
- package/dist/host/reference-keys.d.ts.map +1 -0
- package/dist/host/reference-keys.js +168 -0
- package/dist/host/reference-keys.js.map +1 -0
- package/dist/host/reference-source.d.ts +65 -0
- package/dist/host/reference-source.d.ts.map +1 -0
- package/dist/host/reference-source.js +285 -0
- package/dist/host/reference-source.js.map +1 -0
- package/dist/host/reference.d.ts +321 -0
- package/dist/host/reference.d.ts.map +1 -0
- package/dist/host/reference.js +797 -0
- package/dist/host/reference.js.map +1 -0
- package/dist/host/reload-cycle.d.ts +16 -0
- package/dist/host/reload-cycle.d.ts.map +1 -0
- package/dist/host/reload-cycle.js +81 -0
- package/dist/host/reload-cycle.js.map +1 -0
- package/dist/host/retry-on.d.ts.map +1 -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.map +1 -0
- package/dist/host/root.d.ts +37 -0
- package/dist/host/root.d.ts.map +1 -0
- package/dist/host/root.js +68 -0
- package/dist/host/root.js.map +1 -0
- package/dist/host/route.d.ts +64 -0
- package/dist/host/route.d.ts.map +1 -0
- package/dist/host/route.js +227 -0
- package/dist/host/route.js.map +1 -0
- package/dist/host/routines.d.ts +78 -0
- package/dist/host/routines.d.ts.map +1 -0
- package/dist/host/routines.js +398 -0
- package/dist/host/routines.js.map +1 -0
- package/dist/host/sleep.d.ts +9 -0
- package/dist/host/sleep.d.ts.map +1 -0
- package/dist/host/sleep.js.map +1 -0
- package/dist/host/staging.d.ts +94 -0
- package/dist/host/staging.d.ts.map +1 -0
- package/dist/host/staging.js +304 -0
- package/dist/host/staging.js.map +1 -0
- package/dist/host/unbound-clock.d.ts +23 -0
- package/dist/host/unbound-clock.d.ts.map +1 -0
- package/dist/host/unbound-clock.js +58 -0
- package/dist/host/unbound-clock.js.map +1 -0
- package/dist/host/unbound.d.ts +37 -0
- package/dist/host/unbound.d.ts.map +1 -0
- package/dist/host/unbound.js +88 -0
- package/dist/host/unbound.js.map +1 -0
- package/dist/host/uuid.d.ts.map +1 -0
- package/dist/host/uuid.js.map +1 -0
- package/dist/index.d.ts +29 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -10
- package/dist/index.js.map +1 -1
- package/dist/jobs/definition.d.ts.map +1 -0
- package/dist/jobs/definition.js.map +1 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/internal.d.ts.map +1 -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.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.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.map +1 -0
- package/dist/link/binary.d.ts.map +1 -0
- package/dist/link/binary.js +544 -0
- package/dist/link/binary.js.map +1 -0
- package/dist/link/channel.d.ts +68 -0
- package/dist/link/channel.d.ts.map +1 -0
- package/dist/link/channel.js +215 -0
- package/dist/link/channel.js.map +1 -0
- package/dist/link/errors.d.ts.map +1 -0
- package/dist/link/errors.js.map +1 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/internal.d.ts.map +1 -0
- package/dist/link/internal.js.map +1 -0
- package/dist/link/ipc.d.ts.map +1 -0
- package/dist/link/ipc.js.map +1 -0
- package/dist/link/link.d.ts.map +1 -0
- package/dist/link/link.js.map +1 -0
- package/dist/link/message.d.ts +262 -0
- package/dist/link/message.d.ts.map +1 -0
- package/dist/link/message.js +156 -0
- package/dist/link/message.js.map +1 -0
- package/dist/link/part.d.ts +80 -0
- package/dist/link/part.d.ts.map +1 -0
- package/dist/link/part.js +165 -0
- package/dist/link/part.js.map +1 -0
- package/dist/link/text.d.ts.map +1 -0
- package/dist/link/text.js +355 -0
- package/dist/link/text.js.map +1 -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.map +1 -0
- package/dist/link/websocket.js.map +1 -0
- package/dist/node/app/app.d.ts +269 -0
- package/dist/node/app/app.d.ts.map +1 -0
- package/dist/node/app/app.js +513 -0
- package/dist/node/app/app.js.map +1 -0
- package/dist/node/app/archive.d.ts +37 -0
- package/dist/node/app/archive.d.ts.map +1 -0
- package/dist/node/app/archive.js +204 -0
- package/dist/node/app/archive.js.map +1 -0
- package/dist/node/app/blobs.d.ts +23 -0
- package/dist/node/app/blobs.d.ts.map +1 -0
- package/dist/node/app/blobs.js +64 -0
- package/dist/node/app/blobs.js.map +1 -0
- package/dist/node/app/data.d.ts +35 -0
- package/dist/node/app/data.d.ts.map +1 -0
- package/dist/node/app/data.js +44 -0
- package/dist/node/app/data.js.map +1 -0
- package/dist/node/app/ephemeral-sessions.d.ts +20 -0
- package/dist/node/app/ephemeral-sessions.d.ts.map +1 -0
- package/dist/node/app/ephemeral-sessions.js +69 -0
- package/dist/node/app/ephemeral-sessions.js.map +1 -0
- package/dist/node/app/ephemeral.d.ts +11 -0
- package/dist/node/app/ephemeral.d.ts.map +1 -0
- package/dist/node/app/ephemeral.js +34 -0
- package/dist/node/app/ephemeral.js.map +1 -0
- package/dist/node/app/files-copy.d.ts +13 -0
- package/dist/node/app/files-copy.d.ts.map +1 -0
- package/dist/node/app/files-copy.js +86 -0
- package/dist/node/app/files-copy.js.map +1 -0
- package/dist/node/app/files-entry.d.ts +4 -0
- package/dist/node/app/files-entry.d.ts.map +1 -0
- package/dist/node/app/files-entry.js +7 -0
- package/dist/node/app/files-entry.js.map +1 -0
- package/dist/node/app/files-index.d.ts +180 -0
- package/dist/node/app/files-index.d.ts.map +1 -0
- package/dist/node/app/files-index.js +535 -0
- package/dist/node/app/files-index.js.map +1 -0
- package/dist/node/app/files.d.ts +363 -0
- package/dist/node/app/files.d.ts.map +1 -0
- package/dist/node/app/files.js +368 -0
- package/dist/node/app/files.js.map +1 -0
- package/dist/node/app/folder-views.d.ts +21 -0
- package/dist/node/app/folder-views.d.ts.map +1 -0
- package/dist/node/app/folder-views.js +55 -0
- package/dist/node/app/folder-views.js.map +1 -0
- package/dist/node/app/index.d.ts +12 -0
- package/dist/node/app/index.d.ts.map +1 -0
- package/dist/node/app/index.js +15 -0
- package/dist/node/app/index.js.map +1 -0
- package/dist/node/app/info.d.ts +66 -0
- package/dist/node/app/info.d.ts.map +1 -0
- package/dist/node/app/info.js +37 -0
- package/dist/node/app/info.js.map +1 -0
- package/dist/node/app/invite.d.ts +5 -0
- package/dist/node/app/invite.d.ts.map +1 -0
- package/dist/node/app/invite.js +64 -0
- package/dist/node/app/invite.js.map +1 -0
- package/dist/node/app/layout.d.ts +36 -0
- package/dist/node/app/layout.d.ts.map +1 -0
- package/dist/node/app/layout.js +87 -0
- package/dist/node/app/layout.js.map +1 -0
- package/dist/node/app/owner.d.ts +31 -0
- package/dist/node/app/owner.d.ts.map +1 -0
- package/dist/node/app/owner.js +104 -0
- package/dist/node/app/owner.js.map +1 -0
- package/dist/node/app/pairing.d.ts +55 -0
- package/dist/node/app/pairing.d.ts.map +1 -0
- package/dist/node/app/pairing.js +183 -0
- package/dist/node/app/pairing.js.map +1 -0
- package/dist/node/app/secrets.d.ts +16 -0
- package/dist/node/app/secrets.d.ts.map +1 -0
- package/dist/node/app/secrets.js +72 -0
- package/dist/node/app/secrets.js.map +1 -0
- package/dist/node/app/sessions.d.ts +72 -0
- package/dist/node/app/sessions.d.ts.map +1 -0
- package/dist/node/app/sessions.js +222 -0
- package/dist/node/app/sessions.js.map +1 -0
- package/dist/node/app/tar.d.ts +24 -0
- package/dist/node/app/tar.d.ts.map +1 -0
- package/dist/node/app/tar.js +167 -0
- package/dist/node/app/tar.js.map +1 -0
- package/dist/node/app/uploads.d.ts +37 -0
- package/dist/node/app/uploads.d.ts.map +1 -0
- package/dist/node/app/uploads.js +157 -0
- package/dist/node/app/uploads.js.map +1 -0
- package/dist/node/app/users.d.ts +37 -0
- package/dist/node/app/users.d.ts.map +1 -0
- package/dist/node/app/users.js +62 -0
- package/dist/node/app/users.js.map +1 -0
- package/dist/node/app/worker.d.ts +18 -0
- package/dist/node/app/worker.d.ts.map +1 -0
- package/dist/node/app/worker.js +84 -0
- package/dist/node/app/worker.js.map +1 -0
- package/dist/node/compression.d.ts +7 -0
- package/dist/node/compression.d.ts.map +1 -0
- package/dist/node/compression.js +25 -0
- package/dist/node/compression.js.map +1 -0
- package/dist/node/http/admission.d.ts.map +1 -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.map +1 -0
- package/dist/node/http/file.js.map +1 -0
- package/dist/node/http/headers.d.ts.map +1 -0
- package/dist/node/http/headers.js +136 -0
- package/dist/node/http/headers.js.map +1 -0
- package/dist/node/http/http.d.ts +111 -0
- package/dist/node/http/http.d.ts.map +1 -0
- package/dist/node/http/http.js +524 -0
- package/dist/node/http/http.js.map +1 -0
- package/dist/node/http/incoming.d.ts.map +1 -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.map +1 -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.map +1 -0
- package/dist/node/http/router.d.ts +132 -0
- package/dist/node/http/router.d.ts.map +1 -0
- package/dist/node/http/router.js +267 -0
- package/dist/node/http/router.js.map +1 -0
- package/dist/node/http/upgrades.d.ts +61 -0
- package/dist/node/http/upgrades.d.ts.map +1 -0
- package/dist/node/http/upgrades.js +192 -0
- package/dist/node/http/upgrades.js.map +1 -0
- package/dist/node/plugins/base-inputs.d.ts +14 -0
- package/dist/node/plugins/base-inputs.d.ts.map +1 -0
- package/dist/node/plugins/base-inputs.js +33 -0
- package/dist/node/plugins/base-inputs.js.map +1 -0
- package/dist/node/plugins/build.d.ts +77 -0
- package/dist/node/plugins/build.d.ts.map +1 -0
- package/dist/node/plugins/build.js +576 -0
- package/dist/node/plugins/build.js.map +1 -0
- package/dist/node/plugins/css-modules.d.ts +13 -0
- package/dist/node/plugins/css-modules.d.ts.map +1 -0
- package/dist/node/plugins/css-modules.js +58 -0
- package/dist/node/plugins/css-modules.js.map +1 -0
- package/dist/node/plugins/discover.d.ts +67 -0
- package/dist/node/plugins/discover.d.ts.map +1 -0
- package/dist/node/plugins/discover.js +369 -0
- package/dist/node/plugins/discover.js.map +1 -0
- package/dist/node/plugins/evaluate.d.ts +33 -0
- package/dist/node/plugins/evaluate.d.ts.map +1 -0
- package/dist/node/plugins/evaluate.js +121 -0
- package/dist/node/plugins/evaluate.js.map +1 -0
- package/dist/node/plugins/index.d.ts +11 -0
- package/dist/node/plugins/index.d.ts.map +1 -0
- package/dist/node/plugins/index.js +13 -0
- package/dist/node/plugins/index.js.map +1 -0
- package/dist/node/plugins/install.d.ts +38 -0
- package/dist/node/plugins/install.d.ts.map +1 -0
- package/dist/node/plugins/install.js +213 -0
- package/dist/node/plugins/install.js.map +1 -0
- package/dist/node/plugins/plugins.d.ts +162 -0
- package/dist/node/plugins/plugins.d.ts.map +1 -0
- package/dist/node/plugins/plugins.js +244 -0
- package/dist/node/plugins/plugins.js.map +1 -0
- package/dist/node/plugins/runtime.d.ts +57 -0
- package/dist/node/plugins/runtime.d.ts.map +1 -0
- package/dist/node/plugins/runtime.js +92 -0
- package/dist/node/plugins/runtime.js.map +1 -0
- package/dist/node/plugins/stack.d.ts.map +1 -0
- package/dist/node/plugins/stack.js.map +1 -0
- package/dist/node/plugins/testing.d.ts +58 -0
- package/dist/node/plugins/testing.d.ts.map +1 -0
- package/dist/node/plugins/testing.js +210 -0
- package/dist/node/plugins/testing.js.map +1 -0
- package/dist/node/plugins/watcher.d.ts +69 -0
- package/dist/node/plugins/watcher.d.ts.map +1 -0
- package/dist/node/plugins/watcher.js +622 -0
- package/dist/node/plugins/watcher.js.map +1 -0
- package/dist/node/surfaces/bundle.d.ts +31 -0
- package/dist/node/surfaces/bundle.d.ts.map +1 -0
- package/dist/node/surfaces/bundle.js +118 -0
- package/dist/node/surfaces/bundle.js.map +1 -0
- package/dist/node/surfaces/current.d.ts +17 -0
- package/dist/node/surfaces/current.d.ts.map +1 -0
- package/dist/node/surfaces/current.js +54 -0
- package/dist/node/surfaces/current.js.map +1 -0
- package/dist/node/surfaces/index.d.ts +6 -0
- package/dist/node/surfaces/index.d.ts.map +1 -0
- package/dist/node/surfaces/index.js +6 -0
- package/dist/node/surfaces/index.js.map +1 -0
- package/dist/node/surfaces/published.d.ts +27 -0
- package/dist/node/surfaces/published.d.ts.map +1 -0
- package/dist/node/surfaces/published.js +142 -0
- package/dist/node/surfaces/published.js.map +1 -0
- package/dist/node/surfaces/served.d.ts +15 -0
- package/dist/node/surfaces/served.d.ts.map +1 -0
- package/dist/node/surfaces/served.js +42 -0
- package/dist/node/surfaces/served.js.map +1 -0
- package/dist/node/surfaces/surface-build.d.ts +53 -0
- package/dist/node/surfaces/surface-build.d.ts.map +1 -0
- package/dist/node/surfaces/surface-build.js +105 -0
- package/dist/node/surfaces/surface-build.js.map +1 -0
- package/dist/node/surfaces/tui.d.ts +40 -0
- package/dist/node/surfaces/tui.d.ts.map +1 -0
- package/dist/node/surfaces/tui.js +55 -0
- package/dist/node/surfaces/tui.js.map +1 -0
- package/dist/node/surfaces/web.d.ts +56 -0
- package/dist/node/surfaces/web.d.ts.map +1 -0
- package/dist/node/surfaces/web.js +108 -0
- package/dist/node/surfaces/web.js.map +1 -0
- package/dist/node/tui/actions.d.ts +49 -0
- package/dist/node/tui/actions.d.ts.map +1 -0
- package/dist/node/tui/actions.js +195 -0
- package/dist/node/tui/actions.js.map +1 -0
- package/dist/node/tui/credentials.d.ts +17 -0
- package/dist/node/tui/credentials.d.ts.map +1 -0
- package/dist/node/tui/credentials.js +54 -0
- package/dist/node/tui/credentials.js.map +1 -0
- package/dist/node/tui/filter.d.ts +5 -0
- package/dist/node/tui/filter.d.ts.map +1 -0
- package/dist/node/tui/filter.js +79 -0
- package/dist/node/tui/filter.js.map +1 -0
- package/dist/node/tui/index.d.ts +6 -0
- package/dist/node/tui/index.d.ts.map +1 -0
- package/dist/node/tui/index.js +6 -0
- package/dist/node/tui/index.js.map +1 -0
- package/dist/node/tui/launcher.d.ts +40 -0
- package/dist/node/tui/launcher.d.ts.map +1 -0
- package/dist/node/tui/launcher.js +439 -0
- package/dist/node/tui/launcher.js.map +1 -0
- package/dist/node/tui/pipe.d.ts +18 -0
- package/dist/node/tui/pipe.d.ts.map +1 -0
- package/dist/node/tui/pipe.js +134 -0
- package/dist/node/tui/pipe.js.map +1 -0
- package/dist/node/tui/sandbox.d.ts +54 -0
- package/dist/node/tui/sandbox.d.ts.map +1 -0
- package/dist/node/tui/sandbox.js +431 -0
- package/dist/node/tui/sandbox.js.map +1 -0
- package/dist/node/workers/base.d.ts +30 -0
- package/dist/node/workers/base.d.ts.map +1 -0
- package/dist/node/workers/base.js +255 -0
- package/dist/node/workers/base.js.map +1 -0
- package/dist/node/workers/child.d.ts +4 -0
- package/dist/node/workers/child.d.ts.map +1 -0
- package/dist/node/workers/child.js +6 -0
- package/dist/node/workers/child.js.map +1 -0
- package/dist/node/workers/control.d.ts +83 -0
- package/dist/node/workers/control.d.ts.map +1 -0
- package/dist/node/workers/control.js +77 -0
- package/dist/node/workers/control.js.map +1 -0
- package/dist/node/workers/index.d.ts +4 -0
- package/dist/node/workers/index.d.ts.map +1 -0
- package/dist/node/workers/index.js +7 -0
- package/dist/node/workers/index.js.map +1 -0
- package/dist/node/workers/lock.d.ts +30 -0
- package/dist/node/workers/lock.d.ts.map +1 -0
- package/dist/node/workers/lock.js +180 -0
- package/dist/node/workers/lock.js.map +1 -0
- package/dist/node/workers/main.d.ts +46 -0
- package/dist/node/workers/main.d.ts.map +1 -0
- package/dist/node/workers/main.js +230 -0
- package/dist/node/workers/main.js.map +1 -0
- package/dist/node/workers/process.d.ts +42 -0
- package/dist/node/workers/process.d.ts.map +1 -0
- package/dist/node/workers/process.js +125 -0
- package/dist/node/workers/process.js.map +1 -0
- package/dist/node/workers/workers.d.ts +122 -0
- package/dist/node/workers/workers.d.ts.map +1 -0
- package/dist/node/workers/workers.js +677 -0
- package/dist/node/workers/workers.js.map +1 -0
- package/dist/react/hooks.d.ts +43 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +82 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +4 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/stores.d.ts +9 -0
- package/dist/react/stores.d.ts.map +1 -0
- package/dist/react/stores.js +37 -0
- package/dist/react/stores.js.map +1 -0
- package/dist/registries/contribution.d.ts.map +1 -0
- package/dist/registries/contribution.js.map +1 -0
- package/dist/registries/entries.d.ts.map +1 -0
- package/dist/registries/entries.js.map +1 -0
- package/dist/registries/index.d.ts.map +1 -0
- package/dist/registries/index.js.map +1 -0
- package/dist/registries/internal.d.ts.map +1 -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.map +1 -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.map +1 -0
- package/dist/remote/calls.js.map +1 -0
- package/dist/remote/consumer.d.ts +43 -0
- package/dist/remote/consumer.d.ts.map +1 -0
- package/dist/remote/consumer.js +350 -0
- package/dist/remote/consumer.js.map +1 -0
- package/dist/remote/hold.d.ts +141 -0
- package/dist/remote/hold.d.ts.map +1 -0
- package/dist/remote/hold.js +579 -0
- package/dist/remote/hold.js.map +1 -0
- package/dist/remote/host-link.d.ts +77 -0
- package/dist/remote/host-link.d.ts.map +1 -0
- package/dist/remote/host-link.js +184 -0
- package/dist/remote/host-link.js.map +1 -0
- package/dist/remote/internal.d.ts.map +1 -0
- package/dist/remote/internal.js.map +1 -0
- package/dist/remote/path.d.ts.map +1 -0
- package/dist/remote/path.js.map +1 -0
- package/dist/remote/provider.d.ts +89 -0
- package/dist/remote/provider.d.ts.map +1 -0
- package/dist/remote/provider.js +597 -0
- package/dist/remote/provider.js.map +1 -0
- package/dist/remote/relay.d.ts +69 -0
- package/dist/remote/relay.d.ts.map +1 -0
- package/dist/remote/relay.js +219 -0
- package/dist/remote/relay.js.map +1 -0
- package/dist/remote/remote-object.d.ts +138 -0
- package/dist/remote/remote-object.d.ts.map +1 -0
- package/dist/remote/remote-object.js +492 -0
- package/dist/remote/remote-object.js.map +1 -0
- package/dist/remote/replica.d.ts +59 -0
- package/dist/remote/replica.d.ts.map +1 -0
- package/dist/remote/replica.js +125 -0
- package/dist/remote/replica.js.map +1 -0
- package/dist/sqlite/node.d.ts +9 -1
- package/dist/sqlite/node.d.ts.map +1 -1
- package/dist/sqlite/node.js +9 -3
- package/dist/sqlite/node.js.map +1 -1
- package/dist/state/batch.d.ts +64 -0
- package/dist/state/batch.d.ts.map +1 -0
- package/dist/state/batch.js +164 -0
- package/dist/state/batch.js.map +1 -0
- package/dist/state/derive.d.ts +52 -0
- package/dist/state/derive.d.ts.map +1 -0
- package/dist/state/derive.js +182 -0
- package/dist/state/derive.js.map +1 -0
- package/dist/state/index.d.ts +6 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/internal.d.ts.map +1 -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.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.map +1 -0
- package/dist/store/allocator.d.ts.map +1 -0
- package/dist/store/allocator.js.map +1 -0
- package/dist/store/applier.d.ts.map +1 -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.map +1 -0
- package/dist/store/archive.d.ts +32 -0
- package/dist/store/archive.d.ts.map +1 -0
- package/dist/store/archive.js +130 -0
- package/dist/store/archive.js.map +1 -0
- package/dist/store/backend.d.ts +10 -0
- package/dist/store/backend.d.ts.map +1 -0
- package/dist/store/backend.js.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.map +1 -0
- package/dist/store/claims.d.ts.map +1 -0
- package/dist/store/claims.js.map +1 -0
- package/dist/store/columns.d.ts.map +1 -0
- package/dist/store/columns.js.map +1 -0
- package/dist/store/engine.d.ts +176 -0
- package/dist/store/engine.d.ts.map +1 -0
- package/dist/store/engine.js +283 -0
- package/dist/store/engine.js.map +1 -0
- package/dist/store/evaluate.d.ts +17 -0
- package/dist/store/evaluate.d.ts.map +1 -0
- package/dist/store/evaluate.js.map +1 -0
- package/dist/store/export.d.ts +17 -0
- package/dist/store/export.d.ts.map +1 -0
- package/dist/store/export.js +200 -0
- package/dist/store/export.js.map +1 -0
- package/dist/store/expression.d.ts +150 -0
- package/dist/store/expression.d.ts.map +1 -0
- package/dist/store/expression.js.map +1 -0
- package/dist/store/import.d.ts +10 -0
- package/dist/store/import.d.ts.map +1 -0
- package/dist/store/import.js +276 -0
- package/dist/store/import.js.map +1 -0
- package/dist/store/index.d.ts.map +1 -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.map +1 -0
- package/dist/store/jsonl.js.map +1 -0
- package/dist/store/live-query.d.ts +108 -0
- package/dist/store/live-query.d.ts.map +1 -0
- package/dist/store/live-query.js +254 -0
- package/dist/store/live-query.js.map +1 -0
- package/dist/store/outbox.d.ts +26 -0
- package/dist/store/outbox.d.ts.map +1 -0
- package/dist/store/outbox.js.map +1 -0
- package/dist/store/query.d.ts +39 -0
- package/dist/store/query.d.ts.map +1 -0
- package/dist/store/query.js.map +1 -0
- package/dist/store/refusal.d.ts.map +1 -0
- package/dist/store/refusal.js.map +1 -0
- package/dist/store/rows.d.ts +80 -0
- package/dist/store/rows.d.ts.map +1 -0
- package/dist/store/rows.js.map +1 -0
- package/dist/store/schema.d.ts +25 -0
- package/dist/store/schema.d.ts.map +1 -0
- package/dist/store/schema.js +115 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/sql.d.ts +73 -0
- package/dist/store/sql.d.ts.map +1 -0
- package/dist/store/sql.js.map +1 -0
- package/dist/store/step.d.ts +50 -0
- package/dist/store/step.d.ts.map +1 -0
- package/dist/store/step.js +52 -0
- package/dist/store/step.js.map +1 -0
- package/dist/store/store.d.ts +171 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +818 -0
- package/dist/store/store.js.map +1 -0
- package/dist/store/table-changes.d.ts +29 -0
- package/dist/store/table-changes.d.ts.map +1 -0
- package/dist/store/table-changes.js.map +1 -0
- package/dist/store/table-evolve.d.ts.map +1 -0
- package/dist/store/table-evolve.js.map +1 -0
- package/dist/store/table-handle.d.ts +73 -0
- package/dist/store/table-handle.d.ts.map +1 -0
- package/dist/store/table-handle.js +101 -0
- package/dist/store/table-handle.js.map +1 -0
- package/dist/store/table-history.d.ts.map +1 -0
- package/dist/store/table-history.js.map +1 -0
- package/dist/store/table-migration.d.ts +16 -0
- package/dist/store/table-migration.d.ts.map +1 -0
- package/dist/store/table-migration.js +202 -0
- package/dist/store/table-migration.js.map +1 -0
- package/dist/store/table-writes.d.ts.map +1 -0
- package/dist/store/table-writes.js +170 -0
- package/dist/store/table-writes.js.map +1 -0
- package/dist/store/table.d.ts +80 -0
- package/dist/store/table.d.ts.map +1 -0
- package/dist/store/table.js.map +1 -0
- package/dist/store/text.d.ts.map +1 -0
- package/dist/store/text.js.map +1 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js.map +1 -0
- package/dist/surfaces/active-language.d.ts +20 -0
- package/dist/surfaces/active-language.d.ts.map +1 -0
- package/dist/surfaces/active-language.js +78 -0
- package/dist/surfaces/active-language.js.map +1 -0
- package/dist/surfaces/active-theme.d.ts +16 -0
- package/dist/surfaces/active-theme.d.ts.map +1 -0
- package/dist/surfaces/active-theme.js +47 -0
- package/dist/surfaces/active-theme.js.map +1 -0
- package/dist/surfaces/client.d.ts +96 -0
- package/dist/surfaces/client.d.ts.map +1 -0
- package/dist/surfaces/client.js +264 -0
- package/dist/surfaces/client.js.map +1 -0
- package/dist/surfaces/connection.d.ts +49 -0
- package/dist/surfaces/connection.d.ts.map +1 -0
- package/dist/surfaces/connection.js +142 -0
- package/dist/surfaces/connection.js.map +1 -0
- package/dist/surfaces/format.d.ts +5 -0
- package/dist/surfaces/format.d.ts.map +1 -0
- package/dist/surfaces/format.js +37 -0
- package/dist/surfaces/format.js.map +1 -0
- package/dist/surfaces/index.d.ts +15 -0
- package/dist/surfaces/index.d.ts.map +1 -0
- package/dist/surfaces/index.js +18 -0
- package/dist/surfaces/index.js.map +1 -0
- package/dist/surfaces/language.d.ts +53 -0
- package/dist/surfaces/language.d.ts.map +1 -0
- package/dist/surfaces/language.js +74 -0
- package/dist/surfaces/language.js.map +1 -0
- package/dist/surfaces/loaded.d.ts +42 -0
- package/dist/surfaces/loaded.d.ts.map +1 -0
- package/dist/surfaces/loaded.js +116 -0
- package/dist/surfaces/loaded.js.map +1 -0
- package/dist/surfaces/locale-choice.d.ts +25 -0
- package/dist/surfaces/locale-choice.d.ts.map +1 -0
- package/dist/surfaces/locale-choice.js +14 -0
- package/dist/surfaces/locale-choice.js.map +1 -0
- package/dist/surfaces/messages.d.ts +67 -0
- package/dist/surfaces/messages.d.ts.map +1 -0
- package/dist/surfaces/messages.js +112 -0
- package/dist/surfaces/messages.js.map +1 -0
- package/dist/surfaces/page-state.d.ts +14 -0
- package/dist/surfaces/page-state.d.ts.map +1 -0
- package/dist/surfaces/page-state.js +43 -0
- package/dist/surfaces/page-state.js.map +1 -0
- package/dist/surfaces/preference.d.ts +32 -0
- package/dist/surfaces/preference.d.ts.map +1 -0
- package/dist/surfaces/preference.js +72 -0
- package/dist/surfaces/preference.js.map +1 -0
- package/dist/surfaces/registered.d.ts +33 -0
- package/dist/surfaces/registered.d.ts.map +1 -0
- package/dist/surfaces/registered.js +51 -0
- package/dist/surfaces/registered.js.map +1 -0
- package/dist/surfaces/scripts.d.ts +84 -0
- package/dist/surfaces/scripts.d.ts.map +1 -0
- package/dist/surfaces/scripts.js +28 -0
- package/dist/surfaces/scripts.js.map +1 -0
- package/dist/surfaces/theme-choice.d.ts +31 -0
- package/dist/surfaces/theme-choice.d.ts.map +1 -0
- package/dist/surfaces/theme-choice.js +18 -0
- package/dist/surfaces/theme-choice.js.map +1 -0
- package/dist/surfaces/themes.d.ts +43 -0
- package/dist/surfaces/themes.d.ts.map +1 -0
- package/dist/surfaces/themes.js +110 -0
- package/dist/surfaces/themes.js.map +1 -0
- package/dist/surfaces/translations.d.ts +29 -0
- package/dist/surfaces/translations.d.ts.map +1 -0
- package/dist/surfaces/translations.js +57 -0
- package/dist/surfaces/translations.js.map +1 -0
- package/dist/sync/batch.d.ts +18 -0
- package/dist/sync/batch.d.ts.map +1 -0
- package/dist/sync/batch.js +125 -0
- package/dist/sync/batch.js.map +1 -0
- package/dist/sync/client.d.ts +166 -0
- package/dist/sync/client.d.ts.map +1 -0
- package/dist/sync/client.js +438 -0
- package/dist/sync/client.js.map +1 -0
- package/dist/sync/files.d.ts +46 -0
- package/dist/sync/files.d.ts.map +1 -0
- package/dist/sync/files.js +13 -0
- package/dist/sync/files.js.map +1 -0
- package/dist/sync/filesystem.d.ts +37 -0
- package/dist/sync/filesystem.d.ts.map +1 -0
- package/dist/sync/filesystem.js +185 -0
- package/dist/sync/filesystem.js.map +1 -0
- package/dist/sync/index.d.ts +8 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +9 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/lines.d.ts +18 -0
- package/dist/sync/lines.d.ts.map +1 -0
- package/dist/sync/lines.js +46 -0
- package/dist/sync/lines.js.map +1 -0
- package/dist/sync/remote.d.ts +130 -0
- package/dist/sync/remote.d.ts.map +1 -0
- package/dist/sync/remote.js +46 -0
- package/dist/sync/remote.js.map +1 -0
- package/dist/sync/state.d.ts +17 -0
- package/dist/sync/state.d.ts.map +1 -0
- package/dist/sync/state.js +40 -0
- package/dist/sync/state.js.map +1 -0
- package/dist/telemetry-ingest/batch.d.ts +70 -0
- package/dist/telemetry-ingest/batch.d.ts.map +1 -0
- package/dist/telemetry-ingest/batch.js +110 -0
- package/dist/telemetry-ingest/batch.js.map +1 -0
- package/dist/telemetry-ingest/facet.d.ts +21 -0
- package/dist/telemetry-ingest/facet.d.ts.map +1 -0
- package/dist/telemetry-ingest/facet.js +96 -0
- package/dist/telemetry-ingest/facet.js.map +1 -0
- package/dist/telemetry-ingest/index.d.ts +5 -0
- package/dist/telemetry-ingest/index.d.ts.map +1 -0
- package/dist/telemetry-ingest/index.js +8 -0
- package/dist/telemetry-ingest/index.js.map +1 -0
- package/dist/telemetry-ingest/recorder.d.ts +50 -0
- package/dist/telemetry-ingest/recorder.d.ts.map +1 -0
- package/dist/telemetry-ingest/recorder.js +298 -0
- package/dist/telemetry-ingest/recorder.js.map +1 -0
- package/dist/telemetry-ingest/sender.d.ts +14 -0
- package/dist/telemetry-ingest/sender.d.ts.map +1 -0
- package/dist/telemetry-ingest/sender.js +64 -0
- package/dist/telemetry-ingest/sender.js.map +1 -0
- package/dist/telemetry-sqlite/index.d.ts +13 -4
- package/dist/telemetry-sqlite/index.d.ts.map +1 -1
- package/dist/telemetry-sqlite/index.js +81 -241
- package/dist/telemetry-sqlite/index.js.map +1 -1
- package/dist/telemetry-sqlite/node.d.ts +13 -0
- package/dist/telemetry-sqlite/node.d.ts.map +1 -0
- package/dist/telemetry-sqlite/node.js +27 -0
- package/dist/telemetry-sqlite/node.js.map +1 -0
- package/dist/telemetry-sqlite/schema.d.ts +9 -0
- package/dist/telemetry-sqlite/schema.d.ts.map +1 -0
- package/dist/telemetry-sqlite/schema.js +61 -0
- package/dist/telemetry-sqlite/schema.js.map +1 -0
- package/dist/telemetry-sqlite/store.d.ts +3 -0
- package/dist/telemetry-sqlite/store.d.ts.map +1 -1
- package/dist/telemetry-sqlite/store.js +24 -13
- package/dist/telemetry-sqlite/store.js.map +1 -1
- package/dist/telemetry.d.ts +937 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +470 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/tui/bridge.d.ts +112 -0
- package/dist/tui/bridge.d.ts.map +1 -0
- package/dist/tui/bridge.js +9 -0
- package/dist/tui/bridge.js.map +1 -0
- package/dist/tui/channel.d.ts +44 -0
- package/dist/tui/channel.d.ts.map +1 -0
- package/dist/tui/channel.js +150 -0
- package/dist/tui/channel.js.map +1 -0
- package/dist/tui/frames.d.ts +5 -0
- package/dist/tui/frames.d.ts.map +1 -0
- package/dist/tui/frames.js +52 -0
- package/dist/tui/frames.js.map +1 -0
- package/dist/tui/index.d.ts +7 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +8 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/runtime.d.ts +46 -0
- package/dist/tui/runtime.d.ts.map +1 -0
- package/dist/tui/runtime.js +101 -0
- package/dist/tui/runtime.js.map +1 -0
- package/dist/tui/scope.d.ts +46 -0
- package/dist/tui/scope.d.ts.map +1 -0
- package/dist/tui/scope.js +141 -0
- package/dist/tui/scope.js.map +1 -0
- package/dist/tui/terminal.d.ts +15 -0
- package/dist/tui/terminal.d.ts.map +1 -0
- package/dist/tui/terminal.js +37 -0
- package/dist/tui/terminal.js.map +1 -0
- package/dist/tui/theme.d.ts +17 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +38 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/web/environment.d.ts +4 -0
- package/dist/web/environment.d.ts.map +1 -0
- package/dist/web/environment.js +37 -0
- package/dist/web/environment.js.map +1 -0
- package/dist/web/index.d.ts +5 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +7 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/language.d.ts +7 -0
- package/dist/web/language.d.ts.map +1 -0
- package/dist/web/language.js +21 -0
- package/dist/web/language.js.map +1 -0
- package/dist/web/page.d.ts +29 -0
- package/dist/web/page.d.ts.map +1 -0
- package/dist/web/page.js +92 -0
- package/dist/web/page.js.map +1 -0
- package/dist/web/scripts.d.ts +23 -0
- package/dist/web/scripts.d.ts.map +1 -0
- package/dist/web/scripts.js +50 -0
- package/dist/web/scripts.js.map +1 -0
- package/dist/web/styles.d.ts +17 -0
- package/dist/web/styles.d.ts.map +1 -0
- package/dist/web/styles.js +218 -0
- package/dist/web/styles.js.map +1 -0
- package/dist/web/themes.d.ts +6 -0
- package/dist/web/themes.d.ts.map +1 -0
- package/dist/web/themes.js +31 -0
- package/dist/web/themes.js.map +1 -0
- package/docs/benchmarks.md +1036 -0
- package/docs/decisions.md +3436 -0
- package/docs/dependencies/book.md +1671 -0
- package/docs/dependencies/index.html +2641 -0
- package/docs/design.md +3065 -0
- package/docs/durable-observers/book.md +432 -0
- package/docs/durable-observers/index.html +517 -0
- package/docs/guide-plugins-hosts/book.md +957 -0
- package/docs/guide-plugins-hosts/index.html +952 -0
- package/docs/http-workers/book.md +378 -0
- package/docs/http-workers/index.html +515 -0
- package/docs/i18n/book.md +217 -0
- package/docs/i18n/index.html +344 -0
- package/docs/layer-1.md +311 -0
- package/docs/layer-2.md +216 -0
- package/docs/p3-features/README.md +6 -0
- package/docs/p3-features/book.md +478 -0
- package/docs/plugin-authoring.md +276 -0
- package/docs/plugin-model/book.md +186 -0
- package/docs/plugin-model/index.html +310 -0
- package/docs/plugin-primer/book.md +273 -0
- package/docs/plugin-primer/index.html +430 -0
- package/docs/slice-1.md +236 -0
- package/docs/slice-10.md +288 -0
- package/docs/slice-11.md +114 -0
- package/docs/slice-12.md +132 -0
- package/docs/slice-13.md +121 -0
- package/docs/slice-2.md +174 -0
- package/docs/slice-3a.md +296 -0
- package/docs/slice-3b.md +197 -0
- package/docs/slice-4a.md +418 -0
- package/docs/slice-4b.md +208 -0
- package/docs/slice-6a.md +676 -0
- package/docs/slice-6b.md +332 -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-9.md +110 -0
- package/docs/slices.md +241 -0
- package/docs/store/book.md +670 -0
- package/docs/store/index.html +861 -0
- package/docs/store/walkthrough.md +193 -0
- package/docs/theming/book.md +223 -0
- package/docs/theming/index.html +371 -0
- package/docs/tutorial/book.md +2169 -0
- package/docs/tutorial/index.html +2112 -0
- package/docs/tutorial/screens/click-after.png +0 -0
- package/docs/tutorial/screens/click-before.png +0 -0
- package/docs/tutorial/screens/edited.png +0 -0
- package/docs/tutorial/screens/french.png +0 -0
- package/docs/tutorial/screens/harbor.png +0 -0
- package/docs/tutorial/screens/page.png +0 -0
- package/docs/tutorial/screens/traces-ada.png +0 -0
- package/docs/tutorial/screens/traces.png +0 -0
- package/package.json +99 -21
- package/dist/cell.d.ts +0 -122
- package/dist/cell.d.ts.map +0 -1
- package/dist/cell.js +0 -356
- package/dist/cell.js.map +0 -1
- package/dist/cluster.d.ts +0 -27
- package/dist/cluster.d.ts.map +0 -1
- package/dist/cluster.js +0 -230
- package/dist/cluster.js.map +0 -1
- package/dist/connection.d.ts +0 -270
- package/dist/connection.d.ts.map +0 -1
- package/dist/connection.js +0 -1216
- package/dist/connection.js.map +0 -1
- package/dist/contract.d.ts +0 -207
- package/dist/contract.d.ts.map +0 -1
- package/dist/contract.js +0 -241
- package/dist/contract.js.map +0 -1
- package/dist/declare.d.ts +0 -33
- package/dist/declare.d.ts.map +0 -1
- package/dist/declare.js +0 -2
- package/dist/declare.js.map +0 -1
- package/dist/errors.d.ts +0 -28
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -59
- package/dist/errors.js.map +0 -1
- package/dist/host.d.ts +0 -348
- package/dist/host.d.ts.map +0 -1
- package/dist/host.js +0 -1002
- package/dist/host.js.map +0 -1
- package/dist/link.d.ts +0 -107
- package/dist/link.d.ts.map +0 -1
- package/dist/link.js +0 -355
- package/dist/link.js.map +0 -1
- package/dist/loader.d.ts +0 -4
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js +0 -73
- package/dist/loader.js.map +0 -1
- package/dist/manager.d.ts +0 -115
- package/dist/manager.d.ts.map +0 -1
- package/dist/manager.js +0 -345
- package/dist/manager.js.map +0 -1
- package/dist/next/contracts/accepts.d.ts +0 -81
- package/dist/next/contracts/accepts.d.ts.map +0 -1
- package/dist/next/contracts/accepts.js.map +0 -1
- package/dist/next/contracts/contract.d.ts +0 -121
- package/dist/next/contracts/contract.d.ts.map +0 -1
- package/dist/next/contracts/contract.js.map +0 -1
- package/dist/next/contracts/declare.d.ts.map +0 -1
- package/dist/next/contracts/declare.js.map +0 -1
- package/dist/next/contracts/evolve.d.ts.map +0 -1
- package/dist/next/contracts/evolve.js.map +0 -1
- package/dist/next/contracts/fingerprint.d.ts +0 -16
- package/dist/next/contracts/fingerprint.d.ts.map +0 -1
- package/dist/next/contracts/fingerprint.js.map +0 -1
- package/dist/next/contracts/history.d.ts.map +0 -1
- package/dist/next/contracts/history.js.map +0 -1
- package/dist/next/contracts/host-kind.d.ts.map +0 -1
- package/dist/next/contracts/host-kind.js.map +0 -1
- package/dist/next/contracts/index.d.ts.map +0 -1
- package/dist/next/contracts/index.js.map +0 -1
- package/dist/next/contracts/internal.d.ts.map +0 -1
- package/dist/next/contracts/internal.js.map +0 -1
- package/dist/next/contracts/names.d.ts.map +0 -1
- package/dist/next/contracts/names.js.map +0 -1
- package/dist/next/contracts/params.d.ts +0 -28
- package/dist/next/contracts/params.d.ts.map +0 -1
- package/dist/next/contracts/params.js.map +0 -1
- package/dist/next/contracts/schema.d.ts.map +0 -1
- package/dist/next/contracts/schema.js.map +0 -1
- package/dist/next/contracts/snapshot.d.ts +0 -16
- package/dist/next/contracts/snapshot.d.ts.map +0 -1
- package/dist/next/contracts/snapshot.js +0 -167
- package/dist/next/contracts/snapshot.js.map +0 -1
- package/dist/next/data/args.d.ts +0 -50
- package/dist/next/data/args.d.ts.map +0 -1
- package/dist/next/data/args.js.map +0 -1
- package/dist/next/data/errors.d.ts +0 -73
- package/dist/next/data/errors.d.ts.map +0 -1
- package/dist/next/data/errors.js +0 -107
- package/dist/next/data/errors.js.map +0 -1
- package/dist/next/data/failure.d.ts.map +0 -1
- package/dist/next/data/failure.js +0 -72
- package/dist/next/data/failure.js.map +0 -1
- package/dist/next/data/index.d.ts +0 -4
- package/dist/next/data/index.d.ts.map +0 -1
- package/dist/next/data/index.js +0 -4
- package/dist/next/data/index.js.map +0 -1
- package/dist/next/data/internal.d.ts +0 -7
- package/dist/next/data/internal.d.ts.map +0 -1
- package/dist/next/data/internal.js +0 -8
- package/dist/next/data/internal.js.map +0 -1
- package/dist/next/data/params.d.ts +0 -20
- package/dist/next/data/params.d.ts.map +0 -1
- package/dist/next/data/params.js.map +0 -1
- package/dist/next/data/principal.d.ts +0 -17
- package/dist/next/data/principal.d.ts.map +0 -1
- package/dist/next/data/principal.js +0 -41
- package/dist/next/data/principal.js.map +0 -1
- package/dist/next/data/validator.d.ts +0 -12
- package/dist/next/data/validator.d.ts.map +0 -1
- package/dist/next/data/validator.js +0 -34
- package/dist/next/data/validator.js.map +0 -1
- package/dist/next/documents/address-source.d.ts +0 -20
- package/dist/next/documents/address-source.d.ts.map +0 -1
- package/dist/next/documents/address-source.js.map +0 -1
- package/dist/next/documents/definition.d.ts +0 -84
- package/dist/next/documents/definition.d.ts.map +0 -1
- package/dist/next/documents/definition.js +0 -73
- package/dist/next/documents/definition.js.map +0 -1
- package/dist/next/documents/documents.d.ts +0 -106
- package/dist/next/documents/documents.d.ts.map +0 -1
- package/dist/next/documents/documents.js +0 -224
- package/dist/next/documents/documents.js.map +0 -1
- package/dist/next/documents/fence.d.ts.map +0 -1
- package/dist/next/documents/fence.js.map +0 -1
- package/dist/next/documents/handles.d.ts +0 -76
- package/dist/next/documents/handles.d.ts.map +0 -1
- package/dist/next/documents/handles.js.map +0 -1
- package/dist/next/documents/index.d.ts.map +0 -1
- package/dist/next/documents/index.js.map +0 -1
- package/dist/next/documents/internal.d.ts +0 -9
- package/dist/next/documents/internal.d.ts.map +0 -1
- package/dist/next/documents/internal.js.map +0 -1
- package/dist/next/documents/keyed-slot.d.ts +0 -103
- package/dist/next/documents/keyed-slot.d.ts.map +0 -1
- package/dist/next/documents/keyed-slot.js +0 -395
- package/dist/next/documents/keyed-slot.js.map +0 -1
- package/dist/next/documents/line.d.ts.map +0 -1
- package/dist/next/documents/line.js.map +0 -1
- package/dist/next/documents/persistence.d.ts +0 -104
- package/dist/next/documents/persistence.d.ts.map +0 -1
- package/dist/next/documents/persistence.js +0 -128
- package/dist/next/documents/persistence.js.map +0 -1
- package/dist/next/documents/residency.d.ts +0 -31
- package/dist/next/documents/residency.d.ts.map +0 -1
- package/dist/next/documents/residency.js.map +0 -1
- package/dist/next/documents/slot.d.ts +0 -109
- package/dist/next/documents/slot.d.ts.map +0 -1
- package/dist/next/documents/slot.js +0 -181
- package/dist/next/documents/slot.js.map +0 -1
- package/dist/next/documents/transaction.d.ts +0 -133
- package/dist/next/documents/transaction.d.ts.map +0 -1
- package/dist/next/documents/transaction.js +0 -409
- package/dist/next/documents/transaction.js.map +0 -1
- package/dist/next/host/activity.d.ts +0 -31
- package/dist/next/host/activity.d.ts.map +0 -1
- package/dist/next/host/activity.js +0 -40
- package/dist/next/host/activity.js.map +0 -1
- package/dist/next/host/adapted.d.ts +0 -49
- package/dist/next/host/adapted.d.ts.map +0 -1
- package/dist/next/host/adapted.js.map +0 -1
- package/dist/next/host/attempt.d.ts +0 -278
- package/dist/next/host/attempt.d.ts.map +0 -1
- package/dist/next/host/attempt.js +0 -1072
- package/dist/next/host/attempt.js.map +0 -1
- package/dist/next/host/backoff.d.ts.map +0 -1
- package/dist/next/host/backoff.js.map +0 -1
- package/dist/next/host/ctx.d.ts +0 -47
- package/dist/next/host/ctx.d.ts.map +0 -1
- package/dist/next/host/ctx.js +0 -108
- package/dist/next/host/ctx.js.map +0 -1
- package/dist/next/host/deadline.d.ts.map +0 -1
- package/dist/next/host/deadline.js.map +0 -1
- package/dist/next/host/dependencies.d.ts.map +0 -1
- package/dist/next/host/dependencies.js.map +0 -1
- package/dist/next/host/destination.d.ts +0 -48
- package/dist/next/host/destination.d.ts.map +0 -1
- package/dist/next/host/destination.js.map +0 -1
- package/dist/next/host/facet.d.ts +0 -79
- package/dist/next/host/facet.d.ts.map +0 -1
- package/dist/next/host/facet.js.map +0 -1
- package/dist/next/host/follow.d.ts +0 -52
- package/dist/next/host/follow.d.ts.map +0 -1
- package/dist/next/host/follow.js.map +0 -1
- package/dist/next/host/host.d.ts +0 -495
- package/dist/next/host/host.d.ts.map +0 -1
- package/dist/next/host/host.js +0 -1075
- package/dist/next/host/host.js.map +0 -1
- package/dist/next/host/index.d.ts +0 -17
- package/dist/next/host/index.d.ts.map +0 -1
- package/dist/next/host/index.js.map +0 -1
- package/dist/next/host/internal.d.ts +0 -10
- package/dist/next/host/internal.d.ts.map +0 -1
- package/dist/next/host/internal.js +0 -8
- package/dist/next/host/internal.js.map +0 -1
- package/dist/next/host/members.d.ts +0 -50
- package/dist/next/host/members.d.ts.map +0 -1
- package/dist/next/host/members.js.map +0 -1
- package/dist/next/host/native.d.ts +0 -55
- package/dist/next/host/native.d.ts.map +0 -1
- package/dist/next/host/native.js +0 -92
- package/dist/next/host/native.js.map +0 -1
- package/dist/next/host/object.d.ts +0 -290
- package/dist/next/host/object.d.ts.map +0 -1
- package/dist/next/host/object.js +0 -1127
- package/dist/next/host/object.js.map +0 -1
- package/dist/next/host/parked.d.ts +0 -23
- package/dist/next/host/parked.d.ts.map +0 -1
- package/dist/next/host/parked.js.map +0 -1
- package/dist/next/host/presence.d.ts +0 -34
- package/dist/next/host/presence.d.ts.map +0 -1
- package/dist/next/host/presence.js.map +0 -1
- package/dist/next/host/ref-state.d.ts +0 -53
- package/dist/next/host/ref-state.d.ts.map +0 -1
- package/dist/next/host/ref-state.js +0 -83
- package/dist/next/host/ref-state.js.map +0 -1
- package/dist/next/host/reference-keys.d.ts +0 -36
- package/dist/next/host/reference-keys.d.ts.map +0 -1
- package/dist/next/host/reference-keys.js +0 -168
- package/dist/next/host/reference-keys.js.map +0 -1
- package/dist/next/host/reference-source.d.ts +0 -65
- package/dist/next/host/reference-source.d.ts.map +0 -1
- package/dist/next/host/reference-source.js +0 -285
- package/dist/next/host/reference-source.js.map +0 -1
- package/dist/next/host/reference.d.ts +0 -308
- package/dist/next/host/reference.d.ts.map +0 -1
- package/dist/next/host/reference.js +0 -775
- package/dist/next/host/reference.js.map +0 -1
- package/dist/next/host/retry-on.d.ts.map +0 -1
- package/dist/next/host/retry-on.js.map +0 -1
- package/dist/next/host/revocation.d.ts +0 -16
- package/dist/next/host/revocation.d.ts.map +0 -1
- package/dist/next/host/revocation.js.map +0 -1
- package/dist/next/host/root.d.ts +0 -27
- package/dist/next/host/root.d.ts.map +0 -1
- package/dist/next/host/root.js +0 -68
- package/dist/next/host/root.js.map +0 -1
- package/dist/next/host/route.d.ts +0 -64
- package/dist/next/host/route.d.ts.map +0 -1
- package/dist/next/host/route.js +0 -190
- package/dist/next/host/route.js.map +0 -1
- package/dist/next/host/routines.d.ts +0 -76
- package/dist/next/host/routines.d.ts.map +0 -1
- package/dist/next/host/routines.js +0 -350
- package/dist/next/host/routines.js.map +0 -1
- package/dist/next/host/sleep.d.ts +0 -9
- package/dist/next/host/sleep.d.ts.map +0 -1
- package/dist/next/host/sleep.js.map +0 -1
- package/dist/next/host/staging.d.ts +0 -94
- package/dist/next/host/staging.d.ts.map +0 -1
- package/dist/next/host/staging.js +0 -302
- package/dist/next/host/staging.js.map +0 -1
- package/dist/next/host/unbound.d.ts +0 -30
- package/dist/next/host/unbound.d.ts.map +0 -1
- package/dist/next/host/unbound.js +0 -67
- package/dist/next/host/unbound.js.map +0 -1
- package/dist/next/host/uuid.d.ts.map +0 -1
- package/dist/next/host/uuid.js.map +0 -1
- package/dist/next/index.d.ts +0 -28
- package/dist/next/index.d.ts.map +0 -1
- package/dist/next/index.js +0 -18
- package/dist/next/index.js.map +0 -1
- package/dist/next/jobs/definition.d.ts.map +0 -1
- package/dist/next/jobs/definition.js.map +0 -1
- package/dist/next/jobs/index.d.ts.map +0 -1
- package/dist/next/jobs/index.js.map +0 -1
- package/dist/next/jobs/internal.d.ts.map +0 -1
- package/dist/next/jobs/internal.js.map +0 -1
- package/dist/next/jobs/job.d.ts +0 -152
- package/dist/next/jobs/job.d.ts.map +0 -1
- package/dist/next/jobs/job.js +0 -320
- package/dist/next/jobs/job.js.map +0 -1
- package/dist/next/jobs/persisted.d.ts +0 -38
- package/dist/next/jobs/persisted.d.ts.map +0 -1
- package/dist/next/jobs/persisted.js.map +0 -1
- package/dist/next/jobs/records.d.ts +0 -231
- package/dist/next/jobs/records.d.ts.map +0 -1
- package/dist/next/jobs/records.js +0 -869
- package/dist/next/jobs/records.js.map +0 -1
- package/dist/next/jobs/run-states.d.ts +0 -69
- package/dist/next/jobs/run-states.d.ts.map +0 -1
- package/dist/next/jobs/run-states.js +0 -228
- package/dist/next/jobs/run-states.js.map +0 -1
- package/dist/next/jobs/run.d.ts +0 -113
- package/dist/next/jobs/run.d.ts.map +0 -1
- package/dist/next/jobs/run.js +0 -200
- package/dist/next/jobs/run.js.map +0 -1
- package/dist/next/jobs/running.d.ts +0 -44
- package/dist/next/jobs/running.d.ts.map +0 -1
- package/dist/next/jobs/running.js.map +0 -1
- package/dist/next/jobs/stored.d.ts +0 -63
- package/dist/next/jobs/stored.d.ts.map +0 -1
- package/dist/next/jobs/stored.js.map +0 -1
- package/dist/next/link/binary.d.ts.map +0 -1
- package/dist/next/link/binary.js +0 -534
- package/dist/next/link/binary.js.map +0 -1
- package/dist/next/link/channel.d.ts +0 -63
- package/dist/next/link/channel.d.ts.map +0 -1
- package/dist/next/link/channel.js +0 -202
- package/dist/next/link/channel.js.map +0 -1
- package/dist/next/link/errors.d.ts.map +0 -1
- package/dist/next/link/errors.js.map +0 -1
- package/dist/next/link/index.d.ts.map +0 -1
- package/dist/next/link/index.js.map +0 -1
- package/dist/next/link/internal.d.ts.map +0 -1
- package/dist/next/link/internal.js.map +0 -1
- package/dist/next/link/ipc.d.ts.map +0 -1
- package/dist/next/link/ipc.js.map +0 -1
- package/dist/next/link/link.d.ts.map +0 -1
- package/dist/next/link/link.js.map +0 -1
- package/dist/next/link/message.d.ts +0 -249
- package/dist/next/link/message.d.ts.map +0 -1
- package/dist/next/link/message.js +0 -123
- package/dist/next/link/message.js.map +0 -1
- package/dist/next/link/part.d.ts +0 -80
- package/dist/next/link/part.d.ts.map +0 -1
- package/dist/next/link/part.js +0 -164
- package/dist/next/link/part.js.map +0 -1
- package/dist/next/link/text.d.ts.map +0 -1
- package/dist/next/link/text.js +0 -335
- package/dist/next/link/text.js.map +0 -1
- package/dist/next/link/values.d.ts.map +0 -1
- package/dist/next/link/values.js +0 -117
- package/dist/next/link/values.js.map +0 -1
- package/dist/next/link/websocket.d.ts.map +0 -1
- package/dist/next/link/websocket.js.map +0 -1
- package/dist/next/registries/contribution.d.ts.map +0 -1
- package/dist/next/registries/contribution.js.map +0 -1
- package/dist/next/registries/entries.d.ts.map +0 -1
- package/dist/next/registries/entries.js.map +0 -1
- package/dist/next/registries/index.d.ts.map +0 -1
- package/dist/next/registries/index.js.map +0 -1
- package/dist/next/registries/internal.d.ts.map +0 -1
- package/dist/next/registries/internal.js.map +0 -1
- package/dist/next/registries/record.d.ts +0 -94
- package/dist/next/registries/record.d.ts.map +0 -1
- package/dist/next/registries/record.js +0 -253
- package/dist/next/registries/record.js.map +0 -1
- package/dist/next/registries/registry.d.ts +0 -74
- package/dist/next/registries/registry.d.ts.map +0 -1
- package/dist/next/registries/registry.js.map +0 -1
- package/dist/next/registries/value.d.ts.map +0 -1
- package/dist/next/registries/value.js +0 -199
- package/dist/next/registries/value.js.map +0 -1
- package/dist/next/remote/calls.d.ts.map +0 -1
- package/dist/next/remote/calls.js.map +0 -1
- package/dist/next/remote/consumer.d.ts +0 -42
- package/dist/next/remote/consumer.d.ts.map +0 -1
- package/dist/next/remote/consumer.js +0 -343
- package/dist/next/remote/consumer.js.map +0 -1
- package/dist/next/remote/hold.d.ts +0 -130
- package/dist/next/remote/hold.d.ts.map +0 -1
- package/dist/next/remote/hold.js +0 -537
- package/dist/next/remote/hold.js.map +0 -1
- package/dist/next/remote/host-link.d.ts +0 -77
- package/dist/next/remote/host-link.d.ts.map +0 -1
- package/dist/next/remote/host-link.js +0 -182
- package/dist/next/remote/host-link.js.map +0 -1
- package/dist/next/remote/internal.d.ts.map +0 -1
- package/dist/next/remote/internal.js.map +0 -1
- package/dist/next/remote/path.d.ts.map +0 -1
- package/dist/next/remote/path.js.map +0 -1
- package/dist/next/remote/provider.d.ts +0 -76
- package/dist/next/remote/provider.d.ts.map +0 -1
- package/dist/next/remote/provider.js +0 -506
- package/dist/next/remote/provider.js.map +0 -1
- package/dist/next/remote/relay.d.ts +0 -58
- package/dist/next/remote/relay.d.ts.map +0 -1
- package/dist/next/remote/relay.js +0 -117
- package/dist/next/remote/relay.js.map +0 -1
- package/dist/next/remote/remote-object.d.ts +0 -133
- package/dist/next/remote/remote-object.d.ts.map +0 -1
- package/dist/next/remote/remote-object.js +0 -411
- package/dist/next/remote/remote-object.js.map +0 -1
- package/dist/next/remote/replica.d.ts +0 -59
- package/dist/next/remote/replica.d.ts.map +0 -1
- package/dist/next/remote/replica.js +0 -125
- package/dist/next/remote/replica.js.map +0 -1
- package/dist/next/state/batch.d.ts +0 -64
- package/dist/next/state/batch.d.ts.map +0 -1
- package/dist/next/state/batch.js +0 -163
- package/dist/next/state/batch.js.map +0 -1
- package/dist/next/state/derive.d.ts +0 -52
- package/dist/next/state/derive.d.ts.map +0 -1
- package/dist/next/state/derive.js +0 -182
- package/dist/next/state/derive.js.map +0 -1
- package/dist/next/state/index.d.ts +0 -6
- package/dist/next/state/index.d.ts.map +0 -1
- package/dist/next/state/index.js.map +0 -1
- package/dist/next/state/internal.d.ts.map +0 -1
- package/dist/next/state/internal.js.map +0 -1
- package/dist/next/state/native-source.d.ts +0 -106
- package/dist/next/state/native-source.d.ts.map +0 -1
- package/dist/next/state/native-source.js +0 -240
- package/dist/next/state/native-source.js.map +0 -1
- package/dist/next/state/watchable.d.ts +0 -114
- package/dist/next/state/watchable.d.ts.map +0 -1
- package/dist/next/state/watchable.js +0 -156
- package/dist/next/state/watchable.js.map +0 -1
- package/dist/next/state/writable.d.ts +0 -32
- package/dist/next/state/writable.d.ts.map +0 -1
- package/dist/next/state/writable.js.map +0 -1
- package/dist/next/store/adapter.d.ts +0 -67
- package/dist/next/store/adapter.d.ts.map +0 -1
- package/dist/next/store/adapter.js.map +0 -1
- package/dist/next/store/allocator.d.ts.map +0 -1
- package/dist/next/store/allocator.js.map +0 -1
- package/dist/next/store/applier.d.ts.map +0 -1
- package/dist/next/store/applier.js.map +0 -1
- package/dist/next/store/apply-batch.d.ts +0 -12
- package/dist/next/store/apply-batch.d.ts.map +0 -1
- package/dist/next/store/apply-batch.js.map +0 -1
- package/dist/next/store/archive.d.ts +0 -32
- package/dist/next/store/archive.d.ts.map +0 -1
- package/dist/next/store/archive.js +0 -129
- package/dist/next/store/archive.js.map +0 -1
- package/dist/next/store/backend.d.ts +0 -10
- package/dist/next/store/backend.d.ts.map +0 -1
- package/dist/next/store/backend.js.map +0 -1
- package/dist/next/store/catalog.d.ts +0 -24
- package/dist/next/store/catalog.d.ts.map +0 -1
- package/dist/next/store/catalog.js.map +0 -1
- package/dist/next/store/claims.d.ts.map +0 -1
- package/dist/next/store/claims.js.map +0 -1
- package/dist/next/store/columns.d.ts.map +0 -1
- package/dist/next/store/columns.js.map +0 -1
- package/dist/next/store/engine.d.ts +0 -176
- package/dist/next/store/engine.d.ts.map +0 -1
- package/dist/next/store/engine.js +0 -283
- package/dist/next/store/engine.js.map +0 -1
- package/dist/next/store/evaluate.d.ts +0 -17
- package/dist/next/store/evaluate.d.ts.map +0 -1
- package/dist/next/store/evaluate.js.map +0 -1
- package/dist/next/store/export.d.ts +0 -17
- package/dist/next/store/export.d.ts.map +0 -1
- package/dist/next/store/export.js +0 -200
- package/dist/next/store/export.js.map +0 -1
- package/dist/next/store/expression.d.ts +0 -150
- package/dist/next/store/expression.d.ts.map +0 -1
- package/dist/next/store/expression.js.map +0 -1
- package/dist/next/store/import.d.ts +0 -10
- package/dist/next/store/import.d.ts.map +0 -1
- package/dist/next/store/import.js +0 -276
- package/dist/next/store/import.js.map +0 -1
- package/dist/next/store/index.d.ts.map +0 -1
- package/dist/next/store/index.js.map +0 -1
- package/dist/next/store/json-column.d.ts +0 -33
- package/dist/next/store/json-column.d.ts.map +0 -1
- package/dist/next/store/json-column.js +0 -61
- package/dist/next/store/json-column.js.map +0 -1
- package/dist/next/store/jsonl.d.ts.map +0 -1
- package/dist/next/store/jsonl.js.map +0 -1
- package/dist/next/store/outbox.d.ts +0 -26
- package/dist/next/store/outbox.d.ts.map +0 -1
- package/dist/next/store/outbox.js.map +0 -1
- package/dist/next/store/query.d.ts +0 -39
- package/dist/next/store/query.d.ts.map +0 -1
- package/dist/next/store/query.js.map +0 -1
- package/dist/next/store/refusal.d.ts.map +0 -1
- package/dist/next/store/refusal.js.map +0 -1
- package/dist/next/store/rows.d.ts +0 -80
- package/dist/next/store/rows.d.ts.map +0 -1
- package/dist/next/store/rows.js.map +0 -1
- package/dist/next/store/schema.d.ts +0 -25
- package/dist/next/store/schema.d.ts.map +0 -1
- package/dist/next/store/schema.js +0 -115
- package/dist/next/store/schema.js.map +0 -1
- package/dist/next/store/sql.d.ts +0 -73
- package/dist/next/store/sql.d.ts.map +0 -1
- package/dist/next/store/sql.js.map +0 -1
- package/dist/next/store/step.d.ts +0 -48
- package/dist/next/store/step.d.ts.map +0 -1
- package/dist/next/store/step.js +0 -50
- package/dist/next/store/step.js.map +0 -1
- package/dist/next/store/store.d.ts +0 -161
- package/dist/next/store/store.d.ts.map +0 -1
- package/dist/next/store/store.js +0 -627
- package/dist/next/store/store.js.map +0 -1
- package/dist/next/store/table-changes.d.ts +0 -29
- package/dist/next/store/table-changes.d.ts.map +0 -1
- package/dist/next/store/table-changes.js.map +0 -1
- package/dist/next/store/table-evolve.d.ts.map +0 -1
- package/dist/next/store/table-evolve.js.map +0 -1
- package/dist/next/store/table-handle.d.ts +0 -67
- package/dist/next/store/table-handle.d.ts.map +0 -1
- package/dist/next/store/table-handle.js +0 -101
- package/dist/next/store/table-handle.js.map +0 -1
- package/dist/next/store/table-history.d.ts.map +0 -1
- package/dist/next/store/table-history.js.map +0 -1
- package/dist/next/store/table-migration.d.ts +0 -16
- package/dist/next/store/table-migration.d.ts.map +0 -1
- package/dist/next/store/table-migration.js +0 -202
- package/dist/next/store/table-migration.js.map +0 -1
- package/dist/next/store/table-writes.d.ts.map +0 -1
- package/dist/next/store/table-writes.js +0 -165
- package/dist/next/store/table-writes.js.map +0 -1
- package/dist/next/store/table.d.ts +0 -80
- package/dist/next/store/table.d.ts.map +0 -1
- package/dist/next/store/table.js.map +0 -1
- package/dist/next/store/text.d.ts.map +0 -1
- package/dist/next/store/text.js.map +0 -1
- package/dist/next/store/writes.d.ts.map +0 -1
- package/dist/next/store/writes.js.map +0 -1
- package/dist/next-node/compression.d.ts +0 -7
- package/dist/next-node/compression.d.ts.map +0 -1
- package/dist/next-node/compression.js +0 -24
- package/dist/next-node/compression.js.map +0 -1
- package/dist/next-node/http/admission.d.ts.map +0 -1
- package/dist/next-node/http/admission.js.map +0 -1
- package/dist/next-node/http/authenticate.d.ts +0 -21
- package/dist/next-node/http/authenticate.d.ts.map +0 -1
- package/dist/next-node/http/authenticate.js +0 -34
- package/dist/next-node/http/authenticate.js.map +0 -1
- package/dist/next-node/http/cookies.d.ts +0 -24
- package/dist/next-node/http/cookies.d.ts.map +0 -1
- package/dist/next-node/http/cookies.js +0 -62
- package/dist/next-node/http/cookies.js.map +0 -1
- package/dist/next-node/http/file.d.ts.map +0 -1
- package/dist/next-node/http/file.js.map +0 -1
- package/dist/next-node/http/headers.d.ts.map +0 -1
- package/dist/next-node/http/headers.js +0 -129
- package/dist/next-node/http/headers.js.map +0 -1
- package/dist/next-node/http/http.d.ts +0 -100
- package/dist/next-node/http/http.d.ts.map +0 -1
- package/dist/next-node/http/http.js +0 -462
- package/dist/next-node/http/http.js.map +0 -1
- package/dist/next-node/http/incoming.d.ts.map +0 -1
- package/dist/next-node/http/incoming.js.map +0 -1
- package/dist/next-node/http/index.d.ts +0 -11
- package/dist/next-node/http/index.d.ts.map +0 -1
- package/dist/next-node/http/index.js +0 -12
- package/dist/next-node/http/index.js.map +0 -1
- package/dist/next-node/http/node.d.ts.map +0 -1
- package/dist/next-node/http/node.js.map +0 -1
- package/dist/next-node/http/request.d.ts +0 -54
- package/dist/next-node/http/request.d.ts.map +0 -1
- package/dist/next-node/http/request.js +0 -116
- package/dist/next-node/http/request.js.map +0 -1
- package/dist/next-node/http/response.d.ts +0 -63
- package/dist/next-node/http/response.d.ts.map +0 -1
- package/dist/next-node/http/response.js.map +0 -1
- package/dist/next-node/http/router.d.ts +0 -114
- package/dist/next-node/http/router.d.ts.map +0 -1
- package/dist/next-node/http/router.js +0 -261
- package/dist/next-node/http/router.js.map +0 -1
- package/dist/next-node/http/upgrades.d.ts +0 -58
- package/dist/next-node/http/upgrades.d.ts.map +0 -1
- package/dist/next-node/http/upgrades.js +0 -184
- package/dist/next-node/http/upgrades.js.map +0 -1
- package/dist/next-node/plugins/build.d.ts +0 -57
- package/dist/next-node/plugins/build.d.ts.map +0 -1
- package/dist/next-node/plugins/build.js +0 -334
- package/dist/next-node/plugins/build.js.map +0 -1
- package/dist/next-node/plugins/discover.d.ts +0 -36
- package/dist/next-node/plugins/discover.d.ts.map +0 -1
- package/dist/next-node/plugins/discover.js +0 -91
- package/dist/next-node/plugins/discover.js.map +0 -1
- package/dist/next-node/plugins/evaluate.d.ts +0 -33
- package/dist/next-node/plugins/evaluate.d.ts.map +0 -1
- package/dist/next-node/plugins/evaluate.js +0 -98
- package/dist/next-node/plugins/evaluate.js.map +0 -1
- package/dist/next-node/plugins/index.d.ts +0 -9
- package/dist/next-node/plugins/index.d.ts.map +0 -1
- package/dist/next-node/plugins/index.js +0 -11
- package/dist/next-node/plugins/index.js.map +0 -1
- package/dist/next-node/plugins/install.d.ts +0 -13
- package/dist/next-node/plugins/install.d.ts.map +0 -1
- package/dist/next-node/plugins/install.js +0 -37
- package/dist/next-node/plugins/install.js.map +0 -1
- package/dist/next-node/plugins/plugins.d.ts +0 -135
- package/dist/next-node/plugins/plugins.d.ts.map +0 -1
- package/dist/next-node/plugins/plugins.js +0 -206
- package/dist/next-node/plugins/plugins.js.map +0 -1
- package/dist/next-node/plugins/runtime.d.ts +0 -41
- package/dist/next-node/plugins/runtime.d.ts.map +0 -1
- package/dist/next-node/plugins/runtime.js +0 -136
- package/dist/next-node/plugins/runtime.js.map +0 -1
- package/dist/next-node/plugins/stack.d.ts.map +0 -1
- package/dist/next-node/plugins/stack.js.map +0 -1
- package/dist/next-node/plugins/watcher.d.ts +0 -58
- package/dist/next-node/plugins/watcher.d.ts.map +0 -1
- package/dist/next-node/plugins/watcher.js +0 -281
- package/dist/next-node/plugins/watcher.js.map +0 -1
- package/dist/next-node/workers/control.d.ts +0 -83
- package/dist/next-node/workers/control.d.ts.map +0 -1
- package/dist/next-node/workers/control.js +0 -77
- package/dist/next-node/workers/control.js.map +0 -1
- package/dist/next-node/workers/index.d.ts +0 -5
- package/dist/next-node/workers/index.d.ts.map +0 -1
- package/dist/next-node/workers/index.js +0 -7
- package/dist/next-node/workers/index.js.map +0 -1
- package/dist/next-node/workers/lock.d.ts +0 -21
- package/dist/next-node/workers/lock.d.ts.map +0 -1
- package/dist/next-node/workers/lock.js +0 -137
- package/dist/next-node/workers/lock.js.map +0 -1
- package/dist/next-node/workers/main.d.ts +0 -46
- package/dist/next-node/workers/main.d.ts.map +0 -1
- package/dist/next-node/workers/main.js +0 -230
- package/dist/next-node/workers/main.js.map +0 -1
- package/dist/next-node/workers/process.d.ts +0 -42
- package/dist/next-node/workers/process.d.ts.map +0 -1
- package/dist/next-node/workers/process.js +0 -125
- package/dist/next-node/workers/process.js.map +0 -1
- package/dist/next-node/workers/workers.d.ts +0 -80
- package/dist/next-node/workers/workers.d.ts.map +0 -1
- package/dist/next-node/workers/workers.js +0 -572
- package/dist/next-node/workers/workers.js.map +0 -1
- package/dist/node.d.ts +0 -4
- package/dist/node.d.ts.map +0 -1
- package/dist/node.js +0 -4
- package/dist/node.js.map +0 -1
- package/dist/object.d.ts +0 -438
- package/dist/object.d.ts.map +0 -1
- package/dist/object.js +0 -1570
- package/dist/object.js.map +0 -1
- package/dist/publish.d.ts +0 -5
- package/dist/publish.d.ts.map +0 -1
- package/dist/publish.js +0 -40
- package/dist/publish.js.map +0 -1
- package/dist/registry.d.ts +0 -25
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -6
- package/dist/registry.js.map +0 -1
- package/dist/reload.d.ts +0 -126
- package/dist/reload.d.ts.map +0 -1
- package/dist/reload.js +0 -653
- package/dist/reload.js.map +0 -1
- package/dist/remote.d.ts +0 -165
- package/dist/remote.d.ts.map +0 -1
- package/dist/remote.js +0 -612
- package/dist/remote.js.map +0 -1
- package/dist/schema.d.ts +0 -25
- package/dist/schema.d.ts.map +0 -1
- package/dist/schema.js +0 -403
- package/dist/schema.js.map +0 -1
- package/dist/state.d.ts +0 -92
- package/dist/state.d.ts.map +0 -1
- package/dist/state.js +0 -287
- package/dist/state.js.map +0 -1
- package/dist/types.d.ts +0 -88
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/websocket.d.ts +0 -15
- package/dist/websocket.d.ts.map +0 -1
- package/dist/websocket.js +0 -16
- package/dist/websocket.js.map +0 -1
- package/dist/wire.d.ts +0 -197
- package/dist/wire.d.ts.map +0 -1
- package/dist/wire.js +0 -166
- package/dist/wire.js.map +0 -1
- package/docs/guide.md +0 -814
- package/docs/next/benchmarks.md +0 -959
- package/docs/next/decisions.md +0 -2957
- package/docs/next/dependencies/book.md +0 -1671
- package/docs/next/dependencies/index.html +0 -2641
- package/docs/next/design.md +0 -2554
- package/docs/next/durable-observers/book.md +0 -432
- package/docs/next/durable-observers/index.html +0 -517
- package/docs/next/guide-plugins-hosts/book.md +0 -607
- package/docs/next/guide-plugins-hosts/index.html +0 -652
- package/docs/next/http-workers/book.md +0 -378
- package/docs/next/http-workers/index.html +0 -515
- package/docs/next/layer-1.md +0 -311
- package/docs/next/layer-2.md +0 -216
- package/docs/next/plugin-model/book.md +0 -186
- package/docs/next/plugin-model/index.html +0 -310
- package/docs/next/plugin-primer/book.md +0 -273
- package/docs/next/plugin-primer/index.html +0 -430
- package/docs/next/slice-1.md +0 -236
- package/docs/next/slice-10.md +0 -285
- package/docs/next/slice-11.md +0 -93
- package/docs/next/slice-2.md +0 -174
- package/docs/next/slice-3a.md +0 -296
- package/docs/next/slice-3b.md +0 -197
- package/docs/next/slice-4a.md +0 -418
- package/docs/next/slice-4b.md +0 -208
- package/docs/next/slice-6a.md +0 -676
- package/docs/next/slice-6b.md +0 -332
- package/docs/next/slice-7b/book.md +0 -608
- package/docs/next/slice-7b/index.html +0 -842
- package/docs/next/slice-7b.md +0 -255
- package/docs/next/slice-7c.md +0 -165
- package/docs/next/slices.md +0 -230
- package/docs/next/store/book.md +0 -665
- package/docs/next/store/index.html +0 -861
- package/docs/next/store/walkthrough.md +0 -193
- package/docs/spec.md +0 -288
- package/docs/tutorial.md +0 -932
- /package/dist/{next/contracts → contracts}/accepts.js +0 -0
- /package/dist/{next/contracts → contracts}/contract.js +0 -0
- /package/dist/{next/contracts → contracts}/declare.d.ts +0 -0
- /package/dist/{next/contracts → contracts}/declare.js +0 -0
- /package/dist/{next/contracts → contracts}/evolve.d.ts +0 -0
- /package/dist/{next/contracts → contracts}/evolve.js +0 -0
- /package/dist/{next/contracts → contracts}/fingerprint.js +0 -0
- /package/dist/{next/contracts → contracts}/history.d.ts +0 -0
- /package/dist/{next/contracts → contracts}/history.js +0 -0
- /package/dist/{next/contracts → contracts}/host-kind.d.ts +0 -0
- /package/dist/{next/contracts → contracts}/host-kind.js +0 -0
- /package/dist/{next/contracts → contracts}/index.d.ts +0 -0
- /package/dist/{next/contracts → contracts}/index.js +0 -0
- /package/dist/{next/contracts → contracts}/internal.d.ts +0 -0
- /package/dist/{next/contracts → contracts}/internal.js +0 -0
- /package/dist/{next/contracts → contracts}/names.d.ts +0 -0
- /package/dist/{next/contracts → contracts}/names.js +0 -0
- /package/dist/{next/contracts → contracts}/params.js +0 -0
- /package/dist/{next/contracts → contracts}/schema.d.ts +0 -0
- /package/dist/{next/contracts → contracts}/schema.js +0 -0
- /package/dist/{next/data → data}/args.js +0 -0
- /package/dist/{next/data → data}/failure.d.ts +0 -0
- /package/dist/{next/data → data}/params.js +0 -0
- /package/dist/{next/documents → documents}/address-source.js +0 -0
- /package/dist/{next/documents → documents}/fence.d.ts +0 -0
- /package/dist/{next/documents → documents}/fence.js +0 -0
- /package/dist/{next/documents → documents}/handles.js +0 -0
- /package/dist/{next/documents → documents}/index.d.ts +0 -0
- /package/dist/{next/documents → documents}/index.js +0 -0
- /package/dist/{next/documents → documents}/internal.js +0 -0
- /package/dist/{next/documents → documents}/line.d.ts +0 -0
- /package/dist/{next/documents → documents}/line.js +0 -0
- /package/dist/{next/documents → documents}/residency.js +0 -0
- /package/dist/{next/host → host}/adapted.js +0 -0
- /package/dist/{next/host → host}/backoff.d.ts +0 -0
- /package/dist/{next/host → host}/backoff.js +0 -0
- /package/dist/{next/host → host}/deadline.d.ts +0 -0
- /package/dist/{next/host → host}/deadline.js +0 -0
- /package/dist/{next/host → host}/dependencies.d.ts +0 -0
- /package/dist/{next/host → host}/dependencies.js +0 -0
- /package/dist/{next/host → host}/destination.js +0 -0
- /package/dist/{next/host → host}/facet.js +0 -0
- /package/dist/{next/host → host}/follow.js +0 -0
- /package/dist/{next/host → host}/index.js +0 -0
- /package/dist/{next/host → host}/members.js +0 -0
- /package/dist/{next/host → host}/parked.js +0 -0
- /package/dist/{next/host → host}/presence.js +0 -0
- /package/dist/{next/host → host}/retry-on.d.ts +0 -0
- /package/dist/{next/host → host}/retry-on.js +0 -0
- /package/dist/{next/host → host}/revocation.js +0 -0
- /package/dist/{next/host → host}/sleep.js +0 -0
- /package/dist/{next/host → host}/uuid.d.ts +0 -0
- /package/dist/{next/host → host}/uuid.js +0 -0
- /package/dist/{next/jobs → jobs}/definition.d.ts +0 -0
- /package/dist/{next/jobs → jobs}/definition.js +0 -0
- /package/dist/{next/jobs → jobs}/index.d.ts +0 -0
- /package/dist/{next/jobs → jobs}/index.js +0 -0
- /package/dist/{next/jobs → jobs}/internal.d.ts +0 -0
- /package/dist/{next/jobs → jobs}/internal.js +0 -0
- /package/dist/{next/jobs → jobs}/persisted.js +0 -0
- /package/dist/{next/jobs → jobs}/running.js +0 -0
- /package/dist/{next/jobs → jobs}/stored.js +0 -0
- /package/dist/{next/link → link}/binary.d.ts +0 -0
- /package/dist/{next/link → link}/errors.d.ts +0 -0
- /package/dist/{next/link → link}/errors.js +0 -0
- /package/dist/{next/link → link}/index.d.ts +0 -0
- /package/dist/{next/link → link}/index.js +0 -0
- /package/dist/{next/link → link}/internal.d.ts +0 -0
- /package/dist/{next/link → link}/internal.js +0 -0
- /package/dist/{next/link → link}/ipc.d.ts +0 -0
- /package/dist/{next/link → link}/ipc.js +0 -0
- /package/dist/{next/link → link}/link.d.ts +0 -0
- /package/dist/{next/link → link}/link.js +0 -0
- /package/dist/{next/link → link}/text.d.ts +0 -0
- /package/dist/{next/link → link}/values.d.ts +0 -0
- /package/dist/{next/link → link}/websocket.d.ts +0 -0
- /package/dist/{next/link → link}/websocket.js +0 -0
- /package/dist/{next-node → node}/http/admission.d.ts +0 -0
- /package/dist/{next-node → node}/http/admission.js +0 -0
- /package/dist/{next-node → node}/http/file.d.ts +0 -0
- /package/dist/{next-node → node}/http/file.js +0 -0
- /package/dist/{next-node → node}/http/headers.d.ts +0 -0
- /package/dist/{next-node → node}/http/incoming.d.ts +0 -0
- /package/dist/{next-node → node}/http/incoming.js +0 -0
- /package/dist/{next-node → node}/http/node.d.ts +0 -0
- /package/dist/{next-node → node}/http/node.js +0 -0
- /package/dist/{next-node → node}/http/response.js +0 -0
- /package/dist/{next-node → node}/plugins/stack.d.ts +0 -0
- /package/dist/{next-node → node}/plugins/stack.js +0 -0
- /package/dist/{next/registries → registries}/contribution.d.ts +0 -0
- /package/dist/{next/registries → registries}/contribution.js +0 -0
- /package/dist/{next/registries → registries}/entries.d.ts +0 -0
- /package/dist/{next/registries → registries}/entries.js +0 -0
- /package/dist/{next/registries → registries}/index.d.ts +0 -0
- /package/dist/{next/registries → registries}/index.js +0 -0
- /package/dist/{next/registries → registries}/internal.d.ts +0 -0
- /package/dist/{next/registries → registries}/internal.js +0 -0
- /package/dist/{next/registries → registries}/registry.js +0 -0
- /package/dist/{next/registries → registries}/value.d.ts +0 -0
- /package/dist/{next/remote → remote}/calls.d.ts +0 -0
- /package/dist/{next/remote → remote}/calls.js +0 -0
- /package/dist/{next/remote → remote}/internal.d.ts +0 -0
- /package/dist/{next/remote → remote}/internal.js +0 -0
- /package/dist/{next/remote → remote}/path.d.ts +0 -0
- /package/dist/{next/remote → remote}/path.js +0 -0
- /package/dist/{next/state → state}/index.js +0 -0
- /package/dist/{next/state → state}/internal.d.ts +0 -0
- /package/dist/{next/state → state}/internal.js +0 -0
- /package/dist/{next/state → state}/writable.js +0 -0
- /package/dist/{next/store → store}/adapter.js +0 -0
- /package/dist/{next/store → store}/allocator.d.ts +0 -0
- /package/dist/{next/store → store}/allocator.js +0 -0
- /package/dist/{next/store → store}/applier.d.ts +0 -0
- /package/dist/{next/store → store}/applier.js +0 -0
- /package/dist/{next/store → store}/apply-batch.js +0 -0
- /package/dist/{next/store → store}/backend.js +0 -0
- /package/dist/{next/store → store}/catalog.js +0 -0
- /package/dist/{next/store → store}/claims.d.ts +0 -0
- /package/dist/{next/store → store}/claims.js +0 -0
- /package/dist/{next/store → store}/columns.d.ts +0 -0
- /package/dist/{next/store → store}/columns.js +0 -0
- /package/dist/{next/store → store}/evaluate.js +0 -0
- /package/dist/{next/store → store}/expression.js +0 -0
- /package/dist/{next/store → store}/index.d.ts +0 -0
- /package/dist/{next/store → store}/index.js +0 -0
- /package/dist/{next/store → store}/jsonl.d.ts +0 -0
- /package/dist/{next/store → store}/jsonl.js +0 -0
- /package/dist/{next/store → store}/outbox.js +0 -0
- /package/dist/{next/store → store}/query.js +0 -0
- /package/dist/{next/store → store}/refusal.d.ts +0 -0
- /package/dist/{next/store → store}/refusal.js +0 -0
- /package/dist/{next/store → store}/rows.js +0 -0
- /package/dist/{next/store → store}/sql.js +0 -0
- /package/dist/{next/store → store}/table-changes.js +0 -0
- /package/dist/{next/store → store}/table-evolve.d.ts +0 -0
- /package/dist/{next/store → store}/table-evolve.js +0 -0
- /package/dist/{next/store → store}/table-history.d.ts +0 -0
- /package/dist/{next/store → store}/table-history.js +0 -0
- /package/dist/{next/store → store}/table-writes.d.ts +0 -0
- /package/dist/{next/store → store}/table.js +0 -0
- /package/dist/{next/store → store}/text.d.ts +0 -0
- /package/dist/{next/store → store}/text.js +0 -0
- /package/dist/{next/store → store}/writes.d.ts +0 -0
- /package/dist/{next/store → store}/writes.js +0 -0
- /package/docs/{next/dependencies → dependencies}/model.md +0 -0
- /package/docs/{next/flow-control → flow-control}/book.md +0 -0
- /package/docs/{next/flow-control → flow-control}/fold/index.html +0 -0
- /package/docs/{next/flow-control → flow-control}/index.html +0 -0
- /package/docs/{next/flow-control → flow-control}/window/index.html +0 -0
- /package/docs/{next/slice-4.md → slice-4.md} +0 -0
- /package/docs/{next/slice-5.md → slice-5.md} +0 -0
- /package/docs/{next/slice-7a.md → slice-7a.md} +0 -0
- /package/docs/{next/slice-8.md → slice-8.md} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/next/store/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,eAAe,EAAE,WAAW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AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/next/store/index.ts"],"names":[],"mappings":"AAAA,8GAA8G;AAC9G,0EAA0E;AAG1E,OAAO,EAAgB,aAAa,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EACN,GAAG,EACH,GAAG,EAGH,QAAQ,EACR,MAAM,EAEN,EAAE,EACF,EAAE,EACF,GAAG,EACH,OAAO,EACP,MAAM,EACN,EAAE,EACF,GAAG,EACH,GAAG,EACH,GAAG,EACH,EAAE,EACF,GAAG,EACH,EAAE,EACF,MAAM,EACN,aAAa,EAEb,GAAG,EACH,IAAI,GACJ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAiD,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,EAA+B,KAAK,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,SAAS,EAAiC,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,WAAW,EAAuD,MAAM,YAAY,CAAC;AAC9F,OAAO,EAEN,WAAW,GAIX,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC","sourcesContent":["// The store for apps: opening it over a backend, tables with their queries, writes and migrations, export and\n// import of archives (with their JSONL encoding), the outbox, text order.\n\nexport type { ArchiveManifest, ArchivePart } from \"./archive.ts\";\nexport { type Backend, sqliteBackend } from \"./backend.ts\";\nexport type { Columns, PutRowOf, RowOf } from \"./columns.ts\";\nexport {\n\tadd,\n\tand,\n\ttype ColumnRef,\n\ttype Condition,\n\tcoalesce,\n\tconcat,\n\ttype Expression,\n\teq,\n\tgt,\n\tgte,\n\tinArray,\n\tisNull,\n\tlt,\n\tlte,\n\tmax,\n\tmin,\n\tne,\n\tnot,\n\tor,\n\tprefix,\n\treplacePrefix,\n\ttype SetOf,\n\tsub,\n\twhen,\n} from \"./expression.ts\";\nexport { importStore } from \"./import.ts\";\nexport { type JsonColumnOptions, type JsonColumnSchema, json } from \"./json-column.ts\";\nexport { decodeJsonl, encodeJsonl } from \"./jsonl.ts\";\nexport type { Outbox, OutboxCommit } from \"./outbox.ts\";\nexport { type ColumnRefs, type Query, query } from \"./query.ts\";\nexport { openStore, type Store, type StoreOptions } from \"./store.ts\";\nexport { defineTable, type KeyOf, type TableDefinition, type TableOptions } from \"./table.ts\";\nexport {\n\ttype AddedColumn,\n\tevolveTable,\n\ttype PatchOf,\n\ttype TableEditor,\n\ttype TableTailEditor,\n} from \"./table-evolve.ts\";\nexport type { Page, PageOptions, Table, TableOf } from \"./table-handle.ts\";\nexport { compareText } from \"./text.ts\";\nexport type { StoreWrite } from \"./writes.ts\";\n"]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { JsonSchema } from "@earendil-works/pi-schema";
|
|
2
|
-
import type { Context } from "../../context/index.ts";
|
|
3
|
-
import type { JsonValue } from "../../json.ts";
|
|
4
|
-
import type { Schema, Static } from "../contracts/index.ts";
|
|
5
|
-
/** What `json(...)` takes besides the schema. */
|
|
6
|
-
export type JsonColumnOptions<T> = {
|
|
7
|
-
/** The version of the cells' shape; a cell stores the version it was written at. */
|
|
8
|
-
readonly version: number;
|
|
9
|
-
/** Maps a cell of an older version `from` to this version's shape; pure. Without it older cells are refused. */
|
|
10
|
-
readonly migrate?: (old: JsonValue, from: number) => T;
|
|
11
|
-
};
|
|
12
|
-
/** A `json(...)` column as `columns` takes it: a schema of the cells' type carrying the column. */
|
|
13
|
-
export interface JsonColumnSchema<T> extends Schema<T> {
|
|
14
|
-
readonly json: JsonColumn;
|
|
15
|
-
}
|
|
16
|
-
/** A column holding one JSON value of `schema` per row, at `version`; wrap it in `opt(...)` to make it nullable. */
|
|
17
|
-
export declare function json<S extends Schema>(schema: S, options: JsonColumnOptions<Static<S>>): JsonColumnSchema<Static<S>>;
|
|
18
|
-
/** A `json(...)` column's definition: its schema snapshot, version and fingerprint, and the read of a stored cell. */
|
|
19
|
-
export declare class JsonColumn {
|
|
20
|
-
#private;
|
|
21
|
-
readonly schema: JsonSchema;
|
|
22
|
-
readonly version: number;
|
|
23
|
-
/** The fingerprint of the schema's normal form, recorded with the table: the same version with another is `broken`. */
|
|
24
|
-
readonly fingerprint: string;
|
|
25
|
-
constructor(schema: Schema, version: number, migrate: ((old: JsonValue, from: number) => unknown) | undefined);
|
|
26
|
-
/**
|
|
27
|
-
* The value of a stored cell written at `version`: parsed; an older one migrated and checked once (R8, counted). A
|
|
28
|
-
* newer version, a missing or throwing `migrate` and an invalid result throw `unavailable` (`what` names the cell);
|
|
29
|
-
* the caller fails the owner (slice 6a §1.4), the data stays.
|
|
30
|
-
*/
|
|
31
|
-
read(text: string, version: number, what: string, context: Context): unknown;
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=json-column.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-column.d.ts","sourceRoot":"","sources":["../../../src/next/store/json-column.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAM5D,iDAAiD;AACjD,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IAClC,oFAAoF;IACpF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gHAAgH;IAChH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC,CAAC;CACvD,CAAC;AAEF,mGAAmG;AACnG,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,MAAM,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC1B;AAED,oHAAoH;AACpH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAGpH;AAED,sHAAsH;AACtH,qBAAa,UAAU;;IACtB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uHAAuH;IACvH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAG7B,YAAY,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,EAS5G;IAED;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAgB3E;CACD"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
// `json(schema, { version, migrate? })` table columns (decision "The `json(...)` column helper", W11): one JSON `TEXT`
|
|
2
|
-
// cell with its own version, typed when read, migrated on access (the result checked once, R8), never walked on write
|
|
3
|
-
// (R9).
|
|
4
|
-
import { fingerprintOf } from "../contracts/internal.js";
|
|
5
|
-
import { snapshotSchema } from "../contracts/snapshot.js";
|
|
6
|
-
import { ChordError } from "../data/index.js";
|
|
7
|
-
import { validatorFor } from "../data/internal.js";
|
|
8
|
-
/** A column holding one JSON value of `schema` per row, at `version`; wrap it in `opt(...)` to make it nullable. */
|
|
9
|
-
export function json(schema, options) {
|
|
10
|
-
// Typed as the cells' schema, so `opt(...)` and `Static` take it; the table reads its `json` field.
|
|
11
|
-
return { json: new JsonColumn(schema, options.version, options.migrate) };
|
|
12
|
-
}
|
|
13
|
-
/** A `json(...)` column's definition: its schema snapshot, version and fingerprint, and the read of a stored cell. */
|
|
14
|
-
export class JsonColumn {
|
|
15
|
-
schema;
|
|
16
|
-
version;
|
|
17
|
-
/** The fingerprint of the schema's normal form, recorded with the table: the same version with another is `broken`. */
|
|
18
|
-
fingerprint;
|
|
19
|
-
#migrate;
|
|
20
|
-
constructor(schema, version, migrate) {
|
|
21
|
-
// Declaration policy: JavaScript callers reach this check.
|
|
22
|
-
if (!Number.isSafeInteger(version) || version < 1)
|
|
23
|
-
throw new Error(`json(...): version ${version} is not a positive integer`);
|
|
24
|
-
const snapshot = snapshotSchema(schema, "json(...)");
|
|
25
|
-
this.schema = snapshot.schema;
|
|
26
|
-
this.version = version;
|
|
27
|
-
this.fingerprint = fingerprintOf(snapshot.normal);
|
|
28
|
-
this.#migrate = migrate;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* The value of a stored cell written at `version`: parsed; an older one migrated and checked once (R8, counted). A
|
|
32
|
-
* newer version, a missing or throwing `migrate` and an invalid result throw `unavailable` (`what` names the cell);
|
|
33
|
-
* the caller fails the owner (slice 6a §1.4), the data stays.
|
|
34
|
-
*/
|
|
35
|
-
read(text, version, what, context) {
|
|
36
|
-
const value = JSON.parse(text);
|
|
37
|
-
if (version === this.version)
|
|
38
|
-
return value;
|
|
39
|
-
if (version > this.version)
|
|
40
|
-
throw refused(`${what}: stored at version ${version}, newer than ${this.version}`);
|
|
41
|
-
if (this.#migrate === undefined)
|
|
42
|
-
throw refused(`${what}: no migrate from version ${version} to ${this.version}`);
|
|
43
|
-
let migrated;
|
|
44
|
-
try {
|
|
45
|
-
migrated = this.#migrate(value, version);
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
throw refused(`${what}: migrate from version ${version} threw`, error);
|
|
49
|
-
}
|
|
50
|
-
context.telemetry.metrics?.counter("chord.data.validations").add(1);
|
|
51
|
-
if (!validatorFor(this, context).check(migrated)) {
|
|
52
|
-
throw refused(`${what}: migrate from version ${version} does not match the schema`);
|
|
53
|
-
}
|
|
54
|
-
return migrated;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
/** The error of a cell the code cannot read: the owner fails `broken` with it. */
|
|
58
|
-
function refused(message, cause) {
|
|
59
|
-
return new ChordError({ code: "unavailable", message }, cause === undefined ? undefined : { cause });
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=json-column.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-column.js","sourceRoot":"","sources":["../../../src/next/store/json-column.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,sHAAsH;AACtH,QAAQ;AAMR,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAenD,oHAAoH;AACpH,MAAM,UAAU,IAAI,CAAmB,MAAS,EAAE,OAAqC;IACtF,oGAAoG;IACpG,OAAO,EAAE,IAAI,EAAE,IAAI,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;AAC3E,CAAC;AAED,sHAAsH;AACtH,MAAM,OAAO,UAAU;IACb,MAAM,CAAa;IACnB,OAAO,CAAS;IACzB,uHAAuH;IAC9G,WAAW,CAAS;IACpB,QAAQ,CAA0D;IAE3E,YAAY,MAAc,EAAE,OAAe,EAAE,OAAgE;QAC5G,2DAA2D;QA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AAwB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACpE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClD,MAAM,OAAO,CAAC,GAAG,IAAI,0BAA0B,OAAO,4BAA4B,CAAC,CAAC;QACrF,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD;AAED,kFAAkF;AAClF,SAAS,OAAO,CAAC,OAAe,EAAE,KAAe;IAChD,OAAO,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACtG,CAAC","sourcesContent":["// `json(schema, { version, migrate? })` table columns (decision \"The `json(...)` column helper\", W11): one JSON `TEXT`\n// cell with its own version, typed when read, migrated on access (the result checked once, R8), never walked on write\n// (R9).\n\nimport type { JsonSchema } from \"@earendil-works/pi-schema\";\nimport type { Context } from \"../../context/index.ts\";\nimport type { JsonValue } from \"../../json.ts\";\nimport type { Schema, Static } from \"../contracts/index.ts\";\nimport { fingerprintOf } from \"../contracts/internal.ts\";\nimport { snapshotSchema } from \"../contracts/snapshot.ts\";\nimport { ChordError } from \"../data/index.ts\";\nimport { validatorFor } from \"../data/internal.ts\";\n\n/** What `json(...)` takes besides the schema. */\nexport type JsonColumnOptions<T> = {\n\t/** The version of the cells' shape; a cell stores the version it was written at. */\n\treadonly version: number;\n\t/** Maps a cell of an older version `from` to this version's shape; pure. Without it older cells are refused. */\n\treadonly migrate?: (old: JsonValue, from: number) => T;\n};\n\n/** A `json(...)` column as `columns` takes it: a schema of the cells' type carrying the column. */\nexport interface JsonColumnSchema<T> extends Schema<T> {\n\treadonly json: JsonColumn;\n}\n\n/** A column holding one JSON value of `schema` per row, at `version`; wrap it in `opt(...)` to make it nullable. */\nexport function json<S extends Schema>(schema: S, options: JsonColumnOptions<Static<S>>): JsonColumnSchema<Static<S>> {\n\t// Typed as the cells' schema, so `opt(...)` and `Static` take it; the table reads its `json` field.\n\treturn { json: new JsonColumn(schema, options.version, options.migrate) };\n}\n\n/** A `json(...)` column's definition: its schema snapshot, version and fingerprint, and the read of a stored cell. */\nexport class JsonColumn {\n\treadonly schema: JsonSchema;\n\treadonly version: number;\n\t/** The fingerprint of the schema's normal form, recorded with the table: the same version with another is `broken`. */\n\treadonly fingerprint: string;\n\treadonly #migrate: ((old: JsonValue, from: number) => unknown) | undefined;\n\n\tconstructor(schema: Schema, version: number, migrate: ((old: JsonValue, from: number) => unknown) | undefined) {\n\t\t// Declaration policy: JavaScript callers reach this check.\n\t\tif (!Number.isSafeInteger(version) || version < 1)\n\t\t\tthrow new Error(`json(...): version ${version} is not a positive integer`);\n\t\tconst snapshot = snapshotSchema(schema, \"json(...)\");\n\t\tthis.schema = snapshot.schema;\n\t\tthis.version = version;\n\t\tthis.fingerprint = fingerprintOf(snapshot.normal);\n\t\tthis.#migrate = migrate;\n\t}\n\n\t/**\n\t * The value of a stored cell written at `version`: parsed; an older one migrated and checked once (R8, counted). A\n\t * newer version, a missing or throwing `migrate` and an invalid result throw `unavailable` (`what` names the cell);\n\t * the caller fails the owner (slice 6a §1.4), the data stays.\n\t */\n\tread(text: string, version: number, what: string, context: Context): unknown {\n\t\tconst value = JSON.parse(text) as JsonValue;\n\t\tif (version === this.version) return value;\n\t\tif (version > this.version) throw refused(`${what}: stored at version ${version}, newer than ${this.version}`);\n\t\tif (this.#migrate === undefined) throw refused(`${what}: no migrate from version ${version} to ${this.version}`);\n\t\tlet migrated: unknown;\n\t\ttry {\n\t\t\tmigrated = this.#migrate(value, version);\n\t\t} catch (error) {\n\t\t\tthrow refused(`${what}: migrate from version ${version} threw`, error);\n\t\t}\n\t\tcontext.telemetry.metrics?.counter(\"chord.data.validations\").add(1);\n\t\tif (!validatorFor(this, context).check(migrated)) {\n\t\t\tthrow refused(`${what}: migrate from version ${version} does not match the schema`);\n\t\t}\n\t\treturn migrated;\n\t}\n}\n\n/** The error of a cell the code cannot read: the owner fails `broken` with it. */\nfunction refused(message: string, cause?: unknown): ChordError {\n\treturn new ChordError({ code: \"unavailable\", message }, cause === undefined ? undefined : { cause });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../../src/next/store/jsonl.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAKhD,wDAAwD;AACxD,wBAAuB,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,CAW/F;AAED;;;GAGG;AACH,wBAAuB,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CAgC3F"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsonl.js","sourceRoot":"","sources":["../../../src/next/store/jsonl.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,wFAAwF;AAExF,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,wEAAwE;AACxE,MAAM,KAAK,GAAG,EAAE,GAAG,IAAI,CAAC;AAExB,wDAAwD;AACxD,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,WAAW,CAAC,KAAiC;IACnE,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,IAAI,KAAK,EAAE,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAChC,KAAK,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QACrC,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;YAC3B,MAAM,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,C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,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;YAC9E,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YACpC,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC;YAChB,IAAI,EAAE,CAAC;YACP,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;gBAAE,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,IAAI,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,CAAC;IACP,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["// Plain JSONL for archives (slice 6a §13): one part per line, UTF-8. The store yields and takes parts; this is the\n// encoding it ships (others, compressed ones, come later without touching the applier).\n\nimport { invalid } from \"../data/internal.ts\";\nimport type { ArchivePart } from \"./archive.ts\";\n\n/** The bytes a chunk of encoded lines collects before it is yielded. */\nconst CHUNK = 64 * 1024;\n\n/** `parts` as JSONL bytes, in chunks of whole lines. */\nexport async function* encodeJsonl(parts: AsyncIterable<ArchivePart>): AsyncIterable<Uint8Array> {\n\tconst encoder = new TextEncoder();\n\tlet lines = \"\";\n\tfor await (const part of parts) {\n\t\tlines += `${JSON.stringify(part)}\\n`;\n\t\tif (lines.length >= CHUNK) {\n\t\t\tyield encoder.encode(lines);\n\t\t\tlines = \"\";\n\t\t}\n\t}\n\tif (lines.length > 0) yield encoder.encode(lines);\n}\n\n/**\n * The values of JSONL `bytes`, one per nonempty line, for `importStore` to check (a trust boundary: bytes that are\n * no UTF-8 and a line that is no JSON are `invalid/args`).\n */\nexport async function* decodeJsonl(bytes: AsyncIterable<Uint8Array>): AsyncIterable<unknown> {\n\tconst decoder = new TextDecoder(\"utf-8\", { fatal: true });\n\tlet rest = \"\";\n\tlet line = 0;\n\tconst parse = (text: string): unknown => {\n\t\ttry {\n\t\t\treturn JSON.parse(text);\n\t\t} catch {\n\t\t\tthrow invalid(\"args\", `jsonl: line ${line} is not JSON`);\n\t\t}\n\t};\n\tconst decode = (chunk?: Uint8Array): string => {\n\t\ttry {\n\t\t\treturn chunk === undefined ? decoder.decode() : decoder.decode(chunk, { stream: true });\n\t\t} catch {\n\t\t\tthrow invalid(\"args\", `jsonl: line ${line + 1} is not UTF-8`);\n\t\t}\n\t};\n\tfor await (const chunk of bytes) {\n\t\trest += decode(chunk);\n\t\tlet start = 0;\n\t\tfor (let end = rest.indexOf(\"\\n\"); end >= 0; end = rest.indexOf(\"\\n\", start)) {\n\t\t\tconst text = rest.slice(start, end);\n\t\t\tstart = end + 1;\n\t\t\tline++;\n\t\t\tif (text.trim().length > 0) yield parse(text);\n\t\t}\n\t\trest = rest.slice(start);\n\t}\n\trest += decode();\n\tline++;\n\tif (rest.trim().length > 0) yield parse(rest);\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Context } from "../../context/index.ts";
|
|
2
|
-
import type { ChordStore } from "./store.ts";
|
|
3
|
-
import type { StoreWrite } from "./writes.ts";
|
|
4
|
-
/** The write vocabulary's version an outbox commit is stored in; a newer one is refused, data intact. */
|
|
5
|
-
export declare const OUTBOX_FORMAT = 1;
|
|
6
|
-
/** One commit as the outbox gives it: its seq, the allocator's value it persisted (D3) and its writes in applied order. */
|
|
7
|
-
export type OutboxCommit = {
|
|
8
|
-
readonly seq: number;
|
|
9
|
-
readonly nextId: number;
|
|
10
|
-
readonly writes: readonly StoreWrite[];
|
|
11
|
-
};
|
|
12
|
-
/** A store's outbox: its commits after the floor (the seq it was turned on at, advanced by `trim`). */
|
|
13
|
-
export declare class Outbox {
|
|
14
|
-
#private;
|
|
15
|
-
constructor(store: ChordStore, floor: number);
|
|
16
|
-
/** The seq the outbox starts after: `read` takes any `afterSeq` from it to `lastSeq`. */
|
|
17
|
-
get floor(): number;
|
|
18
|
-
/** Up to `limit` commits after `afterSeq`, in seq order; `afterSeq` outside floor..lastSeq is `invalid/args`. */
|
|
19
|
-
read(afterSeq: number, limit: number, context: Context): Promise<OutboxCommit[]>;
|
|
20
|
-
/**
|
|
21
|
-
* Drops the commits through `throughSeq` and advances the floor; idempotent; beyond `lastSeq` is `invalid/args`.
|
|
22
|
-
* Trims run one at a time, so the stored floor only rises and equals the one in memory.
|
|
23
|
-
*/
|
|
24
|
-
trim(throughSeq: number, context: Context): Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=outbox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"outbox.d.ts","sourceRoot":"","sources":["../../../src/next/store/outbox.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAItD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,yGAAyG;AACzG,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,2HAA2H;AAC3H,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,CAAC;AAIrH,uGAAuG;AACvG,qBAAa,MAAM;;IASlB,YAAY,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAG3C;IAED,yFAAyF;IACzF,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,iHAAiH;IAC3G,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,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":["// The outbox (slice 6a §2; decisions \"The outbox is optional, internal and versioned\", small items 3-4): the store's\n// commits as the sync layer reads them, one `{ seq, writes }` per commit from its floor on, in the current format.\n\nimport type { Context } from \"../../context/index.ts\";\nimport { ChordError } from \"../data/index.ts\";\nimport { invalid } from \"../data/internal.ts\";\nimport { TABLES } from \"./schema.ts\";\nimport type { ChordStore } from \"./store.ts\";\nimport type { StoreWrite } from \"./writes.ts\";\n\n/** The write vocabulary's version an outbox commit is stored in; a newer one is refused, data intact. */\nexport const OUTBOX_FORMAT = 1;\n\n/** One commit as the outbox gives it: its seq, the allocator's value it persisted (D3) and its writes in applied order. */\nexport type OutboxCommit = { readonly seq: number; readonly nextId: number; readonly writes: readonly StoreWrite[] };\n\nconst NOTHING = (): void => {};\n\n/** A store's outbox: its commits after the floor (the seq it was turned on at, advanced by `trim`). */\nexport class Outbox {\n\treadonly #store: ChordStore;\n\t#floor: number;\n\t/**\n\t * The outbox's reads and trims, one at a time: a read checks the floor and reads with no trim running (a trim's\n\t * commit may have deleted rows before its floor is set), a trim waits for the reads in flight.\n\t */\n\t#queue: Promise<void> = Promise.resolve();\n\n\tconstructor(store: ChordStore, floor: number) {\n\t\tthis.#store = store;\n\t\tthis.#floor = floor;\n\t}\n\n\t/** The seq the outbox starts after: `read` takes any `afterSeq` from it to `lastSeq`. */\n\tget floor(): number {\n\t\treturn this.#floor;\n\t}\n\n\t/** Up to `limit` commits after `afterSeq`, in seq order; `afterSeq` outside floor..lastSeq is `invalid/args`. */\n\tasync read(afterSeq: number, limit: number, context: Context): Promise<OutboxCommit[]> {\n\t\tif (!Number.isSafeInteger(afterSeq)) throw invalid(\"args\", `outbox: read after ${afterSeq}, not an integer`);\n\t\tif (!Number.isSafeInteger(limit) || limit < 1) throw invalid(\"args\", \"outbox: limit is a positive integer\");\n\t\treturn this.#queued(() => this.#read(afterSeq, limit, context));\n\t}\n\n\t/**\n\t * Drops the commits through `throughSeq` and advances the floor; idempotent; beyond `lastSeq` is `invalid/args`.\n\t * Trims run one at a time, so the stored floor only rises and equals the one in memory.\n\t */\n\ttrim(throughSeq: number, context: Context): Promise<void> {\n\t\ttry {\n\t\t\tcontext.abortSignal?.throwIfAborted();\n\t\t\tif (!Number.isSafeInteger(throughSeq) || throughSeq > this.#store.lastSeq) {\n\t\t\t\tthrow invalid(\"args\", `outbox: trim through ${throughSeq}, beyond ${this.#store.lastSeq}`);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treturn Promise.reject(error);\n\t\t}\n\t\treturn this.#queued(() => this.#trim(throughSeq));\n\t}\n\n\t/** Runs `operation` once the outbox operations before it settled. */\n\t#queued<T>(operation: () => Promise<T>): Promise<T> {\n\t\tconst run = this.#queue.then(operation);\n\t\tthis.#queue = run.then(NOTHING, NOTHING);\n\t\treturn run;\n\t}\n\n\t/** `read`, its turn come: the floor as no trim moves it. */\n\tasync #read(afterSeq: number, limit: number, context: Context): Promise<OutboxCommit[]> {\n\t\tif (afterSeq < this.#floor || afterSeq > this.#store.lastSeq) {\n\t\t\tthrow invalid(\"args\", `outbox: read after ${afterSeq}, outside ${this.#floor}..${this.#store.lastSeq}`);\n\t\t}\n\t\tconst rows = await this.#store.read(\n\t\t\t(executor) =>\n\t\t\t\texecutor.all<{\n\t\t\t\t\treadonly seq: number;\n\t\t\t\t\treadonly format: number;\n\t\t\t\t\treadonly next_id: number;\n\t\t\t\t\treadonly writes: string;\n\t\t\t\t}>(\n\t\t\t\t\t`SELECT seq, format, next_id, writes FROM ${TABLES.outbox} WHERE seq > ? ORDER BY seq LIMIT ?`,\n\t\t\t\t\tafterSeq,\n\t\t\t\t\tlimit,\n\t\t\t\t),\n\t\t\tcontext,\n\t\t);\n\t\treturn rows.map(({ seq, format, next_id, writes }) => {\n\t\t\tif (format !== OUTBOX_FORMAT) {\n\t\t\t\tconst message = `outbox: commit ${seq} is in format ${format}, newer than ${OUTBOX_FORMAT}`;\n\t\t\t\tthrow new ChordError({ code: \"unavailable\", message });\n\t\t\t}\n\t\t\treturn { seq, nextId: next_id, writes: JSON.parse(writes) as StoreWrite[] };\n\t\t});\n\t}\n\n\tasync #trim(throughSeq: number): Promise<void> {\n\t\tif (throughSeq <= this.#floor) return;\n\t\tawait this.#store.maintain(async (executor) => {\n\t\t\tawait executor.run(`DELETE FROM ${TABLES.outbox} WHERE seq <= ?`, throughSeq);\n\t\t\tawait executor.run(`UPDATE ${TABLES.meta} SET outbox_floor = ? WHERE singleton = 1`, throughSeq);\n\t\t});\n\t\tthis.#floor = throughSeq;\n\t}\n}\n"]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { SqliteValue } from "../../sqlite/index.ts";
|
|
2
|
-
import type { Columns, ColumnTypeOf, ValueOf } from "./columns.ts";
|
|
3
|
-
import { type ColumnRef, type Condition, type WhereNode } from "./expression.ts";
|
|
4
|
-
import type { Order } from "./sql.ts";
|
|
5
|
-
import type { TableDefinition } from "./table.ts";
|
|
6
|
-
/** The column references a table's callbacks get: `e.path`, `e.at`. */
|
|
7
|
-
export type ColumnRefs<C extends Columns> = {
|
|
8
|
-
readonly [K in keyof C & string]: ColumnRef<ValueOf<C[K]>, ColumnTypeOf<C[K]>>;
|
|
9
|
-
};
|
|
10
|
-
/** A query of `table`: its rows, in key order. */
|
|
11
|
-
export declare function query<C extends Columns, K extends readonly string[]>(table: TableDefinition<C, K>): Query<C, K>;
|
|
12
|
-
/**
|
|
13
|
-
* An immutable query of one table: an optional condition (several `where`s are `and`ed) and an order (`orderBy`
|
|
14
|
-
* columns, one direction, the key appended unless already there).
|
|
15
|
-
*/
|
|
16
|
-
export declare class Query<C extends Columns = Columns, K extends readonly string[] = readonly string[]> {
|
|
17
|
-
#private;
|
|
18
|
-
readonly table: TableDefinition<C, K>;
|
|
19
|
-
readonly condition: WhereNode | undefined;
|
|
20
|
-
constructor(table: TableDefinition<C, K>, condition: WhereNode | undefined, orderBy: readonly string[], direction: "asc" | "desc" | undefined);
|
|
21
|
-
/** This query with `fn`'s condition too. */
|
|
22
|
-
where(fn: (row: ColumnRefs<C>) => Condition): Query<C, K>;
|
|
23
|
-
/**
|
|
24
|
-
* This query ordered by `fn`'s column next (a non-`opt` `str` or `int` one), in `direction`: one direction per
|
|
25
|
-
* query, no column twice (`invalid/args`).
|
|
26
|
-
*/
|
|
27
|
-
orderBy(fn: (row: ColumnRefs<C>) => ColumnRef<unknown, "str" | "int">, direction?: "asc" | "desc"): Query<C, K>;
|
|
28
|
-
/** The order of its rows: the `orderBy` columns, then the key columns not among them. */
|
|
29
|
-
get order(): Order;
|
|
30
|
-
}
|
|
31
|
-
/** The cursor of the position after a row with the order values `values` in the table named `table` (its SQL name). */
|
|
32
|
-
export declare function encodeCursor(table: string, order: Order, values: readonly SqliteValue[]): string;
|
|
33
|
-
/**
|
|
34
|
-
* The order values of `cursor` (a trust boundary: an app hands it back): one made for `table`'s `order` (any
|
|
35
|
-
* condition) in the table named `sqlName` (another object's table of the same definition is another table), each value
|
|
36
|
-
* of its column's type; `invalid/args` otherwise.
|
|
37
|
-
*/
|
|
38
|
-
export declare function decodeCursor(table: TableDefinition, sqlName: string, order: Order, cursor: unknown): SqliteValue[];
|
|
39
|
-
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/next/store/query.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAgB,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE/F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,uEAAuE;AACvE,MAAM,MAAM,UAAU,CAAC,CAAC,SAA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,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QACvC,+EAA+E;QAC/E,OAAO,WAAW,CAAC,MAAM,CAAC,IAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,IAAI,UAAU,CAAoB,CAAC;IACxG,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// Queries (decision \"Query runner\"; slice 6a §6, rule 17): `query(Table).where(…).orderBy(…)` as immutable data\n// (the condition compiled when given, the order with the key appended as the tie-break), and the opaque cursors that\n// continue a page, bound to the table, the order columns and the direction.\n\nimport type { SqliteValue } from \"../../sqlite/index.ts\";\nimport { invalid } from \"../data/internal.ts\";\nimport type { Columns, ColumnTypeOf, ValueOf } from \"./columns.ts\";\nimport { type ColumnRef, type Condition, compileWhere, type WhereNode } from \"./expression.ts\";\nimport { checkScalar } from \"./rows.ts\";\nimport type { Order } from \"./sql.ts\";\nimport type { TableDefinition } from \"./table.ts\";\n\n/** The column references a table's callbacks get: `e.path`, `e.at`. */\nexport type ColumnRefs<C extends Columns> = {\n\treadonly [K in keyof C & string]: ColumnRef<ValueOf<C[K]>, ColumnTypeOf<C[K]>>;\n};\n\n/** A query of `table`: its rows, in key order. */\nexport function query<C extends Columns, K extends readonly string[]>(table: TableDefinition<C, K>): Query<C, K> {\n\treturn new Query(table, undefined, [], undefined);\n}\n\n/**\n * An immutable query of one table: an optional condition (several `where`s are `and`ed) and an order (`orderBy`\n * columns, one direction, the key appended unless already there).\n */\nexport class Query<C extends Columns = Columns, K extends readonly string[] = readonly string[]> {\n\treadonly table: TableDefinition<C, K>;\n\treadonly condition: WhereNode | undefined;\n\treadonly #orderBy: readonly string[];\n\treadonly #direction: \"asc\" | \"desc\" | undefined;\n\n\tconstructor(\n\t\ttable: TableDefinition<C, K>,\n\t\tcondition: WhereNode | undefined,\n\t\torderBy: readonly string[],\n\t\tdirection: \"asc\" | \"desc\" | undefined,\n\t) {\n\t\tthis.table = table;\n\t\tthis.condition = condition;\n\t\tthis.#orderBy = orderBy;\n\t\tthis.#direction = direction;\n\t}\n\n\t/** This query with `fn`'s condition too. */\n\twhere(fn: (row: ColumnRefs<C>) => Condition): Query<C, K> {\n\t\t// The refs are the table's columns, typed by `C`.\n\t\tconst compiled = compileWhere(this.table, fn(this.table.refs as ColumnRefs<C>), \"where\");\n\t\tconst condition = this.condition === undefined ? compiled : { and: [this.condition, compiled] };\n\t\treturn new Query(this.table, condition, this.#orderBy, this.#direction);\n\t}\n\n\t/**\n\t * This query ordered by `fn`'s column next (a non-`opt` `str` or `int` one), in `direction`: one direction per\n\t * query, no column twice (`invalid/args`).\n\t */\n\torderBy(\n\t\tfn: (row: ColumnRefs<C>) => ColumnRef<unknown, \"str\" | \"int\">,\n\t\tdirection: \"asc\" | \"desc\" = \"asc\",\n\t): Query<C, K> {\n\t\tconst table = this.table;\n\t\t// The refs are `C`'s columns; what the plugin's callback returns is checked below.\n\t\tconst ref = fn(table.refs as ColumnRefs<C>) as ColumnRef | undefined;\n\t\tconst column = table.byName.get(ref?.column ?? \"\");\n\t\tif (column === undefined || column.optional || (column.type !== \"str\" && column.type !== \"int\")) {\n\t\t\tthrow invalid(\"args\", `${table.name}: orderBy: expected a non-opt str() or int() column`);\n\t\t}\n\t\tif (this.#orderBy.includes(column.name)) throw invalid(\"args\", `${table.name}: orderBy: \"${column.name}\" twice`);\n\t\tif (this.#direction !== undefined && this.#direction !== direction) {\n\t\t\tthrow invalid(\"args\", `${table.name}: orderBy: one direction per query`);\n\t\t}\n\t\treturn new Query(table, this.condition, [...this.#orderBy, column.name], direction);\n\t}\n\n\t/** The order of its rows: the `orderBy` columns, then the key columns not among them. */\n\tget order(): Order {\n\t\tconst columns = [...this.#orderBy, ...this.table.key.filter((column) => !this.#orderBy.includes(column))];\n\t\treturn { columns, direction: this.#direction ?? \"asc\" };\n\t}\n}\n\n/** The cursor of the position after a row with the order values `values` in the table named `table` (its SQL name). */\nexport function encodeCursor(table: string, order: Order, values: readonly SqliteValue[]): string {\n\tconst json = JSON.stringify({ t: table, o: order.columns, d: order.direction, v: values });\n\tlet binary = \"\";\n\tfor (const byte of new TextEncoder().encode(json)) binary += String.fromCharCode(byte);\n\treturn btoa(binary).replaceAll(\"+\", \"-\").replaceAll(\"/\", \"_\").replace(/=+$/, \"\");\n}\n\n/**\n * The order values of `cursor` (a trust boundary: an app hands it back): one made for `table`'s `order` (any\n * condition) in the table named `sqlName` (another object's table of the same definition is another table), each value\n * of its column's type; `invalid/args` otherwise.\n */\nexport function decodeCursor(table: TableDefinition, sqlName: string, order: Order, cursor: unknown): SqliteValue[] {\n\tconst refuse = (): never => {\n\t\tthrow invalid(\"args\", `${table.name}: the cursor is not one of this table's order`);\n\t};\n\tif (typeof cursor !== \"string\") return refuse();\n\tlet decoded: unknown;\n\ttry {\n\t\tconst binary = atob(cursor.replaceAll(\"-\", \"+\").replaceAll(\"_\", \"/\"));\n\t\tdecoded = JSON.parse(\n\t\t\tnew TextDecoder(\"utf-8\", { fatal: true }).decode(Uint8Array.from(binary, (c) => c.charCodeAt(0))),\n\t\t);\n\t} catch {\n\t\treturn refuse();\n\t}\n\t// Wire input: every field is checked below.\n\tconst { t, o, d, v } = (decoded ?? {}) as { t?: unknown; o?: unknown; d?: unknown; v?: unknown };\n\tif (t !== sqlName || d !== order.direction || JSON.stringify(o) !== JSON.stringify(order.columns)) refuse();\n\tif (!Array.isArray(v) || v.length !== order.columns.length) return refuse();\n\treturn order.columns.map((name, index) => {\n\t\tconst column = table.byName.get(name)!;\n\t\t// Order columns are non-opt `str` or `int` (checked when the query was built).\n\t\treturn checkScalar(column.type as \"str\" | \"int\", v[index], `${table.name}: cursor`) as string | number;\n\t});\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"refusal.d.ts","sourceRoot":"","sources":["../../../src/next/store/refusal.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAgB,MAAM,kBAAkB,CAAC;AAE5D,qHAAqH;AACrH,MAAM,MAAM,OAAO,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAAC;AAK3D;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAc5E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"refusal.js","sourceRoot":"","sources":["../../../src/next/store/refusal.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,+GAA+G;AAC/G,6GAA6G;AAE7G,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAO5D,0GAA0G;AAC1G,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,KAAc,EAAE,KAAa;IACtD,IAAI,YAAY,CAAC,KAAK,EAAE,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,aAAa,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,gBAAgB,CAAC,EAAE,CAAC;QAClH,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,GAAG,KAAK,2CAA2C,OAAO,GAAG,CAAC;QAC9E,OAAO;YACN,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;SAC9F,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,KAAK,mCAAmC,OAAO,GAAG,CAAC;IACtE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAC/G,CAAC;AAED;;;GAGG;AACH,SAAS,OAAO,CAAC,KAAc,EAAE,OAAe;IAC/C,MAAM,IAAI,GAAI,KAAoD,EAAE,OAAO,CAAC;IAC5E,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,KAAK,uBAAuB,CAAC;IACtE,OAAO,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC;AACpD,CAAC","sourcesContent":["// A refused commit as Chord's owners take it (slice 6b D4, §1.4): the store rejects a step it rolled back with the\n// step's own error, unchanged (Durable's Storage semantics); Chord classifies it: an `int` column's `CHECK` (a\n// plugin's value out of range) fails only its transaction, any other refusal means memory and disk disagree.\n\nimport { ChordError, isChordError } from \"../data/index.ts\";\n\n/** How a Chord commit ended that the store rejected: `check` fails the transaction only, `broken` its object too. */\nexport type Refusal =\n\t| { readonly kind: \"check\"; readonly error: ChordError }\n\t| { readonly kind: \"broken\"; readonly error: ChordError };\n\n/** SQLite's extended result code `SQLITE_CONSTRAINT_CHECK`, which Node's binding reports as `errcode`. */\nconst SQLITE_CONSTRAINT_CHECK = 275;\n\n/**\n * The refusal behind `error`, a store commit's rejection; `undefined` when it is the store's own (`released` at\n * admission or after close, `unavailable/storage_failed` once stopped), which the owner rethrows as it is.\n */\nexport function refusalOf(error: unknown, label: string): Refusal | undefined {\n\tif (isChordError(error, \"released\") || (isChordError(error, \"unavailable\") && error.reason === \"storage_failed\")) {\n\t\treturn undefined;\n\t}\n\tconst message = error instanceof Error ? error.message : String(error);\n\tif (isCheck(error, message)) {\n\t\tconst refused = `${label}: a value is out of its column's range (${message})`;\n\t\treturn {\n\t\t\tkind: \"check\",\n\t\t\terror: new ChordError({ code: \"invalid\", reason: \"args\", message: refused }, { cause: error }),\n\t\t};\n\t}\n\tconst refused = `${label}: the store refused the commit (${message})`;\n\treturn { kind: \"broken\", error: new ChordError({ code: \"unavailable\", message: refused }, { cause: error }) };\n}\n\n/**\n * Whether a refusal is a `CHECK` failure: SQLite's extended code where the binding has one (Node), the message\n * otherwise (the Durable Object facade has no extended codes).\n */\nfunction isCheck(error: unknown, message: string): boolean {\n\tconst code = (error as { readonly errcode?: unknown } | undefined)?.errcode;\n\tif (typeof code === \"number\") return code === SQLITE_CONSTRAINT_CHECK;\n\treturn message.includes(\"CHECK constraint failed\");\n}\n"]}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { Context } from "../../context/index.ts";
|
|
2
|
-
import type { JsonValue } from "../../json.ts";
|
|
3
|
-
import type { SqliteValue } from "../../sqlite/index.ts";
|
|
4
|
-
import type { Column, ColumnType } from "./columns.ts";
|
|
5
|
-
/** A scalar cell as the store keeps it in rows, writes and operands: a well-formed string, a number or a boolean. */
|
|
6
|
-
export type Scalar = string | number | boolean;
|
|
7
|
-
/** A row as the outbox records it: the stored values, `opt(...)` columns absent when `NULL`. */
|
|
8
|
-
export type StoredRow = {
|
|
9
|
-
readonly [column: string]: Scalar | JsonValue;
|
|
10
|
-
};
|
|
11
|
-
/** A `put` ready for the step: its parameters in `physical` order and its record. */
|
|
12
|
-
export type EncodedRow = {
|
|
13
|
-
readonly params: readonly SqliteValue[];
|
|
14
|
-
readonly row: StoredRow;
|
|
15
|
-
/** Each written `json(...)` column's version. */
|
|
16
|
-
readonly columns: {
|
|
17
|
-
readonly [column: string]: number;
|
|
18
|
-
};
|
|
19
|
-
/** The row's key identity, as `EncodedKey.id`. */
|
|
20
|
-
readonly id: string;
|
|
21
|
-
};
|
|
22
|
-
/** A key ready for the store: its parameters in key order, its record and its identity within one table. */
|
|
23
|
-
export type EncodedKey = {
|
|
24
|
-
readonly params: readonly SqliteValue[];
|
|
25
|
-
readonly key: {
|
|
26
|
-
readonly [column: string]: Scalar;
|
|
27
|
-
};
|
|
28
|
-
/** `JSON.stringify` of the parameters: equal keys, equal ids. */
|
|
29
|
-
readonly id: string;
|
|
30
|
-
};
|
|
31
|
-
/** The physical name of a `json(...)` column's version column, and of the row's eager-step version. */
|
|
32
|
-
export declare function versionColumn(column: string): string;
|
|
33
|
-
/** The row's eager-step version column (W11): set by `put` and eager migration steps only. */
|
|
34
|
-
export declare const ROW_VERSION = "$v";
|
|
35
|
-
/** The physical column order of a stored row: the declared columns, each `json(...)` column's version, then `$v`. */
|
|
36
|
-
export declare function physicalColumns(columns: readonly {
|
|
37
|
-
readonly name: string;
|
|
38
|
-
readonly type: ColumnType;
|
|
39
|
-
}[]): string[];
|
|
40
|
-
/** A scalar as SQLite binds it: booleans as 0 and 1. */
|
|
41
|
-
export declare function toSqlite(scalar: Scalar): string | number;
|
|
42
|
-
/**
|
|
43
|
-
* A table version's codec: `put` rows and keys checked and encoded, stored rows decoded. `physical` is the column
|
|
44
|
-
* order of an encoded row (`physicalColumns`).
|
|
45
|
-
*/
|
|
46
|
-
export declare class RowCodec {
|
|
47
|
-
#private;
|
|
48
|
-
readonly physical: readonly string[];
|
|
49
|
-
constructor(columns: readonly Column[], key: readonly string[], table: string);
|
|
50
|
-
/**
|
|
51
|
-
* Checks and encodes a `put` row of table version `version` (a trust boundary): a plain object with every
|
|
52
|
-
* non-`opt` column (a defaulted one filled in) and no other field; `invalid/args` otherwise.
|
|
53
|
-
*/
|
|
54
|
-
put(row: unknown, version: number): EncodedRow;
|
|
55
|
-
/** Checks and encodes a key (a trust boundary): an object with exactly the key columns; `invalid/args` otherwise. */
|
|
56
|
-
key(key: unknown, what: string): EncodedKey;
|
|
57
|
-
/**
|
|
58
|
-
* A stored row as reads return it: booleans from 0 and 1, `opt(...)` columns absent when `NULL`, `json(...)` cells
|
|
59
|
-
* parsed and migrated on access (a cell the code cannot read throws, see `JsonColumn.read`).
|
|
60
|
-
*/
|
|
61
|
-
decode(stored: {
|
|
62
|
-
readonly [column: string]: SqliteValue;
|
|
63
|
-
}, context: Context): {
|
|
64
|
-
[column: string]: unknown;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
/** A checked cell: what is bound and what is recorded. */
|
|
68
|
-
type Cell = {
|
|
69
|
-
readonly param: SqliteValue;
|
|
70
|
-
readonly stored: Scalar | JsonValue;
|
|
71
|
-
};
|
|
72
|
-
/** Checks and encodes a value of `column`; a `json(...)` value is serialized, not walked (R9). */
|
|
73
|
-
export declare function encodeCell(column: Column, value: unknown, what: string): Cell;
|
|
74
|
-
/**
|
|
75
|
-
* A value of a scalar column type as the store keeps it (a trust boundary): `str` well-formed without NUL, `int` a
|
|
76
|
-
* safe integer, `num` finite, `bool` a boolean; `invalid/args` otherwise.
|
|
77
|
-
*/
|
|
78
|
-
export declare function checkScalar(type: "str" | "int" | "num" | "bool", value: unknown, what: string): Scalar;
|
|
79
|
-
export {};
|
|
80
|
-
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../src/next/store/rows.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGvD,qHAAqH;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K,CAAC;gBAAE,OAAO,KAAe,CAAC;YACxD,MAAM;QACP,KAAK,KAAK;YACT,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC;YACtE,MAAM;QACP,KAAK,MAAM;YACV,IAAI,OAAO,KAAK,KAAK,SAAS;gBAAE,OAAO,KAAK,CAAC;YAC7C,MAAM;IACR,CAAC;IACD,MAAM,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,aAAa,IAAI,QAAQ,CAAC,CAAC;AACpG,CAAC","sourcesContent":["// Rows (slice 6a §5 \"Values at write\", §9): one compiled codec per table version between a plugin's rows and keys\n// (a trust boundary, checked closed) and what the store binds and reads; `json(...)` cells serialized at staging\n// (rule 8), never walked (R9), and migrated on access when read.\n\nimport type { Context } from \"../../context/index.ts\";\nimport type { JsonValue } from \"../../json.ts\";\nimport type { SqliteValue } from \"../../sqlite/index.ts\";\nimport { invalid } from \"../data/internal.ts\";\nimport type { Column, ColumnType } from \"./columns.ts\";\nimport { storedText } from \"./text.ts\";\n\n/** A scalar cell as the store keeps it in rows, writes and operands: a well-formed string, a number or a boolean. */\nexport type Scalar = string | number | boolean;\n\n/** A row as the outbox records it: the stored values, `opt(...)` columns absent when `NULL`. */\nexport type StoredRow = { readonly [column: string]: Scalar | JsonValue };\n\n/** A `put` ready for the step: its parameters in `physical` order and its record. */\nexport type EncodedRow = {\n\treadonly params: readonly SqliteValue[];\n\treadonly row: StoredRow;\n\t/** Each written `json(...)` column's version. */\n\treadonly columns: { readonly [column: string]: number };\n\t/** The row's key identity, as `EncodedKey.id`. */\n\treadonly id: string;\n};\n\n/** A key ready for the store: its parameters in key order, its record and its identity within one table. */\nexport type EncodedKey = {\n\treadonly params: readonly SqliteValue[];\n\treadonly key: { readonly [column: string]: Scalar };\n\t/** `JSON.stringify` of the parameters: equal keys, equal ids. */\n\treadonly id: string;\n};\n\n/** The physical name of a `json(...)` column's version column, and of the row's eager-step version. */\nexport function versionColumn(column: string): string {\n\treturn `${column}$v`;\n}\n\n/** The row's eager-step version column (W11): set by `put` and eager migration steps only. */\nexport const ROW_VERSION = \"$v\";\n\n/** The physical column order of a stored row: the declared columns, each `json(...)` column's version, then `$v`. */\nexport function physicalColumns(columns: readonly { readonly name: string; readonly type: ColumnType }[]): string[] {\n\treturn [\n\t\t...columns.map(({ name }) => name),\n\t\t...columns.filter(({ type }) => type === \"json\").map(({ name }) => versionColumn(name)),\n\t\tROW_VERSION,\n\t];\n}\n\n/** A scalar as SQLite binds it: booleans as 0 and 1. */\nexport function toSqlite(scalar: Scalar): string | number {\n\treturn scalar === true ? 1 : scalar === false ? 0 : scalar;\n}\n\n/**\n * A table version's codec: `put` rows and keys checked and encoded, stored rows decoded. `physical` is the column\n * order of an encoded row (`physicalColumns`).\n */\nexport class RowCodec {\n\treadonly physical: readonly string[];\n\treadonly #columns: readonly Column[];\n\treadonly #key: readonly Column[];\n\treadonly #json: readonly Extract<Column, { readonly type: \"json\" }>[];\n\treadonly #names: ReadonlySet<string>;\n\treadonly #keyNames: ReadonlySet<string>;\n\t/** The positions of the key columns in `physical`. */\n\treadonly #keyPositions: readonly number[];\n\treadonly #table: string;\n\n\tconstructor(columns: readonly Column[], key: readonly string[], table: string) {\n\t\tthis.#columns = columns;\n\t\tthis.#key = key.map((name) => columns.find((column) => column.name === name)!);\n\t\tthis.#json = columns.filter(\n\t\t\t(column): column is Extract<Column, { readonly type: \"json\" }> => column.type === \"json\",\n\t\t);\n\t\tthis.#names = new Set(columns.map(({ name }) => name));\n\t\tthis.#keyNames = new Set(key);\n\t\tthis.#keyPositions = key.map((name) => columns.findIndex((column) => column.name === name));\n\t\tthis.#table = table;\n\t\tthis.physical = physicalColumns(columns);\n\t}\n\n\t/**\n\t * Checks and encodes a `put` row of table version `version` (a trust boundary): a plain object with every\n\t * non-`opt` column (a defaulted one filled in) and no other field; `invalid/args` otherwise.\n\t */\n\tput(row: unknown, version: number): EncodedRow {\n\t\tconst what = `${this.#table}: put`;\n\t\tconst fields = this.#closed(row, this.#names, what);\n\t\tconst params: SqliteValue[] = [];\n\t\tconst stored: { [column: string]: Scalar | JsonValue } = {};\n\t\tconst versions: { [column: string]: number } = {};\n\t\tfor (const column of this.#columns) {\n\t\t\tlet value = fields[column.name];\n\t\t\tif (value === undefined && column.type !== \"json\") value = column.default;\n\t\t\tif (value === undefined) {\n\t\t\t\tif (!column.optional) throw invalid(\"args\", `${what}: column \"${column.name}\" is missing`);\n\t\t\t\tparams.push(null);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst cell = encodeCell(column, value, `${what}: column \"${column.name}\"`);\n\t\t\tparams.push(cell.param);\n\t\t\tstored[column.name] = cell.stored;\n\t\t}\n\t\tfor (const column of this.#json) {\n\t\t\tconst present = Object.hasOwn(stored, column.name);\n\t\t\tif (present) versions[column.name] = column.json.version;\n\t\t\tparams.push(present ? column.json.version : null);\n\t\t}\n\t\tparams.push(version);\n\t\tconst id = JSON.stringify(this.#keyPositions.map((position) => params[position]));\n\t\treturn { params, row: stored, columns: versions, id };\n\t}\n\n\t/** Checks and encodes a key (a trust boundary): an object with exactly the key columns; `invalid/args` otherwise. */\n\tkey(key: unknown, what: string): EncodedKey {\n\t\tconst fields = this.#closed(key, this.#keyNames, `${this.#table}: ${what}: the key`);\n\t\tconst params: SqliteValue[] = [];\n\t\tconst stored: { [column: string]: Scalar } = {};\n\t\tfor (const column of this.#key) {\n\t\t\tconst value = fields[column.name];\n\t\t\tconst where = `${this.#table}: ${what}: key column \"${column.name}\"`;\n\t\t\tif (value === undefined) throw invalid(\"args\", `${where} is missing`);\n\t\t\tconst cell = encodeScalar(column, value, where);\n\t\t\tparams.push(cell);\n\t\t\tstored[column.name] = cell;\n\t\t}\n\t\treturn { params, key: stored, id: JSON.stringify(params) };\n\t}\n\n\t/**\n\t * A stored row as reads return it: booleans from 0 and 1, `opt(...)` columns absent when `NULL`, `json(...)` cells\n\t * parsed and migrated on access (a cell the code cannot read throws, see `JsonColumn.read`).\n\t */\n\tdecode(stored: { readonly [column: string]: SqliteValue }, context: Context): { [column: string]: unknown } {\n\t\tconst row: { [column: string]: unknown } = {};\n\t\tfor (const column of this.#columns) {\n\t\t\tconst value = stored[column.name];\n\t\t\tif (value === null || value === undefined) continue;\n\t\t\tif (column.type === \"bool\") row[column.name] = value === 1;\n\t\t\telse if (column.type === \"json\") {\n\t\t\t\tconst version = stored[versionColumn(column.name)] as number;\n\t\t\t\trow[column.name] = column.json.read(value as string, version, `${this.#table}.${column.name}`, context);\n\t\t\t} else row[column.name] = value;\n\t\t}\n\t\treturn row;\n\t}\n\n\t/** `value`'s own fields when it is a plain object with only fields of `names`; `invalid/args` otherwise. */\n\t#closed(value: unknown, names: ReadonlySet<string>, what: string): { readonly [field: string]: unknown } {\n\t\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\t\tthrow invalid(\"args\", `${what}: expected an object`);\n\t\t}\n\t\tfor (const field of Object.keys(value)) {\n\t\t\tif (!names.has(field)) throw invalid(\"args\", `${what}: unknown column \"${field}\"`);\n\t\t}\n\t\t// Checked above: a plain object with known fields.\n\t\treturn value as { readonly [field: string]: unknown };\n\t}\n}\n\n/** A checked cell: what is bound and what is recorded. */\ntype Cell = { readonly param: SqliteValue; readonly stored: Scalar | JsonValue };\n\n/** Checks and encodes a value of `column`; a `json(...)` value is serialized, not walked (R9). */\nexport function encodeCell(column: Column, value: unknown, what: string): Cell {\n\tif (column.type !== \"json\") {\n\t\tconst stored = checkScalar(column.type, value, what);\n\t\treturn { param: toSqlite(stored), stored };\n\t}\n\tlet text: string | undefined;\n\ttry {\n\t\ttext = JSON.stringify(value);\n\t} catch (error) {\n\t\tthrow invalid(\"args\", `${what}: not JSON (${error instanceof Error ? error.message : String(error)})`);\n\t}\n\tif (text === undefined) throw invalid(\"args\", `${what}: not JSON`);\n\t// `JSON.stringify` accepted it; the recorded value is the one serialized. It is kept, not copied or parsed back:\n\t// same-host values are immutable by convention, so the outbox serializing it again in the step records this text\n\t// (a plugin mutating a value after `tx.put` breaks that convention, as for any other value it hands over).\n\treturn { param: text, stored: value as JsonValue };\n}\n\n/** Checks a scalar value of `column` and returns what is bound (booleans as 0 and 1). */\nfunction encodeScalar(column: Column, value: unknown, what: string): string | number {\n\tif (column.type === \"json\") throw invalid(\"args\", `${what}: a json(...) column has no scalar value`);\n\treturn toSqlite(checkScalar(column.type, value, what));\n}\n\n/**\n * A value of a scalar column type as the store keeps it (a trust boundary): `str` well-formed without NUL, `int` a\n * safe integer, `num` finite, `bool` a boolean; `invalid/args` otherwise.\n */\nexport function checkScalar(type: \"str\" | \"int\" | \"num\" | \"bool\", value: unknown, what: string): Scalar {\n\tswitch (type) {\n\t\tcase \"str\":\n\t\t\tif (typeof value === \"string\") return storedText(value, what);\n\t\t\tbreak;\n\t\tcase \"int\":\n\t\t\tif (Number.isSafeInteger(value)) return value as number;\n\t\t\tbreak;\n\t\tcase \"num\":\n\t\t\tif (typeof value === \"number\" && Number.isFinite(value)) return value;\n\t\t\tbreak;\n\t\tcase \"bool\":\n\t\t\tif (typeof value === \"boolean\") return value;\n\t\t\tbreak;\n\t}\n\tthrow invalid(\"args\", `${what}: ${JSON.stringify(value) ?? String(value)} is not a ${type} value`);\n}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { type SqliteDatabase } from "../../sqlite/index.ts";
|
|
2
|
-
/** The store's tables. */
|
|
3
|
-
export declare const TABLES: {
|
|
4
|
-
readonly meta: "chord_meta";
|
|
5
|
-
readonly tables: "chord_tables";
|
|
6
|
-
readonly documents: "chord_documents";
|
|
7
|
-
readonly revisions: "chord_revisions";
|
|
8
|
-
readonly outbox: "chord_outbox";
|
|
9
|
-
};
|
|
10
|
-
/** The store's schema version: the newest entry of its history (archives carry it). */
|
|
11
|
-
export declare const STORE_SCHEMA: number;
|
|
12
|
-
/** The store's metadata row, as `openStore` reads it once. */
|
|
13
|
-
export type MetaRow = {
|
|
14
|
-
readonly last_seq: number;
|
|
15
|
-
readonly next_id: number;
|
|
16
|
-
readonly outbox: number;
|
|
17
|
-
readonly outbox_floor: number;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Brings `db` to the store's newest schema (one transaction) and checks that it stores text as UTF-8 (the store
|
|
21
|
-
* compares text by its bytes); returns the metadata row. A store already there is read in one statement, without the
|
|
22
|
-
* migrations' write transaction (most opens: the cost of a reopen).
|
|
23
|
-
*/
|
|
24
|
-
export declare function applyStoreSchema(db: SqliteDatabase): Promise<MetaRow>;
|
|
25
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/next/store/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAyB,KAAK,cAAc,EAAwB,MAAM,uBAAuB,CAAC;AAEzG,0BAA0B;AAC1B,eAAO,MAAM,MAAM;aAClB,IAAI,EAAE,YAAY;aAClB,MAAM,EAAE,cAAc;aACtB,SAAS,EAAE,iBAAiB;aAC5B,SAAS,EAAE,iBAAiB;aAC5B,MAAM,EAAE,cAAc;CACb,CAAC;AAmEX,uFAAuF;AACvF,eAAO,MAAM,YAAY,QAA6B,CAAC;AAEvD,8DAA8D;AAC9D,MAAM,MAAM,OAAO,GAAG;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAY3E"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
// The store's own SQL schema (slice 6a §2): its metadata, the recorded table definitions, the documents engine's
|
|
2
|
-
// records and revisions, and the outbox; versioned by `applySqliteMigrations`. Declared tables are named
|
|
3
|
-
// `"<owner>:<table>"`, so no name here can meet one of them.
|
|
4
|
-
import { applySqliteMigrations } from "../../sqlite/index.js";
|
|
5
|
-
/** The store's tables. */
|
|
6
|
-
export const TABLES = {
|
|
7
|
-
meta: "chord_meta",
|
|
8
|
-
tables: "chord_tables",
|
|
9
|
-
documents: "chord_documents",
|
|
10
|
-
revisions: "chord_revisions",
|
|
11
|
-
outbox: "chord_outbox",
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* The schema history; never change an entry, append one (nothing is deployed yet: slice 6b changed entry 1 in place).
|
|
15
|
-
* `chord_meta` is one row: `last_seq`, the allocator's next id (D3; from 2, id 1 is Durable's root conversation), and
|
|
16
|
-
* the outbox setting with its floor (the seq it starts after, advanced by `trim`). A document record keeps its
|
|
17
|
-
* history rule (R1), its current base's version and fingerprint and a `revision` counter for the conditional
|
|
18
|
-
* `UPDATE`; the partial unique index refuses two live records at one address. Entry 2 adds the indexes of reads at a
|
|
19
|
-
* point (slice 6b §1.5): an address's incarnations by creation, an owner's namespace by id, a document's bases (a
|
|
20
|
-
* partial index: deltas write no entry).
|
|
21
|
-
*/
|
|
22
|
-
const MIGRATIONS = [
|
|
23
|
-
{
|
|
24
|
-
version: 1,
|
|
25
|
-
statements: [
|
|
26
|
-
`CREATE TABLE ${TABLES.meta} (
|
|
27
|
-
singleton INTEGER PRIMARY KEY CHECK (singleton = 1),
|
|
28
|
-
last_seq INTEGER NOT NULL,
|
|
29
|
-
next_id INTEGER NOT NULL,
|
|
30
|
-
outbox INTEGER NOT NULL CHECK (outbox IN (0, 1)),
|
|
31
|
-
outbox_floor INTEGER NOT NULL
|
|
32
|
-
) STRICT`,
|
|
33
|
-
`INSERT INTO ${TABLES.meta} (singleton, last_seq, next_id, outbox, outbox_floor) VALUES (1, 0, 2, 0, 0)`,
|
|
34
|
-
`CREATE TABLE ${TABLES.tables} (name TEXT PRIMARY KEY, definition TEXT NOT NULL) STRICT, WITHOUT ROWID`,
|
|
35
|
-
`CREATE TABLE ${TABLES.documents} (
|
|
36
|
-
id INTEGER PRIMARY KEY,
|
|
37
|
-
owner TEXT NOT NULL,
|
|
38
|
-
namespace TEXT NOT NULL,
|
|
39
|
-
kind TEXT NOT NULL,
|
|
40
|
-
key TEXT NOT NULL,
|
|
41
|
-
history TEXT NOT NULL CHECK (history IN ('none', 'latest', 'rewindable')),
|
|
42
|
-
created_at INTEGER NOT NULL,
|
|
43
|
-
retired_at INTEGER,
|
|
44
|
-
meta TEXT,
|
|
45
|
-
revision INTEGER NOT NULL,
|
|
46
|
-
version INTEGER NOT NULL,
|
|
47
|
-
fingerprint TEXT NOT NULL
|
|
48
|
-
) STRICT`,
|
|
49
|
-
`CREATE UNIQUE INDEX chord_documents_live ON ${TABLES.documents} (owner, namespace, kind, key)
|
|
50
|
-
WHERE retired_at IS NULL`,
|
|
51
|
-
`CREATE TABLE ${TABLES.revisions} (
|
|
52
|
-
document_id INTEGER NOT NULL,
|
|
53
|
-
seq INTEGER NOT NULL,
|
|
54
|
-
kind TEXT NOT NULL CHECK (kind IN ('base', 'delta')),
|
|
55
|
-
version INTEGER NOT NULL,
|
|
56
|
-
content TEXT NOT NULL,
|
|
57
|
-
PRIMARY KEY (document_id, seq)
|
|
58
|
-
) STRICT, WITHOUT ROWID`,
|
|
59
|
-
`CREATE TABLE ${TABLES.outbox} (
|
|
60
|
-
seq INTEGER PRIMARY KEY,
|
|
61
|
-
format INTEGER NOT NULL,
|
|
62
|
-
next_id INTEGER NOT NULL,
|
|
63
|
-
writes TEXT NOT NULL
|
|
64
|
-
) STRICT`,
|
|
65
|
-
],
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
version: 2,
|
|
69
|
-
statements: [
|
|
70
|
-
`CREATE INDEX chord_documents_address ON ${TABLES.documents} (owner, namespace, kind, key, created_at)`,
|
|
71
|
-
`CREATE INDEX chord_documents_scope ON ${TABLES.documents} (owner, namespace, id)`,
|
|
72
|
-
// Only bases are looked up by it (a load's newest base at or below a point): deltas write no entry.
|
|
73
|
-
`CREATE INDEX chord_revisions_bases ON ${TABLES.revisions} (document_id, seq) WHERE kind = 'base'`,
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
];
|
|
77
|
-
/** The store's schema version: the newest entry of its history (archives carry it). */
|
|
78
|
-
export const STORE_SCHEMA = MIGRATIONS.at(-1).version;
|
|
79
|
-
/**
|
|
80
|
-
* Brings `db` to the store's newest schema (one transaction) and checks that it stores text as UTF-8 (the store
|
|
81
|
-
* compares text by its bytes); returns the metadata row. A store already there is read in one statement, without the
|
|
82
|
-
* migrations' write transaction (most opens: the cost of a reopen).
|
|
83
|
-
*/
|
|
84
|
-
export async function applyStoreSchema(db) {
|
|
85
|
-
const current = await currentMeta(db);
|
|
86
|
-
if (current !== undefined)
|
|
87
|
-
return current;
|
|
88
|
-
const encoding = await db.get("PRAGMA encoding");
|
|
89
|
-
if (encoding?.encoding !== "UTF-8")
|
|
90
|
-
throw new Error(`store: the database encoding is ${encoding?.encoding}, not UTF-8`);
|
|
91
|
-
await applySqliteMigrations(db, MIGRATIONS, { table: "chord_store_schema" });
|
|
92
|
-
const meta = await db.get(`SELECT last_seq, next_id, outbox, outbox_floor FROM ${TABLES.meta} WHERE singleton = 1`);
|
|
93
|
-
if (meta === undefined)
|
|
94
|
-
throw new Error("store: the metadata row is missing");
|
|
95
|
-
return meta;
|
|
96
|
-
}
|
|
97
|
-
/** The schema version, the encoding and the metadata row of a store, in one read. */
|
|
98
|
-
const CURRENT_META = `SELECT s.version, e.encoding, m.last_seq, m.next_id, m.outbox, m.outbox_floor
|
|
99
|
-
FROM chord_store_schema s, pragma_encoding e, ${TABLES.meta} m WHERE s.singleton = 1 AND m.singleton = 1`;
|
|
100
|
-
/** The metadata row of a store at the newest schema in UTF-8; `undefined` for any other database. */
|
|
101
|
-
async function currentMeta(db) {
|
|
102
|
-
let row;
|
|
103
|
-
try {
|
|
104
|
-
row = await db.get(CURRENT_META);
|
|
105
|
-
}
|
|
106
|
-
catch {
|
|
107
|
-
// A database without the store's tables (new, or not a store) or a backend without `pragma_encoding`: the
|
|
108
|
-
// migrations' path creates, refuses or reads it.
|
|
109
|
-
return undefined;
|
|
110
|
-
}
|
|
111
|
-
if (row === undefined || row.version !== STORE_SCHEMA || row.encoding !== "UTF-8")
|
|
112
|
-
return undefined;
|
|
113
|
-
return { last_seq: row.last_seq, next_id: row.next_id, outbox: row.outbox, outbox_floor: row.outbox_floor };
|
|
114
|
-
}
|
|
115
|
-
//# sourceMappingURL=schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/next/store/schema.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,yGAAyG;AACzG,6DAA6D;AAE7D,OAAO,EAAE,qBAAqB,EAA6C,MAAM,uBAAuB,CAAC;AAEzG,0BAA0B;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG;IACrB,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,cAAc;IACtB,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,iBAAiB;IAC5B,MAAM,EAAE,cAAc;CACb,CAAC;AAEX;;;;;;;;GAQG;AACH,MAAM,UAAU,GAA+B;IAC9C;QACC,OAAO,EAAE,CAAC;QACV,UAAU,EAAE;YACX,gBAAgB,MAAM,CAAC,IAAI;;;;;;YAMlB;YACT,eAAe,MAAM,CAAC,IAAI,8EAA8E;YACxG,gBAAgB,MAAM,CAAC,MAAM,0EAA0E;YACvG,gBAAgB,MAAM,CAAC,SAAS;;;;;;;;;;;;;YAavB;YACT,+CAA+C,MAAM,CAAC,SAAS;6BACrC;YAC1B,gBAAgB,MAAM,CAAC,SAAS;;;;;;;2BAOR;YACxB,gBAAgB,MAAM,CAAC,MAAM;;;;;YAKpB;SACT;KACD;IACD;QAC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AC,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACR,0GAA0G;QAC1G,iDAAiD;QACjD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,OAAO,KAAK,YAAY,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO,SAAS,CAAC;IACpG,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,YAAY,EAAE,CAAC;AAC7G,CAAC","sourcesContent":["// The store's own SQL schema (slice 6a §2): its metadata, the recorded table definitions, the documents engine's\n// records and revisions, and the outbox; versioned by `applySqliteMigrations`. Declared tables are named\n// `\"<owner>:<table>\"`, so no name here can meet one of them.\n\nimport { applySqliteMigrations, type SqliteDatabase, type SqliteMigration } from \"../../sqlite/index.ts\";\n\n/** The store's tables. */\nexport const TABLES = {\n\tmeta: \"chord_meta\",\n\ttables: \"chord_tables\",\n\tdocuments: \"chord_documents\",\n\trevisions: \"chord_revisions\",\n\toutbox: \"chord_outbox\",\n} as const;\n\n/**\n * The schema history; never change an entry, append one (nothing is deployed yet: slice 6b changed entry 1 in place).\n * `chord_meta` is one row: `last_seq`, the allocator's next id (D3; from 2, id 1 is Durable's root conversation), and\n * the outbox setting with its floor (the seq it starts after, advanced by `trim`). A document record keeps its\n * history rule (R1), its current base's version and fingerprint and a `revision` counter for the conditional\n * `UPDATE`; the partial unique index refuses two live records at one address. Entry 2 adds the indexes of reads at a\n * point (slice 6b §1.5): an address's incarnations by creation, an owner's namespace by id, a document's bases (a\n * partial index: deltas write no entry).\n */\nconst MIGRATIONS: readonly SqliteMigration[] = [\n\t{\n\t\tversion: 1,\n\t\tstatements: [\n\t\t\t`CREATE TABLE ${TABLES.meta} (\n\t\t\t\tsingleton INTEGER PRIMARY KEY CHECK (singleton = 1),\n\t\t\t\tlast_seq INTEGER NOT NULL,\n\t\t\t\tnext_id INTEGER NOT NULL,\n\t\t\t\toutbox INTEGER NOT NULL CHECK (outbox IN (0, 1)),\n\t\t\t\toutbox_floor INTEGER NOT NULL\n\t\t\t) STRICT`,\n\t\t\t`INSERT INTO ${TABLES.meta} (singleton, last_seq, next_id, outbox, outbox_floor) VALUES (1, 0, 2, 0, 0)`,\n\t\t\t`CREATE TABLE ${TABLES.tables} (name TEXT PRIMARY KEY, definition TEXT NOT NULL) STRICT, WITHOUT ROWID`,\n\t\t\t`CREATE TABLE ${TABLES.documents} (\n\t\t\t\tid INTEGER PRIMARY KEY,\n\t\t\t\towner TEXT NOT NULL,\n\t\t\t\tnamespace TEXT NOT NULL,\n\t\t\t\tkind TEXT NOT NULL,\n\t\t\t\tkey TEXT NOT NULL,\n\t\t\t\thistory TEXT NOT NULL CHECK (history IN ('none', 'latest', 'rewindable')),\n\t\t\t\tcreated_at INTEGER NOT NULL,\n\t\t\t\tretired_at INTEGER,\n\t\t\t\tmeta TEXT,\n\t\t\t\trevision INTEGER NOT NULL,\n\t\t\t\tversion INTEGER NOT NULL,\n\t\t\t\tfingerprint TEXT NOT NULL\n\t\t\t) STRICT`,\n\t\t\t`CREATE UNIQUE INDEX chord_documents_live ON ${TABLES.documents} (owner, namespace, kind, key)\n\t\t\t\tWHERE retired_at IS NULL`,\n\t\t\t`CREATE TABLE ${TABLES.revisions} (\n\t\t\t\tdocument_id INTEGER NOT NULL,\n\t\t\t\tseq INTEGER NOT NULL,\n\t\t\t\tkind TEXT NOT NULL CHECK (kind IN ('base', 'delta')),\n\t\t\t\tversion INTEGER NOT NULL,\n\t\t\t\tcontent TEXT NOT NULL,\n\t\t\t\tPRIMARY KEY (document_id, seq)\n\t\t\t) STRICT, WITHOUT ROWID`,\n\t\t\t`CREATE TABLE ${TABLES.outbox} (\n\t\t\t\tseq INTEGER PRIMARY KEY,\n\t\t\t\tformat INTEGER NOT NULL,\n\t\t\t\tnext_id INTEGER NOT NULL,\n\t\t\t\twrites TEXT NOT NULL\n\t\t\t) STRICT`,\n\t\t],\n\t},\n\t{\n\t\tversion: 2,\n\t\tstatements: [\n\t\t\t`CREATE INDEX chord_documents_address ON ${TABLES.documents} (owner, namespace, kind, key, created_at)`,\n\t\t\t`CREATE INDEX chord_documents_scope ON ${TABLES.documents} (owner, namespace, id)`,\n\t\t\t// Only bases are looked up by it (a load's newest base at or below a point): deltas write no entry.\n\t\t\t`CREATE INDEX chord_revisions_bases ON ${TABLES.revisions} (document_id, seq) WHERE kind = 'base'`,\n\t\t],\n\t},\n];\n\n/** The store's schema version: the newest entry of its history (archives carry it). */\nexport const STORE_SCHEMA = MIGRATIONS.at(-1)!.version;\n\n/** The store's metadata row, as `openStore` reads it once. */\nexport type MetaRow = {\n\treadonly last_seq: number;\n\treadonly next_id: number;\n\treadonly outbox: number;\n\treadonly outbox_floor: number;\n};\n\n/**\n * Brings `db` to the store's newest schema (one transaction) and checks that it stores text as UTF-8 (the store\n * compares text by its bytes); returns the metadata row. A store already there is read in one statement, without the\n * migrations' write transaction (most opens: the cost of a reopen).\n */\nexport async function applyStoreSchema(db: SqliteDatabase): Promise<MetaRow> {\n\tconst current = await currentMeta(db);\n\tif (current !== undefined) return current;\n\tconst encoding = await db.get<{ readonly encoding: string }>(\"PRAGMA encoding\");\n\tif (encoding?.encoding !== \"UTF-8\")\n\t\tthrow new Error(`store: the database encoding is ${encoding?.encoding}, not UTF-8`);\n\tawait applySqliteMigrations(db, MIGRATIONS, { table: \"chord_store_schema\" });\n\tconst meta = await db.get<MetaRow>(\n\t\t`SELECT last_seq, next_id, outbox, outbox_floor FROM ${TABLES.meta} WHERE singleton = 1`,\n\t);\n\tif (meta === undefined) throw new Error(\"store: the metadata row is missing\");\n\treturn meta;\n}\n\n/** The schema version, the encoding and the metadata row of a store, in one read. */\nconst CURRENT_META = `SELECT s.version, e.encoding, m.last_seq, m.next_id, m.outbox, m.outbox_floor\n\tFROM chord_store_schema s, pragma_encoding e, ${TABLES.meta} m WHERE s.singleton = 1 AND m.singleton = 1`;\n\n/** The metadata row of a store at the newest schema in UTF-8; `undefined` for any other database. */\nasync function currentMeta(db: SqliteDatabase): Promise<MetaRow | undefined> {\n\tlet row: (MetaRow & { readonly version: number; readonly encoding: string }) | undefined;\n\ttry {\n\t\trow = await db.get(CURRENT_META);\n\t} catch {\n\t\t// A database without the store's tables (new, or not a store) or a backend without `pragma_encoding`: the\n\t\t// migrations' path creates, refuses or reads it.\n\t\treturn undefined;\n\t}\n\tif (row === undefined || row.version !== STORE_SCHEMA || row.encoding !== \"UTF-8\") return undefined;\n\treturn { last_seq: row.last_seq, next_id: row.next_id, outbox: row.outbox, outbox_floor: row.outbox_floor };\n}\n"]}
|