@chrona-city/ugc-kit 0.0.0-stage → 1.5.9
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/README.md +110 -2
- package/bin/chrona.mjs +4 -0
- package/chrona.contract.lock.json +432 -0
- package/chrona.controlled-presentation.lock.json +100 -0
- package/chrona.core.lock.json +44 -0
- package/chrona.ecs.lock.json +40 -0
- package/chrona.gameplay-tests.lock.json +64 -0
- package/chrona.ground-rules.lock.json +48 -0
- package/chrona.pipeline.lock.json +100 -0
- package/chrona.private-event-view.lock.json +56 -0
- package/chrona.private-events.lock.json +64 -0
- package/chrona.private-state-view.lock.json +64 -0
- package/chrona.private-state.lock.json +56 -0
- package/chrona.registry.lock.json +72 -0
- package/chrona.resource-bindings.lock.json +68 -0
- package/chrona.sandbox.lock.json +60 -0
- package/chrona.scene-interaction.lock.json +60 -0
- package/chrona.scene-presentation.lock.json +60 -0
- package/chrona.wiring.lock.json +48 -0
- package/chrona.world-scene-runtime.lock.json +164 -0
- package/chrona.world-scene.lock.json +180 -0
- package/compiler/local-builder.lock.json +1 -0
- package/compiler/source/contracts/ugc/creator-source/v1/tool-package.schema.json +11 -0
- package/compiler/source/contracts/ugc/document-presentation/v1/document.mjs +165 -0
- package/compiler/source/contracts/ugc/document-presentation/v1/profile.json +24 -0
- package/compiler/source/contracts/ugc/ground-rules/v1/contract-set.json +9 -0
- package/compiler/source/contracts/ugc/ground-rules/v1/ground-rules.mjs +98 -0
- package/compiler/source/contracts/ugc/ground-rules/v2/ground-rules.mjs +138 -0
- package/compiler/source/contracts/ugc/ground-rules/v2/heightfield.mjs +89 -0
- package/compiler/source/contracts/ugc/ground-rules/v2/movement.mjs +12 -0
- package/compiler/source/contracts/ugc/ground-rules/v2/spatial-source.mjs +193 -0
- package/compiler/source/contracts/ugc/ground-rules/v2.2/center-band.mjs +142 -0
- package/compiler/source/contracts/ugc/ground-rules/v2.2/spatial-source.mjs +77 -0
- package/compiler/source/contracts/ugc/local-content/v1/document-snapshot.mjs +114 -0
- package/compiler/source/contracts/ugc/local-content/v1/snapshot.mjs +171 -0
- package/compiler/source/contracts/ugc/personal-state/v1/declaration.mjs +86 -0
- package/compiler/source/contracts/ugc/personal-state/v1/node-plan.mjs +51 -0
- package/compiler/source/contracts/ugc/pipeline/v1/conformance/js/pipeline-validator.mjs +196 -0
- package/compiler/source/contracts/ugc/private-events/v1/declaration.mjs +25 -0
- package/compiler/source/contracts/ugc/private-events/v1/events.mjs +189 -0
- package/compiler/source/contracts/ugc/registry/v1/conformance/js/capability-resolver.mjs +191 -0
- package/compiler/source/contracts/ugc/registry/v1/registry.json +1 -0
- package/compiler/source/contracts/ugc/registry/v1/resolution-policy.json +70 -0
- package/compiler/source/contracts/ugc/resource-bindings/v1/authored-avatar.mjs +183 -0
- package/compiler/source/contracts/ugc/resource-bindings/v1/bindings.mjs +133 -0
- package/compiler/source/contracts/ugc/resource-bindings/v1/contract-set.json +9 -0
- package/compiler/source/contracts/ugc/scene-interaction/v1/contract-set.json +26 -0
- package/compiler/source/contracts/ugc/scene-interaction/v1/interaction.mjs +83 -0
- package/compiler/source/contracts/ugc/scene-interaction/v1/scene-model.mjs +39 -0
- package/compiler/source/contracts/ugc/scene-interaction/v2/interaction.mjs +80 -0
- package/compiler/source/contracts/ugc/scene-interaction/v2/scene-model.mjs +56 -0
- package/compiler/source/contracts/ugc/scene-presentation/v1/ink-math.mjs +70 -0
- package/compiler/source/contracts/ugc/scene-presentation/v1/render-policy.mjs +108 -0
- package/compiler/source/contracts/ugc/scene-presentation/v1/render-policy.schema.json +27 -0
- package/compiler/source/contracts/ugc/scene-presentation/v1/scene.mjs +147 -0
- package/compiler/source/contracts/ugc/scene-presentation/v1/scene.schema.json +66 -0
- package/compiler/source/contracts/ugc/v1/conformance/js/cover.mjs +23 -0
- package/compiler/source/contracts/ugc/v1/conformance/js/package-validator.mjs +333 -0
- package/compiler/source/contracts/ugc/world-scene/v1/collision-artifacts.mjs +134 -0
- package/compiler/source/contracts/ugc/world-scene/v1/collision-identity.mjs +73 -0
- package/compiler/source/contracts/ugc/world-scene/v1/collision-target.schema.json +18 -0
- package/compiler/source/contracts/ugc/world-scene/v1/coordinates.schema.json +16 -0
- package/compiler/source/contracts/ugc/world-scene/v1/flight-avatar-actions.mjs +3 -0
- package/compiler/source/contracts/ugc/world-scene/v1/flight-avatar-sample.schema.json +14 -0
- package/compiler/source/contracts/ugc/world-scene/v1/scene-declaration.mjs +99 -0
- package/compiler/source/contracts/ugc/world-scene/v1/scene-declaration.schema.json +40 -0
- package/compiler/source/contracts/ugc/world-scene/v1/visual-tileset.mjs +112 -0
- package/compiler/source/contracts/ugc/world-scene/v1/visual-tileset.schema.json +35 -0
- package/compiler/source/contracts/ugc/world-scene/v2/asset-graph.mjs +169 -0
- package/compiler/source/contracts/ugc/world-scene/v2/collision-index.mjs +83 -0
- package/compiler/source/contracts/ugc/world-scene/v2/collision-index.schema.json +29 -0
- package/compiler/source/contracts/ugc/world-scene/v2/collision-partition.mjs +122 -0
- package/compiler/source/contracts/ugc/world-scene/v2/collision-partition.schema.json +37 -0
- package/compiler/source/contracts/ugc/world-scene/v2/contract-set.json +50 -0
- package/compiler/source/contracts/ugc/world-scene/v2/encoded-resource.mjs +98 -0
- package/compiler/source/contracts/ugc/world-scene/v2/encoded-resource.schema.json +17 -0
- package/compiler/source/contracts/ugc/world-scene/v2/scene-declaration.mjs +56 -0
- package/compiler/source/contracts/ugc/world-scene/v2/scene-declaration.schema.json +21 -0
- package/compiler/source/contracts/ugc/world-scene/v2/vendor/pako-raw-inflate.mjs +45 -0
- package/compiler/source/contracts/ugc/world-scene/v2/vendor/pako-raw-inflate.provenance.json +43 -0
- package/compiler/source/contracts/ugc/world-scene/v2/visual-tileset.mjs +107 -0
- package/compiler/source/contracts/ugc/world-scene/v2/visual-tileset.schema.json +33 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v1/runtime-plan.schema.json +660 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v1/runtime-policy.mjs +81 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v2/collision-capacity.mjs +87 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v2/collision-capacity.schema.json +62 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v2/contract-set.json +45 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v2/report.mjs +184 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v2/runtime-plan.schema.json +38 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v2/runtime-policy.mjs +144 -0
- package/compiler/source/contracts/ugc/world-scene-runtime/v2/visual-work-policy.mjs +59 -0
- package/compiler/source/services/game-worker/src/protocol/flight.js +123 -0
- package/compiler/source/services/game-worker/src/protocol/realtime-error.js +9 -0
- package/compiler/source/services/game-worker/src/runtime/content/flight-collision-files.js +122 -0
- package/compiler/source/services/game-worker/src/runtime/content/flight-collision-store.js +252 -0
- package/compiler/source/services/game-worker/src/runtime/content/flight-runtime.js +56 -0
- package/compiler/source/services/game-worker/src/runtime/rooms/flight-collision.js +224 -0
- package/compiler/source/services/game-worker/src/runtime/rooms/flight-motion.js +56 -0
- package/compiler/source/services/game-worker/src/runtime/rooms/flight-preparation.js +166 -0
- package/compiler/source/services/game-worker/src/runtime/rooms/flight-room-controller.js +255 -0
- package/compiler/source/services/ugc-pipeline/src/asset-inspection-worker.mjs +72 -0
- package/compiler/source/services/ugc-pipeline/src/asset-inspection.mjs +230 -0
- package/compiler/source/services/ugc-pipeline/src/avatar-envelope.mjs +70 -0
- package/compiler/source/services/ugc-pipeline/src/cover-inspection-worker.mjs +15 -0
- package/compiler/source/services/ugc-pipeline/src/cover-inspection.mjs +94 -0
- package/compiler/source/services/ugc-pipeline/src/cover-png.mjs +74 -0
- package/compiler/source/services/ugc-pipeline/src/document-presentation-model.mjs +79 -0
- package/compiler/source/services/ugc-pipeline/src/flight-avatar-envelope.mjs +27 -0
- package/compiler/source/services/ugc-pipeline/src/ground-rules-model.mjs +99 -0
- package/compiler/source/services/ugc-pipeline/src/local-content.mjs +182 -0
- package/compiler/source/services/ugc-pipeline/src/personal-state-model.mjs +25 -0
- package/compiler/source/services/ugc-pipeline/src/registry-release.mjs +59 -0
- package/compiler/source/services/ugc-pipeline/src/resource-bindings-model.mjs +77 -0
- package/compiler/source/services/ugc-pipeline/src/scene-interaction-model.mjs +110 -0
- package/compiler/source/services/ugc-pipeline/src/scene-presentation-model.mjs +79 -0
- package/compiler/source/services/ugc-pipeline/src/scene-presentation-source.mjs +26 -0
- package/compiler/source/services/ugc-pipeline/src/scene-render-policies.json +25 -0
- package/compiler/source/services/ugc-pipeline/src/scene-surface-inspection.mjs +57 -0
- package/compiler/source/services/ugc-pipeline/src/static-scene-geometry.mjs +100 -0
- package/compiler/source/services/ugc-pipeline/src/visual-closure-v2.mjs +111 -0
- package/compiler/source/services/ugc-pipeline/src/world-scene-model.mjs +133 -0
- package/compiler/source/services/ugc-pipeline/src/world-scene-policies.json +71 -0
- package/compiler/source/services/ugc-pipeline/src/world-scene-runtime.mjs +186 -0
- package/contracts/ugc/capability-wiring/v1/capability-proposal.schema.json +82 -0
- package/contracts/ugc/capability-wiring/v1/conformance/js/wiring-validator.mjs +95 -0
- package/contracts/ugc/capability-wiring/v1/conformance/web/index.html +5 -0
- package/contracts/ugc/capability-wiring/v1/conformance/web/runner.mjs +32 -0
- package/contracts/ugc/capability-wiring/v1/contract-set.json +8 -0
- package/contracts/ugc/capability-wiring/v1/error-codes.json +15 -0
- package/contracts/ugc/capability-wiring/v1/needs-capability.schema.json +18 -0
- package/contracts/ugc/capability-wiring/v1/testdata/vectors.json +128 -0
- package/contracts/ugc/capability-wiring/v1/wiring-release.schema.json +66 -0
- package/contracts/ugc/controlled-presentation/v1/README.md +175 -0
- package/contracts/ugc/controlled-presentation/v1/approval.schema.json +53 -0
- package/contracts/ugc/controlled-presentation/v1/command.schema.json +243 -0
- package/contracts/ugc/controlled-presentation/v1/conformance/run-vectors.mjs +39 -0
- package/contracts/ugc/controlled-presentation/v1/conformance/run-view-vectors.mjs +54 -0
- package/contracts/ugc/controlled-presentation/v1/conformance/web/index.html +1 -0
- package/contracts/ugc/controlled-presentation/v1/conformance/web/runner.mjs +4 -0
- package/contracts/ugc/controlled-presentation/v1/conformance/web/view-runner.mjs +5 -0
- package/contracts/ugc/controlled-presentation/v1/conformance/web/view.html +1 -0
- package/contracts/ugc/controlled-presentation/v1/context.schema.json +19 -0
- package/contracts/ugc/controlled-presentation/v1/contract-set.json +33 -0
- package/contracts/ugc/controlled-presentation/v1/export-view.mjs +44 -0
- package/contracts/ugc/controlled-presentation/v1/grant.schema.json +120 -0
- package/contracts/ugc/controlled-presentation/v1/presentation.mjs +180 -0
- package/contracts/ugc/controlled-presentation/v1/testdata/vectors.json +565 -0
- package/contracts/ugc/controlled-presentation/v1/view.mjs +46 -0
- package/contracts/ugc/controlled-presentation/v1/view.schema.json +90 -0
- package/contracts/ugc/core-ecs/v1/README.md +13 -0
- package/contracts/ugc/core-ecs/v1/api.json +28 -0
- package/contracts/ugc/core-ecs/v1/conformance/run-vectors.mjs +33 -0
- package/contracts/ugc/core-ecs/v1/conformance/web/index.html +1 -0
- package/contracts/ugc/core-ecs/v1/conformance/web/runner.mjs +4 -0
- package/contracts/ugc/core-ecs/v1/core-view.mjs +138 -0
- package/contracts/ugc/core-ecs/v1/test-fixture.schema.json +169 -0
- package/contracts/ugc/core-ecs/v1/testdata/vectors.json +57 -0
- package/contracts/ugc/creator-source/v1/SOURCE-PACKAGE.md +19 -0
- package/contracts/ugc/creator-source/v1/source-package.mjs +87 -0
- package/contracts/ugc/creator-source/v1/source-package.schema.json +42 -0
- package/contracts/ugc/creator-source/v1/source-package.test.mjs +69 -0
- package/contracts/ugc/creator-source/v1/tool-package.schema.json +11 -0
- package/contracts/ugc/document-presentation/v1/README.md +167 -0
- package/contracts/ugc/document-presentation/v1/contract-set.json +18 -0
- package/contracts/ugc/document-presentation/v1/document.mjs +165 -0
- package/contracts/ugc/document-presentation/v1/document.schema.json +161 -0
- package/contracts/ugc/document-presentation/v1/document.test.mjs +138 -0
- package/contracts/ugc/document-presentation/v1/profile.json +24 -0
- package/contracts/ugc/document-presentation/v1/source.schema.json +88 -0
- package/contracts/ugc/ecs-runtime/v1/README.md +25 -0
- package/contracts/ugc/ecs-runtime/v1/api.json +46 -0
- package/contracts/ugc/ecs-runtime/v1/conformance/run-vectors.mjs +41 -0
- package/contracts/ugc/ecs-runtime/v1/conformance/web/index.html +3 -0
- package/contracts/ugc/ecs-runtime/v1/conformance/web/runner.mjs +5 -0
- package/contracts/ugc/ecs-runtime/v1/private-world.mjs +299 -0
- package/contracts/ugc/ecs-runtime/v1/testdata/vectors.json +1318 -0
- package/contracts/ugc/gameplay-tests/v1/README.md +78 -0
- package/contracts/ugc/gameplay-tests/v1/cases.mjs +70 -0
- package/contracts/ugc/gameplay-tests/v1/cases.schema.json +262 -0
- package/contracts/ugc/gameplay-tests/v1/conformance/run-vectors.mjs +21 -0
- package/contracts/ugc/gameplay-tests/v1/conformance/web/index.html +1 -0
- package/contracts/ugc/gameplay-tests/v1/conformance/web/runner.mjs +4 -0
- package/contracts/ugc/gameplay-tests/v1/contract-set.json +9 -0
- package/contracts/ugc/gameplay-tests/v1/scene-step.mjs +49 -0
- package/contracts/ugc/gameplay-tests/v1/testdata/vectors.json +1504 -0
- package/contracts/ugc/ground-rules/v1/README.md +44 -0
- package/contracts/ugc/ground-rules/v1/conformance/run-vectors.mjs +31 -0
- package/contracts/ugc/ground-rules/v1/conformance/web/index.html +1 -0
- package/contracts/ugc/ground-rules/v1/conformance/web/runner.mjs +4 -0
- package/contracts/ugc/ground-rules/v1/contract-set.json +9 -0
- package/contracts/ugc/ground-rules/v1/effective-ground-rules.schema.json +27 -0
- package/contracts/ugc/ground-rules/v1/ground-rules.mjs +98 -0
- package/contracts/ugc/ground-rules/v1/ground-rules.schema.json +33 -0
- package/contracts/ugc/ground-rules/v1/testdata/vectors.json +57 -0
- package/contracts/ugc/ground-rules/v2/README.md +88 -0
- package/contracts/ugc/ground-rules/v2/contract-set.json +20 -0
- package/contracts/ugc/ground-rules/v2/ground-rules.mjs +138 -0
- package/contracts/ugc/ground-rules/v2/ground-rules.schema.json +373 -0
- package/contracts/ugc/ground-rules/v2/heightfield.mjs +89 -0
- package/contracts/ugc/ground-rules/v2/movement.mjs +12 -0
- package/contracts/ugc/ground-rules/v2/spaces.test.mjs +58 -0
- package/contracts/ugc/ground-rules/v2/spatial-source.mjs +193 -0
- package/contracts/ugc/ground-rules/v2/spatial-source.schema.json +788 -0
- package/contracts/ugc/ground-rules/v2/spatial.test.mjs +142 -0
- package/contracts/ugc/ground-rules/v2.2/README.md +73 -0
- package/contracts/ugc/ground-rules/v2.2/center-band.mjs +142 -0
- package/contracts/ugc/ground-rules/v2.2/center-band.test.mjs +149 -0
- package/contracts/ugc/ground-rules/v2.2/contract-set.json +8 -0
- package/contracts/ugc/ground-rules/v2.2/spatial-source.mjs +77 -0
- package/contracts/ugc/ground-rules/v2.2/spatial-source.schema.json +1049 -0
- package/contracts/ugc/local-content/v1/LOCAL-LAUNCH.md +11 -0
- package/contracts/ugc/local-content/v1/README.md +45 -0
- package/contracts/ugc/local-content/v1/conformance.test.mjs +67 -0
- package/contracts/ugc/local-content/v1/document-local-content-snapshot.schema.json +306 -0
- package/contracts/ugc/local-content/v1/document-snapshot.mjs +114 -0
- package/contracts/ugc/local-content/v1/local-content-snapshot.schema.json +54 -0
- package/contracts/ugc/local-content/v1/local-launch.test.mjs +51 -0
- package/contracts/ugc/local-content/v1/presentation-vectors.json +18 -0
- package/contracts/ugc/local-content/v1/snapshot.mjs +171 -0
- package/contracts/ugc/local-content/v1/tool-version-vectors.json +28 -0
- package/contracts/ugc/personal-state/v1/README.md +181 -0
- package/contracts/ugc/personal-state/v1/declaration.mjs +86 -0
- package/contracts/ugc/personal-state/v1/declaration.schema.json +295 -0
- package/contracts/ugc/personal-state/v1/declaration.test.mjs +26 -0
- package/contracts/ugc/personal-state/v1/marker.schema.json +9 -0
- package/contracts/ugc/personal-state/v1/node-plan.mjs +51 -0
- package/contracts/ugc/personal-state/v1/node-plan.test.mjs +65 -0
- package/contracts/ugc/pipeline/v1/PLATFORM-SOURCE.md +54 -0
- package/contracts/ugc/pipeline/v1/PRESENTATION.md +13 -0
- package/contracts/ugc/pipeline/v1/build-record.schema.json +93 -0
- package/contracts/ugc/pipeline/v1/conformance/js/pipeline-validator.mjs +196 -0
- package/contracts/ugc/pipeline/v1/conformance/js/platform-release-validator.mjs +78 -0
- package/contracts/ugc/pipeline/v1/conformance/web/index.html +5 -0
- package/contracts/ugc/pipeline/v1/conformance/web/runner.mjs +30 -0
- package/contracts/ugc/pipeline/v1/contract-set.json +30 -0
- package/contracts/ugc/pipeline/v1/error-codes.json +95 -0
- package/contracts/ugc/pipeline/v1/platform-publication-binding.schema.json +56 -0
- package/contracts/ugc/pipeline/v1/public-release-descriptor.schema.json +264 -0
- package/contracts/ugc/pipeline/v1/publication-operation.schema.json +97 -0
- package/contracts/ugc/pipeline/v1/release-index.schema.json +192 -0
- package/contracts/ugc/pipeline/v1/review-decision.schema.json +212 -0
- package/contracts/ugc/pipeline/v1/submission-receipt.schema.json +15 -0
- package/contracts/ugc/pipeline/v1/testdata/vectors.json +1713 -0
- package/contracts/ugc/private-event-view/v1/README.md +83 -0
- package/contracts/ugc/private-event-view/v1/conformance/run-vectors.mjs +65 -0
- package/contracts/ugc/private-event-view/v1/conformance/web/index.html +1 -0
- package/contracts/ugc/private-event-view/v1/conformance/web/runner.mjs +5 -0
- package/contracts/ugc/private-event-view/v1/contract-set.json +9 -0
- package/contracts/ugc/private-event-view/v1/export.mjs +22 -0
- package/contracts/ugc/private-event-view/v1/testdata/vectors.json +22 -0
- package/contracts/ugc/private-event-view/v1/view.mjs +130 -0
- package/contracts/ugc/private-event-view/v1/view.schema.json +204 -0
- package/contracts/ugc/private-events/v1/README.md +102 -0
- package/contracts/ugc/private-events/v1/conformance/run-vectors.mjs +52 -0
- package/contracts/ugc/private-events/v1/conformance/web/index.html +1 -0
- package/contracts/ugc/private-events/v1/conformance/web/runner.mjs +4 -0
- package/contracts/ugc/private-events/v1/contract-set.json +9 -0
- package/contracts/ugc/private-events/v1/declaration.mjs +25 -0
- package/contracts/ugc/private-events/v1/events.mjs +189 -0
- package/contracts/ugc/private-events/v1/events.schema.json +19 -0
- package/contracts/ugc/private-events/v1/grant.schema.json +15 -0
- package/contracts/ugc/private-events/v1/output.schema.json +15 -0
- package/contracts/ugc/private-events/v1/testdata/vectors.json +55 -0
- package/contracts/ugc/private-state/v1/README.md +95 -0
- package/contracts/ugc/private-state/v1/conformance/run-vectors.mjs +40 -0
- package/contracts/ugc/private-state/v1/conformance/web/index.html +1 -0
- package/contracts/ugc/private-state/v1/conformance/web/runner.mjs +4 -0
- package/contracts/ugc/private-state/v1/contract-set.json +9 -0
- package/contracts/ugc/private-state/v1/field-table.schema.json +136 -0
- package/contracts/ugc/private-state/v1/projection.mjs +178 -0
- package/contracts/ugc/private-state/v1/projection.schema.json +515 -0
- package/contracts/ugc/private-state/v1/testdata/vectors.json +76 -0
- package/contracts/ugc/private-state-view/v1/README.md +91 -0
- package/contracts/ugc/private-state-view/v1/conformance/run-vectors.mjs +52 -0
- package/contracts/ugc/private-state-view/v1/conformance/web/index.html +1 -0
- package/contracts/ugc/private-state-view/v1/conformance/web/runner.mjs +5 -0
- package/contracts/ugc/private-state-view/v1/contract-set.json +24 -0
- package/contracts/ugc/private-state-view/v1/export.mjs +29 -0
- package/contracts/ugc/private-state-view/v1/publication.schema.json +82 -0
- package/contracts/ugc/private-state-view/v1/testdata/vectors.json +21 -0
- package/contracts/ugc/private-state-view/v1/view.mjs +199 -0
- package/contracts/ugc/private-state-view/v1/view.schema.json +255 -0
- package/contracts/ugc/public-runtime/v1/README.md +136 -0
- package/contracts/ugc/public-runtime/v1/archive.mjs +52 -0
- package/contracts/ugc/public-runtime/v1/document-runtime.test.mjs +118 -0
- package/contracts/ugc/public-runtime/v1/format-fixture.mjs +28 -0
- package/contracts/ugc/public-runtime/v1/golden.json +11 -0
- package/contracts/ugc/public-runtime/v1/manifest.mjs +167 -0
- package/contracts/ugc/public-runtime/v1/runtime-lock.schema.json +85 -0
- package/contracts/ugc/public-runtime/v1/runtime-manifest.schema.json +751 -0
- package/contracts/ugc/public-runtime/v1/runtime.test.mjs +155 -0
- package/contracts/ugc/public-runtime/v1/vectors.json +157 -0
- package/contracts/ugc/registry/v1/capabilities-lock.schema.json +110 -0
- package/contracts/ugc/registry/v1/capability-query-result.schema.json +33 -0
- package/contracts/ugc/registry/v1/capability-query.schema.json +14 -0
- package/contracts/ugc/registry/v1/capability-registry.schema.json +83 -0
- package/contracts/ugc/registry/v1/conformance/js/capability-resolver.mjs +191 -0
- package/contracts/ugc/registry/v1/conformance/web/index.html +5 -0
- package/contracts/ugc/registry/v1/conformance/web/runner.mjs +68 -0
- package/contracts/ugc/registry/v1/contract-set.json +23 -0
- package/contracts/ugc/registry/v1/effective-budgets.schema.json +34 -0
- package/contracts/ugc/registry/v1/error-codes.json +11 -0
- package/contracts/ugc/registry/v1/network-profile-lock.schema.json +26 -0
- package/contracts/ugc/registry/v1/registry.json +1 -0
- package/contracts/ugc/registry/v1/resolution-policy.json +70 -0
- package/contracts/ugc/registry/v1/resolution-result.schema.json +49 -0
- package/contracts/ugc/registry/v1/testdata/vectors.json +405 -0
- package/contracts/ugc/resource-bindings/v1/AUTHORED-AVATAR.md +133 -0
- package/contracts/ugc/resource-bindings/v1/README.md +61 -0
- package/contracts/ugc/resource-bindings/v1/authored-avatar.mjs +183 -0
- package/contracts/ugc/resource-bindings/v1/authored-avatar.schema.json +48 -0
- package/contracts/ugc/resource-bindings/v1/bindings.mjs +133 -0
- package/contracts/ugc/resource-bindings/v1/bindings.schema.json +45 -0
- package/contracts/ugc/resource-bindings/v1/conformance/authored-avatar-vectors.mjs +26 -0
- package/contracts/ugc/resource-bindings/v1/conformance/run-vectors.mjs +32 -0
- package/contracts/ugc/resource-bindings/v1/conformance/web/index.html +1 -0
- package/contracts/ugc/resource-bindings/v1/conformance/web/runner.mjs +13 -0
- package/contracts/ugc/resource-bindings/v1/contract-set.json +9 -0
- package/contracts/ugc/resource-bindings/v1/testdata/authored-avatar-vectors.json +146 -0
- package/contracts/ugc/resource-bindings/v1/testdata/authored-avatar.json +13 -0
- package/contracts/ugc/resource-bindings/v1/testdata/vectors.json +68 -0
- package/contracts/ugc/sandbox/v1/conformance/js/sandbox-validator.mjs +152 -0
- package/contracts/ugc/sandbox/v1/conformance/web/index.html +5 -0
- package/contracts/ugc/sandbox/v1/conformance/web/runner.mjs +26 -0
- package/contracts/ugc/sandbox/v1/contract-set.json +19 -0
- package/contracts/ugc/sandbox/v1/error-codes.json +25 -0
- package/contracts/ugc/sandbox/v1/execution-result.schema.json +80 -0
- package/contracts/ugc/sandbox/v1/launch-request.schema.json +96 -0
- package/contracts/ugc/sandbox/v1/lifecycle-message.schema.json +18 -0
- package/contracts/ugc/sandbox/v1/local-launch-request.schema.json +34 -0
- package/contracts/ugc/sandbox/v1/private-ecs-grant.schema.json +32 -0
- package/contracts/ugc/sandbox/v1/sandbox-profile.schema.json +70 -0
- package/contracts/ugc/sandbox/v1/testdata/vectors.json +89 -0
- package/contracts/ugc/scene-interaction/v1/README.md +63 -0
- package/contracts/ugc/scene-interaction/v1/conformance/run-vectors.mjs +26 -0
- package/contracts/ugc/scene-interaction/v1/conformance/web/index.html +1 -0
- package/contracts/ugc/scene-interaction/v1/conformance/web/runner.mjs +4 -0
- package/contracts/ugc/scene-interaction/v1/contract-set.json +26 -0
- package/contracts/ugc/scene-interaction/v1/effective-targets.schema.json +76 -0
- package/contracts/ugc/scene-interaction/v1/interaction.mjs +83 -0
- package/contracts/ugc/scene-interaction/v1/request.schema.json +30 -0
- package/contracts/ugc/scene-interaction/v1/result.schema.json +88 -0
- package/contracts/ugc/scene-interaction/v1/scene-model.mjs +39 -0
- package/contracts/ugc/scene-interaction/v1/targets.schema.json +49 -0
- package/contracts/ugc/scene-interaction/v1/testdata/vectors.json +732 -0
- package/contracts/ugc/scene-interaction/v2/README.md +63 -0
- package/contracts/ugc/scene-interaction/v2/contract-set.json +19 -0
- package/contracts/ugc/scene-interaction/v2/interaction.mjs +80 -0
- package/contracts/ugc/scene-interaction/v2/metric.test.mjs +99 -0
- package/contracts/ugc/scene-interaction/v2/scene-model.mjs +56 -0
- package/contracts/ugc/scene-interaction/v2/targets.schema.json +229 -0
- package/contracts/ugc/scene-presentation/v1/INK-MATH.md +64 -0
- package/contracts/ugc/scene-presentation/v1/README.md +126 -0
- package/contracts/ugc/scene-presentation/v1/RENDER-POLICY.md +63 -0
- package/contracts/ugc/scene-presentation/v1/conformance/ink-vectors.mjs +34 -0
- package/contracts/ugc/scene-presentation/v1/conformance/render-policy-vectors.mjs +62 -0
- package/contracts/ugc/scene-presentation/v1/conformance/vectors.mjs +128 -0
- package/contracts/ugc/scene-presentation/v1/contract-set.json +6 -0
- package/contracts/ugc/scene-presentation/v1/ink-math.mjs +70 -0
- package/contracts/ugc/scene-presentation/v1/render-policy.mjs +108 -0
- package/contracts/ugc/scene-presentation/v1/render-policy.schema.json +27 -0
- package/contracts/ugc/scene-presentation/v1/scene.mjs +147 -0
- package/contracts/ugc/scene-presentation/v1/scene.schema.json +66 -0
- package/contracts/ugc/v1/COVER.md +38 -0
- package/contracts/ugc/v1/SCENE-PROVENANCE.md +54 -0
- package/contracts/ugc/v1/candidate-submission.schema.json +16 -0
- package/contracts/ugc/v1/capability-request.schema.json +29 -0
- package/contracts/ugc/v1/compatibility.json +32 -0
- package/contracts/ugc/v1/components.schema.json +77 -0
- package/contracts/ugc/v1/conformance/js/capability-operations.mjs +13 -0
- package/contracts/ugc/v1/conformance/js/cover.mjs +23 -0
- package/contracts/ugc/v1/conformance/js/package-validator.mjs +333 -0
- package/contracts/ugc/v1/conformance/js/scene-provenance.mjs +121 -0
- package/contracts/ugc/v1/conformance/js/source-validator.mjs +99 -0
- package/contracts/ugc/v1/conformance/web/index.html +5 -0
- package/contracts/ugc/v1/conformance/web/runner.mjs +82 -0
- package/contracts/ugc/v1/contract-set.json +38 -0
- package/contracts/ugc/v1/creator-sdk.json +84 -0
- package/contracts/ugc/v1/error-codes.json +53 -0
- package/contracts/ugc/v1/manifest.schema.json +215 -0
- package/contracts/ugc/v1/network-intent.schema.json +15 -0
- package/contracts/ugc/v1/prefabs.schema.json +29 -0
- package/contracts/ugc/v1/provenance.schema.json +160 -0
- package/contracts/ugc/v1/scene.schema.json +37 -0
- package/contracts/ugc/v1/testdata/capability-operation-vectors.json +243 -0
- package/contracts/ugc/v1/testdata/cover-vectors.json +25 -0
- package/contracts/ugc/v1/testdata/invalid/authored-avatar-missing-capability.json +44 -0
- package/contracts/ugc/v1/testdata/invalid/authored-avatar-wrong-capability.json +51 -0
- package/contracts/ugc/v1/testdata/invalid/budget-overflow.json +1 -0
- package/contracts/ugc/v1/testdata/invalid/build-field-override.json +1 -0
- package/contracts/ugc/v1/testdata/invalid/creator-server-entrypoint.json +5 -0
- package/contracts/ugc/v1/testdata/invalid/forbidden-network-control.json +1 -0
- package/contracts/ugc/v1/testdata/invalid/ground-authority.json +57 -0
- package/contracts/ugc/v1/testdata/invalid/ground-budget.json +56 -0
- package/contracts/ugc/v1/testdata/invalid/ground-dependency.json +49 -0
- package/contracts/ugc/v1/testdata/invalid/ground-identity.json +56 -0
- package/contracts/ugc/v1/testdata/invalid/ground-missing.json +13 -0
- package/contracts/ugc/v1/testdata/invalid/ground-optional.json +60 -0
- package/contracts/ugc/v1/testdata/invalid/ground-path.json +56 -0
- package/contracts/ugc/v1/testdata/invalid/ground-run-dependency.json +56 -0
- package/contracts/ugc/v1/testdata/invalid/ground-version.json +56 -0
- package/contracts/ugc/v1/testdata/invalid/missing-required-field.json +1 -0
- package/contracts/ugc/v1/testdata/invalid/missing-shared-entrypoint.json +5 -0
- package/contracts/ugc/v1/testdata/invalid/path-escape.json +1 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-authority.json +35 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-budget.json +35 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-dependency.json +27 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-empty.json +20 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-identity.json +34 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-missing.json +13 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-optional.json +38 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-path.json +34 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-type.json +34 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-unknown-ref.json +34 -0
- package/contracts/ugc/v1/testdata/invalid/private-events-version.json +34 -0
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-identity.json +18 -0
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-kind.json +19 -0
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-missing.json +6 -0
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-path.json +6 -0
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-type.json +8 -0
- package/contracts/ugc/v1/testdata/invalid/resource-bindings-unknown.json +18 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-authority.json +61 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-core-unknown.json +61 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-dependency.json +53 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-identity.json +60 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-missing-transform.json +50 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-missing.json +49 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-optional.json +64 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-partial-transform.json +59 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-path.json +60 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-radius.json +60 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-unknown-target.json +60 -0
- package/contracts/ugc/v1/testdata/invalid/scene-interactions-version.json +60 -0
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-authority.json +166 -0
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-capability.json +158 -0
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-identity.json +165 -0
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-missing.json +13 -0
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-optional.json +169 -0
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-path.json +165 -0
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-undeclared.json +163 -0
- package/contracts/ugc/v1/testdata/invalid/scene-presentation-unknown-material.json +165 -0
- package/contracts/ugc/v1/testdata/invalid/schema-incompatible.json +1 -0
- package/contracts/ugc/v1/testdata/invalid/unknown-required-component.json +1 -0
- package/contracts/ugc/v1/testdata/invalid/world-scene-dual-motion.json +7 -0
- package/contracts/ugc/v1/testdata/invalid/world-scene-identity.json +90 -0
- package/contracts/ugc/v1/testdata/invalid/world-scene-missing-capability.json +85 -0
- package/contracts/ugc/v1/testdata/invalid/world-scene-missing.json +28 -0
- package/contracts/ugc/v1/testdata/invalid/world-scene-optional-capability.json +94 -0
- package/contracts/ugc/v1/testdata/invalid/world-scene-path.json +6 -0
- package/contracts/ugc/v1/testdata/invalid/world-scene-version.json +90 -0
- package/contracts/ugc/v1/testdata/scene-provenance-vectors.json +56 -0
- package/contracts/ugc/v1/testdata/source-vectors.json +83 -0
- package/contracts/ugc/v1/testdata/valid/authored-avatar.json +51 -0
- package/contracts/ugc/v1/testdata/valid/boundary.json +1 -0
- package/contracts/ugc/v1/testdata/valid/components.json +15 -0
- package/contracts/ugc/v1/testdata/valid/cosmetic.json +9 -0
- package/contracts/ugc/v1/testdata/valid/ground-rules.json +56 -0
- package/contracts/ugc/v1/testdata/valid/minimal.json +15 -0
- package/contracts/ugc/v1/testdata/valid/prefabs.json +11 -0
- package/contracts/ugc/v1/testdata/valid/private-events.json +34 -0
- package/contracts/ugc/v1/testdata/valid/resource-bindings.json +18 -0
- package/contracts/ugc/v1/testdata/valid/scene-interactions.json +60 -0
- package/contracts/ugc/v1/testdata/valid/scene-presentation.json +165 -0
- package/contracts/ugc/v1/testdata/valid/scene.json +6 -0
- package/contracts/ugc/v1/testdata/valid/unknown-optional-component.json +1 -0
- package/contracts/ugc/v1/testdata/valid/world-scene.json +90 -0
- package/contracts/ugc/v1/testdata/vectors.json +555 -0
- package/contracts/ugc/v1/validation-report.schema.json +61 -0
- package/contracts/ugc/world-scene/v1/ASSET-GRAPH.md +33 -0
- package/contracts/ugc/world-scene/v1/COLLISION-ARTIFACTS.md +124 -0
- package/contracts/ugc/world-scene/v1/FLIGHT-AVATAR-ACTIONS.md +92 -0
- package/contracts/ugc/world-scene/v1/README.md +117 -0
- package/contracts/ugc/world-scene/v1/SCENE-DECLARATION.md +135 -0
- package/contracts/ugc/world-scene/v1/VISUAL-TILESET.md +125 -0
- package/contracts/ugc/world-scene/v1/asset-graph.mjs +126 -0
- package/contracts/ugc/world-scene/v1/collision-artifacts.mjs +134 -0
- package/contracts/ugc/world-scene/v1/collision-identity.mjs +73 -0
- package/contracts/ugc/world-scene/v1/collision-index.schema.json +34 -0
- package/contracts/ugc/world-scene/v1/collision-target.schema.json +18 -0
- package/contracts/ugc/world-scene/v1/conformance/artifact-vectors.mjs +15 -0
- package/contracts/ugc/world-scene/v1/conformance/flight-avatar-vectors.mjs +27 -0
- package/contracts/ugc/world-scene/v1/conformance/run-vectors.mjs +29 -0
- package/contracts/ugc/world-scene/v1/conformance/scene-declaration-vectors.mjs +28 -0
- package/contracts/ugc/world-scene/v1/conformance/visual-tileset-vectors.mjs +24 -0
- package/contracts/ugc/world-scene/v1/conformance/web/index.html +8 -0
- package/contracts/ugc/world-scene/v1/conformance/web/runner.mjs +53 -0
- package/contracts/ugc/world-scene/v1/contract-set.json +40 -0
- package/contracts/ugc/world-scene/v1/coordinates.schema.json +16 -0
- package/contracts/ugc/world-scene/v1/flight-avatar-actions.mjs +3 -0
- package/contracts/ugc/world-scene/v1/flight-avatar-sample.schema.json +14 -0
- package/contracts/ugc/world-scene/v1/scene-declaration.mjs +99 -0
- package/contracts/ugc/world-scene/v1/scene-declaration.schema.json +40 -0
- package/contracts/ugc/world-scene/v1/testdata/artifact-vectors.json +18 -0
- package/contracts/ugc/world-scene/v1/testdata/flight-avatar-actions.json +48 -0
- package/contracts/ugc/world-scene/v1/testdata/scene-declaration-vectors.json +103 -0
- package/contracts/ugc/world-scene/v1/testdata/vectors.json +55 -0
- package/contracts/ugc/world-scene/v1/testdata/visual-tileset-vectors.json +27 -0
- package/contracts/ugc/world-scene/v1/visual-tileset.mjs +112 -0
- package/contracts/ugc/world-scene/v1/visual-tileset.schema.json +35 -0
- package/contracts/ugc/world-scene/v2/ASSET-GRAPH.md +13 -0
- package/contracts/ugc/world-scene/v2/ENCODED-RESOURCES.md +117 -0
- package/contracts/ugc/world-scene/v2/PARTITION.md +59 -0
- package/contracts/ugc/world-scene/v2/VISUAL-TILESET.md +80 -0
- package/contracts/ugc/world-scene/v2/asset-graph.mjs +169 -0
- package/contracts/ugc/world-scene/v2/collision-index.mjs +83 -0
- package/contracts/ugc/world-scene/v2/collision-index.schema.json +29 -0
- package/contracts/ugc/world-scene/v2/collision-partition.mjs +122 -0
- package/contracts/ugc/world-scene/v2/collision-partition.schema.json +37 -0
- package/contracts/ugc/world-scene/v2/conformance/asset-graph-vectors.mjs +52 -0
- package/contracts/ugc/world-scene/v2/conformance/collision-index-vectors.mjs +29 -0
- package/contracts/ugc/world-scene/v2/conformance/encoded-resource-vectors.mjs +17 -0
- package/contracts/ugc/world-scene/v2/conformance/partition-vectors.mjs +74 -0
- package/contracts/ugc/world-scene/v2/conformance/visual-vectors.mjs +24 -0
- package/contracts/ugc/world-scene/v2/contract-set.json +50 -0
- package/contracts/ugc/world-scene/v2/encoded-resource.mjs +98 -0
- package/contracts/ugc/world-scene/v2/encoded-resource.schema.json +17 -0
- package/contracts/ugc/world-scene/v2/scene-declaration.mjs +56 -0
- package/contracts/ugc/world-scene/v2/scene-declaration.schema.json +21 -0
- package/contracts/ugc/world-scene/v2/testdata/asset-graph-vectors.json +3354 -0
- package/contracts/ugc/world-scene/v2/testdata/collision-index-vectors.json +103 -0
- package/contracts/ugc/world-scene/v2/testdata/encoded-resource-vectors.json +372 -0
- package/contracts/ugc/world-scene/v2/testdata/visual-vectors.json +43 -0
- package/contracts/ugc/world-scene/v2/vendor/pako-raw-inflate.mjs +45 -0
- package/contracts/ugc/world-scene/v2/vendor/pako-raw-inflate.provenance.json +43 -0
- package/contracts/ugc/world-scene/v2/visual-tileset.mjs +107 -0
- package/contracts/ugc/world-scene/v2/visual-tileset.schema.json +33 -0
- package/contracts/ugc/world-scene-runtime/v1/README.md +127 -0
- package/contracts/ugc/world-scene-runtime/v1/REPORT.md +87 -0
- package/contracts/ugc/world-scene-runtime/v1/conformance/report-vectors.mjs +104 -0
- package/contracts/ugc/world-scene-runtime/v1/conformance/run-vectors.mjs +22 -0
- package/contracts/ugc/world-scene-runtime/v1/report.mjs +151 -0
- package/contracts/ugc/world-scene-runtime/v1/runtime-plan.schema.json +660 -0
- package/contracts/ugc/world-scene-runtime/v1/runtime-policy.mjs +81 -0
- package/contracts/ugc/world-scene-runtime/v1/testdata/policy-vectors.json +40 -0
- package/contracts/ugc/world-scene-runtime/v1/testdata/report-fixture.json +236 -0
- package/contracts/ugc/world-scene-runtime/v2/COLLISION-CAPACITY.md +74 -0
- package/contracts/ugc/world-scene-runtime/v2/REPORT.md +91 -0
- package/contracts/ugc/world-scene-runtime/v2/RUNTIME-PROJECTION.md +110 -0
- package/contracts/ugc/world-scene-runtime/v2/VISUAL-WORK.md +72 -0
- package/contracts/ugc/world-scene-runtime/v2/collision-capacity.mjs +87 -0
- package/contracts/ugc/world-scene-runtime/v2/collision-capacity.schema.json +62 -0
- package/contracts/ugc/world-scene-runtime/v2/conformance/capacity-vectors.mjs +25 -0
- package/contracts/ugc/world-scene-runtime/v2/conformance/report-vectors.mjs +141 -0
- package/contracts/ugc/world-scene-runtime/v2/conformance/runtime-vectors.mjs +41 -0
- package/contracts/ugc/world-scene-runtime/v2/conformance/visual-work-vectors.mjs +21 -0
- package/contracts/ugc/world-scene-runtime/v2/contract-set.json +45 -0
- package/contracts/ugc/world-scene-runtime/v2/report.mjs +184 -0
- package/contracts/ugc/world-scene-runtime/v2/runtime-plan.schema.json +38 -0
- package/contracts/ugc/world-scene-runtime/v2/runtime-policy.mjs +144 -0
- package/contracts/ugc/world-scene-runtime/v2/testdata/capacity-vectors.json +30 -0
- package/contracts/ugc/world-scene-runtime/v2/testdata/report-fixture.json +250 -0
- package/contracts/ugc/world-scene-runtime/v2/testdata/runtime-vectors.json +39 -0
- package/contracts/ugc/world-scene-runtime/v2/testdata/visual-work-vectors.json +28 -0
- package/contracts/ugc/world-scene-runtime/v2/visual-work-policy.mjs +59 -0
- package/creator-release.json +6 -0
- package/docs/assets-3d-spec.md +112 -0
- package/docs/harness-onboarding.md +171 -0
- package/docs/meshy.md +75 -0
- package/docs/npm-creator.md +908 -0
- package/docs/runtime-download.md +178 -0
- package/document-action-result.source-lock.json +22 -0
- package/document-presentation.snapshot.lock.json +40 -0
- package/ground-endpoint.snapshot.lock.json +36 -0
- package/ground-spaces.snapshot.lock.json +57 -0
- package/lib/capability-harness.mjs +26 -0
- package/lib/creator-agent-studio.mjs +57 -0
- package/lib/creator-agent.mjs +7 -0
- package/lib/creator-api.mjs +637 -0
- package/lib/creator-cli.mjs +545 -0
- package/lib/creator-contribution.mjs +263 -0
- package/lib/creator-discovery.mjs +35 -0
- package/lib/creator-init-paths.mjs +56 -0
- package/lib/creator-init.mjs +132 -0
- package/lib/creator-install.mjs +323 -0
- package/lib/creator-materials.mjs +32 -0
- package/lib/creator-mcp.mjs +198 -0
- package/lib/creator-onboarding.mjs +27 -0
- package/lib/creator-package-identity.mjs +23 -0
- package/lib/creator-platform.mjs +138 -0
- package/lib/creator-project-snapshot.mjs +151 -0
- package/lib/creator-project-update.mjs +200 -0
- package/lib/creator-project.mjs +424 -0
- package/lib/creator-provenance.mjs +90 -0
- package/lib/creator-session.mjs +256 -0
- package/lib/creator-source-archive.mjs +182 -0
- package/lib/creator-source-download.mjs +160 -0
- package/lib/creator-source-git.mjs +72 -0
- package/lib/creator-source-package.mjs +47 -0
- package/lib/creator-submit.mjs +289 -0
- package/lib/creator-toolchain-compat.mjs +89 -0
- package/lib/creator-upgrade.mjs +195 -0
- package/lib/creator-upload-state.mjs +107 -0
- package/lib/document-action-result.mjs +21 -0
- package/lib/document-presentation.mjs +110 -0
- package/lib/host-ipc/distribution-document-tool-package-contract/contracts/ugc/creator-source/v1/tool-package.schema.json +11 -0
- package/lib/host-ipc/host-ipc.schema.json +1186 -0
- package/lib/host-ipc/runtime-contract.mjs +70 -0
- package/lib/host-ipc/source-lock.json +22 -0
- package/lib/local-builder.mjs +73 -0
- package/lib/local-content.mjs +37 -0
- package/lib/local-development.mjs +176 -0
- package/lib/meshy-api.mjs +270 -0
- package/lib/meshy-cli.mjs +80 -0
- package/lib/meshy-store.mjs +161 -0
- package/lib/personal-state-bridge.mjs +77 -0
- package/lib/presentation-project-update.mjs +89 -0
- package/lib/presentation-resources.mjs +109 -0
- package/lib/private-ecs-harness.mjs +54 -0
- package/lib/private-event-harness.mjs +35 -0
- package/lib/project-validation.mjs +763 -0
- package/lib/release-version.mjs +20 -0
- package/lib/runtime-download.mjs +115 -0
- package/lib/runtime-host-client.mjs +127 -0
- package/lib/runtime-host.mjs +117 -0
- package/lib/runtime-install.mjs +225 -0
- package/lib/runtime-snapshot.mjs +132 -0
- package/lib/runtime-source.mjs +39 -0
- package/lib/scene-assets.mjs +54 -0
- package/local-builder.snapshot.lock.json +7 -0
- package/local-content.snapshot.lock.json +190 -0
- package/node_modules/@esbuild/darwin-arm64/README.md +3 -0
- package/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
- package/node_modules/@esbuild/darwin-arm64/package.json +20 -0
- package/node_modules/@esbuild/linux-arm64/README.md +3 -0
- package/node_modules/@esbuild/linux-arm64/bin/esbuild +0 -0
- package/node_modules/@esbuild/linux-arm64/package.json +20 -0
- package/node_modules/@modelcontextprotocol/core/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/core/README.md +40 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts +8501 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-BWdKR39I.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs +1678 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CUe6YdwF.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs +2899 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-CfDMXiII.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts +8501 -0
- package/node_modules/@modelcontextprotocol/core/dist/auth-hYtaIUZm.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.cjs +175 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/core/dist/index.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.cjs +201 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts +99 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/core/dist/internal.mjs +3 -0
- package/node_modules/@modelcontextprotocol/core/package.json +85 -0
- package/node_modules/@modelcontextprotocol/server/LICENSE +216 -0
- package/node_modules/@modelcontextprotocol/server/README.md +30 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs +7514 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts +1071 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CgI-5L6O.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts +1071 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-FOQRM7up.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs +7531 -0
- package/node_modules/@modelcontextprotocol/server/dist/ajvProvider-ZaoO9afR.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs +986 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-BwbPzsdI.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts +74 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-C03CSigr.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts +74 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-doTkZbTr.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs +981 -0
- package/node_modules/@modelcontextprotocol/server/dist/cfWorkerProvider-p3WaZPqB.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Bnu9O96Y.cjs +60 -0
- package/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs +42 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts +4043 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts +4045 -0
- package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs +46 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-D8eXzoGv.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs +34 -0
- package/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs +2055 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts +739 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts +739 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs +1870 -0
- package/node_modules/@modelcontextprotocol/server/dist/index.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs +2022 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs +1931 -0
- package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs +23 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts +11 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts +11 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs +22 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsBrowser.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.cjs +12 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.cts +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.d.mts +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs +4 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs +30 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts +10 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts +10 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs +29 -0
- package/node_modules/@modelcontextprotocol/server/dist/shimsWorkerd.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs +7606 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs +8104 -0
- package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs +564 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.cjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts +107 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts +107 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs +562 -0
- package/node_modules/@modelcontextprotocol/server/dist/stdio.mjs.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts +1099 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DUs7mGBv.d.mts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts +1099 -0
- package/node_modules/@modelcontextprotocol/server/dist/types-DsbMXNFL.d.cts.map +1 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.cjs +5 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/ajv.mjs +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.cjs +3 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.cts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.d.mts +2 -0
- package/node_modules/@modelcontextprotocol/server/dist/validators/cfWorker.mjs +3 -0
- package/node_modules/@modelcontextprotocol/server/package.json +160 -0
- package/node_modules/esbuild/LICENSE.md +21 -0
- package/node_modules/esbuild/README.md +3 -0
- package/node_modules/esbuild/bin/esbuild +223 -0
- package/node_modules/esbuild/install.js +289 -0
- package/node_modules/esbuild/lib/main.d.ts +716 -0
- package/node_modules/esbuild/lib/main.js +2242 -0
- package/node_modules/esbuild/package.json +49 -0
- package/node_modules/gltf-validator/ISSUES.md +188 -0
- package/node_modules/gltf-validator/LICENSE +202 -0
- package/node_modules/gltf-validator/NOTICES +435 -0
- package/node_modules/gltf-validator/README.md +153 -0
- package/node_modules/gltf-validator/gltf_validator.dart.js +10996 -0
- package/node_modules/gltf-validator/index.js +63 -0
- package/node_modules/gltf-validator/module.mjs +63 -0
- package/node_modules/gltf-validator/package.json +22 -0
- package/node_modules/gltf-validator/validation.schema.json +266 -0
- package/node_modules/pngjs/LICENSE +20 -0
- package/node_modules/pngjs/README.md +287 -0
- package/node_modules/pngjs/browser.js +18985 -0
- package/node_modules/pngjs/lib/bitmapper.js +267 -0
- package/node_modules/pngjs/lib/bitpacker.js +158 -0
- package/node_modules/pngjs/lib/chunkstream.js +189 -0
- package/node_modules/pngjs/lib/constants.js +32 -0
- package/node_modules/pngjs/lib/crc.js +40 -0
- package/node_modules/pngjs/lib/filter-pack.js +171 -0
- package/node_modules/pngjs/lib/filter-parse-async.js +24 -0
- package/node_modules/pngjs/lib/filter-parse-sync.js +21 -0
- package/node_modules/pngjs/lib/filter-parse.js +177 -0
- package/node_modules/pngjs/lib/format-normaliser.js +93 -0
- package/node_modules/pngjs/lib/interlace.js +95 -0
- package/node_modules/pngjs/lib/packer-async.js +50 -0
- package/node_modules/pngjs/lib/packer-sync.js +56 -0
- package/node_modules/pngjs/lib/packer.js +129 -0
- package/node_modules/pngjs/lib/paeth-predictor.js +16 -0
- package/node_modules/pngjs/lib/parser-async.js +169 -0
- package/node_modules/pngjs/lib/parser-sync.js +112 -0
- package/node_modules/pngjs/lib/parser.js +290 -0
- package/node_modules/pngjs/lib/png-sync.js +12 -0
- package/node_modules/pngjs/lib/png.js +194 -0
- package/node_modules/pngjs/lib/sync-inflate.js +168 -0
- package/node_modules/pngjs/lib/sync-reader.js +45 -0
- package/node_modules/pngjs/package.json +76 -0
- package/node_modules/smol-toml/LICENSE +24 -0
- package/node_modules/smol-toml/README.md +236 -0
- package/node_modules/smol-toml/dist/date.d.ts +41 -0
- package/node_modules/smol-toml/dist/date.js +127 -0
- package/node_modules/smol-toml/dist/error.d.ts +38 -0
- package/node_modules/smol-toml/dist/error.js +63 -0
- package/node_modules/smol-toml/dist/extract.d.ts +30 -0
- package/node_modules/smol-toml/dist/extract.js +109 -0
- package/node_modules/smol-toml/dist/index.cjs +906 -0
- package/node_modules/smol-toml/dist/index.d.ts +43 -0
- package/node_modules/smol-toml/dist/index.js +33 -0
- package/node_modules/smol-toml/dist/parse.d.ts +37 -0
- package/node_modules/smol-toml/dist/parse.js +148 -0
- package/node_modules/smol-toml/dist/primitive.d.ts +31 -0
- package/node_modules/smol-toml/dist/primitive.js +178 -0
- package/node_modules/smol-toml/dist/stringify.d.ts +31 -0
- package/node_modules/smol-toml/dist/stringify.js +163 -0
- package/node_modules/smol-toml/dist/struct.d.ts +32 -0
- package/node_modules/smol-toml/dist/struct.js +194 -0
- package/node_modules/smol-toml/dist/util.d.ts +42 -0
- package/node_modules/smol-toml/dist/util.js +106 -0
- package/node_modules/smol-toml/package.json +54 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +218 -0
- package/node_modules/zod/compile.cjs +77 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +3 -0
- package/node_modules/zod/index.d.ts +3 -0
- package/node_modules/zod/index.js +7 -0
- package/node_modules/zod/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +146 -0
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +7 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +340 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +33 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +78 -0
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +97 -0
- package/node_modules/zod/src/v4/classic/external.ts +55 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +721 -0
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +20 -0
- package/node_modules/zod/src/v4/classic/parse.ts +88 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2862 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +83 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +720 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +836 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +296 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +979 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1310 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +281 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +107 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +183 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +342 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +362 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +950 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +234 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +662 -0
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +190 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1346 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +780 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4537 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1859 -0
- package/node_modules/zod/src/v4/core/checks.ts +1306 -0
- package/node_modules/zod/src/v4/core/compile.ts +2188 -0
- package/node_modules/zod/src/v4/core/core.ts +232 -0
- package/node_modules/zod/src/v4/core/doc.ts +48 -0
- package/node_modules/zod/src/v4/core/errors.ts +546 -0
- package/node_modules/zod/src/v4/core/index.ts +19 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +830 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
- package/node_modules/zod/src/v4/core/memoizer.ts +284 -0
- package/node_modules/zod/src/v4/core/parse.ts +288 -0
- package/node_modules/zod/src/v4/core/regexes.ts +207 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +5028 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +1639 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +31 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +855 -0
- package/node_modules/zod/src/v4/core/util.ts +1209 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +118 -0
- package/node_modules/zod/src/v4/locales/az.ts +114 -0
- package/node_modules/zod/src/v4/locales/be.ts +186 -0
- package/node_modules/zod/src/v4/locales/bg.ts +131 -0
- package/node_modules/zod/src/v4/locales/bn.ts +121 -0
- package/node_modules/zod/src/v4/locales/ca.ts +119 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +138 -0
- package/node_modules/zod/src/v4/locales/cs.ts +121 -0
- package/node_modules/zod/src/v4/locales/da.ts +126 -0
- package/node_modules/zod/src/v4/locales/de.ts +119 -0
- package/node_modules/zod/src/v4/locales/el.ts +122 -0
- package/node_modules/zod/src/v4/locales/en.ts +134 -0
- package/node_modules/zod/src/v4/locales/eo.ts +121 -0
- package/node_modules/zod/src/v4/locales/es.ts +143 -0
- package/node_modules/zod/src/v4/locales/fa.ts +129 -0
- package/node_modules/zod/src/v4/locales/fi.ts +124 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +119 -0
- package/node_modules/zod/src/v4/locales/fr.ts +137 -0
- package/node_modules/zod/src/v4/locales/gu.ts +121 -0
- package/node_modules/zod/src/v4/locales/he.ts +251 -0
- package/node_modules/zod/src/v4/locales/hi.ts +124 -0
- package/node_modules/zod/src/v4/locales/hr.ts +133 -0
- package/node_modules/zod/src/v4/locales/hu.ts +120 -0
- package/node_modules/zod/src/v4/locales/hy.ts +173 -0
- package/node_modules/zod/src/v4/locales/id.ts +118 -0
- package/node_modules/zod/src/v4/locales/index.ts +62 -0
- package/node_modules/zod/src/v4/locales/is.ts +122 -0
- package/node_modules/zod/src/v4/locales/it.ts +119 -0
- package/node_modules/zod/src/v4/locales/ja.ts +117 -0
- package/node_modules/zod/src/v4/locales/ka.ts +126 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +122 -0
- package/node_modules/zod/src/v4/locales/kn.ts +124 -0
- package/node_modules/zod/src/v4/locales/ko.ts +124 -0
- package/node_modules/zod/src/v4/locales/lt.ts +241 -0
- package/node_modules/zod/src/v4/locales/mk.ts +121 -0
- package/node_modules/zod/src/v4/locales/ms.ts +118 -0
- package/node_modules/zod/src/v4/locales/ne.ts +126 -0
- package/node_modules/zod/src/v4/locales/nl.ts +124 -0
- package/node_modules/zod/src/v4/locales/nn.ts +119 -0
- package/node_modules/zod/src/v4/locales/no.ts +119 -0
- package/node_modules/zod/src/v4/locales/ota.ts +120 -0
- package/node_modules/zod/src/v4/locales/pl.ts +121 -0
- package/node_modules/zod/src/v4/locales/ps.ts +129 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +159 -0
- package/node_modules/zod/src/v4/locales/pt.ts +157 -0
- package/node_modules/zod/src/v4/locales/ro.ts +130 -0
- package/node_modules/zod/src/v4/locales/ru.ts +186 -0
- package/node_modules/zod/src/v4/locales/sk.ts +121 -0
- package/node_modules/zod/src/v4/locales/sl.ts +121 -0
- package/node_modules/zod/src/v4/locales/sv.ts +122 -0
- package/node_modules/zod/src/v4/locales/ta.ts +121 -0
- package/node_modules/zod/src/v4/locales/th.ts +122 -0
- package/node_modules/zod/src/v4/locales/tk.ts +111 -0
- package/node_modules/zod/src/v4/locales/tr.ts +114 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +120 -0
- package/node_modules/zod/src/v4/locales/ur.ts +122 -0
- package/node_modules/zod/src/v4/locales/uz.ts +118 -0
- package/node_modules/zod/src/v4/locales/vi.ts +120 -0
- package/node_modules/zod/src/v4/locales/yo.ts +127 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +119 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +118 -0
- package/node_modules/zod/src/v4/mini/checks.ts +33 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +50 -0
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +16 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +2026 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +1060 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +373 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +148 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +143 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3779 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3697 -0
- package/node_modules/zod/v4/classic/checks.cjs +34 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +48 -0
- package/node_modules/zod/v4/classic/compat.d.ts +48 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +39 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +83 -0
- package/node_modules/zod/v4/classic/errors.d.cts +29 -0
- package/node_modules/zod/v4/classic/errors.d.ts +29 -0
- package/node_modules/zod/v4/classic/errors.js +57 -0
- package/node_modules/zod/v4/classic/external.cjs +76 -0
- package/node_modules/zod/v4/classic/external.d.cts +19 -0
- package/node_modules/zod/v4/classic/external.d.ts +19 -0
- package/node_modules/zod/v4/classic/external.js +17 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +686 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +660 -0
- package/node_modules/zod/v4/classic/in-out.cjs +63 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +3 -0
- package/node_modules/zod/v4/classic/index.d.ts +3 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +49 -0
- package/node_modules/zod/v4/classic/iso.d.cts +7 -0
- package/node_modules/zod/v4/classic/iso.d.ts +7 -0
- package/node_modules/zod/v4/classic/iso.js +15 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +44 -0
- package/node_modules/zod/v4/classic/parse.d.cts +44 -0
- package/node_modules/zod/v4/classic/parse.d.ts +44 -0
- package/node_modules/zod/v4/classic/parse.js +16 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1611 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +802 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +802 -0
- package/node_modules/zod/v4/classic/schemas.js +1491 -0
- package/node_modules/zod/v4/core/api.cjs +1246 -0
- package/node_modules/zod/v4/core/api.d.cts +329 -0
- package/node_modules/zod/v4/core/api.d.ts +329 -0
- package/node_modules/zod/v4/core/api.js +1104 -0
- package/node_modules/zod/v4/core/checks.cjs +607 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +581 -0
- package/node_modules/zod/v4/core/compile.cjs +1813 -0
- package/node_modules/zod/v4/core/compile.d.cts +51 -0
- package/node_modules/zod/v4/core/compile.d.ts +51 -0
- package/node_modules/zod/v4/core/compile.js +1783 -0
- package/node_modules/zod/v4/core/core.cjs +148 -0
- package/node_modules/zod/v4/core/core.d.cts +82 -0
- package/node_modules/zod/v4/core/core.d.ts +82 -0
- package/node_modules/zod/v4/core/core.js +141 -0
- package/node_modules/zod/v4/core/doc.cjs +37 -0
- package/node_modules/zod/v4/core/doc.d.cts +16 -0
- package/node_modules/zod/v4/core/doc.d.ts +16 -0
- package/node_modules/zod/v4/core/doc.js +33 -0
- package/node_modules/zod/v4/core/errors.cjs +301 -0
- package/node_modules/zod/v4/core/errors.d.cts +225 -0
- package/node_modules/zod/v4/core/errors.d.ts +225 -0
- package/node_modules/zod/v4/core/errors.js +270 -0
- package/node_modules/zod/v4/core/index.cjs +51 -0
- package/node_modules/zod/v4/core/index.d.cts +19 -0
- package/node_modules/zod/v4/core/index.d.ts +19 -0
- package/node_modules/zod/v4/core/index.js +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +103 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +813 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +747 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/memoizer.cjs +272 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +265 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +193 -0
- package/node_modules/zod/v4/core/parse.d.cts +52 -0
- package/node_modules/zod/v4/core/parse.d.ts +52 -0
- package/node_modules/zod/v4/core/parse.js +154 -0
- package/node_modules/zod/v4/core/regexes.cjs +184 -0
- package/node_modules/zod/v4/core/regexes.d.cts +87 -0
- package/node_modules/zod/v4/core/regexes.d.ts +87 -0
- package/node_modules/zod/v4/core/regexes.js +150 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2481 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1253 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1253 -0
- package/node_modules/zod/v4/core/schemas.js +2440 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +660 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +153 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +153 -0
- package/node_modules/zod/v4/core/to-json-schema.js +650 -0
- package/node_modules/zod/v4/core/util.cjs +915 -0
- package/node_modules/zod/v4/core/util.d.cts +257 -0
- package/node_modules/zod/v4/core/util.d.ts +257 -0
- package/node_modules/zod/v4/core/util.js +846 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/core/visit.cjs +195 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +32 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +4 -0
- package/node_modules/zod/v4/locales/ar.cjs +136 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +109 -0
- package/node_modules/zod/v4/locales/az.cjs +135 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +108 -0
- package/node_modules/zod/v4/locales/be.cjs +193 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +166 -0
- package/node_modules/zod/v4/locales/bg.cjs +150 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +123 -0
- package/node_modules/zod/v4/locales/bn.cjs +138 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +111 -0
- package/node_modules/zod/v4/locales/ca.cjs +137 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +110 -0
- package/node_modules/zod/v4/locales/ckb.cjs +158 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +131 -0
- package/node_modules/zod/v4/locales/cs.cjs +141 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +114 -0
- package/node_modules/zod/v4/locales/da.cjs +145 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +118 -0
- package/node_modules/zod/v4/locales/de.cjs +138 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +111 -0
- package/node_modules/zod/v4/locales/el.cjs +137 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +110 -0
- package/node_modules/zod/v4/locales/en.cjs +150 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +123 -0
- package/node_modules/zod/v4/locales/eo.cjs +139 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +112 -0
- package/node_modules/zod/v4/locales/es.cjs +161 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +134 -0
- package/node_modules/zod/v4/locales/fa.cjs +144 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +117 -0
- package/node_modules/zod/v4/locales/fi.cjs +142 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +115 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +137 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +110 -0
- package/node_modules/zod/v4/locales/fr.cjs +154 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +127 -0
- package/node_modules/zod/v4/locales/gu.cjs +138 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +111 -0
- package/node_modules/zod/v4/locales/he.cjs +246 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +219 -0
- package/node_modules/zod/v4/locales/hi.cjs +136 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +109 -0
- package/node_modules/zod/v4/locales/hr.cjs +151 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +124 -0
- package/node_modules/zod/v4/locales/hu.cjs +138 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +111 -0
- package/node_modules/zod/v4/locales/hy.cjs +183 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +156 -0
- package/node_modules/zod/v4/locales/id.cjs +136 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +109 -0
- package/node_modules/zod/v4/locales/index.cjs +131 -0
- package/node_modules/zod/v4/locales/index.d.cts +62 -0
- package/node_modules/zod/v4/locales/index.d.ts +62 -0
- package/node_modules/zod/v4/locales/index.js +62 -0
- package/node_modules/zod/v4/locales/is.cjs +139 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +112 -0
- package/node_modules/zod/v4/locales/it.cjs +138 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +111 -0
- package/node_modules/zod/v4/locales/ja.cjs +137 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +110 -0
- package/node_modules/zod/v4/locales/ka.cjs +142 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +115 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +140 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +113 -0
- package/node_modules/zod/v4/locales/kn.cjs +141 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +114 -0
- package/node_modules/zod/v4/locales/ko.cjs +141 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +114 -0
- package/node_modules/zod/v4/locales/lt.cjs +232 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +205 -0
- package/node_modules/zod/v4/locales/mk.cjs +139 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +112 -0
- package/node_modules/zod/v4/locales/ms.cjs +137 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +110 -0
- package/node_modules/zod/v4/locales/ne.cjs +136 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +109 -0
- package/node_modules/zod/v4/locales/nl.cjs +140 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +113 -0
- package/node_modules/zod/v4/locales/nn.cjs +138 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +111 -0
- package/node_modules/zod/v4/locales/no.cjs +138 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +111 -0
- package/node_modules/zod/v4/locales/ota.cjs +139 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +112 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +139 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +112 -0
- package/node_modules/zod/v4/locales/ps.cjs +144 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +117 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +168 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +141 -0
- package/node_modules/zod/v4/locales/pt.cjs +167 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +140 -0
- package/node_modules/zod/v4/locales/ro.cjs +147 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +120 -0
- package/node_modules/zod/v4/locales/ru.cjs +193 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +166 -0
- package/node_modules/zod/v4/locales/sk.cjs +141 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +114 -0
- package/node_modules/zod/v4/locales/sl.cjs +139 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +112 -0
- package/node_modules/zod/v4/locales/sv.cjs +140 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +113 -0
- package/node_modules/zod/v4/locales/ta.cjs +140 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +113 -0
- package/node_modules/zod/v4/locales/th.cjs +140 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +113 -0
- package/node_modules/zod/v4/locales/tk.cjs +132 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +105 -0
- package/node_modules/zod/v4/locales/tr.cjs +135 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +108 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +138 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +111 -0
- package/node_modules/zod/v4/locales/ur.cjs +140 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +113 -0
- package/node_modules/zod/v4/locales/uz.cjs +138 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +111 -0
- package/node_modules/zod/v4/locales/vi.cjs +138 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +111 -0
- package/node_modules/zod/v4/locales/yo.cjs +137 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +110 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +139 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +112 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +137 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +110 -0
- package/node_modules/zod/v4/mini/checks.cjs +35 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +52 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +39 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +74 -0
- package/node_modules/zod/v4/mini/external.d.cts +16 -0
- package/node_modules/zod/v4/mini/external.d.ts +16 -0
- package/node_modules/zod/v4/mini/external.js +16 -0
- package/node_modules/zod/v4/mini/in-out.cjs +63 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +64 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +18 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1111 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +475 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +475 -0
- package/node_modules/zod/v4/mini/schemas.js +987 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +32 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/package.json +171 -4
- package/personal-state-bridge.source-lock.json +42 -0
- package/personal-state.snapshot.lock.json +40 -0
- package/public-runtime.snapshot.lock.json +54 -0
- package/runtime-catalog.json +38 -0
- package/scene-interaction-v2.snapshot.lock.json +36 -0
- package/sdk/client/index.js +20 -0
- package/sdk/shared/index.js +20 -0
- package/source-package.snapshot.lock.json +26 -0
- package/templates/document-presentation/assets.js +73 -0
- package/templates/document-presentation/authority.js +31 -0
- package/templates/document-presentation/journey-actions.js +36 -0
- package/templates/document-presentation/journey-note-bridge.js +34 -0
- package/templates/document-presentation/journey-presentation.js +96 -0
- package/templates/document-presentation/journey-view.js +43 -0
- package/templates/document-presentation/motion.js +11 -0
- package/templates/document-presentation/peer-presentation.js +160 -0
- package/templates/document-presentation/personal-story.js +75 -0
- package/templates/document-presentation/space-projection.js +54 -0
- package/templates/npm-project/AGENTS.md +11 -0
- package/templates/project.gitignore +9 -0
- package/templates/public-untrusted/chrona.project.json +7 -0
- package/templates/public-untrusted/content/assets/runtime/template-triangle.gltf +50 -0
- package/templates/public-untrusted/content/ecs/components.json +30 -0
- package/templates/public-untrusted/content/ecs/prefabs.json +14 -0
- package/templates/public-untrusted/content/ecs/scene.json +9 -0
- package/templates/public-untrusted/content/gameplay/client/presentation.js +8 -0
- package/templates/public-untrusted/content/gameplay/shared/rules.js +17 -0
- package/templates/public-untrusted/content/manifest.json +75 -0
- package/templates/public-untrusted/content/provenance.json +15 -0
- package/templates/public-untrusted/content/tests/budgets.json +5 -0
- package/templates/public-untrusted/content/tests/rules.json +10 -0
- package/templates/public-untrusted/content/tests/scenarios.json +45 -0
|
@@ -0,0 +1,1209 @@
|
|
|
1
|
+
import type * as checks from "./checks.js";
|
|
2
|
+
import { globalConfig } from "./core.js";
|
|
3
|
+
import type { $ZodConfig } from "./core.js";
|
|
4
|
+
import type * as errors from "./errors.js";
|
|
5
|
+
import type * as schemas from "./schemas.js";
|
|
6
|
+
|
|
7
|
+
// json
|
|
8
|
+
export type JSONType = string | number | boolean | null | JSONType[] | { [key: string]: JSONType };
|
|
9
|
+
export type JWTAlgorithm =
|
|
10
|
+
| "HS256"
|
|
11
|
+
| "HS384"
|
|
12
|
+
| "HS512"
|
|
13
|
+
| "RS256"
|
|
14
|
+
| "RS384"
|
|
15
|
+
| "RS512"
|
|
16
|
+
| "ES256"
|
|
17
|
+
| "ES384"
|
|
18
|
+
| "ES512"
|
|
19
|
+
| "PS256"
|
|
20
|
+
| "PS384"
|
|
21
|
+
| "PS512"
|
|
22
|
+
| "EdDSA"
|
|
23
|
+
| (string & {});
|
|
24
|
+
|
|
25
|
+
export type HashAlgorithm = "md5" | "sha1" | "sha256" | "sha384" | "sha512";
|
|
26
|
+
export type HashEncoding = "hex" | "base64" | "base64url";
|
|
27
|
+
export type HashFormat = `${HashAlgorithm}_${HashEncoding}`;
|
|
28
|
+
export type IPVersion = "v4" | "v6";
|
|
29
|
+
export type MimeTypes =
|
|
30
|
+
| "application/json"
|
|
31
|
+
| "application/xml"
|
|
32
|
+
| "application/x-www-form-urlencoded"
|
|
33
|
+
| "application/javascript"
|
|
34
|
+
| "application/pdf"
|
|
35
|
+
| "application/zip"
|
|
36
|
+
| "application/vnd.ms-excel"
|
|
37
|
+
| "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
38
|
+
| "application/msword"
|
|
39
|
+
| "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
|
40
|
+
| "application/vnd.ms-powerpoint"
|
|
41
|
+
| "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
42
|
+
| "application/octet-stream"
|
|
43
|
+
| "application/graphql"
|
|
44
|
+
| "text/html"
|
|
45
|
+
| "text/plain"
|
|
46
|
+
| "text/css"
|
|
47
|
+
| "text/javascript"
|
|
48
|
+
| "text/csv"
|
|
49
|
+
| "image/png"
|
|
50
|
+
| "image/jpeg"
|
|
51
|
+
| "image/gif"
|
|
52
|
+
| "image/svg+xml"
|
|
53
|
+
| "image/webp"
|
|
54
|
+
| "audio/mpeg"
|
|
55
|
+
| "audio/ogg"
|
|
56
|
+
| "audio/wav"
|
|
57
|
+
| "audio/webm"
|
|
58
|
+
| "video/mp4"
|
|
59
|
+
| "video/webm"
|
|
60
|
+
| "video/ogg"
|
|
61
|
+
| "font/woff"
|
|
62
|
+
| "font/woff2"
|
|
63
|
+
| "font/ttf"
|
|
64
|
+
| "font/otf"
|
|
65
|
+
| "multipart/form-data"
|
|
66
|
+
| (string & {});
|
|
67
|
+
export type ParsedTypes =
|
|
68
|
+
| "string"
|
|
69
|
+
| "number"
|
|
70
|
+
| "bigint"
|
|
71
|
+
| "boolean"
|
|
72
|
+
| "symbol"
|
|
73
|
+
| "undefined"
|
|
74
|
+
| "object"
|
|
75
|
+
| "function"
|
|
76
|
+
| "file"
|
|
77
|
+
| "date"
|
|
78
|
+
| "array"
|
|
79
|
+
| "map"
|
|
80
|
+
| "set"
|
|
81
|
+
| "nan"
|
|
82
|
+
| "null"
|
|
83
|
+
| "promise";
|
|
84
|
+
|
|
85
|
+
// utils
|
|
86
|
+
export type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
|
|
87
|
+
export type AssertNotEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? false : true;
|
|
88
|
+
export type AssertExtends<T, U> = T extends U ? T : never;
|
|
89
|
+
type ToZodMismatch<T, S extends schemas.$ZodType> = {
|
|
90
|
+
"types do not match": {
|
|
91
|
+
expected: T;
|
|
92
|
+
received: S["_zod"]["output"];
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// Stays a `$ZodType` so it still satisfies the shape constraint, and carries a brand no real schema has so the offending property is the one TypeScript reports as unassignable.
|
|
97
|
+
type ToZodKeyMismatch<Expected, Received> = schemas.$ZodType & {
|
|
98
|
+
"types do not match": { expected: Expected; received: Received };
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// Rebuilds the shape with a marker on each key that disagrees, so the diagnostic names the key instead of failing the whole schema at the top level. A key the target lacks reports `expected: never`; a key the schema lacks reports `received: never`.
|
|
102
|
+
type ToZodShape<Shape, T> = {
|
|
103
|
+
[K in keyof Shape]: Shape[K] extends schemas.$ZodType
|
|
104
|
+
? K extends keyof T
|
|
105
|
+
? AssertEqual<Shape[K]["_zod"]["output"], T[K]> extends true
|
|
106
|
+
? Shape[K]
|
|
107
|
+
: ToZodKeyMismatch<T[K], Shape[K]["_zod"]["output"]>
|
|
108
|
+
: ToZodKeyMismatch<never, Shape[K]["_zod"]["output"]>
|
|
109
|
+
: Shape[K];
|
|
110
|
+
} & { [K in Exclude<keyof T, keyof Shape>]: ToZodKeyMismatch<T[K], never> };
|
|
111
|
+
|
|
112
|
+
// Forces the mapped type to display expanded, so the error prints the keys rather than the alias name.
|
|
113
|
+
type ToZodExpand<X> = { [K in keyof X]: X[K] } & {};
|
|
114
|
+
|
|
115
|
+
// Only localizes when a key is genuinely at fault. A whole-type difference the per-key walk cannot see — a `readonly` modifier, an intersection versus the flat object with the same keys — leaves every key agreeing, and reporting nothing there would silently accept what the top-level check rejected.
|
|
116
|
+
type ToZodTarget<S extends schemas.$ZodType, T> = S extends schemas.$ZodObject<infer Shape, infer Config>
|
|
117
|
+
? T extends object
|
|
118
|
+
? AssertEqual<ToZodExpand<ToZodShape<Shape, T>>, ToZodExpand<Shape>> extends true
|
|
119
|
+
? S & ToZodMismatch<T, S>
|
|
120
|
+
: schemas.$ZodObject<ToZodExpand<ToZodShape<Shape, T>>, Config>
|
|
121
|
+
: S & ToZodMismatch<T, S>
|
|
122
|
+
: S & ToZodMismatch<T, S>;
|
|
123
|
+
export type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
124
|
+
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
125
|
+
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
|
|
126
|
+
export type MakePartial<T, K extends keyof T> = Omit<T, K> & InexactPartial<Pick<T, K>>;
|
|
127
|
+
export type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
128
|
+
|
|
129
|
+
export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
|
|
130
|
+
export type NoUndefined<T> = T extends undefined ? never : T;
|
|
131
|
+
export type Whatever = {} | undefined | null;
|
|
132
|
+
export type LoosePartial<T extends object> = InexactPartial<T> & {
|
|
133
|
+
[k: string]: unknown;
|
|
134
|
+
};
|
|
135
|
+
export type Mask<Keys extends PropertyKey> = { [K in Keys]?: true };
|
|
136
|
+
export type Writeable<T> = { -readonly [P in keyof T]: T[P] } & {};
|
|
137
|
+
export type InexactPartial<T> = {
|
|
138
|
+
[P in keyof T]?: T[P] | undefined;
|
|
139
|
+
};
|
|
140
|
+
export type EmptyObject = Record<string, never>;
|
|
141
|
+
export type BuiltIn =
|
|
142
|
+
| (((...args: any[]) => any) | (new (...args: any[]) => any))
|
|
143
|
+
| { readonly [Symbol.toStringTag]: string }
|
|
144
|
+
| Date
|
|
145
|
+
| Error
|
|
146
|
+
| Generator
|
|
147
|
+
| Promise<unknown>
|
|
148
|
+
| RegExp;
|
|
149
|
+
export type MakeReadonly<T> = T extends Map<infer K, infer V>
|
|
150
|
+
? ReadonlyMap<K, V>
|
|
151
|
+
: T extends Set<infer V>
|
|
152
|
+
? ReadonlySet<V>
|
|
153
|
+
: T extends [infer Head, ...infer Tail]
|
|
154
|
+
? readonly [Head, ...Tail]
|
|
155
|
+
: T extends Array<infer V>
|
|
156
|
+
? ReadonlyArray<V>
|
|
157
|
+
: T extends BuiltIn
|
|
158
|
+
? T
|
|
159
|
+
: Readonly<T>;
|
|
160
|
+
export type SomeObject = Record<PropertyKey, any>;
|
|
161
|
+
export type Identity<T> = T;
|
|
162
|
+
export type Flatten<T> = Identity<{ [k in keyof T]: T[k] }>;
|
|
163
|
+
export type Mapped<T> = { [k in keyof T]: T[k] };
|
|
164
|
+
export type Prettify<T> = {
|
|
165
|
+
// @ts-ignore
|
|
166
|
+
[K in keyof T]: T[K];
|
|
167
|
+
} & {};
|
|
168
|
+
|
|
169
|
+
export type NoNeverKeys<T> = {
|
|
170
|
+
[k in keyof T]: [T[k]] extends [never] ? never : k;
|
|
171
|
+
}[keyof T];
|
|
172
|
+
export type NoNever<T> = Identity<{
|
|
173
|
+
[k in NoNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
|
174
|
+
}>;
|
|
175
|
+
export type Extend<A extends SomeObject, B extends SomeObject> = Flatten<
|
|
176
|
+
// fast path when there is no keys overlap
|
|
177
|
+
keyof A & keyof B extends never
|
|
178
|
+
? A & B
|
|
179
|
+
: {
|
|
180
|
+
[K in keyof A as K extends keyof B ? never : K]: A[K];
|
|
181
|
+
} & {
|
|
182
|
+
[K in keyof B]: B[K];
|
|
183
|
+
}
|
|
184
|
+
>;
|
|
185
|
+
|
|
186
|
+
export type TupleItems = ReadonlyArray<schemas.SomeType>;
|
|
187
|
+
export type AnyFunc = (...args: any[]) => any;
|
|
188
|
+
export type IsProp<T, K extends keyof T> = T[K] extends AnyFunc ? never : K;
|
|
189
|
+
export type MaybeAsync<T> = T | Promise<T>;
|
|
190
|
+
export type KeyOf<T> = keyof OmitIndexSignature<T>;
|
|
191
|
+
export type OmitIndexSignature<T> = {
|
|
192
|
+
[K in keyof T as string extends K ? never : K extends string ? K : never]: T[K];
|
|
193
|
+
};
|
|
194
|
+
export type ExtractIndexSignature<T> = {
|
|
195
|
+
[K in keyof T as string extends K ? K : K extends string ? never : K]: T[K];
|
|
196
|
+
};
|
|
197
|
+
export type Keys<T extends object> = keyof OmitIndexSignature<T>;
|
|
198
|
+
|
|
199
|
+
export type SchemaClass<T extends schemas.SomeType> = {
|
|
200
|
+
new (def: T["_zod"]["def"]): T;
|
|
201
|
+
};
|
|
202
|
+
export type EnumValue = string | number; // | bigint | boolean | symbol;
|
|
203
|
+
export type EnumLike = Readonly<Record<string, EnumValue>>;
|
|
204
|
+
export type ToEnum<T extends EnumValue> = Flatten<{ [k in T]: k }>;
|
|
205
|
+
export type KeysEnum<T extends object> = ToEnum<Exclude<keyof T, symbol>>;
|
|
206
|
+
export type KeysArray<T extends object> = Flatten<(keyof T & string)[]>;
|
|
207
|
+
export type Literal = string | number | bigint | boolean | null | undefined;
|
|
208
|
+
export type LiteralArray = Array<Literal>;
|
|
209
|
+
export type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
210
|
+
export type PrimitiveArray = Array<Primitive>;
|
|
211
|
+
export type HasSize = { size: number };
|
|
212
|
+
export type HasLength = { length: number }; // string | Array<unknown> | Set<unknown> | File;
|
|
213
|
+
export type Numeric = number | bigint | Date;
|
|
214
|
+
export type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError<T>;
|
|
215
|
+
export type SafeParseSuccess<T> = { success: true; data: T; error?: never };
|
|
216
|
+
export type SafeParseError<T> = {
|
|
217
|
+
success: false;
|
|
218
|
+
data?: never;
|
|
219
|
+
error: errors.$ZodError<T>;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export type PropValues = Record<string, Set<Primitive>>;
|
|
223
|
+
export type PrimitiveSet = Set<Primitive>;
|
|
224
|
+
|
|
225
|
+
// functions
|
|
226
|
+
export function assertEqual<A, B>(val: AssertEqual<A, B>): AssertEqual<A, B> {
|
|
227
|
+
return val;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export function assertNotEqual<A, B>(val: AssertNotEqual<A, B>): AssertNotEqual<A, B> {
|
|
231
|
+
return val;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export function toZod<T>(): <S extends schemas.$ZodType>(
|
|
235
|
+
schema: AssertEqual<S["_zod"]["output"], T> extends true ? S : ToZodTarget<S, T>
|
|
236
|
+
) => S {
|
|
237
|
+
return (schema) => schema as any;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export function assertIs<T>(_arg: T): void {}
|
|
241
|
+
|
|
242
|
+
export function assertNever(_x: never): never {
|
|
243
|
+
throw new Error("Unexpected value in exhaustive check");
|
|
244
|
+
}
|
|
245
|
+
export function assert<T>(_: any): asserts _ is T {}
|
|
246
|
+
|
|
247
|
+
export function getEnumValues(entries: EnumLike): EnumValue[] {
|
|
248
|
+
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
249
|
+
const values = Object.entries(entries)
|
|
250
|
+
.filter(([k, _]) => numericValues.indexOf(+k) === -1)
|
|
251
|
+
.map(([_, v]) => v);
|
|
252
|
+
return values;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export function joinValues<T extends Primitive[]>(array: T, separator = "|"): string {
|
|
256
|
+
return array.map((val) => stringifyPrimitive(val)).join(separator);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export function jsonStringifyReplacer(_: string, value: any): any {
|
|
260
|
+
if (typeof value === "bigint") return value.toString();
|
|
261
|
+
return value;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export function cached<T>(getter: () => T): { value: T } {
|
|
265
|
+
const set = false;
|
|
266
|
+
return {
|
|
267
|
+
get value() {
|
|
268
|
+
if (!set) {
|
|
269
|
+
const value = getter();
|
|
270
|
+
Object.defineProperty(this, "value", { value });
|
|
271
|
+
return value;
|
|
272
|
+
}
|
|
273
|
+
throw new Error("cached value already set");
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export function nullish(input: any): boolean {
|
|
279
|
+
return input === null || input === undefined;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export function cleanRegex(source: string): string {
|
|
283
|
+
const start = source.startsWith("^") ? 1 : 0;
|
|
284
|
+
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
285
|
+
return source.slice(start, end);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export function floatSafeRemainder(val: number, step: number): number {
|
|
289
|
+
const ratio = val / step;
|
|
290
|
+
const roundedRatio = Math.round(ratio);
|
|
291
|
+
// `val` and `step` each round to a double before the division rounds again, so a true decimal multiple's quotient can sit up to 1.5 of these scaled epsilons from the integer. A 1x tolerance therefore rejected 2.03 as a multiple of 0.07; 4x covers the worst case with margin.
|
|
292
|
+
const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
|
|
293
|
+
if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
|
|
294
|
+
return ratio - roundedRatio;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
|
|
298
|
+
|
|
299
|
+
export function defineLazy<T, K extends keyof T>(object: T, key: K, getter: () => T[K]): void {
|
|
300
|
+
let value: T[K] | typeof EVALUATING | undefined = undefined;
|
|
301
|
+
Object.defineProperty(object, key, {
|
|
302
|
+
get() {
|
|
303
|
+
if (value === EVALUATING) {
|
|
304
|
+
// Circular reference detected, return undefined to break the cycle
|
|
305
|
+
return undefined as T[K];
|
|
306
|
+
}
|
|
307
|
+
if (value === undefined) {
|
|
308
|
+
value = EVALUATING;
|
|
309
|
+
value = getter();
|
|
310
|
+
}
|
|
311
|
+
return value;
|
|
312
|
+
},
|
|
313
|
+
set(v) {
|
|
314
|
+
Object.defineProperty(object, key, {
|
|
315
|
+
value: v,
|
|
316
|
+
// configurable: true,
|
|
317
|
+
});
|
|
318
|
+
// object[key] = v;
|
|
319
|
+
},
|
|
320
|
+
configurable: true,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export function objectClone(obj: object) {
|
|
325
|
+
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export function assignProp<T extends object, K extends PropertyKey>(
|
|
329
|
+
target: T,
|
|
330
|
+
prop: K,
|
|
331
|
+
value: K extends keyof T ? T[K] : any
|
|
332
|
+
): void {
|
|
333
|
+
Object.defineProperty(target, prop, {
|
|
334
|
+
value,
|
|
335
|
+
writable: true,
|
|
336
|
+
enumerable: true,
|
|
337
|
+
configurable: true,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export function mergeDefs(...defs: Record<string, any>[]): any {
|
|
342
|
+
const mergedDescriptors: Record<string, PropertyDescriptor> = {};
|
|
343
|
+
|
|
344
|
+
for (const def of defs) {
|
|
345
|
+
const descriptors = Object.getOwnPropertyDescriptors(def);
|
|
346
|
+
Object.assign(mergedDescriptors, descriptors);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return Object.defineProperties({}, mergedDescriptors);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export function cloneDef(schema: schemas.$ZodType): any {
|
|
353
|
+
return mergeDefs(schema._zod.def);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export function getElementAtPath(obj: any, path: (string | number)[] | null | undefined): any {
|
|
357
|
+
if (!path) return obj;
|
|
358
|
+
return path.reduce((acc, key) => acc?.[key], obj);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export function promiseAllObject<T extends object>(promisesObj: T): Promise<{ [k in keyof T]: Awaited<T[k]> }> {
|
|
362
|
+
const keys = Object.keys(promisesObj);
|
|
363
|
+
const promises = keys.map((key) => (promisesObj as any)[key]);
|
|
364
|
+
|
|
365
|
+
return Promise.all(promises).then((results) => {
|
|
366
|
+
const resolvedObj: any = {};
|
|
367
|
+
for (let i = 0; i < keys.length; i++) {
|
|
368
|
+
resolvedObj[keys[i]!] = results[i];
|
|
369
|
+
}
|
|
370
|
+
return resolvedObj;
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export function randomString(length = 10): string {
|
|
375
|
+
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
376
|
+
let str = "";
|
|
377
|
+
for (let i = 0; i < length; i++) {
|
|
378
|
+
str += chars[Math.floor(Math.random() * chars.length)];
|
|
379
|
+
}
|
|
380
|
+
return str;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export function esc(str: string): string {
|
|
384
|
+
return JSON.stringify(str);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export function slugify(input: string): string {
|
|
388
|
+
return input
|
|
389
|
+
.toLowerCase()
|
|
390
|
+
.trim()
|
|
391
|
+
.replace(/[^\w\s-]/g, "")
|
|
392
|
+
.replace(/[\s_-]+/g, "-")
|
|
393
|
+
.replace(/^-+|-+$/g, "");
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export const captureStackTrace: (targetObject: object, constructorOpt?: Function) => void = (
|
|
397
|
+
"captureStackTrace" in Error ? Error.captureStackTrace : (..._args: any[]) => {}
|
|
398
|
+
) as any;
|
|
399
|
+
|
|
400
|
+
export function isObject(data: any): data is Record<PropertyKey, unknown> {
|
|
401
|
+
return typeof data === "object" && data !== null && !Array.isArray(data);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export const allowsEval: { value: boolean } = /* @__PURE__*/ cached(() => {
|
|
405
|
+
// Skip the probe under `jitless`: strict CSPs report the caught `new Function` as a `securitypolicyviolation` even though the throw is swallowed.
|
|
406
|
+
if (globalConfig.jitless) {
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// @ts-ignore
|
|
411
|
+
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
try {
|
|
416
|
+
const F = Function;
|
|
417
|
+
new F("");
|
|
418
|
+
return true;
|
|
419
|
+
} catch (_) {
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
export function isPlainObject(o: any): o is Record<PropertyKey, unknown> {
|
|
425
|
+
if (isObject(o) === false) return false;
|
|
426
|
+
|
|
427
|
+
// modified constructor
|
|
428
|
+
const ctor = o.constructor;
|
|
429
|
+
if (ctor === undefined) return true;
|
|
430
|
+
|
|
431
|
+
if (typeof ctor !== "function") return true;
|
|
432
|
+
|
|
433
|
+
// modified prototype
|
|
434
|
+
const prot = ctor.prototype;
|
|
435
|
+
if (isObject(prot) === false) return false;
|
|
436
|
+
|
|
437
|
+
// ctor doesn't have static `isPrototypeOf`
|
|
438
|
+
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
|
|
439
|
+
return false;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return true;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export function shallowClone(o: any): any {
|
|
446
|
+
if (isPlainObject(o)) return { ...o };
|
|
447
|
+
if (Array.isArray(o)) return [...o];
|
|
448
|
+
if (o instanceof Map) return new Map(o);
|
|
449
|
+
if (o instanceof Set) return new Set(o);
|
|
450
|
+
return o;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export function numKeys(data: any): number {
|
|
454
|
+
let keyCount = 0;
|
|
455
|
+
for (const key in data) {
|
|
456
|
+
if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
457
|
+
keyCount++;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return keyCount;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export const getParsedType = (data: any): ParsedTypes => {
|
|
464
|
+
const t = typeof data;
|
|
465
|
+
|
|
466
|
+
switch (t) {
|
|
467
|
+
case "undefined":
|
|
468
|
+
return "undefined";
|
|
469
|
+
|
|
470
|
+
case "string":
|
|
471
|
+
return "string";
|
|
472
|
+
|
|
473
|
+
case "number":
|
|
474
|
+
return Number.isNaN(data) ? "nan" : "number";
|
|
475
|
+
|
|
476
|
+
case "boolean":
|
|
477
|
+
return "boolean";
|
|
478
|
+
|
|
479
|
+
case "function":
|
|
480
|
+
return "function";
|
|
481
|
+
|
|
482
|
+
case "bigint":
|
|
483
|
+
return "bigint";
|
|
484
|
+
|
|
485
|
+
case "symbol":
|
|
486
|
+
return "symbol";
|
|
487
|
+
|
|
488
|
+
case "object":
|
|
489
|
+
if (Array.isArray(data)) {
|
|
490
|
+
return "array";
|
|
491
|
+
}
|
|
492
|
+
if (data === null) {
|
|
493
|
+
return "null";
|
|
494
|
+
}
|
|
495
|
+
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
|
|
496
|
+
return "promise";
|
|
497
|
+
}
|
|
498
|
+
if (typeof Map !== "undefined" && data instanceof Map) {
|
|
499
|
+
return "map";
|
|
500
|
+
}
|
|
501
|
+
if (typeof Set !== "undefined" && data instanceof Set) {
|
|
502
|
+
return "set";
|
|
503
|
+
}
|
|
504
|
+
if (typeof Date !== "undefined" && data instanceof Date) {
|
|
505
|
+
return "date";
|
|
506
|
+
}
|
|
507
|
+
// @ts-ignore
|
|
508
|
+
if (typeof File !== "undefined" && data instanceof File) {
|
|
509
|
+
return "file";
|
|
510
|
+
}
|
|
511
|
+
return "object";
|
|
512
|
+
|
|
513
|
+
default:
|
|
514
|
+
throw new Error(`Unknown data type: ${t}`);
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
export const propertyKeyTypes: Set<string> = /* @__PURE__*/ new Set(["string", "number", "symbol"]);
|
|
519
|
+
export const primitiveTypes: Set<string> = /* @__PURE__*/ new Set([
|
|
520
|
+
"string",
|
|
521
|
+
"number",
|
|
522
|
+
"bigint",
|
|
523
|
+
"boolean",
|
|
524
|
+
"symbol",
|
|
525
|
+
"undefined",
|
|
526
|
+
]);
|
|
527
|
+
export function escapeRegex(str: string): string {
|
|
528
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// zod-specific utils
|
|
532
|
+
export function clone<T extends schemas.$ZodType>(inst: T, def?: T["_zod"]["def"], params?: { parent: boolean }): T {
|
|
533
|
+
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
534
|
+
if (!def || params?.parent) cl._zod.parent = inst;
|
|
535
|
+
return cl as any;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
export type EmptyToNever<T> = keyof T extends never ? never : T;
|
|
539
|
+
|
|
540
|
+
export type Normalize<T> = T extends undefined
|
|
541
|
+
? never
|
|
542
|
+
: T extends Record<any, any>
|
|
543
|
+
? Flatten<
|
|
544
|
+
{
|
|
545
|
+
[k in keyof Omit<T, "error" | "message">]: T[k];
|
|
546
|
+
} & ("error" extends keyof T
|
|
547
|
+
? {
|
|
548
|
+
error?: Exclude<T["error"], string>;
|
|
549
|
+
// path?: PropertyKey[] | undefined;
|
|
550
|
+
// message?: string | undefined;
|
|
551
|
+
}
|
|
552
|
+
: unknown)
|
|
553
|
+
>
|
|
554
|
+
: never;
|
|
555
|
+
|
|
556
|
+
export function normalizeParams<T>(_params: T): Normalize<T> {
|
|
557
|
+
const params: any = _params;
|
|
558
|
+
|
|
559
|
+
if (!params) return {} as any;
|
|
560
|
+
if (typeof params === "string") return { error: () => params } as any;
|
|
561
|
+
if (params?.message !== undefined) {
|
|
562
|
+
if (params?.error !== undefined) throw new Error("Cannot specify both `message` and `error` params");
|
|
563
|
+
params.error = params.message;
|
|
564
|
+
}
|
|
565
|
+
delete params.message;
|
|
566
|
+
if (typeof params.error === "string") return { ...params, error: () => params.error } as any;
|
|
567
|
+
return params;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export function createTransparentProxy<T extends object>(getter: () => T): T {
|
|
571
|
+
let target: T;
|
|
572
|
+
return new Proxy(
|
|
573
|
+
{},
|
|
574
|
+
{
|
|
575
|
+
get(_, prop, receiver) {
|
|
576
|
+
target ??= getter();
|
|
577
|
+
return Reflect.get(target, prop, receiver);
|
|
578
|
+
},
|
|
579
|
+
set(_, prop, value, receiver) {
|
|
580
|
+
target ??= getter();
|
|
581
|
+
return Reflect.set(target, prop, value, receiver);
|
|
582
|
+
},
|
|
583
|
+
has(_, prop) {
|
|
584
|
+
target ??= getter();
|
|
585
|
+
return Reflect.has(target, prop);
|
|
586
|
+
},
|
|
587
|
+
deleteProperty(_, prop) {
|
|
588
|
+
target ??= getter();
|
|
589
|
+
return Reflect.deleteProperty(target, prop);
|
|
590
|
+
},
|
|
591
|
+
ownKeys(_) {
|
|
592
|
+
target ??= getter();
|
|
593
|
+
return Reflect.ownKeys(target);
|
|
594
|
+
},
|
|
595
|
+
getOwnPropertyDescriptor(_, prop) {
|
|
596
|
+
target ??= getter();
|
|
597
|
+
return Reflect.getOwnPropertyDescriptor(target, prop);
|
|
598
|
+
},
|
|
599
|
+
defineProperty(_, prop, descriptor) {
|
|
600
|
+
target ??= getter();
|
|
601
|
+
return Reflect.defineProperty(target, prop, descriptor);
|
|
602
|
+
},
|
|
603
|
+
}
|
|
604
|
+
) as T;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
export function stringifyPrimitive(value: any): string {
|
|
608
|
+
if (typeof value === "bigint") return value.toString() + "n";
|
|
609
|
+
if (typeof value === "string") return `"${value}"`;
|
|
610
|
+
return `${value}`;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
export function optionalKeys(shape: schemas.$ZodShape): string[] {
|
|
614
|
+
return Object.keys(shape).filter((k) => {
|
|
615
|
+
return shape[k]!._zod.optin !== undefined && shape[k]!._zod.optout === "optional";
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
export type CleanKey<T extends PropertyKey> = T extends `?${infer K}` ? K : T extends `${infer K}?` ? K : T;
|
|
620
|
+
export type ToCleanMap<T extends schemas.$ZodLooseShape> = {
|
|
621
|
+
[k in keyof T]: k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k;
|
|
622
|
+
};
|
|
623
|
+
export type FromCleanMap<T extends schemas.$ZodLooseShape> = {
|
|
624
|
+
[k in keyof T as k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k]: k;
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
// Wrapped in a `@__PURE__` IIFE: esbuild never tree-shakes a top-level initializer that contains a member access on `Number`, so the bare object literal survived into every bundle.
|
|
628
|
+
export const NUMBER_FORMAT_RANGES: Record<checks.$ZodNumberFormats, [number, number]> = /*@__PURE__*/ (() => ({
|
|
629
|
+
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
|
|
630
|
+
int32: [-2147483648, 2147483647],
|
|
631
|
+
uint32: [0, 4294967295],
|
|
632
|
+
float32: [-3.4028234663852886e38, 3.4028234663852886e38],
|
|
633
|
+
float64: [-Number.MAX_VALUE, Number.MAX_VALUE],
|
|
634
|
+
}))();
|
|
635
|
+
|
|
636
|
+
export const BIGINT_FORMAT_RANGES: Record<checks.$ZodBigIntFormats, [bigint, bigint]> = {
|
|
637
|
+
int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
|
|
638
|
+
uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")],
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
export function pick(schema: schemas.$ZodObject, mask: Record<string, unknown>): any {
|
|
642
|
+
const currDef = schema._zod.def;
|
|
643
|
+
|
|
644
|
+
const checks = currDef.checks;
|
|
645
|
+
const hasChecks = checks && checks.length > 0;
|
|
646
|
+
if (hasChecks) {
|
|
647
|
+
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
const def = mergeDefs(schema._zod.def, {
|
|
651
|
+
get shape() {
|
|
652
|
+
const newShape: Writeable<schemas.$ZodShape> = {};
|
|
653
|
+
// `for...in` skips symbols, so a symbol in the mask would select nothing
|
|
654
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
655
|
+
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
656
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
657
|
+
}
|
|
658
|
+
if (!mask[key as string]) continue;
|
|
659
|
+
assignProp(newShape, key as string, (currDef.shape as any)[key]!);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
assignProp(this, "shape", newShape); // self-caching
|
|
663
|
+
return newShape;
|
|
664
|
+
},
|
|
665
|
+
checks: [],
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
return clone(schema, def) as any;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export function omit(schema: schemas.$ZodObject, mask: object): any {
|
|
672
|
+
const currDef = schema._zod.def;
|
|
673
|
+
|
|
674
|
+
const checks = currDef.checks;
|
|
675
|
+
const hasChecks = checks && checks.length > 0;
|
|
676
|
+
if (hasChecks) {
|
|
677
|
+
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
const def = mergeDefs(schema._zod.def, {
|
|
681
|
+
get shape() {
|
|
682
|
+
const newShape: Writeable<schemas.$ZodShape> = { ...schema._zod.def.shape };
|
|
683
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
684
|
+
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {
|
|
685
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
686
|
+
}
|
|
687
|
+
if (!(mask as any)[key]) continue;
|
|
688
|
+
|
|
689
|
+
delete newShape[key as string];
|
|
690
|
+
}
|
|
691
|
+
assignProp(this, "shape", newShape); // self-caching
|
|
692
|
+
return newShape;
|
|
693
|
+
},
|
|
694
|
+
checks: [],
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
return clone(schema, def);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
export function extend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any {
|
|
701
|
+
if (!isPlainObject(shape)) {
|
|
702
|
+
throw new Error("Invalid input to extend: expected a plain object");
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
const checks = schema._zod.def.checks;
|
|
706
|
+
const hasChecks = checks && checks.length > 0;
|
|
707
|
+
if (hasChecks) {
|
|
708
|
+
// Only throw if new shape overlaps with existing shape. Use getOwnPropertyDescriptor to check key existence without accessing values
|
|
709
|
+
const existingShape = schema._zod.def.shape;
|
|
710
|
+
for (const key of Reflect.ownKeys(shape)) {
|
|
711
|
+
if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
|
|
712
|
+
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
const def = mergeDefs(schema._zod.def, {
|
|
718
|
+
get shape() {
|
|
719
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
720
|
+
assignProp(this, "shape", _shape); // self-caching
|
|
721
|
+
return _shape;
|
|
722
|
+
},
|
|
723
|
+
});
|
|
724
|
+
return clone(schema, def) as any;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
export function safeExtend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any {
|
|
728
|
+
if (!isPlainObject(shape)) {
|
|
729
|
+
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
730
|
+
}
|
|
731
|
+
const def = mergeDefs(schema._zod.def, {
|
|
732
|
+
get shape() {
|
|
733
|
+
const _shape = { ...schema._zod.def.shape, ...shape };
|
|
734
|
+
assignProp(this, "shape", _shape); // self-caching
|
|
735
|
+
return _shape;
|
|
736
|
+
},
|
|
737
|
+
});
|
|
738
|
+
return clone(schema, def) as any;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export function merge(a: schemas.$ZodObject, b: schemas.$ZodObject): any {
|
|
742
|
+
if (!b?._zod?.def) {
|
|
743
|
+
throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
|
|
744
|
+
}
|
|
745
|
+
if (a._zod.def.checks?.length) {
|
|
746
|
+
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
747
|
+
}
|
|
748
|
+
const def = mergeDefs(a._zod.def, {
|
|
749
|
+
get shape() {
|
|
750
|
+
const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
|
|
751
|
+
assignProp(this, "shape", _shape); // self-caching
|
|
752
|
+
return _shape;
|
|
753
|
+
},
|
|
754
|
+
get catchall() {
|
|
755
|
+
return b._zod.def.catchall;
|
|
756
|
+
},
|
|
757
|
+
checks: b._zod.def.checks ?? [],
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
return clone(a, def) as any;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
export function partial(
|
|
764
|
+
Class: SchemaClass<schemas.$ZodOptional> | null,
|
|
765
|
+
schema: schemas.$ZodObject,
|
|
766
|
+
mask: object | undefined,
|
|
767
|
+
name = "partial"
|
|
768
|
+
): any {
|
|
769
|
+
const currDef = schema._zod.def;
|
|
770
|
+
const checks = currDef.checks;
|
|
771
|
+
const hasChecks = checks && checks.length > 0;
|
|
772
|
+
if (hasChecks) {
|
|
773
|
+
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
const def = mergeDefs(schema._zod.def, {
|
|
777
|
+
get shape() {
|
|
778
|
+
const oldShape = schema._zod.def.shape;
|
|
779
|
+
const shape: Writeable<schemas.$ZodShape> = { ...oldShape };
|
|
780
|
+
|
|
781
|
+
if (mask) {
|
|
782
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
783
|
+
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {
|
|
784
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
785
|
+
}
|
|
786
|
+
if (!(mask as any)[key]) continue;
|
|
787
|
+
// if (oldShape[key]!._zod.optin === "optional") continue;
|
|
788
|
+
(shape as any)[key] = Class
|
|
789
|
+
? new Class({
|
|
790
|
+
type: "optional",
|
|
791
|
+
innerType: (oldShape as any)[key]!,
|
|
792
|
+
})
|
|
793
|
+
: (oldShape as any)[key]!;
|
|
794
|
+
}
|
|
795
|
+
} else {
|
|
796
|
+
// the spread copies symbol keys; `for...in` would not reach them
|
|
797
|
+
for (const key of Reflect.ownKeys(oldShape)) {
|
|
798
|
+
// if (oldShape[key]!._zod.optin === "optional") continue;
|
|
799
|
+
(shape as any)[key] = Class
|
|
800
|
+
? new Class({
|
|
801
|
+
type: "optional",
|
|
802
|
+
innerType: (oldShape as any)[key]!,
|
|
803
|
+
})
|
|
804
|
+
: (oldShape as any)[key]!;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
assignProp(this, "shape", shape); // self-caching
|
|
809
|
+
return shape;
|
|
810
|
+
},
|
|
811
|
+
checks: [],
|
|
812
|
+
});
|
|
813
|
+
|
|
814
|
+
return clone(schema, def) as any;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
export function required(
|
|
818
|
+
Class: SchemaClass<schemas.$ZodNonOptional>,
|
|
819
|
+
schema: schemas.$ZodObject,
|
|
820
|
+
mask: object | undefined
|
|
821
|
+
): any {
|
|
822
|
+
const def = mergeDefs(schema._zod.def, {
|
|
823
|
+
get shape() {
|
|
824
|
+
const oldShape = schema._zod.def.shape;
|
|
825
|
+
const shape: Writeable<schemas.$ZodShape> = { ...oldShape };
|
|
826
|
+
|
|
827
|
+
if (mask) {
|
|
828
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
829
|
+
if (!Object.prototype.hasOwnProperty.call(shape, key)) {
|
|
830
|
+
throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
831
|
+
}
|
|
832
|
+
if (!(mask as any)[key]) continue;
|
|
833
|
+
// overwrite with non-optional
|
|
834
|
+
(shape as any)[key] = new Class({
|
|
835
|
+
type: "nonoptional",
|
|
836
|
+
innerType: (oldShape as any)[key]!,
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
} else {
|
|
840
|
+
for (const key of Reflect.ownKeys(oldShape)) {
|
|
841
|
+
// overwrite with non-optional
|
|
842
|
+
(shape as any)[key] = new Class({
|
|
843
|
+
type: "nonoptional",
|
|
844
|
+
innerType: (oldShape as any)[key]!,
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
assignProp(this, "shape", shape); // self-caching
|
|
850
|
+
return shape;
|
|
851
|
+
},
|
|
852
|
+
});
|
|
853
|
+
|
|
854
|
+
return clone(schema, def) as any;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
export type Constructor<T, Def extends any[] = any[]> = new (...args: Def) => T;
|
|
858
|
+
|
|
859
|
+
// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom
|
|
860
|
+
export function aborted(x: schemas.ParsePayload, startIndex = 0): boolean {
|
|
861
|
+
if (x.aborted === true) return true;
|
|
862
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
863
|
+
if (x.issues[i]?.continue !== true) {
|
|
864
|
+
return true;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
return false;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
// Checks for explicit abort (continue === false), as opposed to implicit abort (continue === undefined). Used to respect `abort: true` in .refine() even for checks that have a `when` function.
|
|
871
|
+
export function explicitlyAborted(x: schemas.ParsePayload, startIndex = 0): boolean {
|
|
872
|
+
if (x.aborted === true) return true;
|
|
873
|
+
for (let i = startIndex; i < x.issues.length; i++) {
|
|
874
|
+
if (x.issues[i]?.continue === false) {
|
|
875
|
+
return true;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
return false;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
export function prefixIssues(path: PropertyKey, issues: errors.$ZodRawIssue[]): errors.$ZodRawIssue[] {
|
|
882
|
+
return issues.map((iss) => {
|
|
883
|
+
(iss as any).path ??= [];
|
|
884
|
+
(iss as any).path.unshift(path);
|
|
885
|
+
return iss;
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
export function unwrapMessage(message: string | { message: string } | undefined | null): string | undefined {
|
|
890
|
+
return typeof message === "string" ? message : message?.message;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/* A check holds no link back to the schema it is attached to — the same check instance is shared by every clone of that schema — so the owner is stamped onto the issues a check just raised, at the only point where both are in scope. Runs on the failure path only; `start` is the issue count from before the check ran. */
|
|
894
|
+
export function attachSchema(issues: errors.$ZodRawIssue[], start: number, inst: schemas.$ZodType): void {
|
|
895
|
+
for (let i = start; i < issues.length; i++) {
|
|
896
|
+
(issues[i] as any).schema ??= inst;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
export function finalizeIssue(
|
|
901
|
+
iss: errors.$ZodRawIssue,
|
|
902
|
+
ctx: schemas.ParseContextInternal | undefined,
|
|
903
|
+
config: $ZodConfig
|
|
904
|
+
): errors.$ZodIssue {
|
|
905
|
+
// A schema that raised an issue itself owns it outright, and outranks any stamp an enclosing check left in `attachSchema`. String formats and z.custom() are schema and check at once, so when they act as a check they defer to that stamp instead.
|
|
906
|
+
const traits: Set<string> | undefined = (iss.inst as any)?._zod?.traits;
|
|
907
|
+
if (traits?.has("$ZodType")) {
|
|
908
|
+
if (traits.has("$ZodCheck")) (iss as any).schema ??= iss.inst;
|
|
909
|
+
else (iss as any).schema = iss.inst;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
// Decreasing specificity, first map to return a message wins. `inst` is whatever raised the issue, so a check's own map outranks the owning schema's.
|
|
913
|
+
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
|
|
914
|
+
const message = iss.message
|
|
915
|
+
? iss.message
|
|
916
|
+
: (unwrapMessage(iss.inst?._zod.def?.error?.(iss as never)) ??
|
|
917
|
+
unwrapMessage(schemaError?.(iss as never)) ??
|
|
918
|
+
unwrapMessage(ctx?.error?.(iss as never)) ??
|
|
919
|
+
unwrapMessage(config.customError?.(iss)) ??
|
|
920
|
+
unwrapMessage(config.localeError?.(iss)) ??
|
|
921
|
+
"Invalid input");
|
|
922
|
+
|
|
923
|
+
const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss as any;
|
|
924
|
+
rest.path ??= [];
|
|
925
|
+
rest.message = message;
|
|
926
|
+
if (ctx?.reportInput) {
|
|
927
|
+
rest.input = _input;
|
|
928
|
+
}
|
|
929
|
+
return rest;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
export function getSizableOrigin(input: any): "set" | "map" | "file" | "unknown" {
|
|
933
|
+
if (input instanceof Set) return "set";
|
|
934
|
+
if (input instanceof Map) return "map";
|
|
935
|
+
// @ts-ignore
|
|
936
|
+
if (input instanceof File) return "file";
|
|
937
|
+
return "unknown";
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
const highSurrogate = /[\uD800-\uDBFF]/;
|
|
941
|
+
|
|
942
|
+
// Code points in `str`: a surrogate pair counts once, a lone surrogate as itself. Hand-rolled because the string iterator allocates and runs ~250x slower on this path; the regex probe exits ~50x quicker for a string with no astral characters.
|
|
943
|
+
export function codePointLength(str: string): number {
|
|
944
|
+
const units = str.length;
|
|
945
|
+
if (!highSurrogate.test(str)) return units;
|
|
946
|
+
let count = units;
|
|
947
|
+
for (let i = 0; i < units - 1; i++) {
|
|
948
|
+
if ((str.charCodeAt(i) & 0xfc00) === 0xd800 && (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
|
|
949
|
+
count--;
|
|
950
|
+
i++;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
return count;
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
export function getLengthableOrigin(input: any): "array" | "string" | "unknown" {
|
|
957
|
+
if (Array.isArray(input)) return "array";
|
|
958
|
+
if (typeof input === "string") return "string";
|
|
959
|
+
return "unknown";
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
export function parsedType(data: unknown): errors.$ZodInvalidTypeExpected {
|
|
963
|
+
const t = typeof data;
|
|
964
|
+
switch (t) {
|
|
965
|
+
case "number": {
|
|
966
|
+
return Number.isNaN(data) ? "nan" : "number";
|
|
967
|
+
}
|
|
968
|
+
case "object": {
|
|
969
|
+
if (data === null) {
|
|
970
|
+
return "null";
|
|
971
|
+
}
|
|
972
|
+
if (Array.isArray(data)) {
|
|
973
|
+
return "array";
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
const obj = data as object;
|
|
977
|
+
if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
|
|
978
|
+
return (obj.constructor as { name: string }).name;
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
return t;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
////////// REFINES //////////
|
|
986
|
+
export function issue(_iss: string, input: any, inst: any): errors.$ZodRawIssue;
|
|
987
|
+
export function issue(_iss: errors.$ZodRawIssue): errors.$ZodRawIssue;
|
|
988
|
+
export function issue(...args: [string | errors.$ZodRawIssue, any?, any?]): errors.$ZodRawIssue {
|
|
989
|
+
const [iss, input, inst] = args;
|
|
990
|
+
if (typeof iss === "string") {
|
|
991
|
+
return {
|
|
992
|
+
message: iss,
|
|
993
|
+
code: "custom",
|
|
994
|
+
input,
|
|
995
|
+
inst,
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
return { ...iss };
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
export function cleanEnum(obj: Record<string, EnumValue>): EnumValue[] {
|
|
1003
|
+
return Object.entries(obj)
|
|
1004
|
+
.filter(([k, _]) => {
|
|
1005
|
+
// return true if NaN, meaning it's not a number, thus a string key
|
|
1006
|
+
return Number.isNaN(Number.parseInt(k, 10));
|
|
1007
|
+
})
|
|
1008
|
+
.map((el) => el[1]);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
// Codec utility functions
|
|
1012
|
+
export function base64ToUint8Array(base64: string): InstanceType<typeof Uint8Array> {
|
|
1013
|
+
const binaryString = atob(base64);
|
|
1014
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
1015
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
1016
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
1017
|
+
}
|
|
1018
|
+
return bytes;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
export function uint8ArrayToBase64(bytes: Uint8Array): string {
|
|
1022
|
+
let binaryString = "";
|
|
1023
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
1024
|
+
binaryString += String.fromCharCode(bytes[i]);
|
|
1025
|
+
}
|
|
1026
|
+
return btoa(binaryString);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
export function base64urlToUint8Array(base64url: string): InstanceType<typeof Uint8Array> {
|
|
1030
|
+
const base64 = base64url.replace(/-/g, "+").replace(/_/g, "/");
|
|
1031
|
+
const padding = "=".repeat((4 - (base64.length % 4)) % 4);
|
|
1032
|
+
return base64ToUint8Array(base64 + padding);
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
export function uint8ArrayToBase64url(bytes: Uint8Array): string {
|
|
1036
|
+
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
export function hexToUint8Array(hex: string): InstanceType<typeof Uint8Array> {
|
|
1040
|
+
const cleanHex = hex.replace(/^0x/, "");
|
|
1041
|
+
if (cleanHex.length % 2 !== 0) {
|
|
1042
|
+
throw new Error("Invalid hex string length");
|
|
1043
|
+
}
|
|
1044
|
+
const bytes = new Uint8Array(cleanHex.length / 2);
|
|
1045
|
+
for (let i = 0; i < cleanHex.length; i += 2) {
|
|
1046
|
+
bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
|
|
1047
|
+
}
|
|
1048
|
+
return bytes;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
export function uint8ArrayToHex(bytes: Uint8Array): string {
|
|
1052
|
+
return Array.from(bytes)
|
|
1053
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
|
1054
|
+
.join("");
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
// instanceof
|
|
1058
|
+
export abstract class Class {
|
|
1059
|
+
constructor(..._args: any[]) {}
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
////////// PROTOTYPE INSTALLERS //////////
|
|
1063
|
+
//
|
|
1064
|
+
// Members live on the prototype and materialize per instance on first read, which keeps own-property count under the step where V8 stops using inline slots. Changing anything here means re-measuring runtime, memory and bundle size together — see "The three axes" in AGENTS.md.
|
|
1065
|
+
|
|
1066
|
+
/**
|
|
1067
|
+
* Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.
|
|
1068
|
+
*
|
|
1069
|
+
* Call this from a `proto` initializer, which runs once per prototype — never per instance.
|
|
1070
|
+
*/
|
|
1071
|
+
export function members(proto: object, table: object): void {
|
|
1072
|
+
for (const key in table) {
|
|
1073
|
+
const desc = Object.getOwnPropertyDescriptor(table, key)!;
|
|
1074
|
+
// a getter installs as written, so it stays live: `description` reads through to the registry on every access. not enumerable: an object literal's is, and a prototype member never was
|
|
1075
|
+
if (desc.get) Object.defineProperty(proto, key, { ...desc, enumerable: false });
|
|
1076
|
+
// a method materializes bound on first read, which is what keeps a detached member working: `const opt = schema.optional; opt()`
|
|
1077
|
+
else defineBound(proto, key, desc.value);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
|
|
1082
|
+
export function own<T>(inst: object, key: string, value: T, enumerable = true): T {
|
|
1083
|
+
Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
|
|
1084
|
+
return value;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
|
|
1088
|
+
export function hide<T>(inst: object, key: string, value: T): T {
|
|
1089
|
+
return own(inst, key, value, false);
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
function defineBound(proto: object, key: string, fn: AnyFunc): void {
|
|
1093
|
+
Object.defineProperty(proto, key, {
|
|
1094
|
+
configurable: true,
|
|
1095
|
+
get(this: any) {
|
|
1096
|
+
// vitest's spyOn calls a prototype getter bare to find the function it wraps, so a nullish receiver answers the raw method
|
|
1097
|
+
return this == null ? fn : own(this, key, fn.bind(this));
|
|
1098
|
+
},
|
|
1099
|
+
set(this: any, value: unknown) {
|
|
1100
|
+
own(this, key, value);
|
|
1101
|
+
},
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/** Returns the prototype to install on, or `undefined` if this group is already installed on it. */
|
|
1106
|
+
function claim(inst: object, sentinel: string): object | undefined {
|
|
1107
|
+
const proto = Object.getPrototypeOf(inst);
|
|
1108
|
+
// Runs on every construction, so `in` rather than the costlier `hasOwnProperty.call`. Sentinels are keys the group itself defines.
|
|
1109
|
+
return sentinel in proto ? undefined : proto;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
/** A trait's prototype members: a partial view of its own interface, with `this` typed as the instance. */
|
|
1113
|
+
export type ProtoOf<T> = {
|
|
1114
|
+
// `infer R` resolves a polymorphic `this` return type to `T`, which a method written here can actually produce
|
|
1115
|
+
[K in keyof T]?: (T[K] extends (...args: infer A) => infer R ? (...args: A) => R : T[K]) | undefined;
|
|
1116
|
+
} & ThisType<T>;
|
|
1117
|
+
|
|
1118
|
+
// The internals whose init chain is installing. A second call for the same one is a derived constructor overriding its base, so it must not construct another schema in between or the override is dropped.
|
|
1119
|
+
let installing: object | undefined;
|
|
1120
|
+
|
|
1121
|
+
// Set while a getter is running, so a value that resolved through a recursion break is not memoized. One shared descriptor shadows the key for the duration, which costs no per-key allocation.
|
|
1122
|
+
let broke = false;
|
|
1123
|
+
const breaker: PropertyDescriptor = {
|
|
1124
|
+
configurable: true,
|
|
1125
|
+
get() {
|
|
1126
|
+
broke = true;
|
|
1127
|
+
return undefined;
|
|
1128
|
+
},
|
|
1129
|
+
};
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Installs a lazily-derived internal on the `_zod` prototype of `inst`'s
|
|
1133
|
+
* constructor, computed from the internals object itself and cached there on
|
|
1134
|
+
* first read. One accessor per constructor rather than one per instance.
|
|
1135
|
+
*/
|
|
1136
|
+
export function defineLazyInternal<T extends { _zod: any }>(
|
|
1137
|
+
inst: T,
|
|
1138
|
+
key: string,
|
|
1139
|
+
compute: (zod: T["_zod"]) => unknown
|
|
1140
|
+
): void {
|
|
1141
|
+
const proto = Object.getPrototypeOf(inst._zod);
|
|
1142
|
+
if (key in proto && installing !== inst._zod) {
|
|
1143
|
+
// A repeat construction: everything is installed already. Cleared here so the reference is not held past the first construction of every type.
|
|
1144
|
+
installing = undefined;
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
installing = inst._zod;
|
|
1148
|
+
|
|
1149
|
+
Object.defineProperty(proto, key, {
|
|
1150
|
+
configurable: true,
|
|
1151
|
+
get(this: any) {
|
|
1152
|
+
// Shadowed before computing so a re-entrant read from a recursive schema resolves to undefined instead of running the getter again.
|
|
1153
|
+
Object.defineProperty(this, key, breaker);
|
|
1154
|
+
const outer = broke;
|
|
1155
|
+
broke = false;
|
|
1156
|
+
try {
|
|
1157
|
+
const value = compute(this);
|
|
1158
|
+
// A result that resolved through a recursion break is recomputed once the graph is complete; everything else memoizes, undefined included.
|
|
1159
|
+
if (broke) delete this[key];
|
|
1160
|
+
else Object.defineProperty(this, key, { configurable: true, writable: true, value });
|
|
1161
|
+
broke = broke || outer;
|
|
1162
|
+
return value;
|
|
1163
|
+
} catch (err) {
|
|
1164
|
+
// A compute that threw memoizes nothing, so a later read runs it again and fails the same way. The shadow goes with it, since leaving it installed would answer undefined for every later read.
|
|
1165
|
+
delete this[key];
|
|
1166
|
+
broke = broke || outer;
|
|
1167
|
+
throw err;
|
|
1168
|
+
}
|
|
1169
|
+
},
|
|
1170
|
+
set(this: any, value: unknown) {
|
|
1171
|
+
Object.defineProperty(this, key, { configurable: true, writable: true, value });
|
|
1172
|
+
},
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
/**
|
|
1177
|
+
* Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own
|
|
1178
|
+
* data property. One accessor per constructor rather than one per instance, because an own accessor
|
|
1179
|
+
* puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.
|
|
1180
|
+
*/
|
|
1181
|
+
export function installLazyProp(inst: object, key: string, make: (self: any) => unknown, enumerable: boolean): void {
|
|
1182
|
+
const proto = claim(inst, key);
|
|
1183
|
+
if (!proto) return;
|
|
1184
|
+
Object.defineProperty(proto, key, {
|
|
1185
|
+
configurable: true,
|
|
1186
|
+
get(this: any) {
|
|
1187
|
+
// Shadowed before computing, so a re-entrant read from a self-referential shape resolves to undefined instead of running the getter again. A data property rather than an accessor: an own accessor is the dictionary-mode transition this exists to avoid.
|
|
1188
|
+
const desc = { configurable: true, writable: true, enumerable, value: undefined as unknown };
|
|
1189
|
+
Object.defineProperty(this, key, desc);
|
|
1190
|
+
// a compute that throws leaves the shadow behind, so later reads answer undefined instead of re-throwing; `defineLazy` did the same, and `defineLazyInternal`'s delete-on-catch would cost bytes in every bundle for a case only a throwing user getter reaches
|
|
1191
|
+
desc.value = make(this);
|
|
1192
|
+
Object.defineProperty(this, key, desc);
|
|
1193
|
+
return desc.value;
|
|
1194
|
+
},
|
|
1195
|
+
set(this: any, value: unknown) {
|
|
1196
|
+
Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });
|
|
1197
|
+
},
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
/** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */
|
|
1202
|
+
export const CONSTANT_CATCH = "~constantCatch";
|
|
1203
|
+
|
|
1204
|
+
/** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */
|
|
1205
|
+
export function constantCatch<T>(value: T): () => T {
|
|
1206
|
+
const fn = () => value;
|
|
1207
|
+
(fn as { [CONSTANT_CATCH]?: boolean })[CONSTANT_CATCH] = true;
|
|
1208
|
+
return fn;
|
|
1209
|
+
}
|