@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,86 @@
|
|
|
1
|
+
import { type Static } from "../contracts/index.ts";
|
|
2
|
+
/** One plugin's script of the set: its name, its script's digest and URL, its stylesheet's URL when it has one. */
|
|
3
|
+
declare const ScriptEntry: import("../contracts/index.ts").Schema<{
|
|
4
|
+
name: string;
|
|
5
|
+
digest: string;
|
|
6
|
+
url: string;
|
|
7
|
+
css?: string | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
/** One plugin's script of a set (see `ScriptEntry`). */
|
|
10
|
+
export type ScriptEntry = Static<typeof ScriptEntry>;
|
|
11
|
+
/**
|
|
12
|
+
* A client kind's current scripts: `base` (the base bundle's hash: a change reloads the client), `combined` (the URL of
|
|
13
|
+
* one file holding every plugin's script, what a fresh client loads), `plugins` (each one's script, in name order).
|
|
14
|
+
*/
|
|
15
|
+
export declare const ScriptSet: import("../contracts/index.ts").Schema<{
|
|
16
|
+
base: string;
|
|
17
|
+
combined: string;
|
|
18
|
+
plugins: {
|
|
19
|
+
name: string;
|
|
20
|
+
digest: string;
|
|
21
|
+
url: string;
|
|
22
|
+
css?: string | undefined;
|
|
23
|
+
}[];
|
|
24
|
+
}>;
|
|
25
|
+
/** A client kind's current scripts (see `ScriptSet`). */
|
|
26
|
+
export type ScriptSet = Static<typeof ScriptSet>;
|
|
27
|
+
/** The current web scripts (`ScriptSet`), served by the server's web surface to any principal that may load the app. */
|
|
28
|
+
export declare const WebScripts: import("../contracts/contract.ts").Contract<{
|
|
29
|
+
kind: "remote";
|
|
30
|
+
name: "chord.web.scripts";
|
|
31
|
+
params: {};
|
|
32
|
+
history: [{
|
|
33
|
+
version: "1";
|
|
34
|
+
variants: {
|
|
35
|
+
readonly main: {
|
|
36
|
+
state: {
|
|
37
|
+
readonly set: import("../contracts/index.ts").Schema<{
|
|
38
|
+
base: string;
|
|
39
|
+
combined: string;
|
|
40
|
+
plugins: {
|
|
41
|
+
name: string;
|
|
42
|
+
digest: string;
|
|
43
|
+
url: string;
|
|
44
|
+
css?: string | undefined;
|
|
45
|
+
}[];
|
|
46
|
+
}>;
|
|
47
|
+
};
|
|
48
|
+
methods: Record<never, never>;
|
|
49
|
+
events: Record<never, never>;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
changes: never;
|
|
53
|
+
}];
|
|
54
|
+
}>;
|
|
55
|
+
/** The current terminal scripts (`ScriptSet`), served by the server's terminal surface as `WebScripts` is. */
|
|
56
|
+
export declare const TuiScripts: import("../contracts/contract.ts").Contract<{
|
|
57
|
+
kind: "remote";
|
|
58
|
+
name: "chord.tui.scripts";
|
|
59
|
+
params: {};
|
|
60
|
+
history: [{
|
|
61
|
+
version: "1";
|
|
62
|
+
variants: {
|
|
63
|
+
readonly main: {
|
|
64
|
+
state: {
|
|
65
|
+
readonly set: import("../contracts/index.ts").Schema<{
|
|
66
|
+
base: string;
|
|
67
|
+
combined: string;
|
|
68
|
+
plugins: {
|
|
69
|
+
name: string;
|
|
70
|
+
digest: string;
|
|
71
|
+
url: string;
|
|
72
|
+
css?: string | undefined;
|
|
73
|
+
}[];
|
|
74
|
+
}>;
|
|
75
|
+
};
|
|
76
|
+
methods: Record<never, never>;
|
|
77
|
+
events: Record<never, never>;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
changes: never;
|
|
81
|
+
}];
|
|
82
|
+
}>;
|
|
83
|
+
/** The contract of a client kind's scripts, as clients hold it (`WebScripts`, `TuiScripts`). */
|
|
84
|
+
export type ScriptsContract = typeof WebScripts | typeof TuiScripts;
|
|
85
|
+
export {};
|
|
86
|
+
//# sourceMappingURL=scripts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../src/surfaces/scripts.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmC,KAAK,MAAM,EAAO,MAAM,uBAAuB,CAAC;AAK1F,mHAAmH;AACnH,QAAA,MAAM,WAAW;;;;;EAAmE,CAAC;AAErF,wDAAwD;AACxD,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;EAAmE,CAAC;AAE1F,yDAAyD;AACzD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC;AAEjD,wHAAwH;AACxH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;EAAuC,CAAC;AAE/D,8GAA8G;AAC9G,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;EAAuC,CAAC;AAY/D,gGAAgG;AAChG,MAAM,MAAM,eAAe,GAAG,OAAO,UAAU,GAAG,OAAO,UAAU,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// The current plugin scripts of a client kind (slice 11 §1, decision "Slice 11, P5"): what the server's surface serves
|
|
2
|
+
// as a remote object every page and terminal holds. Its state is the set: the base bundle's hash, the combined file of
|
|
3
|
+
// every plugin script, and each plugin's script (and stylesheet); a rollout shipping the kind publishes a new set, and
|
|
4
|
+
// each client fetches what changed.
|
|
5
|
+
import { arr, hostKind, obj, opt, remote, str } from "../contracts/index.js";
|
|
6
|
+
/** The server's host kind as the surfaces place their objects: the app kit's server is `Server()`. */
|
|
7
|
+
const Server = hostKind("server");
|
|
8
|
+
/** One plugin's script of the set: its name, its script's digest and URL, its stylesheet's URL when it has one. */
|
|
9
|
+
const ScriptEntry = obj({ name: str(), digest: str(), url: str(), css: opt(str()) });
|
|
10
|
+
/**
|
|
11
|
+
* A client kind's current scripts: `base` (the base bundle's hash: a change reloads the client), `combined` (the URL of
|
|
12
|
+
* one file holding every plugin's script, what a fresh client loads), `plugins` (each one's script, in name order).
|
|
13
|
+
*/
|
|
14
|
+
export const ScriptSet = obj({ base: str(), combined: str(), plugins: arr(ScriptEntry) });
|
|
15
|
+
/** The current web scripts (`ScriptSet`), served by the server's web surface to any principal that may load the app. */
|
|
16
|
+
export const WebScripts = scriptsContract("chord.web.scripts");
|
|
17
|
+
/** The current terminal scripts (`ScriptSet`), served by the server's terminal surface as `WebScripts` is. */
|
|
18
|
+
export const TuiScripts = scriptsContract("chord.tui.scripts");
|
|
19
|
+
/** The contract of a client kind's current scripts, named `name`: a remote object on the server, its state the set. */
|
|
20
|
+
function scriptsContract(name) {
|
|
21
|
+
return remote(name, {
|
|
22
|
+
version: 1,
|
|
23
|
+
params: {},
|
|
24
|
+
hostAddress: () => Server(),
|
|
25
|
+
variants: { main: { state: { set: ScriptSet } } },
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=scripts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts.js","sourceRoot":"","sources":["../../src/surfaces/scripts.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,uHAAuH;AACvH,uHAAuH;AACvH,oCAAoC;AAEpC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAe,GAAG,EAAE,MAAM,uBAAuB,CAAC;AAE1F,sGAAsG;AACtG,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAElC,mHAAmH;AACnH,MAAM,WAAW,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AAKrF;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AAK1F,wHAAwH;AACxH,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;AAE/D,8GAA8G;AAC9G,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;AAE/D,uHAAuH;AACvH,SAAS,eAAe,CAAyB,IAAO;IACvD,OAAO,MAAM,CAAC,IAAI,EAAE;QACnB,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE;QAC3B,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,EAAE;KACjD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// The current plugin scripts of a client kind (slice 11 §1, decision \"Slice 11, P5\"): what the server's surface serves\n// as a remote object every page and terminal holds. Its state is the set: the base bundle's hash, the combined file of\n// every plugin script, and each plugin's script (and stylesheet); a rollout shipping the kind publishes a new set, and\n// each client fetches what changed.\n\nimport { arr, hostKind, obj, opt, remote, type Static, str } from \"../contracts/index.ts\";\n\n/** The server's host kind as the surfaces place their objects: the app kit's server is `Server()`. */\nconst Server = hostKind(\"server\");\n\n/** One plugin's script of the set: its name, its script's digest and URL, its stylesheet's URL when it has one. */\nconst ScriptEntry = obj({ name: str(), digest: str(), url: str(), css: opt(str()) });\n\n/** One plugin's script of a set (see `ScriptEntry`). */\nexport type ScriptEntry = Static<typeof ScriptEntry>;\n\n/**\n * A client kind's current scripts: `base` (the base bundle's hash: a change reloads the client), `combined` (the URL of\n * one file holding every plugin's script, what a fresh client loads), `plugins` (each one's script, in name order).\n */\nexport const ScriptSet = obj({ base: str(), combined: str(), plugins: arr(ScriptEntry) });\n\n/** A client kind's current scripts (see `ScriptSet`). */\nexport type ScriptSet = Static<typeof ScriptSet>;\n\n/** The current web scripts (`ScriptSet`), served by the server's web surface to any principal that may load the app. */\nexport const WebScripts = scriptsContract(\"chord.web.scripts\");\n\n/** The current terminal scripts (`ScriptSet`), served by the server's terminal surface as `WebScripts` is. */\nexport const TuiScripts = scriptsContract(\"chord.tui.scripts\");\n\n/** The contract of a client kind's current scripts, named `name`: a remote object on the server, its state the set. */\nfunction scriptsContract<const N extends string>(name: N) {\n\treturn remote(name, {\n\t\tversion: 1,\n\t\tparams: {},\n\t\thostAddress: () => Server(),\n\t\tvariants: { main: { state: { set: ScriptSet } } },\n\t});\n}\n\n/** The contract of a client kind's scripts, as clients hold it (`WebScripts`, `TuiScripts`). */\nexport type ScriptsContract = typeof WebScripts | typeof TuiScripts;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Principal } from "../data/index.ts";
|
|
2
|
+
import type { Facet } from "../host/index.ts";
|
|
3
|
+
/** The caller's theme choice, on the server: its pick, and `choose` to change it. */
|
|
4
|
+
export declare const ThemeChoice: import("../contracts/contract.ts").Contract<{
|
|
5
|
+
kind: "remote";
|
|
6
|
+
name: "chord.themes.choice";
|
|
7
|
+
params: {};
|
|
8
|
+
history: [{
|
|
9
|
+
version: "1";
|
|
10
|
+
variants: {
|
|
11
|
+
readonly main: {
|
|
12
|
+
state: {
|
|
13
|
+
readonly pick: import("../contracts/index.ts").Schema<{
|
|
14
|
+
dark: string | null;
|
|
15
|
+
light: string | null;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
18
|
+
methods: {
|
|
19
|
+
readonly choose: import("../contracts/schema.ts").Method<import("../contracts/index.ts").Schema<{
|
|
20
|
+
dark: string | null;
|
|
21
|
+
light: string | null;
|
|
22
|
+
}>, import("../contracts/schema.ts").NullSchema>;
|
|
23
|
+
};
|
|
24
|
+
events: Record<never, never>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
changes: never;
|
|
28
|
+
}];
|
|
29
|
+
}>;
|
|
30
|
+
/** The kit's server facet for theme choices: the store of picks and each principal's `ThemeChoice`. */
|
|
31
|
+
export declare function themeChoiceFacet<P extends Principal>(): Facet<P>;
|
|
32
|
+
//# sourceMappingURL=theme-choice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-choice.d.ts","sourceRoot":"","sources":["../../src/surfaces/theme-choice.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAU9C,qFAAqF;AACrF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;EAAkD,CAAC;AAK3E,uGAAuG;AACvG,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,CAEhE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// The user's theme choice (slice 11 §4b): one dark and one light theme id per principal, a preference the server keeps
|
|
2
|
+
// (the kit serves it) and every page and terminal of that principal holds, so choosing a theme restyles them all at
|
|
3
|
+
// once. An id is at most 128 characters (fix round 1: Opus M4, Fable L7).
|
|
4
|
+
import { nul, obj, str, union } from "../contracts/index.js";
|
|
5
|
+
import { preferenceContract, preferenceFacet } from "./preference.js";
|
|
6
|
+
/** A theme id (at most 128 characters), or `null` for the first contributed theme of its mode. */
|
|
7
|
+
const ThemeId = union([str({ max: 128 }), nul()]);
|
|
8
|
+
/** A pick: a theme id per mode. */
|
|
9
|
+
const Pick = obj({ dark: ThemeId, light: ThemeId });
|
|
10
|
+
/** The caller's theme choice, on the server: its pick, and `choose` to change it. */
|
|
11
|
+
export const ThemeChoice = preferenceContract("chord.themes.choice", Pick);
|
|
12
|
+
/** No choice yet: the first contributed theme of each mode. */
|
|
13
|
+
const NO_PICK = { dark: null, light: null };
|
|
14
|
+
/** The kit's server facet for theme choices: the store of picks and each principal's `ThemeChoice`. */
|
|
15
|
+
export function themeChoiceFacet() {
|
|
16
|
+
return preferenceFacet(ThemeChoice, "chord.themes.picks", Pick, NO_PICK);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=theme-choice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-choice.js","sourceRoot":"","sources":["../../src/surfaces/theme-choice.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,oHAAoH;AACpH,0EAA0E;AAE1E,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGtE,kGAAkG;AAClG,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;AAElD,mCAAmC;AACnC,MAAM,IAAI,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AAEpD,qFAAqF;AACrF,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AAE3E,+DAA+D;AAC/D,MAAM,OAAO,GAAc,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAEvD,uGAAuG;AACvG,MAAM,UAAU,gBAAgB;IAC/B,OAAO,eAAe,CAAI,WAAW,EAAE,oBAAoB,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["// The user's theme choice (slice 11 §4b): one dark and one light theme id per principal, a preference the server keeps\n// (the kit serves it) and every page and terminal of that principal holds, so choosing a theme restyles them all at\n// once. An id is at most 128 characters (fix round 1: Opus M4, Fable L7).\n\nimport { nul, obj, str, union } from \"../contracts/index.ts\";\nimport type { Principal } from \"../data/index.ts\";\nimport type { Facet } from \"../host/index.ts\";\nimport { preferenceContract, preferenceFacet } from \"./preference.ts\";\nimport type { ThemePick } from \"./themes.ts\";\n\n/** A theme id (at most 128 characters), or `null` for the first contributed theme of its mode. */\nconst ThemeId = union([str({ max: 128 }), nul()]);\n\n/** A pick: a theme id per mode. */\nconst Pick = obj({ dark: ThemeId, light: ThemeId });\n\n/** The caller's theme choice, on the server: its pick, and `choose` to change it. */\nexport const ThemeChoice = preferenceContract(\"chord.themes.choice\", Pick);\n\n/** No choice yet: the first contributed theme of each mode. */\nconst NO_PICK: ThemePick = { dark: null, light: null };\n\n/** The kit's server facet for theme choices: the store of picks and each principal's `ThemeChoice`. */\nexport function themeChoiceFacet<P extends Principal>(): Facet<P> {\n\treturn preferenceFacet<P>(ThemeChoice, \"chord.themes.picks\", Pick, NO_PICK);\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Principal } from "../data/index.ts";
|
|
2
|
+
import { type Facet } from "../host/index.ts";
|
|
3
|
+
import { type Registry } from "../registries/index.ts";
|
|
4
|
+
/** The roles every theme names: the kit's base set. Apps add their own roles; themes fill at least these. */
|
|
5
|
+
export declare const BASE_ROLES: readonly ["accent", "bg", "fg", "muted", "error", "warning", "success"];
|
|
6
|
+
/** A base role. */
|
|
7
|
+
export type BaseRole = (typeof BASE_ROLES)[number];
|
|
8
|
+
/** A theme: an id, a name, its mode, a colour per role (CSS colours; `#rrggbb` for terminals), web and terminal extras. */
|
|
9
|
+
export type Theme = {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly mode: "dark" | "light";
|
|
13
|
+
readonly colors: Readonly<Record<BaseRole, string>> & Readonly<Record<string, string>>;
|
|
14
|
+
/** More CSS variables on `:root`, by name without `--` (`radius`, `font`); URLs of the plugin's assets allowed. */
|
|
15
|
+
readonly web?: Readonly<Record<string, string>>;
|
|
16
|
+
/** Terminal colours by role, before `colors`: `#rrggbb` or an xterm 256-colour index (`"208"`). */
|
|
17
|
+
readonly tui?: Readonly<Record<string, string>>;
|
|
18
|
+
};
|
|
19
|
+
/** The themes plugins contribute, in plugin-name order; served on every client and on the server by the kit. */
|
|
20
|
+
export declare const Themes: Registry<Theme, readonly Theme[]>;
|
|
21
|
+
/** The kit's facet serving `Themes` on a host: the contributions as they are, in plugin-name order. */
|
|
22
|
+
export declare function themesFacet<P extends Principal>(): Facet<P>;
|
|
23
|
+
/** The theme used when no plugin contributed one of a mode: neutral colours. */
|
|
24
|
+
export declare const FALLBACK_THEMES: Readonly<Record<Theme["mode"], Theme>>;
|
|
25
|
+
/** The user's choice: a theme id for dark and one for light (`null`: the first contributed of that mode). */
|
|
26
|
+
export type ThemePick = {
|
|
27
|
+
readonly dark: string | null;
|
|
28
|
+
readonly light: string | null;
|
|
29
|
+
};
|
|
30
|
+
/** The active theme for `mode`: the one `pick` names if contributed, else the first of that mode, else the fallback. */
|
|
31
|
+
export declare function activeTheme(themes: readonly Theme[], pick: ThemePick, mode: Theme["mode"]): Theme;
|
|
32
|
+
/** The CSS custom properties of `theme`: `--<role>` for every colour, then `--<name>` for each `web` extra. */
|
|
33
|
+
export declare function themeVariables(theme: Theme): Readonly<Record<string, string>>;
|
|
34
|
+
/** How many colours a terminal shows. */
|
|
35
|
+
export type ColorDepth = "truecolor" | "256";
|
|
36
|
+
/**
|
|
37
|
+
* The SGR parameters of `role`'s colour in `theme` for a terminal of `depth` (`38;2;r;g;b`, `38;5;n`; `48;…` for a
|
|
38
|
+
* background): the role's `tui` override first, else its colour, else the fallback theme's; a `#rrggbb` colour is the
|
|
39
|
+
* nearest of the 256 xterm colours on a 256-colour terminal. A role nobody defines, or a colour that is no `#rrggbb`,
|
|
40
|
+
* gives the terminal's default (`39`, `49`).
|
|
41
|
+
*/
|
|
42
|
+
export declare function terminalColor(theme: Theme, role: string, depth: ColorDepth, layer: "fg" | "bg"): string;
|
|
43
|
+
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/surfaces/themes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvE,6GAA6G;AAC7G,eAAO,MAAM,UAAU,YAAI,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAElG,mBAAmB;A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I,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAIjG;AAED,+GAA+G;AAC/G,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAK7E;AAED,yCAAyC;AACzC,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,KAAK,CAAC;AAE7C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,MAAM,CASvG"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Looks and themes (slice 11 §4b, decision "Looks and themes", `docs/theming/`): a theme is data in one registry,
|
|
2
|
+
// `Themes`, that plugins contribute to on any host kind; a page writes the active theme as CSS custom properties on
|
|
3
|
+
// `:root`, a terminal looks colours up by role. A theme names a colour for each role (the kit's base roles, and roles
|
|
4
|
+
// an app adds), with `web` extras (more CSS variables: radii, fonts) and `tui` overrides (a colour per role for
|
|
5
|
+
// terminals). The user picks one dark and one light theme (`ThemeChoice`); the system's mode chooses between them.
|
|
6
|
+
import { defineFacet } from "../host/index.js";
|
|
7
|
+
import { defineRegistry } from "../registries/index.js";
|
|
8
|
+
/** The roles every theme names: the kit's base set. Apps add their own roles; themes fill at least these. */
|
|
9
|
+
export const BASE_ROLES = ["accent", "bg", "fg", "muted", "error", "warning", "success"];
|
|
10
|
+
/** The themes plugins contribute, in plugin-name order; served on every client and on the server by the kit. */
|
|
11
|
+
export const Themes = defineRegistry("chord.themes", {
|
|
12
|
+
version: 1,
|
|
13
|
+
});
|
|
14
|
+
/** The kit's facet serving `Themes` on a host: the contributions as they are, in plugin-name order. */
|
|
15
|
+
export function themesFacet() {
|
|
16
|
+
return defineFacet((host) => host.serve(Themes, { compose: (table) => table.map(({ value }) => value) }));
|
|
17
|
+
}
|
|
18
|
+
/** The theme used when no plugin contributed one of a mode: neutral colours. */
|
|
19
|
+
export const FALLBACK_THEMES = {
|
|
20
|
+
dark: {
|
|
21
|
+
id: "chord.dark",
|
|
22
|
+
name: "Dark",
|
|
23
|
+
mode: "dark",
|
|
24
|
+
colors: {
|
|
25
|
+
accent: "#4c9aff",
|
|
26
|
+
bg: "#16181d",
|
|
27
|
+
fg: "#e6e6e6",
|
|
28
|
+
muted: "#8a8f98",
|
|
29
|
+
error: "#ff6b6b",
|
|
30
|
+
warning: "#f0b429",
|
|
31
|
+
success: "#3ecf8e",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
light: {
|
|
35
|
+
id: "chord.light",
|
|
36
|
+
name: "Light",
|
|
37
|
+
mode: "light",
|
|
38
|
+
colors: {
|
|
39
|
+
accent: "#0b62d6",
|
|
40
|
+
bg: "#ffffff",
|
|
41
|
+
fg: "#1c1e21",
|
|
42
|
+
muted: "#6b7280",
|
|
43
|
+
error: "#c62828",
|
|
44
|
+
warning: "#b26a00",
|
|
45
|
+
success: "#1b7f4b",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
/** The active theme for `mode`: the one `pick` names if contributed, else the first of that mode, else the fallback. */
|
|
50
|
+
export function activeTheme(themes, pick, mode) {
|
|
51
|
+
const wanted = pick[mode];
|
|
52
|
+
const ofMode = themes.filter((theme) => theme.mode === mode);
|
|
53
|
+
return ofMode.find((theme) => theme.id === wanted) ?? ofMode[0] ?? FALLBACK_THEMES[mode];
|
|
54
|
+
}
|
|
55
|
+
/** The CSS custom properties of `theme`: `--<role>` for every colour, then `--<name>` for each `web` extra. */
|
|
56
|
+
export function themeVariables(theme) {
|
|
57
|
+
const variables = {};
|
|
58
|
+
for (const [role, color] of Object.entries(theme.colors))
|
|
59
|
+
variables[`--${role}`] = color;
|
|
60
|
+
for (const [name, value] of Object.entries(theme.web ?? {}))
|
|
61
|
+
variables[`--${name}`] = value;
|
|
62
|
+
return variables;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The SGR parameters of `role`'s colour in `theme` for a terminal of `depth` (`38;2;r;g;b`, `38;5;n`; `48;…` for a
|
|
66
|
+
* background): the role's `tui` override first, else its colour, else the fallback theme's; a `#rrggbb` colour is the
|
|
67
|
+
* nearest of the 256 xterm colours on a 256-colour terminal. A role nobody defines, or a colour that is no `#rrggbb`,
|
|
68
|
+
* gives the terminal's default (`39`, `49`).
|
|
69
|
+
*/
|
|
70
|
+
export function terminalColor(theme, role, depth, layer) {
|
|
71
|
+
const fallback = FALLBACK_THEMES[theme.mode].colors;
|
|
72
|
+
const color = theme.tui?.[role] ?? theme.colors[role] ?? fallback[role];
|
|
73
|
+
const base = layer === "fg" ? "38" : "48";
|
|
74
|
+
if (color !== undefined && /^\d{1,3}$/.test(color) && Number(color) < 256)
|
|
75
|
+
return `${base};5;${color}`;
|
|
76
|
+
const rgb = color === undefined ? undefined : parseHex(color);
|
|
77
|
+
if (rgb === undefined)
|
|
78
|
+
return layer === "fg" ? "39" : "49";
|
|
79
|
+
if (depth === "truecolor")
|
|
80
|
+
return `${base};2;${rgb.join(";")}`;
|
|
81
|
+
return `${base};5;${nearest256(rgb)}`;
|
|
82
|
+
}
|
|
83
|
+
/** The red, green and blue of a `#rrggbb` colour. */
|
|
84
|
+
function parseHex(color) {
|
|
85
|
+
const match = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);
|
|
86
|
+
if (match === null)
|
|
87
|
+
return undefined;
|
|
88
|
+
return [Number.parseInt(match[1], 16), Number.parseInt(match[2], 16), Number.parseInt(match[3], 16)];
|
|
89
|
+
}
|
|
90
|
+
/** The levels of the xterm 6×6×6 colour cube. */
|
|
91
|
+
const CUBE = [0, 95, 135, 175, 215, 255];
|
|
92
|
+
/** The nearest xterm 256-colour index to `rgb`: the nearer of the colour cube's (16–231) and the grey ramp's (232–255). */
|
|
93
|
+
function nearest256(rgb) {
|
|
94
|
+
const level = (value) => {
|
|
95
|
+
let best = 0;
|
|
96
|
+
for (let index = 1; index < CUBE.length; index++) {
|
|
97
|
+
if (Math.abs(CUBE[index] - value) < Math.abs(CUBE[best] - value))
|
|
98
|
+
best = index;
|
|
99
|
+
}
|
|
100
|
+
return best;
|
|
101
|
+
};
|
|
102
|
+
const [r, g, b] = rgb.map(level);
|
|
103
|
+
const cube = [CUBE[r], CUBE[g], CUBE[b]];
|
|
104
|
+
const average = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
105
|
+
const grey = Math.max(0, Math.min(23, Math.round((average - 8) / 10)));
|
|
106
|
+
const greyValue = 8 + grey * 10;
|
|
107
|
+
const distance = (other) => (other[0] - rgb[0]) ** 2 + (other[1] - rgb[1]) ** 2 + (other[2] - rgb[2]) ** 2;
|
|
108
|
+
return distance([greyValue, greyValue, greyValue]) < distance(cube) ? 232 + grey : 16 + 36 * r + 6 * g + b;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=themes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../src/surfaces/themes.ts"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,oHAAoH;AACpH,sHAAsH;AACtH,gHAAgH;AAChH,mHAAmH;AAGnH,OAAO,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAiB,MAAM,wBAAwB,CAAC;AAEvE,6GAA6G;AAC7G,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAiBlG,gHAAgH;AAChH,MAAM,CAAC,MAAM,MAAM,GAAsC,cAAc,CAA0B,cAAc,EAAE;IAChH,OAAO,EAAE,CAAC;CACV,CAAC,CAAC;AAEH,uGAAuG;AACvG,MAAM,UAAU,WAAW;IAC1B,OAAO,WAAW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AC5G,CAAC","sourcesContent":["// Looks and themes (slice 11 §4b, decision \"Looks and themes\", `docs/theming/`): a theme is data in one registry,\n// `Themes`, that plugins contribute to on any host kind; a page writes the active theme as CSS custom properties on\n// `:root`, a terminal looks colours up by role. A theme names a colour for each role (the kit's base roles, and roles\n// an app adds), with `web` extras (more CSS variables: radii, fonts) and `tui` overrides (a colour per role for\n// terminals). The user picks one dark and one light theme (`ThemeChoice`); the system's mode chooses between them.\n\nimport type { Principal } from \"../data/index.ts\";\nimport { defineFacet, type Facet } from \"../host/index.ts\";\nimport { defineRegistry, type Registry } from \"../registries/index.ts\";\n\n/** The roles every theme names: the kit's base set. Apps add their own roles; themes fill at least these. */\nexport const BASE_ROLES = [\"accent\", \"bg\", \"fg\", \"muted\", \"error\", \"warning\", \"success\"] as const;\n\n/** A base role. */\nexport type BaseRole = (typeof BASE_ROLES)[number];\n\n/** A theme: an id, a name, its mode, a colour per role (CSS colours; `#rrggbb` for terminals), web and terminal extras. */\nexport type Theme = {\n\treadonly id: string;\n\treadonly name: string;\n\treadonly mode: \"dark\" | \"light\";\n\treadonly colors: Readonly<Record<BaseRole, string>> & Readonly<Record<string, string>>;\n\t/** More CSS variables on `:root`, by name without `--` (`radius`, `font`); URLs of the plugin's assets allowed. */\n\treadonly web?: Readonly<Record<string, string>>;\n\t/** Terminal colours by role, before `colors`: `#rrggbb` or an xterm 256-colour index (`\"208\"`). */\n\treadonly tui?: Readonly<Record<string, string>>;\n};\n\n/** The themes plugins contribute, in plugin-name order; served on every client and on the server by the kit. */\nexport const Themes: Registry<Theme, readonly Theme[]> = defineRegistry<Theme, readonly Theme[]>(\"chord.themes\", {\n\tversion: 1,\n});\n\n/** The kit's facet serving `Themes` on a host: the contributions as they are, in plugin-name order. */\nexport function themesFacet<P extends Principal>(): Facet<P> {\n\treturn defineFacet<P>((host) => host.serve(Themes, { compose: (table) => table.map(({ value }) => value) }));\n}\n\n/** The theme used when no plugin contributed one of a mode: neutral colours. */\nexport const FALLBACK_THEMES: Readonly<Record<Theme[\"mode\"], Theme>> = {\n\tdark: {\n\t\tid: \"chord.dark\",\n\t\tname: \"Dark\",\n\t\tmode: \"dark\",\n\t\tcolors: {\n\t\t\taccent: \"#4c9aff\",\n\t\t\tbg: \"#16181d\",\n\t\t\tfg: \"#e6e6e6\",\n\t\t\tmuted: \"#8a8f98\",\n\t\t\terror: \"#ff6b6b\",\n\t\t\twarning: \"#f0b429\",\n\t\t\tsuccess: \"#3ecf8e\",\n\t\t},\n\t},\n\tlight: {\n\t\tid: \"chord.light\",\n\t\tname: \"Light\",\n\t\tmode: \"light\",\n\t\tcolors: {\n\t\t\taccent: \"#0b62d6\",\n\t\t\tbg: \"#ffffff\",\n\t\t\tfg: \"#1c1e21\",\n\t\t\tmuted: \"#6b7280\",\n\t\t\terror: \"#c62828\",\n\t\t\twarning: \"#b26a00\",\n\t\t\tsuccess: \"#1b7f4b\",\n\t\t},\n\t},\n};\n\n/** The user's choice: a theme id for dark and one for light (`null`: the first contributed of that mode). */\nexport type ThemePick = { readonly dark: string | null; readonly light: string | null };\n\n/** The active theme for `mode`: the one `pick` names if contributed, else the first of that mode, else the fallback. */\nexport function activeTheme(themes: readonly Theme[], pick: ThemePick, mode: Theme[\"mode\"]): Theme {\n\tconst wanted = pick[mode];\n\tconst ofMode = themes.filter((theme) => theme.mode === mode);\n\treturn ofMode.find((theme) => theme.id === wanted) ?? ofMode[0] ?? FALLBACK_THEMES[mode];\n}\n\n/** The CSS custom properties of `theme`: `--<role>` for every colour, then `--<name>` for each `web` extra. */\nexport function themeVariables(theme: Theme): Readonly<Record<string, string>> {\n\tconst variables: Record<string, string> = {};\n\tfor (const [role, color] of Object.entries(theme.colors)) variables[`--${role}`] = color;\n\tfor (const [name, value] of Object.entries(theme.web ?? {})) variables[`--${name}`] = value;\n\treturn variables;\n}\n\n/** How many colours a terminal shows. */\nexport type ColorDepth = \"truecolor\" | \"256\";\n\n/**\n * The SGR parameters of `role`'s colour in `theme` for a terminal of `depth` (`38;2;r;g;b`, `38;5;n`; `48;…` for a\n * background): the role's `tui` override first, else its colour, else the fallback theme's; a `#rrggbb` colour is the\n * nearest of the 256 xterm colours on a 256-colour terminal. A role nobody defines, or a colour that is no `#rrggbb`,\n * gives the terminal's default (`39`, `49`).\n */\nexport function terminalColor(theme: Theme, role: string, depth: ColorDepth, layer: \"fg\" | \"bg\"): string {\n\tconst fallback = FALLBACK_THEMES[theme.mode].colors as Readonly<Record<string, string>>;\n\tconst color = theme.tui?.[role] ?? theme.colors[role] ?? fallback[role];\n\tconst base = layer === \"fg\" ? \"38\" : \"48\";\n\tif (color !== undefined && /^\\d{1,3}$/.test(color) && Number(color) < 256) return `${base};5;${color}`;\n\tconst rgb = color === undefined ? undefined : parseHex(color);\n\tif (rgb === undefined) return layer === \"fg\" ? \"39\" : \"49\";\n\tif (depth === \"truecolor\") return `${base};2;${rgb.join(\";\")}`;\n\treturn `${base};5;${nearest256(rgb)}`;\n}\n\n/** The red, green and blue of a `#rrggbb` colour. */\nfunction parseHex(color: string): readonly [number, number, number] | undefined {\n\tconst match = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);\n\tif (match === null) return undefined;\n\treturn [Number.parseInt(match[1]!, 16), Number.parseInt(match[2]!, 16), Number.parseInt(match[3]!, 16)];\n}\n\n/** The levels of the xterm 6×6×6 colour cube. */\nconst CUBE = [0, 95, 135, 175, 215, 255];\n\n/** The nearest xterm 256-colour index to `rgb`: the nearer of the colour cube's (16–231) and the grey ramp's (232–255). */\nfunction nearest256(rgb: readonly [number, number, number]): number {\n\tconst level = (value: number): number => {\n\t\tlet best = 0;\n\t\tfor (let index = 1; index < CUBE.length; index++) {\n\t\t\tif (Math.abs(CUBE[index]! - value) < Math.abs(CUBE[best]! - value)) best = index;\n\t\t}\n\t\treturn best;\n\t};\n\tconst [r, g, b] = rgb.map(level) as [number, number, number];\n\tconst cube = [CUBE[r]!, CUBE[g]!, CUBE[b]!] as const;\n\tconst average = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\tconst grey = Math.max(0, Math.min(23, Math.round((average - 8) / 10)));\n\tconst greyValue = 8 + grey * 10;\n\tconst distance = (other: readonly number[]): number =>\n\t\t(other[0]! - rgb[0]) ** 2 + (other[1]! - rgb[1]) ** 2 + (other[2]! - rgb[2]) ** 2;\n\treturn distance([greyValue, greyValue, greyValue]) < distance(cube) ? 232 + grey : 16 + 36 * r + 6 * g + b;\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Principal } from "../data/index.ts";
|
|
2
|
+
import { type Facet } from "../host/index.ts";
|
|
3
|
+
import { type ComposeContext, type Registry, type RegistryTable, type TableItem } from "../registries/index.ts";
|
|
4
|
+
import type { Catalog } from "./messages.ts";
|
|
5
|
+
/** One catalog: the messages of `namespace` in `locale`; `override: true` replaces the plugin's own for that locale. */
|
|
6
|
+
export type Translation = {
|
|
7
|
+
readonly namespace: string;
|
|
8
|
+
readonly locale: string;
|
|
9
|
+
/** Partial allowed: a missing key falls back (the locale's base, then the namespace's first catalog). */
|
|
10
|
+
readonly messages: Catalog;
|
|
11
|
+
readonly override?: true;
|
|
12
|
+
};
|
|
13
|
+
/** The composed catalogs: the one used per namespace and canonical locale, with its plugin; every locale offered. */
|
|
14
|
+
export type TranslationIndex = {
|
|
15
|
+
readonly catalogs: ReadonlyMap<string, ReadonlyMap<string, TableItem<Translation>>>;
|
|
16
|
+
/** Every locale some catalog offers, canonical (`pt-BR`), sorted. */
|
|
17
|
+
readonly locales: readonly string[];
|
|
18
|
+
};
|
|
19
|
+
/** The catalogs plugins contribute, a list per contributor; served on the server, pages and terminals by the kit. */
|
|
20
|
+
export declare const Translations: Registry<readonly Translation[], TranslationIndex>;
|
|
21
|
+
/** No catalogs: what a host's language has before its `Translations` value arrives. */
|
|
22
|
+
export declare const NO_TRANSLATIONS: TranslationIndex;
|
|
23
|
+
/** The kit's facet serving `Translations` on a host. */
|
|
24
|
+
export declare function translationsFacet<P extends Principal>(): Facet<P>;
|
|
25
|
+
/** The index of `table`: per namespace and locale the winning catalog; conflicts and invalid locales reported. */
|
|
26
|
+
export declare function composeTranslations(table: RegistryTable<readonly Translation[]>, { report }: ComposeContext): TranslationIndex;
|
|
27
|
+
/** `locale` canonical (`pt-br` is `pt-BR`), or `undefined` when it is no language tag. */
|
|
28
|
+
export declare function canonicalLocale(locale: string): string | undefined;
|
|
29
|
+
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../src/surfaces/translations.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACN,KAAK,cAAc,EAEnB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,wHAAwH;AACxH,MAAM,MAAM,WAAW,GAAG;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yGAAyG;IACzG,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC;CACzB,CAAC;AAEF,qHAAqH;AACrH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACpF,qEAAqE;IACrE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC,CAAC;AAEF,qHAAqH;AACrH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,SAAS,WAAW,EAAE,EAAE,gBAAgB,CAGrC,CAAC;AAExC,uFAAuF;AACvF,eAAO,MAAM,eAAe,EAAE,gBAAuD,CAAC;AAEtF,wDAAwD;AACxD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,SAAS,KAAK,KAAK,CAAC,CAAC,CAAC,CAEjE;AAED,kHAAkH;AAClH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,aAAa,CAAC,SAAS,WAAW,EAAE,CAAC,EAC5C,EAAE,MAAM,EAAE,EAAE,cAAc,GACxB,gBAAgB,CA4BlB;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMlE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Languages as contributions (decision "Messages and languages in the app kit" (2), refined in the build): the
|
|
2
|
+
// `Translations` registry, served on the server, pages and terminals by the kit. A contribution is a list of catalogs,
|
|
3
|
+
// `{ namespace, locale, messages, override? }`: a plugin contributes its own catalogs (`t.translations`) from each
|
|
4
|
+
// facet that renders, a translation plugin its catalogs for other plugins. The composed index has one catalog per
|
|
5
|
+
// namespace and locale: the first by plugin name wins and the other is reported, except that `override: true` wins over
|
|
6
|
+
// a catalog without it. Registries are per host, so catalogs (they hold functions) never cross links.
|
|
7
|
+
import { defineFacet } from "../host/index.js";
|
|
8
|
+
import { defineRegistry, } from "../registries/index.js";
|
|
9
|
+
/** The catalogs plugins contribute, a list per contributor; served on the server, pages and terminals by the kit. */
|
|
10
|
+
export const Translations = defineRegistry("chord.translations", { version: 1 });
|
|
11
|
+
/** No catalogs: what a host's language has before its `Translations` value arrives. */
|
|
12
|
+
export const NO_TRANSLATIONS = { catalogs: new Map(), locales: [] };
|
|
13
|
+
/** The kit's facet serving `Translations` on a host. */
|
|
14
|
+
export function translationsFacet() {
|
|
15
|
+
return defineFacet((host) => host.serve(Translations, { compose: composeTranslations }));
|
|
16
|
+
}
|
|
17
|
+
/** The index of `table`: per namespace and locale the winning catalog; conflicts and invalid locales reported. */
|
|
18
|
+
export function composeTranslations(table, { report }) {
|
|
19
|
+
const catalogs = new Map();
|
|
20
|
+
const locales = new Set();
|
|
21
|
+
for (const { value, plugin } of table) {
|
|
22
|
+
for (const translation of value) {
|
|
23
|
+
const locale = canonicalLocale(translation.locale);
|
|
24
|
+
if (locale === undefined) {
|
|
25
|
+
report({ message: `"${translation.locale}" is no locale (${translation.namespace})`, plugins: [plugin] });
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
locales.add(locale);
|
|
29
|
+
let byLocale = catalogs.get(translation.namespace);
|
|
30
|
+
if (byLocale === undefined) {
|
|
31
|
+
byLocale = new Map();
|
|
32
|
+
catalogs.set(translation.namespace, byLocale);
|
|
33
|
+
}
|
|
34
|
+
const taken = byLocale.get(locale);
|
|
35
|
+
if (taken === undefined || (translation.override === true && taken.value.override !== true)) {
|
|
36
|
+
byLocale.set(locale, { value: translation, plugin });
|
|
37
|
+
}
|
|
38
|
+
else if ((translation.override === true) === (taken.value.override === true)) {
|
|
39
|
+
report({
|
|
40
|
+
message: `${translation.namespace} in ${locale} is contributed twice`,
|
|
41
|
+
plugins: [taken.plugin, plugin],
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return { catalogs, locales: [...locales].sort() };
|
|
47
|
+
}
|
|
48
|
+
/** `locale` canonical (`pt-br` is `pt-BR`), or `undefined` when it is no language tag. */
|
|
49
|
+
export function canonicalLocale(locale) {
|
|
50
|
+
try {
|
|
51
|
+
return Intl.getCanonicalLocales(locale)[0];
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=translations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.js","sourceRoot":"","sources":["../../src/surfaces/translations.ts"],"names":[],"mappings":"AAAA,+GAA+G;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ClB,CAAC;AACF,CAAC","sourcesContent":["// Languages as contributions (decision \"Messages and languages in the app kit\" (2), refined in the build): the\n// `Translations` registry, served on the server, pages and terminals by the kit. A contribution is a list of catalogs,\n// `{ namespace, locale, messages, override? }`: a plugin contributes its own catalogs (`t.translations`) from each\n// facet that renders, a translation plugin its catalogs for other plugins. The composed index has one catalog per\n// namespace and locale: the first by plugin name wins and the other is reported, except that `override: true` wins over\n// a catalog without it. Registries are per host, so catalogs (they hold functions) never cross links.\n\nimport type { Principal } from \"../data/index.ts\";\nimport { defineFacet, type Facet } from \"../host/index.ts\";\nimport {\n\ttype ComposeContext,\n\tdefineRegistry,\n\ttype Registry,\n\ttype RegistryTable,\n\ttype TableItem,\n} from \"../registries/index.ts\";\nimport type { Catalog } from \"./messages.ts\";\n\n/** One catalog: the messages of `namespace` in `locale`; `override: true` replaces the plugin's own for that locale. */\nexport type Translation = {\n\treadonly namespace: string;\n\treadonly locale: string;\n\t/** Partial allowed: a missing key falls back (the locale's base, then the namespace's first catalog). */\n\treadonly messages: Catalog;\n\treadonly override?: true;\n};\n\n/** The composed catalogs: the one used per namespace and canonical locale, with its plugin; every locale offered. */\nexport type TranslationIndex = {\n\treadonly catalogs: ReadonlyMap<string, ReadonlyMap<string, TableItem<Translation>>>;\n\t/** Every locale some catalog offers, canonical (`pt-BR`), sorted. */\n\treadonly locales: readonly string[];\n};\n\n/** The catalogs plugins contribute, a list per contributor; served on the server, pages and terminals by the kit. */\nexport const Translations: Registry<readonly Translation[], TranslationIndex> = defineRegistry<\n\treadonly Translation[],\n\tTranslationIndex\n>(\"chord.translations\", { version: 1 });\n\n/** No catalogs: what a host's language has before its `Translations` value arrives. */\nexport const NO_TRANSLATIONS: TranslationIndex = { catalogs: new Map(), locales: [] };\n\n/** The kit's facet serving `Translations` on a host. */\nexport function translationsFacet<P extends Principal>(): Facet<P> {\n\treturn defineFacet<P>((host) => host.serve(Translations, { compose: composeTranslations }));\n}\n\n/** The index of `table`: per namespace and locale the winning catalog; conflicts and invalid locales reported. */\nexport function composeTranslations(\n\ttable: RegistryTable<readonly Translation[]>,\n\t{ report }: ComposeContext,\n): TranslationIndex {\n\tconst catalogs = new Map<string, Map<string, TableItem<Translation>>>();\n\tconst locales = new Set<string>();\n\tfor (const { value, plugin } of table) {\n\t\tfor (const translation of value) {\n\t\t\tconst locale = canonicalLocale(translation.locale);\n\t\t\tif (locale === undefined) {\n\t\t\t\treport({ message: `\"${translation.locale}\" is no locale (${translation.namespace})`, plugins: [plugin] });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tlocales.add(locale);\n\t\t\tlet byLocale = catalogs.get(translation.namespace);\n\t\t\tif (byLocale === undefined) {\n\t\t\t\tbyLocale = new Map();\n\t\t\t\tcatalogs.set(translation.namespace, byLocale);\n\t\t\t}\n\t\t\tconst taken = byLocale.get(locale);\n\t\t\tif (taken === undefined || (translation.override === true && taken.value.override !== true)) {\n\t\t\t\tbyLocale.set(locale, { value: translation, plugin });\n\t\t\t} else if ((translation.override === true) === (taken.value.override === true)) {\n\t\t\t\treport({\n\t\t\t\t\tmessage: `${translation.namespace} in ${locale} is contributed twice`,\n\t\t\t\t\tplugins: [taken.plugin, plugin],\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn { catalogs, locales: [...locales].sort() };\n}\n\n/** `locale` canonical (`pt-br` is `pt-BR`), or `undefined` when it is no language tag. */\nexport function canonicalLocale(locale: string): string | undefined {\n\ttry {\n\t\treturn Intl.getCanonicalLocales(locale)[0];\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { RefState } from "../host/index.ts";
|
|
2
|
+
import type { NativeWatchable } from "../watch.ts";
|
|
3
|
+
/** A reference to a remote contract, held or got: its state and the variant it is bound in. */
|
|
4
|
+
export type VariantRef = {
|
|
5
|
+
readonly state: NativeWatchable<RefState>;
|
|
6
|
+
readonly variant: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/** The variants `R` can be bound in. */
|
|
9
|
+
export type VariantOf<R extends VariantRef> = R extends {
|
|
10
|
+
readonly variant: infer V;
|
|
11
|
+
} ? Exclude<V, undefined> : never;
|
|
12
|
+
/** `R` bound in variant `V`: that variant's members, `variant` narrowed to it. */
|
|
13
|
+
export type InVariant<R extends VariantRef, V extends string> = Extract<R, {
|
|
14
|
+
readonly variant: V | undefined;
|
|
15
|
+
}> & {
|
|
16
|
+
readonly variant: V;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* `ref` when it is live and bound in `variant`, else `undefined`: no reference, loading (also between two variants),
|
|
20
|
+
* failed (denied too), ended, or another variant. True of the moment it is read: no guarantee across an `await`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function liveIn<R extends VariantRef, const V extends VariantOf<R>>(ref: R | undefined, variant: V): InVariant<R, V> | undefined;
|
|
23
|
+
//# sourceMappingURL=variant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variant.d.ts","sourceRoot":"","sources":["../../src/surfaces/variant.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,+FAA+F;AAC/F,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAE7G,wCAAwC;AACxC,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,SAAS;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC;AAEtH,kFAAkF;AAClF,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,MAAM,IAAI,OAAO,CAAC,CAAC,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,SAAS,CAAA;CAAE,CAAC,GAAG;IACjH,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACpB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EACxE,GAAG,EAAE,CAAC,GAAG,SAAS,EAClB,OAAO,EAAE,CAAC,GACR,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAK7B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// A remote reference as a UI reads it in one variant (decision "C15 stands; the UI bindings follow the variant"): the
|
|
2
|
+
// reference narrowed to that variant while it is live in it, nothing otherwise. What React's `useVariant` and the TUI
|
|
3
|
+
// scope's `variant` return, each with its own subscription to the reference's state: a held reference's variant is
|
|
4
|
+
// `undefined` until it binds and changes while it is held (an admission's other allowed value binds another variant),
|
|
5
|
+
// and it keeps its last variant while it loads, so the comparison alone would leave an editor's controls up for a
|
|
6
|
+
// reader. References themselves get no such helper (C15): plain code compares `ref.variant`.
|
|
7
|
+
/**
|
|
8
|
+
* `ref` when it is live and bound in `variant`, else `undefined`: no reference, loading (also between two variants),
|
|
9
|
+
* failed (denied too), ended, or another variant. True of the moment it is read: no guarantee across an `await`.
|
|
10
|
+
*/
|
|
11
|
+
export function liveIn(ref, variant) {
|
|
12
|
+
// `variant` throws on a released reference: read only while live.
|
|
13
|
+
if (ref === undefined || ref.state.value.kind !== "live" || ref.variant !== variant)
|
|
14
|
+
return undefined;
|
|
15
|
+
// The discriminant was compared: TypeScript cannot narrow a generic union by it.
|
|
16
|
+
return ref;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=variant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variant.js","sourceRoot":"","sources":["../../src/surfaces/variant.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,sHAAsH;AACtH,mHAAmH;AACnH,sHAAsH;AACtH,kHAAkH;AAClH,6FAA6F;AAgB7F;;;GAGG;AACH,MAAM,UAAU,MAAM,CACrB,GAAkB,EAClB,OAAU;IAEV,kEAAkE;IAClE,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,GAAG,CAAC,OAAO,KAAK,OAAO;QAAE,OAAO,SAAS,CAAC;IACtG,iFAAiF;IACjF,OAAO,GAAsB,CAAC;AAC/B,CAAC","sourcesContent":["// A remote reference as a UI reads it in one variant (decision \"C15 stands; the UI bindings follow the variant\"): the\n// reference narrowed to that variant while it is live in it, nothing otherwise. What React's `useVariant` and the TUI\n// scope's `variant` return, each with its own subscription to the reference's state: a held reference's variant is\n// `undefined` until it binds and changes while it is held (an admission's other allowed value binds another variant),\n// and it keeps its last variant while it loads, so the comparison alone would leave an editor's controls up for a\n// reader. References themselves get no such helper (C15): plain code compares `ref.variant`.\n\nimport type { RefState } from \"../host/index.ts\";\nimport type { NativeWatchable } from \"../watch.ts\";\n\n/** A reference to a remote contract, held or got: its state and the variant it is bound in. */\nexport type VariantRef = { readonly state: NativeWatchable<RefState>; readonly variant: string | undefined };\n\n/** The variants `R` can be bound in. */\nexport type VariantOf<R extends VariantRef> = R extends { readonly variant: infer V } ? Exclude<V, undefined> : never;\n\n/** `R` bound in variant `V`: that variant's members, `variant` narrowed to it. */\nexport type InVariant<R extends VariantRef, V extends string> = Extract<R, { readonly variant: V | undefined }> & {\n\treadonly variant: V;\n};\n\n/**\n * `ref` when it is live and bound in `variant`, else `undefined`: no reference, loading (also between two variants),\n * failed (denied too), ended, or another variant. True of the moment it is read: no guarantee across an `await`.\n */\nexport function liveIn<R extends VariantRef, const V extends VariantOf<R>>(\n\tref: R | undefined,\n\tvariant: V,\n): InVariant<R, V> | undefined {\n\t// `variant` throws on a released reference: read only while live.\n\tif (ref === undefined || ref.state.value.kind !== \"live\" || ref.variant !== variant) return undefined;\n\t// The discriminant was compared: TypeScript cannot narrow a generic union by it.\n\treturn ref as InVariant<R, V>;\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ArchivePart } from "../store/archive.ts";
|
|
2
|
+
import type { OutboxCommit } from "../store/outbox.ts";
|
|
3
|
+
/** A body on the remote: its bytes in chunks, read once. */
|
|
4
|
+
export type SyncBody = AsyncIterable<Uint8Array>;
|
|
5
|
+
/** A batch body: `commits` as gzip-compressed JSON lines, read from `commits` only as the body is read. */
|
|
6
|
+
export declare function encodeBatch(commits: Iterable<OutboxCommit> | AsyncIterable<OutboxCommit>): SyncBody;
|
|
7
|
+
/** The commits of a batch body, in order, as they arrive. */
|
|
8
|
+
export declare function decodeBatch(body: SyncBody): AsyncGenerator<OutboxCommit>;
|
|
9
|
+
/** The commits of a batch body with the size of each line, for callers that bound what they hold. */
|
|
10
|
+
export declare function decodeBatchLines(body: SyncBody): AsyncGenerator<{
|
|
11
|
+
readonly commit: OutboxCommit;
|
|
12
|
+
readonly bytes: number;
|
|
13
|
+
}>;
|
|
14
|
+
/** A snapshot body: a store archive (`store.export()`), one part per JSON line, gzip-compressed. */
|
|
15
|
+
export declare function encodeSnapshot(parts: AsyncIterable<ArchivePart>): SyncBody;
|
|
16
|
+
/** The parts of a snapshot body as they arrive, unchecked: `importStore()` checks them (a trust boundary). */
|
|
17
|
+
export declare function decodeSnapshot(body: SyncBody): AsyncIterable<unknown>;
|
|
18
|
+
//# sourceMappingURL=batch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch.d.ts","sourceRoot":"","sources":["../../src/sync/batch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,4DAA4D;AAC5D,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;AAKjD,2GAA2G;AAC3G,wBAAgB,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,aAAa,CAAC,YAAY,CAAC,GAAG,QAAQ,CAMnG;AAED,6DAA6D;AAC7D,wBAAuB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,cAAc,CAAC,YAAY,CAAC,CAE/E;AAED,qGAAqG;AACrG,wBAAuB,gBAAgB,CACtC,IAAI,EAAE,QAAQ,GACZ,cAAc,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAQ3E;AAED,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,QAAQ,CAE1E;AAED,8GAA8G;AAC9G,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,CAErE"}
|