@dialecte/core 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/hub.worker-B1HcVDhn.js +2 -0
- package/dist/diagnostics/diagnostics.d.ts +4 -0
- package/dist/diagnostics/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics/types.d.ts +6 -1
- package/dist/diagnostics/types.d.ts.map +1 -1
- package/dist/dialecte/create-dialecte-project.d.ts +11 -0
- package/dist/dialecte/create-dialecte-project.d.ts.map +1 -0
- package/dist/dialecte/create-project-factory.d.ts +14 -0
- package/dist/dialecte/create-project-factory.d.ts.map +1 -0
- package/dist/dialecte/define-dialecte.d.ts +12 -0
- package/dist/dialecte/define-dialecte.d.ts.map +1 -0
- package/dist/dialecte/dialecte.constants.d.ts +4 -0
- package/dist/dialecte/dialecte.constants.d.ts.map +1 -0
- package/dist/dialecte/dialecte.types.d.ts +75 -0
- package/dist/dialecte/dialecte.types.d.ts.map +1 -0
- package/dist/dialecte/index.d.ts +4 -0
- package/dist/dialecte/index.d.ts.map +1 -0
- package/dist/{project-DIKdMMHx.js → dialecte-gIPrRzni.js} +8031 -8457
- package/dist/document/bind-extensions.d.ts +4 -1
- package/dist/document/bind-extensions.d.ts.map +1 -1
- package/dist/document/document.d.ts +58 -5
- package/dist/document/document.d.ts.map +1 -1
- package/dist/document/progress/progress.types.d.ts +21 -4
- package/dist/document/progress/progress.types.d.ts.map +1 -1
- package/dist/document/query/find/ancestor/find-ancestor.d.ts +2 -0
- package/dist/document/query/find/ancestor/find-ancestor.d.ts.map +1 -1
- package/dist/document/query/find/by-attribute/find-by-attributes.d.ts +4 -0
- package/dist/document/query/find/by-attribute/find-by-attributes.d.ts.map +1 -1
- package/dist/document/query/find/descendant/find-descendant.d.ts +2 -0
- package/dist/document/query/find/descendant/find-descendant.d.ts.map +1 -1
- package/dist/document/query/get/attribute/get-attribute.d.ts +4 -0
- package/dist/document/query/get/attribute/get-attribute.d.ts.map +1 -1
- package/dist/document/query/get/attribute/get-attributes.d.ts +4 -0
- package/dist/document/query/get/attribute/get-attributes.d.ts.map +1 -1
- package/dist/document/query/get/definition/get-definition.d.ts +2 -0
- package/dist/document/query/get/definition/get-definition.d.ts.map +1 -1
- package/dist/document/query/get/record/get-child.d.ts +2 -0
- package/dist/document/query/get/record/get-child.d.ts.map +1 -1
- package/dist/document/query/get/record/get-children.d.ts +2 -0
- package/dist/document/query/get/record/get-children.d.ts.map +1 -1
- package/dist/document/query/get/record/get-record.d.ts +2 -0
- package/dist/document/query/get/record/get-record.d.ts.map +1 -1
- package/dist/document/query/get/record/get-records-by-tagname.d.ts +2 -0
- package/dist/document/query/get/record/get-records-by-tagname.d.ts.map +1 -1
- package/dist/document/query/get/record/get-records.d.ts +2 -0
- package/dist/document/query/get/record/get-records.d.ts.map +1 -1
- package/dist/document/query/get/record/load-live-records.d.ts +2 -0
- package/dist/document/query/get/record/load-live-records.d.ts.map +1 -1
- package/dist/document/query/get/record/resolve-record.d.ts +2 -0
- package/dist/document/query/get/record/resolve-record.d.ts.map +1 -1
- package/dist/document/query/get/record/staged-lookup.d.ts +4 -0
- package/dist/document/query/get/record/staged-lookup.d.ts.map +1 -1
- package/dist/document/query/get/tree/get-tree.d.ts +6 -0
- package/dist/document/query/get/tree/get-tree.d.ts.map +1 -1
- package/dist/document/query/main.d.ts +50 -15
- package/dist/document/query/main.d.ts.map +1 -1
- package/dist/document/query/snapshot/collect-snapshot.d.ts +2 -0
- package/dist/document/query/snapshot/collect-snapshot.d.ts.map +1 -1
- package/dist/document/query/snapshot/get-snapshot.d.ts +2 -0
- package/dist/document/query/snapshot/get-snapshot.d.ts.map +1 -1
- package/dist/document/query/snapshot/records-to-tree.d.ts +2 -0
- package/dist/document/query/snapshot/records-to-tree.d.ts.map +1 -1
- package/dist/document/query/tree-filter/omit.d.ts +8 -0
- package/dist/document/query/tree-filter/omit.d.ts.map +1 -1
- package/dist/document/query/tree-filter/order.d.ts +5 -2
- package/dist/document/query/tree-filter/order.d.ts.map +1 -1
- package/dist/document/query/tree-filter/unwrap.d.ts +2 -0
- package/dist/document/query/tree-filter/unwrap.d.ts.map +1 -1
- package/dist/document/staged-operations.d.ts +5 -1
- package/dist/document/staged-operations.d.ts.map +1 -1
- package/dist/document/transaction/clone/clone.d.ts +2 -0
- package/dist/document/transaction/clone/clone.d.ts.map +1 -1
- package/dist/document/transaction/commit/commit.d.ts.map +1 -1
- package/dist/document/transaction/commit/merge-operations.d.ts +1 -1
- package/dist/document/transaction/commit/merge-operations.d.ts.map +1 -1
- package/dist/document/transaction/commit/summarize-operations.d.ts +16 -0
- package/dist/document/transaction/commit/summarize-operations.d.ts.map +1 -0
- package/dist/document/transaction/commit/summarize-operations.types.d.ts +17 -0
- package/dist/document/transaction/commit/summarize-operations.types.d.ts.map +1 -0
- package/dist/document/transaction/create/create.d.ts +2 -0
- package/dist/document/transaction/create/create.d.ts.map +1 -1
- package/dist/document/transaction/guard.d.ts +5 -0
- package/dist/document/transaction/guard.d.ts.map +1 -1
- package/dist/document/transaction/index.d.ts +2 -0
- package/dist/document/transaction/index.d.ts.map +1 -1
- package/dist/document/transaction/main.d.ts +46 -16
- package/dist/document/transaction/main.d.ts.map +1 -1
- package/dist/document/transaction/stage-operations.d.ts.map +1 -1
- package/dist/document/transaction/update/update.d.ts +2 -0
- package/dist/document/transaction/update/update.d.ts.map +1 -1
- package/dist/document/types.d.ts +3 -5
- package/dist/document/types.d.ts.map +1 -1
- package/dist/document/types.extensions.d.ts.map +1 -1
- package/dist/engine-store-CIEqgPUb.js +348 -0
- package/dist/engine.constants-DBMjMmV9.js +98 -0
- package/dist/engine.d.ts +9 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +15805 -0
- package/dist/errors/codes.d.ts +451 -0
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/errors/errors.constants.d.ts +3 -0
- package/dist/errors/errors.constants.d.ts.map +1 -0
- package/dist/errors/errors.d.ts +10 -0
- package/dist/errors/errors.d.ts.map +1 -1
- package/dist/errors/types.d.ts +14 -0
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/helpers/assert-fixed.d.ts +3 -1
- package/dist/helpers/assert-fixed.d.ts.map +1 -1
- package/dist/helpers/assert-xml-characters.d.ts +35 -0
- package/dist/helpers/assert-xml-characters.d.ts.map +1 -0
- package/dist/helpers/assert-xml-characters.types.d.ts +26 -0
- package/dist/helpers/assert-xml-characters.types.d.ts.map +1 -0
- package/dist/helpers/assert-xsi-type.d.ts +4 -0
- package/dist/helpers/assert-xsi-type.d.ts.map +1 -1
- package/dist/helpers/converter.d.ts +21 -6
- package/dist/helpers/converter.d.ts.map +1 -1
- package/dist/helpers/evaluate-expectations.d.ts +21 -0
- package/dist/helpers/evaluate-expectations.d.ts.map +1 -0
- package/dist/helpers/evaluate-expectations.types.d.ts +31 -0
- package/dist/helpers/evaluate-expectations.types.d.ts.map +1 -0
- package/dist/helpers/guard.d.ts +24 -4
- package/dist/helpers/guard.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/merge-extensions.d.ts +2 -0
- package/dist/helpers/merge-extensions.d.ts.map +1 -1
- package/dist/helpers/read-attributes.d.ts +4 -0
- package/dist/helpers/read-attributes.d.ts.map +1 -1
- package/dist/helpers/standardizing.d.ts +10 -0
- package/dist/helpers/standardizing.d.ts.map +1 -1
- package/dist/helpers/strip-attributes.d.ts +2 -0
- package/dist/helpers/strip-attributes.d.ts.map +1 -1
- package/dist/helpers-DVShv41E.js +489 -0
- package/dist/helpers.js +3 -439
- package/dist/in-process-link-DBeAOZRp.js +2791 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -12
- package/dist/perf/create-perf.d.ts +8 -1
- package/dist/perf/create-perf.d.ts.map +1 -1
- package/dist/perf/index.d.ts +1 -1
- package/dist/perf/index.d.ts.map +1 -1
- package/dist/perf/noop-perf.d.ts.map +1 -1
- package/dist/perf/perf.types.d.ts +65 -6
- package/dist/perf/perf.types.d.ts.map +1 -1
- package/dist/project/index.d.ts +7 -5
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/io/export-blob.d.ts +5 -2
- package/dist/project/io/export-blob.d.ts.map +1 -1
- package/dist/project/io/export-document.d.ts +5 -4
- package/dist/project/io/export-document.d.ts.map +1 -1
- package/dist/project/io/index.d.ts +1 -1
- package/dist/project/io/index.d.ts.map +1 -1
- package/dist/project/io/init-empty-document.d.ts +2 -0
- package/dist/project/io/init-empty-document.d.ts.map +1 -1
- package/dist/project/io/run-export.d.ts +19 -0
- package/dist/project/io/run-export.d.ts.map +1 -0
- package/dist/project/io/run-export.types.d.ts +45 -0
- package/dist/project/io/run-export.types.d.ts.map +1 -0
- package/dist/project/io/run-import.d.ts +15 -0
- package/dist/project/io/run-import.d.ts.map +1 -0
- package/dist/project/io/run-import.types.d.ts +19 -0
- package/dist/project/io/run-import.types.d.ts.map +1 -0
- package/dist/project/io/store-runtime.constants.d.ts +6 -0
- package/dist/project/io/store-runtime.constants.d.ts.map +1 -0
- package/dist/project/io/store-runtime.d.ts +12 -0
- package/dist/project/io/store-runtime.d.ts.map +1 -0
- package/dist/project/io/store-runtime.types.d.ts +18 -0
- package/dist/project/io/store-runtime.types.d.ts.map +1 -0
- package/dist/project/project-channel.d.ts +11 -0
- package/dist/project/project-channel.d.ts.map +1 -0
- package/dist/project/project.constants.d.ts +12 -0
- package/dist/project/project.constants.d.ts.map +1 -0
- package/dist/project/project.d.ts +315 -31
- package/dist/project/project.d.ts.map +1 -1
- package/dist/project/state/document-lifecycle.d.ts +0 -12
- package/dist/project/state/document-lifecycle.d.ts.map +1 -1
- package/dist/project/state/document-state.d.ts +4 -0
- package/dist/project/state/document-state.d.ts.map +1 -1
- package/dist/project/types.d.ts +126 -60
- package/dist/project/types.d.ts.map +1 -1
- package/dist/project-key-Ch34EtFa.js +1435 -0
- package/dist/rolldown-runtime-CYdcPHCu.js +12 -0
- package/dist/running-operations-vnijBvn7.js +76 -0
- package/dist/same-json-value-C6kUaoyt.js +1603 -0
- package/dist/sqlite.d.ts +5 -0
- package/dist/sqlite.d.ts.map +1 -0
- package/dist/sqlite.js +2671 -0
- package/dist/sqlite3.wasm +0 -0
- package/dist/store/apply-record-patch.d.ts +13 -0
- package/dist/store/apply-record-patch.d.ts.map +1 -0
- package/dist/store/closing-connections.d.ts +7 -0
- package/dist/store/closing-connections.d.ts.map +1 -0
- package/dist/store/closing-connections.types.d.ts +13 -0
- package/dist/store/closing-connections.types.d.ts.map +1 -0
- package/dist/store/commit-progress.d.ts +10 -0
- package/dist/store/commit-progress.d.ts.map +1 -0
- package/dist/store/compare-by-id.d.ts +10 -0
- package/dist/store/compare-by-id.d.ts.map +1 -0
- package/dist/store/document-path.constants.d.ts +20 -0
- package/dist/store/document-path.constants.d.ts.map +1 -0
- package/dist/store/document-path.d.ts +75 -0
- package/dist/store/document-path.d.ts.map +1 -0
- package/dist/store/document-path.types.d.ts +11 -0
- package/dist/store/document-path.types.d.ts.map +1 -0
- package/dist/store/engine/client/check-engine-wire.d.ts +8 -0
- package/dist/store/engine/client/check-engine-wire.d.ts.map +1 -0
- package/dist/store/engine/client/client.constants.d.ts +30 -0
- package/dist/store/engine/client/client.constants.d.ts.map +1 -0
- package/dist/store/engine/client/client.types.d.ts +200 -0
- package/dist/store/engine/client/client.types.d.ts.map +1 -0
- package/dist/store/engine/client/engine-client.d.ts +15 -0
- package/dist/store/engine/client/engine-client.d.ts.map +1 -0
- package/dist/store/engine/client/engine-control.d.ts +16 -0
- package/dist/store/engine/client/engine-control.d.ts.map +1 -0
- package/dist/store/engine/client/heartbeat-watch.d.ts +17 -0
- package/dist/store/engine/client/heartbeat-watch.d.ts.map +1 -0
- package/dist/store/engine/client/hub-connector.d.ts +11 -0
- package/dist/store/engine/client/hub-connector.d.ts.map +1 -0
- package/dist/store/engine/client/hub-connector.types.d.ts +25 -0
- package/dist/store/engine/client/hub-connector.types.d.ts.map +1 -0
- package/dist/store/engine/client/worker-connector.d.ts +32 -0
- package/dist/store/engine/client/worker-connector.d.ts.map +1 -0
- package/dist/store/engine/creation-refusal.d.ts +10 -0
- package/dist/store/engine/creation-refusal.d.ts.map +1 -0
- package/dist/store/engine/dialecte-refusal.d.ts +18 -0
- package/dist/store/engine/dialecte-refusal.d.ts.map +1 -0
- package/dist/store/engine/engine-store.d.ts +163 -0
- package/dist/store/engine/engine-store.d.ts.map +1 -0
- package/dist/store/engine/engine-store.types.d.ts +53 -0
- package/dist/store/engine/engine-store.types.d.ts.map +1 -0
- package/dist/store/engine/engine.constants.d.ts +14 -0
- package/dist/store/engine/engine.constants.d.ts.map +1 -0
- package/dist/store/engine/engine.types.d.ts +165 -0
- package/dist/store/engine/engine.types.d.ts.map +1 -0
- package/dist/store/engine/host/engine-wire.d.ts +19 -0
- package/dist/store/engine/host/engine-wire.d.ts.map +1 -0
- package/dist/store/engine/host/heartbeat.d.ts +33 -0
- package/dist/store/engine/host/heartbeat.d.ts.map +1 -0
- package/dist/store/engine/host/host.constants.d.ts +13 -0
- package/dist/store/engine/host/host.constants.d.ts.map +1 -0
- package/dist/store/engine/host/host.types.d.ts +65 -0
- package/dist/store/engine/host/host.types.d.ts.map +1 -0
- package/dist/store/engine/host/store-events.d.ts +14 -0
- package/dist/store/engine/host/store-events.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-client.constants.d.ts +27 -0
- package/dist/store/engine/hub/hub-client.constants.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-client.d.ts +46 -0
- package/dist/store/engine/hub/hub-client.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-client.types.d.ts +208 -0
- package/dist/store/engine/hub/hub-client.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-protocol.types.d.ts +193 -0
- package/dist/store/engine/hub/hub-protocol.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-router.d.ts +9 -0
- package/dist/store/engine/hub/hub-router.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-shell.d.ts +13 -0
- package/dist/store/engine/hub/hub-shell.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-shell.types.d.ts +64 -0
- package/dist/store/engine/hub/hub-shell.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub.constants.d.ts +33 -0
- package/dist/store/engine/hub/hub.constants.d.ts.map +1 -0
- package/dist/store/engine/hub/hub.types.d.ts +305 -0
- package/dist/store/engine/hub/hub.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub.worker.d.ts +2 -0
- package/dist/store/engine/hub/hub.worker.d.ts.map +1 -0
- package/dist/store/engine/hub/realm-host.d.ts +10 -0
- package/dist/store/engine/hub/realm-host.d.ts.map +1 -0
- package/dist/store/engine/hub/realm-host.types.d.ts +78 -0
- package/dist/store/engine/hub/realm-host.types.d.ts.map +1 -0
- package/dist/store/engine/project-key.d.ts +15 -0
- package/dist/store/engine/project-key.d.ts.map +1 -0
- package/dist/store/engine/wire/error-envelope.d.ts +25 -0
- package/dist/store/engine/wire/error-envelope.d.ts.map +1 -0
- package/dist/store/engine/wire/wire-values.d.ts +33 -0
- package/dist/store/engine/wire/wire-values.d.ts.map +1 -0
- package/dist/store/engine/wire/wire.constants.d.ts +116 -0
- package/dist/store/engine/wire/wire.constants.d.ts.map +1 -0
- package/dist/store/engine/wire/wire.types.d.ts +119 -0
- package/dist/store/engine/wire/wire.types.d.ts.map +1 -0
- package/dist/store/hub-public.d.ts +33 -0
- package/dist/store/hub-public.d.ts.map +1 -0
- package/dist/store/ignore-destroy-outcome.d.ts +6 -0
- package/dist/store/ignore-destroy-outcome.d.ts.map +1 -0
- package/dist/store/in-memory/in-memory-state.d.ts +46 -0
- package/dist/store/in-memory/in-memory-state.d.ts.map +1 -0
- package/dist/store/in-memory/in-memory-store.constants.d.ts +7 -0
- package/dist/store/in-memory/in-memory-store.constants.d.ts.map +1 -0
- package/dist/store/in-memory/in-memory-store.d.ts +105 -17
- package/dist/store/in-memory/in-memory-store.d.ts.map +1 -1
- package/dist/store/in-memory/types.d.ts +55 -1
- package/dist/store/in-memory/types.d.ts.map +1 -1
- package/dist/store/index.d.ts +8 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/json-values.constants.d.ts +18 -0
- package/dist/store/json-values.constants.d.ts.map +1 -0
- package/dist/store/json-values.d.ts +40 -0
- package/dist/store/json-values.d.ts.map +1 -0
- package/dist/store/json-values.types.d.ts +18 -0
- package/dist/store/json-values.types.d.ts.map +1 -0
- package/dist/store/local/dexie-store.constants.d.ts +20 -0
- package/dist/store/local/dexie-store.constants.d.ts.map +1 -0
- package/dist/store/local/dexie-store.d.ts +134 -5
- package/dist/store/local/dexie-store.d.ts.map +1 -1
- package/dist/store/local/types.d.ts +6 -0
- package/dist/store/local/types.d.ts.map +1 -1
- package/dist/store/lost-write.d.ts +32 -0
- package/dist/store/lost-write.d.ts.map +1 -0
- package/dist/store/lost-write.types.d.ts +4 -0
- package/dist/store/lost-write.types.d.ts.map +1 -0
- package/dist/store/open-connections.d.ts +4 -0
- package/dist/store/open-connections.d.ts.map +1 -0
- package/dist/store/open-connections.types.d.ts +17 -0
- package/dist/store/open-connections.types.d.ts.map +1 -0
- package/dist/store/own-import.d.ts +10 -0
- package/dist/store/own-import.d.ts.map +1 -0
- package/dist/store/project-name.d.ts +10 -0
- package/dist/store/project-name.d.ts.map +1 -0
- package/dist/store/resolve-store.d.ts +28 -4
- package/dist/store/resolve-store.d.ts.map +1 -1
- package/dist/store/running-operations.d.ts +7 -0
- package/dist/store/running-operations.d.ts.map +1 -0
- package/dist/store/running-operations.types.d.ts +10 -0
- package/dist/store/running-operations.types.d.ts.map +1 -0
- package/dist/store/same-json-value.d.ts +9 -0
- package/dist/store/same-json-value.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/in-process-link.d.ts +20 -0
- package/dist/store/sqlite/adapter/in-process-link.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/in-process-link.types.d.ts +21 -0
- package/dist/store/sqlite/adapter/in-process-link.types.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/realm-storage.d.ts +10 -0
- package/dist/store/sqlite/adapter/realm-storage.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-connector.d.ts +14 -0
- package/dist/store/sqlite/adapter/sqlite-connector.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-engine-settings.d.ts +4 -0
- package/dist/store/sqlite/adapter/sqlite-engine-settings.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.d.ts +8 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.types.d.ts +5 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.types.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.d.ts +8 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.types.d.ts +5 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.types.d.ts.map +1 -0
- package/dist/store/sqlite/engine/blobs.d.ts +55 -0
- package/dist/store/sqlite/engine/blobs.d.ts.map +1 -0
- package/dist/store/sqlite/engine/bulk-insert.d.ts +31 -0
- package/dist/store/sqlite/engine/bulk-insert.d.ts.map +1 -0
- package/dist/store/sqlite/engine/commit.d.ts +20 -0
- package/dist/store/sqlite/engine/commit.d.ts.map +1 -0
- package/dist/store/sqlite/engine/device-cache.d.ts +13 -0
- package/dist/store/sqlite/engine/device-cache.d.ts.map +1 -0
- package/dist/store/sqlite/engine/engine-errors.d.ts +26 -0
- package/dist/store/sqlite/engine/engine-errors.d.ts.map +1 -0
- package/dist/store/sqlite/engine/engine.constants.d.ts +144 -0
- package/dist/store/sqlite/engine/engine.constants.d.ts.map +1 -0
- package/dist/store/sqlite/engine/engine.types.d.ts +361 -0
- package/dist/store/sqlite/engine/engine.types.d.ts.map +1 -0
- package/dist/store/sqlite/engine/history.d.ts +114 -0
- package/dist/store/sqlite/engine/history.d.ts.map +1 -0
- package/dist/store/sqlite/engine/import-queue.d.ts +7 -0
- package/dist/store/sqlite/engine/import-queue.d.ts.map +1 -0
- package/dist/store/sqlite/engine/import-target.d.ts +23 -0
- package/dist/store/sqlite/engine/import-target.d.ts.map +1 -0
- package/dist/store/sqlite/engine/import-window.d.ts +23 -0
- package/dist/store/sqlite/engine/import-window.d.ts.map +1 -0
- package/dist/store/sqlite/engine/reclaim.d.ts +13 -0
- package/dist/store/sqlite/engine/reclaim.d.ts.map +1 -0
- package/dist/store/sqlite/engine/records.d.ts +117 -0
- package/dist/store/sqlite/engine/records.d.ts.map +1 -0
- package/dist/store/sqlite/engine/registry.d.ts +76 -0
- package/dist/store/sqlite/engine/registry.d.ts.map +1 -0
- package/dist/store/sqlite/engine/schema.d.ts +57 -0
- package/dist/store/sqlite/engine/schema.d.ts.map +1 -0
- package/dist/store/sqlite/engine/sqlite-engine.d.ts +14 -0
- package/dist/store/sqlite/engine/sqlite-engine.d.ts.map +1 -0
- package/dist/store/sqlite/engine/transaction.d.ts +12 -0
- package/dist/store/sqlite/engine/transaction.d.ts.map +1 -0
- package/dist/store/sqlite/list-projects.constants.d.ts +12 -0
- package/dist/store/sqlite/list-projects.constants.d.ts.map +1 -0
- package/dist/store/sqlite/list-projects.d.ts +22 -0
- package/dist/store/sqlite/list-projects.d.ts.map +1 -0
- package/dist/store/sqlite/list-projects.types.d.ts +28 -0
- package/dist/store/sqlite/list-projects.types.d.ts.map +1 -0
- package/dist/store/sqlite/load-sqlite.d.ts +11 -0
- package/dist/store/sqlite/load-sqlite.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/close-engine.d.ts +18 -0
- package/dist/store/sqlite/runtime/close-engine.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/install-pool.d.ts +94 -0
- package/dist/store/sqlite/runtime/install-pool.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/pool-header.d.ts +13 -0
- package/dist/store/sqlite/runtime/pool-header.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/progress-beat.d.ts +13 -0
- package/dist/store/sqlite/runtime/progress-beat.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/runtime.constants.d.ts +57 -0
- package/dist/store/sqlite/runtime/runtime.constants.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/runtime.types.d.ts +56 -0
- package/dist/store/sqlite/runtime/runtime.types.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/serve-dialecte-engine.d.ts +16 -0
- package/dist/store/sqlite/runtime/serve-dialecte-engine.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite-store-of.d.ts +7 -0
- package/dist/store/sqlite/sqlite-store-of.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite-text.d.ts +20 -0
- package/dist/store/sqlite/sqlite-text.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite-wasm-url.d.ts +9 -0
- package/dist/store/sqlite/sqlite-wasm-url.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite.constants.d.ts +15 -0
- package/dist/store/sqlite/sqlite.constants.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite.types.d.ts +36 -0
- package/dist/store/sqlite/sqlite.types.d.ts.map +1 -0
- package/dist/store/sqlite-storage.constants.d.ts +14 -0
- package/dist/store/sqlite-storage.constants.d.ts.map +1 -0
- package/dist/store/sqlite-storage.d.ts +22 -0
- package/dist/store/sqlite-storage.d.ts.map +1 -0
- package/dist/store/sqlite-storage.types.d.ts +24 -0
- package/dist/store/sqlite-storage.types.d.ts.map +1 -0
- package/dist/store/store-errors.d.ts +51 -0
- package/dist/store/store-errors.d.ts.map +1 -0
- package/dist/store/store.constants.d.ts +15 -3
- package/dist/store/store.constants.d.ts.map +1 -1
- package/dist/store/store.types.d.ts +280 -16
- package/dist/store/store.types.d.ts.map +1 -1
- package/dist/store/stored-record.d.ts +16 -0
- package/dist/store/stored-record.d.ts.map +1 -0
- package/dist/store/unfinished-imports.d.ts +15 -0
- package/dist/store/unfinished-imports.d.ts.map +1 -0
- package/dist/store/write-outcome.d.ts +34 -0
- package/dist/store/write-outcome.d.ts.map +1 -0
- package/dist/test/assert-valid-xml/assert-valid-xml.constants.d.ts +7 -0
- package/dist/test/assert-valid-xml/assert-valid-xml.constants.d.ts.map +1 -0
- package/dist/test/assert-valid-xml/assert-valid-xml.d.ts +19 -18
- package/dist/test/assert-valid-xml/assert-valid-xml.d.ts.map +1 -1
- package/dist/test/assert-valid-xml/assert-valid-xml.types.d.ts +8 -4
- package/dist/test/assert-valid-xml/assert-valid-xml.types.d.ts.map +1 -1
- package/dist/test/assert-xml/assert-xml.constants.d.ts +25 -0
- package/dist/test/assert-xml/assert-xml.constants.d.ts.map +1 -0
- package/dist/test/assert-xml/assert-xml.d.ts +23 -34
- package/dist/test/assert-xml/assert-xml.d.ts.map +1 -1
- package/dist/test/assert-xml/assert-xml.types.d.ts +48 -0
- package/dist/test/assert-xml/assert-xml.types.d.ts.map +1 -0
- package/dist/test/assert-xml/describe-nearby.d.ts +16 -0
- package/dist/test/assert-xml/describe-nearby.d.ts.map +1 -0
- package/dist/test/assert-xml/describe-node-place.d.ts +15 -0
- package/dist/test/assert-xml/describe-node-place.d.ts.map +1 -0
- package/dist/test/assert-xml/index.d.ts +1 -1
- package/dist/test/assert-xml/index.d.ts.map +1 -1
- package/dist/test/assert-xml/query-failure-message.d.ts +24 -0
- package/dist/test/assert-xml/query-failure-message.d.ts.map +1 -0
- package/dist/test/assert-xml/read-xpath-step.d.ts +8 -0
- package/dist/test/assert-xml/read-xpath-step.d.ts.map +1 -0
- package/dist/test/assert-xml/xpath-parser.d.ts +2 -1
- package/dist/test/assert-xml/xpath-parser.d.ts.map +1 -1
- package/dist/test/config.d.ts +5 -0
- package/dist/test/config.d.ts.map +1 -1
- package/dist/test/constant.d.ts +2 -0
- package/dist/test/constant.d.ts.map +1 -1
- package/dist/test/create-test-dialecte.d.ts +32 -37
- package/dist/test/create-test-dialecte.d.ts.map +1 -1
- package/dist/test/create-test-dialecte.types.d.ts +99 -0
- package/dist/test/create-test-dialecte.types.d.ts.map +1 -0
- package/dist/test/create-test-helpers-internal.types.d.ts +19 -0
- package/dist/test/create-test-helpers-internal.types.d.ts.map +1 -0
- package/dist/test/create-test-helpers.d.ts +13 -0
- package/dist/test/create-test-helpers.d.ts.map +1 -0
- package/dist/test/create-test-helpers.types.d.ts +50 -0
- package/dist/test/create-test-helpers.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-constraint.d.ts +3 -0
- package/dist/test/fixtures/test-entry-scan-constraint.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-edges.types.d.ts +10 -0
- package/dist/test/fixtures/test-entry-scan-edges.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-recursive.d.ts +4 -0
- package/dist/test/fixtures/test-entry-scan-recursive.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-recursive.types.d.ts +15 -0
- package/dist/test/fixtures/test-entry-scan-recursive.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-shapes.d.ts +14 -0
- package/dist/test/fixtures/test-entry-scan-shapes.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-shapes.types.d.ts +14 -0
- package/dist/test/fixtures/test-entry-scan-shapes.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-tree.d.ts +3 -0
- package/dist/test/fixtures/test-entry-scan-tree.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan.d.ts +5 -0
- package/dist/test/fixtures/test-entry-scan.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan.types.d.ts +5 -0
- package/dist/test/fixtures/test-entry-scan.types.d.ts.map +1 -0
- package/dist/test/generated/definition.generated.d.ts +5 -0
- package/dist/test/generated/definition.generated.d.ts.map +1 -1
- package/dist/test/in-memory-storage.setup.d.ts +2 -0
- package/dist/test/in-memory-storage.setup.d.ts.map +1 -0
- package/dist/test/index.d.ts +6 -0
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/normalize-uuids.constants.d.ts +3 -0
- package/dist/test/normalize-uuids.constants.d.ts.map +1 -0
- package/dist/test/normalize-uuids.d.ts +12 -0
- package/dist/test/normalize-uuids.d.ts.map +1 -1
- package/dist/test/run-test-cases.d.ts +30 -11
- package/dist/test/run-test-cases.d.ts.map +1 -1
- package/dist/test/run-test-cases.type.d.ts +16 -0
- package/dist/test/run-test-cases.type.d.ts.map +1 -1
- package/dist/test/sqlite-storage.setup.d.ts +1 -0
- package/dist/test/sqlite-storage.setup.d.ts.map +1 -0
- package/dist/test/test-dialecte-setup.d.ts +31 -0
- package/dist/test/test-dialecte-setup.d.ts.map +1 -0
- package/dist/test/test-dialecte-setup.types.d.ts +29 -0
- package/dist/test/test-dialecte-setup.types.d.ts.map +1 -0
- package/dist/test/test-dialecte.d.ts +2722 -0
- package/dist/test/test-dialecte.d.ts.map +1 -0
- package/dist/test/test-dialecte.types.d.ts +3 -0
- package/dist/test/test-dialecte.types.d.ts.map +1 -0
- package/dist/test/test-dialecte.worker.d.ts +2 -0
- package/dist/test/test-dialecte.worker.d.ts.map +1 -0
- package/dist/test/test-entry-environment.constants.d.ts +27 -0
- package/dist/test/test-entry-environment.constants.d.ts.map +1 -0
- package/dist/test/test-record.d.ts +49 -1
- package/dist/test/test-record.d.ts.map +1 -1
- package/dist/test/test-storage/index.d.ts +5 -0
- package/dist/test/test-storage/index.d.ts.map +1 -0
- package/dist/test/test-storage/read-test-storage.d.ts +4 -0
- package/dist/test/test-storage/read-test-storage.d.ts.map +1 -0
- package/dist/test/test-storage/resolve-test-storage.d.ts +9 -0
- package/dist/test/test-storage/resolve-test-storage.d.ts.map +1 -0
- package/dist/test/test-storage/test-storage.constants.d.ts +9 -0
- package/dist/test/test-storage/test-storage.constants.d.ts.map +1 -0
- package/dist/test/test-storage/test-storage.types.d.ts +15 -0
- package/dist/test/test-storage/test-storage.types.d.ts.map +1 -0
- package/dist/test/test-storage/test-store-for.d.ts +19 -0
- package/dist/test/test-storage/test-store-for.d.ts.map +1 -0
- package/dist/test/test-storage/use-test-storage.d.ts +14 -0
- package/dist/test/test-storage/use-test-storage.d.ts.map +1 -0
- package/dist/test/test-timing.constants.d.ts +15 -0
- package/dist/test/test-timing.constants.d.ts.map +1 -0
- package/dist/test/xml/engine-console.d.ts +6 -0
- package/dist/test/xml/engine-console.d.ts.map +1 -0
- package/dist/test/xml/engine.d.ts +3 -0
- package/dist/test/xml/engine.d.ts.map +1 -0
- package/dist/test/xml/index.d.ts +8 -0
- package/dist/test/xml/index.d.ts.map +1 -0
- package/dist/test/xml/malformed-xml-error.d.ts +5 -0
- package/dist/test/xml/malformed-xml-error.d.ts.map +1 -0
- package/dist/test/xml/print-node.d.ts +7 -0
- package/dist/test/xml/print-node.d.ts.map +1 -0
- package/dist/test/xml/select-nodes.d.ts +14 -0
- package/dist/test/xml/select-nodes.d.ts.map +1 -0
- package/dist/test/xml/with-xml-document.constants.d.ts +7 -0
- package/dist/test/xml/with-xml-document.constants.d.ts.map +1 -0
- package/dist/test/xml/with-xml-document.d.ts +14 -0
- package/dist/test/xml/with-xml-document.d.ts.map +1 -0
- package/dist/test/xml/xml-query-refused-error.d.ts +13 -0
- package/dist/test/xml/xml-query-refused-error.d.ts.map +1 -0
- package/dist/test/xml/xml.constants.d.ts +16 -0
- package/dist/test/xml/xml.constants.d.ts.map +1 -0
- package/dist/test/xml/xml.types.d.ts +31 -0
- package/dist/test/xml/xml.types.d.ts.map +1 -0
- package/dist/test/xsd/test-ext.xsd +226 -0
- package/dist/test/xsd/test.xsd +528 -0
- package/dist/test.js +3427 -406
- package/dist/types/dialecte-config.d.ts +6 -0
- package/dist/types/dialecte-config.d.ts.map +1 -1
- package/dist/types/io.d.ts +5 -0
- package/dist/types/io.d.ts.map +1 -1
- package/dist/utils/attribute-rules.d.ts +16 -1
- package/dist/utils/attribute-rules.d.ts.map +1 -1
- package/dist/utils/child-occurrences.constants.d.ts +4 -0
- package/dist/utils/child-occurrences.constants.d.ts.map +1 -0
- package/dist/utils/child-occurrences.d.ts +17 -0
- package/dist/utils/child-occurrences.d.ts.map +1 -0
- package/dist/utils/child-occurrences.types.d.ts +6 -0
- package/dist/utils/child-occurrences.types.d.ts.map +1 -0
- package/dist/utils/datatype.d.ts +4 -0
- package/dist/utils/datatype.d.ts.map +1 -1
- package/dist/utils/format-xml.d.ts +4 -0
- package/dist/utils/format-xml.d.ts.map +1 -1
- package/dist/utils/index.d.ts +5 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/invariant.d.ts +2 -0
- package/dist/utils/invariant.d.ts.map +1 -1
- package/dist/utils/namespaces.d.ts +15 -1
- package/dist/utils/namespaces.d.ts.map +1 -1
- package/dist/utils/order-children.d.ts +14 -3
- package/dist/utils/order-children.d.ts.map +1 -1
- package/dist/utils/order-children.types.d.ts +10 -0
- package/dist/utils/order-children.types.d.ts.map +1 -0
- package/dist/utils/particle-occurrences.d.ts +4 -0
- package/dist/utils/particle-occurrences.d.ts.map +1 -0
- package/dist/utils/required-choices.d.ts +17 -0
- package/dist/utils/required-choices.d.ts.map +1 -0
- package/dist/utils/required-choices.types.d.ts +15 -0
- package/dist/utils/required-choices.types.d.ts.map +1 -0
- package/dist/utils/resolve-definition.d.ts +4 -0
- package/dist/utils/resolve-definition.d.ts.map +1 -1
- package/dist/utils/save-to-disk.constants.d.ts +3 -0
- package/dist/utils/save-to-disk.constants.d.ts.map +1 -0
- package/dist/utils/save-to-disk.d.ts +17 -5
- package/dist/utils/save-to-disk.d.ts.map +1 -1
- package/dist/utils/save-to-disk.types.d.ts +17 -0
- package/dist/utils/save-to-disk.types.d.ts.map +1 -0
- package/dist/utils/seeded-uuid.constants.d.ts +5 -0
- package/dist/utils/seeded-uuid.constants.d.ts.map +1 -0
- package/dist/utils/seeded-uuid.d.ts +15 -0
- package/dist/utils/seeded-uuid.d.ts.map +1 -0
- package/dist/utils/seeded-uuid.types.d.ts +8 -0
- package/dist/utils/seeded-uuid.types.d.ts.map +1 -0
- package/dist/utils/tell-listener.constants.d.ts +9 -0
- package/dist/utils/tell-listener.constants.d.ts.map +1 -0
- package/dist/utils/tell-listener.d.ts +24 -0
- package/dist/utils/tell-listener.d.ts.map +1 -0
- package/dist/utils/xml-characters.constants.d.ts +9 -0
- package/dist/utils/xml-characters.constants.d.ts.map +1 -0
- package/dist/utils/xml-characters.d.ts +8 -0
- package/dist/utils/xml-characters.d.ts.map +1 -0
- package/dist/utils/xml-whitespace.constants.d.ts +8 -0
- package/dist/utils/xml-whitespace.constants.d.ts.map +1 -0
- package/dist/utils/xml-whitespace.d.ts +19 -0
- package/dist/utils/xml-whitespace.d.ts.map +1 -0
- package/dist/utils/xsi-type.d.ts +4 -0
- package/dist/utils/xsi-type.d.ts.map +1 -1
- package/dist/utils/yield-to-queue.d.ts +6 -0
- package/dist/utils/yield-to-queue.d.ts.map +1 -0
- package/dist/utils-USNkj4sT.js +1275 -0
- package/dist/utils.js +1 -2
- package/dist/xml/build/document-root.d.ts +7 -0
- package/dist/xml/build/document-root.d.ts.map +1 -0
- package/dist/xml/build/index.d.ts +0 -5
- package/dist/xml/build/index.d.ts.map +1 -1
- package/dist/xml/build/record-element.d.ts +15 -0
- package/dist/xml/build/record-element.d.ts.map +1 -0
- package/dist/xml/build/record-element.types.d.ts +12 -0
- package/dist/xml/build/record-element.types.d.ts.map +1 -0
- package/dist/xml/build/write-xml-records.d.ts +7 -0
- package/dist/xml/build/write-xml-records.d.ts.map +1 -0
- package/dist/xml/build/write-xml-records.types.d.ts +11 -0
- package/dist/xml/build/write-xml-records.types.d.ts.map +1 -0
- package/dist/xml/build/xml-element.d.ts +79 -0
- package/dist/xml/build/xml-element.d.ts.map +1 -0
- package/dist/xml/build/xml-element.types.d.ts +34 -0
- package/dist/xml/build/xml-element.types.d.ts.map +1 -0
- package/dist/xml/build/xml-writer.constants.d.ts +24 -0
- package/dist/xml/build/xml-writer.constants.d.ts.map +1 -0
- package/dist/xml/build/xml-writer.d.ts +40 -0
- package/dist/xml/build/xml-writer.d.ts.map +1 -0
- package/dist/xml/build/xml-writer.types.d.ts +34 -0
- package/dist/xml/build/xml-writer.types.d.ts.map +1 -0
- package/dist/xml/dom/index.d.ts +3 -0
- package/dist/xml/dom/index.d.ts.map +1 -0
- package/dist/xml/dom/xml-document-from-file.d.ts +10 -0
- package/dist/xml/dom/xml-document-from-file.d.ts.map +1 -0
- package/dist/xml/dom/xml-document-from-file.types.d.ts +5 -0
- package/dist/xml/dom/xml-document-from-file.types.d.ts.map +1 -0
- package/dist/xml/index.d.ts +1 -0
- package/dist/xml/index.d.ts.map +1 -1
- package/dist/xml/inspect-xml.d.ts +2 -0
- package/dist/xml/inspect-xml.d.ts.map +1 -1
- package/dist/xml/parse/index.d.ts +1 -1
- package/dist/xml/parse/index.d.ts.map +1 -1
- package/dist/xml/parse/parse-xml-document.constants.d.ts +5 -0
- package/dist/xml/parse/parse-xml-document.constants.d.ts.map +1 -0
- package/dist/xml/parse/parse-xml-document.d.ts +13 -2
- package/dist/xml/parse/parse-xml-document.d.ts.map +1 -1
- package/dist/xml/parse/parse-xml-document.types.d.ts +7 -2
- package/dist/xml/parse/parse-xml-document.types.d.ts.map +1 -1
- package/dist/xml/parse/parser.constants.d.ts +7 -0
- package/dist/xml/parse/parser.constants.d.ts.map +1 -0
- package/dist/xml/parse/parser.d.ts.map +1 -1
- package/package.json +88 -10
- package/skills/dialecte/SKILL.md +345 -0
- package/skills/dialecte/references/api.json +1830 -0
- package/skills/dialecte/references/api.md +557 -0
- package/skills/dialecte/references/core-api.md +205 -0
- package/skills/dialecte/references/testing.md +116 -0
- package/skills/dialecte-contributing/SKILL.md +374 -0
- package/skills/dialecte-contributing/references/code-rules.md +115 -0
- package/skills/dialecte-contributing/references/landing-changes.md +87 -0
- package/skills/dialecte-contributing/references/lot-in-a-package.md +45 -0
- package/skills/dialecte-contributing/references/perf.md +40 -0
- package/skills/dialecte-contributing/references/traps.md +109 -0
- package/skills/dialecte-lot/SKILL.md +526 -0
- package/skills/dialecte-lot/references/briefs.md +161 -0
- package/skills/dialecte-lot/references/model-tiers.md +52 -0
- package/skills/dialecte-lot/references/retro.md +51 -0
- package/skills/dialecte-lot/references/standard-check.md +45 -0
- package/skills/dialecte-lot/references/stations.md +110 -0
- package/dist/project/io/import-document.d.ts +0 -7
- package/dist/project/io/import-document.d.ts.map +0 -1
- package/dist/test/assert-xml/types.d.ts +0 -2
- package/dist/test/assert-xml/types.d.ts.map +0 -1
- package/dist/utils-DJN0Md0v.js +0 -624
- package/dist/xml/build/build-xml-document.d.ts +0 -10
- package/dist/xml/build/build-xml-document.d.ts.map +0 -1
- package/dist/xml/build/build-xml-document.types.d.ts +0 -22
- package/dist/xml/build/build-xml-document.types.d.ts.map +0 -1
- package/dist/xml/build/download-file.d.ts +0 -7
- package/dist/xml/build/download-file.d.ts.map +0 -1
- package/dist/xml/build/formatter.d.ts +0 -2
- package/dist/xml/build/formatter.d.ts.map +0 -1
- package/dist/xml/build/serialize.d.ts +0 -11
- package/dist/xml/build/serialize.d.ts.map +0 -1
- package/dist/xml/build/serialize.types.d.ts +0 -12
- package/dist/xml/build/serialize.types.d.ts.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){let e=`https://dialecte.github.io/core`,t={UNKNOWN:{code:`D0001`,message:`An unknown error occurred`,explanation:{when:"A transaction's callback threw something that is not a structured error (a plain `Error`, a value); the original is its `cause`.",fix:"Read `cause` and `detail`; raise your own failures with `throwDialecteError` or `invariant` so callers get a key.",docs:`${e}/guide/development/state-and-errors#error-catalog`}},ASSERTION_FAILED:{code:`D0002`,message:`Assertion failed`,explanation:{when:"An `invariant` without its own key failed, or core met a state it never expects (a catalogue built wrong, an inconsistent export, an engine running an sqlite-wasm older than 3.54.1, which removes a project on a failed install).",fix:"Read `detail`: it names the condition. Give `invariant` a key of its own when the failure is one a caller should handle.",docs:`${e}/guide/development/state-and-errors#error-catalog`}},STORE_CONNECTION_FAILED:{code:`D1001`,message:`Failed to open database`,explanation:{when:`The project's database could not be opened (the SQLite file or its worker did not start), or the origin's hub could not be joined: its SharedWorker failed to start or was blocked, or a child's port went unanswered past the welcome budget (its page unbound it).`,fix:"Check the browser supports the store (OPFS, workers, SharedWorker for the hub) and that no other tab holds the project; reload, or open the project with another storage. A child view refused so is bound again by its page (`createHubPort`, then `adoptHubPort`).",docs:`${e}/api/project#store-errors`}},STORE_COMMIT_FAILED:{code:`D1002`,message:`Failed to commit changes`,explanation:{when:"The database refused a transaction's write as it committed (the failure is the `cause`).",fix:"Read `cause`; a full disk or a lost connection are the usual reasons. Retry the transaction once the store is back.",docs:`${e}/api/project#store-errors`}},STORE_RECORD_NOT_FOUND:{code:`D1003`,message:`Record not found in database`,explanation:{when:`A write updated or deleted a record the store does not hold in that document.`,fix:`Read the record again before writing: it was deleted, or the ref names another document.`,docs:`${e}/api/project#store-errors`}},STORE_BULK_ADD_FAILED:{code:`D1004`,message:`Failed to add records to database`,explanation:{when:"The database refused to add a batch of records (import, commit); the failure is the `cause`.",fix:"Read `cause`; a full disk or a closed store are the usual reasons.",docs:`${e}/api/project#store-errors`}},STORE_BULK_UPDATE_FAILED:{code:`D1005`,message:`Failed to update records in database`,explanation:{when:"The database refused to update a batch of records; the failure is the `cause`.",fix:"Read `cause`; a full disk or a closed store are the usual reasons.",docs:`${e}/api/project#store-errors`}},STORE_DELETE_FAILED:{code:`D1006`,message:`Failed to delete records from database`,explanation:{when:"The database refused to delete records; the failure is the `cause`.",fix:"Read `cause`; a closed store is the usual reason.",docs:`${e}/api/project#store-errors`}},STORE_NOT_WRITABLE:{code:`D1007`,message:`Store is not writable`,explanation:{when:`A write reached an in-memory store created read-only.`,fix:"Create the project with `storage: { type: 'inMemory', writable: true }` when the script writes.",docs:`${e}/api/project#in-memory-storage`}},STORE_BLOB_NOT_FOUND:{code:`D1008`,message:`Blob not found`,explanation:{when:`A blob operation named a blob id the store does not hold.`,fix:"List the blobs (`project.getBlobsByDocument`) and use an id from there.",docs:`${e}/api/project#blobs`}},STORE_DUPLICATE_ID:{code:`D1009`,message:`An id is already taken in the store`,explanation:{when:"A write would create a record (or register a document) with an id the store already holds; `meta.recordIds` lists them.",fix:"Let core mint ids (omit `id`), or pick ids no record of the document has; `deepClone` mints new ids itself.",docs:`${e}/api/project#store-errors`}},STORE_CLOSED:{code:`D1010`,message:`Store is closed`,explanation:{when:"A store operation was still in flight when its store closed, or code holding the store itself (a custom store, a test context) called it after its `close()`. A project closed with `project.close()` answers `PROJECT_NOT_OPENED` instead.",fix:`Await every operation before closing the store or the project; open it again before using it.`,docs:`${e}/api/project#lifecycle`}},STORE_READ_FAILED:{code:`D1011`,message:`Failed to read from database`,explanation:{when:"The SQLite store's database failed under a read; the failure is the `cause`.",fix:"Read `cause`; reopen the project. A lasting failure means the file is damaged: import its documents again.",docs:`${e}/api/project#store-errors`}},STORE_PROTOCOL_MISMATCH:{code:`D1012`,message:`Another version of the library holds the shared store connection`,explanation:{when:`Another version of the library already holds the shared store connection (another tab runs an older or newer build).`,fix:`Close the other tabs of the app, or reload them all on the same version.`,docs:`${e}/api/project#store-errors`}},STORE_REALM_ID_TAKEN:{code:`D1013`,message:`A view with this id is already connected to the shared store`,explanation:{when:`A view joined the shared store with an id another connected view already uses.`,fix:`Give each view its own id; reload the page that reused one.`,docs:`${e}/api/project#store-errors`}},STORE_REALM_UNKNOWN:{code:`D1014`,message:`The shared store does not know this view`,explanation:{when:`A view spoke to the shared store without having joined it, or after it left.`,fix:`Join (open the project) before reading or writing; reload a view that was disconnected.`,docs:`${e}/api/project#store-errors`}},STORE_VALUE_NOT_JSON:{code:`D1015`,message:`A value handed to the store is not JSON`,explanation:{when:`A write handed the store a value that is not plain JSON (a function, a Map, undefined, a class instance) in a record or in document metadata.`,fix:"Pass plain strings, numbers, booleans, arrays and objects; `detail` names the value and the field.",docs:`${e}/io/#values-a-store-keeps`}},STORE_UNAVAILABLE:{code:`D1016`,message:`This browser gives the page no storage for a project`,explanation:{when:`The browser gives the page no private file system (a private window), or a worker no synchronous file access, so the SQLite project store cannot create, open or destroy the project; nothing is changed.`,fix:`Open the app in a normal (not private) window of a browser that supports the origin private file system.`,docs:`${e}/api/project#store-errors`}},STORE_QUOTA_EXCEEDED:{code:`D1017`,message:`Not enough storage left for the project`,explanation:{when:"The origin has too little storage left: for a new project's files, for an import (eight times the file's size and at least 1 MiB, less the project's free pages), or the file system refused a write for want of space; nothing of the call applied. The SQLite project store answers it; the local (IndexedDB) store answers the failing write's own error (`STORE_COMMIT_FAILED`, `STORE_BULK_ADD_FAILED`, `STORE_BULK_UPDATE_FAILED`; an import `IMPORT_FAILED`) until it moves to SQLite; the in-memory store has no limit.",fix:"Free storage for the origin (delete projects no longer needed) or import a smaller file, then try again; `meta.needed` and `meta.available` give the sizes when known.",docs:`${e}/api/project#store-errors`}},STORE_ENGINE_LOST:{code:`D1018`,message:`The project engine stopped answering`,explanation:{when:"A call to a project engine served from a worker lost that engine: it ended with what hosted it or gave no answer within its budget (`meta.reason` `'host-gone'`), it sent nothing for too long while the call waited (`'no-heartbeat'`, it may still finish), or the hub dropped this view with the page that bound it - frozen, gone, or unbinding it (`'realm-dropped'`: every call, `getWriteOutcome` too, is refused so until the view is bound again).",fix:"A Document's commit and a Project's import ask the outcome themselves, once: a commit that landed resolves; otherwise the refusal says `meta.outcome` - `not-applied` (make it again if wanted), `running` (a silent engine may still apply it: tell the user, read again later), `unknown` (it could not be asked), or `applied` for an import (its document is in the project; its diagnostics were lost). Elsewhere ask `getWriteOutcome({ writeId })` with `meta.writeId` before writing again; never retry a write blindly. For `'realm-dropped'`, every call is refused until the page binds the view again once it is back (`onRejoined`, then `createHubPort`, its port handed to the view's `adoptHubPort`).",docs:`${e}/api/project#store-errors`}},STORE_HUB_SPAWNERS_FIXED:{code:`D1019`,message:`The page's hub connection runs another version of this dialecte's engine`,explanation:{when:"`connectHub({ spawners })` named a dialecte whose engine the page's connection already runs at another version, or a project was opened (or destroyed by name) on `sqlite` from a factory of such a version (the project offers its engine to the hub as it opens): a page runs one version of each dialecte's engine (two would split a project's views between two engines). A later call adds the engines of dialectes the page does not run yet. `meta.spawners` names the dialectes (id and version) refused; nothing of the call was added, nothing opened.",fix:"Ship one version of each dialecte in the app: register each dialecte's `factory.spawner` from the copy the app opens its projects with.",docs:`${e}/api/project#store-errors`}},ELEMENT_NOT_FOUND:{code:`D2001`,message:`Element not found`,explanation:{when:`A ref names an element the document does not hold (deleted, never created, or from another document).`,fix:"Read the ref from a query in the same document (`getRecord`, `findDescendants`) instead of keeping an old one.",docs:`${e}/guide/development/state-and-errors#error-catalog`}},ROOT_NOT_FOUND:{code:`D2002`,message:`Root element not found`,explanation:{when:`The document holds no root element of the dialecte's root tag (an empty or foreign document).`,fix:"Import a file whose root is the dialecte's root element, or create the document with `project.initEmptyDocument`.",docs:`${e}/api/project#initemptydocument`}},DUPLICATE_ID:{code:`D2003`,message:`Duplicate element ID`,explanation:{when:`Not raised by core itself: a dialecte or app code raises it when two elements carry the same id.`,fix:`Give each element its own id; let core mint them.`,docs:`${e}/guide/development/state-and-errors#error-catalog`}},ELEMENT_TAGNAME_MISMATCH:{code:`D2004`,message:`Element tagName does not match the expected type`,explanation:{when:"A ref's `tagName` is not the tag of the record its id names.",fix:"Build refs with `toRef(record)` from a record you read, never by hand with a guessed tag.",docs:`${e}/api/transaction#reforrecord`}},INVALID_PARENT_CHILD:{code:`D3001`,message:`Invalid parent-child relationship`,explanation:{when:`Not raised by core itself: a dialecte or app code raises it when an element is placed under a parent the schema does not admit.`,fix:"Read the parent's children in the definition (`query.getDefinition`) and add the element under an admitted parent.",docs:`${e}/api/transaction#addchild`}},INVALID_ATTRIBUTE:{code:`D3002`,message:`Invalid attribute for element`,explanation:{when:`Not raised by core itself: a dialecte or app code raises it for an attribute the element does not declare.`,fix:`Use an attribute the element's definition lists.`,docs:`${e}/guide/development/state-and-errors#error-catalog`}},PROTECTED_ROOT:{code:`D3003`,message:`Root element cannot be deleted`,explanation:{when:`A transaction tried to delete the document's root element.`,fix:"Delete the root's children instead, or remove the whole document with `project.removeDocument`.",docs:`${e}/api/transaction#delete`}},REQUIRED_ATTRIBUTE_MISSING:{code:`D3004`,message:`Required attribute is missing`,explanation:{when:`Not raised by core itself: a dialecte or app code raises it when a required attribute is absent.`,fix:`Give the attribute a value when creating the element.`,docs:`${e}/guide/development/state-and-errors#error-catalog`}},UNIQUE_CONSTRAINT_VIOLATION:{code:`D3005`,message:`Value is already used within its scope`,explanation:{when:`Not raised by core itself: a dialecte raises it when a value is already used within the scope where it must be unique.`,fix:`Pick another value, or let the dialecte's hook name the element.`,docs:`${e}/guide/development/state-and-errors#error-catalog`}},UNKNOWN_NAMESPACE_PREFIX:{code:`D3006`,message:`Unknown namespace prefix on attribute — pass it explicitly as { name, namespace: { prefix, uri } }`,explanation:{when:`An attribute was written with a namespace key or prefix the dialecte does not declare.`,fix:"Use a namespace key of the dialecte's config, or pass the namespace in full: `{ name, namespace: { prefix, uri } }`.",docs:`${e}/api/transaction#addchild`}},PREFIXED_ATTRIBUTE_NAME:{code:`D3007`,message:`Authored attribute name must be a local name — pass the namespace separately as { name, namespace }, not a prefixed name`,explanation:{when:"An attribute was written with a prefixed name (`ext:attr`) on create or update.",fix:"Pass the local name and the namespace apart: `{ name: 'attr', namespace }`.",docs:`${e}/api/transaction#addchild`}},FIXED_VALUE_VIOLATION:{code:`D3008`,message:`Attribute value differs from the schema-fixed value`,explanation:{when:`A write gave an attribute another value than the one the schema fixes.`,fix:"Leave the attribute out (core writes the fixed value) or give exactly the fixed value; `getAttributeRules` reads it.",docs:`${e}/api/transaction#addchild`}},XSI_TYPE_REQUIRED:{code:`D3009`,message:`The element is declared with an abstract type: name a type with xsi:type`,explanation:{when:"An element declared with an abstract type was created without naming a concrete type in `xsi:type`.",fix:"Name one of the admitted types: `attributes: { 'xsi:type': '<Type>' }`; `admittedXsiTypes` lists them.",docs:`${e}/api/transaction#addchild`}},XSI_TYPE_NOT_ADMITTED:{code:`D3010`,message:`The element may not take the type named with xsi:type`,explanation:{when:"A write named in `xsi:type` a type the element may not take.",fix:"Pick a type from `admittedXsiTypes` for that element.",docs:`${e}/api/transaction#addchild`}},XSI_TYPE_CHANGE_LEAVES_CONTENT:{code:`D3011`,message:`The new xsi:type does not admit content the element still holds`,explanation:{when:"An update changed `xsi:type` to a type that does not admit attributes or children the element still holds.",fix:`Remove that content in the same transaction before changing the type, or pick a type that admits it.`,docs:`${e}/api/transaction#update`}},XML_CHARACTER_NOT_ALLOWED:{code:`D3012`,message:`The text holds a character XML does not allow`,explanation:{when:`A write, an import session's own writes or an export met a character XML does not allow (a control character below U+0020 but tab, line feed and carriage return, U+FFFE, U+FFFF) in a value, a name, a prefix, a namespace URI or an id; nothing was written, no file.`,fix:"Remove or replace the character named in `meta.character` at `meta.part` of the record `meta.recordId` before writing or exporting it.",docs:`${e}/io/#values-a-store-keeps`}},ALREADY_COMMITTED:{code:`D4001`,message:`Transaction already committed`,explanation:{when:`Not raised by core today: kept for a transaction used after its commit.`,fix:"Start a new `doc.transaction` for further writes.",docs:`${e}/guide/development/state-and-errors#error-catalog`}},ALREADY_FAILED:{code:`D4002`,message:`Transaction already failed`,explanation:{when:`Not raised by core today: kept for a transaction used after it failed.`,fix:"Start a new `doc.transaction`; the failed one wrote nothing.",docs:`${e}/guide/development/state-and-errors#error-catalog`}},DATABASE_COMMIT_ERROR:{code:`D4003`,message:`An error occurred while committing changes to the database`,explanation:{when:"Not raised by core today: store commit failures are `STORE_COMMIT_FAILED`.",fix:"Read `cause`; see `STORE_COMMIT_FAILED`.",docs:`${e}/guide/development/state-and-errors#error-catalog`}},CONCURRENT_TRANSACTION:{code:`D4004`,message:`A transaction is already in progress. Concurrent transactions are not supported yet — serialize them or implement a transaction queue.`,explanation:{when:"A `doc.transaction` started on a Document while another transaction or `doc.prepare` was still running on it (a missing `await`, or a nested transaction).",fix:"Await each transaction before the next; inside a transaction, write through its `tx`, never through `doc.transaction` again.",docs:`${e}/api/document`}},EXPORT_ROOT_NOT_FOUND:{code:`D5001`,message:`Root element not found in records during export`,explanation:{when:`The export found no root record in the document.`,fix:"The document is empty or damaged: import it again, or create it with `project.initEmptyDocument`.",docs:`${e}/api/project#export`}},EXPORT_ORPHAN_CHILD_REF:{code:`D5002`,message:`Parent references non-existent child record`,explanation:{when:`The export met a parent whose list of children names a record that does not exist.`,fix:"A hook or a raw write left a dangling child ref: a hook that deletes must also return the parent's `updated` operation.",docs:`${e}/api/project#export`}},PARSE_ERROR:{code:`D5003`,message:`Failed to parse XML`,explanation:{when:"The file given to import (or to `parseXmlDocument`) is not well-formed XML.",fix:"Fix the XML where `detail` points (line and column); check the file's encoding.",docs:`${e}/api/project#import`}},IMPORT_FAILED:{code:`D5004`,message:`Failed to import the file`,explanation:{when:`Importing a file failed after it was parsed (a hook threw, the store refused the records); nothing of the file remains.`,fix:"Read `cause` and `detail`; an import hook must not read the store or throw on data it can report as a diagnostic.",docs:`${e}/api/project#import`}},IMPORT_ABORTED:{code:`D5005`,message:`The import was aborted`,explanation:{when:"The import's `signal` was aborted; nothing of the file remains.",fix:`Nothing to fix when the abort was wanted; import the file again otherwise.`,docs:`${e}/api/project#import`}},EXPORT_CONFLICT:{code:`D5006`,message:`The document changed while it was exported`,explanation:{when:`The document was written twice while it was being exported, so no consistent file could be read.`,fix:`Export when no transaction or import is writing the document, or retry.`,docs:`${e}/api/project#export`}},EXPORT_ABORTED:{code:`D5007`,message:`The export was aborted`,explanation:{when:"The export's `signal` was aborted.",fix:`Nothing to fix when the abort was wanted; export again otherwise.`,docs:`${e}/api/project#export`}},EXTENSION_METHOD_COLLISION:{code:`D6001`,message:`Extension method name collision detected`,explanation:{when:`Two extension modules merged under one key define a method of the same name.`,fix:`Rename your method, or put your module under a key of its own.`,docs:`${e}/guide/extensions/#registering-extensions`}},UNKNOWN_CONFIG_KEY:{code:`D7001`,message:`Unknown config key`,explanation:{when:`A document, a test or a declaration named a config key the dialecte does not declare.`,fix:"Use a key of the dialecte's `configs` (its `defaultConfigKey` when in doubt).",docs:`${e}/api/dialecte#definedialecte`}},DOCUMENT_NOT_REGISTERED:{code:`D7002`,message:`Document not registered in project`,explanation:{when:`A document id names no document of the open project (removed, or from another project).`,fix:"Use an id from `project.getDocuments()` or from the import result.",docs:`${e}/api/project#document-access`}},PROJECT_NOT_OPENED:{code:`D7003`,message:`Project not opened`,explanation:{when:"The project was used before `open(name)` resolved, or once `close()`, `destroy()` or another `open()` was called on it - a batch import's file whose turn came after that is refused the same.",fix:"Keep the instance and await its `open(name)` before using the project; open it again after `close()` or `destroy()`, and await an `open()` of another project before using the Project again.",docs:`${e}/api/project#lifecycle`}},BLOB_NOT_FOUND:{code:`D7004`,message:`Blob not found in store`,explanation:{when:"`project.exportBlob` named a blob the project does not hold.",fix:"Use an id from `project.getBlobsByDocument` or `getStandaloneBlobs`.",docs:`${e}/api/project#blobs`}},PROJECT_LAYOUT_OUTDATED:{code:`D7005`,message:`Project stored by another version of the library`,explanation:{when:`The project file was stored by another version of the library (another layout); nothing was written to it.`,fix:`Delete the project and import its files again with this version.`,docs:`${e}/api/project#store-errors`}},PROJECT_ENGINE_UNAVAILABLE:{code:`D7006`,message:`No view can start the project engine`,explanation:{when:`The project's engine could not be started or reached: its worker failed to load or never answered its open within the open budget; through the origin's hub, no open view offers an engine for the project's dialecte, or the engine never said it opened; a destroy still running past the open budget, or one asked by a page suspended before the hub granted it.`,fix:"Keep one tab of the app open and reload; check the dialecte's `engineUrl` points at its worker and that it loads (the console names a script that fails); a destroy refused so is asked again once the project is closed elsewhere.",docs:`${e}/api/project#store-errors`}},PROJECT_ENGINE_BUSY:{code:`D7007`,message:`The project is still held by another engine`,explanation:{when:`Another engine still holds the project (another tab or a worker that did not stop).`,fix:`Close the other tabs of the app, then open the project again.`,docs:`${e}/api/project#store-errors`}},PROJECT_DIALECTE_MISMATCH:{code:`D7008`,message:`The project's engine or file is of another dialecte`,explanation:{when:"A project file stored by another dialecte was opened (nothing of it written); or an engine was asked for a project of another dialecte than its own - the dialecte's `engineUrl` (its project factory's, or a hub spawner's) pointing at another dialecte's worker. Two dialectes' projects of one name are two projects: opening one never meets the other. `meta`: `project`, `projectDialecteId` (the engine's or the file's), `realmDialecteId` (the one asked).",fix:"Open the project with the dialecte it was created with; point the dialecte's `engineUrl` at its own worker.",docs:`${e}/api/project#store-errors`}},PROJECT_DIALECTE_VERSION_MISMATCH:{code:`D7009`,message:`The project engine runs another version of the dialecte`,explanation:{when:`The project's engine runs another version of the dialecte than this view.`,fix:`Reload every tab of the app so they run the same version.`,docs:`${e}/api/project#store-errors`}},PROJECT_DESTROY_FAILED:{code:`D7010`,message:`The project could not be deleted`,explanation:{when:`Destroying a project left its files in place: another tab or worker still holds one.`,fix:`Close the other tabs or windows of the app that have the project open, then destroy it again.`,docs:`${e}/api/project#lifecycle`}},PROJECT_OPEN_ELSEWHERE:{code:`D7011`,message:`The project is open in another tab, window or connection`,explanation:{when:"Another tab or window has the project open and there is no shared connection between them; or a destroy was asked while another connection - a store or project of the name in this page, or another tab - has the project open (`meta.connections`, where the store counts them).",fix:`Close the project in the other tab, window or connection, then open or destroy it here again.`,docs:`${e}/api/project#lifecycle`}},PROJECT_DATABASE_LOST:{code:`D7012`,message:`The project's database is gone`,explanation:{when:"The project's files hold data but none of them is its database any more: the database file's header was damaged (by the disk, another program, or site data changed outside the app). Nothing is opened or changed: no empty database is made in its place. `meta.project` names the project.",fix:"The project's data cannot be read back. Offer the user a reset, never automatically: `destroy()` on the same Project instance whose `open` was refused (keep it: `const project = new Project(params)`, then `await project.open(name)`) removes what the refused store holds, without opening it; `open(name)` then makes it again, empty, and its documents can be imported again.",docs:`${e}/api/project#lifecycle`}},PROJECT_DESTROYED_WHILE_AWAY:{code:`D7013`,message:`The project was deleted while this view was away`,explanation:{when:"A view's connection to a project came back - the page back from a freeze or the back/forward cache, its engine started again - and the project it had open was destroyed meanwhile by another tab (and maybe made again under its name): nothing is opened in its place and nothing of it is read. `meta.project` names the project.",fix:"Tell the user the project was deleted elsewhere; close it in this view (`project.close()`), then open it again by its name for what is there now, or choose another.",docs:`${e}/api/project#lifecycle`}},PROJECT_NAME_INVALID:{code:`D7014`,message:`The project's name cannot name its files`,explanation:{when:"A project's name or its dialecte's id is empty, `.` or `..`: every store refuses it before it is built (a SQLite project's files sit in a directory named after both, which no directory can be); nothing was opened or written. `meta.project` and `meta.dialecteId` say which.",fix:"Give the project a name of its own (and the dialecte an id) other than an empty one, `.` or `..`.",docs:`${e}/api/project#lifecycle`}},PROJECT_ENGINE_NOT_DECLARED:{code:`D7015`,message:`This project has no engine to open it on SQLite`,explanation:{when:"A project was opened on `storage: { type: 'sqlite' }` but made by no dialecte's project factory: its engine (the dialecte's id, its version and its engine worker's URL) is known to no one, so nothing can start it. Nothing was opened.",fix:"Make the project with the dialecte's project factory (`createProjectFactory({ dialecte, engineUrl })`, as a dialecte package exports it), or open it on another storage.",docs:`${e}/api/project#sqlite-storage`}},PROJECT_SQLITE_NOT_IMPORTED:{code:`D7016`,message:"SQLite storage needs `import '@dialecte/core/sqlite'`",explanation:{when:"A project was opened (or destroyed by name) on `storage: { type: 'sqlite' }`, or a test asked for the `sqlite` test store, but the app never imported `@dialecte/core/sqlite`: the SQLite storage kind lives behind that entry, so an app that never imports it neither emits nor downloads the SQLite engine, its wasm or the hub. Nothing was opened.",fix:"Add `import '@dialecte/core/sqlite'` once to the app's entry (for tests, to the test runner's setup file), before the first project is opened on SQLite; or open the project on another storage. Imported already? The import registers the kind for every copy of @dialecte/core of the same SQLite storage version in the realm: a copy of another one (a dialecte bringing its own core) does not see it - align the core versions.",docs:`${e}/api/project#sqlite-storage`}},DOCUMENT_PATH_INVALID:{code:`D7030`,message:`A document's path is not valid`,explanation:{when:"A document's path breaks a rule (empty, `.` or `..` segment, backslash, invisible character, not NFC, too long), names another file than the document's, changes its extension, or was handed to `project.import` of several files; nothing was written. `detail` says which rule.",fix:"Write the path relative, joined by `/`, in NFC, ending with the document's file name; pass a path to `importFile`, not to `import`.",docs:`${e}/api/project#a-document-s-path`}},DOCUMENT_PATH_TAKEN:{code:`D7031`,message:`A document's path is another document's place`,explanation:{when:"Another document already holds the place (`meta.takenBy`), a document still importing included: the same path, a path under another document's file, or a file at a folder another document's path uses.",fix:`Choose a path no other document holds, or move the other document first.`,docs:`${e}/api/project#a-document-s-path`}}};function n(e,n){let r=typeof e==`string`?{key:e,...t[e]}:e,i={code:r.code,key:r.key,message:n.message??r.message,detail:n.detail,method:a((/* @__PURE__ */ Error()).stack),ref:n.ref,meta:n.meta,cause:n.cause},o=Error(n.detail);return o.cause=i,o}new Set(Object.values(t).map(e=>e.code));function r(e){if(!(e instanceof Error))return;let t=e.cause;if(!(!t||t instanceof Error)&&typeof t.key==`string`&&typeof t.code==`string`)return t}let i=/* @__PURE__ */ new Set([`throwDialecteError`,`createDialecteError`,`invariant`,`reportFailure`]);function a(e){if(!e)return`unknown`;let t=e.split(`
|
|
2
|
+
`).slice(1).map(e=>e.match(/\bat\s+(?:async\s+)?(\S+)(?:\s+\[as\s+[^\]]+\])?\s+\(([^)]+)\)/)).find(e=>!o(e?.[1])),n=t?.[1]?.replace(/^Object\./,``),r=t?.[2];if(!r||!n)return n??`unknown`;let i=r.match(/(\w[\w-]*\/src\/[^?:]+)/);return i?`${i[1].replace(/\.[^/.]+$/,``)}::${n}`:n}function o(e){return e?i.has(e.slice(e.lastIndexOf(`.`)+1)):!1}function s(e){return c({thrown:e.thrown,depth:0})}function c(e){let{thrown:t,depth:n}=e,i=r(t);if(i&&t instanceof Error){let{cause:e,meta:r,ref:a,...o}=i,s={...o};return r!==void 0&&(s.meta=l({value:r})),a!==void 0&&(s.ref=l({value:a})),e!==void 0&&n<4&&(s.cause=c({thrown:e,depth:n+1})),{kind:`dialecte`,message:t.message,stack:t.stack,error:s}}if(t instanceof Error){let e={kind:`error`,name:t.name,message:t.message,stack:t.stack};return t.cause!==void 0&&n<4&&(e.cause=c({thrown:t.cause,depth:n+1})),e}return{kind:`value`,value:l({value:t})}}function l(e){let{value:t,ancestors:n=/* @__PURE__ */ new Set}=e;if(u({value:t}))return t;if(typeof t!=`object`||!t||n.has(t))return String(t);let r=Object.getPrototypeOf(t),i=Array.isArray(t);if(r!==(i?Array.prototype:Object.prototype)&&r!==null)return String(t);n.add(t);let a=i?t.map(function(e){return l({value:e,ancestors:n})}):Object.fromEntries(Object.entries(t).map(function([e,t]){return[e,l({value:t,ancestors:n})]}));return n.delete(t),a}function u(e){try{return structuredClone(e.value),!0}catch{return!1}}let d=3e4;function f(e){let{dialecteId:t,project:n}=e;return`${encodeURIComponent(t)}/${encodeURIComponent(n)}`}function ee(){let e={realms:/* @__PURE__ */ new Map,projects:/* @__PURE__ */ new Map,holds:/* @__PURE__ */ new Map,nextGeneration:1,nextOrder:0};return{handle:function(t){let n={state:e,now:t.now,commands:[]};return te({step:n,event:t}),{commands:n.commands,wakeAt:de({state:e})}}}}function te(e){let{step:t,event:n}=e;switch(n.type){case`hello`:return ne({step:t,hello:n});case`spawners`:return re({step:t,added:n});case`open`:return m({step:t,open:n});case`leave`:return oe({step:t,leave:n});case`realm-gone`:return le({step:t,realmId:n.realmId});case`engine-opened`:return N({step:t,opened:n});case`engine-open-failed`:return P({step:t,failed:n});case`engine-ended`:return L({step:t,ended:n});case`destroy`:return se({step:t,destroy:n});case`destroyed`:return T({step:t,key:f(n),realmId:n.realmId});case`destroy-elsewhere`:return b({step:t,destroy:n});case`files-deleted`:return ce({step:t,deleted:n});case`tick`:return z({step:t});default:return n}}function ne(e){let{step:t,hello:n}=e;if(n.protocol!==5){p({step:t,realmId:n.realmId,refusal:{origin:`hub`,key:`STORE_PROTOCOL_MISMATCH`,detail:`the hub speaks protocol 5, the view ${n.protocol}`,meta:{hubProtocol:5,realmProtocol:n.protocol}}});return}if(t.state.realms.has(n.realmId)){p({step:t,realmId:n.realmId,refusal:{origin:`hub`,key:`STORE_REALM_ID_TAKEN`,detail:`a view "${n.realmId}" is already connected`,meta:{realmId:n.realmId}}});return}if(n.parentRealmId!==void 0&&!t.state.realms.has(n.parentRealmId)){p({step:t,realmId:n.realmId,refusal:{origin:`hub`,key:`STORE_REALM_UNKNOWN`,detail:`the hub knows no view "${n.parentRealmId}", the parent of "${n.realmId}"`,meta:{realmId:n.realmId,parentRealmId:n.parentRealmId}}});return}let r=n.parentRealmId===void 0?n.spawners:[];t.state.realms.set(n.realmId,{realmId:n.realmId,topLevel:n.topLevel,spawners:new Map(r.map(e=>[e.dialecteId,e.dialecteVersion])),parentRealmId:n.parentRealmId,order:t.state.nextOrder++}),t.commands.push({type:`welcome`,realmId:n.realmId}),n.parentRealmId===void 0&&t.commands.push({type:`watch-realm-lock`,realmId:n.realmId})}function re(e){let{step:t,added:n}=e,r=t.state.realms.get(n.realmId);if(r&&r.parentRealmId===void 0)for(let e of n.spawners)r.spawners.has(e.dialecteId)||r.spawners.set(e.dialecteId,e.dialecteVersion)}function p(e){let{step:t,realmId:n,refusal:r}=e;t.commands.push({type:`refuse-hello`,realmId:n,refusal:r})}function m(e){let{step:t,open:n}=e;if(!t.state.realms.has(n.realmId)){U({step:t,realmId:n.realmId,project:n.project,dialecteId:n.dialecteId,refusal:{origin:`hub`,key:`STORE_REALM_UNKNOWN`,detail:`the hub knows no view "${n.realmId}"`,meta:{realmId:n.realmId}}});return}let r=t.state.holds.get(f(n));if(r){r.opens.set(n.realmId,n);return}let i=t.state.projects.get(f(n));if(i){let e=v({project:i,open:n});if(!e)return ae({step:t,project:i,open:n});if(!ie({state:t.state,project:i,open:n}))return U({step:t,realmId:n.realmId,project:n.project,dialecteId:n.dialecteId,refusal:e});W({step:t,project:i}),t.state.projects.delete(f(i))}h({step:t,open:n})}function ie(e){let{state:t,project:n,open:r}=e;if(n.clients.size>0)return!1;let i=/* @__PURE__ */ new Map([[r.realmId,r.dialecteVersion]]),[a]=K({state:t,dialecteId:r.dialecteId,clients:i});return a?.dialecteVersion===r.dialecteVersion}function ae(e){let{step:t,project:n,open:r}=e;n.clients.set(r.realmId,r.dialecteVersion),g({project:n,open:r}),n.idleDeadline=void 0,n.engine.status===`opening`?A({step:t,project:n}):G({step:t,project:n,realmId:r.realmId})}function h(e){let{step:t,open:n}=e,r=/* @__PURE__ */ new Map([[n.realmId,n.dialecteVersion]]),i=j({step:t,project:n.project,dialecteId:n.dialecteId,clients:r});if(!i)return;let a=t.now+d,o={project:n.project,dialecteId:n.dialecteId,clients:r,expectations:/* @__PURE__ */ new Map,engine:M({step:t,project:n.project,dialecteId:n.dialecteId,host:i,openDeadline:a,expectedCreationId:n.expectedCreationId}),openDeadline:a,idleDeadline:void 0,triedHosts:[]};g({project:o,open:n}),t.state.projects.set(f(n),o)}function g(e){let{project:t,open:n}=e;n.expectedCreationId===void 0?t.expectations.delete(n.realmId):t.expectations.set(n.realmId,n.expectedCreationId)}function _(e){let{project:t}=e,n=[...t.clients.keys()].map(function(e){return t.expectations.get(e)});return n.some(function(e){return e===void 0})?void 0:n[0]}function v(e){let{project:t,open:n}=e;if(n.dialecteVersion!==t.engine.dialecteVersion)return y({project:t.project,dialecteId:t.dialecteId,engineVersion:t.engine.dialecteVersion,realmVersion:n.dialecteVersion})}function y(e){let{project:t,dialecteId:n,engineVersion:r,realmVersion:i}=e;return{origin:`hub`,key:`PROJECT_DIALECTE_VERSION_MISMATCH`,detail:`the engine of "${t}" runs ${n} ${r}, the view ${i}`,meta:{project:t,dialecteId:n,engineVersion:r,realmVersion:i}}}function oe(e){let{step:t,leave:n}=e;t.state.holds.get(f(n))?.opens.delete(n.realmId);let r=t.state.projects.get(f(n));r&&E({step:t,project:r,realmId:n.realmId}),t.commands.push({type:`left`,realmId:n.realmId,project:n.project,dialecteId:n.dialecteId})}function se(e){let{step:t,destroy:n}=e,r=w({state:t.state,destroy:n});r?S({step:t,destroy:n,refusal:r}):(C({step:t,destroy:n,deleterRealmId:void 0}),t.commands.push({type:`destroy-granted`,realmId:n.realmId,project:n.project,dialecteId:n.dialecteId}))}function b(e){let{step:t,destroy:n}=e,r=w({state:t.state,destroy:n});if(r){S({step:t,destroy:n,refusal:r});return}let i=x({state:t.state,destroy:n});i===void 0?S({step:t,destroy:n,refusal:{origin:`hub`,key:`STORE_UNAVAILABLE`,detail:`no view of the origin runs an engine of "${n.dialecteId}" to delete "${n.project}"`,meta:{project:n.project,dialecteId:n.dialecteId}}}):(C({step:t,destroy:n,deleterRealmId:i}),t.commands.push({type:`delete-files`,realmId:i,project:n.project,dialecteId:n.dialecteId}))}function x(e){let{state:t,destroy:n}=e,r=t.realms.get(n.realmId),i=r?.parentRealmId===void 0?void 0:t.realms.get(r.parentRealmId),a=[...t.realms.values()].filter(function(e){return e.realmId!==n.realmId&&e!==i}).sort(function(e,t){return e.order-t.order}),o=i?[i,...a]:a;function s(e){return e.spawners.get(n.dialecteId)===n.dialecteVersion}function c(e){return e.spawners.has(n.dialecteId)}return(o.find(s)??o.find(c))?.realmId}function S(e){let{step:t,destroy:n,refusal:r}=e;t.commands.push({type:`refuse-destroy`,realmId:n.realmId,project:n.project,dialecteId:n.dialecteId,refusal:r})}function C(e){let{step:t,destroy:n,deleterRealmId:r}=e,{realmId:i}=n,a={project:n.project,dialecteId:n.dialecteId,realmId:i,...r!==void 0&&{deleterRealmId:r},opens:/* @__PURE__ */ new Map},o=t.state.projects.get(f(n));if(o){let e=o.clients.get(i);e!==void 0&&(r===void 0&&a.opens.set(i,{type:`open`,now:t.now,realmId:i,project:o.project,dialecteId:o.dialecteId,dialecteVersion:e}),o.engine.status===`ready`&&t.commands.push({type:`engine-lost`,realmId:i,project:o.project,dialecteId:o.dialecteId,generation:o.engine.generation})),W({step:t,project:o}),t.state.projects.delete(f(o))}t.state.holds.set(f(n),a)}function ce(e){let{step:t,deleted:n}=e,r=f(n),i=t.state.holds.get(r);i?.deleterRealmId!==void 0&&i.deleterRealmId===n.realmId&&(t.state.realms.has(i.realmId)&&(n.error===void 0?t.commands.push({type:`destroyed-elsewhere`,realmId:i.realmId,project:i.project,dialecteId:i.dialecteId}):S({step:t,destroy:i,refusal:{origin:`engine`,error:n.error}})),T({step:t,key:r,realmId:i.realmId,held:!0}))}function w(e){let{state:t,destroy:n}=e,{realmId:r,project:i}=n,a=f(n);if(!t.realms.has(r))return{origin:`hub`,key:`STORE_REALM_UNKNOWN`,detail:`the hub knows no view "${r}"`,meta:{realmId:r}};if(t.holds.has(a))return{origin:`hub`,key:`PROJECT_OPEN_ELSEWHERE`,detail:`"${i}" is being destroyed by another view`,meta:{project:i}};let o=[...t.projects.get(a)?.clients.keys()??[]].filter(function(e){return e!==r});if(o.length!==0)return{origin:`hub`,key:`PROJECT_OPEN_ELSEWHERE`,detail:`"${i}" is open in ${o.length} other view(s)`,meta:{project:i,connections:o.length}}}function T(e){let{step:t,key:n,realmId:r,held:i=!1}=e,a=t.state.holds.get(n);if(a?.realmId===r&&(a.deleterRealmId===void 0||i)){t.state.holds.delete(n);for(let e of a.opens.values())m({step:t,open:{...e,now:t.now}})}}function E(e){let{step:t,project:n,realmId:r}=e;I({project:n,realmId:r})&&(n.engine.status===`ready`&&t.commands.push({type:`client-gone`,project:n.project,dialecteId:n.dialecteId,generation:n.engine.generation,realmId:r}),n.clients.size>0||(n.idleDeadline=t.now+5e3,n.openDeadline=void 0))}function le(e){let{step:t,realmId:n}=e;if(!t.state.realms.has(n))return;let r=D({state:t.state,realmId:n});for(let e of r)t.state.realms.delete(e),t.commands.push({type:`drop-realm`,realmId:e});for(let e of t.state.holds.values()){for(let t of r)e.opens.delete(t);e.deleterRealmId!==void 0&&r.includes(e.deleterRealmId)?(r.includes(e.realmId)||S({step:t,destroy:e,refusal:{origin:`hub`,key:`STORE_ENGINE_LOST`,detail:`the view deleting "${e.project}" is gone: its files may be partly deleted`,meta:{project:e.project,reason:`host-gone`}}}),T({step:t,key:f(e),realmId:e.realmId,held:!0})):r.includes(e.realmId)&&T({step:t,key:f(e),realmId:e.realmId})}for(let e of t.state.projects.values())if(r.includes(e.engine.hostRealmId)){for(let t of r)I({project:e,realmId:t});O({step:t,project:e})}else for(let n of r)E({step:t,project:e,realmId:n})}function D(e){let{state:t,realmId:n}=e,r=[n];for(let e of r)for(let n of t.realms.values())n.parentRealmId===e&&r.push(n.realmId);return r}function O(e){let{step:t,project:n}=e;if(W({step:t,project:n}),n.engine.status===`ready`)for(let e of n.clients.keys())t.commands.push({type:`engine-lost`,realmId:e,project:n.project,dialecteId:n.dialecteId,generation:n.engine.generation});if(n.openDeadline!==void 0&&n.openDeadline-t.now<1e3){k({step:t,project:n});return}let r=n.clients.size>0?j({step:t,project:n.project,dialecteId:n.dialecteId,clients:n.clients}):void 0;r?n.engine=M({step:t,project:n.project,dialecteId:n.dialecteId,host:r,openDeadline:A({step:t,project:n}),expectedCreationId:_({project:n})}):t.state.projects.delete(f(n))}function k(e){let{step:t,project:n}=e;H({step:t,project:n.project,dialecteId:n.dialecteId,clients:n.clients,refusal:{origin:`hub`,key:`PROJECT_ENGINE_UNAVAILABLE`,detail:`no engine for "${n.project}" opened within ${d} ms`,meta:{project:n.project,dialecteId:n.dialecteId,openBudgetMs:d}}}),t.state.projects.delete(f(n))}function A(e){let{step:t,project:n}=e;return n.openDeadline===void 0&&(n.openDeadline=t.now+d,n.triedHosts=[]),n.openDeadline}function j(e){let{step:t,project:n,dialecteId:r,clients:i}=e,[a]=K({state:t.state,dialecteId:r,clients:i});if(a)return ue({step:t,project:n,dialecteId:r,clients:i,host:a});H({step:t,project:n,dialecteId:r,clients:i,refusal:{origin:`hub`,key:`PROJECT_ENGINE_UNAVAILABLE`,detail:`no connected view can start an engine of "${r}"`,meta:{project:n,dialecteId:r}}})}function ue(e){let{step:t,project:n,dialecteId:r,clients:i,host:a}=e;for(let[e,o]of i)o!==a.dialecteVersion&&(U({step:t,realmId:e,project:n,dialecteId:r,refusal:y({project:n,dialecteId:r,engineVersion:a.dialecteVersion,realmVersion:o})}),i.delete(e));return i.size>0?a:void 0}function M(e){let{step:t,project:n,dialecteId:r,host:i,openDeadline:a,expectedCreationId:o}=e,s={hostRealmId:i.realm.realmId,generation:t.state.nextGeneration++,dialecteVersion:i.dialecteVersion,status:`opening`,creationId:void 0,expectedCreationId:o};return t.commands.push({type:`spawn-engine`,realmId:s.hostRealmId,project:n,dialecteId:r,generation:s.generation,openBudgetMs:Math.min(1e4,a-t.now),...o!==void 0&&{expectedCreationId:o}}),s}function N(e){let{step:t,opened:n}=e,r=V({state:t.state,project:n.project,dialecteId:n.dialecteId,generation:n.generation});if(r?.engine.status===`opening`){r.engine.status=`ready`,r.engine.creationId=n.creationId,r.openDeadline=void 0;for(let e of r.clients.keys())G({step:t,project:r,realmId:e})}}function P(e){let{step:t,failed:n}=e,r=V({state:t.state,project:n.project,dialecteId:n.dialecteId,generation:n.generation});if(r?.engine.status!==`opening`)return;W({step:t,project:r});let i=A({step:t,project:r});if(r.triedHosts.push(r.engine.hostRealmId),n.failure.key===`PROJECT_DESTROYED_WHILE_AWAY`)return F({step:t,project:r,error:n.failure.error,openDeadline:i});let a=n.failure.key===`PROJECT_ENGINE_BUSY`&&r.clients.size>0&&i-t.now>=1e3?R({step:t,project:r}):void 0;a?r.engine=M({step:t,project:r.project,dialecteId:r.dialecteId,host:a,openDeadline:i,expectedCreationId:_({project:r})}):(H({step:t,project:r.project,dialecteId:r.dialecteId,clients:r.clients,refusal:{origin:`engine`,error:n.failure.error}}),t.state.projects.delete(f(r)))}function F(e){let{step:t,project:n,error:r,openDeadline:i}=e,a=n.engine.expectedCreationId,o=new Map([...n.clients].filter(function([e]){return n.expectations.get(e)===a}));for(let e of o.keys())I({project:n,realmId:e});if(H({step:t,project:n.project,dialecteId:n.dialecteId,clients:o,refusal:{origin:`engine`,error:r}}),n.clients.size===0){t.state.projects.delete(f(n));return}if(i-t.now<1e3)return k({step:t,project:n});let s=j({step:t,project:n.project,dialecteId:n.dialecteId,clients:n.clients});s?n.engine=M({step:t,project:n.project,dialecteId:n.dialecteId,host:s,openDeadline:i,expectedCreationId:_({project:n})}):t.state.projects.delete(f(n))}function I(e){let{project:t,realmId:n}=e;return t.expectations.delete(n),t.clients.delete(n)}function L(e){let{step:t,ended:n}=e,r=V({state:t.state,project:n.project,dialecteId:n.dialecteId,generation:n.generation});r&&(r.engine.status===`ready`?O({step:t,project:r}):(W({step:t,project:r}),H({step:t,project:r.project,dialecteId:r.dialecteId,clients:r.clients,refusal:{origin:`hub`,key:`PROJECT_ENGINE_UNAVAILABLE`,detail:`the engine of "${r.project}" ended before it opened`,meta:{project:r.project,dialecteId:r.dialecteId}}}),t.state.projects.delete(f(r))))}function R(e){let{step:t,project:n}=e,r=K({state:t.state,dialecteId:n.dialecteId,clients:n.clients}),i=n.triedHosts.at(-1);return r.find(e=>!n.triedHosts.includes(e.realm.realmId)&&q({clients:n.clients,candidate:e})>0)??r.find(e=>e.realm.realmId===i)}function z(e){let{step:t}=e;for(let e of t.state.projects.values())e.openDeadline===void 0||e.openDeadline>t.now||(W({step:t,project:e}),k({step:t,project:e}));for(let e of t.state.projects.values())e.idleDeadline===void 0||e.idleDeadline>t.now||(W({step:t,project:e}),t.state.projects.delete(f(e)));for(let e of t.state.holds.values())B({step:t,hold:e})}function B(e){let{step:t,hold:n}=e;for(let e of n.opens.values())e.now+d>t.now||(n.opens.delete(e.realmId),U({step:t,realmId:e.realmId,project:n.project,dialecteId:n.dialecteId,refusal:{origin:`hub`,key:`PROJECT_ENGINE_UNAVAILABLE`,detail:`"${n.project}" is being destroyed and was not done within ${d} ms`,meta:{project:n.project,openBudgetMs:d}}}))}function V(e){let t=e.state.projects.get(f(e));return t?.engine.generation===e.generation?t:void 0}function H(e){let{step:t,project:n,dialecteId:r,clients:i,refusal:a}=e;for(let e of i.keys())U({step:t,realmId:e,project:n,dialecteId:r,refusal:a});i.clear()}function U(e){let{step:t,realmId:n,project:r,dialecteId:i,refusal:a}=e;t.commands.push({type:`refuse-open`,realmId:n,project:r,dialecteId:i,refusal:a})}function W(e){let{step:t,project:n}=e;t.commands.push({type:`release-engine`,project:n.project,dialecteId:n.dialecteId,generation:n.engine.generation,hostRealmId:n.engine.hostRealmId})}function de(e){let t=[...e.state.projects.values()].flatMap(e=>[e.openDeadline,e.idleDeadline].filter(e=>e!==void 0));for(let n of e.state.holds.values())for(let e of n.opens.values())t.push(e.now+d);return t.length>0?Math.min(...t):void 0}function G(e){let{step:t,project:n,realmId:r}=e,{creationId:i}=n.engine;i!==void 0&&(n.expectations.set(r,i),t.commands.push({type:`connect-client`,creationId:i,project:n.project,dialecteId:n.dialecteId,generation:n.engine.generation,realmId:r}))}function K(e){let{state:t,dialecteId:n,clients:r}=e;return[...t.realms.values()].flatMap(e=>fe({realm:e,dialecteId:n})).sort((e,t)=>pe({left:e,right:t,clients:r}))}function fe(e){let{realm:t,dialecteId:n}=e,r=t.spawners.get(n);return r===void 0?[]:[{realm:t,dialecteVersion:r}]}function pe(e){let{left:t,right:n,clients:r}=e;return Number(n.realm.topLevel)-Number(t.realm.topLevel)||q({clients:r,candidate:n})-q({clients:r,candidate:t})||Number(r.has(n.realm.realmId))-Number(r.has(t.realm.realmId))||t.realm.order-n.realm.order}function q(e){let{clients:t,candidate:n}=e;return[...t.values()].filter(e=>e===n.dialecteVersion).length}function me(e={}){let{helloBudgetMs:t=2e4}=e,r=ee(),i={realms:/* @__PURE__ */ new Map,hosts:/* @__PURE__ */ new Map,adoptions:/* @__PURE__ */ new Map,nextAdoptionId:0,bindings:/* @__PURE__ */ new Map,timer:void 0,hubLock:`dialecte:hub:${crypto.randomUUID()}`},a=Ee({name:i.hubLock});a.catch(Te);function o(e){let t=r.handle(e.event);for(let n of t.commands)he({state:i,command:n,hello:e.hello,feed:o});we({state:i,wakeAt:t.wakeAt,feed:o})}function c(e){let{port:n,parentRealmId:r,bindingId:a}=e,s,c=a===void 0?setTimeout(function(){n.onmessage=null,n.close()},t):void 0;n.onmessage=function(e){let t=e.data;if(typeof t?.type==`string`){if(t.type===`hello`){if(s!==void 0)return;clearTimeout(c),s=t.realmId,o({event:{type:`hello`,now:performance.now(),realmId:t.realmId,protocol:t.protocol,topLevel:t.topLevel,spawners:t.spawners,parentRealmId:r},hello:{port:n,bindingId:a}})}else t.type===`port-unused`&&s===void 0?(clearTimeout(c),a!==void 0&&i.bindings.delete(a),n.close()):s!==void 0&&i.realms.get(s)?.port===n&&l({realmId:s,message:t})}}}function l(e){let{realmId:t,message:n}=e,r=performance.now();switch(n.type){case`open`:return o({event:{...n,now:r,realmId:t}});case`spawners`:return o({event:{type:`spawners`,now:r,realmId:t,spawners:n.spawners}});case`ping`:return $({port:i.realms.get(t).port,message:{type:`pong`}});case`files-deleted`:return o({event:{type:`files-deleted`,now:r,realmId:t,project:n.project,dialecteId:n.dialecteId,...n.error!==void 0&&{error:n.error}}});case`destroy-elsewhere`:return o({event:{type:`destroy-elsewhere`,now:r,realmId:t,project:n.project,dialecteId:n.dialecteId,dialecteVersion:n.dialecteVersion}});case`leave`:case`destroy`:case`destroyed`:return o({event:{type:n.type,now:r,realmId:t,project:n.project,dialecteId:n.dialecteId}});case`bind-child`:return i.bindings.set(n.bindingId,{port:n.port,parentRealmId:t,realmId:void 0}),c({port:n.port,parentRealmId:t,bindingId:n.bindingId});case`unbind-child`:return be({state:i,bindingId:n.bindingId,feed:o});case`engine-opened`:return J({state:i,realmId:t,engine:n})?o({event:{type:`engine-opened`,now:r,project:n.project,dialecteId:n.dialecteId,generation:n.generation,creationId:n.creationId}}):void 0;case`engine-ended`:return J({state:i,realmId:t,engine:n})?o({event:{type:`engine-ended`,now:r,project:n.project,dialecteId:n.dialecteId,generation:n.generation}}):void 0;case`engine-open-failed`:return J({state:i,realmId:t,engine:n})?o({event:{type:`engine-open-failed`,now:r,project:n.project,dialecteId:n.dialecteId,generation:n.generation,failure:{key:n.key,error:n.error}}}):void 0;case`client-adopted`:return Se({state:i,realmId:t,adoptionId:n.adoptionId});case`client-adopt-failed`:return Ce({state:i,realmId:t,adoptionId:n.adoptionId,feed:o});default:return}}return{connect:function({port:e}){a.then(function(){c({port:e})},function(t){$({port:e,message:{type:`hello-refused`,error:s({thrown:n(`STORE_CONNECTION_FAILED`,{detail:`The origin's hub could not hold its lock: it welcomes no view`,...t instanceof Error&&{cause:t}})})}}),e.close()})}}}function he(e){let{state:t,command:n,hello:r,feed:i}=e;switch(n.type){case`welcome`:return ge({state:t,realmId:n.realmId,hello:r});case`refuse-hello`:if(!r)return;$({port:r.port,message:{type:`hello-refused`,error:X(n.refusal)}}),r.port.close(),r.bindingId!==void 0&&t.bindings.delete(r.bindingId);return;case`drop-realm`:return _e({state:t,realmId:n.realmId});case`watch-realm-lock`:return ye({state:t,realmId:n.realmId,feed:i});case`spawn-engine`:return t.hosts.set(Z(n),n.realmId),Q({state:t,realmId:n.realmId,message:{type:`spawn-engine`,project:n.project,dialecteId:n.dialecteId,generation:n.generation,openBudgetMs:n.openBudgetMs,...n.expectedCreationId!==void 0&&{expectedCreationId:n.expectedCreationId}}});case`connect-client`:return xe({state:t,project:n.project,dialecteId:n.dialecteId,generation:n.generation,creationId:n.creationId,clientRealmId:n.realmId,feed:i});case`engine-lost`:return Y({state:t,realmId:n.realmId,engine:n}),Q({state:t,realmId:n.realmId,message:{type:`engine-lost`,project:n.project,dialecteId:n.dialecteId,generation:n.generation}});case`refuse-open`:return Y({state:t,realmId:n.realmId,engine:n}),Q({state:t,realmId:n.realmId,message:{type:`open-refused`,project:n.project,dialecteId:n.dialecteId,error:X(n.refusal)}});case`client-gone`:{Y({state:t,realmId:n.realmId,engine:n});let e=t.hosts.get(Z(n));return e===void 0?void 0:Q({state:t,realmId:e,message:{type:`client-gone`,project:n.project,dialecteId:n.dialecteId,generation:n.generation,clientId:n.realmId}})}case`release-engine`:return t.hosts.delete(Z(n)),Q({state:t,realmId:n.hostRealmId,message:{type:`release-engine`,project:n.project,dialecteId:n.dialecteId,generation:n.generation}});case`left`:return Q({state:t,realmId:n.realmId,message:{type:`left`,project:n.project,dialecteId:n.dialecteId}});case`destroy-granted`:return Q({state:t,realmId:n.realmId,message:{type:`destroy-granted`,project:n.project,dialecteId:n.dialecteId}});case`delete-files`:case`destroyed-elsewhere`:return Q({state:t,realmId:n.realmId,message:{type:n.type,project:n.project,dialecteId:n.dialecteId}});case`refuse-destroy`:return Q({state:t,realmId:n.realmId,message:{type:`destroy-refused`,project:n.project,dialecteId:n.dialecteId,error:X(n.refusal)}});default:return n}}function ge(e){let{state:t,realmId:n,hello:r}=e;if(r){if(t.realms.set(n,{realmId:n,port:r.port,watch:void 0}),r.bindingId!==void 0){let e=t.bindings.get(r.bindingId);e&&(e.realmId=n)}$({port:r.port,message:{type:`welcome`,realmId:n,hubLock:t.hubLock}})}}function _e(e){let{state:t,realmId:n}=e,r=t.realms.get(n);if(r){t.realms.delete(n),r.watch?.abort(),ve({state:t,realmId:n})&&$({port:r.port,message:{type:`dropped`}}),r.port.close();for(let[e,r]of t.adoptions)r.clientRealmId===n&&(r.port.close(),t.adoptions.delete(e));for(let[e,r]of t.bindings)r.realmId===n&&t.bindings.delete(e),r.realmId===void 0&&r.parentRealmId===n&&($({port:r.port,message:{type:`hello-refused`,error:X({origin:`hub`,key:`STORE_REALM_UNKNOWN`,detail:`the view that bound this one ("${n}") is gone`,meta:{realmId:n}})}}),r.port.close(),t.bindings.delete(e))}}function ve(e){for(let t of e.state.bindings.values())if(t.realmId===e.realmId)return!0;return!1}function ye(e){let{state:t,realmId:n,feed:r}=e,i=t.realms.get(n);if(!i)return;let a=new AbortController;i.watch=a,navigator.locks.request(`dialecte:realm:${n}`,{signal:a.signal},function(){r({event:{type:`realm-gone`,now:performance.now(),realmId:n}})}).catch(function(e){e?.name!==`AbortError`&&console.error(`The hub could not watch a view for its end:`,e)})}function be(e){let{state:t,bindingId:n,feed:r}=e,i=t.bindings.get(n);i&&(i.realmId===void 0?(t.bindings.delete(n),i.port.close()):(r({event:{type:`realm-gone`,now:performance.now(),realmId:i.realmId}}),t.bindings.delete(n)))}function xe(e){let{state:t,project:n,dialecteId:r,generation:i,creationId:a,clientRealmId:o,feed:s}=e,c=t.hosts.get(Z({project:n,generation:i})),l=c===void 0?void 0:t.realms.get(c);if(c===void 0||!l){queueMicrotask(function(){s({event:{type:`engine-ended`,now:performance.now(),project:n,dialecteId:r,generation:i}})});return}let u=new MessageChannel;t.nextAdoptionId+=1;let d=t.nextAdoptionId;t.adoptions.set(d,{hostRealmId:c,clientRealmId:o,project:n,dialecteId:r,generation:i,creationId:a,port:u.port1}),$({port:l.port,message:{type:`adopt-client`,project:n,dialecteId:r,generation:i,adoptionId:d,clientId:o,port:u.port2},transfer:[u.port2]})}function Se(e){let{state:t,realmId:n,adoptionId:r}=e,i=t.adoptions.get(r);if(i?.hostRealmId!==n)return;t.adoptions.delete(r);let a=t.realms.get(i.clientRealmId);!a||t.hosts.get(Z(i))!==n?i.port.close():$({port:a.port,message:{type:`engine-ready`,project:i.project,dialecteId:i.dialecteId,generation:i.generation,creationId:i.creationId,port:i.port},transfer:[i.port]})}function Ce(e){let{state:t,realmId:n,adoptionId:r,feed:i}=e,a=t.adoptions.get(r);a?.hostRealmId===n&&(t.adoptions.delete(r),a.port.close(),i({event:{type:`engine-ended`,now:performance.now(),project:a.project,dialecteId:a.dialecteId,generation:a.generation}}))}function J(e){return e.state.hosts.get(Z(e.engine))===e.realmId}function Y(e){let{state:t,realmId:n,engine:r}=e;for(let[e,i]of t.adoptions){let a=i.project===r.project&&i.dialecteId===r.dialecteId;i.clientRealmId===n&&a&&(i.port.close(),t.adoptions.delete(e))}}function we(e){let{state:t,wakeAt:n,feed:r}=e;clearTimeout(t.timer),t.timer=void 0,n!==void 0&&(t.timer=setTimeout(function(){t.timer=void 0;let e={type:`tick`,now:performance.now()};r({event:e})},Math.max(0,n-performance.now())))}function X(e){return e.origin===`engine`?e.error:s({thrown:n(e.key,{detail:e.detail,meta:e.meta})})}function Z(e){return`${e.project}#${e.generation}`}function Q(e){let t=e.state.realms.get(e.realmId);t&&$({port:t.port,message:e.message})}function $(e){e.port.postMessage(e.message,e.transfer??[])}function Te(){}function Ee(e){return new Promise(function(t,n){navigator.locks.request(e.name,function(){return t(),new Promise(function(){})}).catch(n)})}let De=me();self.onconnect=function(e){for(let t of e.ports)De.connect({port:t})}})();
|
|
@@ -5,6 +5,8 @@ import { CreateDiagnosticParams, CreatedDiagnostic, Diagnostic, DiagnosticCatalo
|
|
|
5
5
|
* their type on the way out, so a dialecte's typed diagnostic (`Diagnostic<'x'> & { meta: {…} }`) is
|
|
6
6
|
* what this returns when it is given that `meta`.
|
|
7
7
|
*
|
|
8
|
+
* @intent report an import or validation problem as a typed diagnostic, build a diagnostic from a dialecte's catalogue, attach meta to a diagnostic
|
|
9
|
+
*
|
|
8
10
|
* @example
|
|
9
11
|
* createDiagnostic(SCL_IMPORT_DIAGNOSTICS, 'unresolved-reference', {
|
|
10
12
|
* ref: { tagName: 'FunctionRef', id, attribute: 'function' },
|
|
@@ -17,6 +19,8 @@ export declare function createDiagnostic<const GenericCatalogue extends Diagnost
|
|
|
17
19
|
* the pair (`source`, `code`) - two dialectes may both have an `unresolved-reference`. Its `code` is
|
|
18
20
|
* then narrowed to those catalogues' codes, so a `switch` on it or a table read with it is checked.
|
|
19
21
|
*
|
|
22
|
+
* @intent tell which diagnostic an import reported, narrow a diagnostic to a catalogue's codes, word a diagnostic for a user
|
|
23
|
+
*
|
|
20
24
|
* @example
|
|
21
25
|
* if (isKnownDiagnostic(diagnostic, { catalogues: [SCL_IMPORT_DIAGNOSTICS] })) sentences[diagnostic.code]
|
|
22
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/diagnostics/diagnostics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,SAAS,CAAA;AAEhB
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/diagnostics/diagnostics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC/B,KAAK,CAAC,gBAAgB,SAAS,mBAAmB,EAClD,WAAW,SAAS,MAAM,gBAAgB,CAAC,OAAO,CAAC,GAAG,MAAM,EAC5D,aAAa,SAAS,sBAAsB,EAE5C,SAAS,EAAE,gBAAgB,EAC3B,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,aAAa,GACnB,iBAAiB,CAAC,WAAW,EAAE,aAAa,CAAC,CAiB/C;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,SAAS,SAAS,mBAAmB,EAAE,EAC/F,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE;IAAE,UAAU,EAAE,iBAAiB,CAAA;CAAE,GACvC,UAAU,IAAI,UAAU,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,CAKlE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CatalogueExplanation } from '../errors';
|
|
1
2
|
/**
|
|
2
3
|
* The levels of the language-server protocol: `error` and `warning` say something is wrong,
|
|
3
4
|
* `information` reports what was done (a value rewritten on import), `hint` what could be better.
|
|
@@ -35,11 +36,15 @@ export type Diagnostic<GenericCode extends string = string> = {
|
|
|
35
36
|
/** What it is about, as serializable data - the contract, with `code`; `message` is the convenience. */
|
|
36
37
|
meta?: Record<string, unknown>;
|
|
37
38
|
};
|
|
38
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* What a catalogue says of one code: the severity its diagnostics carry, their family, their default
|
|
41
|
+
* wording, and optionally when it is raised and the usual fix.
|
|
42
|
+
*/
|
|
39
43
|
export type DiagnosticCatalogueEntry = {
|
|
40
44
|
severity: DiagnosticSeverity;
|
|
41
45
|
family: DiagnosticFamily;
|
|
42
46
|
message: string;
|
|
47
|
+
explanation?: CatalogueExplanation;
|
|
43
48
|
};
|
|
44
49
|
/**
|
|
45
50
|
* The diagnostics a producer may emit, by code, under one `source`. A dialecte writes one per
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/diagnostics/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,CAAA;AAE7E,2HAA2H;AAC3H,MAAM,MAAM,gBAAgB,GACzB,OAAO,GACP,WAAW,GACX,WAAW,GACX,UAAU,GACV,WAAW,GACX,QAAQ,CAAA;AAEX,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,CAAC,WAAW,SAAS,MAAM,GAAG,MAAM,IAAI;IAC7D,0CAA0C;IAC1C,IAAI,EAAE,WAAW,CAAA;IACjB,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,sGAAsG;IACtG,MAAM,EAAE,MAAM,CAAA;IACd,0FAA0F;IAC1F,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,aAAa,CAAA;IAClB,kFAAkF;IAClF,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,aAAa,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACnD,wGAAwG;IACxG,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/diagnostics/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEpD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,aAAa,GAAG,MAAM,CAAA;AAE7E,2HAA2H;AAC3H,MAAM,MAAM,gBAAgB,GACzB,OAAO,GACP,WAAW,GACX,WAAW,GACX,UAAU,GACV,WAAW,GACX,QAAQ,CAAA;AAEX,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,CAAC,WAAW,SAAS,MAAM,GAAG,MAAM,IAAI;IAC7D,0CAA0C;IAC1C,IAAI,EAAE,WAAW,CAAA;IACjB,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,sGAAsG;IACtG,MAAM,EAAE,MAAM,CAAA;IACd,0FAA0F;IAC1F,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,aAAa,CAAA;IAClB,kFAAkF;IAClF,OAAO,CAAC,EAAE;QAAE,GAAG,EAAE,aAAa,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACnD,wGAAwG;IACxG,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACtC,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,MAAM,EAAE,gBAAgB,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,oBAAoB,CAAA;CAClC,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE;QAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,wBAAwB,CAAA;KAAE,CAAA;CAC5E,CAAA;AAED,sGAAsG;AACtG,MAAM,MAAM,sBAAsB,GAAG;IACpC,GAAG,EAAE,aAAa,CAAA;IAClB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAC5B,WAAW,SAAS,MAAM,EAC1B,aAAa,SAAS,sBAAsB,IACzC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,SAAS,CAAC,CAAA;AAE9F,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,CAAC,iBAAiB,SAAS,SAAS,mBAAmB,EAAE,IACvF,gBAAgB,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAA;AAE5C,KAAK,gBAAgB,CAAC,gBAAgB,IAAI,gBAAgB,SAAS,mBAAmB,GACnF,MAAM,gBAAgB,CAAC,OAAO,CAAC,GAAG,MAAM,GACxC,KAAK,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Project } from '../project';
|
|
2
|
+
import { CreateDialecteProjectParams } from './dialecte.types';
|
|
3
|
+
import { ExtensionModules } from '../document';
|
|
4
|
+
import { AnyDialecteConfig } from '../types';
|
|
5
|
+
/**
|
|
6
|
+
* The one place a Project of a declared dialecte is wired: every config, the default key, the
|
|
7
|
+
* dialecte's extensions under the consumer's, a fresh hooks instance, the local store by default; its engine
|
|
8
|
+
* worker's address when its factory gives one (what `sqlite` storage starts).
|
|
9
|
+
*/
|
|
10
|
+
export declare function createDialecteProject<GenericConfig extends AnyDialecteConfig, GenericModules extends ExtensionModules = Record<never, never>, CustomModules extends ExtensionModules = Record<never, never>>(params: CreateDialecteProjectParams<GenericConfig, GenericModules, CustomModules>): Project<GenericConfig, GenericModules & CustomModules>;
|
|
11
|
+
//# sourceMappingURL=create-dialecte-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-dialecte-project.d.ts","sourceRoot":"","sources":["../../src/dialecte/create-dialecte-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACpC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9D,aAAa,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAE7D,MAAM,EAAE,2BAA2B,CAAC,aAAa,EAAE,cAAc,EAAE,aAAa,CAAC,GAC/E,OAAO,CAAC,aAAa,EAAE,cAAc,GAAG,aAAa,CAAC,CAaxD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CreateProjectFactoryParams, ProjectFactory } from './dialecte.types';
|
|
2
|
+
import { ExtensionModules } from '../document';
|
|
3
|
+
import { AnyDialecteConfig } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* The project factory of a dialecte: every config, the default key, the dialecte's extensions
|
|
6
|
+
* merged under the consumer's, and a fresh hooks instance per Project. It carries the declaration,
|
|
7
|
+
* `engineUrl`, the address of the dialecte's engine worker, for the store that spawns it, and `spawner`,
|
|
8
|
+
* the engine as a page registers it with the hub (`connectHub({ spawners })`). `destroyProject({ name })` deletes the
|
|
9
|
+
* dialecte's project of that name on SQLite storage without opening it (an outdated or lost one too).
|
|
10
|
+
*
|
|
11
|
+
* @intent open projects of a dialecte from an app, get the factory that creates a dialecte's projects, delete a dialecte's project without opening it, register a dialecte's engine with the hub, use SQLite storage in an app (import `@dialecte/core/sqlite` once and open with `storage: { type: 'sqlite' }`), share one SQLite engine per project between the tabs of an app
|
|
12
|
+
*/
|
|
13
|
+
export declare function createProjectFactory<GenericConfig extends AnyDialecteConfig, GenericModules extends ExtensionModules = Record<never, never>, GenericConfigKey extends string = string>(params: CreateProjectFactoryParams<GenericConfig, GenericModules, GenericConfigKey>): ProjectFactory<GenericConfig, GenericModules, GenericConfigKey>;
|
|
14
|
+
//# sourceMappingURL=create-project-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-project-factory.d.ts","sourceRoot":"","sources":["../../src/dialecte/create-project-factory.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACX,0BAA0B,EAE1B,cAAc,EACd,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAGlD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEhD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9D,gBAAgB,SAAS,MAAM,GAAG,MAAM,EAExC,MAAM,EAAE,0BAA0B,CAAC,aAAa,EAAE,cAAc,EAAE,gBAAgB,CAAC,GACjF,cAAc,CAAC,aAAa,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAyCjE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DefineDialecteParams, DialecteDeclaration } from './dialecte.types';
|
|
2
|
+
import { ExtensionModules } from '../document';
|
|
3
|
+
import { AnyDialecteConfig } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Declare a dialecte once: its identity, its configs, its extensions and how its hooks are made.
|
|
6
|
+
* Core derives the rest: `createProjectFactory`, `createTestRunner`, `createTestProject` and,
|
|
7
|
+
* in a worker, the engine. The declaration is frozen.
|
|
8
|
+
*
|
|
9
|
+
* @intent declare a dialecte package, register a dialecte's configs and extensions and hooks once, set up a new dialecte
|
|
10
|
+
*/
|
|
11
|
+
export declare function defineDialecte<GenericConfig extends AnyDialecteConfig, GenericModules extends ExtensionModules = Record<never, never>, GenericConfigKey extends string = string>(params: DefineDialecteParams<GenericConfig, GenericModules, GenericConfigKey>): DialecteDeclaration<GenericConfig, GenericModules, GenericConfigKey>;
|
|
12
|
+
//# sourceMappingURL=define-dialecte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-dialecte.d.ts","sourceRoot":"","sources":["../../src/dialecte/define-dialecte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAMhD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC7B,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9D,gBAAgB,SAAS,MAAM,GAAG,MAAM,EAExC,MAAM,EAAE,oBAAoB,CAAC,aAAa,EAAE,cAAc,EAAE,gBAAgB,CAAC,GAC3E,mBAAmB,CAAC,aAAa,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAmBtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialecte.constants.d.ts","sourceRoot":"","sources":["../../src/dialecte/dialecte.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,uDAAuD;AACvD,eAAO,MAAM,oBAAoB,EAAE,gBAAqB,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ExtensionModules } from '../document';
|
|
2
|
+
import { Project, StorageParam } from '../project';
|
|
3
|
+
import { HubEngineSpawner } from '../store';
|
|
4
|
+
import { AnyDialecteConfig, DialecteHooks } from '../types';
|
|
5
|
+
/** What a dialecte gives `defineDialecte`: everything core derives a Project, a test runner and an engine from. */
|
|
6
|
+
export type DefineDialecteParams<GenericConfig extends AnyDialecteConfig, GenericModules extends ExtensionModules = Record<never, never>, GenericConfigKey extends string = string> = {
|
|
7
|
+
/** The dialecte's identity: the engine stores it with each project it opens. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** The dialecte package's version: a client and the engine it talks to must run the same one. */
|
|
10
|
+
version: string;
|
|
11
|
+
/** Every config of the dialecte, under the keys `configKey` names them by. */
|
|
12
|
+
configs: Record<GenericConfigKey, GenericConfig>;
|
|
13
|
+
/** The config a document gets when it names none. */
|
|
14
|
+
defaultConfigKey: NoInfer<GenericConfigKey>;
|
|
15
|
+
/** The dialecte's own extension modules, merged under the ones a consumer adds per project. */
|
|
16
|
+
extensions?: GenericModules;
|
|
17
|
+
/**
|
|
18
|
+
* Makes the dialecte's hooks (IO and transaction). Called once per Project and once per engine:
|
|
19
|
+
* the state a hook keeps belongs to that one owner, never shared across realms.
|
|
20
|
+
*/
|
|
21
|
+
createHooks?: () => DialecteHooks<GenericConfig>;
|
|
22
|
+
};
|
|
23
|
+
/** A dialecte, declared once: what `defineDialecte` returns and every derivation takes. */
|
|
24
|
+
export type DialecteDeclaration<GenericConfig extends AnyDialecteConfig, GenericModules extends ExtensionModules = Record<never, never>, GenericConfigKey extends string = string> = {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly version: string;
|
|
27
|
+
readonly configs: Readonly<Record<GenericConfigKey, GenericConfig>>;
|
|
28
|
+
readonly defaultConfigKey: GenericConfigKey;
|
|
29
|
+
readonly extensions: GenericModules;
|
|
30
|
+
readonly createHooks: () => DialecteHooks<GenericConfig>;
|
|
31
|
+
};
|
|
32
|
+
export type CreateProjectFactoryParams<GenericConfig extends AnyDialecteConfig, GenericModules extends ExtensionModules = Record<never, never>, GenericConfigKey extends string = string> = {
|
|
33
|
+
dialecte: DialecteDeclaration<GenericConfig, GenericModules, GenericConfigKey>;
|
|
34
|
+
/**
|
|
35
|
+
* The address of the dialecte's engine worker: the URL its module exports from a `?worker&url`
|
|
36
|
+
* import of its worker entry. The store that runs the engine spawns
|
|
37
|
+
* `new Worker(engineUrl, { type: 'module' })` on it.
|
|
38
|
+
*/
|
|
39
|
+
engineUrl: string;
|
|
40
|
+
};
|
|
41
|
+
/** What a consumer chooses per project; everything else comes from the declaration. */
|
|
42
|
+
export type CreateProjectParams<CustomModules extends ExtensionModules = Record<never, never>> = {
|
|
43
|
+
/** Defaults to the local store. */
|
|
44
|
+
storage?: StorageParam;
|
|
45
|
+
/** The consumer's own extension modules, merged over the dialecte's. */
|
|
46
|
+
extensions?: CustomModules;
|
|
47
|
+
dev?: {
|
|
48
|
+
perf?: boolean;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Makes a Project of the dialecte: call it, then `open(name)`. Carries the declaration and the
|
|
53
|
+
* engine address it was made with.
|
|
54
|
+
*/
|
|
55
|
+
export type ProjectFactory<GenericConfig extends AnyDialecteConfig, GenericModules extends ExtensionModules = Record<never, never>, GenericConfigKey extends string = string> = {
|
|
56
|
+
<CustomModules extends ExtensionModules = Record<never, never>>(params?: CreateProjectParams<CustomModules>): Project<GenericConfig, GenericModules & CustomModules>;
|
|
57
|
+
readonly dialecte: DialecteDeclaration<GenericConfig, GenericModules, GenericConfigKey>;
|
|
58
|
+
readonly engineUrl: string;
|
|
59
|
+
/** The dialecte's engine as a page registers it with the hub: `connectHub({ spawners: [factory.spawner] })`. */
|
|
60
|
+
readonly spawner: HubEngineSpawner;
|
|
61
|
+
/**
|
|
62
|
+
* Delete the dialecte's project of that name on SQLite storage without opening it (an `outdated` or `lost` one of
|
|
63
|
+
* `listProjects` too); refused `PROJECT_OPEN_ELSEWHERE` while a view has it open.
|
|
64
|
+
*/
|
|
65
|
+
readonly destroyProject: (params: {
|
|
66
|
+
name: string;
|
|
67
|
+
}) => Promise<void>;
|
|
68
|
+
};
|
|
69
|
+
/** What every Project of a dialecte is made from: the declaration and what one consumer chooses. */
|
|
70
|
+
export type CreateDialecteProjectParams<GenericConfig extends AnyDialecteConfig, GenericModules extends ExtensionModules = Record<never, never>, CustomModules extends ExtensionModules = Record<never, never>> = CreateProjectParams<CustomModules> & {
|
|
71
|
+
dialecte: DialecteDeclaration<GenericConfig, GenericModules, string>;
|
|
72
|
+
/** The address of the dialecte's engine worker, from its project factory: `sqlite` storage needs it. */
|
|
73
|
+
engineUrl?: string;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=dialecte.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialecte.types.d.ts","sourceRoot":"","sources":["../../src/dialecte/dialecte.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE/D,mHAAmH;AACnH,MAAM,MAAM,oBAAoB,CAC/B,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9D,gBAAgB,SAAS,MAAM,GAAG,MAAM,IACrC;IACH,gFAAgF;IAChF,EAAE,EAAE,MAAM,CAAA;IACV,iGAAiG;IACjG,OAAO,EAAE,MAAM,CAAA;IACf,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAA;IAChD,qDAAqD;IACrD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAC3C,+FAA+F;IAC/F,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,aAAa,CAAC,aAAa,CAAC,CAAA;CAChD,CAAA;AAED,2FAA2F;AAC3F,MAAM,MAAM,mBAAmB,CAC9B,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9D,gBAAgB,SAAS,MAAM,GAAG,MAAM,IACrC;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAA;IACnE,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAA;IAC3C,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAA;IACnC,QAAQ,CAAC,WAAW,EAAE,MAAM,aAAa,CAAC,aAAa,CAAC,CAAA;CACxD,CAAA;AAED,MAAM,MAAM,0BAA0B,CACrC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9D,gBAAgB,SAAS,MAAM,GAAG,MAAM,IACrC;IACH,QAAQ,EAAE,mBAAmB,CAAC,aAAa,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAAA;IAC9E;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,uFAAuF;AACvF,MAAM,MAAM,mBAAmB,CAAC,aAAa,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI;IAChG,mCAAmC;IACnC,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,wEAAwE;IACxE,UAAU,CAAC,EAAE,aAAa,CAAA;IAC1B,GAAG,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CACxB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,CACzB,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9D,gBAAgB,SAAS,MAAM,GAAG,MAAM,IACrC;IACH,CAAC,aAAa,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC7D,MAAM,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,GACzC,OAAO,CAAC,aAAa,EAAE,cAAc,GAAG,aAAa,CAAC,CAAA;IACzD,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC,aAAa,EAAE,cAAc,EAAE,gBAAgB,CAAC,CAAA;IACvF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,gHAAgH;IAChH,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAA;IAClC;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACpE,CAAA;AAED,oGAAoG;AACpG,MAAM,MAAM,2BAA2B,CACtC,aAAa,SAAS,iBAAiB,EACvC,cAAc,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,EAC9D,aAAa,SAAS,gBAAgB,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAC1D,mBAAmB,CAAC,aAAa,CAAC,GAAG;IACxC,QAAQ,EAAE,mBAAmB,CAAC,aAAa,EAAE,cAAc,EAAE,MAAM,CAAC,CAAA;IACpE,wGAAwG;IACxG,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { defineDialecte } from './define-dialecte';
|
|
2
|
+
export { createProjectFactory } from './create-project-factory';
|
|
3
|
+
export type { DefineDialecteParams, DialecteDeclaration, CreateProjectFactoryParams, CreateProjectParams, ProjectFactory, } from './dialecte.types';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dialecte/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,YAAY,EACX,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,GACd,MAAM,kBAAkB,CAAA"}
|