@diffra-ai/chord 0.0.0-stage → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +237 -0
- package/README.md +227 -2
- package/dist/context/index.d.ts +43 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/context/index.js +112 -0
- package/dist/context/index.js.map +1 -0
- package/dist/contracts/accepts.d.ts +91 -0
- package/dist/contracts/accepts.d.ts.map +1 -0
- package/dist/contracts/accepts.js +145 -0
- package/dist/contracts/accepts.js.map +1 -0
- package/dist/contracts/contract.d.ts +238 -0
- package/dist/contracts/contract.d.ts.map +1 -0
- package/dist/contracts/contract.js +69 -0
- package/dist/contracts/contract.js.map +1 -0
- package/dist/contracts/declare.d.ts +144 -0
- package/dist/contracts/declare.d.ts.map +1 -0
- package/dist/contracts/declare.js +207 -0
- package/dist/contracts/declare.js.map +1 -0
- package/dist/contracts/evolve.d.ts +142 -0
- package/dist/contracts/evolve.d.ts.map +1 -0
- package/dist/contracts/evolve.js +216 -0
- package/dist/contracts/evolve.js.map +1 -0
- package/dist/contracts/fingerprint.d.ts +16 -0
- package/dist/contracts/fingerprint.d.ts.map +1 -0
- package/dist/contracts/fingerprint.js +61 -0
- package/dist/contracts/fingerprint.js.map +1 -0
- package/dist/contracts/history.d.ts +79 -0
- package/dist/contracts/history.d.ts.map +1 -0
- package/dist/contracts/history.js +3 -0
- package/dist/contracts/history.js.map +1 -0
- package/dist/contracts/host-kind.d.ts +58 -0
- package/dist/contracts/host-kind.d.ts.map +1 -0
- package/dist/contracts/host-kind.js +122 -0
- package/dist/contracts/host-kind.js.map +1 -0
- package/dist/contracts/index.d.ts +8 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +7 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/internal.d.ts +12 -0
- package/dist/contracts/internal.d.ts.map +1 -0
- package/dist/contracts/internal.js +11 -0
- package/dist/contracts/internal.js.map +1 -0
- package/dist/contracts/names.d.ts +3 -0
- package/dist/contracts/names.d.ts.map +1 -0
- package/dist/contracts/names.js +13 -0
- package/dist/contracts/names.js.map +1 -0
- package/dist/contracts/params.d.ts +28 -0
- package/dist/contracts/params.d.ts.map +1 -0
- package/dist/contracts/params.js +55 -0
- package/dist/contracts/params.js.map +1 -0
- package/dist/contracts/schema.d.ts +144 -0
- package/dist/contracts/schema.d.ts.map +1 -0
- package/dist/contracts/schema.js +144 -0
- package/dist/contracts/schema.js.map +1 -0
- package/dist/contracts/snapshot.d.ts +16 -0
- package/dist/contracts/snapshot.d.ts.map +1 -0
- package/dist/contracts/snapshot.js +167 -0
- package/dist/contracts/snapshot.js.map +1 -0
- package/dist/data/args.d.ts +50 -0
- package/dist/data/args.d.ts.map +1 -0
- package/dist/data/args.js +83 -0
- package/dist/data/args.js.map +1 -0
- package/dist/data/errors.d.ts +80 -0
- package/dist/data/errors.d.ts.map +1 -0
- package/dist/data/errors.js +116 -0
- package/dist/data/errors.js.map +1 -0
- package/dist/data/failure.d.ts +31 -0
- package/dist/data/failure.d.ts.map +1 -0
- package/dist/data/failure.js +78 -0
- package/dist/data/failure.js.map +1 -0
- package/dist/data/index.d.ts +4 -0
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +5 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/internal.d.ts +7 -0
- package/dist/data/internal.d.ts.map +1 -0
- package/dist/data/internal.js +8 -0
- package/dist/data/internal.js.map +1 -0
- package/dist/data/params.d.ts +20 -0
- package/dist/data/params.d.ts.map +1 -0
- package/dist/data/params.js +31 -0
- package/dist/data/params.js.map +1 -0
- package/dist/data/principal.d.ts +28 -0
- package/dist/data/principal.d.ts.map +1 -0
- package/dist/data/principal.js +64 -0
- package/dist/data/principal.js.map +1 -0
- package/dist/data/validator.d.ts +12 -0
- package/dist/data/validator.d.ts.map +1 -0
- package/dist/data/validator.js +35 -0
- package/dist/data/validator.js.map +1 -0
- package/dist/delta/apply-immutable-trusted.d.ts +4 -0
- package/dist/delta/apply-immutable-trusted.d.ts.map +1 -0
- package/dist/delta/apply-immutable-trusted.js +126 -0
- package/dist/delta/apply-immutable-trusted.js.map +1 -0
- package/dist/delta/diff.d.ts +5 -0
- package/dist/delta/diff.d.ts.map +1 -0
- package/dist/delta/diff.js +435 -0
- package/dist/delta/diff.js.map +1 -0
- package/dist/delta/draft.d.ts +5 -0
- package/dist/delta/draft.d.ts.map +1 -0
- package/dist/delta/draft.js +2 -0
- package/dist/delta/draft.js.map +1 -0
- package/dist/delta/index.d.ts +120 -0
- package/dist/delta/index.d.ts.map +1 -0
- package/dist/delta/index.js +697 -0
- package/dist/delta/index.js.map +1 -0
- package/dist/delta/pending.d.ts +36 -0
- package/dist/delta/pending.d.ts.map +1 -0
- package/dist/delta/pending.js +143 -0
- package/dist/delta/pending.js.map +1 -0
- package/dist/delta/revision-validator.d.ts +7 -0
- package/dist/delta/revision-validator.d.ts.map +1 -0
- package/dist/delta/revision-validator.js +71 -0
- package/dist/delta/revision-validator.js.map +1 -0
- package/dist/delta/tracker.d.ts +38 -0
- package/dist/delta/tracker.d.ts.map +1 -0
- package/dist/delta/tracker.js +2175 -0
- package/dist/delta/tracker.js.map +1 -0
- package/dist/documents/address-source.d.ts +20 -0
- package/dist/documents/address-source.d.ts.map +1 -0
- package/dist/documents/address-source.js +44 -0
- package/dist/documents/address-source.js.map +1 -0
- package/dist/documents/definition.d.ts +92 -0
- package/dist/documents/definition.d.ts.map +1 -0
- package/dist/documents/definition.js +81 -0
- package/dist/documents/definition.js.map +1 -0
- package/dist/documents/documents.d.ts +129 -0
- package/dist/documents/documents.d.ts.map +1 -0
- package/dist/documents/documents.js +258 -0
- package/dist/documents/documents.js.map +1 -0
- package/dist/documents/fence.d.ts +9 -0
- package/dist/documents/fence.d.ts.map +1 -0
- package/dist/documents/fence.js +15 -0
- package/dist/documents/fence.js.map +1 -0
- package/dist/documents/handles.d.ts +81 -0
- package/dist/documents/handles.d.ts.map +1 -0
- package/dist/documents/handles.js +74 -0
- package/dist/documents/handles.js.map +1 -0
- package/dist/documents/index.d.ts +4 -0
- package/dist/documents/index.d.ts.map +1 -0
- package/dist/documents/index.js +3 -0
- package/dist/documents/index.js.map +1 -0
- package/dist/documents/internal.d.ts +9 -0
- package/dist/documents/internal.d.ts.map +1 -0
- package/dist/documents/internal.js +9 -0
- package/dist/documents/internal.js.map +1 -0
- package/dist/documents/keyed-slot.d.ts +139 -0
- package/dist/documents/keyed-slot.d.ts.map +1 -0
- package/dist/documents/keyed-slot.js +478 -0
- package/dist/documents/keyed-slot.js.map +1 -0
- package/dist/documents/line.d.ts +7 -0
- package/dist/documents/line.d.ts.map +1 -0
- package/dist/documents/line.js +14 -0
- package/dist/documents/line.js.map +1 -0
- package/dist/documents/persistence.d.ts +120 -0
- package/dist/documents/persistence.d.ts.map +1 -0
- package/dist/documents/persistence.js +156 -0
- package/dist/documents/persistence.js.map +1 -0
- package/dist/documents/residency.d.ts +31 -0
- package/dist/documents/residency.d.ts.map +1 -0
- package/dist/documents/residency.js +93 -0
- package/dist/documents/residency.js.map +1 -0
- package/dist/documents/slot.d.ts +112 -0
- package/dist/documents/slot.d.ts.map +1 -0
- package/dist/documents/slot.js +190 -0
- package/dist/documents/slot.js.map +1 -0
- package/dist/documents/transaction.d.ts +143 -0
- package/dist/documents/transaction.d.ts.map +1 -0
- package/dist/documents/transaction.js +445 -0
- package/dist/documents/transaction.js.map +1 -0
- package/dist/host/activity.d.ts +31 -0
- package/dist/host/activity.d.ts.map +1 -0
- package/dist/host/activity.js +40 -0
- package/dist/host/activity.js.map +1 -0
- package/dist/host/adapted.d.ts +63 -0
- package/dist/host/adapted.d.ts.map +1 -0
- package/dist/host/adapted.js +298 -0
- package/dist/host/adapted.js.map +1 -0
- package/dist/host/admission.d.ts +137 -0
- package/dist/host/admission.d.ts.map +1 -0
- package/dist/host/admission.js +290 -0
- package/dist/host/admission.js.map +1 -0
- package/dist/host/attempt.d.ts +417 -0
- package/dist/host/attempt.d.ts.map +1 -0
- package/dist/host/attempt.js +1490 -0
- package/dist/host/attempt.js.map +1 -0
- package/dist/host/backoff.d.ts +29 -0
- package/dist/host/backoff.d.ts.map +1 -0
- package/dist/host/backoff.js +69 -0
- package/dist/host/backoff.js.map +1 -0
- package/dist/host/ctx.d.ts +94 -0
- package/dist/host/ctx.d.ts.map +1 -0
- package/dist/host/ctx.js +200 -0
- package/dist/host/ctx.js.map +1 -0
- package/dist/host/deadline.d.ts +12 -0
- package/dist/host/deadline.d.ts.map +1 -0
- package/dist/host/deadline.js +40 -0
- package/dist/host/deadline.js.map +1 -0
- package/dist/host/dependencies.d.ts +97 -0
- package/dist/host/dependencies.d.ts.map +1 -0
- package/dist/host/dependencies.js +148 -0
- package/dist/host/dependencies.js.map +1 -0
- package/dist/host/destination.d.ts +48 -0
- package/dist/host/destination.d.ts.map +1 -0
- package/dist/host/destination.js +101 -0
- package/dist/host/destination.js.map +1 -0
- package/dist/host/events.d.ts +114 -0
- package/dist/host/events.d.ts.map +1 -0
- package/dist/host/events.js +191 -0
- package/dist/host/events.js.map +1 -0
- package/dist/host/facet.d.ts +106 -0
- package/dist/host/facet.d.ts.map +1 -0
- package/dist/host/facet.js +55 -0
- package/dist/host/facet.js.map +1 -0
- package/dist/host/follow.d.ts +52 -0
- package/dist/host/follow.d.ts.map +1 -0
- package/dist/host/follow.js +207 -0
- package/dist/host/follow.js.map +1 -0
- package/dist/host/host-data.d.ts +62 -0
- package/dist/host/host-data.d.ts.map +1 -0
- package/dist/host/host-data.js +229 -0
- package/dist/host/host-data.js.map +1 -0
- package/dist/host/host.d.ts +641 -0
- package/dist/host/host.d.ts.map +1 -0
- package/dist/host/host.js +1449 -0
- package/dist/host/host.js.map +1 -0
- package/dist/host/index.d.ts +20 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +7 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/internal.d.ts +13 -0
- package/dist/host/internal.d.ts.map +1 -0
- package/dist/host/internal.js +11 -0
- package/dist/host/internal.js.map +1 -0
- package/dist/host/list.d.ts +52 -0
- package/dist/host/list.d.ts.map +1 -0
- package/dist/host/list.js +149 -0
- package/dist/host/list.js.map +1 -0
- package/dist/host/members.d.ts +58 -0
- package/dist/host/members.d.ts.map +1 -0
- package/dist/host/members.js +178 -0
- package/dist/host/members.js.map +1 -0
- package/dist/host/named-query.d.ts +67 -0
- package/dist/host/named-query.d.ts.map +1 -0
- package/dist/host/named-query.js +166 -0
- package/dist/host/named-query.js.map +1 -0
- package/dist/host/native.d.ts +64 -0
- package/dist/host/native.d.ts.map +1 -0
- package/dist/host/native.js +126 -0
- package/dist/host/native.js.map +1 -0
- package/dist/host/object.d.ts +388 -0
- package/dist/host/object.d.ts.map +1 -0
- package/dist/host/object.js +1527 -0
- package/dist/host/object.js.map +1 -0
- package/dist/host/old-work.d.ts +34 -0
- package/dist/host/old-work.d.ts.map +1 -0
- package/dist/host/old-work.js +52 -0
- package/dist/host/old-work.js.map +1 -0
- package/dist/host/parked.d.ts +23 -0
- package/dist/host/parked.d.ts.map +1 -0
- package/dist/host/parked.js +79 -0
- package/dist/host/parked.js.map +1 -0
- package/dist/host/presence.d.ts +34 -0
- package/dist/host/presence.d.ts.map +1 -0
- package/dist/host/presence.js +117 -0
- package/dist/host/presence.js.map +1 -0
- package/dist/host/query-reader.d.ts +80 -0
- package/dist/host/query-reader.d.ts.map +1 -0
- package/dist/host/query-reader.js +182 -0
- package/dist/host/query-reader.js.map +1 -0
- package/dist/host/read-declarations.d.ts +75 -0
- package/dist/host/read-declarations.d.ts.map +1 -0
- package/dist/host/read-declarations.js +152 -0
- package/dist/host/read-declarations.js.map +1 -0
- package/dist/host/readiness.d.ts +27 -0
- package/dist/host/readiness.d.ts.map +1 -0
- package/dist/host/readiness.js +134 -0
- package/dist/host/readiness.js.map +1 -0
- package/dist/host/ref-state.d.ts +53 -0
- package/dist/host/ref-state.d.ts.map +1 -0
- package/dist/host/ref-state.js +83 -0
- package/dist/host/ref-state.js.map +1 -0
- package/dist/host/reference-events.d.ts +51 -0
- package/dist/host/reference-events.d.ts.map +1 -0
- package/dist/host/reference-events.js +133 -0
- package/dist/host/reference-events.js.map +1 -0
- package/dist/host/reference-keys.d.ts +36 -0
- package/dist/host/reference-keys.d.ts.map +1 -0
- package/dist/host/reference-keys.js +168 -0
- package/dist/host/reference-keys.js.map +1 -0
- package/dist/host/reference-source.d.ts +77 -0
- package/dist/host/reference-source.d.ts.map +1 -0
- package/dist/host/reference-source.js +326 -0
- package/dist/host/reference-source.js.map +1 -0
- package/dist/host/reference.d.ts +377 -0
- package/dist/host/reference.d.ts.map +1 -0
- package/dist/host/reference.js +986 -0
- package/dist/host/reference.js.map +1 -0
- package/dist/host/reload-cycle.d.ts +16 -0
- package/dist/host/reload-cycle.d.ts.map +1 -0
- package/dist/host/reload-cycle.js +81 -0
- package/dist/host/reload-cycle.js.map +1 -0
- package/dist/host/retry-on.d.ts +28 -0
- package/dist/host/retry-on.d.ts.map +1 -0
- package/dist/host/retry-on.js +52 -0
- package/dist/host/retry-on.js.map +1 -0
- package/dist/host/revocation.d.ts +16 -0
- package/dist/host/revocation.d.ts.map +1 -0
- package/dist/host/revocation.js +27 -0
- package/dist/host/revocation.js.map +1 -0
- package/dist/host/root.d.ts +37 -0
- package/dist/host/root.d.ts.map +1 -0
- package/dist/host/root.js +68 -0
- package/dist/host/root.js.map +1 -0
- package/dist/host/route-admission.d.ts +24 -0
- package/dist/host/route-admission.d.ts.map +1 -0
- package/dist/host/route-admission.js +238 -0
- package/dist/host/route-admission.js.map +1 -0
- package/dist/host/route.d.ts +88 -0
- package/dist/host/route.d.ts.map +1 -0
- package/dist/host/route.js +247 -0
- package/dist/host/route.js.map +1 -0
- package/dist/host/routines.d.ts +78 -0
- package/dist/host/routines.d.ts.map +1 -0
- package/dist/host/routines.js +398 -0
- package/dist/host/routines.js.map +1 -0
- package/dist/host/sleep.d.ts +9 -0
- package/dist/host/sleep.d.ts.map +1 -0
- package/dist/host/sleep.js +40 -0
- package/dist/host/sleep.js.map +1 -0
- package/dist/host/staging.d.ts +100 -0
- package/dist/host/staging.d.ts.map +1 -0
- package/dist/host/staging.js +413 -0
- package/dist/host/staging.js.map +1 -0
- package/dist/host/tiling.d.ts +57 -0
- package/dist/host/tiling.d.ts.map +1 -0
- package/dist/host/tiling.js +269 -0
- package/dist/host/tiling.js.map +1 -0
- package/dist/host/unbound-clock.d.ts +23 -0
- package/dist/host/unbound-clock.d.ts.map +1 -0
- package/dist/host/unbound-clock.js +58 -0
- package/dist/host/unbound-clock.js.map +1 -0
- package/dist/host/unbound.d.ts +37 -0
- package/dist/host/unbound.d.ts.map +1 -0
- package/dist/host/unbound.js +88 -0
- package/dist/host/unbound.js.map +1 -0
- package/dist/host/uuid.d.ts +3 -0
- package/dist/host/uuid.d.ts.map +1 -0
- package/dist/host/uuid.js +38 -0
- package/dist/host/uuid.js.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/jobs/definition.d.ts +96 -0
- package/dist/jobs/definition.d.ts.map +1 -0
- package/dist/jobs/definition.js +83 -0
- package/dist/jobs/definition.js.map +1 -0
- package/dist/jobs/index.d.ts +5 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +3 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/internal.d.ts +3 -0
- package/dist/jobs/internal.d.ts.map +1 -0
- package/dist/jobs/internal.js +4 -0
- package/dist/jobs/internal.js.map +1 -0
- package/dist/jobs/job.d.ts +149 -0
- package/dist/jobs/job.d.ts.map +1 -0
- package/dist/jobs/job.js +387 -0
- package/dist/jobs/job.js.map +1 -0
- package/dist/jobs/persisted.d.ts +38 -0
- package/dist/jobs/persisted.d.ts.map +1 -0
- package/dist/jobs/persisted.js +95 -0
- package/dist/jobs/persisted.js.map +1 -0
- package/dist/jobs/records.d.ts +231 -0
- package/dist/jobs/records.d.ts.map +1 -0
- package/dist/jobs/records.js +871 -0
- package/dist/jobs/records.js.map +1 -0
- package/dist/jobs/run-states.d.ts +69 -0
- package/dist/jobs/run-states.d.ts.map +1 -0
- package/dist/jobs/run-states.js +228 -0
- package/dist/jobs/run-states.js.map +1 -0
- package/dist/jobs/run.d.ts +117 -0
- package/dist/jobs/run.d.ts.map +1 -0
- package/dist/jobs/run.js +204 -0
- package/dist/jobs/run.js.map +1 -0
- package/dist/jobs/running.d.ts +44 -0
- package/dist/jobs/running.d.ts.map +1 -0
- package/dist/jobs/running.js +117 -0
- package/dist/jobs/running.js.map +1 -0
- package/dist/jobs/stored.d.ts +63 -0
- package/dist/jobs/stored.d.ts.map +1 -0
- package/dist/jobs/stored.js +55 -0
- package/dist/jobs/stored.js.map +1 -0
- package/dist/json.d.ts +18 -0
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +124 -0
- package/dist/json.js.map +1 -0
- package/dist/link/binary.d.ts +4 -0
- package/dist/link/binary.d.ts.map +1 -0
- package/dist/link/binary.js +574 -0
- package/dist/link/binary.js.map +1 -0
- package/dist/link/channel.d.ts +78 -0
- package/dist/link/channel.d.ts.map +1 -0
- package/dist/link/channel.js +252 -0
- package/dist/link/channel.js.map +1 -0
- package/dist/link/errors.d.ts +7 -0
- package/dist/link/errors.d.ts.map +1 -0
- package/dist/link/errors.js +21 -0
- package/dist/link/errors.js.map +1 -0
- package/dist/link/index.d.ts +8 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +8 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/internal.d.ts +9 -0
- package/dist/link/internal.d.ts.map +1 -0
- package/dist/link/internal.js +10 -0
- package/dist/link/internal.js.map +1 -0
- package/dist/link/ipc.d.ts +22 -0
- package/dist/link/ipc.d.ts.map +1 -0
- package/dist/link/ipc.js +64 -0
- package/dist/link/ipc.js.map +1 -0
- package/dist/link/link.d.ts +34 -0
- package/dist/link/link.d.ts.map +1 -0
- package/dist/link/link.js +87 -0
- package/dist/link/link.js.map +1 -0
- package/dist/link/message.d.ts +278 -0
- package/dist/link/message.d.ts.map +1 -0
- package/dist/link/message.js +179 -0
- package/dist/link/message.js.map +1 -0
- package/dist/link/part.d.ts +80 -0
- package/dist/link/part.d.ts.map +1 -0
- package/dist/link/part.js +165 -0
- package/dist/link/part.js.map +1 -0
- package/dist/link/text.d.ts +6 -0
- package/dist/link/text.d.ts.map +1 -0
- package/dist/link/text.js +383 -0
- package/dist/link/text.js.map +1 -0
- package/dist/link/values.d.ts +40 -0
- package/dist/link/values.d.ts.map +1 -0
- package/dist/link/values.js +121 -0
- package/dist/link/values.js.map +1 -0
- package/dist/link/websocket.d.ts +26 -0
- package/dist/link/websocket.d.ts.map +1 -0
- package/dist/link/websocket.js +91 -0
- package/dist/link/websocket.js.map +1 -0
- package/dist/node/app/app.d.ts +283 -0
- package/dist/node/app/app.d.ts.map +1 -0
- package/dist/node/app/app.js +598 -0
- package/dist/node/app/app.js.map +1 -0
- package/dist/node/app/archive.d.ts +44 -0
- package/dist/node/app/archive.d.ts.map +1 -0
- package/dist/node/app/archive.js +212 -0
- package/dist/node/app/archive.js.map +1 -0
- package/dist/node/app/blobs.d.ts +23 -0
- package/dist/node/app/blobs.d.ts.map +1 -0
- package/dist/node/app/blobs.js +64 -0
- package/dist/node/app/blobs.js.map +1 -0
- package/dist/node/app/data.d.ts +40 -0
- package/dist/node/app/data.d.ts.map +1 -0
- package/dist/node/app/data.js +47 -0
- package/dist/node/app/data.js.map +1 -0
- package/dist/node/app/ephemeral-sign-ins.d.ts +20 -0
- package/dist/node/app/ephemeral-sign-ins.d.ts.map +1 -0
- package/dist/node/app/ephemeral-sign-ins.js +69 -0
- package/dist/node/app/ephemeral-sign-ins.js.map +1 -0
- package/dist/node/app/ephemeral.d.ts +11 -0
- package/dist/node/app/ephemeral.d.ts.map +1 -0
- package/dist/node/app/ephemeral.js +34 -0
- package/dist/node/app/ephemeral.js.map +1 -0
- package/dist/node/app/files-copy.d.ts +13 -0
- package/dist/node/app/files-copy.d.ts.map +1 -0
- package/dist/node/app/files-copy.js +86 -0
- package/dist/node/app/files-copy.js.map +1 -0
- package/dist/node/app/files-entry.d.ts +4 -0
- package/dist/node/app/files-entry.d.ts.map +1 -0
- package/dist/node/app/files-entry.js +7 -0
- package/dist/node/app/files-entry.js.map +1 -0
- package/dist/node/app/files-index.d.ts +180 -0
- package/dist/node/app/files-index.d.ts.map +1 -0
- package/dist/node/app/files-index.js +535 -0
- package/dist/node/app/files-index.js.map +1 -0
- package/dist/node/app/files.d.ts +388 -0
- package/dist/node/app/files.d.ts.map +1 -0
- package/dist/node/app/files.js +368 -0
- package/dist/node/app/files.js.map +1 -0
- package/dist/node/app/folder-views.d.ts +21 -0
- package/dist/node/app/folder-views.d.ts.map +1 -0
- package/dist/node/app/folder-views.js +55 -0
- package/dist/node/app/folder-views.js.map +1 -0
- package/dist/node/app/index.d.ts +12 -0
- package/dist/node/app/index.d.ts.map +1 -0
- package/dist/node/app/index.js +15 -0
- package/dist/node/app/index.js.map +1 -0
- package/dist/node/app/info.d.ts +70 -0
- package/dist/node/app/info.d.ts.map +1 -0
- package/dist/node/app/info.js +37 -0
- package/dist/node/app/info.js.map +1 -0
- package/dist/node/app/invite.d.ts +5 -0
- package/dist/node/app/invite.d.ts.map +1 -0
- package/dist/node/app/invite.js +64 -0
- package/dist/node/app/invite.js.map +1 -0
- package/dist/node/app/layout.d.ts +36 -0
- package/dist/node/app/layout.d.ts.map +1 -0
- package/dist/node/app/layout.js +87 -0
- package/dist/node/app/layout.js.map +1 -0
- package/dist/node/app/owner.d.ts +31 -0
- package/dist/node/app/owner.d.ts.map +1 -0
- package/dist/node/app/owner.js +104 -0
- package/dist/node/app/owner.js.map +1 -0
- package/dist/node/app/pairing.d.ts +55 -0
- package/dist/node/app/pairing.d.ts.map +1 -0
- package/dist/node/app/pairing.js +183 -0
- package/dist/node/app/pairing.js.map +1 -0
- package/dist/node/app/secrets.d.ts +16 -0
- package/dist/node/app/secrets.d.ts.map +1 -0
- package/dist/node/app/secrets.js +72 -0
- package/dist/node/app/secrets.js.map +1 -0
- package/dist/node/app/sign-ins.d.ts +74 -0
- package/dist/node/app/sign-ins.d.ts.map +1 -0
- package/dist/node/app/sign-ins.js +222 -0
- package/dist/node/app/sign-ins.js.map +1 -0
- package/dist/node/app/tar.d.ts +24 -0
- package/dist/node/app/tar.d.ts.map +1 -0
- package/dist/node/app/tar.js +167 -0
- package/dist/node/app/tar.js.map +1 -0
- package/dist/node/app/uploads.d.ts +37 -0
- package/dist/node/app/uploads.d.ts.map +1 -0
- package/dist/node/app/uploads.js +157 -0
- package/dist/node/app/uploads.js.map +1 -0
- package/dist/node/app/users.d.ts +39 -0
- package/dist/node/app/users.d.ts.map +1 -0
- package/dist/node/app/users.js +62 -0
- package/dist/node/app/users.js.map +1 -0
- package/dist/node/app/worker.d.ts +18 -0
- package/dist/node/app/worker.d.ts.map +1 -0
- package/dist/node/app/worker.js +84 -0
- package/dist/node/app/worker.js.map +1 -0
- package/dist/node/compression.d.ts +7 -0
- package/dist/node/compression.d.ts.map +1 -0
- package/dist/node/compression.js +25 -0
- package/dist/node/compression.js.map +1 -0
- package/dist/node/http/admission.d.ts +64 -0
- package/dist/node/http/admission.d.ts.map +1 -0
- package/dist/node/http/admission.js +137 -0
- package/dist/node/http/admission.js.map +1 -0
- package/dist/node/http/authenticate.d.ts +21 -0
- package/dist/node/http/authenticate.d.ts.map +1 -0
- package/dist/node/http/authenticate.js +34 -0
- package/dist/node/http/authenticate.js.map +1 -0
- package/dist/node/http/cookies.d.ts +32 -0
- package/dist/node/http/cookies.d.ts.map +1 -0
- package/dist/node/http/cookies.js +70 -0
- package/dist/node/http/cookies.js.map +1 -0
- package/dist/node/http/file.d.ts +23 -0
- package/dist/node/http/file.d.ts.map +1 -0
- package/dist/node/http/file.js +94 -0
- package/dist/node/http/file.js.map +1 -0
- package/dist/node/http/headers.d.ts +37 -0
- package/dist/node/http/headers.d.ts.map +1 -0
- package/dist/node/http/headers.js +136 -0
- package/dist/node/http/headers.js.map +1 -0
- package/dist/node/http/http.d.ts +114 -0
- package/dist/node/http/http.d.ts.map +1 -0
- package/dist/node/http/http.js +524 -0
- package/dist/node/http/http.js.map +1 -0
- package/dist/node/http/incoming.d.ts +19 -0
- package/dist/node/http/incoming.d.ts.map +1 -0
- package/dist/node/http/incoming.js +31 -0
- package/dist/node/http/incoming.js.map +1 -0
- package/dist/node/http/index.d.ts +11 -0
- package/dist/node/http/index.d.ts.map +1 -0
- package/dist/node/http/index.js +12 -0
- package/dist/node/http/index.js.map +1 -0
- package/dist/node/http/node.d.ts +78 -0
- package/dist/node/http/node.d.ts.map +1 -0
- package/dist/node/http/node.js +291 -0
- package/dist/node/http/node.js.map +1 -0
- package/dist/node/http/request.d.ts +60 -0
- package/dist/node/http/request.d.ts.map +1 -0
- package/dist/node/http/request.js +118 -0
- package/dist/node/http/request.js.map +1 -0
- package/dist/node/http/response.d.ts +63 -0
- package/dist/node/http/response.d.ts.map +1 -0
- package/dist/node/http/response.js +202 -0
- package/dist/node/http/response.js.map +1 -0
- package/dist/node/http/router.d.ts +132 -0
- package/dist/node/http/router.d.ts.map +1 -0
- package/dist/node/http/router.js +267 -0
- package/dist/node/http/router.js.map +1 -0
- package/dist/node/http/upgrades.d.ts +62 -0
- package/dist/node/http/upgrades.d.ts.map +1 -0
- package/dist/node/http/upgrades.js +194 -0
- package/dist/node/http/upgrades.js.map +1 -0
- package/dist/node/plugins/base-inputs.d.ts +14 -0
- package/dist/node/plugins/base-inputs.d.ts.map +1 -0
- package/dist/node/plugins/base-inputs.js +33 -0
- package/dist/node/plugins/base-inputs.js.map +1 -0
- package/dist/node/plugins/build.d.ts +77 -0
- package/dist/node/plugins/build.d.ts.map +1 -0
- package/dist/node/plugins/build.js +577 -0
- package/dist/node/plugins/build.js.map +1 -0
- package/dist/node/plugins/css-modules.d.ts +13 -0
- package/dist/node/plugins/css-modules.d.ts.map +1 -0
- package/dist/node/plugins/css-modules.js +58 -0
- package/dist/node/plugins/css-modules.js.map +1 -0
- package/dist/node/plugins/discover.d.ts +67 -0
- package/dist/node/plugins/discover.d.ts.map +1 -0
- package/dist/node/plugins/discover.js +369 -0
- package/dist/node/plugins/discover.js.map +1 -0
- package/dist/node/plugins/evaluate.d.ts +33 -0
- package/dist/node/plugins/evaluate.d.ts.map +1 -0
- package/dist/node/plugins/evaluate.js +121 -0
- package/dist/node/plugins/evaluate.js.map +1 -0
- package/dist/node/plugins/index.d.ts +11 -0
- package/dist/node/plugins/index.d.ts.map +1 -0
- package/dist/node/plugins/index.js +13 -0
- package/dist/node/plugins/index.js.map +1 -0
- package/dist/node/plugins/install.d.ts +40 -0
- package/dist/node/plugins/install.d.ts.map +1 -0
- package/dist/node/plugins/install.js +215 -0
- package/dist/node/plugins/install.js.map +1 -0
- package/dist/node/plugins/plugins.d.ts +165 -0
- package/dist/node/plugins/plugins.d.ts.map +1 -0
- package/dist/node/plugins/plugins.js +268 -0
- package/dist/node/plugins/plugins.js.map +1 -0
- package/dist/node/plugins/runtime.d.ts +57 -0
- package/dist/node/plugins/runtime.d.ts.map +1 -0
- package/dist/node/plugins/runtime.js +92 -0
- package/dist/node/plugins/runtime.js.map +1 -0
- package/dist/node/plugins/stack.d.ts +16 -0
- package/dist/node/plugins/stack.d.ts.map +1 -0
- package/dist/node/plugins/stack.js +70 -0
- package/dist/node/plugins/stack.js.map +1 -0
- package/dist/node/plugins/testing.d.ts +58 -0
- package/dist/node/plugins/testing.d.ts.map +1 -0
- package/dist/node/plugins/testing.js +210 -0
- package/dist/node/plugins/testing.js.map +1 -0
- package/dist/node/plugins/watcher.d.ts +69 -0
- package/dist/node/plugins/watcher.d.ts.map +1 -0
- package/dist/node/plugins/watcher.js +622 -0
- package/dist/node/plugins/watcher.js.map +1 -0
- package/dist/node/surfaces/bundle.d.ts +40 -0
- package/dist/node/surfaces/bundle.d.ts.map +1 -0
- package/dist/node/surfaces/bundle.js +121 -0
- package/dist/node/surfaces/bundle.js.map +1 -0
- package/dist/node/surfaces/current.d.ts +17 -0
- package/dist/node/surfaces/current.d.ts.map +1 -0
- package/dist/node/surfaces/current.js +54 -0
- package/dist/node/surfaces/current.js.map +1 -0
- package/dist/node/surfaces/index.d.ts +6 -0
- package/dist/node/surfaces/index.d.ts.map +1 -0
- package/dist/node/surfaces/index.js +6 -0
- package/dist/node/surfaces/index.js.map +1 -0
- package/dist/node/surfaces/published.d.ts +27 -0
- package/dist/node/surfaces/published.d.ts.map +1 -0
- package/dist/node/surfaces/published.js +142 -0
- package/dist/node/surfaces/published.js.map +1 -0
- package/dist/node/surfaces/served.d.ts +17 -0
- package/dist/node/surfaces/served.d.ts.map +1 -0
- package/dist/node/surfaces/served.js +44 -0
- package/dist/node/surfaces/served.js.map +1 -0
- package/dist/node/surfaces/surface-build.d.ts +53 -0
- package/dist/node/surfaces/surface-build.d.ts.map +1 -0
- package/dist/node/surfaces/surface-build.js +105 -0
- package/dist/node/surfaces/surface-build.js.map +1 -0
- package/dist/node/surfaces/tui.d.ts +42 -0
- package/dist/node/surfaces/tui.d.ts.map +1 -0
- package/dist/node/surfaces/tui.js +59 -0
- package/dist/node/surfaces/tui.js.map +1 -0
- package/dist/node/surfaces/web.d.ts +82 -0
- package/dist/node/surfaces/web.d.ts.map +1 -0
- package/dist/node/surfaces/web.js +122 -0
- package/dist/node/surfaces/web.js.map +1 -0
- package/dist/node/tui/actions.d.ts +49 -0
- package/dist/node/tui/actions.d.ts.map +1 -0
- package/dist/node/tui/actions.js +195 -0
- package/dist/node/tui/actions.js.map +1 -0
- package/dist/node/tui/credentials.d.ts +17 -0
- package/dist/node/tui/credentials.d.ts.map +1 -0
- package/dist/node/tui/credentials.js +54 -0
- package/dist/node/tui/credentials.js.map +1 -0
- package/dist/node/tui/filter.d.ts +5 -0
- package/dist/node/tui/filter.d.ts.map +1 -0
- package/dist/node/tui/filter.js +79 -0
- package/dist/node/tui/filter.js.map +1 -0
- package/dist/node/tui/index.d.ts +6 -0
- package/dist/node/tui/index.d.ts.map +1 -0
- package/dist/node/tui/index.js +6 -0
- package/dist/node/tui/index.js.map +1 -0
- package/dist/node/tui/launcher.d.ts +40 -0
- package/dist/node/tui/launcher.d.ts.map +1 -0
- package/dist/node/tui/launcher.js +439 -0
- package/dist/node/tui/launcher.js.map +1 -0
- package/dist/node/tui/pipe.d.ts +18 -0
- package/dist/node/tui/pipe.d.ts.map +1 -0
- package/dist/node/tui/pipe.js +134 -0
- package/dist/node/tui/pipe.js.map +1 -0
- package/dist/node/tui/sandbox.d.ts +54 -0
- package/dist/node/tui/sandbox.d.ts.map +1 -0
- package/dist/node/tui/sandbox.js +431 -0
- package/dist/node/tui/sandbox.js.map +1 -0
- package/dist/node/workers/base.d.ts +30 -0
- package/dist/node/workers/base.d.ts.map +1 -0
- package/dist/node/workers/base.js +260 -0
- package/dist/node/workers/base.js.map +1 -0
- package/dist/node/workers/child.d.ts +4 -0
- package/dist/node/workers/child.d.ts.map +1 -0
- package/dist/node/workers/child.js +6 -0
- package/dist/node/workers/child.js.map +1 -0
- package/dist/node/workers/control.d.ts +83 -0
- package/dist/node/workers/control.d.ts.map +1 -0
- package/dist/node/workers/control.js +77 -0
- package/dist/node/workers/control.js.map +1 -0
- package/dist/node/workers/index.d.ts +4 -0
- package/dist/node/workers/index.d.ts.map +1 -0
- package/dist/node/workers/index.js +7 -0
- package/dist/node/workers/index.js.map +1 -0
- package/dist/node/workers/lock.d.ts +30 -0
- package/dist/node/workers/lock.d.ts.map +1 -0
- package/dist/node/workers/lock.js +180 -0
- package/dist/node/workers/lock.js.map +1 -0
- package/dist/node/workers/main.d.ts +46 -0
- package/dist/node/workers/main.d.ts.map +1 -0
- package/dist/node/workers/main.js +230 -0
- package/dist/node/workers/main.js.map +1 -0
- package/dist/node/workers/process.d.ts +43 -0
- package/dist/node/workers/process.d.ts.map +1 -0
- package/dist/node/workers/process.js +137 -0
- package/dist/node/workers/process.js.map +1 -0
- package/dist/node/workers/workers.d.ts +144 -0
- package/dist/node/workers/workers.d.ts.map +1 -0
- package/dist/node/workers/workers.js +723 -0
- package/dist/node/workers/workers.js.map +1 -0
- package/dist/output.d.ts +91 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +362 -0
- package/dist/output.js.map +1 -0
- package/dist/react/hooks.d.ts +61 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +119 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +4 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/stores.d.ts +9 -0
- package/dist/react/stores.d.ts.map +1 -0
- package/dist/react/stores.js +37 -0
- package/dist/react/stores.js.map +1 -0
- package/dist/registries/contribution.d.ts +50 -0
- package/dist/registries/contribution.d.ts.map +1 -0
- package/dist/registries/contribution.js +129 -0
- package/dist/registries/contribution.js.map +1 -0
- package/dist/registries/entries.d.ts +18 -0
- package/dist/registries/entries.d.ts.map +1 -0
- package/dist/registries/entries.js +42 -0
- package/dist/registries/entries.js.map +1 -0
- package/dist/registries/index.d.ts +3 -0
- package/dist/registries/index.d.ts.map +1 -0
- package/dist/registries/index.js +5 -0
- package/dist/registries/index.js.map +1 -0
- package/dist/registries/internal.d.ts +4 -0
- package/dist/registries/internal.d.ts.map +1 -0
- package/dist/registries/internal.js +5 -0
- package/dist/registries/internal.js.map +1 -0
- package/dist/registries/record.d.ts +115 -0
- package/dist/registries/record.d.ts.map +1 -0
- package/dist/registries/record.js +283 -0
- package/dist/registries/record.js.map +1 -0
- package/dist/registries/registry.d.ts +74 -0
- package/dist/registries/registry.d.ts.map +1 -0
- package/dist/registries/registry.js +14 -0
- package/dist/registries/registry.js.map +1 -0
- package/dist/registries/value.d.ts +48 -0
- package/dist/registries/value.d.ts.map +1 -0
- package/dist/registries/value.js +224 -0
- package/dist/registries/value.js.map +1 -0
- package/dist/remote/calls.d.ts +34 -0
- package/dist/remote/calls.d.ts.map +1 -0
- package/dist/remote/calls.js +75 -0
- package/dist/remote/calls.js.map +1 -0
- package/dist/remote/consumer.d.ts +59 -0
- package/dist/remote/consumer.d.ts.map +1 -0
- package/dist/remote/consumer.js +468 -0
- package/dist/remote/consumer.js.map +1 -0
- package/dist/remote/hold.d.ts +147 -0
- package/dist/remote/hold.d.ts.map +1 -0
- package/dist/remote/hold.js +653 -0
- package/dist/remote/hold.js.map +1 -0
- package/dist/remote/host-link.d.ts +81 -0
- package/dist/remote/host-link.d.ts.map +1 -0
- package/dist/remote/host-link.js +198 -0
- package/dist/remote/host-link.js.map +1 -0
- package/dist/remote/internal.d.ts +6 -0
- package/dist/remote/internal.d.ts.map +1 -0
- package/dist/remote/internal.js +6 -0
- package/dist/remote/internal.js.map +1 -0
- package/dist/remote/path.d.ts +105 -0
- package/dist/remote/path.d.ts.map +1 -0
- package/dist/remote/path.js +197 -0
- package/dist/remote/path.js.map +1 -0
- package/dist/remote/provider.d.ts +113 -0
- package/dist/remote/provider.d.ts.map +1 -0
- package/dist/remote/provider.js +787 -0
- package/dist/remote/provider.js.map +1 -0
- package/dist/remote/relay.d.ts +126 -0
- package/dist/remote/relay.d.ts.map +1 -0
- package/dist/remote/relay.js +334 -0
- package/dist/remote/relay.js.map +1 -0
- package/dist/remote/remote-object.d.ts +181 -0
- package/dist/remote/remote-object.d.ts.map +1 -0
- package/dist/remote/remote-object.js +683 -0
- package/dist/remote/remote-object.js.map +1 -0
- package/dist/remote/replica.d.ts +66 -0
- package/dist/remote/replica.d.ts.map +1 -0
- package/dist/remote/replica.js +148 -0
- package/dist/remote/replica.js.map +1 -0
- package/dist/sqlite/cloudflare.d.ts +54 -0
- package/dist/sqlite/cloudflare.d.ts.map +1 -0
- package/dist/sqlite/cloudflare.js +144 -0
- package/dist/sqlite/cloudflare.js.map +1 -0
- package/dist/sqlite/database.d.ts +40 -0
- package/dist/sqlite/database.d.ts.map +1 -0
- package/dist/sqlite/database.js +2 -0
- package/dist/sqlite/database.js.map +1 -0
- package/dist/sqlite/index.d.ts +4 -0
- package/dist/sqlite/index.d.ts.map +1 -0
- package/dist/sqlite/index.js +3 -0
- package/dist/sqlite/index.js.map +1 -0
- package/dist/sqlite/migrations.d.ts +10 -0
- package/dist/sqlite/migrations.d.ts.map +1 -0
- package/dist/sqlite/migrations.js +33 -0
- package/dist/sqlite/migrations.js.map +1 -0
- package/dist/sqlite/node.d.ts +49 -0
- package/dist/sqlite/node.d.ts.map +1 -0
- package/dist/sqlite/node.js +197 -0
- package/dist/sqlite/node.js.map +1 -0
- package/dist/sqlite/schema.d.ts +3 -0
- package/dist/sqlite/schema.d.ts.map +1 -0
- package/dist/sqlite/schema.js +10 -0
- package/dist/sqlite/schema.js.map +1 -0
- package/dist/state/batch.d.ts +64 -0
- package/dist/state/batch.d.ts.map +1 -0
- package/dist/state/batch.js +164 -0
- package/dist/state/batch.js.map +1 -0
- package/dist/state/derive.d.ts +56 -0
- package/dist/state/derive.d.ts.map +1 -0
- package/dist/state/derive.js +192 -0
- package/dist/state/derive.js.map +1 -0
- package/dist/state/framed.d.ts +43 -0
- package/dist/state/framed.d.ts.map +1 -0
- package/dist/state/framed.js +121 -0
- package/dist/state/framed.js.map +1 -0
- package/dist/state/index.d.ts +6 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +4 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/internal.d.ts +7 -0
- package/dist/state/internal.d.ts.map +1 -0
- package/dist/state/internal.js +9 -0
- package/dist/state/internal.js.map +1 -0
- package/dist/state/native-source.d.ts +106 -0
- package/dist/state/native-source.d.ts.map +1 -0
- package/dist/state/native-source.js +240 -0
- package/dist/state/native-source.js.map +1 -0
- package/dist/state/watchable.d.ts +114 -0
- package/dist/state/watchable.d.ts.map +1 -0
- package/dist/state/watchable.js +156 -0
- package/dist/state/watchable.js.map +1 -0
- package/dist/state/writable.d.ts +32 -0
- package/dist/state/writable.d.ts.map +1 -0
- package/dist/state/writable.js +49 -0
- package/dist/state/writable.js.map +1 -0
- package/dist/store/adapter.d.ts +67 -0
- package/dist/store/adapter.d.ts.map +1 -0
- package/dist/store/adapter.js +118 -0
- package/dist/store/adapter.js.map +1 -0
- package/dist/store/allocator.d.ts +17 -0
- package/dist/store/allocator.d.ts.map +1 -0
- package/dist/store/allocator.js +30 -0
- package/dist/store/allocator.js.map +1 -0
- package/dist/store/applier.d.ts +8 -0
- package/dist/store/applier.d.ts.map +1 -0
- package/dist/store/applier.js +390 -0
- package/dist/store/applier.js.map +1 -0
- package/dist/store/apply-batch.d.ts +12 -0
- package/dist/store/apply-batch.d.ts.map +1 -0
- package/dist/store/apply-batch.js +83 -0
- package/dist/store/apply-batch.js.map +1 -0
- package/dist/store/archive.d.ts +36 -0
- package/dist/store/archive.d.ts.map +1 -0
- package/dist/store/archive.js +140 -0
- package/dist/store/archive.js.map +1 -0
- package/dist/store/backend.d.ts +10 -0
- package/dist/store/backend.d.ts.map +1 -0
- package/dist/store/backend.js +15 -0
- package/dist/store/backend.js.map +1 -0
- package/dist/store/catalog.d.ts +24 -0
- package/dist/store/catalog.d.ts.map +1 -0
- package/dist/store/catalog.js +17 -0
- package/dist/store/catalog.js.map +1 -0
- package/dist/store/claims.d.ts +23 -0
- package/dist/store/claims.d.ts.map +1 -0
- package/dist/store/claims.js +65 -0
- package/dist/store/claims.js.map +1 -0
- package/dist/store/column-set.d.ts +64 -0
- package/dist/store/column-set.d.ts.map +1 -0
- package/dist/store/column-set.js +96 -0
- package/dist/store/column-set.js.map +1 -0
- package/dist/store/columns.d.ts +93 -0
- package/dist/store/columns.d.ts.map +1 -0
- package/dist/store/columns.js +87 -0
- package/dist/store/columns.js.map +1 -0
- package/dist/store/engine.d.ts +182 -0
- package/dist/store/engine.d.ts.map +1 -0
- package/dist/store/engine.js +290 -0
- package/dist/store/engine.js.map +1 -0
- package/dist/store/evaluate.d.ts +17 -0
- package/dist/store/evaluate.d.ts.map +1 -0
- package/dist/store/evaluate.js +131 -0
- package/dist/store/evaluate.js.map +1 -0
- package/dist/store/export.d.ts +30 -0
- package/dist/store/export.d.ts.map +1 -0
- package/dist/store/export.js +221 -0
- package/dist/store/export.js.map +1 -0
- package/dist/store/expression.d.ts +254 -0
- package/dist/store/expression.d.ts.map +1 -0
- package/dist/store/expression.js +577 -0
- package/dist/store/expression.js.map +1 -0
- package/dist/store/host-column.d.ts +22 -0
- package/dist/store/host-column.d.ts.map +1 -0
- package/dist/store/host-column.js +36 -0
- package/dist/store/host-column.js.map +1 -0
- package/dist/store/host-data.d.ts +100 -0
- package/dist/store/host-data.d.ts.map +1 -0
- package/dist/store/host-data.js +397 -0
- package/dist/store/host-data.js.map +1 -0
- package/dist/store/import-migration.d.ts +19 -0
- package/dist/store/import-migration.d.ts.map +1 -0
- package/dist/store/import-migration.js +124 -0
- package/dist/store/import-migration.js.map +1 -0
- package/dist/store/import.d.ts +12 -0
- package/dist/store/import.d.ts.map +1 -0
- package/dist/store/import.js +279 -0
- package/dist/store/import.js.map +1 -0
- package/dist/store/index.d.ts +19 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +16 -0
- package/dist/store/index.js.map +1 -0
- package/dist/store/json-column.d.ts +33 -0
- package/dist/store/json-column.d.ts.map +1 -0
- package/dist/store/json-column.js +62 -0
- package/dist/store/json-column.js.map +1 -0
- package/dist/store/jsonl.d.ts +9 -0
- package/dist/store/jsonl.d.ts.map +1 -0
- package/dist/store/jsonl.js +61 -0
- package/dist/store/jsonl.js.map +1 -0
- package/dist/store/live-query.d.ts +72 -0
- package/dist/store/live-query.d.ts.map +1 -0
- package/dist/store/live-query.js +162 -0
- package/dist/store/live-query.js.map +1 -0
- package/dist/store/open-query.d.ts +90 -0
- package/dist/store/open-query.d.ts.map +1 -0
- package/dist/store/open-query.js +201 -0
- package/dist/store/open-query.js.map +1 -0
- package/dist/store/outbox.d.ts +26 -0
- package/dist/store/outbox.d.ts.map +1 -0
- package/dist/store/outbox.js +80 -0
- package/dist/store/outbox.js.map +1 -0
- package/dist/store/page.d.ts +14 -0
- package/dist/store/page.d.ts.map +1 -0
- package/dist/store/page.js +26 -0
- package/dist/store/page.js.map +1 -0
- package/dist/store/query.d.ts +65 -0
- package/dist/store/query.d.ts.map +1 -0
- package/dist/store/query.js +193 -0
- package/dist/store/query.js.map +1 -0
- package/dist/store/read-plan.d.ts +74 -0
- package/dist/store/read-plan.d.ts.map +1 -0
- package/dist/store/read-plan.js +324 -0
- package/dist/store/read-plan.js.map +1 -0
- package/dist/store/read.d.ts +81 -0
- package/dist/store/read.d.ts.map +1 -0
- package/dist/store/read.js +113 -0
- package/dist/store/read.js.map +1 -0
- package/dist/store/reads.d.ts +79 -0
- package/dist/store/reads.d.ts.map +1 -0
- package/dist/store/reads.js +255 -0
- package/dist/store/reads.js.map +1 -0
- package/dist/store/refusal.d.ts +15 -0
- package/dist/store/refusal.d.ts.map +1 -0
- package/dist/store/refusal.js +36 -0
- package/dist/store/refusal.js.map +1 -0
- package/dist/store/rows.d.ts +96 -0
- package/dist/store/rows.d.ts.map +1 -0
- package/dist/store/rows.js +222 -0
- package/dist/store/rows.js.map +1 -0
- package/dist/store/schema.d.ts +25 -0
- package/dist/store/schema.d.ts.map +1 -0
- package/dist/store/schema.js +123 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store/skip.d.ts +26 -0
- package/dist/store/skip.d.ts.map +1 -0
- package/dist/store/skip.js +66 -0
- package/dist/store/skip.js.map +1 -0
- package/dist/store/sql.d.ts +78 -0
- package/dist/store/sql.d.ts.map +1 -0
- package/dist/store/sql.js +244 -0
- package/dist/store/sql.js.map +1 -0
- package/dist/store/step.d.ts +52 -0
- package/dist/store/step.d.ts.map +1 -0
- package/dist/store/step.js +59 -0
- package/dist/store/step.js.map +1 -0
- package/dist/store/store.d.ts +192 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +863 -0
- package/dist/store/store.js.map +1 -0
- package/dist/store/table-changes.d.ts +35 -0
- package/dist/store/table-changes.d.ts.map +1 -0
- package/dist/store/table-changes.js +127 -0
- package/dist/store/table-changes.js.map +1 -0
- package/dist/store/table-evolve.d.ts +82 -0
- package/dist/store/table-evolve.d.ts.map +1 -0
- package/dist/store/table-evolve.js +208 -0
- package/dist/store/table-evolve.js.map +1 -0
- package/dist/store/table-handle.d.ts +69 -0
- package/dist/store/table-handle.d.ts.map +1 -0
- package/dist/store/table-handle.js +92 -0
- package/dist/store/table-handle.js.map +1 -0
- package/dist/store/table-history.d.ts +78 -0
- package/dist/store/table-history.d.ts.map +1 -0
- package/dist/store/table-history.js +43 -0
- package/dist/store/table-history.js.map +1 -0
- package/dist/store/table-migration.d.ts +28 -0
- package/dist/store/table-migration.d.ts.map +1 -0
- package/dist/store/table-migration.js +212 -0
- package/dist/store/table-migration.js.map +1 -0
- package/dist/store/table-writes.d.ts +125 -0
- package/dist/store/table-writes.d.ts.map +1 -0
- package/dist/store/table-writes.js +170 -0
- package/dist/store/table-writes.js.map +1 -0
- package/dist/store/table.d.ts +91 -0
- package/dist/store/table.d.ts.map +1 -0
- package/dist/store/table.js +133 -0
- package/dist/store/table.js.map +1 -0
- package/dist/store/text.d.ts +14 -0
- package/dist/store/text.d.ts.map +1 -0
- package/dist/store/text.js +51 -0
- package/dist/store/text.js.map +1 -0
- package/dist/store/writes.d.ts +5 -0
- package/dist/store/writes.d.ts.map +1 -0
- package/dist/store/writes.js +4 -0
- package/dist/store/writes.js.map +1 -0
- package/dist/surfaces/active-language.d.ts +20 -0
- package/dist/surfaces/active-language.d.ts.map +1 -0
- package/dist/surfaces/active-language.js +78 -0
- package/dist/surfaces/active-language.js.map +1 -0
- package/dist/surfaces/active-theme.d.ts +16 -0
- package/dist/surfaces/active-theme.d.ts.map +1 -0
- package/dist/surfaces/active-theme.js +47 -0
- package/dist/surfaces/active-theme.js.map +1 -0
- package/dist/surfaces/client.d.ts +106 -0
- package/dist/surfaces/client.d.ts.map +1 -0
- package/dist/surfaces/client.js +280 -0
- package/dist/surfaces/client.js.map +1 -0
- package/dist/surfaces/connection.d.ts +53 -0
- package/dist/surfaces/connection.d.ts.map +1 -0
- package/dist/surfaces/connection.js +161 -0
- package/dist/surfaces/connection.js.map +1 -0
- package/dist/surfaces/format.d.ts +5 -0
- package/dist/surfaces/format.d.ts.map +1 -0
- package/dist/surfaces/format.js +37 -0
- package/dist/surfaces/format.js.map +1 -0
- package/dist/surfaces/index.d.ts +15 -0
- package/dist/surfaces/index.d.ts.map +1 -0
- package/dist/surfaces/index.js +18 -0
- package/dist/surfaces/index.js.map +1 -0
- package/dist/surfaces/language.d.ts +53 -0
- package/dist/surfaces/language.d.ts.map +1 -0
- package/dist/surfaces/language.js +74 -0
- package/dist/surfaces/language.js.map +1 -0
- package/dist/surfaces/loaded.d.ts +42 -0
- package/dist/surfaces/loaded.d.ts.map +1 -0
- package/dist/surfaces/loaded.js +116 -0
- package/dist/surfaces/loaded.js.map +1 -0
- package/dist/surfaces/locale-choice.d.ts +26 -0
- package/dist/surfaces/locale-choice.d.ts.map +1 -0
- package/dist/surfaces/locale-choice.js +14 -0
- package/dist/surfaces/locale-choice.js.map +1 -0
- package/dist/surfaces/messages.d.ts +67 -0
- package/dist/surfaces/messages.d.ts.map +1 -0
- package/dist/surfaces/messages.js +112 -0
- package/dist/surfaces/messages.js.map +1 -0
- package/dist/surfaces/page-state.d.ts +14 -0
- package/dist/surfaces/page-state.d.ts.map +1 -0
- package/dist/surfaces/page-state.js +43 -0
- package/dist/surfaces/page-state.js.map +1 -0
- package/dist/surfaces/preference.d.ts +33 -0
- package/dist/surfaces/preference.d.ts.map +1 -0
- package/dist/surfaces/preference.js +72 -0
- package/dist/surfaces/preference.js.map +1 -0
- package/dist/surfaces/registered.d.ts +33 -0
- package/dist/surfaces/registered.d.ts.map +1 -0
- package/dist/surfaces/registered.js +51 -0
- package/dist/surfaces/registered.js.map +1 -0
- package/dist/surfaces/scripts.d.ts +86 -0
- package/dist/surfaces/scripts.d.ts.map +1 -0
- package/dist/surfaces/scripts.js +28 -0
- package/dist/surfaces/scripts.js.map +1 -0
- package/dist/surfaces/theme-choice.d.ts +32 -0
- package/dist/surfaces/theme-choice.d.ts.map +1 -0
- package/dist/surfaces/theme-choice.js +18 -0
- package/dist/surfaces/theme-choice.js.map +1 -0
- package/dist/surfaces/themes.d.ts +43 -0
- package/dist/surfaces/themes.d.ts.map +1 -0
- package/dist/surfaces/themes.js +110 -0
- package/dist/surfaces/themes.js.map +1 -0
- package/dist/surfaces/translations.d.ts +29 -0
- package/dist/surfaces/translations.d.ts.map +1 -0
- package/dist/surfaces/translations.js +57 -0
- package/dist/surfaces/translations.js.map +1 -0
- package/dist/surfaces/variant.d.ts +23 -0
- package/dist/surfaces/variant.d.ts.map +1 -0
- package/dist/surfaces/variant.js +18 -0
- package/dist/surfaces/variant.js.map +1 -0
- package/dist/sync/batch.d.ts +18 -0
- package/dist/sync/batch.d.ts.map +1 -0
- package/dist/sync/batch.js +125 -0
- package/dist/sync/batch.js.map +1 -0
- package/dist/sync/client.d.ts +169 -0
- package/dist/sync/client.d.ts.map +1 -0
- package/dist/sync/client.js +459 -0
- package/dist/sync/client.js.map +1 -0
- package/dist/sync/files.d.ts +46 -0
- package/dist/sync/files.d.ts.map +1 -0
- package/dist/sync/files.js +13 -0
- package/dist/sync/files.js.map +1 -0
- package/dist/sync/filesystem.d.ts +37 -0
- package/dist/sync/filesystem.d.ts.map +1 -0
- package/dist/sync/filesystem.js +205 -0
- package/dist/sync/filesystem.js.map +1 -0
- package/dist/sync/index.d.ts +8 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/index.js +9 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/lines.d.ts +18 -0
- package/dist/sync/lines.d.ts.map +1 -0
- package/dist/sync/lines.js +46 -0
- package/dist/sync/lines.js.map +1 -0
- package/dist/sync/remote.d.ts +145 -0
- package/dist/sync/remote.d.ts.map +1 -0
- package/dist/sync/remote.js +59 -0
- package/dist/sync/remote.js.map +1 -0
- package/dist/sync/state.d.ts +17 -0
- package/dist/sync/state.d.ts.map +1 -0
- package/dist/sync/state.js +40 -0
- package/dist/sync/state.js.map +1 -0
- package/dist/telemetry-ingest/batch.d.ts +73 -0
- package/dist/telemetry-ingest/batch.d.ts.map +1 -0
- package/dist/telemetry-ingest/batch.js +110 -0
- package/dist/telemetry-ingest/batch.js.map +1 -0
- package/dist/telemetry-ingest/facet.d.ts +26 -0
- package/dist/telemetry-ingest/facet.d.ts.map +1 -0
- package/dist/telemetry-ingest/facet.js +100 -0
- package/dist/telemetry-ingest/facet.js.map +1 -0
- package/dist/telemetry-ingest/index.d.ts +5 -0
- package/dist/telemetry-ingest/index.d.ts.map +1 -0
- package/dist/telemetry-ingest/index.js +8 -0
- package/dist/telemetry-ingest/index.js.map +1 -0
- package/dist/telemetry-ingest/recorder.d.ts +50 -0
- package/dist/telemetry-ingest/recorder.d.ts.map +1 -0
- package/dist/telemetry-ingest/recorder.js +298 -0
- package/dist/telemetry-ingest/recorder.js.map +1 -0
- package/dist/telemetry-ingest/sender.d.ts +14 -0
- package/dist/telemetry-ingest/sender.d.ts.map +1 -0
- package/dist/telemetry-ingest/sender.js +64 -0
- package/dist/telemetry-ingest/sender.js.map +1 -0
- package/dist/telemetry-sqlite/index.d.ts +33 -0
- package/dist/telemetry-sqlite/index.d.ts.map +1 -0
- package/dist/telemetry-sqlite/index.js +113 -0
- package/dist/telemetry-sqlite/index.js.map +1 -0
- package/dist/telemetry-sqlite/node.d.ts +13 -0
- package/dist/telemetry-sqlite/node.d.ts.map +1 -0
- package/dist/telemetry-sqlite/node.js +27 -0
- package/dist/telemetry-sqlite/node.js.map +1 -0
- package/dist/telemetry-sqlite/schema.d.ts +9 -0
- package/dist/telemetry-sqlite/schema.d.ts.map +1 -0
- package/dist/telemetry-sqlite/schema.js +61 -0
- package/dist/telemetry-sqlite/schema.js.map +1 -0
- package/dist/telemetry-sqlite/store.d.ts +12 -0
- package/dist/telemetry-sqlite/store.d.ts.map +1 -0
- package/dist/telemetry-sqlite/store.js +121 -0
- package/dist/telemetry-sqlite/store.js.map +1 -0
- package/dist/telemetry.d.ts +1013 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +518 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/tui/bridge.d.ts +112 -0
- package/dist/tui/bridge.d.ts.map +1 -0
- package/dist/tui/bridge.js +9 -0
- package/dist/tui/bridge.js.map +1 -0
- package/dist/tui/channel.d.ts +44 -0
- package/dist/tui/channel.d.ts.map +1 -0
- package/dist/tui/channel.js +150 -0
- package/dist/tui/channel.js.map +1 -0
- package/dist/tui/frames.d.ts +5 -0
- package/dist/tui/frames.d.ts.map +1 -0
- package/dist/tui/frames.js +52 -0
- package/dist/tui/frames.js.map +1 -0
- package/dist/tui/index.d.ts +8 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +8 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/runtime.d.ts +46 -0
- package/dist/tui/runtime.d.ts.map +1 -0
- package/dist/tui/runtime.js +101 -0
- package/dist/tui/runtime.js.map +1 -0
- package/dist/tui/scope.d.ts +62 -0
- package/dist/tui/scope.d.ts.map +1 -0
- package/dist/tui/scope.js +173 -0
- package/dist/tui/scope.js.map +1 -0
- package/dist/tui/terminal.d.ts +15 -0
- package/dist/tui/terminal.d.ts.map +1 -0
- package/dist/tui/terminal.js +37 -0
- package/dist/tui/terminal.js.map +1 -0
- package/dist/tui/theme.d.ts +17 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +38 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/watch.d.ts +194 -0
- package/dist/watch.d.ts.map +1 -0
- package/dist/watch.js +383 -0
- package/dist/watch.js.map +1 -0
- package/dist/web/environment.d.ts +4 -0
- package/dist/web/environment.d.ts.map +1 -0
- package/dist/web/environment.js +37 -0
- package/dist/web/environment.js.map +1 -0
- package/dist/web/index.d.ts +5 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +7 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/language.d.ts +7 -0
- package/dist/web/language.d.ts.map +1 -0
- package/dist/web/language.js +21 -0
- package/dist/web/language.js.map +1 -0
- package/dist/web/page.d.ts +42 -0
- package/dist/web/page.d.ts.map +1 -0
- package/dist/web/page.js +96 -0
- package/dist/web/page.js.map +1 -0
- package/dist/web/scripts.d.ts +23 -0
- package/dist/web/scripts.d.ts.map +1 -0
- package/dist/web/scripts.js +50 -0
- package/dist/web/scripts.js.map +1 -0
- package/dist/web/styles.d.ts +17 -0
- package/dist/web/styles.d.ts.map +1 -0
- package/dist/web/styles.js +218 -0
- package/dist/web/styles.js.map +1 -0
- package/dist/web/themes.d.ts +6 -0
- package/dist/web/themes.d.ts.map +1 -0
- package/dist/web/themes.js +31 -0
- package/dist/web/themes.js.map +1 -0
- package/docs/admission/design.md +178 -0
- package/docs/benchmarks.md +1182 -0
- package/docs/decisions.md +3760 -0
- package/docs/dependencies/book.md +1671 -0
- package/docs/dependencies/index.html +2641 -0
- package/docs/dependencies/model.md +330 -0
- package/docs/design.md +3691 -0
- package/docs/durable-observers/book.md +432 -0
- package/docs/durable-observers/index.html +517 -0
- package/docs/events/spec.md +438 -0
- package/docs/flow-control/book.md +333 -0
- package/docs/flow-control/fold/index.html +265 -0
- package/docs/flow-control/index.html +548 -0
- package/docs/flow-control/window/index.html +228 -0
- package/docs/guide-plugins-hosts/book.md +958 -0
- package/docs/guide-plugins-hosts/index.html +952 -0
- package/docs/host-keyed/spec.md +343 -0
- package/docs/http-workers/book.md +378 -0
- package/docs/http-workers/index.html +515 -0
- package/docs/i18n/book.md +217 -0
- package/docs/i18n/index.html +344 -0
- package/docs/layer-1.md +311 -0
- package/docs/layer-2.md +216 -0
- package/docs/p3-features/README.md +6 -0
- package/docs/p3-features/book.md +478 -0
- package/docs/plugin-authoring.md +389 -0
- package/docs/plugin-model/book.md +186 -0
- package/docs/plugin-model/index.html +310 -0
- package/docs/plugin-primer/book.md +273 -0
- package/docs/plugin-primer/index.html +430 -0
- package/docs/shared-holds/design.md +339 -0
- package/docs/slice-1.md +236 -0
- package/docs/slice-10.md +288 -0
- package/docs/slice-11.md +114 -0
- package/docs/slice-12.md +132 -0
- package/docs/slice-13.md +121 -0
- package/docs/slice-14-design.md +213 -0
- package/docs/slice-14.md +861 -0
- package/docs/slice-2.md +174 -0
- package/docs/slice-3a.md +296 -0
- package/docs/slice-3b.md +197 -0
- package/docs/slice-4.md +146 -0
- package/docs/slice-4a.md +418 -0
- package/docs/slice-4b.md +208 -0
- package/docs/slice-5.md +281 -0
- package/docs/slice-6a.md +676 -0
- package/docs/slice-6b.md +332 -0
- package/docs/slice-7a.md +130 -0
- package/docs/slice-7b/book.md +608 -0
- package/docs/slice-7b/index.html +842 -0
- package/docs/slice-7b.md +255 -0
- package/docs/slice-7c.md +165 -0
- package/docs/slice-8.md +194 -0
- package/docs/slice-9.md +110 -0
- package/docs/slices.md +380 -0
- package/docs/store/book.md +670 -0
- package/docs/store/index.html +861 -0
- package/docs/store/walkthrough.md +193 -0
- package/docs/theming/book.md +223 -0
- package/docs/theming/index.html +371 -0
- package/docs/tutorial/book.md +2170 -0
- package/docs/tutorial/index.html +2112 -0
- package/docs/tutorial/screens/click-after.png +0 -0
- package/docs/tutorial/screens/click-before.png +0 -0
- package/docs/tutorial/screens/edited.png +0 -0
- package/docs/tutorial/screens/french.png +0 -0
- package/docs/tutorial/screens/harbor.png +0 -0
- package/docs/tutorial/screens/page.png +0 -0
- package/docs/tutorial/screens/traces-ada.png +0 -0
- package/docs/tutorial/screens/traces.png +0 -0
- package/package.json +200 -5
- package/src/delta/README.md +262 -0
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
// `startServer` (slice 13 §1, §5; decisions "The app kit, point 1" to "point 5"): the server of an app built with the kit.
|
|
2
|
+
// It lays out the data directory, opens the server's store, creates the server host, the HTTP component and one
|
|
3
|
+
// workers component per worker kind, the plugins component over the app's required root and the user's root, loads
|
|
4
|
+
// the server's plugins with the kit's own facets (the start-data object, sign-ins, the owner link, pairing, files),
|
|
5
|
+
// and gives the app the controls it needs: the owner link, `applyChanges`, installs, export, import and delete per
|
|
6
|
+
// address (the worker's data and the server's records and rows belonging to the address).
|
|
7
|
+
// After the listen, off the start's path, it builds the bases (the surfaces' base bundles, each worker kind's worker
|
|
8
|
+
// base) and records the base code the `base` mark compares.
|
|
9
|
+
import { randomUUID } from "node:crypto";
|
|
10
|
+
import { createReadStream, createWriteStream, statSync } from "node:fs";
|
|
11
|
+
import { mkdtemp, rename, rm } from "node:fs/promises";
|
|
12
|
+
import { dirname, join, resolve, sep } from "node:path";
|
|
13
|
+
import { pipeline } from "node:stream/promises";
|
|
14
|
+
import { withAbortSignal } from "../../context/index.js";
|
|
15
|
+
import { hostKind } from "../../contracts/index.js";
|
|
16
|
+
import { isChordError } from "../../data/index.js";
|
|
17
|
+
import { principalKey, samePrincipal } from "../../data/principal.js";
|
|
18
|
+
import { createHost } from "../../host/index.js";
|
|
19
|
+
import { isJsonValue } from "../../json.js";
|
|
20
|
+
import { openNodeSqliteDatabase } from "../../sqlite/node.js";
|
|
21
|
+
import { decodeJsonl, encodeJsonl, openStore, sqliteBackend } from "../../store/index.js";
|
|
22
|
+
import { localeChoiceFacet, themeChoiceFacet, themesFacet, translationsFacet } from "../../surfaces/index.js";
|
|
23
|
+
import { telemetryIngestFacet } from "../../telemetry-ingest/index.js";
|
|
24
|
+
import { createHttp } from "../http/index.js";
|
|
25
|
+
import { createPlugins, } from "../plugins/index.js";
|
|
26
|
+
import { processConditions, tuiSurface, WEB_PREFIX, webSurface, } from "../surfaces/index.js";
|
|
27
|
+
import { createWorkers, nodeBaseInputs, processLock, } from "../workers/index.js";
|
|
28
|
+
import { ARCHIVE_FORMAT, exists, packData, unpackStaging } from "./archive.js";
|
|
29
|
+
import { addressParam, HostData } from "./data.js";
|
|
30
|
+
import { filesFacet } from "./files.js";
|
|
31
|
+
import { appInfoFacet } from "./info.js";
|
|
32
|
+
import { createLayout, defaultDataDir, openDataDir, privateStore, workerDirectory } from "./layout.js";
|
|
33
|
+
import { OWNER_PATH, OwnerLink, ownerFacet, ownerTokenFile } from "./owner.js";
|
|
34
|
+
import { Pairings, pairingFacet } from "./pairing.js";
|
|
35
|
+
import { secretFile } from "./secrets.js";
|
|
36
|
+
import { createSignIns } from "./sign-ins.js";
|
|
37
|
+
/** The server's host kind: the kit's server host is `Server()`. */
|
|
38
|
+
export const Server = hostKind("server");
|
|
39
|
+
/**
|
|
40
|
+
* Starts the app's server (§1): resolves once its plugins are loaded and it listens. A failing plugin of the app's
|
|
41
|
+
* root (or a problem discovery reports there) rejects with the plugins component's `PluginError`, everything closed.
|
|
42
|
+
* The bases are built right after the listen, from the files as they are then (`basesBuilt`): a page request waits
|
|
43
|
+
* for its surface's, a worker start for its kind's.
|
|
44
|
+
*/
|
|
45
|
+
export async function startServer(options, context) {
|
|
46
|
+
checkOwner(options.principal.owner, options.principal.server, context);
|
|
47
|
+
const { layout, cookieSecret, store, lock } = await openServer(resolve(options.dataDir ?? defaultDataDir(options.name)), context);
|
|
48
|
+
const { onError, api, limits = {} } = options;
|
|
49
|
+
const signIns = createSignIns(cookieSecret, { maxEphemeral: limits.ephemeralSignIns });
|
|
50
|
+
const { telemetry, principalAttributes } = options;
|
|
51
|
+
const host = createHost({
|
|
52
|
+
address: Server(),
|
|
53
|
+
principal: options.principal.server,
|
|
54
|
+
store,
|
|
55
|
+
telemetry,
|
|
56
|
+
...(principalAttributes === undefined ? {} : { principalAttributes }),
|
|
57
|
+
...options.timeouts,
|
|
58
|
+
onError: (error) => onError({ kind: "host", error }),
|
|
59
|
+
});
|
|
60
|
+
const http = createHttp(host, {
|
|
61
|
+
listen: options.listen ?? { host: "127.0.0.1", port: 0 },
|
|
62
|
+
links: { path: "/chord", opened: signIns.opened },
|
|
63
|
+
telemetry,
|
|
64
|
+
onError: (error) => onError({ kind: "http", error }),
|
|
65
|
+
}, context);
|
|
66
|
+
const plugins = createPlugins({
|
|
67
|
+
roots: [{ path: resolve(options.root ?? "plugins"), required: true }, layout.plugins],
|
|
68
|
+
api: { name: api.name, versions: api.versions },
|
|
69
|
+
kinds: Object.fromEntries(Object.entries(options.kinds).map(([name, kind]) => [
|
|
70
|
+
name,
|
|
71
|
+
{ platform: kind.platform, hostPackages: hostPackagesOf(api, name, kind) },
|
|
72
|
+
])),
|
|
73
|
+
install: options.install,
|
|
74
|
+
// The server's own base code, hashed now; each base bundle's record is added once built (`watchBase`).
|
|
75
|
+
base: (options.base ?? []).map((path) => resolve(path)),
|
|
76
|
+
publicPath: `${WEB_PREFIX}assets/`,
|
|
77
|
+
onError: (error) => onError({ kind: "plugins", error }),
|
|
78
|
+
}, context);
|
|
79
|
+
const workers = new Map();
|
|
80
|
+
// The address key of each worker by its principal's key: the principal its link stamps on its telemetry batches.
|
|
81
|
+
const workerHosts = new Map();
|
|
82
|
+
const link = new OwnerLink();
|
|
83
|
+
const { owner } = options.principal;
|
|
84
|
+
const core = [
|
|
85
|
+
{ name: "chord.http", facet: http.facet },
|
|
86
|
+
{
|
|
87
|
+
name: "chord.app.info",
|
|
88
|
+
facet: appInfoFacet({ dataDir: layout.dataDir, name: options.name, version: api.versions[0] ?? "", owner }),
|
|
89
|
+
},
|
|
90
|
+
{ name: "chord.app.sign-ins", facet: signIns.facet },
|
|
91
|
+
{ name: "chord.app.owner", facet: ownerFacet(link, owner) },
|
|
92
|
+
{
|
|
93
|
+
name: "chord.app.pairing",
|
|
94
|
+
facet: pairingFacet(new Pairings({ maxPending: limits.pendingPairings, perAddress: limits.pairingsPerAddress }), owner),
|
|
95
|
+
},
|
|
96
|
+
{ name: "chord.app.files", facet: filesFacet(join(layout.server, "files"), options.files, limits.uploads) },
|
|
97
|
+
{ name: "chord.themes", facet: themesFacet() },
|
|
98
|
+
{ name: "chord.themes.choice", facet: themeChoiceFacet() },
|
|
99
|
+
{ name: "chord.translations", facet: translationsFacet() },
|
|
100
|
+
{ name: "chord.locale.choice", facet: localeChoiceFacet() },
|
|
101
|
+
];
|
|
102
|
+
if (telemetry !== undefined) {
|
|
103
|
+
const facet = telemetryIngestFacet({
|
|
104
|
+
target: telemetry,
|
|
105
|
+
// Every link of the kit's server is signed in: its pages are the app's own people's.
|
|
106
|
+
admit: () => true,
|
|
107
|
+
workerHost: (principal) => workerHosts.get(principalKey(principal, context)),
|
|
108
|
+
principalAttributes: (principal) => host.principalAttributes(principal, context),
|
|
109
|
+
});
|
|
110
|
+
core.push({ name: "chord.telemetry", facet });
|
|
111
|
+
}
|
|
112
|
+
const surfaces = [];
|
|
113
|
+
const app = new RunningApp(host, http, workers, plugins, surfaces, { store, lock }, layout, options);
|
|
114
|
+
// What runs after the start reports nothing once the app closes (a build or scan finishing late).
|
|
115
|
+
const report = (error) => {
|
|
116
|
+
if (!app.closing())
|
|
117
|
+
onError(error);
|
|
118
|
+
};
|
|
119
|
+
try {
|
|
120
|
+
for (const kind of options.workers ?? []) {
|
|
121
|
+
workers.set(kind.kind.kind, workersOf(host, store, kind, options, layout, plugins, workerHosts, context));
|
|
122
|
+
}
|
|
123
|
+
for (const surface of surfacesOf(host, options, plugins)) {
|
|
124
|
+
surfaces.push(surface);
|
|
125
|
+
core.push({ name: `chord.${surface.name}`, facet: surface.surface.facet });
|
|
126
|
+
}
|
|
127
|
+
await plugins.load(host, { kind: "server", core, modules: modulesOf(api, options.kinds.server) }, context);
|
|
128
|
+
await ownerTokenFile(layout.ownerToken, owner, host, context);
|
|
129
|
+
const listening = await http.listening(context);
|
|
130
|
+
const bases = [
|
|
131
|
+
...surfaces.map(({ name, surface }) => ({ name, build: () => surface.build() })),
|
|
132
|
+
...[...workers].map(([name, each]) => ({ name, build: () => each.build() })),
|
|
133
|
+
];
|
|
134
|
+
const compared = [];
|
|
135
|
+
const built = buildBases(bases, plugins, compared, report, () => app.closing());
|
|
136
|
+
const watching = watchBaseCode(plugins, built, compared, report, () => app.closing());
|
|
137
|
+
app.started(link.renew(), listening, built, watching);
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
await app.close(context);
|
|
141
|
+
throw error;
|
|
142
|
+
}
|
|
143
|
+
return app;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Refuses an owner the kit could not recognize or that would act as the server (a declaration policy the types cannot
|
|
147
|
+
* express): sign-ins keep the owner as JSON, so a field `undefined` (or anything else not strict JSON) would never
|
|
148
|
+
* match it again; the server's principal reaches every worker's kit objects.
|
|
149
|
+
*/
|
|
150
|
+
function checkOwner(owner, server, context) {
|
|
151
|
+
if (!isJsonValue(owner)) {
|
|
152
|
+
throw new Error("startServer: principal.owner must be strict JSON (no undefined fields, functions or class instances)");
|
|
153
|
+
}
|
|
154
|
+
if (samePrincipal(owner, server, context)) {
|
|
155
|
+
throw new Error("startServer: principal.owner must not be the server's principal");
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Builds every base right after the listen, at once, from the files as they are now (owner decision "A": nothing is
|
|
160
|
+
* kept between starts; the server answers meanwhile, each request needing a base waits for it). A built base's record
|
|
161
|
+
* is added to what `plugins` compares (its first comparisons pushed to `compared`); a failed one is reported
|
|
162
|
+
* (`base_build`) and the server runs on. Settles once every build ended; what ends after the close is dropped.
|
|
163
|
+
*/
|
|
164
|
+
async function buildBases(bases, plugins, compared, report, closed) {
|
|
165
|
+
await Promise.all(bases.map(async ({ name, build }) => {
|
|
166
|
+
const built = await build();
|
|
167
|
+
if (closed())
|
|
168
|
+
return;
|
|
169
|
+
if (built.kind === "failed")
|
|
170
|
+
report({ kind: "base_build", base: name, error: built.error });
|
|
171
|
+
else
|
|
172
|
+
compared.push(plugins.watchBase(built.inputs));
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Adds the server's own code to what `plugins` compares, once the bases are built (`built`; the scan's reads would
|
|
177
|
+
* contend with the builds the first requests wait for): the static graph of its entry (the start script;
|
|
178
|
+
* `nodeBaseInputs`; a file changed since the process started is recorded as differing, `editedSinceStart`). Best
|
|
179
|
+
* effort: a failed scan is reported (`server_scan`) and that code not compared. An entry under `node_modules` is
|
|
180
|
+
* installed code (an npm-installed app, a test runner), never compared. Settles once every record's first comparison
|
|
181
|
+
* did (the bases' in `compared` too: `base` knows them all). A close meanwhile ends it at its next step; a scan stalled
|
|
182
|
+
* on a read keeps it pending until the read ends (the close does not wait for it; its result is dropped).
|
|
183
|
+
*/
|
|
184
|
+
async function watchBaseCode(plugins, built, compared, report, closed) {
|
|
185
|
+
await built;
|
|
186
|
+
if (closed())
|
|
187
|
+
return;
|
|
188
|
+
const entry = process.argv[1];
|
|
189
|
+
if (entry !== undefined && !entry.split(sep).includes("node_modules")) {
|
|
190
|
+
const conditions = processConditions(process.execArgv, process.env.NODE_OPTIONS);
|
|
191
|
+
const scanned = await nodeBaseInputs(entry, conditions).then((inputs) => inputs, (error) => report({ kind: "server_scan", error }));
|
|
192
|
+
if (closed())
|
|
193
|
+
return;
|
|
194
|
+
if (scanned !== undefined)
|
|
195
|
+
compared.push(plugins.watchBase(editedSinceStart(scanned)));
|
|
196
|
+
}
|
|
197
|
+
await Promise.all(compared);
|
|
198
|
+
}
|
|
199
|
+
/** What the scan records for a file changed since the process started: a hash no bytes have. */
|
|
200
|
+
const EDITED_SINCE_START = "changed since the server started";
|
|
201
|
+
/** How far in the future a file's timestamp may be and still count as an edit since the start: clock skew. */
|
|
202
|
+
const FUTURE_SLACK_MS = 5_000;
|
|
203
|
+
/**
|
|
204
|
+
* The scan's record `inputs` with every file changed since this process started (its mtime or ctime after
|
|
205
|
+
* `performance.timeOrigin`) recorded as differing: Node may have loaded other bytes than the scan read, so its first
|
|
206
|
+
* comparison marks `base` (until a restart: the bytes Node loaded are unknown). Conservative: an edit Node loaded
|
|
207
|
+
* anyway (made during the module loading, before the file was read) or a change of metadata only (ctime) marks too.
|
|
208
|
+
* Per timestamp: one later than now (plus `FUTURE_SLACK_MS`) is no edit since the start (a file stamped in the future,
|
|
209
|
+
* by a skewed clock or an archive, would mark every start until that time); a file neither of whose timestamps is in
|
|
210
|
+
* range keeps its hash, compared by content alone.
|
|
211
|
+
*/
|
|
212
|
+
function editedSinceStart(inputs) {
|
|
213
|
+
const started = performance.timeOrigin;
|
|
214
|
+
const latest = Date.now() + FUTURE_SLACK_MS;
|
|
215
|
+
return new Map([...inputs].map(([path, hash]) => {
|
|
216
|
+
try {
|
|
217
|
+
const { mtimeMs, ctimeMs } = statSync(path);
|
|
218
|
+
const edited = [mtimeMs, ctimeMs].some((time) => time > started && time <= latest);
|
|
219
|
+
return [path, edited ? EDITED_SINCE_START : hash];
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
// Gone: its first comparison finds it so.
|
|
223
|
+
return [path, hash];
|
|
224
|
+
}
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
227
|
+
/** The app's client surfaces, in order: the web's, the terminal's (their base bundles built after the listen). */
|
|
228
|
+
function surfacesOf(host, options, plugins) {
|
|
229
|
+
const surfaces = [];
|
|
230
|
+
if (options.web !== undefined)
|
|
231
|
+
surfaces.push({ name: "web", surface: webSurface(host, { ...options.web, plugins }) });
|
|
232
|
+
if (options.tui !== undefined)
|
|
233
|
+
surfaces.push({ name: "tui", surface: tuiSurface(host, { ...options.tui, plugins }) });
|
|
234
|
+
return surfaces;
|
|
235
|
+
}
|
|
236
|
+
/** How long a second server waits for the data directory's lock before it is refused. */
|
|
237
|
+
const SERVER_LOCK_MS = 1000;
|
|
238
|
+
/**
|
|
239
|
+
* The server's own part of the data directory `path`: its lock (one server per data directory, by its real path: a
|
|
240
|
+
* second one, also through a symbolic link, would share its stores and secrets), the layout made private, the cookie
|
|
241
|
+
* secret and the server's store; the lock released when the rest fails.
|
|
242
|
+
*/
|
|
243
|
+
async function openServer(path, context) {
|
|
244
|
+
const dataDir = await openDataDir(path);
|
|
245
|
+
const waited = AbortSignal.timeout(SERVER_LOCK_MS);
|
|
246
|
+
const lock = await processLock(`chord-app:${dataDir}`, withAbortSignal(waited, context)).catch((error) => {
|
|
247
|
+
throw waited.aborted ? new Error(`startServer: another server runs on ${dataDir}`) : error;
|
|
248
|
+
});
|
|
249
|
+
try {
|
|
250
|
+
const layout = await createLayout(dataDir);
|
|
251
|
+
const cookieSecret = await secretFile(layout.cookieSecret);
|
|
252
|
+
await privateStore(layout.serverStore);
|
|
253
|
+
const store = await openStore(sqliteBackend(await openNodeSqliteDatabase(layout.serverStore)), context);
|
|
254
|
+
return { layout, cookieSecret, store, lock };
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
await lock.release();
|
|
258
|
+
throw error;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/** The host packages of kind `name`: the API's shared and per-kind module of every version, and its packages. */
|
|
262
|
+
function hostPackagesOf(api, name, kind) {
|
|
263
|
+
const modules = api.versions.flatMap((version) => [`${api.name}/${version}`, `${api.name}/${version}/${name}`]);
|
|
264
|
+
return [...modules, ...Object.keys(kind.packages ?? {})];
|
|
265
|
+
}
|
|
266
|
+
/** This process's modules for a kind: the API's and the kind's packages. */
|
|
267
|
+
function modulesOf(api, kind) {
|
|
268
|
+
return { ...api.modules, ...kind?.packages };
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* The workers component of one worker kind (its base built after the listen, into the kind's directory under
|
|
272
|
+
* `cache/workers/`): started with the kit's part of the start data beside the app's.
|
|
273
|
+
*/
|
|
274
|
+
function workersOf(host, store, kind, options, layout, plugins, workerHosts, context) {
|
|
275
|
+
const { dataDir } = layout;
|
|
276
|
+
const facet = kind.facet ?? "worker";
|
|
277
|
+
// `AppOptions` admits worker kinds only with `principal.worker`.
|
|
278
|
+
const worker = options.principal.worker;
|
|
279
|
+
const { server } = options.principal;
|
|
280
|
+
return createWorkers(host,
|
|
281
|
+
// A host kind of the app: any params; its addresses come back from its route as the kit hands them on.
|
|
282
|
+
kind.kind, {
|
|
283
|
+
kind: facet,
|
|
284
|
+
entry: kind.entry,
|
|
285
|
+
...(kind.execArgv === undefined ? {} : { execArgv: kind.execArgv }),
|
|
286
|
+
...(kind.env === undefined ? {} : { env: kind.env }),
|
|
287
|
+
baseDir: join(layout.workerBases, kind.kind.kind),
|
|
288
|
+
compileCache: layout.compileCache,
|
|
289
|
+
// The server's: a worker's exit is published after the commits its calls queued there.
|
|
290
|
+
store,
|
|
291
|
+
// The server reaches its workers' kit objects (`HostData`) whatever the app admits.
|
|
292
|
+
authorize: (principal, address) => samePrincipal(principal, server, context) || kind.authorize(principal, address),
|
|
293
|
+
principal: worker,
|
|
294
|
+
start: async (address, ctx) => {
|
|
295
|
+
const principal = worker(address);
|
|
296
|
+
workerHosts.set(principalKey(principal, ctx), address.key);
|
|
297
|
+
const kit = {
|
|
298
|
+
dir: workerDirectory(dataDir, address),
|
|
299
|
+
facet,
|
|
300
|
+
// Principals are JSON (they cross links).
|
|
301
|
+
principal: principal,
|
|
302
|
+
server: server,
|
|
303
|
+
files: { ...options.files },
|
|
304
|
+
telemetry: options.telemetry !== undefined,
|
|
305
|
+
...(options.limits?.uploads === undefined ? {} : { uploads: options.limits.uploads }),
|
|
306
|
+
timeouts: { ...options.timeouts },
|
|
307
|
+
};
|
|
308
|
+
return { kit, app: await kind.start(address, ctx) };
|
|
309
|
+
},
|
|
310
|
+
lock: (address) => workerLock(options.name, dataDir, address.key),
|
|
311
|
+
...(kind.idleMs === undefined ? {} : { idleMs: kind.idleMs }),
|
|
312
|
+
plugins,
|
|
313
|
+
onError: (error) => options.onError({ kind: "workers", error }),
|
|
314
|
+
}, context);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Whether a host data commit's rejection leaves its outcome unknown: the store stopped after or during `COMMIT`
|
|
318
|
+
* (`unavailable/storage_failed`), so the commit may stand.
|
|
319
|
+
*/
|
|
320
|
+
function unknownOutcome(error) {
|
|
321
|
+
return isChordError(error) && error.code === "unavailable" && error.reason === "storage_failed";
|
|
322
|
+
}
|
|
323
|
+
/** The process lock of the worker at `address`: its worker holds it while it runs, an export or import meanwhile. */
|
|
324
|
+
function workerLock(name, dataDir, key) {
|
|
325
|
+
return `${name}:${dataDir}:${key}`;
|
|
326
|
+
}
|
|
327
|
+
/** How long an export or import waits for a worker's lock: past it a worker holds it (it runs or starts). */
|
|
328
|
+
const ADDRESS_LOCK_MS = 2000;
|
|
329
|
+
/** The host of the owner link for the address listened on: loopback for a wildcard, an IPv6 address in brackets. */
|
|
330
|
+
function linkHost(host) {
|
|
331
|
+
if (host === "0.0.0.0" || host === "")
|
|
332
|
+
return "127.0.0.1";
|
|
333
|
+
if (host === "::")
|
|
334
|
+
return "[::1]";
|
|
335
|
+
return host.includes(":") ? `[${host}]` : host;
|
|
336
|
+
}
|
|
337
|
+
class RunningApp {
|
|
338
|
+
host;
|
|
339
|
+
http;
|
|
340
|
+
workers;
|
|
341
|
+
plugins;
|
|
342
|
+
dataDir;
|
|
343
|
+
ownerTokenFile;
|
|
344
|
+
#component;
|
|
345
|
+
/** The client surfaces, filled before the server's load. */
|
|
346
|
+
#surfaces;
|
|
347
|
+
#store;
|
|
348
|
+
#lock;
|
|
349
|
+
#options;
|
|
350
|
+
#link = "";
|
|
351
|
+
/** The bases' builds after the start (`buildBases`). */
|
|
352
|
+
#building = Promise.resolve();
|
|
353
|
+
/** The recording of the base code after the start (`watchBaseCode`). */
|
|
354
|
+
#scanning = Promise.resolve();
|
|
355
|
+
#closing;
|
|
356
|
+
/** The latest `applyChanges`, settled to nothing: the next one starts after it. */
|
|
357
|
+
#applying = Promise.resolve();
|
|
358
|
+
constructor(host, http, workers, plugins, surfaces, server, layout, options) {
|
|
359
|
+
this.host = host;
|
|
360
|
+
this.http = http;
|
|
361
|
+
this.workers = workers;
|
|
362
|
+
this.#component = plugins;
|
|
363
|
+
this.#surfaces = surfaces;
|
|
364
|
+
this.#store = server.store;
|
|
365
|
+
this.#lock = server.lock;
|
|
366
|
+
this.#options = options;
|
|
367
|
+
this.dataDir = layout.dataDir;
|
|
368
|
+
this.ownerTokenFile = layout.ownerToken;
|
|
369
|
+
this.plugins = {
|
|
370
|
+
state: plugins.state,
|
|
371
|
+
install: (source, context) => plugins.installPlugin(source, layout.plugins, context),
|
|
372
|
+
component: plugins,
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* The start finished: the owner link's token and the address it names (the one listened on), the bases' builds and
|
|
377
|
+
* the recording of the base code under way (`basesBuilt`, `baseWatched`).
|
|
378
|
+
*/
|
|
379
|
+
started(token, listening, building, scanning) {
|
|
380
|
+
this.#link = `http://${linkHost(listening.host)}:${listening.port}${OWNER_PATH}#${token}`;
|
|
381
|
+
this.#building = building;
|
|
382
|
+
this.#scanning = scanning;
|
|
383
|
+
}
|
|
384
|
+
ownerLink() {
|
|
385
|
+
return this.#link;
|
|
386
|
+
}
|
|
387
|
+
get basesBuilt() {
|
|
388
|
+
return this.#building;
|
|
389
|
+
}
|
|
390
|
+
get baseWatched() {
|
|
391
|
+
return this.#scanning;
|
|
392
|
+
}
|
|
393
|
+
get web() {
|
|
394
|
+
return this.#surfaceBase("web");
|
|
395
|
+
}
|
|
396
|
+
get tui() {
|
|
397
|
+
return this.#surfaceBase("tui");
|
|
398
|
+
}
|
|
399
|
+
/** The surface `name`'s base hash once built, when the app has that surface. */
|
|
400
|
+
#surfaceBase(name) {
|
|
401
|
+
const found = this.#surfaces.find((each) => each.name === name);
|
|
402
|
+
if (found === undefined)
|
|
403
|
+
return undefined;
|
|
404
|
+
const { built } = found.surface;
|
|
405
|
+
return { base: built?.kind === "built" ? built.base : undefined };
|
|
406
|
+
}
|
|
407
|
+
applyChanges(context) {
|
|
408
|
+
// One build and rollout at a time: a later build rolled out before an earlier one would leave the older code
|
|
409
|
+
// deployed (each host applies the last set it is handed).
|
|
410
|
+
const applied = this.#applying.then(() => this.#applyChanges(context));
|
|
411
|
+
this.#applying = applied.then(() => { }, () => { });
|
|
412
|
+
return applied;
|
|
413
|
+
}
|
|
414
|
+
/** One build of the dirty plugins and its rollout: the server, every worker kind, then the clients. */
|
|
415
|
+
async #applyChanges(context) {
|
|
416
|
+
const plugins = this.#component;
|
|
417
|
+
const built = await plugins.build(plugins.state.value.dirty, context);
|
|
418
|
+
const steps = [
|
|
419
|
+
plugins.step("server", this.host),
|
|
420
|
+
...[...this.workers].map(([name, each]) => each.step(name)),
|
|
421
|
+
...this.#surfaces.map(({ name, surface }) => surface.step(name)),
|
|
422
|
+
];
|
|
423
|
+
return plugins.rollout(steps, built, context);
|
|
424
|
+
}
|
|
425
|
+
async exportData(address, path, context) {
|
|
426
|
+
const workers = this.#workersOf(address);
|
|
427
|
+
const manifest = this.#manifest(address);
|
|
428
|
+
const target = resolve(path);
|
|
429
|
+
// The server's part first, staged beside the archive: the worker or `packData` packs it with the rest.
|
|
430
|
+
const staging = await mkdtemp(join(dirname(target), ".chord-server-"));
|
|
431
|
+
const server = join(staging, "server.archive");
|
|
432
|
+
try {
|
|
433
|
+
const parts = encodeJsonl(this.host.exportHostData(address, context));
|
|
434
|
+
await pipeline(parts, createWriteStream(server, { mode: 0o600 }));
|
|
435
|
+
await this.#exportWorker(workers, address, manifest, server, target, context);
|
|
436
|
+
}
|
|
437
|
+
finally {
|
|
438
|
+
await rm(staging, { recursive: true, force: true });
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
/** Packs the worker's data with the server's part `server` at `target`, by the running worker or under its lock. */
|
|
442
|
+
async #exportWorker(workers, address, manifest, server, target, context) {
|
|
443
|
+
// Running: the worker packs its own store. Else the lock, unless a worker starts first: then ask it.
|
|
444
|
+
for (let attempt = 1;; attempt++) {
|
|
445
|
+
if (workers.state.value[address.key]?.status === "running") {
|
|
446
|
+
const data = await this.host.get(HostData, { address: addressParam(address) }, context);
|
|
447
|
+
try {
|
|
448
|
+
await data.exportTo({ path: target, manifest: JSON.stringify(manifest), server }, context);
|
|
449
|
+
}
|
|
450
|
+
finally {
|
|
451
|
+
data.release();
|
|
452
|
+
}
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
const lock = await this.#workerLock(address, context);
|
|
456
|
+
if (lock !== undefined) {
|
|
457
|
+
try {
|
|
458
|
+
await packData(workerDirectory(this.dataDir, address), manifest, server, target, context);
|
|
459
|
+
}
|
|
460
|
+
finally {
|
|
461
|
+
await lock.release();
|
|
462
|
+
}
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
if (attempt === 5)
|
|
466
|
+
throw new Error(`exportData: the worker at ${address.key} keeps starting; try again`);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
async importData(archive, address, context, options = {}) {
|
|
470
|
+
this.#workersOf(address);
|
|
471
|
+
const { name, limits = {} } = this.#options;
|
|
472
|
+
const existing = options.existing ?? "refuse";
|
|
473
|
+
const accept = (manifest) => {
|
|
474
|
+
// A trust boundary: an archive from anywhere.
|
|
475
|
+
if (manifest?.format !== ARCHIVE_FORMAT)
|
|
476
|
+
throw new Error(`importData: not a format ${ARCHIVE_FORMAT} archive`);
|
|
477
|
+
if (manifest.app !== name)
|
|
478
|
+
throw new Error(`importData: an archive of "${manifest.app}", not "${name}"`);
|
|
479
|
+
if (manifest.address?.kind !== address.kind) {
|
|
480
|
+
throw new Error(`importData: an archive of a ${String(manifest.address?.kind)}, not a ${address.kind}`);
|
|
481
|
+
}
|
|
482
|
+
};
|
|
483
|
+
const dir = workerDirectory(this.dataDir, address);
|
|
484
|
+
await this.#underLock(address, "importData", "has data (its worker runs)", context, async () => {
|
|
485
|
+
if (existing === "refuse" && (await exists(dir))) {
|
|
486
|
+
throw new Error(`importData: ${dir} exists already (an address is imported once)`);
|
|
487
|
+
}
|
|
488
|
+
// (1) Unpacked whole into staging: nothing changed yet.
|
|
489
|
+
const bounds = { bytes: limits.importBytes, entries: limits.importEntries };
|
|
490
|
+
const { staging } = await unpackStaging(resolve(archive), dirname(dir), accept, bounds, context);
|
|
491
|
+
const aside = existing === "replace" && (await exists(dir)) ? `${dir}.aside-${randomUUID()}` : undefined;
|
|
492
|
+
let placed = false;
|
|
493
|
+
const undo = async () => {
|
|
494
|
+
await rm(placed ? dir : staging, { recursive: true, force: true });
|
|
495
|
+
if (aside !== undefined && (await exists(aside)))
|
|
496
|
+
await rename(aside, dir);
|
|
497
|
+
};
|
|
498
|
+
try {
|
|
499
|
+
// (2) The old directory aside, (3) the new one in place.
|
|
500
|
+
if (aside !== undefined)
|
|
501
|
+
await rename(dir, aside);
|
|
502
|
+
await rename(staging, dir);
|
|
503
|
+
placed = true;
|
|
504
|
+
// (4) The server's part, the one commit, last.
|
|
505
|
+
const parts = decodeJsonl(createReadStream(join(dir, "server.archive")));
|
|
506
|
+
await this.host.importHostData(parts, context, { address, existing });
|
|
507
|
+
}
|
|
508
|
+
catch (error) {
|
|
509
|
+
if (unknownOutcome(error)) {
|
|
510
|
+
// It may have committed: undoing could pair the old directory with the new server data.
|
|
511
|
+
throw new Error(`importData: ${address.key}: the server's commit has an unknown outcome; nothing was undone (the ` +
|
|
512
|
+
`new directory is in place${aside === undefined ? "" : `, the old one at ${aside}`}). Run the ` +
|
|
513
|
+
`import again with existing: "replace" once the server's store is back.`, { cause: error });
|
|
514
|
+
}
|
|
515
|
+
await undo();
|
|
516
|
+
throw error;
|
|
517
|
+
}
|
|
518
|
+
// Committed: what is left over is harmless, so these never fail the import.
|
|
519
|
+
await rm(join(dir, "server.archive"), { force: true }).catch(() => { });
|
|
520
|
+
if (aside !== undefined)
|
|
521
|
+
await rm(aside, { recursive: true, force: true }).catch(() => { });
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
async deleteData(address, context) {
|
|
525
|
+
this.#workersOf(address);
|
|
526
|
+
const dir = workerDirectory(this.dataDir, address);
|
|
527
|
+
await this.#underLock(address, "deleteData", "runs; stop its worker first", context, async () => {
|
|
528
|
+
// The server's part first (the one commit); a crash before the directory goes leaves it orphaned (nothing
|
|
529
|
+
// refers to it) and a repeated `deleteData` removes it.
|
|
530
|
+
await this.host.deleteHostData(address, context);
|
|
531
|
+
await rm(dir, { recursive: true, force: true });
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
/** Runs `work` under the worker's lock of `address` (refused while its worker runs: `<what>: <key> <held>`). */
|
|
535
|
+
async #underLock(address, what, held, context, work) {
|
|
536
|
+
const lock = await this.#workerLock(address, context);
|
|
537
|
+
if (lock === undefined)
|
|
538
|
+
throw new Error(`${what}: ${address.key} ${held}`);
|
|
539
|
+
try {
|
|
540
|
+
await work();
|
|
541
|
+
}
|
|
542
|
+
finally {
|
|
543
|
+
await lock.release();
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
/** The process lock of the worker at `address` (the one its worker takes at start), or `undefined` while held. */
|
|
547
|
+
async #workerLock(address, context) {
|
|
548
|
+
const waited = AbortSignal.timeout(ADDRESS_LOCK_MS);
|
|
549
|
+
try {
|
|
550
|
+
return await processLock(workerLock(this.#options.name, this.dataDir, address.key), withAbortSignal(waited, context));
|
|
551
|
+
}
|
|
552
|
+
catch (error) {
|
|
553
|
+
if (waited.aborted)
|
|
554
|
+
return undefined;
|
|
555
|
+
throw error;
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
close(context) {
|
|
559
|
+
this.#closing ??= this.#close(context);
|
|
560
|
+
return this.#closing;
|
|
561
|
+
}
|
|
562
|
+
/** The workers of `address`'s kind. */
|
|
563
|
+
#workersOf(address) {
|
|
564
|
+
const workers = this.workers.get(address.kind);
|
|
565
|
+
if (workers === undefined)
|
|
566
|
+
throw new Error(`app: no worker kind "${address.kind}"`);
|
|
567
|
+
return workers;
|
|
568
|
+
}
|
|
569
|
+
/** The manifest of `address`'s archive. */
|
|
570
|
+
#manifest(address) {
|
|
571
|
+
const { name, api } = this.#options;
|
|
572
|
+
return {
|
|
573
|
+
format: ARCHIVE_FORMAT,
|
|
574
|
+
app: name,
|
|
575
|
+
api: api.versions[0] ?? "",
|
|
576
|
+
address: { kind: address.kind, key: address.key },
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
/** Whether the app is closing or closed: what runs after the start stops there. */
|
|
580
|
+
closing() {
|
|
581
|
+
return this.#closing !== undefined;
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* The close, in order: HTTP (it drains requests the host's close would seal), workers, host, store, the plugins'
|
|
585
|
+
* watcher, then the data directory's lock. The bases' builds and the recording of the base code are not waited for:
|
|
586
|
+
* what they finish after the close is dropped.
|
|
587
|
+
*/
|
|
588
|
+
async #close(context) {
|
|
589
|
+
await this.http.close(context);
|
|
590
|
+
for (const workers of this.workers.values())
|
|
591
|
+
await workers.close(context);
|
|
592
|
+
await this.host.close(context);
|
|
593
|
+
await this.#store.close(context);
|
|
594
|
+
this.#component.close();
|
|
595
|
+
await this.#lock.release();
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
//# sourceMappingURL=app.js.map
|