@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 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/node/app/app.ts"],"names":[],"mappings":"AAAA,2HAA2H;AAC3H,gHAAgH;AAChH,mHAAmH;AACnH,oHAAoH;AACpH,mHAAmH;AACnH,0FAA0F;AAC1F,qHAAqH;AACrH,4DAA4D;AAE5D,OA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): the server of an app built with the kit.\n// It lays out the data directory, opens the server's store, creates the server host, the HTTP component and one\n// workers component per worker kind, the plugins component over the app's required root and the user's root, loads\n// the server's plugins with the kit's own facets (the start-data object, sign-ins, the owner link, pairing, files),\n// and gives the app the controls it needs: the owner link, `applyChanges`, installs, export, import and delete per\n// address (the worker's data and the server's records and rows belonging to the address).\n// After the listen, off the start's path, it builds the bases (the surfaces' base bundles, each worker kind's worker\n// base) and records the base code the `base` mark compares.\n\nimport { randomUUID } from \"node:crypto\";\nimport { createReadStream, createWriteStream, statSync } from \"node:fs\";\nimport { mkdtemp, rename, rm } from \"node:fs/promises\";\nimport { dirname, join, resolve, sep } from \"node:path\";\nimport { pipeline } from \"node:stream/promises\";\nimport type { TelemetryContext } from \"@diffra-ai/telemetry\";\nimport { type Context, withAbortSignal } from \"../../context/index.ts\";\nimport { type Address, type HostKind, hostKind, type KindShape } from \"../../contracts/index.ts\";\nimport { isChordError, type Principal } from \"../../data/index.ts\";\nimport { principalKey, samePrincipal } from \"../../data/principal.ts\";\nimport { createHost, type Host, type HostError, type PluginFacet, type PrincipalAttributes } from \"../../host/index.ts\";\nimport { isJsonValue, type JsonValue } from \"../../json.ts\";\nimport { openNodeSqliteDatabase } from \"../../sqlite/node.ts\";\nimport { decodeJsonl, encodeJsonl, openStore, type Store, sqliteBackend } from \"../../store/index.ts\";\nimport { localeChoiceFacet, themeChoiceFacet, themesFacet, translationsFacet } from \"../../surfaces/index.ts\";\nimport { type TelemetryIngestTarget, telemetryIngestFacet } from \"../../telemetry-ingest/index.ts\";\nimport type { Watchable } from \"../../watch.ts\";\nimport { createHttp, type HttpComponent, type HttpError, type ListenAddress } from \"../http/index.ts\";\nimport {\n\ttype BaseInputs,\n\tcreatePlugins,\n\ttype HostPackages,\n\ttype InstallOptions,\n\ttype PluginSource,\n\ttype Plugins,\n\ttype PluginsError,\n\ttype PluginsState,\n\ttype RolloutResult,\n} from \"../plugins/index.ts\";\nimport {\n\tprocessConditions,\n\ttype SurfaceBuilt,\n\ttype TuiSurface,\n\ttype TuiSurfaceOptions,\n\ttuiSurface,\n\tWEB_PREFIX,\n\ttype WebRoutesOptions,\n\ttype WebSurface,\n\ttype WebSurfaceOptions,\n\twebSurface,\n} from \"../surfaces/index.ts\";\nimport {\n\tcreateWorkers,\n\tnodeBaseInputs,\n\ttype ProcessLock,\n\tprocessLock,\n\ttype Workers,\n\ttype WorkersBuilt,\n\ttype WorkersError,\n} from \"../workers/index.ts\";\nimport { ARCHIVE_FORMAT, type ArchiveManifest, exists, packData, unpackStaging } from \"./archive.ts\";\nimport { addressParam, HostData } from \"./data.ts\";\nimport { type FilesCaps, filesFacet } from \"./files.ts\";\nimport { appInfoFacet } from \"./info.ts\";\nimport { type AppLayout, createLayout, defaultDataDir, openDataDir, privateStore, workerDirectory } from \"./layout.ts\";\nimport { OWNER_PATH, OwnerLink, ownerFacet, ownerTokenFile } from \"./owner.ts\";\nimport { Pairings, pairingFacet } from \"./pairing.ts\";\nimport { secretFile } from \"./secrets.ts\";\nimport { createSignIns } from \"./sign-ins.ts\";\n\n/** The server's host kind: the kit's server host is `Server()`. */\nexport const Server = hostKind(\"server\");\n\n/**\n * The app's API (slice 12): its package name, the versions it provides (newest first) and this process's modules of\n * them by specifier (`@acme/app/v3`, `@acme/app/v3/server`).\n */\nexport type AppApi = {\n\treadonly name: string;\n\treadonly versions: readonly string[];\n\treadonly modules: HostPackages;\n};\n\n/**\n * A facet kind of the app: where its builds run, and the packages besides the API its plugins share (`react`). Its API\n * modules are named by convention: `<api>/<version>` and `<api>/<version>/<kind>` for every version.\n */\nexport type AppKind = { readonly platform: \"node\" | \"browser\"; readonly packages?: HostPackages };\n\n/** A worker kind: a host kind of the app and how its workers start (the workers component's options). */\nexport type AppWorkerKind<P extends Principal> = {\n\t/** The host kind (`hostKind(\"project\", { id: str() })`). */\n\treadonly kind: KindShape;\n\t/**\n\t * The worker's entry module (it calls `startWorker`), bundled with the base code it imports at start (every worker of\n\t * the kind runs that snapshot until the server restarts); its Node flags and environment.\n\t */\n\treadonly entry: string;\n\treadonly execArgv?: readonly string[];\n\treadonly env?: Readonly<Record<string, string>>;\n\t/** The facet kind its workers load: `worker` by default. */\n\treadonly facet?: string;\n\t/** The app's start data for the worker at `address` (JSON), before each start. */\n\treadonly start: (address: Address, context: Context) => Promise<JsonValue> | JsonValue;\n\t/** Whether `principal` may reach the worker at `address` (synchronous). */\n\treadonly authorize: (principal: P, address: Address) => boolean;\n\t/** How long a worker idles before it stops: 5 minutes by default. */\n\treadonly idleMs?: () => number;\n};\n\n/**\n * What the kit reports: from its host, its HTTP component, its workers or its plugins, a base that did not build after\n * the start (`base_build`: `base` is `web`, `tui` or the worker kind's name; the server runs on, the page answers 503,\n * the kind's workers fail their start), or a failed scan of the server's own code (`server_scan`: the server runs on,\n * that code is not compared).\n */\nexport type AppError =\n\t| { readonly kind: \"host\"; readonly error: HostError }\n\t| { readonly kind: \"http\"; readonly error: HttpError }\n\t| { readonly kind: \"workers\"; readonly error: WorkersError }\n\t| { readonly kind: \"plugins\"; readonly error: PluginsError }\n\t| { readonly kind: \"base_build\"; readonly base: string; readonly error: unknown }\n\t| { readonly kind: \"server_scan\"; readonly error: unknown };\n\n/**\n * What `startServer` takes. Worker kinds need `principal.worker`: a type error without it, also for a `workers` list\n * typed as an array (not a tuple) that is empty.\n */\nexport type AppOptions<P extends Principal> = {\n\t/** The app's name: its default data directory is `~/.<name>`, its archives carry it. */\n\treadonly name: string;\n\t/** The data directory (the start script's to decide; no environment variables): `~/.<name>` by default. */\n\treadonly dataDir?: string;\n\t/** The app's built-in plugins root (required): `plugins/` of the working directory by default. */\n\treadonly root?: string;\n\t/** Where the server listens: `127.0.0.1`, a free port by default. */\n\treadonly listen?: ListenAddress;\n\treadonly api: AppApi;\n\t/** The app's facet kinds: `server` and each worker kind's facet kind among them. */\n\treadonly kinds: Readonly<Record<string, AppKind>>;\n\t/**\n\t * The server's principal, each worker's (stamped on its link; only with worker kinds) and the owner's: whom the owner\n\t * link, the owner token file and device pairing sign in, and who approves pairings and makes invites (`AppInfo.owner`).\n\t * The owner must be strict JSON and not the server's principal (refused at start).\n\t */\n\treadonly principal: { readonly server: P; readonly worker?: (address: Address) => P; readonly owner: P };\n\t/** The worker kinds; none: a server with clients only. */\n\treadonly workers?: readonly AppWorkerKind<P>[];\n\t/** The caps of each host's files (the server's and every worker's). */\n\treadonly files?: FilesCaps;\n\t/** The bounds of what public endpoints and imports may cost. */\n\treadonly limits?: AppLimits;\n\t/** How installs run npm (slice 12's `InstallOptions`): `npm` on the `PATH` by default. */\n\treadonly install?: InstallOptions;\n\t/**\n\t * The web surface (slice 11): the app's web entry (the base bundle's), its page template, the paths serving the\n\t * page (`[\"/\"]`), whether the page is public, the conditions its packages resolve with (the server process's by\n\t * default); the `web` facet kind. None: no web surface.\n\t */\n\treadonly web?: AppWeb;\n\t/**\n\t * The terminal surface (slice 11): the app's terminal entry and the conditions its packages resolve with (the server\n\t * process's by default); the `tui` facet kind. None: no terminal clients.\n\t */\n\treadonly tui?: Pick<TuiSurfaceOptions, \"entry\" | \"conditions\">;\n\t/**\n\t * The app's telemetry store (§29; decision \"The server is the one place telemetry is stored\"): the server's host,\n\t * its HTTP requests and the kit's ingest record to it (`createSqliteTelemetry`'s store). With one, every worker\n\t * records in memory and sends its spans and metrics to the server's `WorkerTelemetry`, and pages that record\n\t * (`startPage({ telemetry: true })`) theirs to `PageTelemetry`; carriers join them into one trace. None: NOOP.\n\t */\n\treadonly telemetry?: TelemetryContext & TelemetryIngestTarget;\n\t/**\n\t * Who a span was for (`createHost`'s `principalAttributes`): the server's hook, also stamped on the spans pages\n\t * send (the principal of their link). Each worker's is its `startWorker`'s.\n\t */\n\treadonly principalAttributes?: PrincipalAttributes<P>;\n\t/**\n\t * The app's base code beside what the kit knows (files or directories: its API modules, its start script), hashed at\n\t * start: `plugins.state.base` is true while a file differs from what the server or a base bundle read (or a source\n\t * file is new in one of the directories). The kit adds every file its base bundles were built from, with the bytes\n\t * they read: the web's, the terminal's and each worker kind's.\n\t */\n\treadonly base?: readonly string[];\n\t/**\n\t * The `closeTimeout`, `readyTimeout` and `reloadDrainTimeout` of every host (the server's and each worker's): 30 s,\n\t * 60 s and 5 s by default.\n\t */\n\treadonly timeouts?: AppTimeouts;\n\treadonly onError: (error: AppError) => void;\n} & ({ readonly workers?: readonly [] } | { readonly principal: { readonly worker: (address: Address) => P } });\n\n/**\n * The bounds of what public endpoints, clients and imports may cost: live ephemeral sign-ins (1,000; past it the\n * oldest ends, signed out), pairings under way that anonymous clients started (100 in all, 10 per client address; past\n * them 429; the owner's own are not counted), uploads under way per `Files` object (64; past it `unavailable`, `busy`),\n * an archive's unpacked bytes (4 GiB) and entries (100,000).\n */\nexport type AppLimits = {\n\treadonly uploads?: number;\n\treadonly ephemeralSignIns?: number;\n\treadonly pendingPairings?: number;\n\treadonly pairingsPerAddress?: number;\n\treadonly importBytes?: number;\n\treadonly importEntries?: number;\n};\n\n/**\n * The hosts' timeouts in milliseconds (`HostOptions.closeTimeout`, `HostOptions.readyTimeout`,\n * `HostOptions.reloadDrainTimeout`).\n */\nexport type AppTimeouts = {\n\treadonly closeTimeout?: number;\n\treadonly readyTimeout?: number;\n\treadonly reloadDrainTimeout?: number;\n};\n\n/** The kit's web surface options (`webSurface`'s, its kind `web` and plugins the kit's). */\nexport type AppWeb = Pick<WebSurfaceOptions, \"entry\" | \"conditions\"> & Omit<WebRoutesOptions, \"routes\">;\n\n/** The plugins of a running app, for its \"apply changes\" control and its installs. */\nexport type AppPlugins = {\n\t/** The marks (`dirty`, `install`, `set`, `base`): what the app's button shows. */\n\treadonly state: Watchable<PluginsState>;\n\t/** Installs plugins from git or npm into the user's root (slice 12's `installPlugin`); their names. */\n\tinstall(source: PluginSource, context: Context): Promise<readonly string[]>;\n\t/** The plugins component itself. */\n\treadonly component: Plugins;\n};\n\n/** A running app. */\nexport interface App<P extends Principal> {\n\treadonly host: Host<P>;\n\treadonly http: HttpComponent<P>;\n\t/** The workers components, by host kind name. */\n\treadonly workers: ReadonlyMap<string, Workers<HostKind>>;\n\treadonly plugins: AppPlugins;\n\t/**\n\t * The web surface, when the app has one: its base bundle's hash once built (`basesBuilt`); `undefined` before, and\n\t * when its build failed.\n\t */\n\treadonly web: { readonly base: string | undefined } | undefined;\n\t/** The terminal surface, when the app has one: its base bundle's hash, as `web`'s. */\n\treadonly tui: { readonly base: string | undefined } | undefined;\n\t/** The data directory. */\n\treadonly dataDir: string;\n\t/** The owner link of this start (single use, 10 minutes): `http://127.0.0.1:<port>/_chord/owner#<token>`. */\n\townerLink(): string;\n\t/** The owner token file's path (a device sign-in of the owner, mode 0600). */\n\treadonly ownerTokenFile: string;\n\t/**\n\t * Settles once every base (the web and terminal base bundles, each worker kind's worker base) was built after the\n\t * start, or failed (reported, `base_build`). Never rejects.\n\t */\n\treadonly basesBuilt: Promise<void>;\n\t/**\n\t * Settles once the base code is recorded, watched and compared once, after the start: the bases' records (after\n\t * `basesBuilt`) and the scan of the server's own code. Until then `plugins.state.base` is not known (`false` may\n\t * mean \"not compared yet\"); a file of the server's own code changed since the process started marks it until a\n\t * restart (Node may have loaded other bytes than the scan read).\n\t */\n\treadonly baseWatched: Promise<void>;\n\t/**\n\t * Builds the dirty plugins and rolls them out: the server, every worker kind, then the clients; never by itself. Calls\n\t * run one after another (a later one builds after the earlier one rolled out).\n\t */\n\tapplyChanges(context: Context): Promise<RolloutResult>;\n\t/**\n\t * Writes the data of the worker at `address` (its store and finished files, and the server's records and rows\n\t * belonging to the address) as an archive at `path`, stopping nothing: a running worker packs its own store at one\n\t * consistent point; without one the server packs it under the worker's lock (no worker starts meanwhile).\n\t */\n\texportData(address: Address, path: string, context: Context): Promise<void>;\n\t/**\n\t * Makes the data of `address` from the archive at `archive` (an archive of an address of its kind; another address\n\t * is a copy: the server's host cells and keys are rewritten), under the worker's lock; its next hold starts it. An\n\t * address with data (a directory, server records or rows) is refused, unless `options.existing` is `\"replace\"`:\n\t * then its data is replaced. A refused or definitely failed import is undone (the old directory back, nothing new\n\t * left); one whose server commit has an unknown outcome (`storage_failed`) undoes nothing: the new directory stays in\n\t * place and the old one aside, and the rejection says so.\n\t */\n\timportData(archive: string, address: Address, context: Context, options?: DataImportOptions): Promise<void>;\n\t/**\n\t * Deletes the data of `address` (its worker's directory and the server's records and rows belonging to it) under\n\t * the worker's lock; refused while its worker runs.\n\t */\n\tdeleteData(address: Address, context: Context): Promise<void>;\n\t/** Closes the HTTP component, the workers, the host, the store, the watcher and the data directory's lock. */\n\tclose(context: Context): Promise<void>;\n}\n\n/** What `importData` takes besides the archive and the address. */\nexport type DataImportOptions = {\n\t/** What happens when the address has data: refused (the default), or replaced. */\n\treadonly existing?: \"refuse\" | \"replace\";\n};\n\n/** What `startWorker` reads from its start data besides the app's: the kit's part. */\nexport type KitStart = {\n\treadonly dir: string;\n\treadonly facet: string;\n\treadonly principal: JsonValue;\n\treadonly server: JsonValue;\n\treadonly files: { readonly maxFile?: number; readonly maxTotal?: number };\n\t/** Whether the server has a telemetry store: the worker then sends what it records to `WorkerTelemetry`. */\n\treadonly telemetry: boolean;\n\t/** The cap of uploads under way per `Files` object (`limits.uploads`). */\n\treadonly uploads?: number;\n\t/** The app's host timeouts (`timeouts`), the worker's host takes them too. */\n\treadonly timeouts: AppTimeouts;\n};\n\n/**\n * Starts the app's server (§1): resolves once its plugins are loaded and it listens. A failing plugin of the app's\n * root (or a problem discovery reports there) rejects with the plugins component's `PluginError`, everything closed.\n * The bases are built right after the listen, from the files as they are then (`basesBuilt`): a page request waits\n * for its surface's, a worker start for its kind's.\n */\nexport async function startServer<P extends Principal>(options: AppOptions<P>, context: Context): Promise<App<P>> {\n\tcheckOwner(options.principal.owner, options.principal.server, context);\n\tconst { layout, cookieSecret, store, lock } = await openServer(\n\t\tresolve(options.dataDir ?? defaultDataDir(options.name)),\n\t\tcontext,\n\t);\n\tconst { onError, api, limits = {} } = options;\n\tconst signIns = createSignIns<P>(cookieSecret, { maxEphemeral: limits.ephemeralSignIns });\n\tconst { telemetry, principalAttributes } = options;\n\tconst host = createHost<P>({\n\t\taddress: Server(),\n\t\tprincipal: options.principal.server,\n\t\tstore,\n\t\ttelemetry,\n\t\t...(principalAttributes === undefined ? {} : { principalAttributes }),\n\t\t...options.timeouts,\n\t\tonError: (error) => onError({ kind: \"host\", error }),\n\t});\n\tconst http = createHttp(\n\t\thost,\n\t\t{\n\t\t\tlisten: options.listen ?? { host: \"127.0.0.1\", port: 0 },\n\t\t\tlinks: { path: \"/chord\", opened: signIns.opened },\n\t\t\ttelemetry,\n\t\t\tonError: (error) => onError({ kind: \"http\", error }),\n\t\t},\n\t\tcontext,\n\t);\n\tconst plugins = createPlugins(\n\t\t{\n\t\t\troots: [{ path: resolve(options.root ?? \"plugins\"), required: true }, layout.plugins],\n\t\t\tapi: { name: api.name, versions: api.versions },\n\t\t\tkinds: Object.fromEntries(\n\t\t\t\tObject.entries(options.kinds).map(([name, kind]) => [\n\t\t\t\t\tname,\n\t\t\t\t\t{ platform: kind.platform, hostPackages: hostPackagesOf(api, name, kind) },\n\t\t\t\t]),\n\t\t\t),\n\t\t\tinstall: options.install,\n\t\t\t// The server's own base code, hashed now; each base bundle's record is added once built (`watchBase`).\n\t\t\tbase: (options.base ?? []).map((path) => resolve(path)),\n\t\t\tpublicPath: `${WEB_PREFIX}assets/`,\n\t\t\tonError: (error) => onError({ kind: \"plugins\", error }),\n\t\t},\n\t\tcontext,\n\t);\n\tconst workers = new Map<string, Workers<HostKind>>();\n\t// The address key of each worker by its principal's key: the principal its link stamps on its telemetry batches.\n\tconst workerHosts = new Map<string, string>();\n\tconst link = new OwnerLink();\n\tconst { owner } = options.principal;\n\tconst core: PluginFacet<P>[] = [\n\t\t{ name: \"chord.http\", facet: http.facet },\n\t\t{\n\t\t\tname: \"chord.app.info\",\n\t\t\tfacet: appInfoFacet({ dataDir: layout.dataDir, name: options.name, version: api.versions[0] ?? \"\", owner }),\n\t\t},\n\t\t{ name: \"chord.app.sign-ins\", facet: signIns.facet },\n\t\t{ name: \"chord.app.owner\", facet: ownerFacet(link, owner) },\n\t\t{\n\t\t\tname: \"chord.app.pairing\",\n\t\t\tfacet: pairingFacet(\n\t\t\t\tnew Pairings({ maxPending: limits.pendingPairings, perAddress: limits.pairingsPerAddress }),\n\t\t\t\towner,\n\t\t\t),\n\t\t},\n\t\t{ name: \"chord.app.files\", facet: filesFacet(join(layout.server, \"files\"), options.files, limits.uploads) },\n\t\t{ name: \"chord.themes\", facet: themesFacet() },\n\t\t{ name: \"chord.themes.choice\", facet: themeChoiceFacet() },\n\t\t{ name: \"chord.translations\", facet: translationsFacet() },\n\t\t{ name: \"chord.locale.choice\", facet: localeChoiceFacet() },\n\t];\n\tif (telemetry !== undefined) {\n\t\tconst facet = telemetryIngestFacet<P>({\n\t\t\ttarget: telemetry,\n\t\t\t// Every link of the kit's server is signed in: its pages are the app's own people's.\n\t\t\tadmit: () => true,\n\t\t\tworkerHost: (principal) => workerHosts.get(principalKey(principal, context)),\n\t\t\tprincipalAttributes: (principal) => host.principalAttributes(principal, context),\n\t\t});\n\t\tcore.push({ name: \"chord.telemetry\", facet });\n\t}\n\tconst surfaces: Surface<P>[] = [];\n\tconst app = new RunningApp(host, http, workers, plugins, surfaces, { store, lock }, layout, options);\n\t// What runs after the start reports nothing once the app closes (a build or scan finishing late).\n\tconst report = (error: AppError): void => {\n\t\tif (!app.closing()) onError(error);\n\t};\n\ttry {\n\t\tfor (const kind of options.workers ?? []) {\n\t\t\tworkers.set(kind.kind.kind, workersOf(host, store, kind, options, layout, plugins, workerHosts, context));\n\t\t}\n\t\tfor (const surface of surfacesOf(host, options, plugins)) {\n\t\t\tsurfaces.push(surface);\n\t\t\tcore.push({ name: `chord.${surface.name}`, facet: surface.surface.facet });\n\t\t}\n\t\tawait plugins.load(host, { kind: \"server\", core, modules: modulesOf(api, options.kinds.server) }, context);\n\t\tawait ownerTokenFile(layout.ownerToken, owner, host, context);\n\t\tconst listening = await http.listening(context);\n\t\tconst bases = [\n\t\t\t...surfaces.map(({ name, surface }) => ({ name, build: () => surface.build() })),\n\t\t\t...[...workers].map(([name, each]) => ({ name, build: () => each.build() })),\n\t\t];\n\t\tconst compared: Promise<void>[] = [];\n\t\tconst built = buildBases(bases, plugins, compared, report, () => app.closing());\n\t\tconst watching = watchBaseCode(plugins, built, compared, report, () => app.closing());\n\t\tapp.started(link.renew(), listening, built, watching);\n\t} catch (error) {\n\t\tawait app.close(context);\n\t\tthrow error;\n\t}\n\treturn app;\n}\n\n/**\n * Refuses an owner the kit could not recognize or that would act as the server (a declaration policy the types cannot\n * express): sign-ins keep the owner as JSON, so a field `undefined` (or anything else not strict JSON) would never\n * match it again; the server's principal reaches every worker's kit objects.\n */\nfunction checkOwner<P extends Principal>(owner: P, server: P, context: Context): void {\n\tif (!isJsonValue(owner)) {\n\t\tthrow new Error(\n\t\t\t\"startServer: principal.owner must be strict JSON (no undefined fields, functions or class instances)\",\n\t\t);\n\t}\n\tif (samePrincipal(owner, server, context)) {\n\t\tthrow new Error(\"startServer: principal.owner must not be the server's principal\");\n\t}\n}\n\n/** A base the kit builds after the listen: its name in reports, its build. */\ntype Base = { readonly name: string; build(): Promise<SurfaceBuilt | WorkersBuilt> };\n\n/**\n * Builds every base right after the listen, at once, from the files as they are now (owner decision \"A\": nothing is\n * kept between starts; the server answers meanwhile, each request needing a base waits for it). A built base's record\n * is added to what `plugins` compares (its first comparisons pushed to `compared`); a failed one is reported\n * (`base_build`) and the server runs on. Settles once every build ended; what ends after the close is dropped.\n */\nasync function buildBases(\n\tbases: readonly Base[],\n\tplugins: Plugins,\n\tcompared: Promise<void>[],\n\treport: (error: AppError) => void,\n\tclosed: () => boolean,\n): Promise<void> {\n\tawait Promise.all(\n\t\tbases.map(async ({ name, build }) => {\n\t\t\tconst built = await build();\n\t\t\tif (closed()) return;\n\t\t\tif (built.kind === \"failed\") report({ kind: \"base_build\", base: name, error: built.error });\n\t\t\telse compared.push(plugins.watchBase(built.inputs));\n\t\t}),\n\t);\n}\n\n/**\n * Adds the server's own code to what `plugins` compares, once the bases are built (`built`; the scan's reads would\n * contend with the builds the first requests wait for): the static graph of its entry (the start script;\n * `nodeBaseInputs`; a file changed since the process started is recorded as differing, `editedSinceStart`). Best\n * effort: a failed scan is reported (`server_scan`) and that code not compared. An entry under `node_modules` is\n * installed code (an npm-installed app, a test runner), never compared. Settles once every record's first comparison\n * did (the bases' in `compared` too: `base` knows them all). A close meanwhile ends it at its next step; a scan stalled\n * on a read keeps it pending until the read ends (the close does not wait for it; its result is dropped).\n */\nasync function watchBaseCode(\n\tplugins: Plugins,\n\tbuilt: Promise<void>,\n\tcompared: Promise<void>[],\n\treport: (error: AppError) => void,\n\tclosed: () => boolean,\n): Promise<void> {\n\tawait built;\n\tif (closed()) return;\n\tconst entry = process.argv[1];\n\tif (entry !== undefined && !entry.split(sep).includes(\"node_modules\")) {\n\t\tconst conditions = processConditions(process.execArgv, process.env.NODE_OPTIONS);\n\t\tconst scanned = await nodeBaseInputs(entry, conditions).then(\n\t\t\t(inputs) => inputs,\n\t\t\t(error: unknown) => report({ kind: \"server_scan\", error }),\n\t\t);\n\t\tif (closed()) return;\n\t\tif (scanned !== undefined) compared.push(plugins.watchBase(editedSinceStart(scanned)));\n\t}\n\tawait Promise.all(compared);\n}\n\n/** What the scan records for a file changed since the process started: a hash no bytes have. */\nconst EDITED_SINCE_START = \"changed since the server started\";\n\n/** How far in the future a file's timestamp may be and still count as an edit since the start: clock skew. */\nconst FUTURE_SLACK_MS = 5_000;\n\n/**\n * The scan's record `inputs` with every file changed since this process started (its mtime or ctime after\n * `performance.timeOrigin`) recorded as differing: Node may have loaded other bytes than the scan read, so its first\n * comparison marks `base` (until a restart: the bytes Node loaded are unknown). Conservative: an edit Node loaded\n * anyway (made during the module loading, before the file was read) or a change of metadata only (ctime) marks too.\n * Per timestamp: one later than now (plus `FUTURE_SLACK_MS`) is no edit since the start (a file stamped in the future,\n * by a skewed clock or an archive, would mark every start until that time); a file neither of whose timestamps is in\n * range keeps its hash, compared by content alone.\n */\nfunction editedSinceStart(inputs: BaseInputs): BaseInputs {\n\tconst started = performance.timeOrigin;\n\tconst latest = Date.now() + FUTURE_SLACK_MS;\n\treturn new Map(\n\t\t[...inputs].map(([path, hash]) => {\n\t\t\ttry {\n\t\t\t\tconst { mtimeMs, ctimeMs } = statSync(path);\n\t\t\t\tconst edited = [mtimeMs, ctimeMs].some((time) => time > started && time <= latest);\n\t\t\t\treturn [path, edited ? EDITED_SINCE_START : hash];\n\t\t\t} catch {\n\t\t\t\t// Gone: its first comparison finds it so.\n\t\t\t\treturn [path, hash];\n\t\t\t}\n\t\t}),\n\t);\n}\n\n/** A client surface of the app and its name (`web`, `tui`). */\ntype Surface<P extends Principal> = { readonly name: \"web\" | \"tui\"; readonly surface: WebSurface<P> | TuiSurface<P> };\n\n/** The app's client surfaces, in order: the web's, the terminal's (their base bundles built after the listen). */\nfunction surfacesOf<P extends Principal>(host: Host<P>, options: AppOptions<P>, plugins: Plugins): Surface<P>[] {\n\tconst surfaces: Surface<P>[] = [];\n\tif (options.web !== undefined)\n\t\tsurfaces.push({ name: \"web\", surface: webSurface(host, { ...options.web, plugins }) });\n\tif (options.tui !== undefined)\n\t\tsurfaces.push({ name: \"tui\", surface: tuiSurface(host, { ...options.tui, plugins }) });\n\treturn surfaces;\n}\n\n/** How long a second server waits for the data directory's lock before it is refused. */\nconst SERVER_LOCK_MS = 1000;\n\n/**\n * The server's own part of the data directory `path`: its lock (one server per data directory, by its real path: a\n * second one, also through a symbolic link, would share its stores and secrets), the layout made private, the cookie\n * secret and the server's store; the lock released when the rest fails.\n */\nasync function openServer(\n\tpath: string,\n\tcontext: Context,\n): Promise<{ layout: AppLayout; cookieSecret: string; store: Store; lock: ProcessLock }> {\n\tconst dataDir = await openDataDir(path);\n\tconst waited = AbortSignal.timeout(SERVER_LOCK_MS);\n\tconst lock = await processLock(`chord-app:${dataDir}`, withAbortSignal(waited, context)).catch((error: unknown) => {\n\t\tthrow waited.aborted ? new Error(`startServer: another server runs on ${dataDir}`) : error;\n\t});\n\ttry {\n\t\tconst layout = await createLayout(dataDir);\n\t\tconst cookieSecret = await secretFile(layout.cookieSecret);\n\t\tawait privateStore(layout.serverStore);\n\t\tconst store = await openStore(sqliteBackend(await openNodeSqliteDatabase(layout.serverStore)), context);\n\t\treturn { layout, cookieSecret, store, lock };\n\t} catch (error) {\n\t\tawait lock.release();\n\t\tthrow error;\n\t}\n}\n\n/** The host packages of kind `name`: the API's shared and per-kind module of every version, and its packages. */\nfunction hostPackagesOf(api: AppApi, name: string, kind: AppKind): string[] {\n\tconst modules = api.versions.flatMap((version) => [`${api.name}/${version}`, `${api.name}/${version}/${name}`]);\n\treturn [...modules, ...Object.keys(kind.packages ?? {})];\n}\n\n/** This process's modules for a kind: the API's and the kind's packages. */\nfunction modulesOf(api: AppApi, kind: AppKind | undefined): HostPackages {\n\treturn { ...api.modules, ...kind?.packages };\n}\n\n/**\n * The workers component of one worker kind (its base built after the listen, into the kind's directory under\n * `cache/workers/`): started with the kit's part of the start data beside the app's.\n */\nfunction workersOf<P extends Principal>(\n\thost: Host<P>,\n\tstore: Store,\n\tkind: AppWorkerKind<P>,\n\toptions: AppOptions<P>,\n\tlayout: AppLayout,\n\tplugins: Plugins,\n\tworkerHosts: Map<string, string>,\n\tcontext: Context,\n): Workers<HostKind> {\n\tconst { dataDir } = layout;\n\tconst facet = kind.facet ?? \"worker\";\n\t// `AppOptions` admits worker kinds only with `principal.worker`.\n\tconst worker = options.principal.worker as (address: Address) => P;\n\tconst { server } = options.principal;\n\treturn createWorkers(\n\t\thost,\n\t\t// A host kind of the app: any params; its addresses come back from its route as the kit hands them on.\n\t\tkind.kind as HostKind,\n\t\t{\n\t\t\tkind: facet,\n\t\t\tentry: kind.entry,\n\t\t\t...(kind.execArgv === undefined ? {} : { execArgv: kind.execArgv }),\n\t\t\t...(kind.env === undefined ? {} : { env: kind.env }),\n\t\t\tbaseDir: join(layout.workerBases, kind.kind.kind),\n\t\t\tcompileCache: layout.compileCache,\n\t\t\t// The server's: a worker's exit is published after the commits its calls queued there.\n\t\t\tstore,\n\t\t\t// The server reaches its workers' kit objects (`HostData`) whatever the app admits.\n\t\t\tauthorize: (principal, address) =>\n\t\t\t\tsamePrincipal(principal, server, context) || kind.authorize(principal, address),\n\t\t\tprincipal: worker,\n\t\t\tstart: async (address, ctx) => {\n\t\t\t\tconst principal = worker(address);\n\t\t\t\tworkerHosts.set(principalKey(principal, ctx), address.key);\n\t\t\t\tconst kit: KitStart = {\n\t\t\t\t\tdir: workerDirectory(dataDir, address),\n\t\t\t\t\tfacet,\n\t\t\t\t\t// Principals are JSON (they cross links).\n\t\t\t\t\tprincipal: principal as unknown as JsonValue,\n\t\t\t\t\tserver: server as unknown as JsonValue,\n\t\t\t\t\tfiles: { ...options.files },\n\t\t\t\t\ttelemetry: options.telemetry !== undefined,\n\t\t\t\t\t...(options.limits?.uploads === undefined ? {} : { uploads: options.limits.uploads }),\n\t\t\t\t\ttimeouts: { ...options.timeouts },\n\t\t\t\t};\n\t\t\t\treturn { kit, app: await kind.start(address, ctx) };\n\t\t\t},\n\t\t\tlock: (address) => workerLock(options.name, dataDir, address.key),\n\t\t\t...(kind.idleMs === undefined ? {} : { idleMs: kind.idleMs }),\n\t\t\tplugins,\n\t\t\tonError: (error) => options.onError({ kind: \"workers\", error }),\n\t\t},\n\t\tcontext,\n\t);\n}\n\n/**\n * Whether a host data commit's rejection leaves its outcome unknown: the store stopped after or during `COMMIT`\n * (`unavailable/storage_failed`), so the commit may stand.\n */\nfunction unknownOutcome(error: unknown): boolean {\n\treturn isChordError(error) && error.code === \"unavailable\" && error.reason === \"storage_failed\";\n}\n\n/** The process lock of the worker at `address`: its worker holds it while it runs, an export or import meanwhile. */\nfunction workerLock(name: string, dataDir: string, key: string): string {\n\treturn `${name}:${dataDir}:${key}`;\n}\n\n/** How long an export or import waits for a worker's lock: past it a worker holds it (it runs or starts). */\nconst ADDRESS_LOCK_MS = 2000;\n\n/** The host of the owner link for the address listened on: loopback for a wildcard, an IPv6 address in brackets. */\nfunction linkHost(host: string): string {\n\tif (host === \"0.0.0.0\" || host === \"\") return \"127.0.0.1\";\n\tif (host === \"::\") return \"[::1]\";\n\treturn host.includes(\":\") ? `[${host}]` : host;\n}\n\nclass RunningApp<P extends Principal> implements App<P> {\n\treadonly host: Host<P>;\n\treadonly http: HttpComponent<P>;\n\treadonly workers: ReadonlyMap<string, Workers<HostKind>>;\n\treadonly plugins: AppPlugins;\n\treadonly dataDir: string;\n\treadonly ownerTokenFile: string;\n\treadonly #component: Plugins;\n\t/** The client surfaces, filled before the server's load. */\n\treadonly #surfaces: readonly Surface<P>[];\n\treadonly #store: Store;\n\treadonly #lock: ProcessLock;\n\treadonly #options: AppOptions<P>;\n\t#link = \"\";\n\t/** The bases' builds after the start (`buildBases`). */\n\t#building: Promise<void> = Promise.resolve();\n\t/** The recording of the base code after the start (`watchBaseCode`). */\n\t#scanning: Promise<void> = Promise.resolve();\n\t#closing: Promise<void> | undefined;\n\t/** The latest `applyChanges`, settled to nothing: the next one starts after it. */\n\t#applying: Promise<void> = Promise.resolve();\n\n\tconstructor(\n\t\thost: Host<P>,\n\t\thttp: HttpComponent<P>,\n\t\tworkers: ReadonlyMap<string, Workers<HostKind>>,\n\t\tplugins: Plugins,\n\t\tsurfaces: readonly Surface<P>[],\n\t\tserver: { readonly store: Store; readonly lock: ProcessLock },\n\t\tlayout: { readonly dataDir: string; readonly plugins: string; readonly ownerToken: string },\n\t\toptions: AppOptions<P>,\n\t) {\n\t\tthis.host = host;\n\t\tthis.http = http;\n\t\tthis.workers = workers;\n\t\tthis.#component = plugins;\n\t\tthis.#surfaces = surfaces;\n\t\tthis.#store = server.store;\n\t\tthis.#lock = server.lock;\n\t\tthis.#options = options;\n\t\tthis.dataDir = layout.dataDir;\n\t\tthis.ownerTokenFile = layout.ownerToken;\n\t\tthis.plugins = {\n\t\t\tstate: plugins.state,\n\t\t\tinstall: (source, context) => plugins.installPlugin(source, layout.plugins, context),\n\t\t\tcomponent: plugins,\n\t\t};\n\t}\n\n\t/**\n\t * The start finished: the owner link's token and the address it names (the one listened on), the bases' builds and\n\t * the recording of the base code under way (`basesBuilt`, `baseWatched`).\n\t */\n\tstarted(token: string, listening: ListenAddress, building: Promise<void>, scanning: Promise<void>): void {\n\t\tthis.#link = `http://${linkHost(listening.host)}:${listening.port}${OWNER_PATH}#${token}`;\n\t\tthis.#building = building;\n\t\tthis.#scanning = scanning;\n\t}\n\n\townerLink(): string {\n\t\treturn this.#link;\n\t}\n\n\tget basesBuilt(): Promise<void> {\n\t\treturn this.#building;\n\t}\n\n\tget baseWatched(): Promise<void> {\n\t\treturn this.#scanning;\n\t}\n\n\tget web(): { readonly base: string | undefined } | undefined {\n\t\treturn this.#surfaceBase(\"web\");\n\t}\n\n\tget tui(): { readonly base: string | undefined } | undefined {\n\t\treturn this.#surfaceBase(\"tui\");\n\t}\n\n\t/** The surface `name`'s base hash once built, when the app has that surface. */\n\t#surfaceBase(name: \"web\" | \"tui\"): { readonly base: string | undefined } | undefined {\n\t\tconst found = this.#surfaces.find((each) => each.name === name);\n\t\tif (found === undefined) return undefined;\n\t\tconst { built } = found.surface;\n\t\treturn { base: built?.kind === \"built\" ? built.base : undefined };\n\t}\n\n\tapplyChanges(context: Context): Promise<RolloutResult> {\n\t\t// One build and rollout at a time: a later build rolled out before an earlier one would leave the older code\n\t\t// deployed (each host applies the last set it is handed).\n\t\tconst applied = this.#applying.then(() => this.#applyChanges(context));\n\t\tthis.#applying = applied.then(\n\t\t\t() => {},\n\t\t\t() => {},\n\t\t);\n\t\treturn applied;\n\t}\n\n\t/** One build of the dirty plugins and its rollout: the server, every worker kind, then the clients. */\n\tasync #applyChanges(context: Context): Promise<RolloutResult> {\n\t\tconst plugins = this.#component;\n\t\tconst built = await plugins.build(plugins.state.value.dirty, context);\n\t\tconst steps = [\n\t\t\tplugins.step(\"server\", this.host),\n\t\t\t...[...this.workers].map(([name, each]) => each.step(name)),\n\t\t\t...this.#surfaces.map(({ name, surface }) => surface.step(name)),\n\t\t];\n\t\treturn plugins.rollout(steps, built, context);\n\t}\n\n\tasync exportData(address: Address, path: string, context: Context): Promise<void> {\n\t\tconst workers = this.#workersOf(address);\n\t\tconst manifest = this.#manifest(address);\n\t\tconst target = resolve(path);\n\t\t// The server's part first, staged beside the archive: the worker or `packData` packs it with the rest.\n\t\tconst staging = await mkdtemp(join(dirname(target), \".chord-server-\"));\n\t\tconst server = join(staging, \"server.archive\");\n\t\ttry {\n\t\t\tconst parts = encodeJsonl(this.host.exportHostData(address, context));\n\t\t\tawait pipeline(parts, createWriteStream(server, { mode: 0o600 }));\n\t\t\tawait this.#exportWorker(workers, address, manifest, server, target, context);\n\t\t} finally {\n\t\t\tawait rm(staging, { recursive: true, force: true });\n\t\t}\n\t}\n\n\t/** Packs the worker's data with the server's part `server` at `target`, by the running worker or under its lock. */\n\tasync #exportWorker(\n\t\tworkers: Workers<HostKind>,\n\t\taddress: Address,\n\t\tmanifest: ArchiveManifest,\n\t\tserver: string,\n\t\ttarget: string,\n\t\tcontext: Context,\n\t): Promise<void> {\n\t\t// Running: the worker packs its own store. Else the lock, unless a worker starts first: then ask it.\n\t\tfor (let attempt = 1; ; attempt++) {\n\t\t\tif (workers.state.value[address.key]?.status === \"running\") {\n\t\t\t\tconst data = await this.host.get(HostData, { address: addressParam(address) }, context);\n\t\t\t\ttry {\n\t\t\t\t\tawait data.exportTo({ path: target, manifest: JSON.stringify(manifest), server }, context);\n\t\t\t\t} finally {\n\t\t\t\t\tdata.release();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst lock = await this.#workerLock(address, context);\n\t\t\tif (lock !== undefined) {\n\t\t\t\ttry {\n\t\t\t\t\tawait packData(workerDirectory(this.dataDir, address), manifest, server, target, context);\n\t\t\t\t} finally {\n\t\t\t\t\tawait lock.release();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (attempt === 5) throw new Error(`exportData: the worker at ${address.key} keeps starting; try again`);\n\t\t}\n\t}\n\n\tasync importData(\n\t\tarchive: string,\n\t\taddress: Address,\n\t\tcontext: Context,\n\t\toptions: DataImportOptions = {},\n\t): Promise<void> {\n\t\tthis.#workersOf(address);\n\t\tconst { name, limits = {} } = this.#options;\n\t\tconst existing = options.existing ?? \"refuse\";\n\t\tconst accept = (manifest: ArchiveManifest): void => {\n\t\t\t// A trust boundary: an archive from anywhere.\n\t\t\tif (manifest?.format !== ARCHIVE_FORMAT) throw new Error(`importData: not a format ${ARCHIVE_FORMAT} archive`);\n\t\t\tif (manifest.app !== name) throw new Error(`importData: an archive of \"${manifest.app}\", not \"${name}\"`);\n\t\t\tif (manifest.address?.kind !== address.kind) {\n\t\t\t\tthrow new Error(`importData: an archive of a ${String(manifest.address?.kind)}, not a ${address.kind}`);\n\t\t\t}\n\t\t};\n\t\tconst dir = workerDirectory(this.dataDir, address);\n\t\tawait this.#underLock(address, \"importData\", \"has data (its worker runs)\", context, async () => {\n\t\t\tif (existing === \"refuse\" && (await exists(dir))) {\n\t\t\t\tthrow new Error(`importData: ${dir} exists already (an address is imported once)`);\n\t\t\t}\n\t\t\t// (1) Unpacked whole into staging: nothing changed yet.\n\t\t\tconst bounds = { bytes: limits.importBytes, entries: limits.importEntries };\n\t\t\tconst { staging } = await unpackStaging(resolve(archive), dirname(dir), accept, bounds, context);\n\t\t\tconst aside = existing === \"replace\" && (await exists(dir)) ? `${dir}.aside-${randomUUID()}` : undefined;\n\t\t\tlet placed = false;\n\t\t\tconst undo = async (): Promise<void> => {\n\t\t\t\tawait rm(placed ? dir : staging, { recursive: true, force: true });\n\t\t\t\tif (aside !== undefined && (await exists(aside))) await rename(aside, dir);\n\t\t\t};\n\t\t\ttry {\n\t\t\t\t// (2) The old directory aside, (3) the new one in place.\n\t\t\t\tif (aside !== undefined) await rename(dir, aside);\n\t\t\t\tawait rename(staging, dir);\n\t\t\t\tplaced = true;\n\t\t\t\t// (4) The server's part, the one commit, last.\n\t\t\t\tconst parts = decodeJsonl(createReadStream(join(dir, \"server.archive\")));\n\t\t\t\tawait this.host.importHostData(parts, context, { address, existing });\n\t\t\t} catch (error) {\n\t\t\t\tif (unknownOutcome(error)) {\n\t\t\t\t\t// It may have committed: undoing could pair the old directory with the new server data.\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`importData: ${address.key}: the server's commit has an unknown outcome; nothing was undone (the ` +\n\t\t\t\t\t\t\t`new directory is in place${aside === undefined ? \"\" : `, the old one at ${aside}`}). Run the ` +\n\t\t\t\t\t\t\t`import again with existing: \"replace\" once the server's store is back.`,\n\t\t\t\t\t\t{ cause: error },\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tawait undo();\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\t// Committed: what is left over is harmless, so these never fail the import.\n\t\t\tawait rm(join(dir, \"server.archive\"), { force: true }).catch(() => {});\n\t\t\tif (aside !== undefined) await rm(aside, { recursive: true, force: true }).catch(() => {});\n\t\t});\n\t}\n\n\tasync deleteData(address: Address, context: Context): Promise<void> {\n\t\tthis.#workersOf(address);\n\t\tconst dir = workerDirectory(this.dataDir, address);\n\t\tawait this.#underLock(address, \"deleteData\", \"runs; stop its worker first\", context, async () => {\n\t\t\t// The server's part first (the one commit); a crash before the directory goes leaves it orphaned (nothing\n\t\t\t// refers to it) and a repeated `deleteData` removes it.\n\t\t\tawait this.host.deleteHostData(address, context);\n\t\t\tawait rm(dir, { recursive: true, force: true });\n\t\t});\n\t}\n\n\t/** Runs `work` under the worker's lock of `address` (refused while its worker runs: `<what>: <key> <held>`). */\n\tasync #underLock(\n\t\taddress: Address,\n\t\twhat: string,\n\t\theld: string,\n\t\tcontext: Context,\n\t\twork: () => Promise<void>,\n\t): Promise<void> {\n\t\tconst lock = await this.#workerLock(address, context);\n\t\tif (lock === undefined) throw new Error(`${what}: ${address.key} ${held}`);\n\t\ttry {\n\t\t\tawait work();\n\t\t} finally {\n\t\t\tawait lock.release();\n\t\t}\n\t}\n\n\t/** The process lock of the worker at `address` (the one its worker takes at start), or `undefined` while held. */\n\tasync #workerLock(address: Address, context: Context): Promise<ProcessLock | undefined> {\n\t\tconst waited = AbortSignal.timeout(ADDRESS_LOCK_MS);\n\t\ttry {\n\t\t\treturn await processLock(\n\t\t\t\tworkerLock(this.#options.name, this.dataDir, address.key),\n\t\t\t\twithAbortSignal(waited, context),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tif (waited.aborted) return undefined;\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tclose(context: Context): Promise<void> {\n\t\tthis.#closing ??= this.#close(context);\n\t\treturn this.#closing;\n\t}\n\n\t/** The workers of `address`'s kind. */\n\t#workersOf(address: Address): Workers<HostKind> {\n\t\tconst workers = this.workers.get(address.kind);\n\t\tif (workers === undefined) throw new Error(`app: no worker kind \"${address.kind}\"`);\n\t\treturn workers;\n\t}\n\n\t/** The manifest of `address`'s archive. */\n\t#manifest(address: Address): ArchiveManifest {\n\t\tconst { name, api } = this.#options;\n\t\treturn {\n\t\t\tformat: ARCHIVE_FORMAT,\n\t\t\tapp: name,\n\t\t\tapi: api.versions[0] ?? \"\",\n\t\t\taddress: { kind: address.kind, key: address.key },\n\t\t};\n\t}\n\n\t/** Whether the app is closing or closed: what runs after the start stops there. */\n\tclosing(): boolean {\n\t\treturn this.#closing !== undefined;\n\t}\n\n\t/**\n\t * The close, in order: HTTP (it drains requests the host's close would seal), workers, host, store, the plugins'\n\t * watcher, then the data directory's lock. The bases' builds and the recording of the base code are not waited for:\n\t * what they finish after the close is dropped.\n\t */\n\tasync #close(context: Context): Promise<void> {\n\t\tawait this.http.close(context);\n\t\tfor (const workers of this.workers.values()) await workers.close(context);\n\t\tawait this.host.close(context);\n\t\tawait this.#store.close(context);\n\t\tthis.#component.close();\n\t\tawait this.#lock.release();\n\t}\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Context } from "../../context/index.ts";
|
|
2
|
+
import { type Store } from "../../store/index.ts";
|
|
3
|
+
/** The kit's archive format version (2: `server.archive`). */
|
|
4
|
+
export declare const ARCHIVE_FORMAT = 2;
|
|
5
|
+
/** What an archive says about itself. */
|
|
6
|
+
export type ArchiveManifest = {
|
|
7
|
+
readonly format: number;
|
|
8
|
+
readonly app: string;
|
|
9
|
+
readonly api: string;
|
|
10
|
+
readonly address: {
|
|
11
|
+
readonly kind: string;
|
|
12
|
+
readonly key: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Packs the host directory `dir` of a host that does not run (its worker's lock held: nothing writes it) into the
|
|
17
|
+
* archive at `path`: `manifest`, its store's export, the server's part (the JSONL file `server`) and its files.
|
|
18
|
+
*/
|
|
19
|
+
export declare function packData(dir: string, manifest: ArchiveManifest, server: string, path: string, context: Context): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Packs the open `store`, the server's part (the JSONL file `server`, the server's records and rows belonging to the
|
|
22
|
+
* address) and the files directory `files` into the archive at `path` (mode 0600, staged beside it and renamed):
|
|
23
|
+
* `manifest`, the store's export (one consistent point, written while the host runs on), `server.archive` and the
|
|
24
|
+
* finished files (uploads under way left out).
|
|
25
|
+
*/
|
|
26
|
+
export declare function packStore(store: Store, files: string, manifest: ArchiveManifest, server: string, path: string, context: Context): Promise<void>;
|
|
27
|
+
/** What an import takes at most: unpacked bytes (4 GiB by default) and entries (100,000 by default). */
|
|
28
|
+
export type ImportLimits = {
|
|
29
|
+
readonly bytes?: number;
|
|
30
|
+
readonly entries?: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Unpacks the archive at `archive` into a new staging directory in `parent` (mode 0700, files 0600): its manifest
|
|
34
|
+
* checked by `accept` (a throw refuses it), the store made from `store.archive`, `files/` restored, `server.archive`
|
|
35
|
+
* kept for the server, within `limits`. Changes nothing else: a refused or broken archive leaves nothing. The staging
|
|
36
|
+
* directory and its server part's path; the caller renames it into place and then imports the server's part.
|
|
37
|
+
*/
|
|
38
|
+
export declare function unpackStaging(archive: string, parent: string, accept: (manifest: ArchiveManifest) => void, limits: ImportLimits, context: Context): Promise<{
|
|
39
|
+
readonly staging: string;
|
|
40
|
+
readonly server: string;
|
|
41
|
+
}>;
|
|
42
|
+
/** Whether `path` exists. */
|
|
43
|
+
export declare function exists(path: string): Promise<boolean>;
|
|
44
|
+
//# sourceMappingURL=archive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../../src/node/app/archive.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAoD,KAAK,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AAInH,8DAA8D;AAC9D,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,yCAAyC;AACzC,MAAM,MAAM,eAAe,GAAG;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAClE,CAAC;AAKF;;;GAGG;AACH,wBAAsB,QAAQ,CAC7B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GACd,OAAO,CAAC,IAAI,CAAC,CAQf;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAC9B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,eAAe,EACzB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GACd,OAAO,CAAC,IAAI,CAAC,CAoBf;AAuDD,wGAAwG;AACxG,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF;;;;;GAKG;AACH,wBAAsB,aAAa,CAClC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,IAAI,EAC3C,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,GACd,OAAO,CAAC;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAehE;AAkED,6BAA6B;AAC7B,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAK3D"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
// Data archives (slice 13 §4, decisions "The app kit, point 5", "App kit naming and export" and "Documents and table
|
|
2
|
+
// rows can belong to a host"): one tar of the data a host created, `manifest.json` (the app, its API version, the kit's
|
|
3
|
+
// format version, the address), `store.archive` (the store's export archive, slice 6a, as JSONL: one consistent point,
|
|
4
|
+
// the export holding the commit queue while it reads), `server.archive` (the server's records and rows belonging to the
|
|
5
|
+
// address, `exportHostData`, as JSONL) and `files/` (its finished files). A running worker packs its own open store;
|
|
6
|
+
// without one the server packs the directory under the worker's lock. Unpacking makes a staging directory, refusing
|
|
7
|
+
// every path that would leave it; the kit puts it in place, then imports the server's part (`app.ts`).
|
|
8
|
+
import { createReadStream, createWriteStream } from "node:fs";
|
|
9
|
+
import { mkdir, mkdtemp, open, readdir, rename, rm, stat } from "node:fs/promises";
|
|
10
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
11
|
+
import { pipeline } from "node:stream/promises";
|
|
12
|
+
import { openNodeSqliteDatabase } from "../../sqlite/node.js";
|
|
13
|
+
import { decodeJsonl, encodeJsonl, importStore, openStore, sqliteBackend } from "../../store/index.js";
|
|
14
|
+
import { privateDirectory, privateStore } from "./layout.js";
|
|
15
|
+
import { readTar, writeTar } from "./tar.js";
|
|
16
|
+
/** The kit's archive format version (2: `server.archive`). */
|
|
17
|
+
export const ARCHIVE_FORMAT = 2;
|
|
18
|
+
/** The store file of a host directory. */
|
|
19
|
+
const STORE = "store.sqlite";
|
|
20
|
+
/**
|
|
21
|
+
* Packs the host directory `dir` of a host that does not run (its worker's lock held: nothing writes it) into the
|
|
22
|
+
* archive at `path`: `manifest`, its store's export, the server's part (the JSONL file `server`) and its files.
|
|
23
|
+
*/
|
|
24
|
+
export async function packData(dir, manifest, server, path, context) {
|
|
25
|
+
if (!(await exists(dir)))
|
|
26
|
+
throw new Error(`exportData: ${manifest.address.key} has no data`);
|
|
27
|
+
const store = await openStore(sqliteBackend(await openNodeSqliteDatabase(join(dir, STORE))), context);
|
|
28
|
+
try {
|
|
29
|
+
await packStore(store, join(dir, "files"), manifest, server, path, context);
|
|
30
|
+
}
|
|
31
|
+
finally {
|
|
32
|
+
await store.close(context);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Packs the open `store`, the server's part (the JSONL file `server`, the server's records and rows belonging to the
|
|
37
|
+
* address) and the files directory `files` into the archive at `path` (mode 0600, staged beside it and renamed):
|
|
38
|
+
* `manifest`, the store's export (one consistent point, written while the host runs on), `server.archive` and the
|
|
39
|
+
* finished files (uploads under way left out).
|
|
40
|
+
*/
|
|
41
|
+
export async function packStore(store, files, manifest, server, path, context) {
|
|
42
|
+
const staging = await mkdtemp(join(dirname(path), ".chord-export-"));
|
|
43
|
+
try {
|
|
44
|
+
const exported = join(staging, "store.archive");
|
|
45
|
+
await pipeline(encodeJsonl(store.export(context)), createWriteStream(exported, { mode: 0o600 }));
|
|
46
|
+
const text = new TextEncoder().encode(JSON.stringify(manifest));
|
|
47
|
+
const size = (await stat(exported)).size;
|
|
48
|
+
const serverSize = (await stat(server)).size;
|
|
49
|
+
async function* entries() {
|
|
50
|
+
yield { path: "manifest.json", size: text.length, data: chunksOf(text) };
|
|
51
|
+
yield { path: "store.archive", size, data: createReadStream(exported) };
|
|
52
|
+
yield { path: "server.archive", size: serverSize, data: createReadStream(server) };
|
|
53
|
+
yield* filesOf(files);
|
|
54
|
+
}
|
|
55
|
+
const written = join(staging, "archive.tar");
|
|
56
|
+
await pipeline(writeTar(entries()), createWriteStream(written, { mode: 0o600 }));
|
|
57
|
+
await rename(written, path);
|
|
58
|
+
}
|
|
59
|
+
finally {
|
|
60
|
+
await rm(staging, { recursive: true, force: true });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** One chunk. */
|
|
64
|
+
async function* chunksOf(bytes) {
|
|
65
|
+
yield bytes;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The files under `root` as entries `files/<relative path>` (hidden ones, uploads under way, left out), each opened only
|
|
69
|
+
* when the archive comes to it (one descriptor at a time) and its size taken from the open file: a file deleted while a
|
|
70
|
+
* running worker is exported is skipped, or read whole from its open handle (finished files never change; Opus L7).
|
|
71
|
+
*/
|
|
72
|
+
async function* filesOf(root) {
|
|
73
|
+
for (const path of await pathsUnder(root)) {
|
|
74
|
+
const handle = await open(path, "r").catch((error) => {
|
|
75
|
+
if (error.code === "ENOENT")
|
|
76
|
+
return undefined;
|
|
77
|
+
throw error;
|
|
78
|
+
});
|
|
79
|
+
if (handle === undefined)
|
|
80
|
+
continue;
|
|
81
|
+
const info = await handle.stat();
|
|
82
|
+
if (!info.isFile()) {
|
|
83
|
+
await handle.close();
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const inside = relative(root, path).split(sep).join("/");
|
|
87
|
+
yield {
|
|
88
|
+
path: `files/${inside}`,
|
|
89
|
+
size: info.size,
|
|
90
|
+
data: handle.createReadStream({ start: 0, end: Math.max(0, info.size - 1) }),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** The paths of the files under `root`, sorted, hidden ones left out (a directory gone meanwhile: none of it). */
|
|
95
|
+
async function pathsUnder(root) {
|
|
96
|
+
const paths = [];
|
|
97
|
+
const walk = async (dir) => {
|
|
98
|
+
let entries;
|
|
99
|
+
try {
|
|
100
|
+
entries = (await readdir(dir, { withFileTypes: true })).sort((a, b) => (a.name < b.name ? -1 : 1));
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
if (error.code === "ENOENT")
|
|
104
|
+
return;
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
for (const entry of entries) {
|
|
108
|
+
if (entry.name.startsWith("."))
|
|
109
|
+
continue;
|
|
110
|
+
const path = join(dir, entry.name);
|
|
111
|
+
if (entry.isDirectory())
|
|
112
|
+
await walk(path);
|
|
113
|
+
else if (entry.isFile())
|
|
114
|
+
paths.push(path);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
await walk(root);
|
|
118
|
+
return paths;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Unpacks the archive at `archive` into a new staging directory in `parent` (mode 0700, files 0600): its manifest
|
|
122
|
+
* checked by `accept` (a throw refuses it), the store made from `store.archive`, `files/` restored, `server.archive`
|
|
123
|
+
* kept for the server, within `limits`. Changes nothing else: a refused or broken archive leaves nothing. The staging
|
|
124
|
+
* directory and its server part's path; the caller renames it into place and then imports the server's part.
|
|
125
|
+
*/
|
|
126
|
+
export async function unpackStaging(archive, parent, accept, limits, context) {
|
|
127
|
+
await privateDirectory(parent);
|
|
128
|
+
const staging = await mkdtemp(join(parent, ".chord-import-"));
|
|
129
|
+
try {
|
|
130
|
+
const { store: storeArchive, server } = await unpackEntries(archive, staging, accept, limits, context);
|
|
131
|
+
await privateStore(join(staging, STORE));
|
|
132
|
+
const backend = sqliteBackend(await openNodeSqliteDatabase(join(staging, STORE)));
|
|
133
|
+
const store = await importStore(backend, decodeJsonl(createReadStream(storeArchive)), context);
|
|
134
|
+
await store.close(context);
|
|
135
|
+
await rm(storeArchive);
|
|
136
|
+
return { staging, server };
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
await rm(staging, { recursive: true, force: true });
|
|
140
|
+
throw error;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Writes the entries of `archive` into `staging`: the manifest first (checked by `accept` before any data is written),
|
|
145
|
+
* then `store.archive`, `server.archive` and `files/…`, within `limits` (counted from the headers, before an entry is
|
|
146
|
+
* written). The paths of the staged `store.archive` and `server.archive`.
|
|
147
|
+
*/
|
|
148
|
+
async function unpackEntries(archive, staging, accept, limits, context) {
|
|
149
|
+
const maxBytes = limits.bytes ?? 4 * 1024 ** 3;
|
|
150
|
+
const maxEntries = limits.entries ?? 100_000;
|
|
151
|
+
let manifest;
|
|
152
|
+
let storeArchive;
|
|
153
|
+
let serverArchive;
|
|
154
|
+
let bytes = 0;
|
|
155
|
+
let entries = 0;
|
|
156
|
+
for await (const entry of readTar(createReadStream(archive))) {
|
|
157
|
+
context.abortSignal?.throwIfAborted();
|
|
158
|
+
if (++entries > maxEntries)
|
|
159
|
+
throw new Error(`importData: the archive has more than ${maxEntries} entries`);
|
|
160
|
+
if (entry.kind === "directory")
|
|
161
|
+
continue;
|
|
162
|
+
bytes += entry.size;
|
|
163
|
+
if (bytes > maxBytes)
|
|
164
|
+
throw new Error(`importData: the archive unpacks to more than ${maxBytes} bytes`);
|
|
165
|
+
if (manifest === undefined && entry.path !== "manifest.json") {
|
|
166
|
+
throw new Error("importData: the archive does not start with manifest.json");
|
|
167
|
+
}
|
|
168
|
+
if (entry.path === "manifest.json") {
|
|
169
|
+
// A trust boundary: the archive's own description, checked by `accept`.
|
|
170
|
+
manifest = JSON.parse(new TextDecoder().decode(await collect(entry.data, 64 * 1024)));
|
|
171
|
+
accept(manifest);
|
|
172
|
+
}
|
|
173
|
+
else if (entry.path === "store.archive" || entry.path === "server.archive") {
|
|
174
|
+
const target = join(staging, entry.path);
|
|
175
|
+
if (entry.path === "store.archive")
|
|
176
|
+
storeArchive = target;
|
|
177
|
+
else
|
|
178
|
+
serverArchive = target;
|
|
179
|
+
await pipeline(entry.data, createWriteStream(target, { mode: 0o600 }));
|
|
180
|
+
}
|
|
181
|
+
else if (entry.path.startsWith("files/")) {
|
|
182
|
+
// `readTar` refused absolute paths and `..`: `files/<path>` stays inside the staging directory.
|
|
183
|
+
const target = join(staging, ...entry.path.split("/"));
|
|
184
|
+
await mkdir(dirname(target), { recursive: true, mode: 0o700 });
|
|
185
|
+
await pipeline(entry.data, createWriteStream(target, { mode: 0o600 }));
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
throw new Error(`importData: the archive holds ${entry.path}, which an address archive does not`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (manifest === undefined || storeArchive === undefined || serverArchive === undefined) {
|
|
192
|
+
throw new Error("importData: the archive has no manifest.json, store.archive or server.archive");
|
|
193
|
+
}
|
|
194
|
+
return { store: storeArchive, server: serverArchive };
|
|
195
|
+
}
|
|
196
|
+
/** The bytes of `data`, refused past `limit`. */
|
|
197
|
+
async function collect(data, limit) {
|
|
198
|
+
const chunks = [];
|
|
199
|
+
let size = 0;
|
|
200
|
+
for await (const chunk of data) {
|
|
201
|
+
size += chunk.length;
|
|
202
|
+
if (size > limit)
|
|
203
|
+
throw new Error("importData: manifest.json is too large");
|
|
204
|
+
chunks.push(chunk);
|
|
205
|
+
}
|
|
206
|
+
return Buffer.concat(chunks);
|
|
207
|
+
}
|
|
208
|
+
/** Whether `path` exists. */
|
|
209
|
+
export async function exists(path) {
|
|
210
|
+
return stat(path).then(() => true, () => false);
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=archive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../../src/node/app/archive.ts"],"names":[],"mappings":"AAAA,qHAAqH;AACrH,wHAAwH;AAC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KAAK,SAAS,EAAE,CAAC;QACzF,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;IAClG,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AACvD,CAAC;AAED,iDAAiD;AACjD,KAAK,UAAU,OAAO,CAAC,IAA+B,EAAE,KAAa;IACpE,MAAM,MAAM,GAAiB,EAAE,CAAC;IAChC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;QAChC,IAAI,IAAI,KAAK,CAAC,MAAM,CAAC;QACrB,IAAI,IAAI,GAAG,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5E,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED,6BAA6B;AAC7B,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CACrB,GAAG,EAAE,CAAC,IAAI,EACV,GAAG,EAAE,CAAC,KAAK,CACX,CAAC;AACH,CAAC","sourcesContent":["// Data archives (slice 13 §4, decisions \"The app kit, point 5\", \"App kit naming and export\" and \"Documents and table\n// rows can belong to a host\"): one tar of the data a host created, `manifest.json` (the app, its API version, the kit's\n// format version, the address), `store.archive` (the store's export archive, slice 6a, as JSONL: one consistent point,\n// the export holding the commit queue while it reads), `server.archive` (the server's records and rows belonging to the\n// address, `exportHostData`, as JSONL) and `files/` (its finished files). A running worker packs its own open store;\n// without one the server packs the directory under the worker's lock. Unpacking makes a staging directory, refusing\n// every path that would leave it; the kit puts it in place, then imports the server's part (`app.ts`).\n\nimport { createReadStream, createWriteStream, type Dirent } from \"node:fs\";\nimport { mkdir, mkdtemp, open, readdir, rename, rm, stat } from \"node:fs/promises\";\nimport { dirname, join, relative, sep } from \"node:path\";\nimport { pipeline } from \"node:stream/promises\";\nimport type { Context } from \"../../context/index.ts\";\nimport { openNodeSqliteDatabase } from \"../../sqlite/node.ts\";\nimport { decodeJsonl, encodeJsonl, importStore, openStore, type Store, sqliteBackend } from \"../../store/index.ts\";\nimport { privateDirectory, privateStore } from \"./layout.ts\";\nimport { readTar, type TarEntry, writeTar } from \"./tar.ts\";\n\n/** The kit's archive format version (2: `server.archive`). */\nexport const ARCHIVE_FORMAT = 2;\n\n/** What an archive says about itself. */\nexport type ArchiveManifest = {\n\treadonly format: number;\n\treadonly app: string;\n\treadonly api: string;\n\treadonly address: { readonly kind: string; readonly key: string };\n};\n\n/** The store file of a host directory. */\nconst STORE = \"store.sqlite\";\n\n/**\n * Packs the host directory `dir` of a host that does not run (its worker's lock held: nothing writes it) into the\n * archive at `path`: `manifest`, its store's export, the server's part (the JSONL file `server`) and its files.\n */\nexport async function packData(\n\tdir: string,\n\tmanifest: ArchiveManifest,\n\tserver: string,\n\tpath: string,\n\tcontext: Context,\n): Promise<void> {\n\tif (!(await exists(dir))) throw new Error(`exportData: ${manifest.address.key} has no data`);\n\tconst store = await openStore(sqliteBackend(await openNodeSqliteDatabase(join(dir, STORE))), context);\n\ttry {\n\t\tawait packStore(store, join(dir, \"files\"), manifest, server, path, context);\n\t} finally {\n\t\tawait store.close(context);\n\t}\n}\n\n/**\n * Packs the open `store`, the server's part (the JSONL file `server`, the server's records and rows belonging to the\n * address) and the files directory `files` into the archive at `path` (mode 0600, staged beside it and renamed):\n * `manifest`, the store's export (one consistent point, written while the host runs on), `server.archive` and the\n * finished files (uploads under way left out).\n */\nexport async function packStore(\n\tstore: Store,\n\tfiles: string,\n\tmanifest: ArchiveManifest,\n\tserver: string,\n\tpath: string,\n\tcontext: Context,\n): Promise<void> {\n\tconst staging = await mkdtemp(join(dirname(path), \".chord-export-\"));\n\ttry {\n\t\tconst exported = join(staging, \"store.archive\");\n\t\tawait pipeline(encodeJsonl(store.export(context)), createWriteStream(exported, { mode: 0o600 }));\n\t\tconst text = new TextEncoder().encode(JSON.stringify(manifest));\n\t\tconst size = (await stat(exported)).size;\n\t\tconst serverSize = (await stat(server)).size;\n\t\tasync function* entries(): AsyncGenerator<TarEntry> {\n\t\t\tyield { path: \"manifest.json\", size: text.length, data: chunksOf(text) };\n\t\t\tyield { path: \"store.archive\", size, data: createReadStream(exported) };\n\t\t\tyield { path: \"server.archive\", size: serverSize, data: createReadStream(server) };\n\t\t\tyield* filesOf(files);\n\t\t}\n\t\tconst written = join(staging, \"archive.tar\");\n\t\tawait pipeline(writeTar(entries()), createWriteStream(written, { mode: 0o600 }));\n\t\tawait rename(written, path);\n\t} finally {\n\t\tawait rm(staging, { recursive: true, force: true });\n\t}\n}\n\n/** One chunk. */\nasync function* chunksOf(bytes: Uint8Array): AsyncGenerator<Uint8Array> {\n\tyield bytes;\n}\n\n/**\n * The files under `root` as entries `files/<relative path>` (hidden ones, uploads under way, left out), each opened only\n * when the archive comes to it (one descriptor at a time) and its size taken from the open file: a file deleted while a\n * running worker is exported is skipped, or read whole from its open handle (finished files never change; Opus L7).\n */\nasync function* filesOf(root: string): AsyncGenerator<TarEntry> {\n\tfor (const path of await pathsUnder(root)) {\n\t\tconst handle = await open(path, \"r\").catch((error: NodeJS.ErrnoException) => {\n\t\t\tif (error.code === \"ENOENT\") return undefined;\n\t\t\tthrow error;\n\t\t});\n\t\tif (handle === undefined) continue;\n\t\tconst info = await handle.stat();\n\t\tif (!info.isFile()) {\n\t\t\tawait handle.close();\n\t\t\tcontinue;\n\t\t}\n\t\tconst inside = relative(root, path).split(sep).join(\"/\");\n\t\tyield {\n\t\t\tpath: `files/${inside}`,\n\t\t\tsize: info.size,\n\t\t\tdata: handle.createReadStream({ start: 0, end: Math.max(0, info.size - 1) }),\n\t\t};\n\t}\n}\n\n/** The paths of the files under `root`, sorted, hidden ones left out (a directory gone meanwhile: none of it). */\nasync function pathsUnder(root: string): Promise<string[]> {\n\tconst paths: string[] = [];\n\tconst walk = async (dir: string): Promise<void> => {\n\t\tlet entries: Dirent[];\n\t\ttry {\n\t\t\tentries = (await readdir(dir, { withFileTypes: true })).sort((a, b) => (a.name < b.name ? -1 : 1));\n\t\t} catch (error) {\n\t\t\tif ((error as NodeJS.ErrnoException).code === \"ENOENT\") return;\n\t\t\tthrow error;\n\t\t}\n\t\tfor (const entry of entries) {\n\t\t\tif (entry.name.startsWith(\".\")) continue;\n\t\t\tconst path = join(dir, entry.name);\n\t\t\tif (entry.isDirectory()) await walk(path);\n\t\t\telse if (entry.isFile()) paths.push(path);\n\t\t}\n\t};\n\tawait walk(root);\n\treturn paths;\n}\n\n/** What an import takes at most: unpacked bytes (4 GiB by default) and entries (100,000 by default). */\nexport type ImportLimits = { readonly bytes?: number; readonly entries?: number };\n\n/**\n * Unpacks the archive at `archive` into a new staging directory in `parent` (mode 0700, files 0600): its manifest\n * checked by `accept` (a throw refuses it), the store made from `store.archive`, `files/` restored, `server.archive`\n * kept for the server, within `limits`. Changes nothing else: a refused or broken archive leaves nothing. The staging\n * directory and its server part's path; the caller renames it into place and then imports the server's part.\n */\nexport async function unpackStaging(\n\tarchive: string,\n\tparent: string,\n\taccept: (manifest: ArchiveManifest) => void,\n\tlimits: ImportLimits,\n\tcontext: Context,\n): Promise<{ readonly staging: string; readonly server: string }> {\n\tawait privateDirectory(parent);\n\tconst staging = await mkdtemp(join(parent, \".chord-import-\"));\n\ttry {\n\t\tconst { store: storeArchive, server } = await unpackEntries(archive, staging, accept, limits, context);\n\t\tawait privateStore(join(staging, STORE));\n\t\tconst backend = sqliteBackend(await openNodeSqliteDatabase(join(staging, STORE)));\n\t\tconst store = await importStore(backend, decodeJsonl(createReadStream(storeArchive)), context);\n\t\tawait store.close(context);\n\t\tawait rm(storeArchive);\n\t\treturn { staging, server };\n\t} catch (error) {\n\t\tawait rm(staging, { recursive: true, force: true });\n\t\tthrow error;\n\t}\n}\n\n/**\n * Writes the entries of `archive` into `staging`: the manifest first (checked by `accept` before any data is written),\n * then `store.archive`, `server.archive` and `files/…`, within `limits` (counted from the headers, before an entry is\n * written). The paths of the staged `store.archive` and `server.archive`.\n */\nasync function unpackEntries(\n\tarchive: string,\n\tstaging: string,\n\taccept: (manifest: ArchiveManifest) => void,\n\tlimits: ImportLimits,\n\tcontext: Context,\n): Promise<{ readonly store: string; readonly server: string }> {\n\tconst maxBytes = limits.bytes ?? 4 * 1024 ** 3;\n\tconst maxEntries = limits.entries ?? 100_000;\n\tlet manifest: ArchiveManifest | undefined;\n\tlet storeArchive: string | undefined;\n\tlet serverArchive: string | undefined;\n\tlet bytes = 0;\n\tlet entries = 0;\n\tfor await (const entry of readTar(createReadStream(archive))) {\n\t\tcontext.abortSignal?.throwIfAborted();\n\t\tif (++entries > maxEntries) throw new Error(`importData: the archive has more than ${maxEntries} entries`);\n\t\tif (entry.kind === \"directory\") continue;\n\t\tbytes += entry.size;\n\t\tif (bytes > maxBytes) throw new Error(`importData: the archive unpacks to more than ${maxBytes} bytes`);\n\t\tif (manifest === undefined && entry.path !== \"manifest.json\") {\n\t\t\tthrow new Error(\"importData: the archive does not start with manifest.json\");\n\t\t}\n\t\tif (entry.path === \"manifest.json\") {\n\t\t\t// A trust boundary: the archive's own description, checked by `accept`.\n\t\t\tmanifest = JSON.parse(new TextDecoder().decode(await collect(entry.data, 64 * 1024))) as ArchiveManifest;\n\t\t\taccept(manifest);\n\t\t} else if (entry.path === \"store.archive\" || entry.path === \"server.archive\") {\n\t\t\tconst target = join(staging, entry.path);\n\t\t\tif (entry.path === \"store.archive\") storeArchive = target;\n\t\t\telse serverArchive = target;\n\t\t\tawait pipeline(entry.data, createWriteStream(target, { mode: 0o600 }));\n\t\t} else if (entry.path.startsWith(\"files/\")) {\n\t\t\t// `readTar` refused absolute paths and `..`: `files/<path>` stays inside the staging directory.\n\t\t\tconst target = join(staging, ...entry.path.split(\"/\"));\n\t\t\tawait mkdir(dirname(target), { recursive: true, mode: 0o700 });\n\t\t\tawait pipeline(entry.data, createWriteStream(target, { mode: 0o600 }));\n\t\t} else {\n\t\t\tthrow new Error(`importData: the archive holds ${entry.path}, which an address archive does not`);\n\t\t}\n\t}\n\tif (manifest === undefined || storeArchive === undefined || serverArchive === undefined) {\n\t\tthrow new Error(\"importData: the archive has no manifest.json, store.archive or server.archive\");\n\t}\n\treturn { store: storeArchive, server: serverArchive };\n}\n\n/** The bytes of `data`, refused past `limit`. */\nasync function collect(data: AsyncIterable<Uint8Array>, limit: number): Promise<Uint8Array> {\n\tconst chunks: Uint8Array[] = [];\n\tlet size = 0;\n\tfor await (const chunk of data) {\n\t\tsize += chunk.length;\n\t\tif (size > limit) throw new Error(\"importData: manifest.json is too large\");\n\t\tchunks.push(chunk);\n\t}\n\treturn Buffer.concat(chunks);\n}\n\n/** Whether `path` exists. */\nexport async function exists(path: string): Promise<boolean> {\n\treturn stat(path).then(\n\t\t() => true,\n\t\t() => false,\n\t);\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The blob files of one host, in `dir` (`<files>/blobs`). */
|
|
2
|
+
export declare class Blobs {
|
|
3
|
+
readonly dir: string;
|
|
4
|
+
constructor(dir: string);
|
|
5
|
+
/** Where blob `id` lives. */
|
|
6
|
+
path(id: string): string;
|
|
7
|
+
/** Makes the directory (mode 0700) before a blob moves in. */
|
|
8
|
+
prepare(): Promise<void>;
|
|
9
|
+
/** Writes `bytes` as blob `id`: into `staging` (mode 0600), then moved into place. */
|
|
10
|
+
write(id: string, bytes: Uint8Array, staging: string): Promise<void>;
|
|
11
|
+
/** Up to `length` bytes of blob `id` (of `size` bytes) from `offset`: fewer at its end. */
|
|
12
|
+
read(id: string, size: number, offset: number, length: number): Promise<Uint8Array>;
|
|
13
|
+
/** Removes the blobs `ids` (a missing one: nothing). */
|
|
14
|
+
remove(ids: readonly string[]): Promise<void>;
|
|
15
|
+
/** Removes every blob file `known` does not know: what writes left that never committed. */
|
|
16
|
+
sweep(known: (id: string) => Promise<boolean>): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Puts blob `id` into `target` (another host's blob directory): a hard link (blobs never change, so two hosts may
|
|
19
|
+
* share the file), a copy where the file system refuses links.
|
|
20
|
+
*/
|
|
21
|
+
linkInto(id: string, target: string): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=blobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blobs.d.ts","sourceRoot":"","sources":["../../../src/node/app/blobs.ts"],"names":[],"mappings":"AAQA,8DAA8D;AAC9D,qBAAa,KAAK;IACjB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,YAAY,GAAG,EAAE,MAAM,EAEtB;IAED,6BAA6B;IAC7B,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEvB;IAED,8DAA8D;IACxD,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7B;IAED,sFAAsF;IAChF,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKzE;IAED,2FAA2F;IACrF,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CASxF;IAED,wDAAwD;IAClD,MAAM,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAElD;IAED,4FAA4F;IACtF,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlE;IAED;;;OAGG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxD;CACD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// The blobs of one host's files (Files v2): immutable byte files under `<files>/blobs/`, named by id. A blob is
|
|
2
|
+
// written whole beside its place and moved there (a reader never sees part of one), never changed, and removed once no
|
|
3
|
+
// version references it. Blobs a write left without its index commit (a crash between the two) are swept.
|
|
4
|
+
import { constants } from "node:fs";
|
|
5
|
+
import { copyFile, link, mkdir, open, readdir, rename, rm, writeFile } from "node:fs/promises";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
7
|
+
/** The blob files of one host, in `dir` (`<files>/blobs`). */
|
|
8
|
+
export class Blobs {
|
|
9
|
+
dir;
|
|
10
|
+
constructor(dir) {
|
|
11
|
+
this.dir = dir;
|
|
12
|
+
}
|
|
13
|
+
/** Where blob `id` lives. */
|
|
14
|
+
path(id) {
|
|
15
|
+
return join(this.dir, id);
|
|
16
|
+
}
|
|
17
|
+
/** Makes the directory (mode 0700) before a blob moves in. */
|
|
18
|
+
async prepare() {
|
|
19
|
+
await mkdir(this.dir, { recursive: true, mode: 0o700 });
|
|
20
|
+
}
|
|
21
|
+
/** Writes `bytes` as blob `id`: into `staging` (mode 0600), then moved into place. */
|
|
22
|
+
async write(id, bytes, staging) {
|
|
23
|
+
await this.prepare();
|
|
24
|
+
await mkdir(dirname(staging), { recursive: true, mode: 0o700 });
|
|
25
|
+
await writeFile(staging, bytes, { mode: 0o600, flag: "wx" });
|
|
26
|
+
await rename(staging, this.path(id));
|
|
27
|
+
}
|
|
28
|
+
/** Up to `length` bytes of blob `id` (of `size` bytes) from `offset`: fewer at its end. */
|
|
29
|
+
async read(id, size, offset, length) {
|
|
30
|
+
const handle = await open(this.path(id), "r");
|
|
31
|
+
try {
|
|
32
|
+
const buffer = new Uint8Array(Math.max(0, Math.min(length, size - offset)));
|
|
33
|
+
const { bytesRead } = await handle.read(buffer, 0, buffer.length, offset);
|
|
34
|
+
return buffer.subarray(0, bytesRead);
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
await handle.close();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Removes the blobs `ids` (a missing one: nothing). */
|
|
41
|
+
async remove(ids) {
|
|
42
|
+
for (const id of ids)
|
|
43
|
+
await rm(this.path(id), { force: true });
|
|
44
|
+
}
|
|
45
|
+
/** Removes every blob file `known` does not know: what writes left that never committed. */
|
|
46
|
+
async sweep(known) {
|
|
47
|
+
for (const id of await readdir(this.dir).catch(() => [])) {
|
|
48
|
+
if (!(await known(id)))
|
|
49
|
+
await rm(this.path(id), { force: true });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Puts blob `id` into `target` (another host's blob directory): a hard link (blobs never change, so two hosts may
|
|
54
|
+
* share the file), a copy where the file system refuses links.
|
|
55
|
+
*/
|
|
56
|
+
async linkInto(id, target) {
|
|
57
|
+
await link(this.path(id), join(target, id)).catch(async (error) => {
|
|
58
|
+
if (error.code === "EEXIST")
|
|
59
|
+
throw error;
|
|
60
|
+
await copyFile(this.path(id), join(target, id), constants.COPYFILE_EXCL);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=blobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blobs.js","sourceRoot":"","sources":["../../../src/node/app/blobs.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,uHAAuH;AACvH,0GAA0G;AAE1G,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,8DAA8D;AAC9D,MAAM,OAAO,KAAK;IACR,GAAG,CAAS;IAErB,YAAY,GAAW;QACtB,IAAI,CAAC,GAAG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C;CACD","sourcesContent":["// The blobs of one host's files (Files v2): immutable byte files under `<files>/blobs/`, named by id. A blob is\n// written whole beside its place and moved there (a reader never sees part of one), never changed, and removed once no\n// version references it. Blobs a write left without its index commit (a crash between the two) are swept.\n\nimport { constants } from \"node:fs\";\nimport { copyFile, link, mkdir, open, readdir, rename, rm, writeFile } from \"node:fs/promises\";\nimport { dirname, join } from \"node:path\";\n\n/** The blob files of one host, in `dir` (`<files>/blobs`). */\nexport class Blobs {\n\treadonly dir: string;\n\n\tconstructor(dir: string) {\n\t\tthis.dir = dir;\n\t}\n\n\t/** Where blob `id` lives. */\n\tpath(id: string): string {\n\t\treturn join(this.dir, id);\n\t}\n\n\t/** Makes the directory (mode 0700) before a blob moves in. */\n\tasync prepare(): Promise<void> {\n\t\tawait mkdir(this.dir, { recursive: true, mode: 0o700 });\n\t}\n\n\t/** Writes `bytes` as blob `id`: into `staging` (mode 0600), then moved into place. */\n\tasync write(id: string, bytes: Uint8Array, staging: string): Promise<void> {\n\t\tawait this.prepare();\n\t\tawait mkdir(dirname(staging), { recursive: true, mode: 0o700 });\n\t\tawait writeFile(staging, bytes, { mode: 0o600, flag: \"wx\" });\n\t\tawait rename(staging, this.path(id));\n\t}\n\n\t/** Up to `length` bytes of blob `id` (of `size` bytes) from `offset`: fewer at its end. */\n\tasync read(id: string, size: number, offset: number, length: number): Promise<Uint8Array> {\n\t\tconst handle = await open(this.path(id), \"r\");\n\t\ttry {\n\t\t\tconst buffer = new Uint8Array(Math.max(0, Math.min(length, size - offset)));\n\t\t\tconst { bytesRead } = await handle.read(buffer, 0, buffer.length, offset);\n\t\t\treturn buffer.subarray(0, bytesRead);\n\t\t} finally {\n\t\t\tawait handle.close();\n\t\t}\n\t}\n\n\t/** Removes the blobs `ids` (a missing one: nothing). */\n\tasync remove(ids: readonly string[]): Promise<void> {\n\t\tfor (const id of ids) await rm(this.path(id), { force: true });\n\t}\n\n\t/** Removes every blob file `known` does not know: what writes left that never committed. */\n\tasync sweep(known: (id: string) => Promise<boolean>): Promise<void> {\n\t\tfor (const id of await readdir(this.dir).catch(() => [])) {\n\t\t\tif (!(await known(id))) await rm(this.path(id), { force: true });\n\t\t}\n\t}\n\n\t/**\n\t * Puts blob `id` into `target` (another host's blob directory): a hard link (blobs never change, so two hosts may\n\t * share the file), a copy where the file system refuses links.\n\t */\n\tasync linkInto(id: string, target: string): Promise<void> {\n\t\tawait link(this.path(id), join(target, id)).catch(async (error: NodeJS.ErrnoException) => {\n\t\t\tif (error.code === \"EEXIST\") throw error;\n\t\t\tawait copyFile(this.path(id), join(target, id), constants.COPYFILE_EXCL);\n\t\t});\n\t}\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type Address } from "../../contracts/index.ts";
|
|
2
|
+
import { type Principal } from "../../data/index.ts";
|
|
3
|
+
import { type Facet } from "../../host/index.ts";
|
|
4
|
+
import type { Store } from "../../store/index.ts";
|
|
5
|
+
/**
|
|
6
|
+
* The data of the worker at `address` (its JSON, as `addressParam` writes it): `exportTo` packs it at `path`, with the
|
|
7
|
+
* server's part (its records and rows belonging to the address) from the JSONL file `server`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const HostData: import("../../contracts/contract.ts").Contract<{
|
|
10
|
+
kind: "remote";
|
|
11
|
+
name: "chord.app.data";
|
|
12
|
+
params: {
|
|
13
|
+
readonly address: import("../../contracts/schema.ts").StringSchema;
|
|
14
|
+
};
|
|
15
|
+
history: [{
|
|
16
|
+
version: "1";
|
|
17
|
+
variants: {
|
|
18
|
+
readonly main: {
|
|
19
|
+
state: Record<never, never>;
|
|
20
|
+
methods: {
|
|
21
|
+
readonly exportTo: import("../../contracts/schema.ts").Method<import("../../contracts/index.ts").Schema<{
|
|
22
|
+
path: string;
|
|
23
|
+
manifest: string;
|
|
24
|
+
server: string;
|
|
25
|
+
}>, import("../../contracts/schema.ts").NullSchema>;
|
|
26
|
+
};
|
|
27
|
+
events: Record<never, never>;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
changes: never;
|
|
31
|
+
}];
|
|
32
|
+
}>;
|
|
33
|
+
/** `address` as `HostData`'s param. */
|
|
34
|
+
export declare function addressParam(address: Address): string;
|
|
35
|
+
/**
|
|
36
|
+
* The kit's worker facet serving `HostData` for the worker's open `store` and its files directory `files`, to `server`
|
|
37
|
+
* (the server's principal) only.
|
|
38
|
+
*/
|
|
39
|
+
export declare function hostDataFacet<P extends Principal>(store: Store, files: string, server: P): Facet<P>;
|
|
40
|
+
//# sourceMappingURL=data.d.ts.map
|