@azx-pbc/axiom-runtime 0.0.0-stage → 0.0.5
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/LICENSE +21 -0
- package/README.md +714 -2
- package/dist/cache/index.d.ts +191 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +361 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/canonical/jcs.d.ts +78 -0
- package/dist/canonical/jcs.d.ts.map +1 -0
- package/dist/canonical/jcs.js +500 -0
- package/dist/canonical/jcs.js.map +1 -0
- package/dist/canonical/restricted-json.d.ts +7 -0
- package/dist/canonical/restricted-json.d.ts.map +1 -0
- package/dist/canonical/restricted-json.js +318 -0
- package/dist/canonical/restricted-json.js.map +1 -0
- package/dist/canonical/restricted-value.d.ts +59 -0
- package/dist/canonical/restricted-value.d.ts.map +1 -0
- package/dist/canonical/restricted-value.js +156 -0
- package/dist/canonical/restricted-value.js.map +1 -0
- package/dist/canonical/restricted.d.ts +85 -0
- package/dist/canonical/restricted.d.ts.map +1 -0
- package/dist/canonical/restricted.js +163 -0
- package/dist/canonical/restricted.js.map +1 -0
- package/dist/canonical/signature.d.ts +38 -0
- package/dist/canonical/signature.d.ts.map +1 -0
- package/dist/canonical/signature.js +47 -0
- package/dist/canonical/signature.js.map +1 -0
- package/dist/eval/access/delivery.d.ts +63 -0
- package/dist/eval/access/delivery.d.ts.map +1 -0
- package/dist/eval/access/delivery.js +98 -0
- package/dist/eval/access/delivery.js.map +1 -0
- package/dist/eval/access/overlay.d.ts +72 -0
- package/dist/eval/access/overlay.d.ts.map +1 -0
- package/dist/eval/access/overlay.js +402 -0
- package/dist/eval/access/overlay.js.map +1 -0
- package/dist/eval/access/projection.d.ts +159 -0
- package/dist/eval/access/projection.d.ts.map +1 -0
- package/dist/eval/access/projection.js +211 -0
- package/dist/eval/access/projection.js.map +1 -0
- package/dist/eval/access/window.d.ts +128 -0
- package/dist/eval/access/window.d.ts.map +1 -0
- package/dist/eval/access/window.js +254 -0
- package/dist/eval/access/window.js.map +1 -0
- package/dist/eval/access/write.d.ts +113 -0
- package/dist/eval/access/write.d.ts.map +1 -0
- package/dist/eval/access/write.js +119 -0
- package/dist/eval/access/write.js.map +1 -0
- package/dist/eval/addressing.d.ts +131 -0
- package/dist/eval/addressing.d.ts.map +1 -0
- package/dist/eval/addressing.js +270 -0
- package/dist/eval/addressing.js.map +1 -0
- package/dist/eval/budget.d.ts +143 -0
- package/dist/eval/budget.d.ts.map +1 -0
- package/dist/eval/budget.js +387 -0
- package/dist/eval/budget.js.map +1 -0
- package/dist/eval/computed.d.ts +46 -0
- package/dist/eval/computed.d.ts.map +1 -0
- package/dist/eval/computed.js +89 -0
- package/dist/eval/computed.js.map +1 -0
- package/dist/eval/denials.d.ts +64 -0
- package/dist/eval/denials.d.ts.map +1 -0
- package/dist/eval/denials.js +87 -0
- package/dist/eval/denials.js.map +1 -0
- package/dist/eval/engine/cancellation.d.ts +12 -0
- package/dist/eval/engine/cancellation.d.ts.map +1 -0
- package/dist/eval/engine/cancellation.js +56 -0
- package/dist/eval/engine/cancellation.js.map +1 -0
- package/dist/eval/engine/delta.d.ts +104 -0
- package/dist/eval/engine/delta.d.ts.map +1 -0
- package/dist/eval/engine/delta.js +466 -0
- package/dist/eval/engine/delta.js.map +1 -0
- package/dist/eval/engine/deps.d.ts +136 -0
- package/dist/eval/engine/deps.d.ts.map +1 -0
- package/dist/eval/engine/deps.js +345 -0
- package/dist/eval/engine/deps.js.map +1 -0
- package/dist/eval/engine/identity.d.ts +128 -0
- package/dist/eval/engine/identity.d.ts.map +1 -0
- package/dist/eval/engine/identity.js +398 -0
- package/dist/eval/engine/identity.js.map +1 -0
- package/dist/eval/engine/index.d.ts +200 -0
- package/dist/eval/engine/index.d.ts.map +1 -0
- package/dist/eval/engine/index.js +1242 -0
- package/dist/eval/engine/index.js.map +1 -0
- package/dist/eval/engine/measurement.d.ts +23 -0
- package/dist/eval/engine/measurement.d.ts.map +1 -0
- package/dist/eval/engine/measurement.js +42 -0
- package/dist/eval/engine/measurement.js.map +1 -0
- package/dist/eval/engine/naive.d.ts +19 -0
- package/dist/eval/engine/naive.d.ts.map +1 -0
- package/dist/eval/engine/naive.js +59 -0
- package/dist/eval/engine/naive.js.map +1 -0
- package/dist/eval/engine/ops.d.ts +214 -0
- package/dist/eval/engine/ops.d.ts.map +1 -0
- package/dist/eval/engine/ops.js +1422 -0
- package/dist/eval/engine/ops.js.map +1 -0
- package/dist/eval/engine/patches.d.ts +40 -0
- package/dist/eval/engine/patches.d.ts.map +1 -0
- package/dist/eval/engine/patches.js +125 -0
- package/dist/eval/engine/patches.js.map +1 -0
- package/dist/eval/engine/ports.d.ts +71 -0
- package/dist/eval/engine/ports.d.ts.map +1 -0
- package/dist/eval/engine/ports.js +2 -0
- package/dist/eval/engine/ports.js.map +1 -0
- package/dist/eval/engine/session.d.ts +116 -0
- package/dist/eval/engine/session.d.ts.map +1 -0
- package/dist/eval/engine/session.js +653 -0
- package/dist/eval/engine/session.js.map +1 -0
- package/dist/eval/engine/snapshot.d.ts +97 -0
- package/dist/eval/engine/snapshot.d.ts.map +1 -0
- package/dist/eval/engine/snapshot.js +221 -0
- package/dist/eval/engine/snapshot.js.map +1 -0
- package/dist/eval/engine/subscriptions.d.ts +47 -0
- package/dist/eval/engine/subscriptions.d.ts.map +1 -0
- package/dist/eval/engine/subscriptions.js +103 -0
- package/dist/eval/engine/subscriptions.js.map +1 -0
- package/dist/eval/engine/trace.d.ts +77 -0
- package/dist/eval/engine/trace.d.ts.map +1 -0
- package/dist/eval/engine/trace.js +140 -0
- package/dist/eval/engine/trace.js.map +1 -0
- package/dist/eval/error-diagnostic.d.ts +26 -0
- package/dist/eval/error-diagnostic.d.ts.map +1 -0
- package/dist/eval/error-diagnostic.js +63 -0
- package/dist/eval/error-diagnostic.js.map +1 -0
- package/dist/eval/evaluate-expr.d.ts +44 -0
- package/dist/eval/evaluate-expr.d.ts.map +1 -0
- package/dist/eval/evaluate-expr.js +149 -0
- package/dist/eval/evaluate-expr.js.map +1 -0
- package/dist/eval/evaluate.d.ts +282 -0
- package/dist/eval/evaluate.d.ts.map +1 -0
- package/dist/eval/evaluate.js +391 -0
- package/dist/eval/evaluate.js.map +1 -0
- package/dist/eval/evolution/relocate.d.ts +72 -0
- package/dist/eval/evolution/relocate.d.ts.map +1 -0
- package/dist/eval/evolution/relocate.js +427 -0
- package/dist/eval/evolution/relocate.js.map +1 -0
- package/dist/eval/evolution/select.d.ts +11 -0
- package/dist/eval/evolution/select.d.ts.map +1 -0
- package/dist/eval/evolution/select.js +53 -0
- package/dist/eval/evolution/select.js.map +1 -0
- package/dist/eval/evolution/upcast.d.ts +13 -0
- package/dist/eval/evolution/upcast.d.ts.map +1 -0
- package/dist/eval/evolution/upcast.js +88 -0
- package/dist/eval/evolution/upcast.js.map +1 -0
- package/dist/eval/expr/aggregates.d.ts +75 -0
- package/dist/eval/expr/aggregates.d.ts.map +1 -0
- package/dist/eval/expr/aggregates.js +991 -0
- package/dist/eval/expr/aggregates.js.map +1 -0
- package/dist/eval/expr/arithmetic.d.ts +26 -0
- package/dist/eval/expr/arithmetic.d.ts.map +1 -0
- package/dist/eval/expr/arithmetic.js +387 -0
- package/dist/eval/expr/arithmetic.js.map +1 -0
- package/dist/eval/expr/between.d.ts +17 -0
- package/dist/eval/expr/between.d.ts.map +1 -0
- package/dist/eval/expr/between.js +46 -0
- package/dist/eval/expr/between.js.map +1 -0
- package/dist/eval/expr/binder.d.ts +96 -0
- package/dist/eval/expr/binder.d.ts.map +1 -0
- package/dist/eval/expr/binder.js +253 -0
- package/dist/eval/expr/binder.js.map +1 -0
- package/dist/eval/expr/call-dispatch.d.ts +28 -0
- package/dist/eval/expr/call-dispatch.d.ts.map +1 -0
- package/dist/eval/expr/call-dispatch.js +114 -0
- package/dist/eval/expr/call-dispatch.js.map +1 -0
- package/dist/eval/expr/collections.d.ts +20 -0
- package/dist/eval/expr/collections.d.ts.map +1 -0
- package/dist/eval/expr/collections.js +66 -0
- package/dist/eval/expr/collections.js.map +1 -0
- package/dist/eval/expr/compare.d.ts +36 -0
- package/dist/eval/expr/compare.d.ts.map +1 -0
- package/dist/eval/expr/compare.js +115 -0
- package/dist/eval/expr/compare.js.map +1 -0
- package/dist/eval/expr/datasets.d.ts +28 -0
- package/dist/eval/expr/datasets.d.ts.map +1 -0
- package/dist/eval/expr/datasets.js +304 -0
- package/dist/eval/expr/datasets.js.map +1 -0
- package/dist/eval/expr/digest.d.ts +23 -0
- package/dist/eval/expr/digest.d.ts.map +1 -0
- package/dist/eval/expr/digest.js +89 -0
- package/dist/eval/expr/digest.js.map +1 -0
- package/dist/eval/expr/domains.d.ts +19 -0
- package/dist/eval/expr/domains.d.ts.map +1 -0
- package/dist/eval/expr/domains.js +18 -0
- package/dist/eval/expr/domains.js.map +1 -0
- package/dist/eval/expr/host.d.ts +152 -0
- package/dist/eval/expr/host.d.ts.map +1 -0
- package/dist/eval/expr/host.js +36 -0
- package/dist/eval/expr/host.js.map +1 -0
- package/dist/eval/expr/lists.d.ts +24 -0
- package/dist/eval/expr/lists.d.ts.map +1 -0
- package/dist/eval/expr/lists.js +155 -0
- package/dist/eval/expr/lists.js.map +1 -0
- package/dist/eval/expr/member.d.ts +15 -0
- package/dist/eval/expr/member.d.ts.map +1 -0
- package/dist/eval/expr/member.js +32 -0
- package/dist/eval/expr/member.js.map +1 -0
- package/dist/eval/expr/money-ops.d.ts +10 -0
- package/dist/eval/expr/money-ops.d.ts.map +1 -0
- package/dist/eval/expr/money-ops.js +17 -0
- package/dist/eval/expr/money-ops.js.map +1 -0
- package/dist/eval/expr/operands.d.ts +27 -0
- package/dist/eval/expr/operands.d.ts.map +1 -0
- package/dist/eval/expr/operands.js +167 -0
- package/dist/eval/expr/operands.js.map +1 -0
- package/dist/eval/expr/presence.d.ts +27 -0
- package/dist/eval/expr/presence.d.ts.map +1 -0
- package/dist/eval/expr/presence.js +140 -0
- package/dist/eval/expr/presence.js.map +1 -0
- package/dist/eval/expr/records.d.ts +22 -0
- package/dist/eval/expr/records.d.ts.map +1 -0
- package/dist/eval/expr/records.js +101 -0
- package/dist/eval/expr/records.js.map +1 -0
- package/dist/eval/expr/rule-refs.d.ts +25 -0
- package/dist/eval/expr/rule-refs.d.ts.map +1 -0
- package/dist/eval/expr/rule-refs.js +60 -0
- package/dist/eval/expr/rule-refs.js.map +1 -0
- package/dist/eval/expr/sequences.d.ts +26 -0
- package/dist/eval/expr/sequences.d.ts.map +1 -0
- package/dist/eval/expr/sequences.js +151 -0
- package/dist/eval/expr/sequences.js.map +1 -0
- package/dist/eval/expr/value.d.ts +99 -0
- package/dist/eval/expr/value.d.ts.map +1 -0
- package/dist/eval/expr/value.js +14 -0
- package/dist/eval/expr/value.js.map +1 -0
- package/dist/eval/expression.d.ts +142 -0
- package/dist/eval/expression.d.ts.map +1 -0
- package/dist/eval/expression.js +446 -0
- package/dist/eval/expression.js.map +1 -0
- package/dist/eval/firing.d.ts +68 -0
- package/dist/eval/firing.d.ts.map +1 -0
- package/dist/eval/firing.js +222 -0
- package/dist/eval/firing.js.map +1 -0
- package/dist/eval/gate.d.ts +110 -0
- package/dist/eval/gate.d.ts.map +1 -0
- package/dist/eval/gate.js +278 -0
- package/dist/eval/gate.js.map +1 -0
- package/dist/eval/layout-visibility.d.ts +18 -0
- package/dist/eval/layout-visibility.d.ts.map +1 -0
- package/dist/eval/layout-visibility.js +61 -0
- package/dist/eval/layout-visibility.js.map +1 -0
- package/dist/eval/option-availability.d.ts +26 -0
- package/dist/eval/option-availability.d.ts.map +1 -0
- package/dist/eval/option-availability.js +580 -0
- package/dist/eval/option-availability.js.map +1 -0
- package/dist/eval/options-boundary.d.ts +15 -0
- package/dist/eval/options-boundary.d.ts.map +1 -0
- package/dist/eval/options-boundary.js +40 -0
- package/dist/eval/options-boundary.js.map +1 -0
- package/dist/eval/options.d.ts +99 -0
- package/dist/eval/options.d.ts.map +1 -0
- package/dist/eval/options.js +96 -0
- package/dist/eval/options.js.map +1 -0
- package/dist/eval/overrides.d.ts +116 -0
- package/dist/eval/overrides.d.ts.map +1 -0
- package/dist/eval/overrides.js +176 -0
- package/dist/eval/overrides.js.map +1 -0
- package/dist/eval/paths.d.ts +25 -0
- package/dist/eval/paths.d.ts.map +1 -0
- package/dist/eval/paths.js +47 -0
- package/dist/eval/paths.js.map +1 -0
- package/dist/eval/presentation-reads.d.ts +20 -0
- package/dist/eval/presentation-reads.d.ts.map +1 -0
- package/dist/eval/presentation-reads.js +2 -0
- package/dist/eval/presentation-reads.js.map +1 -0
- package/dist/eval/presentation.d.ts +122 -0
- package/dist/eval/presentation.d.ts.map +1 -0
- package/dist/eval/presentation.js +255 -0
- package/dist/eval/presentation.js.map +1 -0
- package/dist/eval/reader/context-value.d.ts +41 -0
- package/dist/eval/reader/context-value.d.ts.map +1 -0
- package/dist/eval/reader/context-value.js +129 -0
- package/dist/eval/reader/context-value.js.map +1 -0
- package/dist/eval/reader/covered.d.ts +53 -0
- package/dist/eval/reader/covered.d.ts.map +1 -0
- package/dist/eval/reader/covered.js +139 -0
- package/dist/eval/reader/covered.js.map +1 -0
- package/dist/eval/reader/declarations.d.ts +182 -0
- package/dist/eval/reader/declarations.d.ts.map +1 -0
- package/dist/eval/reader/declarations.js +153 -0
- package/dist/eval/reader/declarations.js.map +1 -0
- package/dist/eval/reader/member-access.d.ts +87 -0
- package/dist/eval/reader/member-access.d.ts.map +1 -0
- package/dist/eval/reader/member-access.js +212 -0
- package/dist/eval/reader/member-access.js.map +1 -0
- package/dist/eval/reader/memo.d.ts +34 -0
- package/dist/eval/reader/memo.d.ts.map +1 -0
- package/dist/eval/reader/memo.js +67 -0
- package/dist/eval/reader/memo.js.map +1 -0
- package/dist/eval/reader/overlay.d.ts +74 -0
- package/dist/eval/reader/overlay.d.ts.map +1 -0
- package/dist/eval/reader/overlay.js +365 -0
- package/dist/eval/reader/overlay.js.map +1 -0
- package/dist/eval/reader/questions.d.ts +37 -0
- package/dist/eval/reader/questions.d.ts.map +1 -0
- package/dist/eval/reader/questions.js +78 -0
- package/dist/eval/reader/questions.js.map +1 -0
- package/dist/eval/reader/resolve.d.ts +84 -0
- package/dist/eval/reader/resolve.d.ts.map +1 -0
- package/dist/eval/reader/resolve.js +310 -0
- package/dist/eval/reader/resolve.js.map +1 -0
- package/dist/eval/reader/value-read.d.ts +50 -0
- package/dist/eval/reader/value-read.d.ts.map +1 -0
- package/dist/eval/reader/value-read.js +133 -0
- package/dist/eval/reader/value-read.js.map +1 -0
- package/dist/eval/reader/withheld.d.ts +48 -0
- package/dist/eval/reader/withheld.d.ts.map +1 -0
- package/dist/eval/reader/withheld.js +108 -0
- package/dist/eval/reader/withheld.js.map +1 -0
- package/dist/eval/reader-paths.d.ts +24 -0
- package/dist/eval/reader-paths.d.ts.map +1 -0
- package/dist/eval/reader-paths.js +23 -0
- package/dist/eval/reader-paths.js.map +1 -0
- package/dist/eval/reader.d.ts +281 -0
- package/dist/eval/reader.d.ts.map +1 -0
- package/dist/eval/reader.js +560 -0
- package/dist/eval/reader.js.map +1 -0
- package/dist/eval/receipt.d.ts +37 -0
- package/dist/eval/receipt.d.ts.map +1 -0
- package/dist/eval/receipt.js +222 -0
- package/dist/eval/receipt.js.map +1 -0
- package/dist/eval/report/assemble.d.ts +84 -0
- package/dist/eval/report/assemble.d.ts.map +1 -0
- package/dist/eval/report/assemble.js +277 -0
- package/dist/eval/report/assemble.js.map +1 -0
- package/dist/eval/report/fold.d.ts +18 -0
- package/dist/eval/report/fold.d.ts.map +1 -0
- package/dist/eval/report/fold.js +58 -0
- package/dist/eval/report/fold.js.map +1 -0
- package/dist/eval/rule/alternatives.d.ts +23 -0
- package/dist/eval/rule/alternatives.d.ts.map +1 -0
- package/dist/eval/rule/alternatives.js +46 -0
- package/dist/eval/rule/alternatives.js.map +1 -0
- package/dist/eval/rule/behaviour.d.ts +47 -0
- package/dist/eval/rule/behaviour.d.ts.map +1 -0
- package/dist/eval/rule/behaviour.js +249 -0
- package/dist/eval/rule/behaviour.js.map +1 -0
- package/dist/eval/rule/compute.d.ts +46 -0
- package/dist/eval/rule/compute.d.ts.map +1 -0
- package/dist/eval/rule/compute.js +158 -0
- package/dist/eval/rule/compute.js.map +1 -0
- package/dist/eval/rule/create-state.d.ts +42 -0
- package/dist/eval/rule/create-state.d.ts.map +1 -0
- package/dist/eval/rule/create-state.js +134 -0
- package/dist/eval/rule/create-state.js.map +1 -0
- package/dist/eval/rule/diagnostics.d.ts +24 -0
- package/dist/eval/rule/diagnostics.d.ts.map +1 -0
- package/dist/eval/rule/diagnostics.js +45 -0
- package/dist/eval/rule/diagnostics.js.map +1 -0
- package/dist/eval/rule/execution.d.ts +24 -0
- package/dist/eval/rule/execution.d.ts.map +1 -0
- package/dist/eval/rule/execution.js +495 -0
- package/dist/eval/rule/execution.js.map +1 -0
- package/dist/eval/rule/gate.d.ts +12 -0
- package/dist/eval/rule/gate.d.ts.map +1 -0
- package/dist/eval/rule/gate.js +34 -0
- package/dist/eval/rule/gate.js.map +1 -0
- package/dist/eval/rule/item.d.ts +11 -0
- package/dist/eval/rule/item.d.ts.map +1 -0
- package/dist/eval/rule/item.js +265 -0
- package/dist/eval/rule/item.js.map +1 -0
- package/dist/eval/rule/prepare.d.ts +64 -0
- package/dist/eval/rule/prepare.d.ts.map +1 -0
- package/dist/eval/rule/prepare.js +131 -0
- package/dist/eval/rule/prepare.js.map +1 -0
- package/dist/eval/rule/result.d.ts +97 -0
- package/dist/eval/rule/result.d.ts.map +1 -0
- package/dist/eval/rule/result.js +347 -0
- package/dist/eval/rule/result.js.map +1 -0
- package/dist/eval/rule/runner.d.ts +128 -0
- package/dist/eval/rule/runner.d.ts.map +1 -0
- package/dist/eval/rule/runner.js +296 -0
- package/dist/eval/rule/runner.js.map +1 -0
- package/dist/eval/rule/screen.d.ts +32 -0
- package/dist/eval/rule/screen.d.ts.map +1 -0
- package/dist/eval/rule/screen.js +73 -0
- package/dist/eval/rule/screen.js.map +1 -0
- package/dist/eval/rule/state.d.ts +137 -0
- package/dist/eval/rule/state.d.ts.map +1 -0
- package/dist/eval/rule/state.js +2 -0
- package/dist/eval/rule/state.js.map +1 -0
- package/dist/eval/rule/steps.d.ts +44 -0
- package/dist/eval/rule/steps.d.ts.map +1 -0
- package/dist/eval/rule/steps.js +367 -0
- package/dist/eval/rule/steps.js.map +1 -0
- package/dist/eval/rule/visibility.d.ts +18 -0
- package/dist/eval/rule/visibility.d.ts.map +1 -0
- package/dist/eval/rule/visibility.js +79 -0
- package/dist/eval/rule/visibility.js.map +1 -0
- package/dist/eval/seal.d.ts +74 -0
- package/dist/eval/seal.d.ts.map +1 -0
- package/dist/eval/seal.js +154 -0
- package/dist/eval/seal.js.map +1 -0
- package/dist/eval/signature-coverage.d.ts +19 -0
- package/dist/eval/signature-coverage.d.ts.map +1 -0
- package/dist/eval/signature-coverage.js +160 -0
- package/dist/eval/signature-coverage.js.map +1 -0
- package/dist/eval/state/derive.d.ts +72 -0
- package/dist/eval/state/derive.d.ts.map +1 -0
- package/dist/eval/state/derive.js +61 -0
- package/dist/eval/state/derive.js.map +1 -0
- package/dist/eval/state/describe.d.ts +18 -0
- package/dist/eval/state/describe.d.ts.map +1 -0
- package/dist/eval/state/describe.js +19 -0
- package/dist/eval/state/describe.js.map +1 -0
- package/dist/eval/state/field-state.d.ts +471 -0
- package/dist/eval/state/field-state.d.ts.map +1 -0
- package/dist/eval/state/field-state.js +1604 -0
- package/dist/eval/state/field-state.js.map +1 -0
- package/dist/eval/state/measurement.d.ts +136 -0
- package/dist/eval/state/measurement.d.ts.map +1 -0
- package/dist/eval/state/measurement.js +209 -0
- package/dist/eval/state/measurement.js.map +1 -0
- package/dist/eval/state/options.d.ts +21 -0
- package/dist/eval/state/options.d.ts.map +1 -0
- package/dist/eval/state/options.js +3 -0
- package/dist/eval/state/options.js.map +1 -0
- package/dist/eval/state/readiness.d.ts +400 -0
- package/dist/eval/state/readiness.d.ts.map +1 -0
- package/dist/eval/state/readiness.js +1067 -0
- package/dist/eval/state/readiness.js.map +1 -0
- package/dist/eval/state/snapshot.d.ts +130 -0
- package/dist/eval/state/snapshot.d.ts.map +1 -0
- package/dist/eval/state/snapshot.js +35 -0
- package/dist/eval/state/snapshot.js.map +1 -0
- package/dist/eval/state/unavailable-options.d.ts +54 -0
- package/dist/eval/state/unavailable-options.d.ts.map +1 -0
- package/dist/eval/state/unavailable-options.js +82 -0
- package/dist/eval/state/unavailable-options.js.map +1 -0
- package/dist/eval/state/value-state.d.ts +38 -0
- package/dist/eval/state/value-state.d.ts.map +1 -0
- package/dist/eval/state/value-state.js +52 -0
- package/dist/eval/state/value-state.js.map +1 -0
- package/dist/eval/submission/admission.d.ts +50 -0
- package/dist/eval/submission/admission.d.ts.map +1 -0
- package/dist/eval/submission/admission.js +174 -0
- package/dist/eval/submission/admission.js.map +1 -0
- package/dist/eval/submission/authority.d.ts +71 -0
- package/dist/eval/submission/authority.d.ts.map +1 -0
- package/dist/eval/submission/authority.js +118 -0
- package/dist/eval/submission/authority.js.map +1 -0
- package/dist/eval/submission/datasets.d.ts +28 -0
- package/dist/eval/submission/datasets.d.ts.map +1 -0
- package/dist/eval/submission/datasets.js +109 -0
- package/dist/eval/submission/datasets.js.map +1 -0
- package/dist/eval/submission/index.d.ts +15 -0
- package/dist/eval/submission/index.d.ts.map +1 -0
- package/dist/eval/submission/index.js +13 -0
- package/dist/eval/submission/index.js.map +1 -0
- package/dist/eval/submission/refusals.d.ts +103 -0
- package/dist/eval/submission/refusals.d.ts.map +1 -0
- package/dist/eval/submission/refusals.js +15 -0
- package/dist/eval/submission/refusals.js.map +1 -0
- package/dist/eval/submission/signatures.d.ts +7 -0
- package/dist/eval/submission/signatures.d.ts.map +1 -0
- package/dist/eval/submission/signatures.js +215 -0
- package/dist/eval/submission/signatures.js.map +1 -0
- package/dist/eval/submission/writes.d.ts +51 -0
- package/dist/eval/submission/writes.d.ts.map +1 -0
- package/dist/eval/submission/writes.js +203 -0
- package/dist/eval/submission/writes.js.map +1 -0
- package/dist/eval/submission.d.ts +53 -0
- package/dist/eval/submission.d.ts.map +1 -0
- package/dist/eval/submission.js +521 -0
- package/dist/eval/submission.js.map +1 -0
- package/dist/eval/suggestions-to-engine.d.ts +18 -0
- package/dist/eval/suggestions-to-engine.d.ts.map +1 -0
- package/dist/eval/suggestions-to-engine.js +40 -0
- package/dist/eval/suggestions-to-engine.js.map +1 -0
- package/dist/eval/suggestions.d.ts +17 -0
- package/dist/eval/suggestions.d.ts.map +1 -0
- package/dist/eval/suggestions.js +314 -0
- package/dist/eval/suggestions.js.map +1 -0
- package/dist/eval/undecided.d.ts +64 -0
- package/dist/eval/undecided.d.ts.map +1 -0
- package/dist/eval/undecided.js +101 -0
- package/dist/eval/undecided.js.map +1 -0
- package/dist/eval/verdict.d.ts +66 -0
- package/dist/eval/verdict.d.ts.map +1 -0
- package/dist/eval/verdict.js +106 -0
- package/dist/eval/verdict.js.map +1 -0
- package/dist/eval/verify-signature.d.ts +78 -0
- package/dist/eval/verify-signature.d.ts.map +1 -0
- package/dist/eval/verify-signature.js +185 -0
- package/dist/eval/verify-signature.js.map +1 -0
- package/dist/eval/version-dispatch.d.ts +38 -0
- package/dist/eval/version-dispatch.d.ts.map +1 -0
- package/dist/eval/version-dispatch.js +61 -0
- package/dist/eval/version-dispatch.js.map +1 -0
- package/dist/eval/visibility.d.ts +33 -0
- package/dist/eval/visibility.d.ts.map +1 -0
- package/dist/eval/visibility.js +83 -0
- package/dist/eval/visibility.js.map +1 -0
- package/dist/evaluate.d.ts +24 -0
- package/dist/evaluate.d.ts.map +1 -0
- package/dist/evaluate.js +18 -0
- package/dist/evaluate.js.map +1 -0
- package/dist/expr/builtin-docs.d.ts +51 -0
- package/dist/expr/builtin-docs.d.ts.map +1 -0
- package/dist/expr/builtin-docs.js +874 -0
- package/dist/expr/builtin-docs.js.map +1 -0
- package/dist/expr/builtins.d.ts +50 -0
- package/dist/expr/builtins.d.ts.map +1 -0
- package/dist/expr/builtins.js +966 -0
- package/dist/expr/builtins.js.map +1 -0
- package/dist/expr/decimal-precision.d.ts +39 -0
- package/dist/expr/decimal-precision.d.ts.map +1 -0
- package/dist/expr/decimal-precision.js +62 -0
- package/dist/expr/decimal-precision.js.map +1 -0
- package/dist/expr/decimal.d.ts +172 -0
- package/dist/expr/decimal.d.ts.map +1 -0
- package/dist/expr/decimal.js +782 -0
- package/dist/expr/decimal.js.map +1 -0
- package/dist/expr/deprecations.d.ts +34 -0
- package/dist/expr/deprecations.d.ts.map +1 -0
- package/dist/expr/deprecations.js +17 -0
- package/dist/expr/deprecations.js.map +1 -0
- package/dist/expr/diagnostics.d.ts +21 -0
- package/dist/expr/diagnostics.d.ts.map +1 -0
- package/dist/expr/diagnostics.js +231 -0
- package/dist/expr/diagnostics.js.map +1 -0
- package/dist/expr/direction.d.ts +30 -0
- package/dist/expr/direction.d.ts.map +1 -0
- package/dist/expr/direction.js +77 -0
- package/dist/expr/direction.js.map +1 -0
- package/dist/expr/example-expression.d.ts +62 -0
- package/dist/expr/example-expression.d.ts.map +1 -0
- package/dist/expr/example-expression.js +670 -0
- package/dist/expr/example-expression.js.map +1 -0
- package/dist/expr/instant.d.ts +49 -0
- package/dist/expr/instant.d.ts.map +1 -0
- package/dist/expr/instant.js +111 -0
- package/dist/expr/instant.js.map +1 -0
- package/dist/expr/logic.d.ts +17 -0
- package/dist/expr/logic.d.ts.map +1 -0
- package/dist/expr/logic.js +65 -0
- package/dist/expr/logic.js.map +1 -0
- package/dist/expr/messages.d.ts +45 -0
- package/dist/expr/messages.d.ts.map +1 -0
- package/dist/expr/messages.js +280 -0
- package/dist/expr/messages.js.map +1 -0
- package/dist/expr/money.d.ts +38 -0
- package/dist/expr/money.d.ts.map +1 -0
- package/dist/expr/money.js +127 -0
- package/dist/expr/money.js.map +1 -0
- package/dist/expr/ordering.d.ts +56 -0
- package/dist/expr/ordering.d.ts.map +1 -0
- package/dist/expr/ordering.js +167 -0
- package/dist/expr/ordering.js.map +1 -0
- package/dist/expr/pattern.d.ts +44 -0
- package/dist/expr/pattern.d.ts.map +1 -0
- package/dist/expr/pattern.js +458 -0
- package/dist/expr/pattern.js.map +1 -0
- package/dist/expr/plain-date.d.ts +90 -0
- package/dist/expr/plain-date.d.ts.map +1 -0
- package/dist/expr/plain-date.js +230 -0
- package/dist/expr/plain-date.js.map +1 -0
- package/dist/expr/plural-categories.d.ts +8 -0
- package/dist/expr/plural-categories.d.ts.map +1 -0
- package/dist/expr/plural-categories.js +15 -0
- package/dist/expr/plural-categories.js.map +1 -0
- package/dist/expr/plural-keys.d.ts +39 -0
- package/dist/expr/plural-keys.d.ts.map +1 -0
- package/dist/expr/plural-keys.js +46 -0
- package/dist/expr/plural-keys.js.map +1 -0
- package/dist/expr/plural.d.ts +33 -0
- package/dist/expr/plural.d.ts.map +1 -0
- package/dist/expr/plural.js +50 -0
- package/dist/expr/plural.js.map +1 -0
- package/dist/expr/quantity.d.ts +31 -0
- package/dist/expr/quantity.d.ts.map +1 -0
- package/dist/expr/quantity.js +83 -0
- package/dist/expr/quantity.js.map +1 -0
- package/dist/expr/reduce.d.ts +50 -0
- package/dist/expr/reduce.d.ts.map +1 -0
- package/dist/expr/reduce.js +236 -0
- package/dist/expr/reduce.js.map +1 -0
- package/dist/expr/regex.d.ts +108 -0
- package/dist/expr/regex.d.ts.map +1 -0
- package/dist/expr/regex.js +1210 -0
- package/dist/expr/regex.js.map +1 -0
- package/dist/expr/select-locale.d.ts +67 -0
- package/dist/expr/select-locale.d.ts.map +1 -0
- package/dist/expr/select-locale.js +219 -0
- package/dist/expr/select-locale.js.map +1 -0
- package/dist/expr/sequences.d.ts +123 -0
- package/dist/expr/sequences.d.ts.map +1 -0
- package/dist/expr/sequences.js +234 -0
- package/dist/expr/sequences.js.map +1 -0
- package/dist/expr/strings.d.ts +50 -0
- package/dist/expr/strings.d.ts.map +1 -0
- package/dist/expr/strings.js +184 -0
- package/dist/expr/strings.js.map +1 -0
- package/dist/expr/validation.d.ts +32 -0
- package/dist/expr/validation.d.ts.map +1 -0
- package/dist/expr/validation.js +182 -0
- package/dist/expr/validation.js.map +1 -0
- package/dist/graph/freeze.d.ts +4 -0
- package/dist/graph/freeze.d.ts.map +1 -0
- package/dist/graph/freeze.js +52 -0
- package/dist/graph/freeze.js.map +1 -0
- package/dist/graph/index.d.ts +15 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +13 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/inspect.d.ts +76 -0
- package/dist/graph/inspect.d.ts.map +1 -0
- package/dist/graph/inspect.js +263 -0
- package/dist/graph/inspect.js.map +1 -0
- package/dist/graph/read-walk.d.ts +101 -0
- package/dist/graph/read-walk.d.ts.map +1 -0
- package/dist/graph/read-walk.js +358 -0
- package/dist/graph/read-walk.js.map +1 -0
- package/dist/graph/record-index.d.ts +24 -0
- package/dist/graph/record-index.d.ts.map +1 -0
- package/dist/graph/record-index.js +35 -0
- package/dist/graph/record-index.js.map +1 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +139 -0
- package/dist/index.js.map +1 -0
- package/dist/lookup/digest.d.ts +51 -0
- package/dist/lookup/digest.d.ts.map +1 -0
- package/dist/lookup/digest.js +46 -0
- package/dist/lookup/digest.js.map +1 -0
- package/dist/lookup/index.d.ts +28 -0
- package/dist/lookup/index.d.ts.map +1 -0
- package/dist/lookup/index.js +27 -0
- package/dist/lookup/index.js.map +1 -0
- package/dist/lookup/install.d.ts +48 -0
- package/dist/lookup/install.d.ts.map +1 -0
- package/dist/lookup/install.js +315 -0
- package/dist/lookup/install.js.map +1 -0
- package/dist/lookup/pass.d.ts +55 -0
- package/dist/lookup/pass.d.ts.map +1 -0
- package/dist/lookup/pass.js +212 -0
- package/dist/lookup/pass.js.map +1 -0
- package/dist/lookup/pins.d.ts +34 -0
- package/dist/lookup/pins.d.ts.map +1 -0
- package/dist/lookup/pins.js +39 -0
- package/dist/lookup/pins.js.map +1 -0
- package/dist/lookup/provenance.d.ts +23 -0
- package/dist/lookup/provenance.d.ts.map +1 -0
- package/dist/lookup/provenance.js +78 -0
- package/dist/lookup/provenance.js.map +1 -0
- package/dist/lookup/readiness.d.ts +13 -0
- package/dist/lookup/readiness.d.ts.map +1 -0
- package/dist/lookup/readiness.js +57 -0
- package/dist/lookup/readiness.js.map +1 -0
- package/dist/lookup/resolve.d.ts +24 -0
- package/dist/lookup/resolve.d.ts.map +1 -0
- package/dist/lookup/resolve.js +201 -0
- package/dist/lookup/resolve.js.map +1 -0
- package/dist/lookup/store.d.ts +41 -0
- package/dist/lookup/store.d.ts.map +1 -0
- package/dist/lookup/store.js +74 -0
- package/dist/lookup/store.js.map +1 -0
- package/dist/model/access.d.ts +200 -0
- package/dist/model/access.d.ts.map +1 -0
- package/dist/model/access.js +125 -0
- package/dist/model/access.js.map +1 -0
- package/dist/model/artifact-members.d.ts +3 -0
- package/dist/model/artifact-members.d.ts.map +1 -0
- package/dist/model/artifact-members.js +38 -0
- package/dist/model/artifact-members.js.map +1 -0
- package/dist/model/composition.d.ts +47 -0
- package/dist/model/composition.d.ts.map +1 -0
- package/dist/model/composition.js +66 -0
- package/dist/model/composition.js.map +1 -0
- package/dist/model/domain.d.ts +51 -0
- package/dist/model/domain.d.ts.map +1 -0
- package/dist/model/domain.js +75 -0
- package/dist/model/domain.js.map +1 -0
- package/dist/model/duration.d.ts +31 -0
- package/dist/model/duration.d.ts.map +1 -0
- package/dist/model/duration.js +136 -0
- package/dist/model/duration.js.map +1 -0
- package/dist/model/errors.d.ts +58 -0
- package/dist/model/errors.d.ts.map +1 -0
- package/dist/model/errors.js +81 -0
- package/dist/model/errors.js.map +1 -0
- package/dist/model/evolution.d.ts +177 -0
- package/dist/model/evolution.d.ts.map +1 -0
- package/dist/model/evolution.js +5 -0
- package/dist/model/evolution.js.map +1 -0
- package/dist/model/expr-children.d.ts +15 -0
- package/dist/model/expr-children.d.ts.map +1 -0
- package/dist/model/expr-children.js +45 -0
- package/dist/model/expr-children.js.map +1 -0
- package/dist/model/guards.d.ts +9 -0
- package/dist/model/guards.d.ts.map +1 -0
- package/dist/model/guards.js +11 -0
- package/dist/model/guards.js.map +1 -0
- package/dist/model/input.d.ts +42 -0
- package/dist/model/input.d.ts.map +1 -0
- package/dist/model/input.js +26 -0
- package/dist/model/input.js.map +1 -0
- package/dist/model/integer.d.ts +14 -0
- package/dist/model/integer.d.ts.map +1 -0
- package/dist/model/integer.js +16 -0
- package/dist/model/integer.js.map +1 -0
- package/dist/model/intrinsic.d.ts +18 -0
- package/dist/model/intrinsic.d.ts.map +1 -0
- package/dist/model/intrinsic.js +21 -0
- package/dist/model/intrinsic.js.map +1 -0
- package/dist/model/layout.d.ts +129 -0
- package/dist/model/layout.d.ts.map +1 -0
- package/dist/model/layout.js +2 -0
- package/dist/model/layout.js.map +1 -0
- package/dist/model/media.d.ts +33 -0
- package/dist/model/media.d.ts.map +1 -0
- package/dist/model/media.js +86 -0
- package/dist/model/media.js.map +1 -0
- package/dist/model/members.generated.d.ts +11 -0
- package/dist/model/members.generated.d.ts.map +1 -0
- package/dist/model/members.generated.js +71 -0
- package/dist/model/members.generated.js.map +1 -0
- package/dist/model/row-address.d.ts +27 -0
- package/dist/model/row-address.d.ts.map +1 -0
- package/dist/model/row-address.js +146 -0
- package/dist/model/row-address.js.map +1 -0
- package/dist/model/schema.d.ts +108 -0
- package/dist/model/schema.d.ts.map +1 -0
- package/dist/model/schema.js +2 -0
- package/dist/model/schema.js.map +1 -0
- package/dist/model/shape.d.ts +193 -0
- package/dist/model/shape.d.ts.map +1 -0
- package/dist/model/shape.js +2 -0
- package/dist/model/shape.js.map +1 -0
- package/dist/model/time.d.ts +61 -0
- package/dist/model/time.d.ts.map +1 -0
- package/dist/model/time.js +110 -0
- package/dist/model/time.js.map +1 -0
- package/dist/model/types.d.ts +1329 -0
- package/dist/model/types.d.ts.map +1 -0
- package/dist/model/types.js +424 -0
- package/dist/model/types.js.map +1 -0
- package/dist/model/values.d.ts +91 -0
- package/dist/model/values.d.ts.map +1 -0
- package/dist/model/values.js +195 -0
- package/dist/model/values.js.map +1 -0
- package/dist/model/wire.d.ts +356 -0
- package/dist/model/wire.d.ts.map +1 -0
- package/dist/model/wire.js +1504 -0
- package/dist/model/wire.js.map +1 -0
- package/dist/offline/index.d.ts +374 -0
- package/dist/offline/index.d.ts.map +1 -0
- package/dist/offline/index.js +422 -0
- package/dist/offline/index.js.map +1 -0
- package/dist/testing.d.ts +30 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +42 -0
- package/dist/testing.js.map +1 -0
- package/dist/version.d.ts +30 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +116 -0
- package/dist/version.js.map +1 -0
- package/package.json +98 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strings.js","sourceRoot":"","sources":["../../src/expr/strings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;;;GAOG;AAEH,gEAAgE;AAChE,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,OAAO,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC1C,KAAK,IAAI,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,KAAK,IAAI,CAAC,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,iBAAiB,CAAC,CAAS,EAAE,CAAS;IACpD,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,OAAO,SAAS,GAAG,CAAC,CAAC,MAAM,IAAI,UAAU,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,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,IAAY;IAC1D,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAClC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACxE,IAAI,OAAO,GAAG,IAAI,CAAC;QACnB,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,OAAO,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE,CAAC;YACpE,OAAO,GAAG,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,OAAO;YAAE,OAAO,KAAK,CAAC;IAC5B,CAAC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC","sourcesContent":["import { AxiomError } from '../model/errors.js';\n\n/**\n * String primitives, `spec/semantics/expr-v1.md` section 14.\n *\n * The runtime ships to Node, browsers and React Native's Hermes and reads no locale database,\n * so case mapping is ASCII-only and ordering is by Unicode code point. A host locale can never\n * change the answer, and `len` counts what a reader calls a character (a code point), not the\n * UTF-16 code units a JavaScript string is stored in.\n */\n\n/** Code points in `text`: a surrogate pair is one character. */\nexport function codePointLength(text: string): number {\n let count = 0;\n let index = 0;\n while (index < text.length) {\n const code = text.codePointAt(index) ?? 0;\n index += code > 0xffff ? 2 : 1;\n count += 1;\n }\n return count;\n}\n\n/** Code point order: UTF-16 code-unit order disagrees for astral text. */\nexport function compareCodePoints(a: string, b: string): number {\n let leftIndex = 0;\n let rightIndex = 0;\n while (leftIndex < a.length && rightIndex < b.length) {\n const x = a.codePointAt(leftIndex) ?? 0;\n const y = b.codePointAt(rightIndex) ?? 0;\n if (x !== y) return x < y ? -1 : 1;\n leftIndex += x > 0xffff ? 2 : 1;\n rightIndex += y > 0xffff ? 2 : 1;\n }\n if (leftIndex >= a.length && rightIndex >= b.length) return 0;\n return leftIndex >= a.length ? -1 : 1;\n}\n\n/** ASCII `A-Z` mapping only: every other code point is returned unchanged. */\nexport function asciiLower(text: string): string {\n let result = '';\n for (const character of text) {\n const code = character.codePointAt(0) ?? 0;\n result += code >= 0x41 && code <= 0x5a ? String.fromCharCode(code + 0x20) : character;\n }\n return result;\n}\n\n/** ASCII `a-z` mapping only: every other code point is returned unchanged. */\nexport function asciiUpper(text: string): string {\n let result = '';\n for (const character of text) {\n const code = character.codePointAt(0) ?? 0;\n result += code >= 0x61 && code <= 0x7a ? String.fromCharCode(code - 0x20) : character;\n }\n return result;\n}\n\n/**\n * Whether `code` is ASCII whitespace: space, tab, line feed, carriage\n * return, vertical tab and form feed. A no-break space, an em space and every other\n * Unicode space are data, not padding, because the result must not depend on a locale or\n * on a Unicode table this runtime does not carry.\n */\nfunction isAsciiWhitespace(code: number): boolean {\n return code === 0x20 || (code >= 0x09 && code <= 0x0d);\n}\n\n/** `trim`: strips leading and trailing ASCII whitespace in one linear scan. */\nexport function trimAsciiWhitespace(text: string): string {\n let start = 0;\n let end = text.length;\n while (start < end && isAsciiWhitespace(text.charCodeAt(start))) start += 1;\n while (end > start && isAsciiWhitespace(text.charCodeAt(end - 1))) end -= 1;\n return text.slice(start, end);\n}\n\n/**\n * The code points of `text`, each one element of the result. A JavaScript string is a\n * sequence of UTF-16 code units, so `Array.from` is the conversion that keeps a surrogate\n * pair — one reader-visible character — as one element rather than two.\n *\n * Every string operator below indexes this array, which is what makes `substring`, `split`\n * and `index_of` count characters rather than code units (`EXPR-14.1.1`, `EXPR-14.1.7`).\n */\nfunction codePoints(text: string): string[] {\n return Array.from(text);\n}\n\n/**\n * `replace(s, find, with)`: every non-overlapping occurrence of `find`, left to right, as\n * literal text. The needle is never a pattern, so no character in it is special\n * (`EXPR-14.1.7`).\n *\n * The scan is over code points, so a needle that is astral text matches at a character\n * boundary and the replacement is inserted whole. An empty `find` has no occurrence rule\n * that is not degenerate, so the caller refuses it before this runs.\n */\nexport function replaceAllLiteral(text: string, find: string, replacement: string): string {\n const subject = codePoints(text);\n const needle = codePoints(find);\n if (needle.length === 0) {\n throw new AxiomError(\n 'ENGINE_ERROR',\n 'replaceAllLiteral requires a non-empty needle; the caller refuses it first',\n );\n }\n let result = '';\n let index = 0;\n while (index < subject.length) {\n let matches = index + needle.length <= subject.length;\n for (let offset = 0; matches && offset < needle.length; offset += 1) {\n matches = subject[index + offset] === needle[offset];\n }\n if (matches) {\n result += replacement;\n index += needle.length;\n continue;\n }\n result += subject[index] ?? '';\n index += 1;\n }\n return result;\n}\n\n/**\n * `split(s, separator)`: the text between literal occurrences of `separator`, left to right.\n * An empty `separator` is refused by the caller, because splitting on it has no segment rule\n * the language states. An empty subject is one empty segment, not zero segments\n * (`EXPR-14.1.8`).\n */\nexport function splitLiteral(text: string, separator: string): string[] {\n const subject = codePoints(text);\n const needle = codePoints(separator);\n if (needle.length === 0) {\n throw new AxiomError(\n 'ENGINE_ERROR',\n 'splitLiteral requires a non-empty separator; the caller refuses it first',\n );\n }\n const segments: string[] = [];\n let start = 0;\n let index = 0;\n while (index < subject.length) {\n let matches = index + needle.length <= subject.length;\n for (let offset = 0; matches && offset < needle.length; offset += 1) {\n matches = subject[index + offset] === needle[offset];\n }\n if (matches) {\n segments.push(subject.slice(start, index).join(''));\n index += needle.length;\n start = index;\n continue;\n }\n index += 1;\n }\n segments.push(subject.slice(start).join(''));\n return segments;\n}\n\n/**\n * `substring(s, start, length)`: `length` code points from `start`, clamped to the text.\n *\n * The caller refuses a negative `start` or `length`; here they are non-negative, so the only\n * boundary left is the end of the text: a `start` at or past the end is the empty string, and\n * a window that runs past the end stops at the end (`EXPR-14.1.9`).\n */\nexport function substringCodePoints(text: string, start: number, length: number): string {\n const subject = codePoints(text);\n if (start >= subject.length || length === 0) return '';\n // The window is clamped before the addition, so a `start + length` pair near the\n // canonical integer ceiling cannot overflow into an imprecise sum.\n const end = length >= subject.length - start ? subject.length : start + length;\n return subject.slice(start, end).join('');\n}\n\n/**\n * `index_of(s, find)`: the code-point index of the first literal occurrence of `find`, or\n * `-1` when the text does not contain it. An empty `find` occurs at index `0`, which is the\n * only index it can be said to start at (`EXPR-14.1.10`).\n */\nexport function indexOfCodePoints(text: string, find: string): number {\n const subject = codePoints(text);\n const needle = codePoints(find);\n if (needle.length === 0) return 0;\n for (let index = 0; index + needle.length <= subject.length; index += 1) {\n let matches = true;\n for (let offset = 0; matches && offset < needle.length; offset += 1) {\n matches = subject[index + offset] === needle[offset];\n }\n if (matches) return index;\n }\n return -1;\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bounded string predicates behind `is_email`, `is_phone` and `is_url`,
|
|
3
|
+
* `spec/semantics/expr-v1.md` section 7.2.
|
|
4
|
+
*
|
|
5
|
+
* Each predicate checks its length cap first and then makes a single left-to-right scan,
|
|
6
|
+
* so hostile input is refused in work proportional to the cap. No pattern with a nested
|
|
7
|
+
* quantifier appears here: the zero-ReDoS guarantee is a property of the shape of the
|
|
8
|
+
* code, not of a matcher budget.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* `is_email`: an ASCII address of at most 254 characters, with a dot-atom
|
|
12
|
+
* local part and a dotted domain of at least two labels. A quoted local part, a comment,
|
|
13
|
+
* an address literal and a domain outside ASCII are outside the contract and answer
|
|
14
|
+
* `false`; the predicate validates a form input, it does not prove deliverability.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isEmailAddress(text: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* `is_phone`: strict E.164 — a leading `+`, then 1 to 15 ASCII digits, the
|
|
19
|
+
* first of them non-zero. No space, hyphen, parenthesis, national trunk prefix or Unicode
|
|
20
|
+
* digit is accepted; a control that accepts typed input formats it before the value is
|
|
21
|
+
* stored, so the stored value has exactly one spelling.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isE164PhoneNumber(text: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* `is_url`: an ASCII `http://` or `https://` URL of at most 2048
|
|
26
|
+
* characters whose authority is a host name with an optional port. No user-info, no
|
|
27
|
+
* non-ASCII, no space or control character, and no other scheme. This is a shape test for a
|
|
28
|
+
* form input, not an authorisation to fetch it: it accepts loopback, private and link-local
|
|
29
|
+
* authorities, so a host that fetches the value applies its own policy after resolution.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isHttpUrl(text: string): boolean;
|
|
32
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/expr/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAuCH;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASpD;AAyCD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOvD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAoB/C"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bounded string predicates behind `is_email`, `is_phone` and `is_url`,
|
|
3
|
+
* `spec/semantics/expr-v1.md` section 7.2.
|
|
4
|
+
*
|
|
5
|
+
* Each predicate checks its length cap first and then makes a single left-to-right scan,
|
|
6
|
+
* so hostile input is refused in work proportional to the cap. No pattern with a nested
|
|
7
|
+
* quantifier appears here: the zero-ReDoS guarantee is a property of the shape of the
|
|
8
|
+
* code, not of a matcher budget.
|
|
9
|
+
*/
|
|
10
|
+
/** The forward-path limit of, RFC 5321 4.5.3.1.3. */
|
|
11
|
+
const MAX_EMAIL_LENGTH = 254;
|
|
12
|
+
/** The local-part limit of, RFC 5321 4.5.3.1.1. */
|
|
13
|
+
const MAX_EMAIL_LOCAL_LENGTH = 64;
|
|
14
|
+
/** One dot-separated label's limit, so a host name stays inside the 253-character bound. */
|
|
15
|
+
const MAX_LABEL_LENGTH = 63;
|
|
16
|
+
/** The domain-name limit of, RFC 1035 2.3.4. */
|
|
17
|
+
const MAX_HOST_LENGTH = 253;
|
|
18
|
+
/** Characters RFC 5322 `atext` admits in an unquoted local part, beside letters and digits. */
|
|
19
|
+
const EMAIL_LOCAL_ATOMS = "!#$%&'*+/=?^_`{|}~-";
|
|
20
|
+
/** E.164 bounds the whole number at 15 digits. */
|
|
21
|
+
const MAX_E164_DIGITS = 15;
|
|
22
|
+
/** The URL bound of; kept in code units, which is at least the code-point count. */
|
|
23
|
+
const MAX_URL_LENGTH = 2048;
|
|
24
|
+
/** A port above this cannot be dialled, so it is not part of a valid authority. */
|
|
25
|
+
const MAX_PORT = 65_535;
|
|
26
|
+
function isAsciiDigit(code) {
|
|
27
|
+
return code >= 0x30 && code <= 0x39;
|
|
28
|
+
}
|
|
29
|
+
function isAsciiLetter(code) {
|
|
30
|
+
return (code >= 0x41 && code <= 0x5a) || (code >= 0x61 && code <= 0x7a);
|
|
31
|
+
}
|
|
32
|
+
/** Printable ASCII: no space, no control character, nothing outside ASCII. */
|
|
33
|
+
function isAsciiPrintable(code) {
|
|
34
|
+
return code >= 0x21 && code <= 0x7e;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* `is_email`: an ASCII address of at most 254 characters, with a dot-atom
|
|
38
|
+
* local part and a dotted domain of at least two labels. A quoted local part, a comment,
|
|
39
|
+
* an address literal and a domain outside ASCII are outside the contract and answer
|
|
40
|
+
* `false`; the predicate validates a form input, it does not prove deliverability.
|
|
41
|
+
*/
|
|
42
|
+
export function isEmailAddress(text) {
|
|
43
|
+
if (text.length > MAX_EMAIL_LENGTH)
|
|
44
|
+
return false;
|
|
45
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
46
|
+
if (!isAsciiPrintable(text.charCodeAt(index)))
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
const at = text.indexOf('@');
|
|
50
|
+
// Exactly one `@`, and never the first or last character.
|
|
51
|
+
if (at <= 0 || at !== text.lastIndexOf('@') || at === text.length - 1)
|
|
52
|
+
return false;
|
|
53
|
+
return isEmailLocalPart(text.slice(0, at)) && isEmailDomain(text.slice(at + 1));
|
|
54
|
+
}
|
|
55
|
+
function isEmailLocalPart(local) {
|
|
56
|
+
if (local.length > MAX_EMAIL_LOCAL_LENGTH)
|
|
57
|
+
return false;
|
|
58
|
+
if (local.startsWith('.') || local.endsWith('.') || local.includes('..'))
|
|
59
|
+
return false;
|
|
60
|
+
for (const character of local) {
|
|
61
|
+
const code = character.codePointAt(0) ?? 0;
|
|
62
|
+
if (isAsciiLetter(code) || isAsciiDigit(code))
|
|
63
|
+
continue;
|
|
64
|
+
if (character === '.' || EMAIL_LOCAL_ATOMS.includes(character))
|
|
65
|
+
continue;
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
function isEmailDomain(domain) {
|
|
71
|
+
if (domain.length > MAX_HOST_LENGTH)
|
|
72
|
+
return false;
|
|
73
|
+
const labels = domain.split('.');
|
|
74
|
+
if (labels.length < 2)
|
|
75
|
+
return false;
|
|
76
|
+
for (const label of labels) {
|
|
77
|
+
if (!isHostLabel(label))
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
// A top-level label of one character is a host name, not a registered domain.
|
|
81
|
+
const topLevel = labels[labels.length - 1] ?? '';
|
|
82
|
+
if (topLevel.length < 2)
|
|
83
|
+
return false;
|
|
84
|
+
for (const character of topLevel) {
|
|
85
|
+
if (!isAsciiLetter(character.codePointAt(0) ?? 0))
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
/** One dot-separated label: non-empty, bounded, letters, digits and interior hyphens. */
|
|
91
|
+
function isHostLabel(label) {
|
|
92
|
+
if (label.length === 0 || label.length > MAX_LABEL_LENGTH)
|
|
93
|
+
return false;
|
|
94
|
+
if (label.startsWith('-') || label.endsWith('-'))
|
|
95
|
+
return false;
|
|
96
|
+
for (const character of label) {
|
|
97
|
+
const code = character.codePointAt(0) ?? 0;
|
|
98
|
+
if (!isAsciiLetter(code) && !isAsciiDigit(code) && character !== '-')
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* `is_phone`: strict E.164 — a leading `+`, then 1 to 15 ASCII digits, the
|
|
105
|
+
* first of them non-zero. No space, hyphen, parenthesis, national trunk prefix or Unicode
|
|
106
|
+
* digit is accepted; a control that accepts typed input formats it before the value is
|
|
107
|
+
* stored, so the stored value has exactly one spelling.
|
|
108
|
+
*/
|
|
109
|
+
export function isE164PhoneNumber(text) {
|
|
110
|
+
if (text.length < 2 || text.length > MAX_E164_DIGITS + 1)
|
|
111
|
+
return false;
|
|
112
|
+
if (text.charCodeAt(0) !== 0x2b)
|
|
113
|
+
return false;
|
|
114
|
+
for (let index = 1; index < text.length; index += 1) {
|
|
115
|
+
if (!isAsciiDigit(text.charCodeAt(index)))
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
return text.charCodeAt(1) >= 0x31;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* `is_url`: an ASCII `http://` or `https://` URL of at most 2048
|
|
122
|
+
* characters whose authority is a host name with an optional port. No user-info, no
|
|
123
|
+
* non-ASCII, no space or control character, and no other scheme. This is a shape test for a
|
|
124
|
+
* form input, not an authorisation to fetch it: it accepts loopback, private and link-local
|
|
125
|
+
* authorities, so a host that fetches the value applies its own policy after resolution.
|
|
126
|
+
*/
|
|
127
|
+
export function isHttpUrl(text) {
|
|
128
|
+
if (text.length > MAX_URL_LENGTH)
|
|
129
|
+
return false;
|
|
130
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
131
|
+
if (!isAsciiPrintable(text.charCodeAt(index)))
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
const rest = text.startsWith('https://')
|
|
135
|
+
? text.slice('https://'.length)
|
|
136
|
+
: text.startsWith('http://')
|
|
137
|
+
? text.slice('http://'.length)
|
|
138
|
+
: undefined;
|
|
139
|
+
if (rest === undefined)
|
|
140
|
+
return false;
|
|
141
|
+
let authorityEnd = rest.length;
|
|
142
|
+
for (let index = 0; index < rest.length; index += 1) {
|
|
143
|
+
const character = rest[index];
|
|
144
|
+
if (character === '/' || character === '?' || character === '#') {
|
|
145
|
+
authorityEnd = index;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return isUrlAuthority(rest.slice(0, authorityEnd));
|
|
150
|
+
}
|
|
151
|
+
function isUrlAuthority(authority) {
|
|
152
|
+
// User-info carries credentials inside a value the form would store and hash; a URL
|
|
153
|
+
// field never accepts one.
|
|
154
|
+
if (authority.length === 0 || authority.includes('@'))
|
|
155
|
+
return false;
|
|
156
|
+
const colon = authority.indexOf(':');
|
|
157
|
+
if (colon === -1)
|
|
158
|
+
return isUrlHost(authority);
|
|
159
|
+
return isUrlHost(authority.slice(0, colon)) && isUrlPort(authority.slice(colon + 1));
|
|
160
|
+
}
|
|
161
|
+
function isUrlHost(host) {
|
|
162
|
+
if (host.length > MAX_HOST_LENGTH)
|
|
163
|
+
return false;
|
|
164
|
+
for (const label of host.split('.')) {
|
|
165
|
+
if (!isHostLabel(label))
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
function isUrlPort(text) {
|
|
171
|
+
if (text.length === 0 || text.length > '65535'.length)
|
|
172
|
+
return false;
|
|
173
|
+
let port = 0;
|
|
174
|
+
for (let index = 0; index < text.length; index += 1) {
|
|
175
|
+
const code = text.charCodeAt(index);
|
|
176
|
+
if (!isAsciiDigit(code))
|
|
177
|
+
return false;
|
|
178
|
+
port = port * 10 + (code - 0x30);
|
|
179
|
+
}
|
|
180
|
+
return port >= 1 && port <= MAX_PORT;
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/expr/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,qDAAqD;AACrD,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B,mDAAmD;AACnD,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC,4FAA4F;AAC5F,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAE5B,gDAAgD;AAChD,MAAM,eAAe,GAAG,GAAG,CAAC;AAE5B,+FAA+F;AAC/F,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAEhD,kDAAkD;AAClD,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,oFAAoF;AACpF,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,mFAAmF;AACnF,MAAM,QAAQ,GAAG,MAAM,CAAC;AAExB,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC;AACtC,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,CAAC;AAC1E,CAAC;AAED,8EAA8E;AAC9E,SAAS,gBAAgB,CAAC,IAAY;IACpC,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC;AACtC,CAAC;AAED;;;;;GAKG;AAC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M,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;IACxC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACpE,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACpC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QACtC,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,QAAQ,CAAC;AACvC,CAAC","sourcesContent":["/**\n * The bounded string predicates behind `is_email`, `is_phone` and `is_url`,\n * `spec/semantics/expr-v1.md` section 7.2.\n *\n * Each predicate checks its length cap first and then makes a single left-to-right scan,\n * so hostile input is refused in work proportional to the cap. No pattern with a nested\n * quantifier appears here: the zero-ReDoS guarantee is a property of the shape of the\n * code, not of a matcher budget.\n */\n\n/** The forward-path limit of, RFC 5321 4.5.3.1.3. */\nconst MAX_EMAIL_LENGTH = 254;\n\n/** The local-part limit of, RFC 5321 4.5.3.1.1. */\nconst MAX_EMAIL_LOCAL_LENGTH = 64;\n\n/** One dot-separated label's limit, so a host name stays inside the 253-character bound. */\nconst MAX_LABEL_LENGTH = 63;\n\n/** The domain-name limit of, RFC 1035 2.3.4. */\nconst MAX_HOST_LENGTH = 253;\n\n/** Characters RFC 5322 `atext` admits in an unquoted local part, beside letters and digits. */\nconst EMAIL_LOCAL_ATOMS = \"!#$%&'*+/=?^_`{|}~-\";\n\n/** E.164 bounds the whole number at 15 digits. */\nconst MAX_E164_DIGITS = 15;\n\n/** The URL bound of; kept in code units, which is at least the code-point count. */\nconst MAX_URL_LENGTH = 2048;\n\n/** A port above this cannot be dialled, so it is not part of a valid authority. */\nconst MAX_PORT = 65_535;\n\nfunction isAsciiDigit(code: number): boolean {\n return code >= 0x30 && code <= 0x39;\n}\n\nfunction isAsciiLetter(code: number): boolean {\n return (code >= 0x41 && code <= 0x5a) || (code >= 0x61 && code <= 0x7a);\n}\n\n/** Printable ASCII: no space, no control character, nothing outside ASCII. */\nfunction isAsciiPrintable(code: number): boolean {\n return code >= 0x21 && code <= 0x7e;\n}\n\n/**\n * `is_email`: an ASCII address of at most 254 characters, with a dot-atom\n * local part and a dotted domain of at least two labels. A quoted local part, a comment,\n * an address literal and a domain outside ASCII are outside the contract and answer\n * `false`; the predicate validates a form input, it does not prove deliverability.\n */\nexport function isEmailAddress(text: string): boolean {\n if (text.length > MAX_EMAIL_LENGTH) return false;\n for (let index = 0; index < text.length; index += 1) {\n if (!isAsciiPrintable(text.charCodeAt(index))) return false;\n }\n const at = text.indexOf('@');\n // Exactly one `@`, and never the first or last character.\n if (at <= 0 || at !== text.lastIndexOf('@') || at === text.length - 1) return false;\n return isEmailLocalPart(text.slice(0, at)) && isEmailDomain(text.slice(at + 1));\n}\n\nfunction isEmailLocalPart(local: string): boolean {\n if (local.length > MAX_EMAIL_LOCAL_LENGTH) return false;\n if (local.startsWith('.') || local.endsWith('.') || local.includes('..')) return false;\n for (const character of local) {\n const code = character.codePointAt(0) ?? 0;\n if (isAsciiLetter(code) || isAsciiDigit(code)) continue;\n if (character === '.' || EMAIL_LOCAL_ATOMS.includes(character)) continue;\n return false;\n }\n return true;\n}\n\nfunction isEmailDomain(domain: string): boolean {\n if (domain.length > MAX_HOST_LENGTH) return false;\n const labels = domain.split('.');\n if (labels.length < 2) return false;\n for (const label of labels) {\n if (!isHostLabel(label)) return false;\n }\n // A top-level label of one character is a host name, not a registered domain.\n const topLevel = labels[labels.length - 1] ?? '';\n if (topLevel.length < 2) return false;\n for (const character of topLevel) {\n if (!isAsciiLetter(character.codePointAt(0) ?? 0)) return false;\n }\n return true;\n}\n\n/** One dot-separated label: non-empty, bounded, letters, digits and interior hyphens. */\nfunction isHostLabel(label: string): boolean {\n if (label.length === 0 || label.length > MAX_LABEL_LENGTH) return false;\n if (label.startsWith('-') || label.endsWith('-')) return false;\n for (const character of label) {\n const code = character.codePointAt(0) ?? 0;\n if (!isAsciiLetter(code) && !isAsciiDigit(code) && character !== '-') return false;\n }\n return true;\n}\n\n/**\n * `is_phone`: strict E.164 — a leading `+`, then 1 to 15 ASCII digits, the\n * first of them non-zero. No space, hyphen, parenthesis, national trunk prefix or Unicode\n * digit is accepted; a control that accepts typed input formats it before the value is\n * stored, so the stored value has exactly one spelling.\n */\nexport function isE164PhoneNumber(text: string): boolean {\n if (text.length < 2 || text.length > MAX_E164_DIGITS + 1) return false;\n if (text.charCodeAt(0) !== 0x2b) return false;\n for (let index = 1; index < text.length; index += 1) {\n if (!isAsciiDigit(text.charCodeAt(index))) return false;\n }\n return text.charCodeAt(1) >= 0x31;\n}\n\n/**\n * `is_url`: an ASCII `http://` or `https://` URL of at most 2048\n * characters whose authority is a host name with an optional port. No user-info, no\n * non-ASCII, no space or control character, and no other scheme. This is a shape test for a\n * form input, not an authorisation to fetch it: it accepts loopback, private and link-local\n * authorities, so a host that fetches the value applies its own policy after resolution.\n */\nexport function isHttpUrl(text: string): boolean {\n if (text.length > MAX_URL_LENGTH) return false;\n for (let index = 0; index < text.length; index += 1) {\n if (!isAsciiPrintable(text.charCodeAt(index))) return false;\n }\n const rest = text.startsWith('https://')\n ? text.slice('https://'.length)\n : text.startsWith('http://')\n ? text.slice('http://'.length)\n : undefined;\n if (rest === undefined) return false;\n let authorityEnd = rest.length;\n for (let index = 0; index < rest.length; index += 1) {\n const character = rest[index];\n if (character === '/' || character === '?' || character === '#') {\n authorityEnd = index;\n break;\n }\n }\n return isUrlAuthority(rest.slice(0, authorityEnd));\n}\n\nfunction isUrlAuthority(authority: string): boolean {\n // User-info carries credentials inside a value the form would store and hash; a URL\n // field never accepts one.\n if (authority.length === 0 || authority.includes('@')) return false;\n const colon = authority.indexOf(':');\n if (colon === -1) return isUrlHost(authority);\n return isUrlHost(authority.slice(0, colon)) && isUrlPort(authority.slice(colon + 1));\n}\n\nfunction isUrlHost(host: string): boolean {\n if (host.length > MAX_HOST_LENGTH) return false;\n for (const label of host.split('.')) {\n if (!isHostLabel(label)) return false;\n }\n return true;\n}\n\nfunction isUrlPort(text: string): boolean {\n if (text.length === 0 || text.length > '65535'.length) return false;\n let port = 0;\n for (let index = 0; index < text.length; index += 1) {\n const code = text.charCodeAt(index);\n if (!isAsciiDigit(code)) return false;\n port = port * 10 + (code - 0x30);\n }\n return port >= 1 && port <= MAX_PORT;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"freeze.d.ts","sourceRoot":"","sources":["../../src/graph/freeze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AA2CzD,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAI7D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { isRecord } from '../model/values.js';
|
|
2
|
+
/**
|
|
3
|
+
* Freezing one artifact in place before its facts are derived from it.
|
|
4
|
+
*
|
|
5
|
+
* A dependency derivation caches its answer against the artifact's identity, and a report handed
|
|
6
|
+
* to a caller is the artifact's own subtrees rather than copies. Both are sound only while the
|
|
7
|
+
* artifact cannot change, so the first derivation freezes the whole tree — every nested object,
|
|
8
|
+
* once per object, which is what makes the walk linear rather than re-freezing a shared subtree.
|
|
9
|
+
*
|
|
10
|
+
* The set of frozen artifacts is what keeps a second derivation from walking the tree again: an
|
|
11
|
+
* artifact the compiler emitted was frozen when its own inspection ran.
|
|
12
|
+
*/
|
|
13
|
+
const FROZEN_ARTIFACTS = new WeakSet();
|
|
14
|
+
/**
|
|
15
|
+
* Freezes everything reachable from one artifact, refusing the node-level shortcut `freezeTree`
|
|
16
|
+
* takes.
|
|
17
|
+
*
|
|
18
|
+
* `freezeTree` returns at any node `Object.isFrozen` reports, which is sound for a tree it froze
|
|
19
|
+
* itself — children are frozen before their parent, so a frozen node is already whole — but not
|
|
20
|
+
* for a tree someone else froze shallowly: the root is skipped, its members are never visited,
|
|
21
|
+
* and the identity-keyed caches below would then answer for a tree that can still change. This
|
|
22
|
+
* guard runs once per artifact, so the unconditional walk costs one pass over the declarations
|
|
23
|
+
* and cannot be short-circuited by a caller's `Object.freeze`.
|
|
24
|
+
*/
|
|
25
|
+
function freezeWhole(value, seen) {
|
|
26
|
+
if (typeof value !== 'object' || value === null)
|
|
27
|
+
return;
|
|
28
|
+
if (!Array.isArray(value) && !isRecord(value))
|
|
29
|
+
return;
|
|
30
|
+
// A cycle is not something an artifact can be canonicalised with, but it must not turn this
|
|
31
|
+
// walk into a stack overflow: the seen set makes the walk total.
|
|
32
|
+
if (seen.has(value))
|
|
33
|
+
return;
|
|
34
|
+
seen.add(value);
|
|
35
|
+
if (Array.isArray(value)) {
|
|
36
|
+
for (const item of value)
|
|
37
|
+
freezeWhole(item, seen);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
for (const member of Object.values(value))
|
|
41
|
+
freezeWhole(member, seen);
|
|
42
|
+
}
|
|
43
|
+
Object.freeze(value);
|
|
44
|
+
}
|
|
45
|
+
/** Freezes `compiled` and everything below it, once per artifact. */
|
|
46
|
+
export function freezeArtifact(compiled) {
|
|
47
|
+
if (FROZEN_ARTIFACTS.has(compiled))
|
|
48
|
+
return;
|
|
49
|
+
freezeWhole(compiled, new WeakSet());
|
|
50
|
+
FROZEN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AAG,CAAC,QAAQ,CAAC,CAAC;AACjC,CAAC","sourcesContent":["import type { CompiledSchema } from '../model/schema.js';\nimport { isRecord } from '../model/values.js';\n\n/**\n * Freezing one artifact in place before its facts are derived from it.\n *\n * A dependency derivation caches its answer against the artifact's identity, and a report handed\n * to a caller is the artifact's own subtrees rather than copies. Both are sound only while the\n * artifact cannot change, so the first derivation freezes the whole tree — every nested object,\n * once per object, which is what makes the walk linear rather than re-freezing a shared subtree.\n *\n * The set of frozen artifacts is what keeps a second derivation from walking the tree again: an\n * artifact the compiler emitted was frozen when its own inspection ran.\n */\n\nconst FROZEN_ARTIFACTS: WeakSet<CompiledSchema> = new WeakSet();\n\n/**\n * Freezes everything reachable from one artifact, refusing the node-level shortcut `freezeTree`\n * takes.\n *\n * `freezeTree` returns at any node `Object.isFrozen` reports, which is sound for a tree it froze\n * itself — children are frozen before their parent, so a frozen node is already whole — but not\n * for a tree someone else froze shallowly: the root is skipped, its members are never visited,\n * and the identity-keyed caches below would then answer for a tree that can still change. This\n * guard runs once per artifact, so the unconditional walk costs one pass over the declarations\n * and cannot be short-circuited by a caller's `Object.freeze`.\n */\nfunction freezeWhole(value: unknown, seen: WeakSet<object>): void {\n if (typeof value !== 'object' || value === null) return;\n if (!Array.isArray(value) && !isRecord(value)) return;\n // A cycle is not something an artifact can be canonicalised with, but it must not turn this\n // walk into a stack overflow: the seen set makes the walk total.\n if (seen.has(value)) return;\n seen.add(value);\n if (Array.isArray(value)) {\n for (const item of value) freezeWhole(item, seen);\n } else {\n for (const member of Object.values(value)) freezeWhole(member, seen);\n }\n Object.freeze(value);\n}\n\n/** Freezes `compiled` and everything below it, once per artifact. */\nexport function freezeArtifact(compiled: CompiledSchema): void {\n if (FROZEN_ARTIFACTS.has(compiled)) return;\n freezeWhole(compiled, new WeakSet());\n FROZEN_ARTIFACTS.add(compiled);\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dependency facts of a compiled artifact, and the one index they are derived against.
|
|
3
|
+
*
|
|
4
|
+
* Four modules, one job each: `record-index` derives the declared shape a path is resolved
|
|
5
|
+
* against, `read-walk` answers what a set of expressions reads, `inspect` turns those reads into
|
|
6
|
+
* a recalculation order or states why there is none, and `freeze` is the one step that makes an
|
|
7
|
+
* artifact safe to cache against. This module is their public surface and holds no behaviour of
|
|
8
|
+
* its own, so a caller reaches one entry point and each rule lives in exactly one file.
|
|
9
|
+
*/
|
|
10
|
+
export { recordIndexFromDeclarations } from './record-index.js';
|
|
11
|
+
export { collectReadRefs, declaredFieldExpressions, declaredFieldReads, gateItemReads, ruleContextReads, ruleExpressions, ruleOkTargets, ruleReads, } from './read-walk.js';
|
|
12
|
+
export type { CollectedReads, ReadRef } from './read-walk.js';
|
|
13
|
+
export { inspectDeps } from './inspect.js';
|
|
14
|
+
export type { ComputedDependency, DependencyInspection, DependencyInspectionOptions, DependencyProblem, DependencyReport, RuleDependency, } from './inspect.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,YAAY,EACV,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAC3B,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dependency facts of a compiled artifact, and the one index they are derived against.
|
|
3
|
+
*
|
|
4
|
+
* Four modules, one job each: `record-index` derives the declared shape a path is resolved
|
|
5
|
+
* against, `read-walk` answers what a set of expressions reads, `inspect` turns those reads into
|
|
6
|
+
* a recalculation order or states why there is none, and `freeze` is the one step that makes an
|
|
7
|
+
* artifact safe to cache against. This module is their public surface and holds no behaviour of
|
|
8
|
+
* its own, so a caller reaches one entry point and each rule lives in exactly one file.
|
|
9
|
+
*/
|
|
10
|
+
export { recordIndexFromDeclarations } from './record-index.js';
|
|
11
|
+
export { collectReadRefs, declaredFieldExpressions, declaredFieldReads, gateItemReads, ruleContextReads, ruleExpressions, ruleOkTargets, ruleReads, } from './read-walk.js';
|
|
12
|
+
export { inspectDeps } from './inspect.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/graph/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,SAAS,GACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC","sourcesContent":["/**\n * The dependency facts of a compiled artifact, and the one index they are derived against.\n *\n * Four modules, one job each: `record-index` derives the declared shape a path is resolved\n * against, `read-walk` answers what a set of expressions reads, `inspect` turns those reads into\n * a recalculation order or states why there is none, and `freeze` is the one step that makes an\n * artifact safe to cache against. This module is their public surface and holds no behaviour of\n * its own, so a caller reaches one entry point and each rule lives in exactly one file.\n */\nexport { recordIndexFromDeclarations } from './record-index.js';\nexport {\n collectReadRefs,\n declaredFieldExpressions,\n declaredFieldReads,\n gateItemReads,\n ruleContextReads,\n ruleExpressions,\n ruleOkTargets,\n ruleReads,\n} from './read-walk.js';\nexport type { CollectedReads, ReadRef } from './read-walk.js';\nexport { inspectDeps } from './inspect.js';\nexport type {\n ComputedDependency,\n DependencyInspection,\n DependencyInspectionOptions,\n DependencyProblem,\n DependencyReport,\n RuleDependency,\n} from './inspect.js';\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { FieldRef, RuleKind, RuleScope } from '../model/types.js';
|
|
2
|
+
import type { CompiledSchema } from '../model/schema.js';
|
|
3
|
+
/**
|
|
4
|
+
* The derived dependency graph of a compiled artifact.
|
|
5
|
+
*
|
|
6
|
+
* A report states the fields a rule read, the compiler refuses a computed cycle before it can
|
|
7
|
+
* reach a device, and a reactive engine needs the recalculation order. This module is the second
|
|
8
|
+
* half of that answer: the read walk says what one rule reads, and the inspection turns those
|
|
9
|
+
* reads into an order, or states why no order exists.
|
|
10
|
+
*/
|
|
11
|
+
/** One rule's derived dependencies, in schema declaration order. */
|
|
12
|
+
export interface RuleDependency {
|
|
13
|
+
readonly ruleId: string;
|
|
14
|
+
readonly kind: RuleKind;
|
|
15
|
+
readonly scope: RuleScope;
|
|
16
|
+
readonly fieldId?: string;
|
|
17
|
+
/** The targets a multi-target `visible` or `enabled` rule decides. */
|
|
18
|
+
readonly fieldIds?: readonly string[];
|
|
19
|
+
/** Every declared field the rule reads. */
|
|
20
|
+
readonly reads: readonly FieldRef[];
|
|
21
|
+
/** Every declared context root the rule reads, which the session closure keys on. */
|
|
22
|
+
readonly contextReads: readonly string[];
|
|
23
|
+
/** The rules a gate names. */
|
|
24
|
+
readonly dependsOnRules: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
/** One computed field's place in the recalculation order. */
|
|
27
|
+
export interface ComputedDependency {
|
|
28
|
+
readonly fieldId: string;
|
|
29
|
+
readonly ruleId: string;
|
|
30
|
+
readonly scope: RuleScope;
|
|
31
|
+
/** The computed fields this rule reads, which must be recalculated first. */
|
|
32
|
+
readonly readsComputed: readonly string[];
|
|
33
|
+
}
|
|
34
|
+
/** The derived dependency graph a reactive engine and an auditor both read. */
|
|
35
|
+
export interface DependencyReport {
|
|
36
|
+
readonly rules: readonly RuleDependency[];
|
|
37
|
+
readonly computed: readonly ComputedDependency[];
|
|
38
|
+
}
|
|
39
|
+
/** A dependency the artifact cannot satisfy, which the compiler refuses. */
|
|
40
|
+
export interface DependencyProblem {
|
|
41
|
+
readonly code: 'CYCLE_DETECTED' | 'DUPLICATE_WRITER';
|
|
42
|
+
readonly fieldId: string;
|
|
43
|
+
readonly ruleIds: readonly string[];
|
|
44
|
+
}
|
|
45
|
+
/** The inspection's verdict: a usable graph, or the reasons this artifact has none. */
|
|
46
|
+
export type DependencyInspection = {
|
|
47
|
+
readonly ok: true;
|
|
48
|
+
readonly report: DependencyReport;
|
|
49
|
+
} | {
|
|
50
|
+
readonly ok: false;
|
|
51
|
+
readonly problems: readonly DependencyProblem[];
|
|
52
|
+
};
|
|
53
|
+
/** How an inspection orders a writer that reads the field it writes. */
|
|
54
|
+
export interface DependencyInspectionOptions {
|
|
55
|
+
/**
|
|
56
|
+
* `'cycle'` is the default and refuses a self-read: a reactive engine cannot place a writer
|
|
57
|
+
* after itself, so an artifact it would loop on has no recalculation order.
|
|
58
|
+
*
|
|
59
|
+
* `'base-value'` places the writer as if that read were the submission's own value, which
|
|
60
|
+
* is what a one-shot evaluation delivers: the writer produces its result once, and a read
|
|
61
|
+
* made while it runs sees the value already submitted. Only a cycle between two different
|
|
62
|
+
* fields still has no order under this reading.
|
|
63
|
+
*/
|
|
64
|
+
readonly selfReads?: 'cycle' | 'base-value';
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Derives every rule's reads and rule dependencies, and orders the computed fields so a
|
|
68
|
+
* writer is recalculated after everything it reads.
|
|
69
|
+
*
|
|
70
|
+
* An artifact whose computed fields form a cycle, or whose field has two writers, has no
|
|
71
|
+
* recalculation order at all, so the inspection refuses it rather than choosing one: a
|
|
72
|
+
* reactive engine built on an arbitrary order would report a value that depends on where
|
|
73
|
+
* it started.
|
|
74
|
+
*/
|
|
75
|
+
export declare function inspectDeps(compiled: CompiledSchema, options?: DependencyInspectionOptions): DependencyInspection;
|
|
76
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/graph/inspect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA+B,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACpG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKzD;;;;;;;GAOG;AAEH,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,qFAAqF;IACrF,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IACzC,8BAA8B;IAC9B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5C;AAED,6DAA6D;AAC7D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3C;AAED,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,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