@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../../src/node/tui/sandbox.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,gHAAgH;A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CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,MAAc;QAClB,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,CAAC;CACD;AAED;;;;;;GAMG;AACH,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA8BE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAkCb,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuIpD,CAAC","sourcesContent":["// The terminal's sandbox (slice 11 §4, decision \"Slice 11, P8\"; fix round 2: a child process, as the owner decided\n// after the worker thread was escaped through its shared realm): a Node child process of the launcher's binary.\n// - The operating system's side: its stdin, stdout and stderr are pipes to the launcher (never the terminal: no\n// descriptor of the child is a TTY), its environment empty, its directory a private one holding only the bootstrap;\n// Node's permission model with nothing allowed but reading the bootstrap (no other file read, no write, no network,\n// no child processes, no workers, no addons, no inspector, no WASI) and `node:sqlite` removed\n// (`--no-experimental-sqlite`: SQLite opens files past the permission model). An escape from the JavaScript layer\n// reaches no terminal, no file, no socket, no launcher memory or token.\n// - The JavaScript side, a second layer: downloaded code (the base bundle, a CommonJS script; the plugins' registered\n// scripts) is only evaluated by the bootstrap (`vm.Script` with no dynamic import callback, so `import()` throws),\n// with a `require` answering the allowed builtins only (`SANDBOX_BUILTINS`); `process` is a substitute with\n// `SANDBOX_PROCESS` only. The bootstrap keeps its own references to what it uses before any downloaded code runs.\n// Messages go both ways as length-prefixed binary frames (`pipe.ts`). Known gaps, each needing the JavaScript layer\n// broken first unless noted: the child may signal processes of the same user (Node has no permission for signals; the\n// launcher ignores SIGUSR1, which would open its inspector), read machine details (`os`), learn whether any path exists\n// (`require.resolve` fails one way for a file that exists, another for one that does not: Opus E13), and allocate\n// memory outside its heap (no limit without a shell's `ulimit`; only the child dies). Needs Node 26.5.1 or later.\n\nimport { type ChildProcessWithoutNullStreams, spawn } from \"node:child_process\";\nimport { mkdtemp, realpath, rm, writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { BridgeStart, LauncherMessage, SandboxMessage } from \"../../tui/bridge.ts\";\nimport { FrameReader, launcherFrame, MAX_PIPE_FRAME, startFrame } from \"./pipe.ts\";\n\n/** The largest base bundle a sandbox runs: 8 MiB. */\nexport const MAX_BUNDLE = 8 * 1024 * 1024;\n\n/**\n * The builtins code in the sandbox may `require`, each computation in memory without I/O, descriptors or machine\n * details: bytes and text (`buffer`, `string_decoder`, `punycode`, `querystring`), events and streams in memory\n * (`events`, `stream` and its submodules), formatting and type checks (`util`, `util/types`), URL and path strings\n * (`url`, `path`), timers, assertions, hashing and randomness (`crypto`: no keys from files, no network) and compression\n * in memory (`zlib`). Not `fs`, `tty`, `net`, `dgram`, `dns`, `http`, `https`, `http2`, `tls`, `child_process`,\n * `cluster`, `worker_threads`, `sqlite`, `inspector`, `vm`, `v8`, `os`, `module`, `process`, `perf_hooks`, `wasi`,\n * `repl`, `readline`, `trace_events` or anything else.\n */\nexport const SANDBOX_BUILTINS: readonly string[] = [\n\t\"assert\",\n\t\"assert/strict\",\n\t\"buffer\",\n\t\"crypto\",\n\t\"events\",\n\t\"path\",\n\t\"path/posix\",\n\t\"path/win32\",\n\t\"punycode\",\n\t\"querystring\",\n\t\"stream\",\n\t\"stream/consumers\",\n\t\"stream/promises\",\n\t\"stream/web\",\n\t\"string_decoder\",\n\t\"timers\",\n\t\"timers/promises\",\n\t\"url\",\n\t\"util\",\n\t\"util/types\",\n\t\"zlib\",\n];\n\n/**\n * The sandbox's `process`: a frozen plain object in place of Node's (no event emitter, so no prototype shared with\n * Node's internals leads back to the real one). Its properties, each harmless: which Node it is (`arch`, `platform`,\n * `version`, `versions`, `release`), time (`nextTick`, `hrtime`, `uptime`), ending the sandbox (`exit`), the permission\n * checks (`permission`), the allowed builtins (`getBuiltinModule`), fixed values (`env` empty, `argv`, `argv0`,\n * `execArgv`, `execPath`, `title`, `cwd` `/`), `stdout` (to the terminal through the bridge) and `stderr` (dropped),\n * and listener calls that keep nothing (`on`, `once`, `off`, `addListener`, `removeListener`, `removeAllListeners`,\n * `emit`, `emitWarning`, `listenerCount`, `listeners`). Not `binding`, `_linkedBinding`, `dlopen`, `_rawDebug`, `kill`,\n * `execve`, `chdir`, `abort`, `reallyExit`, `stdin`, `openStdin`, `report`, `pid`, `ppid`, `config`, the user and group\n * calls, `loadEnvFile`, `moduleLoadList`, resource and handle listings or any other.\n */\nexport const SANDBOX_PROCESS: readonly string[] = [\n\t\"addListener\",\n\t\"arch\",\n\t\"argv\",\n\t\"argv0\",\n\t\"cwd\",\n\t\"emit\",\n\t\"emitWarning\",\n\t\"env\",\n\t\"execArgv\",\n\t\"execPath\",\n\t\"exit\",\n\t\"getBuiltinModule\",\n\t\"hrtime\",\n\t\"listenerCount\",\n\t\"listeners\",\n\t\"nextTick\",\n\t\"off\",\n\t\"on\",\n\t\"once\",\n\t\"permission\",\n\t\"platform\",\n\t\"release\",\n\t\"removeAllListeners\",\n\t\"removeListener\",\n\t\"stderr\",\n\t\"stdout\",\n\t\"title\",\n\t\"uptime\",\n\t\"version\",\n\t\"versions\",\n];\n\n/**\n * The child's Node flags for its script `script`: the permission model allowing only reading that file, no SQLite, a\n * 96 MiB heap. Exported for the tests of the operating system's layer alone.\n */\nexport function sandboxFlags(script: string): string[] {\n\treturn [\"--permission\", `--allow-fs-read=${script}`, \"--no-experimental-sqlite\", \"--max-old-space-size=96\", script];\n}\n\n/** The bootstrap's file in the sandbox's directory: a script, not `-e`, which puts every builtin on `globalThis`. */\nexport const BOOTSTRAP_FILE = \"bootstrap.cjs\";\n\n/** The most bytes waiting for the sandbox to read them before it counts as stuck: 64 MiB. */\nconst MAX_UNREAD = 64 * 1024 * 1024;\n\n/** Throws unless this Node is 26.5.1 or later, the Node the sandbox's permissions were checked on. */\nexport function requireSandboxNode(version: string = process.versions.node): void {\n\tconst [major = 0, minor = 0, patch = 0] = version.split(\".\").map(Number);\n\tif (major > 26 || (major === 26 && (minor > 5 || (minor === 5 && patch >= 1)))) return;\n\tthrow new Error(`the terminal client needs Node 26.5.1 or later for its sandbox (this is Node ${version})`);\n}\n\n/**\n * The child's environment: empty, but for `LD_LIBRARY_PATH` when the launcher has one: the launcher needed it to run\n * this same binary (a Node built against libraries outside the system's paths), and the server cannot influence it.\n */\nexport function sandboxEnvironment(): Record<string, string> {\n\tconst libraries = process.env.LD_LIBRARY_PATH;\n\treturn libraries === undefined ? {} : { LD_LIBRARY_PATH: libraries };\n}\n\n/** A running sandbox: messages both ways, and its end. */\nexport class Sandbox {\n\treadonly #child: ChildProcessWithoutNullStreams;\n\treadonly #directory: string;\n\treadonly #onMessage: (message: SandboxMessage) => void;\n\treadonly #onEnd: (reason: string) => void;\n\treadonly #reader = new FrameReader();\n\treadonly #exited: Promise<void>;\n\t#ended = false;\n\t/** Whether the child has sent anything: its bootstrap was read, so the file goes. */\n\t#running = false;\n\n\t/**\n\t * Starts a sandbox running the base bundle `source` (a CommonJS script) with `start` on its bridge; `onMessage` gets\n\t * what it sends, `onEnd` its end (an exit, a crash, its memory limit, a malformed frame), once.\n\t */\n\tstatic async start(\n\t\tsource: string,\n\t\tstart: BridgeStart,\n\t\tonMessage: (message: SandboxMessage) => void,\n\t\tonEnd: (reason: string) => void,\n\t): Promise<Sandbox> {\n\t\trequireSandboxNode();\n\t\tif (Buffer.byteLength(source) > MAX_BUNDLE) throw new Error(\"terminal: the base bundle exceeds 8 MiB\");\n\t\t// Node resolves its entry before reading it; a symlinked ancestor would need a broader file grant.\n\t\tconst directory = await realpath(await mkdtemp(join(tmpdir(), \"chord-tui-\")));\n\t\tawait writeFile(join(directory, BOOTSTRAP_FILE), BOOTSTRAP);\n\t\tconst sandbox = new Sandbox(directory, onMessage, onEnd);\n\t\tsandbox.#write(startFrame(start, source));\n\t\treturn sandbox;\n\t}\n\n\tprivate constructor(\n\t\tdirectory: string,\n\t\tonMessage: (message: SandboxMessage) => void,\n\t\tonEnd: (reason: string) => void,\n\t) {\n\t\tthis.#directory = directory;\n\t\tthis.#onMessage = onMessage;\n\t\tthis.#onEnd = onEnd;\n\t\tthis.#child = spawn(process.execPath, sandboxFlags(join(directory, BOOTSTRAP_FILE)), {\n\t\t\tstdio: [\"pipe\", \"pipe\", \"pipe\"],\n\t\t\tenv: sandboxEnvironment(),\n\t\t\tcwd: directory,\n\t\t\twindowsHide: true,\n\t\t});\n\t\tthis.#exited = new Promise((resolve) => this.#child.once(\"close\", () => resolve()));\n\t\tthis.#child.stdout.on(\"data\", (chunk: Buffer) => this.#read(chunk));\n\t\t// Dropped: the sandbox writes only through the bridge, and the terminal is the launcher's.\n\t\tthis.#child.stderr.resume();\n\t\t// A write after the child ended fails here; its end is reported by `close`.\n\t\tthis.#child.stdin.on(\"error\", () => {});\n\t\tthis.#child.on(\"error\", (error) => this.#end(`the terminal client failed: ${error.message}`));\n\t\tthis.#child.on(\"close\", () => {\n\t\t\tthis.#end(\"the terminal client exited\");\n\t\t\tvoid rm(this.#directory, { recursive: true, force: true });\n\t\t});\n\t}\n\n\t/** Sends `message` to the sandbox; a sandbox not reading what it was sent is ended. */\n\tpost(message: LauncherMessage): void {\n\t\tif (!this.#ended) this.#write(launcherFrame(message));\n\t}\n\n\t/** Ends the sandbox and waits for its exit. */\n\tasync terminate(): Promise<void> {\n\t\tthis.#ended = true;\n\t\tthis.#child.kill(\"SIGKILL\");\n\t\tawait this.#exited;\n\t}\n\n\t#write(frame: Buffer): void {\n\t\tif (this.#child.stdin.writableLength + frame.length > MAX_UNREAD + MAX_PIPE_FRAME) {\n\t\t\tthis.#fail(\"the terminal client stopped reading\");\n\t\t\treturn;\n\t\t}\n\t\tthis.#child.stdin.write(frame);\n\t}\n\n\t/** The sandbox's output: its messages, each passed on; a malformed one ends the sandbox. */\n\t#read(chunk: Buffer): void {\n\t\tif (this.#ended) return;\n\t\tif (!this.#running) {\n\t\t\tthis.#running = true;\n\t\t\t// Read once at the start; a launcher killed later leaves at most an empty directory.\n\t\t\tvoid rm(join(this.#directory, BOOTSTRAP_FILE), { force: true });\n\t\t}\n\t\tlet messages: SandboxMessage[];\n\t\ttry {\n\t\t\tmessages = this.#reader.push(chunk);\n\t\t} catch (error) {\n\t\t\tthis.#fail((error as Error).message);\n\t\t\treturn;\n\t\t}\n\t\tfor (const message of messages) if (!this.#ended) this.#onMessage(message);\n\t}\n\n\t#fail(reason: string): void {\n\t\tthis.#child.kill(\"SIGKILL\");\n\t\tthis.#end(reason);\n\t}\n\n\t#end(reason: string): void {\n\t\tif (this.#ended) return;\n\t\tthis.#ended = true;\n\t\tthis.#onEnd(reason);\n\t}\n}\n\n/**\n * The trusted bootstrap (strict CommonJS, the child's main script). Before any downloaded code runs it keeps its own\n * references to what it uses (so code that changes shared prototypes later cannot steer it), closes the file system's\n * functions, shadows the real `process`'s listener calls, puts the substitute `process` in place, removes the module\n * globals and leaves the bridge on `globalThis`; then it waits for the launcher's start frame and evaluates the base\n * bundle through its own `require`. Frames as in `pipe.ts`.\n */\nconst BOOTSTRAP = `\"use strict\";\nconst real = process;\nconst getBuiltin = real.getBuiltinModule;\nconst apply = Reflect.apply;\nconst uncurry = Function.prototype.call.bind(Function.prototype.bind, Function.prototype.call);\nconst parse = JSON.parse;\nconst stringify = JSON.stringify;\nconst freeze = Object.freeze;\nconst define = Object.defineProperty;\nconst BufferFrom = Buffer.from;\nconst BufferAlloc = Buffer.allocUnsafe;\nconst BufferConcat = Buffer.concat;\nconst readUInt32BE = uncurry(Buffer.prototype.readUInt32BE);\nconst writeUInt32BE = uncurry(Buffer.prototype.writeUInt32BE);\nconst bufferText = uncurry(Buffer.prototype.toString);\nconst subarray = uncurry(Buffer.prototype.subarray);\nconst copyBytes = uncurry(Buffer.prototype.copy);\nconst isUint8Array = (value) => value instanceof Uint8Array;\nconst builtin0 = (id) => apply(getBuiltin, real, [id]);\nconst Script = builtin0(\"node:vm\").Script;\nconst runInThisContext = uncurry(Script.prototype.runInThisContext);\nconst nextTick = real.nextTick;\nconst hrtime = real.hrtime;\nconst hrtimeBigint = real.hrtime.bigint;\nconst uptime = real.uptime;\nconst exit = real.exit;\nconst input = real.stdin;\nconst output = real.stdout;\nconst writeOutput = uncurry(output.write);\nconst onInput = uncurry(input.on);\nconst MAX_FRAME = ${MAX_PIPE_FRAME};\nconst deny = () => {\n\tthrow new Error(\"unavailable in the terminal's sandbox\");\n};\n\n// The file system's functions closed: the permission model guards paths, not the pipes' descriptors.\nfor (const facade of [builtin0(\"node:fs\"), builtin0(\"node:fs/promises\")]) {\n\tfor (const name of Object.keys(facade)) {\n\t\tif (typeof facade[name] === \"function\") define(facade, name, { value: deny, writable: false, configurable: false, enumerable: true });\n\t}\n}\nconst v8 = builtin0(\"node:v8\");\nfor (const name of [\"writeHeapSnapshot\", \"getHeapSnapshot\", \"queryObjects\", \"setFlagsFromString\", \"takeCoverage\", \"startCpuProfile\", \"startHeapProfile\"]) {\n\tif (typeof v8[name] === \"function\") v8[name] = deny;\n}\nbuiltin0(\"node:module\").syncBuiltinESMExports();\n// Node emits on its own process (warnings among them): its listener calls are its own properties, not the shared\n// prototype's, which downloaded code may change.\nconst emitter = builtin0(\"node:events\").EventEmitter.prototype;\nfor (const name of Object.getOwnPropertyNames(emitter)) {\n\tif (name !== \"constructor\" && typeof emitter[name] === \"function\") define(real, name, { value: emitter[name], writable: false, configurable: false });\n}\n// Node reads properties its process does not have (noDeprecation, throwDeprecation, traceDeprecation,\n// traceProcessWarnings, channel, connected, …): such a read goes up the prototype chain, where a getter would get the\n// real process as its this (Opus E7: Buffer(1) warns, and the warning reads process.noDeprecation). Every prototype of\n// the chain, Object.prototype included, takes no new property and keeps its own ones, so no getter and no other\n// prototype gets in. Not frozen: Node assigns over prototype fields (\\`this._events ??= {}\\`).\nfor (let prototype = Object.getPrototypeOf(real); prototype !== null; prototype = Object.getPrototypeOf(prototype)) {\n\tfor (const key of Reflect.ownKeys(prototype)) define(prototype, key, { configurable: false });\n\tObject.preventExtensions(prototype);\n}\n\n// The allowed builtins, by name with or without \"node:\"; looked up in an object of no prototype.\nconst allowed = Object.create(null);\nfor (const name of ${JSON.stringify(SANDBOX_BUILTINS)}) allowed[name] = true;\nconst builtin = (id) => {\n\tif (typeof id !== \"string\") throw new Error(\"unavailable in the terminal's sandbox\");\n\tconst name = id.length > 5 && id[0] === \"n\" && id[1] === \"o\" && id[2] === \"d\" && id[3] === \"e\" && id[4] === \":\" ? id.slice(5) : id;\n\tif (typeof name !== \"string\" || allowed[name] !== true) throw new Error(id + \": unavailable in the terminal's sandbox\");\n\treturn builtin0(\"node:\" + name);\n};\n\n// Frames out: the message's header as JSON, its write text or socket bytes as the body.\nconst send = (message) => {\n\tconst kind = message.kind;\n\tlet header;\n\tlet body;\n\tif (kind === \"write\") {\n\t\tconst data = String(message.data);\n\t\t// Refused before it is copied: a huge string costs no buffer of its size.\n\t\tif (data.length > MAX_FRAME) throw new RangeError(\"the terminal's bridge takes frames of at most 17 MiB\");\n\t\theader = { kind };\n\t\tbody = BufferFrom(data);\n\t} else if (kind === \"socket_send\") {\n\t\tif (!isUint8Array(message.bytes)) throw new TypeError(\"socket_send: bytes expected\");\n\t\theader = { kind, socket: message.socket };\n\t\tbody = message.bytes;\n\t} else {\n\t\theader = message;\n\t}\n\tconst json = BufferFrom(stringify(header));\n\tconst length = 4 + json.length + (body === undefined ? 0 : body.length);\n\tif (length > MAX_FRAME) throw new RangeError(\"the terminal's bridge takes frames of at most 17 MiB\");\n\tconst prefix = BufferAlloc(8);\n\twriteUInt32BE(prefix, length, 0);\n\twriteUInt32BE(prefix, json.length, 4);\n\twriteOutput(output, BufferConcat(body === undefined ? [prefix, json] : [prefix, json, body]));\n};\n\n// The substitute process.\nconst stdout = freeze({ isTTY: false, write: (data) => (send({ kind: \"write\", data: String(data) }), true) });\nconst listening = (name) => [name, function () { return fake; }];\nconst fake = freeze({\n\tarch: real.arch,\n\tplatform: real.platform,\n\tversion: real.version,\n\tversions: freeze({ ...real.versions }),\n\trelease: freeze({ ...real.release }),\n\tnextTick: (...args) => apply(nextTick, real, args),\n\thrtime: Object.assign((...args) => apply(hrtime, real, args), { bigint: () => apply(hrtimeBigint, real, []) }),\n\tuptime: () => apply(uptime, real, []),\n\texit: (code) => apply(exit, real, [code]),\n\tpermission: real.permission,\n\tenv: freeze({}),\n\targv: freeze([\"node\"]),\n\targv0: \"node\",\n\texecArgv: freeze([]),\n\texecPath: \"node\",\n\ttitle: \"node\",\n\tcwd: () => \"/\",\n\tgetBuiltinModule: builtin,\n\tstdout,\n\tstderr: freeze({ isTTY: false, write: () => true }),\n\t...Object.fromEntries([\"on\", \"once\", \"off\", \"addListener\", \"removeListener\", \"removeAllListeners\"].map(listening)),\n\temit: () => false,\n\temitWarning: () => {},\n\tlistenerCount: () => 0,\n\tlisteners: () => [],\n});\ndefine(globalThis, \"process\", { value: fake, writable: false, configurable: false, enumerable: false });\nfor (const name of [\"BroadcastChannel\", \"localStorage\", \"sessionStorage\"]) delete globalThis[name];\n\n// Downloaded code runs only through here, with options of no prototype (nothing read from Object.prototype).\nconst evaluate = (text, filename) => {\n\tconst options = Object.create(null);\n\toptions.filename = String(filename);\n\treturn runInThisContext(new Script(String(text), options));\n};\n\n// Frames in: the first is the start (the bridge's start and the base bundle), the rest the launcher's messages.\nlet listener;\nlet started = false;\n// Unread bytes: one buffer, grown by doubling, each byte copied in once.\nlet pending = BufferAlloc(64 * 1024);\nlet start = 0;\nlet end = 0;\nconst received = (payload) => {\n\tconst headerLength = readUInt32BE(payload, 0);\n\tconst header = parse(bufferText(payload, \"utf8\", 4, 4 + headerLength));\n\tconst body = subarray(payload, 4 + headerLength);\n\tif (!started) {\n\t\tstarted = true;\n\t\trun(header.start, bufferText(body, \"utf8\"));\n\t\treturn;\n\t}\n\tif (header.kind === \"input\") header.data = bufferText(body, \"utf8\");\n\telse if (header.kind === \"socket_message\" || header.kind === \"attached\") header.bytes = new Uint8Array(body);\n\tif (listener !== undefined) listener(header);\n};\nonInput(input, \"data\", (chunk) => {\n\tif (end + chunk.length > pending.length) {\n\t\tconst unread = end - start;\n\t\tconst target = unread + chunk.length <= pending.length ? pending : BufferAlloc(Math.max(unread + chunk.length, pending.length * 2));\n\t\tcopyBytes(pending, target, 0, start, end);\n\t\tpending = target;\n\t\tstart = 0;\n\t\tend = unread;\n\t}\n\tcopyBytes(chunk, pending, end);\n\tend += chunk.length;\n\twhile (end - start >= 4) {\n\t\tconst length = readUInt32BE(pending, start);\n\t\tif (length > MAX_FRAME) apply(exit, real, [70]);\n\t\tif (end - start < 4 + length) break;\n\t\t// A copy: the buffer is reused, and what the frame carries is kept by the sandbox.\n\t\tconst payload = BufferAlloc(length);\n\t\tcopyBytes(pending, payload, 0, start + 4, start + 4 + length);\n\t\tstart += 4 + length;\n\t\treceived(payload);\n\t}\n\tif (start === end) start = end = 0;\n});\nonInput(input, \"end\", () => apply(exit, real, [0]));\nconst run = (start, source) => {\n\tglobalThis.chordBridge = freeze({\n\t\tstart: freeze(start),\n\t\tsend,\n\t\tonMessage: (next) => {\n\t\t\tlistener = next;\n\t\t},\n\t\tevaluate,\n\t});\n\ttry {\n\t\tconst base = { exports: {} };\n\t\tevaluate(\"(function (require, module, exports) {\" + source + \"\\\\n})\", \"chord-base.js\")(builtin, base, base.exports);\n\t} catch (error) {\n\t\tsend({ kind: \"failed\", message: String(error && error.message) });\n\t}\n};\n`;\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type BaseInputs } from "../plugins/base-inputs.ts";
|
|
2
|
+
/** A worker kind's bundled base: the file workers are forked from, and the files it was built from. */
|
|
3
|
+
export interface WorkerBase {
|
|
4
|
+
/** The files esbuild read for it with their bytes' hashes: the app's base code, a file differing outdates it. */
|
|
5
|
+
readonly inputs: BaseInputs;
|
|
6
|
+
/**
|
|
7
|
+
* The entry module's path, its chunks beside it: written at the first call, and again when a temporary-file cleaner
|
|
8
|
+
* removed one of them (into a new temporary directory, or its named one).
|
|
9
|
+
*/
|
|
10
|
+
file(): string;
|
|
11
|
+
/** Removes the bundle's directory, when `file()` wrote it. */
|
|
12
|
+
remove(): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Bundles `entry` for workers forked with `execArgv` (its `--conditions` resolve imports as the child's Node would),
|
|
16
|
+
* in memory; its files are written at the handle's first `file()`, into `dir` (a private directory the handle owns:
|
|
17
|
+
* emptied first, removed by `remove`) or, without one, a new temporary directory. Rejects with esbuild's failure.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildWorkerBase(entry: string, execArgv: readonly string[], dir?: string): Promise<WorkerBase>;
|
|
20
|
+
/**
|
|
21
|
+
* The files of the static import graph of Node code started from `entry` with `conditions`, with their bytes' hashes: a
|
|
22
|
+
* best-effort scan (esbuild bundles it only to record what it reads; nothing is written or run). It sees the literal
|
|
23
|
+
* imports of the graph, including lazy literal `import()`s Node may never run (conservative: such a file's edit asks
|
|
24
|
+
* for a restart); a computed `import(x)` and modules a loader provides are not seen, and an import that does not
|
|
25
|
+
* resolve (an inactive optional import of a missing file or package, a loader's scheme) is left out. It resolves as
|
|
26
|
+
* Node does: the conditions, `main`, no `tsconfig.json` `paths`; installed packages are left out (never compared).
|
|
27
|
+
* Rejects with esbuild's failure for anything else (a file it cannot parse).
|
|
28
|
+
*/
|
|
29
|
+
export declare function nodeBaseInputs(entry: string, conditions: readonly string[]): Promise<BaseInputs>;
|
|
30
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/node/workers/base.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,UAAU,EAAiC,MAAM,2BAA2B,CAAC;AAG3F,uGAAuG;AACvG,MAAM,WAAW,UAAU;IAC1B,iHAAiH;IACjH,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B;;;OAGG;IACH,IAAI,IAAI,MAAM,CAAC;IACf,8DAA8D;IAC9D,MAAM,IAAI,IAAI,CAAC;CACf;AAaD;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CA+CnH;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAkBtG"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// The worker base (decision "Workers start from the base code the server booted with"): a worker kind's entry and the
|
|
2
|
+
// base code it imports, bundled once by esbuild when the workers component builds it (the kit: right after the server
|
|
3
|
+
// listens), as the surfaces build their base bundles. Every worker of the kind is forked from this snapshot, so an edit
|
|
4
|
+
// of the app's source while the server runs reaches workers only through a restart of the server. Packages installed under `node_modules` (native
|
|
5
|
+
// addons, packages reading their own files) and Node builtins stay external: Node loads them at each fork from where
|
|
6
|
+
// the build resolved them. Everything else, the app's files and workspace packages linked into `node_modules`, is
|
|
7
|
+
// inlined. The bundle is split at each dynamic `import()` esbuild can follow: the entry module and the chunks it imports
|
|
8
|
+
// statically load at each fork, a lazily imported module (pi-ai's provider APIs and the packages they import) only when
|
|
9
|
+
// the worker imports it. Every file is an ES module with an inline source map, written at the first fork (`file()`;
|
|
10
|
+
// a handle never forked writes nothing) into one private directory its handle owns and removes: a new temporary one, or
|
|
11
|
+
// one the caller names (the kit's per kind in the data directory: the same path at every start, so Node's compile cache
|
|
12
|
+
// knows the files). Every file the build read is recorded with its bytes' hash
|
|
13
|
+
// (`BaseInputs`), as its one read hands them to esbuild.
|
|
14
|
+
import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
15
|
+
import { isBuiltin } from "node:module";
|
|
16
|
+
import { tmpdir } from "node:os";
|
|
17
|
+
import { basename, dirname, extname, join, parse, resolve, sep } from "node:path";
|
|
18
|
+
import { pathToFileURL } from "node:url";
|
|
19
|
+
import { build } from "esbuild";
|
|
20
|
+
import { readRecorded, recordedSources } from "../plugins/base-inputs.js";
|
|
21
|
+
import { conditionsOf } from "../surfaces/bundle.js";
|
|
22
|
+
/**
|
|
23
|
+
* What `import.meta.url`, `.dirname` and `.filename` (and a CommonJS file's free `__dirname` and `__filename`) become: a
|
|
24
|
+
* module's own constants (`moduleLocations`).
|
|
25
|
+
*/
|
|
26
|
+
const MODULE_URL = "__chordModuleUrl";
|
|
27
|
+
const MODULE_DIRNAME = "__chordModuleDirname";
|
|
28
|
+
const MODULE_FILENAME = "__chordModuleFilename";
|
|
29
|
+
/** The entry module's name in the bundle's directory (`worker.mjs`); chunks are named `<name>-<hash>.mjs`. */
|
|
30
|
+
const ENTRY_NAME = "worker";
|
|
31
|
+
/**
|
|
32
|
+
* Bundles `entry` for workers forked with `execArgv` (its `--conditions` resolve imports as the child's Node would),
|
|
33
|
+
* in memory; its files are written at the handle's first `file()`, into `dir` (a private directory the handle owns:
|
|
34
|
+
* emptied first, removed by `remove`) or, without one, a new temporary directory. Rejects with esbuild's failure.
|
|
35
|
+
*/
|
|
36
|
+
export async function buildWorkerBase(entry, execArgv, dir) {
|
|
37
|
+
// Built as if at the file system's root: the source map's paths relative to it, made absolute by `sourceRoot`.
|
|
38
|
+
const root = parse(resolve(entry)).root;
|
|
39
|
+
const inputs = new Map();
|
|
40
|
+
const result = await build({
|
|
41
|
+
entryPoints: [{ in: entry, out: ENTRY_NAME }],
|
|
42
|
+
// One flat directory: every chunk imports the others as `./<name>`, and the source maps' paths stay relative to
|
|
43
|
+
// the root.
|
|
44
|
+
outdir: root,
|
|
45
|
+
entryNames: "[name]",
|
|
46
|
+
chunkNames: "[name]-[hash]",
|
|
47
|
+
outExtension: { ".js": ".mjs" },
|
|
48
|
+
// A dynamic `import()` esbuild can follow becomes a chunk Node loads only when the worker imports it, with the
|
|
49
|
+
// packages it imports: inlined into one module, every lazily imported module would load and run at each fork.
|
|
50
|
+
splitting: true,
|
|
51
|
+
write: false,
|
|
52
|
+
bundle: true,
|
|
53
|
+
format: "esm",
|
|
54
|
+
platform: "node",
|
|
55
|
+
// Node's own resolution: the child's conditions, `main` only (no `module` condition or field).
|
|
56
|
+
conditions: conditionsOf(execArgv),
|
|
57
|
+
mainFields: ["main"],
|
|
58
|
+
// Every imported module runs, as Node runs it: `sideEffects: false` and pure annotations drop none (the entry's
|
|
59
|
+
// own package may say it, as Chord's does).
|
|
60
|
+
ignoreAnnotations: true,
|
|
61
|
+
// Function and class names as the source has them (`name` stays what unbundled code sees).
|
|
62
|
+
keepNames: true,
|
|
63
|
+
sourcemap: "inline",
|
|
64
|
+
sourcesContent: false,
|
|
65
|
+
sourceRoot: pathToFileURL(root).href,
|
|
66
|
+
// A CommonJS file of the base code requires through this (each chunk has its own); external packages by their
|
|
67
|
+
// absolute paths.
|
|
68
|
+
banner: {
|
|
69
|
+
js: 'import { createRequire as __chordCreateRequire } from "node:module"; const require = __chordCreateRequire(import.meta.url);',
|
|
70
|
+
},
|
|
71
|
+
define: {
|
|
72
|
+
"import.meta.url": MODULE_URL,
|
|
73
|
+
"import.meta.dirname": MODULE_DIRNAME,
|
|
74
|
+
"import.meta.filename": MODULE_FILENAME,
|
|
75
|
+
__dirname: MODULE_DIRNAME,
|
|
76
|
+
__filename: MODULE_FILENAME,
|
|
77
|
+
},
|
|
78
|
+
plugins: [installedPackages(), moduleLocations(inputs), recordedSources(inputs)],
|
|
79
|
+
logLevel: "silent",
|
|
80
|
+
});
|
|
81
|
+
const files = result.outputFiles.map((output) => ({ name: basename(output.path), contents: output.contents }));
|
|
82
|
+
return new BundleFiles(files, inputs, dir);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The files of the static import graph of Node code started from `entry` with `conditions`, with their bytes' hashes: a
|
|
86
|
+
* best-effort scan (esbuild bundles it only to record what it reads; nothing is written or run). It sees the literal
|
|
87
|
+
* imports of the graph, including lazy literal `import()`s Node may never run (conservative: such a file's edit asks
|
|
88
|
+
* for a restart); a computed `import(x)` and modules a loader provides are not seen, and an import that does not
|
|
89
|
+
* resolve (an inactive optional import of a missing file or package, a loader's scheme) is left out. It resolves as
|
|
90
|
+
* Node does: the conditions, `main`, no `tsconfig.json` `paths`; installed packages are left out (never compared).
|
|
91
|
+
* Rejects with esbuild's failure for anything else (a file it cannot parse).
|
|
92
|
+
*/
|
|
93
|
+
export async function nodeBaseInputs(entry, conditions) {
|
|
94
|
+
const inputs = new Map();
|
|
95
|
+
await build({
|
|
96
|
+
entryPoints: [entry],
|
|
97
|
+
write: false,
|
|
98
|
+
bundle: true,
|
|
99
|
+
format: "esm",
|
|
100
|
+
platform: "node",
|
|
101
|
+
conditions: [...conditions],
|
|
102
|
+
mainFields: ["main"],
|
|
103
|
+
// Node reads no tsconfig.json: its `paths` would resolve an import elsewhere than Node does.
|
|
104
|
+
tsconfigRaw: "{}",
|
|
105
|
+
// Every file the bundle reaches is read, as Node would load it; the output is dropped.
|
|
106
|
+
ignoreAnnotations: true,
|
|
107
|
+
plugins: [staticGraph(), recordedSources(inputs)],
|
|
108
|
+
logLevel: "silent",
|
|
109
|
+
});
|
|
110
|
+
return inputs;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The scan's resolution (`nodeBaseInputs`): an import resolving under a `node_modules` directory and one that does not
|
|
114
|
+
* resolve at all are left out (external); the rest resolves as esbuild does.
|
|
115
|
+
*/
|
|
116
|
+
function staticGraph() {
|
|
117
|
+
return {
|
|
118
|
+
name: "chord-node-base-static-graph",
|
|
119
|
+
setup(builder) {
|
|
120
|
+
builder.onResolve({ filter: /.*/ }, async (args) => {
|
|
121
|
+
if (args.pluginData === RESOLVING || args.kind === "entry-point" || isBuiltin(args.path))
|
|
122
|
+
return undefined;
|
|
123
|
+
const resolved = await builder.resolve(args.path, {
|
|
124
|
+
kind: args.kind,
|
|
125
|
+
importer: args.importer,
|
|
126
|
+
resolveDir: args.resolveDir,
|
|
127
|
+
pluginData: RESOLVING,
|
|
128
|
+
});
|
|
129
|
+
const outside = resolved.errors.length > 0 || resolved.external || resolved.path.split(sep).includes("node_modules");
|
|
130
|
+
return outside ? { path: args.path, external: true } : resolved;
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/** Marks the resolver's own call, so the plugin does not resolve it again. */
|
|
136
|
+
const RESOLVING = Symbol("chord.worker-base.resolving");
|
|
137
|
+
/**
|
|
138
|
+
* Keeps a package resolved under a `node_modules` directory external, by its absolute file (a URL for an `import`, a
|
|
139
|
+
* path for a `require`): the bundle lives elsewhere, so a bare specifier would not resolve from it. A workspace
|
|
140
|
+
* package resolves to its real path outside `node_modules` and is inlined. A specifier that does not resolve is left to
|
|
141
|
+
* esbuild (an error, or a warning for a `require` in a `try`).
|
|
142
|
+
*/
|
|
143
|
+
function installedPackages() {
|
|
144
|
+
return {
|
|
145
|
+
name: "chord-worker-installed-packages",
|
|
146
|
+
setup(builder) {
|
|
147
|
+
builder.onResolve({ filter: /^[^./]/ }, async (args) => {
|
|
148
|
+
if (args.pluginData === RESOLVING || isBuiltin(args.path))
|
|
149
|
+
return undefined;
|
|
150
|
+
const resolved = await builder.resolve(args.path, {
|
|
151
|
+
kind: args.kind,
|
|
152
|
+
importer: args.importer,
|
|
153
|
+
resolveDir: args.resolveDir,
|
|
154
|
+
pluginData: RESOLVING,
|
|
155
|
+
});
|
|
156
|
+
if (resolved.errors.length > 0)
|
|
157
|
+
return undefined;
|
|
158
|
+
if (!resolved.path.split(sep).includes("node_modules"))
|
|
159
|
+
return resolved;
|
|
160
|
+
const path = args.kind.startsWith("require") ? resolved.path : pathToFileURL(resolved.path).href;
|
|
161
|
+
return { path, external: true };
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** Whether a source names its own location. */
|
|
167
|
+
const LOCATIONS = /import\.meta|__dirname|__filename/;
|
|
168
|
+
/** The loaders of the source files `moduleLocations` reads: every extension its filter matches. */
|
|
169
|
+
const LOADERS = {
|
|
170
|
+
".js": "js",
|
|
171
|
+
".mjs": "js",
|
|
172
|
+
".cjs": "js",
|
|
173
|
+
".jsx": "jsx",
|
|
174
|
+
".ts": "ts",
|
|
175
|
+
".mts": "ts",
|
|
176
|
+
".cts": "ts",
|
|
177
|
+
".tsx": "tsx",
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Keeps `import.meta.url`, `.dirname` and `.filename`, `__dirname` and `__filename` naming each module's source file, not
|
|
181
|
+
* the bundle (base code finds files beside it this way: p2's plugins directory): a module using them gets its own
|
|
182
|
+
* constants, which `define` puts in their place. Declared on its first line, so the source map's lines stay. It reads
|
|
183
|
+
* (and records in `inputs`) every source file of its extensions, which it hands to esbuild changed or as read.
|
|
184
|
+
*/
|
|
185
|
+
function moduleLocations(inputs) {
|
|
186
|
+
return {
|
|
187
|
+
name: "chord-worker-module-locations",
|
|
188
|
+
setup(builder) {
|
|
189
|
+
builder.onLoad({ filter: /\.(?:[cm]?[jt]s|[jt]sx)$/ }, async (args) => {
|
|
190
|
+
if (args.namespace !== "file")
|
|
191
|
+
return undefined;
|
|
192
|
+
const bytes = await readRecorded(args.path, inputs);
|
|
193
|
+
// The filter matched one of `LOADERS`' extensions.
|
|
194
|
+
const loader = LOADERS[extname(args.path)];
|
|
195
|
+
const source = bytes.toString("utf8");
|
|
196
|
+
if (!LOCATIONS.test(source))
|
|
197
|
+
return { contents: bytes, loader };
|
|
198
|
+
const constants = [
|
|
199
|
+
[MODULE_URL, pathToFileURL(args.path).href],
|
|
200
|
+
[MODULE_DIRNAME, dirname(args.path)],
|
|
201
|
+
[MODULE_FILENAME, args.path],
|
|
202
|
+
].map(([name, value]) => `${name} = ${JSON.stringify(value)}`);
|
|
203
|
+
return { contents: `var ${constants.join(", ")};${source}`, loader };
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* The bundle as files: written at the first `file()` (a named directory is shared with later starts: a handle whose
|
|
210
|
+
* owner closed before forking must never touch it) into its named directory (emptied first: the files of an earlier
|
|
211
|
+
* build go) or a new private temporary one, again when one of them is gone; the directory removed with the handle.
|
|
212
|
+
*/
|
|
213
|
+
class BundleFiles {
|
|
214
|
+
inputs;
|
|
215
|
+
#files;
|
|
216
|
+
#named;
|
|
217
|
+
/** Where the files were written; `undefined` before the first `file()` and after `remove`. */
|
|
218
|
+
#dir;
|
|
219
|
+
constructor(files, inputs, named) {
|
|
220
|
+
this.#files = files;
|
|
221
|
+
this.inputs = inputs;
|
|
222
|
+
this.#named = named;
|
|
223
|
+
}
|
|
224
|
+
file() {
|
|
225
|
+
// A long-running server's temporary directory may be cleaned (systemd-tmpfiles, macOS), a chunk no worker
|
|
226
|
+
// imported for a while first: a fork needs all of them. A temporary directory is a new one, never the old name:
|
|
227
|
+
// another user may have made that one since (a named directory is the app's own, private).
|
|
228
|
+
const dir = this.#dir;
|
|
229
|
+
if (dir !== undefined && this.#files.every((file) => existsSync(join(dir, file.name)))) {
|
|
230
|
+
return join(dir, `${ENTRY_NAME}.mjs`);
|
|
231
|
+
}
|
|
232
|
+
this.remove();
|
|
233
|
+
return join(this.#write(), `${ENTRY_NAME}.mjs`);
|
|
234
|
+
}
|
|
235
|
+
remove() {
|
|
236
|
+
if (this.#dir !== undefined)
|
|
237
|
+
rmSync(this.#dir, { recursive: true, force: true });
|
|
238
|
+
this.#dir = undefined;
|
|
239
|
+
}
|
|
240
|
+
/** Writes the bundle's files into its private directory (mode 0700, each file 0600); the directory. */
|
|
241
|
+
#write() {
|
|
242
|
+
let dir = this.#named;
|
|
243
|
+
if (dir === undefined)
|
|
244
|
+
dir = mkdtempSync(join(tmpdir(), "chord-worker-"));
|
|
245
|
+
else {
|
|
246
|
+
rmSync(dir, { recursive: true, force: true });
|
|
247
|
+
mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
248
|
+
}
|
|
249
|
+
for (const file of this.#files)
|
|
250
|
+
writeFileSync(join(dir, file.name), file.contents, { mode: 0o600 });
|
|
251
|
+
this.#dir = dir;
|
|
252
|
+
return dir;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/node/workers/base.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,sHAAsH;AACtH,wHAAwH;AACxH,kJAAkJ;AAClJ,qHAAqH;AACrH,kHAAkH;AAClH,yHAAyH;AACzH,wHAAwH;AACxH,oHAAoH;AACpH,wHAAwH;AACxH,wHAAwH;AACxH,+EAA+E;AAC/E,yDAAyD;AAEzD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAA4B,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAmB,YAAY,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAerD;;;GAGG;AACH,MAA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,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,MAAM;YAAE,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACpG,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,OAAO,GAAG,CAAC;IACZ,CAAC;CACD","sourcesContent":["// The worker base (decision \"Workers start from the base code the server booted with\"): a worker kind's entry and the\n// base code it imports, bundled once by esbuild when the workers component builds it (the kit: right after the server\n// listens), as the surfaces build their base bundles. Every worker of the kind is forked from this snapshot, so an edit\n// of the app's source while the server runs reaches workers only through a restart of the server. Packages installed under `node_modules` (native\n// addons, packages reading their own files) and Node builtins stay external: Node loads them at each fork from where\n// the build resolved them. Everything else, the app's files and workspace packages linked into `node_modules`, is\n// inlined. The bundle is split at each dynamic `import()` esbuild can follow: the entry module and the chunks it imports\n// statically load at each fork, a lazily imported module (pi-ai's provider APIs and the packages they import) only when\n// the worker imports it. Every file is an ES module with an inline source map, written at the first fork (`file()`;\n// a handle never forked writes nothing) into one private directory its handle owns and removes: a new temporary one, or\n// one the caller names (the kit's per kind in the data directory: the same path at every start, so Node's compile cache\n// knows the files). Every file the build read is recorded with its bytes' hash\n// (`BaseInputs`), as its one read hands them to esbuild.\n\nimport { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from \"node:fs\";\nimport { isBuiltin } from \"node:module\";\nimport { tmpdir } from \"node:os\";\nimport { basename, dirname, extname, join, parse, resolve, sep } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { build, type Loader, type Plugin } from \"esbuild\";\nimport { type BaseInputs, readRecorded, recordedSources } from \"../plugins/base-inputs.ts\";\nimport { conditionsOf } from \"../surfaces/bundle.ts\";\n\n/** A worker kind's bundled base: the file workers are forked from, and the files it was built from. */\nexport interface WorkerBase {\n\t/** The files esbuild read for it with their bytes' hashes: the app's base code, a file differing outdates it. */\n\treadonly inputs: BaseInputs;\n\t/**\n\t * The entry module's path, its chunks beside it: written at the first call, and again when a temporary-file cleaner\n\t * removed one of them (into a new temporary directory, or its named one).\n\t */\n\tfile(): string;\n\t/** Removes the bundle's directory, when `file()` wrote it. */\n\tremove(): void;\n}\n\n/**\n * What `import.meta.url`, `.dirname` and `.filename` (and a CommonJS file's free `__dirname` and `__filename`) become: a\n * module's own constants (`moduleLocations`).\n */\nconst MODULE_URL = \"__chordModuleUrl\";\nconst MODULE_DIRNAME = \"__chordModuleDirname\";\nconst MODULE_FILENAME = \"__chordModuleFilename\";\n\n/** The entry module's name in the bundle's directory (`worker.mjs`); chunks are named `<name>-<hash>.mjs`. */\nconst ENTRY_NAME = \"worker\";\n\n/**\n * Bundles `entry` for workers forked with `execArgv` (its `--conditions` resolve imports as the child's Node would),\n * in memory; its files are written at the handle's first `file()`, into `dir` (a private directory the handle owns:\n * emptied first, removed by `remove`) or, without one, a new temporary directory. Rejects with esbuild's failure.\n */\nexport async function buildWorkerBase(entry: string, execArgv: readonly string[], dir?: string): Promise<WorkerBase> {\n\t// Built as if at the file system's root: the source map's paths relative to it, made absolute by `sourceRoot`.\n\tconst root = parse(resolve(entry)).root;\n\tconst inputs = new Map<string, string>();\n\tconst result = await build({\n\t\tentryPoints: [{ in: entry, out: ENTRY_NAME }],\n\t\t// One flat directory: every chunk imports the others as `./<name>`, and the source maps' paths stay relative to\n\t\t// the root.\n\t\toutdir: root,\n\t\tentryNames: \"[name]\",\n\t\tchunkNames: \"[name]-[hash]\",\n\t\toutExtension: { \".js\": \".mjs\" },\n\t\t// A dynamic `import()` esbuild can follow becomes a chunk Node loads only when the worker imports it, with the\n\t\t// packages it imports: inlined into one module, every lazily imported module would load and run at each fork.\n\t\tsplitting: true,\n\t\twrite: false,\n\t\tbundle: true,\n\t\tformat: \"esm\",\n\t\tplatform: \"node\",\n\t\t// Node's own resolution: the child's conditions, `main` only (no `module` condition or field).\n\t\tconditions: conditionsOf(execArgv),\n\t\tmainFields: [\"main\"],\n\t\t// Every imported module runs, as Node runs it: `sideEffects: false` and pure annotations drop none (the entry's\n\t\t// own package may say it, as Chord's does).\n\t\tignoreAnnotations: true,\n\t\t// Function and class names as the source has them (`name` stays what unbundled code sees).\n\t\tkeepNames: true,\n\t\tsourcemap: \"inline\",\n\t\tsourcesContent: false,\n\t\tsourceRoot: pathToFileURL(root).href,\n\t\t// A CommonJS file of the base code requires through this (each chunk has its own); external packages by their\n\t\t// absolute paths.\n\t\tbanner: {\n\t\t\tjs: 'import { createRequire as __chordCreateRequire } from \"node:module\"; const require = __chordCreateRequire(import.meta.url);',\n\t\t},\n\t\tdefine: {\n\t\t\t\"import.meta.url\": MODULE_URL,\n\t\t\t\"import.meta.dirname\": MODULE_DIRNAME,\n\t\t\t\"import.meta.filename\": MODULE_FILENAME,\n\t\t\t__dirname: MODULE_DIRNAME,\n\t\t\t__filename: MODULE_FILENAME,\n\t\t},\n\t\tplugins: [installedPackages(), moduleLocations(inputs), recordedSources(inputs)],\n\t\tlogLevel: \"silent\",\n\t});\n\tconst files = result.outputFiles.map((output) => ({ name: basename(output.path), contents: output.contents }));\n\treturn new BundleFiles(files, inputs, dir);\n}\n\n/**\n * The files of the static import graph of Node code started from `entry` with `conditions`, with their bytes' hashes: a\n * best-effort scan (esbuild bundles it only to record what it reads; nothing is written or run). It sees the literal\n * imports of the graph, including lazy literal `import()`s Node may never run (conservative: such a file's edit asks\n * for a restart); a computed `import(x)` and modules a loader provides are not seen, and an import that does not\n * resolve (an inactive optional import of a missing file or package, a loader's scheme) is left out. It resolves as\n * Node does: the conditions, `main`, no `tsconfig.json` `paths`; installed packages are left out (never compared).\n * Rejects with esbuild's failure for anything else (a file it cannot parse).\n */\nexport async function nodeBaseInputs(entry: string, conditions: readonly string[]): Promise<BaseInputs> {\n\tconst inputs = new Map<string, string>();\n\tawait build({\n\t\tentryPoints: [entry],\n\t\twrite: false,\n\t\tbundle: true,\n\t\tformat: \"esm\",\n\t\tplatform: \"node\",\n\t\tconditions: [...conditions],\n\t\tmainFields: [\"main\"],\n\t\t// Node reads no tsconfig.json: its `paths` would resolve an import elsewhere than Node does.\n\t\ttsconfigRaw: \"{}\",\n\t\t// Every file the bundle reaches is read, as Node would load it; the output is dropped.\n\t\tignoreAnnotations: true,\n\t\tplugins: [staticGraph(), recordedSources(inputs)],\n\t\tlogLevel: \"silent\",\n\t});\n\treturn inputs;\n}\n\n/**\n * The scan's resolution (`nodeBaseInputs`): an import resolving under a `node_modules` directory and one that does not\n * resolve at all are left out (external); the rest resolves as esbuild does.\n */\nfunction staticGraph(): Plugin {\n\treturn {\n\t\tname: \"chord-node-base-static-graph\",\n\t\tsetup(builder) {\n\t\t\tbuilder.onResolve({ filter: /.*/ }, async (args) => {\n\t\t\t\tif (args.pluginData === RESOLVING || args.kind === \"entry-point\" || isBuiltin(args.path)) return undefined;\n\t\t\t\tconst resolved = await builder.resolve(args.path, {\n\t\t\t\t\tkind: args.kind,\n\t\t\t\t\timporter: args.importer,\n\t\t\t\t\tresolveDir: args.resolveDir,\n\t\t\t\t\tpluginData: RESOLVING,\n\t\t\t\t});\n\t\t\t\tconst outside =\n\t\t\t\t\tresolved.errors.length > 0 || resolved.external || resolved.path.split(sep).includes(\"node_modules\");\n\t\t\t\treturn outside ? { path: args.path, external: true } : resolved;\n\t\t\t});\n\t\t},\n\t};\n}\n\n/** Marks the resolver's own call, so the plugin does not resolve it again. */\nconst RESOLVING = Symbol(\"chord.worker-base.resolving\");\n\n/**\n * Keeps a package resolved under a `node_modules` directory external, by its absolute file (a URL for an `import`, a\n * path for a `require`): the bundle lives elsewhere, so a bare specifier would not resolve from it. A workspace\n * package resolves to its real path outside `node_modules` and is inlined. A specifier that does not resolve is left to\n * esbuild (an error, or a warning for a `require` in a `try`).\n */\nfunction installedPackages(): Plugin {\n\treturn {\n\t\tname: \"chord-worker-installed-packages\",\n\t\tsetup(builder) {\n\t\t\tbuilder.onResolve({ filter: /^[^./]/ }, async (args) => {\n\t\t\t\tif (args.pluginData === RESOLVING || isBuiltin(args.path)) return undefined;\n\t\t\t\tconst resolved = await builder.resolve(args.path, {\n\t\t\t\t\tkind: args.kind,\n\t\t\t\t\timporter: args.importer,\n\t\t\t\t\tresolveDir: args.resolveDir,\n\t\t\t\t\tpluginData: RESOLVING,\n\t\t\t\t});\n\t\t\t\tif (resolved.errors.length > 0) return undefined;\n\t\t\t\tif (!resolved.path.split(sep).includes(\"node_modules\")) return resolved;\n\t\t\t\tconst path = args.kind.startsWith(\"require\") ? resolved.path : pathToFileURL(resolved.path).href;\n\t\t\t\treturn { path, external: true };\n\t\t\t});\n\t\t},\n\t};\n}\n\n/** Whether a source names its own location. */\nconst LOCATIONS = /import\\.meta|__dirname|__filename/;\n\n/** The loaders of the source files `moduleLocations` reads: every extension its filter matches. */\nconst LOADERS: Readonly<Record<string, Loader>> = {\n\t\".js\": \"js\",\n\t\".mjs\": \"js\",\n\t\".cjs\": \"js\",\n\t\".jsx\": \"jsx\",\n\t\".ts\": \"ts\",\n\t\".mts\": \"ts\",\n\t\".cts\": \"ts\",\n\t\".tsx\": \"tsx\",\n};\n\n/**\n * Keeps `import.meta.url`, `.dirname` and `.filename`, `__dirname` and `__filename` naming each module's source file, not\n * the bundle (base code finds files beside it this way: p2's plugins directory): a module using them gets its own\n * constants, which `define` puts in their place. Declared on its first line, so the source map's lines stay. It reads\n * (and records in `inputs`) every source file of its extensions, which it hands to esbuild changed or as read.\n */\nfunction moduleLocations(inputs: Map<string, string>): Plugin {\n\treturn {\n\t\tname: \"chord-worker-module-locations\",\n\t\tsetup(builder) {\n\t\t\tbuilder.onLoad({ filter: /\\.(?:[cm]?[jt]s|[jt]sx)$/ }, async (args) => {\n\t\t\t\tif (args.namespace !== \"file\") return undefined;\n\t\t\t\tconst bytes = await readRecorded(args.path, inputs);\n\t\t\t\t// The filter matched one of `LOADERS`' extensions.\n\t\t\t\tconst loader = LOADERS[extname(args.path)]!;\n\t\t\t\tconst source = bytes.toString(\"utf8\");\n\t\t\t\tif (!LOCATIONS.test(source)) return { contents: bytes, loader };\n\t\t\t\tconst constants = [\n\t\t\t\t\t[MODULE_URL, pathToFileURL(args.path).href],\n\t\t\t\t\t[MODULE_DIRNAME, dirname(args.path)],\n\t\t\t\t\t[MODULE_FILENAME, args.path],\n\t\t\t\t].map(([name, value]) => `${name} = ${JSON.stringify(value)}`);\n\t\t\t\treturn { contents: `var ${constants.join(\", \")};${source}`, loader };\n\t\t\t});\n\t\t},\n\t};\n}\n\n/** One output file of the bundle: its name in the bundle's directory and its contents. */\ninterface BundleFile {\n\treadonly name: string;\n\treadonly contents: Uint8Array;\n}\n\n/**\n * The bundle as files: written at the first `file()` (a named directory is shared with later starts: a handle whose\n * owner closed before forking must never touch it) into its named directory (emptied first: the files of an earlier\n * build go) or a new private temporary one, again when one of them is gone; the directory removed with the handle.\n */\nclass BundleFiles implements WorkerBase {\n\treadonly inputs: BaseInputs;\n\treadonly #files: readonly BundleFile[];\n\treadonly #named: string | undefined;\n\t/** Where the files were written; `undefined` before the first `file()` and after `remove`. */\n\t#dir: string | undefined;\n\n\tconstructor(files: readonly BundleFile[], inputs: BaseInputs, named: string | undefined) {\n\t\tthis.#files = files;\n\t\tthis.inputs = inputs;\n\t\tthis.#named = named;\n\t}\n\n\tfile(): string {\n\t\t// A long-running server's temporary directory may be cleaned (systemd-tmpfiles, macOS), a chunk no worker\n\t\t// imported for a while first: a fork needs all of them. A temporary directory is a new one, never the old name:\n\t\t// another user may have made that one since (a named directory is the app's own, private).\n\t\tconst dir = this.#dir;\n\t\tif (dir !== undefined && this.#files.every((file) => existsSync(join(dir, file.name)))) {\n\t\t\treturn join(dir, `${ENTRY_NAME}.mjs`);\n\t\t}\n\t\tthis.remove();\n\t\treturn join(this.#write(), `${ENTRY_NAME}.mjs`);\n\t}\n\n\tremove(): void {\n\t\tif (this.#dir !== undefined) rmSync(this.#dir, { recursive: true, force: true });\n\t\tthis.#dir = undefined;\n\t}\n\n\t/** Writes the bundle's files into its private directory (mode 0700, each file 0600); the directory. */\n\t#write(): string {\n\t\tlet dir = this.#named;\n\t\tif (dir === undefined) dir = mkdtempSync(join(tmpdir(), \"chord-worker-\"));\n\t\telse {\n\t\t\trmSync(dir, { recursive: true, force: true });\n\t\t\tmkdirSync(dir, { recursive: true, mode: 0o700 });\n\t\t}\n\t\tfor (const file of this.#files) writeFileSync(join(dir, file.name), file.contents, { mode: 0o600 });\n\t\tthis.#dir = dir;\n\t\treturn dir;\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child.d.ts","sourceRoot":"","sources":["../../../src/node/workers/child.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,KAAK,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,UAAU,GACV,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// The worker process's side of the workers component (`@earendil-works/chord/workers/child`): `workerMain` and
|
|
2
|
+
// `processLock` without the server's side, whose worker base bundles with esbuild. A worker entry imports this, so a
|
|
3
|
+
// forked worker never loads esbuild.
|
|
4
|
+
export { processLock } from "./lock.js";
|
|
5
|
+
export { workerMain, } from "./main.js";
|
|
6
|
+
//# sourceMappingURL=child.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"child.js","sourceRoot":"","sources":["../../../src/node/workers/child.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,qHAAqH;AACrH,qCAAqC;AAGrC,OAAO,EAAoB,WAAW,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAKN,UAAU,GACV,MAAM,WAAW,CAAC","sourcesContent":["// The worker process's side of the workers component (`@earendil-works/chord/workers/child`): `workerMain` and\n// `processLock` without the server's side, whose worker base bundles with esbuild. A worker entry imports this, so a\n// forked worker never loads esbuild.\n\nexport type { CrossedError } from \"./control.ts\";\nexport { type ProcessLock, processLock } from \"./lock.ts\";\nexport {\n\ttype WorkerMainOptions,\n\ttype WorkerPlugins,\n\ttype WorkerResult,\n\ttype WorkerStart,\n\tworkerMain,\n} from \"./main.ts\";\n"]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Address } from "../../contracts/index.ts";
|
|
2
|
+
import { type FailureCause } from "../../data/index.ts";
|
|
3
|
+
import type { ReloadReport } from "../../host/index.ts";
|
|
4
|
+
import type { JsonValue } from "../../json.ts";
|
|
5
|
+
import type { PluginScript } from "../plugins/runtime.ts";
|
|
6
|
+
/** An error as it crosses: its message, and a ChordError's code and reason. */
|
|
7
|
+
export type CrossedError = {
|
|
8
|
+
readonly message: string;
|
|
9
|
+
readonly code?: string;
|
|
10
|
+
readonly reason?: string;
|
|
11
|
+
};
|
|
12
|
+
/** A reload report as it crosses: its errors crossed. */
|
|
13
|
+
export type CrossedReport = {
|
|
14
|
+
readonly plugins: ReloadReport["plugins"];
|
|
15
|
+
readonly failed: readonly {
|
|
16
|
+
readonly plugin: string;
|
|
17
|
+
readonly error: CrossedError;
|
|
18
|
+
}[];
|
|
19
|
+
readonly objects: readonly {
|
|
20
|
+
readonly object: string;
|
|
21
|
+
readonly kind: string;
|
|
22
|
+
readonly cause?: CrossedCause;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
/** A failure cause as it crosses. */
|
|
26
|
+
type CrossedCause = {
|
|
27
|
+
readonly kind: FailureCause["kind"];
|
|
28
|
+
readonly error: CrossedError;
|
|
29
|
+
};
|
|
30
|
+
/** What the server sends a worker. */
|
|
31
|
+
export type ToWorker = {
|
|
32
|
+
readonly kind: "start";
|
|
33
|
+
readonly address: Address;
|
|
34
|
+
readonly start: JsonValue;
|
|
35
|
+
readonly scripts: readonly PluginScript[];
|
|
36
|
+
readonly lock: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly kind: "shutdown";
|
|
39
|
+
} | {
|
|
40
|
+
readonly kind: "reload";
|
|
41
|
+
readonly scripts: readonly PluginScript[];
|
|
42
|
+
};
|
|
43
|
+
/** What a worker sends the server. */
|
|
44
|
+
export type FromWorker = {
|
|
45
|
+
readonly kind: "started";
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: "ready";
|
|
48
|
+
readonly idle: boolean;
|
|
49
|
+
readonly report: CrossedReport;
|
|
50
|
+
} | {
|
|
51
|
+
readonly kind: "idle";
|
|
52
|
+
readonly idle: boolean;
|
|
53
|
+
} | {
|
|
54
|
+
readonly kind: "fatal";
|
|
55
|
+
readonly error: CrossedError;
|
|
56
|
+
} | {
|
|
57
|
+
readonly kind: "reloaded";
|
|
58
|
+
readonly report: CrossedReport;
|
|
59
|
+
} | {
|
|
60
|
+
readonly kind: "reloaded";
|
|
61
|
+
readonly error: CrossedError;
|
|
62
|
+
};
|
|
63
|
+
/** `message` in its envelope, as it goes over the IPC channel. */
|
|
64
|
+
export declare function envelope(message: ToWorker | FromWorker): {
|
|
65
|
+
readonly [ENVELOPE]: ToWorker | FromWorker;
|
|
66
|
+
};
|
|
67
|
+
/** The envelope's key: a control message is `{ "chord.workers": message }`. */
|
|
68
|
+
declare const ENVELOPE = "chord.workers";
|
|
69
|
+
/**
|
|
70
|
+
* The control message in an IPC message, or `undefined` for anything else (a link frame, the app's own). A trust
|
|
71
|
+
* boundary in name only: both ends are the app's processes, so only the envelope is checked.
|
|
72
|
+
*/
|
|
73
|
+
export declare function controlOf<M extends ToWorker | FromWorker>(message: unknown): M | undefined;
|
|
74
|
+
/** `error` as it crosses. */
|
|
75
|
+
export declare function crossed(error: unknown): CrossedError;
|
|
76
|
+
/** A crossed error as an error again: a ChordError when its code is one, an `Error` otherwise. */
|
|
77
|
+
export declare function uncrossed(error: CrossedError): Error;
|
|
78
|
+
/** `report` as it crosses. */
|
|
79
|
+
export declare function crossedReport(report: ReloadReport): CrossedReport;
|
|
80
|
+
/** A crossed report as a report again. */
|
|
81
|
+
export declare function uncrossedReport(report: CrossedReport): ReloadReport;
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../../src/node/workers/control.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAc,KAAK,YAAY,EAAgB,MAAM,qBAAqB,CAAC;AAElF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1G,yDAAyD;AACzD,MAAM,MAAM,aAAa,GAAG;IAC3B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,SAAS;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;KAAE,EAAE,CAAC;IACtF,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAA;KAAE,EAAE,CAAC;CAC/G,CAAC;AAEF,qCAAqC;AACrC,KAAK,YAAY,GAAG;IAAE,QAAQ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QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,UAAU,GAAG;IAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;CAAE,CAEvG;AAED,+EAA+E;AAC/E,QAAA,MAAM,QAAQ,kBAAkB,CAAC;AAEjC;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,QAAQ,GAAG,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,CAAC,GAAG,SAAS,CAI1F;AAED,6BAA6B;AAC7B,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CASpD;AAED,kGAAkG;AAClG,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,CAWpD;AAED,8BAA8B;AAC9B,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAcjE;AAED,0CAA0C;AAC1C,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAanE"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// The control channel between the server and a worker (slice 10 §3): JSON messages beside the link's `Uint8Array`
|
|
2
|
+
// frames on one IPC channel (the IPC link skips them), and errors as they cross it (`{ message, code?, reason? }`,
|
|
3
|
+
// never a stack or a cause).
|
|
4
|
+
import { ChordError, isChordError } from "../../data/index.js";
|
|
5
|
+
import { chordErrorFromJson } from "../../data/internal.js";
|
|
6
|
+
/** `message` in its envelope, as it goes over the IPC channel. */
|
|
7
|
+
export function envelope(message) {
|
|
8
|
+
return { [ENVELOPE]: message };
|
|
9
|
+
}
|
|
10
|
+
/** The envelope's key: a control message is `{ "chord.workers": message }`. */
|
|
11
|
+
const ENVELOPE = "chord.workers";
|
|
12
|
+
/**
|
|
13
|
+
* The control message in an IPC message, or `undefined` for anything else (a link frame, the app's own). A trust
|
|
14
|
+
* boundary in name only: both ends are the app's processes, so only the envelope is checked.
|
|
15
|
+
*/
|
|
16
|
+
export function controlOf(message) {
|
|
17
|
+
if (typeof message !== "object" || message === null || !(ENVELOPE in message))
|
|
18
|
+
return undefined;
|
|
19
|
+
// Sent by the other end of this channel through `envelope`.
|
|
20
|
+
return message[ENVELOPE];
|
|
21
|
+
}
|
|
22
|
+
/** `error` as it crosses. */
|
|
23
|
+
export function crossed(error) {
|
|
24
|
+
if (isChordError(error)) {
|
|
25
|
+
return {
|
|
26
|
+
message: error.message,
|
|
27
|
+
code: error.code,
|
|
28
|
+
...(error.reason === undefined ? {} : { reason: error.reason }),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return { message: error instanceof Error ? error.message : String(error) };
|
|
32
|
+
}
|
|
33
|
+
/** A crossed error as an error again: a ChordError when its code is one, an `Error` otherwise. */
|
|
34
|
+
export function uncrossed(error) {
|
|
35
|
+
if (error.code === undefined)
|
|
36
|
+
return new Error(error.message);
|
|
37
|
+
try {
|
|
38
|
+
return chordErrorFromJson({
|
|
39
|
+
code: error.code,
|
|
40
|
+
message: error.message,
|
|
41
|
+
...(error.reason === undefined ? {} : { reason: error.reason }),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return new Error(error.message);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** `report` as it crosses. */
|
|
49
|
+
export function crossedReport(report) {
|
|
50
|
+
return {
|
|
51
|
+
plugins: report.plugins,
|
|
52
|
+
failed: report.failed.map(({ plugin, error }) => ({ plugin, error: crossed(error) })),
|
|
53
|
+
objects: report.objects.map((each) => each.kind === "parked"
|
|
54
|
+
? {
|
|
55
|
+
object: each.object,
|
|
56
|
+
kind: each.kind,
|
|
57
|
+
cause: { kind: each.cause.kind, error: crossed(each.cause.error) },
|
|
58
|
+
}
|
|
59
|
+
: each),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** A crossed report as a report again. */
|
|
63
|
+
export function uncrossedReport(report) {
|
|
64
|
+
return {
|
|
65
|
+
plugins: report.plugins,
|
|
66
|
+
failed: report.failed.map(({ plugin, error }) => ({ plugin, error: uncrossed(error) })),
|
|
67
|
+
objects: report.objects.map(({ object, kind, cause }) => {
|
|
68
|
+
if (cause === undefined)
|
|
69
|
+
return { object, kind: kind };
|
|
70
|
+
const error = uncrossed(cause.error);
|
|
71
|
+
// A parked object's cause is a ChordError on the worker; one that crossed without a code is wrapped as one.
|
|
72
|
+
const chord = isChordError(error) ? error : new ChordError({ code: "unavailable", message: error.message });
|
|
73
|
+
return { object, kind: "parked", cause: { kind: cause.kind, error: chord } };
|
|
74
|
+
}),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../../src/node/workers/control.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,mHAAmH;AACnH,6BAA6B;AAG7B,OAAO,EAAE,UAAU,EAAqB,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAuC5D,kEAAkE;AAClE,MAAM,UAAU,QAAQ,CAAC,OAA8B;IACtD,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;AAChC,CAAC;AAED,+EAA+E;AAC/E,MAAM,QAAQ,GAAG,eAAe,CAAC;AAEjC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAkC,OAAgB;IAC1E,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,QAAQ,IAAI,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAChG,4DAA4D;IAC5D,OAAQ,OAAsC,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAED,6BAA6B;AAC7B,MAAM,UAAU,OAAO,CAAC,KAAc;IACrC,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO;YACN,OAAO,EAAE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AE,KAAK,EAAE,KAAK,EAAkB,EAAE,CAAC;QAC9F,CAAC,CAAC;KACF,CAAC;AACH,CAAC","sourcesContent":["// The control channel between the server and a worker (slice 10 §3): JSON messages beside the link's `Uint8Array`\n// frames on one IPC channel (the IPC link skips them), and errors as they cross it (`{ message, code?, reason? }`,\n// never a stack or a cause).\n\nimport type { Address } from \"../../contracts/index.ts\";\nimport { ChordError, type FailureCause, isChordError } from \"../../data/index.ts\";\nimport { chordErrorFromJson } from \"../../data/internal.ts\";\nimport type { ReloadReport } from \"../../host/index.ts\";\nimport type { JsonValue } from \"../../json.ts\";\nimport type { PluginScript } from \"../plugins/runtime.ts\";\n\n/** An error as it crosses: its message, and a ChordError's code and reason. */\nexport type CrossedError = { readonly message: string; readonly code?: string; readonly reason?: string };\n\n/** A reload report as it crosses: its errors crossed. */\nexport type CrossedReport = {\n\treadonly plugins: ReloadReport[\"plugins\"];\n\treadonly failed: readonly { readonly plugin: string; readonly error: CrossedError }[];\n\treadonly objects: readonly { readonly object: string; readonly kind: string; readonly cause?: CrossedCause }[];\n};\n\n/** A failure cause as it crosses. */\ntype CrossedCause = { readonly kind: FailureCause[\"kind\"]; readonly error: CrossedError };\n\n/** What the server sends a worker. */\nexport type ToWorker =\n\t| {\n\t\t\treadonly kind: \"start\";\n\t\t\treadonly address: Address;\n\t\t\treadonly start: JsonValue;\n\t\t\treadonly scripts: readonly PluginScript[];\n\t\t\treadonly lock: string;\n\t }\n\t| { readonly kind: \"shutdown\" }\n\t| { readonly kind: \"reload\"; readonly scripts: readonly PluginScript[] };\n\n/** What a worker sends the server. */\nexport type FromWorker =\n\t| { readonly kind: \"started\" }\n\t| { readonly kind: \"ready\"; readonly idle: boolean; readonly report: CrossedReport }\n\t| { readonly kind: \"idle\"; readonly idle: boolean }\n\t| { readonly kind: \"fatal\"; readonly error: CrossedError }\n\t| { readonly kind: \"reloaded\"; readonly report: CrossedReport }\n\t| { readonly kind: \"reloaded\"; readonly error: CrossedError };\n\n/** `message` in its envelope, as it goes over the IPC channel. */\nexport function envelope(message: ToWorker | FromWorker): { readonly [ENVELOPE]: ToWorker | FromWorker } {\n\treturn { [ENVELOPE]: message };\n}\n\n/** The envelope's key: a control message is `{ \"chord.workers\": message }`. */\nconst ENVELOPE = \"chord.workers\";\n\n/**\n * The control message in an IPC message, or `undefined` for anything else (a link frame, the app's own). A trust\n * boundary in name only: both ends are the app's processes, so only the envelope is checked.\n */\nexport function controlOf<M extends ToWorker | FromWorker>(message: unknown): M | undefined {\n\tif (typeof message !== \"object\" || message === null || !(ENVELOPE in message)) return undefined;\n\t// Sent by the other end of this channel through `envelope`.\n\treturn (message as { readonly [ENVELOPE]: M })[ENVELOPE];\n}\n\n/** `error` as it crosses. */\nexport function crossed(error: unknown): CrossedError {\n\tif (isChordError(error)) {\n\t\treturn {\n\t\t\tmessage: error.message,\n\t\t\tcode: error.code,\n\t\t\t...(error.reason === undefined ? {} : { reason: error.reason }),\n\t\t};\n\t}\n\treturn { message: error instanceof Error ? error.message : String(error) };\n}\n\n/** A crossed error as an error again: a ChordError when its code is one, an `Error` otherwise. */\nexport function uncrossed(error: CrossedError): Error {\n\tif (error.code === undefined) return new Error(error.message);\n\ttry {\n\t\treturn chordErrorFromJson({\n\t\t\tcode: error.code,\n\t\t\tmessage: error.message,\n\t\t\t...(error.reason === undefined ? {} : { reason: error.reason }),\n\t\t});\n\t} catch {\n\t\treturn new Error(error.message);\n\t}\n}\n\n/** `report` as it crosses. */\nexport function crossedReport(report: ReloadReport): CrossedReport {\n\treturn {\n\t\tplugins: report.plugins,\n\t\tfailed: report.failed.map(({ plugin, error }) => ({ plugin, error: crossed(error) })),\n\t\tobjects: report.objects.map((each) =>\n\t\t\teach.kind === \"parked\"\n\t\t\t\t? {\n\t\t\t\t\t\tobject: each.object,\n\t\t\t\t\t\tkind: each.kind,\n\t\t\t\t\t\tcause: { kind: each.cause.kind, error: crossed(each.cause.error) },\n\t\t\t\t\t}\n\t\t\t\t: each,\n\t\t),\n\t};\n}\n\n/** A crossed report as a report again. */\nexport function uncrossedReport(report: CrossedReport): ReloadReport {\n\treturn {\n\t\tplugins: report.plugins,\n\t\tfailed: report.failed.map(({ plugin, error }) => ({ plugin, error: uncrossed(error) })),\n\t\tobjects: report.objects.map(({ object, kind, cause }) => {\n\t\t\tif (cause === undefined)\n\t\t\t\treturn { object, kind: kind as Exclude<ReloadReport[\"objects\"][number][\"kind\"], \"parked\"> };\n\t\t\tconst error = uncrossed(cause.error);\n\t\t\t// A parked object's cause is a ChordError on the worker; one that crossed without a code is wrapped as one.\n\t\t\tconst chord = isChordError(error) ? error : new ChordError({ code: \"unavailable\", message: error.message });\n\t\t\treturn { object, kind: \"parked\", cause: { kind: cause.kind, error: chord } as FailureCause };\n\t\t}),\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/workers/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,cAAc,YAAY,CAAC;AAC3B,OAAO,EACN,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,cAAc,GACnB,MAAM,cAAc,CAAC"}
|