niceeval 0.15.1-canary.76 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +45 -40
- package/dist/adapter-execution-trace.cjs.map +1 -1
- package/dist/adapter-execution-trace.d.cts +26 -0
- package/dist/adapter-execution-trace.d.mts +26 -0
- package/dist/adapter-execution-trace.d.ts +26 -0
- package/dist/adapter-usage.cjs.map +1 -1
- package/dist/adapter-usage.d.cts +9 -0
- package/dist/adapter-usage.d.mts +9 -0
- package/dist/adapter-usage.d.ts +9 -0
- package/dist/adapter.cjs +19 -4
- package/dist/adapter.cjs.map +1 -1
- package/dist/adapter.d.cts +37 -12
- package/dist/adapter.d.mts +37 -12
- package/dist/adapter.d.ts +37 -12
- package/dist/agents/ai-sdk.cjs +3 -0
- package/dist/agents/ai-sdk.cjs.map +1 -1
- package/dist/agents/bub.cjs +3 -0
- package/dist/agents/bub.cjs.map +1 -1
- package/dist/agents/claude-code-native.cjs +28 -2
- package/dist/agents/claude-code-native.cjs.map +1 -1
- package/dist/agents/claude-code.cjs +3 -0
- package/dist/agents/claude-code.cjs.map +1 -1
- package/dist/agents/codex.cjs +3 -0
- package/dist/agents/codex.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.cjs +9 -10
- package/dist/agents/coding-cli-versions.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.d.cts +1 -1
- package/dist/agents/coding-cli-versions.d.mts +1 -1
- package/dist/agents/coding-cli-versions.d.ts +1 -1
- package/dist/agents/deepseek-harness.cjs +3 -0
- package/dist/agents/deepseek-harness.cjs.map +1 -1
- package/dist/agents/hermes.cjs +3 -0
- package/dist/agents/hermes.cjs.map +1 -1
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +3 -2
- package/dist/agents/index.d.mts +3 -2
- package/dist/agents/index.d.ts +3 -2
- package/dist/agents/omp.cjs +3 -0
- package/dist/agents/omp.cjs.map +1 -1
- package/dist/agents/openai-compat.cjs +6 -0
- package/dist/agents/openai-compat.cjs.map +1 -1
- package/dist/agents/openclaw.cjs +3 -0
- package/dist/agents/openclaw.cjs.map +1 -1
- package/dist/agents/opencode.cjs +3 -0
- package/dist/agents/opencode.cjs.map +1 -1
- package/dist/agents/sdk-streams.cjs +9 -0
- package/dist/agents/sdk-streams.cjs.map +1 -1
- package/dist/agents/ui-message-stream.cjs +3 -0
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/assertions/api.cjs.map +1 -1
- package/dist/assertions/api.d.cts +27 -5
- package/dist/assertions/api.d.mts +27 -5
- package/dist/assertions/api.d.ts +27 -5
- package/dist/assertions/collection.cjs +6 -0
- package/dist/assertions/collection.cjs.map +1 -1
- package/dist/assertions/collection.d.cts +4 -2
- package/dist/assertions/collection.d.mts +4 -2
- package/dist/assertions/collection.d.ts +4 -2
- package/dist/assertions/collection.js +12 -8
- package/dist/assertions/context-match.cjs +70 -0
- package/dist/assertions/context-match.cjs.map +1 -0
- package/dist/assertions/context-match.d.cts +107 -0
- package/dist/assertions/context-match.d.mts +107 -0
- package/dist/assertions/context-match.d.ts +107 -0
- package/dist/assertions/context-match.js +12 -0
- package/dist/assertions/context-match.js.map +1 -0
- package/dist/assertions/full-content.cjs +109 -0
- package/dist/assertions/full-content.cjs.map +1 -0
- package/dist/assertions/full-content.d.cts +6 -0
- package/dist/assertions/full-content.d.mts +6 -0
- package/dist/assertions/full-content.d.ts +6 -0
- package/dist/assertions/full-content.js +12 -0
- package/dist/assertions/full-content.js.map +1 -0
- package/dist/assertions/judge-presets.cjs +2 -34
- package/dist/assertions/judge-presets.cjs.map +1 -1
- package/dist/assertions/judge-presets.d.cts +6 -9
- package/dist/assertions/judge-presets.d.mts +6 -9
- package/dist/assertions/judge-presets.d.ts +6 -9
- package/dist/assertions/judge-presets.js +8 -8
- package/dist/assertions/judge.cjs +107 -29
- package/dist/assertions/judge.cjs.map +1 -1
- package/dist/assertions/judge.d.cts +2 -0
- package/dist/assertions/judge.d.mts +2 -0
- package/dist/assertions/judge.d.ts +2 -0
- package/dist/assertions/match.cjs +244 -5
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +43 -3
- package/dist/assertions/match.d.mts +43 -3
- package/dist/assertions/match.d.ts +43 -3
- package/dist/assertions/match.js +88 -78
- package/dist/assertions/material.cjs +520 -0
- package/dist/assertions/material.cjs.map +1 -0
- package/dist/assertions/material.d.cts +56 -0
- package/dist/assertions/material.d.mts +56 -0
- package/dist/assertions/material.d.ts +56 -0
- package/dist/assertions/material.js +20 -0
- package/dist/assertions/material.js.map +1 -0
- package/dist/assertions/record/attachment.cjs +5 -2
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/codec.cjs +2 -1
- package/dist/assertions/record/codec.cjs.map +1 -1
- package/dist/assertions/record/model.cjs.map +1 -1
- package/dist/assertions/record/model.d.cts +6 -1
- package/dist/assertions/record/model.d.mts +6 -1
- package/dist/assertions/record/model.d.ts +6 -1
- package/dist/assertions/runtime.cjs +207 -14
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/assertions/runtime.d.cts +9 -0
- package/dist/assertions/runtime.d.mts +9 -0
- package/dist/assertions/runtime.d.ts +9 -0
- package/dist/assertions/runtime.js +14 -8
- package/dist/assertions/score-match-audit.cjs +18 -8
- package/dist/assertions/score-match-audit.cjs.map +1 -1
- package/dist/assertions/score-match-gateway.cjs +83 -25
- package/dist/assertions/score-match-gateway.cjs.map +1 -1
- package/dist/assertions/score-match-gateway.d.cts +2 -0
- package/dist/assertions/score-match-gateway.d.mts +2 -0
- package/dist/assertions/score-match-gateway.d.ts +2 -0
- package/dist/assertions/value-composition.test-d.cjs +77 -0
- package/dist/assertions/value-composition.test-d.cjs.map +1 -0
- package/dist/assertions/value-composition.test-d.d.cts +1 -0
- package/dist/assertions/value-composition.test-d.d.mts +1 -0
- package/dist/assertions/value-composition.test-d.d.ts +1 -0
- package/dist/assertions/value-composition.test-d.js +4 -0
- package/dist/assertions/value-composition.test-d.js.map +1 -0
- package/dist/context/assert-first.cjs +207 -213
- package/dist/context/assert-first.cjs.map +1 -1
- package/dist/context/assert-first.d.cts +49 -23
- package/dist/context/assert-first.d.mts +49 -23
- package/dist/context/assert-first.d.ts +49 -23
- package/dist/context/session.cjs +111 -9
- package/dist/context/session.cjs.map +1 -1
- package/dist/context/session.d.cts +18 -0
- package/dist/context/session.d.mts +18 -0
- package/dist/context/session.d.ts +18 -0
- package/dist/define.cjs +17 -1
- package/dist/define.cjs.map +1 -1
- package/dist/eval/cli/contribution.cjs +2 -0
- package/dist/eval/cli/contribution.cjs.map +1 -1
- package/dist/eval/host/index.cjs +2 -0
- package/dist/eval/host/index.cjs.map +1 -1
- package/dist/eval/record/evaluation.cjs +3 -0
- package/dist/eval/record/evaluation.cjs.map +1 -1
- package/dist/eval/record/membership-provenance.d.cts +15 -15
- package/dist/eval/record/membership-provenance.d.mts +15 -15
- package/dist/eval/record/membership-provenance.d.ts +15 -15
- package/dist/eval/record/score.cjs +7 -0
- package/dist/eval/record/score.cjs.map +1 -1
- package/dist/eval/record/sealed-assertion.cjs +3 -0
- package/dist/eval/record/sealed-assertion.cjs.map +1 -1
- package/dist/eval/record/verdict.cjs +7 -0
- package/dist/eval/record/verdict.cjs.map +1 -1
- package/dist/expect/index.cjs +8 -2
- package/dist/expect/index.cjs.map +1 -1
- package/dist/expect/index.d.cts +9 -4
- package/dist/expect/index.d.mts +9 -4
- package/dist/expect/index.d.ts +9 -4
- package/dist/expect/index.js +72 -62
- package/dist/expect/index.mjs +72 -62
- package/dist/experiment/host/cli/contribution.cjs +37 -23
- package/dist/experiment/host/cli/contribution.cjs.map +1 -1
- package/dist/experiment/host/cli/contribution.d.cts +9 -1
- package/dist/experiment/host/cli/contribution.d.mts +9 -1
- package/dist/experiment/host/cli/contribution.d.ts +9 -1
- package/dist/experiment/host/current.cjs +74 -0
- package/dist/experiment/host/current.cjs.map +1 -0
- package/dist/experiment/host/current.d.cts +33 -0
- package/dist/experiment/host/current.d.mts +33 -0
- package/dist/experiment/host/current.d.ts +33 -0
- package/dist/experiment/host/current.js +10 -0
- package/dist/experiment/host/current.js.map +1 -0
- package/dist/experiment/host/index.cjs +17 -174
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/experiment/host/index.d.cts +8 -54
- package/dist/experiment/host/index.d.mts +8 -54
- package/dist/experiment/host/index.d.ts +8 -54
- package/dist/experiment/host/operations.cjs +33 -10
- package/dist/experiment/host/operations.cjs.map +1 -1
- package/dist/experiment/host/operations.d.cts +29 -1
- package/dist/experiment/host/operations.d.mts +29 -1
- package/dist/experiment/host/operations.d.ts +29 -1
- package/dist/experiment/host/operations.js +6 -4
- package/dist/experiment/host/requirements.cjs +3 -0
- package/dist/experiment/host/requirements.cjs.map +1 -0
- package/dist/experiment/host/requirements.d.cts +3 -0
- package/dist/experiment/host/requirements.d.mts +3 -0
- package/dist/experiment/host/requirements.d.ts +3 -0
- package/dist/experiment/host/requirements.js +4 -0
- package/dist/experiment/host/requirements.js.map +1 -0
- package/dist/experiment/host/runtime.cjs +179 -0
- package/dist/experiment/host/runtime.cjs.map +1 -0
- package/dist/experiment/host/runtime.d.cts +79 -0
- package/dist/experiment/host/runtime.d.mts +79 -0
- package/dist/experiment/host/runtime.d.ts +79 -0
- package/dist/experiment/host/runtime.js +6 -0
- package/dist/experiment/host/runtime.js.map +1 -0
- package/dist/experiment/host/types.cjs.map +1 -1
- package/dist/experiment/host/types.d.cts +17 -16
- package/dist/experiment/host/types.d.mts +17 -16
- package/dist/experiment/host/types.d.ts +17 -16
- package/dist/fresh-import.cjs +2 -1
- package/dist/fresh-import.cjs.map +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -6
- package/dist/index.d.mts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.js +32 -30
- package/dist/index.mjs +32 -30
- package/dist/inspection/artifacts.cjs +83 -54
- package/dist/inspection/artifacts.cjs.map +1 -1
- package/dist/inspection/artifacts.d.cts +8 -0
- package/dist/inspection/artifacts.d.mts +8 -0
- package/dist/inspection/artifacts.d.ts +8 -0
- package/dist/inspection/artifacts.js +2 -0
- package/dist/inspection/assertions.cjs +4 -1
- package/dist/inspection/assertions.cjs.map +1 -1
- package/dist/inspection/cli/contribution.cjs +27 -4
- package/dist/inspection/cli/contribution.cjs.map +1 -1
- package/dist/inspection/cli/contribution.d.cts +2 -1
- package/dist/inspection/cli/contribution.d.mts +2 -1
- package/dist/inspection/cli/contribution.d.ts +2 -1
- package/dist/inspection/execution-traces.cjs +114 -8
- package/dist/inspection/execution-traces.cjs.map +1 -1
- package/dist/inspection/execution-traces.d.cts +38 -0
- package/dist/inspection/execution-traces.d.mts +38 -0
- package/dist/inspection/execution-traces.d.ts +38 -0
- package/dist/inspection/facts.cjs +12 -0
- package/dist/inspection/facts.cjs.map +1 -1
- package/dist/inspection/limits.cjs +5 -1
- package/dist/inspection/limits.cjs.map +1 -1
- package/dist/inspection/limits.d.cts +4 -0
- package/dist/inspection/limits.d.mts +4 -0
- package/dist/inspection/limits.d.ts +4 -0
- package/dist/inspection/limits.js +6 -2
- package/dist/inspection/overview.cjs +74 -33
- package/dist/inspection/overview.cjs.map +1 -1
- package/dist/inspection/overview.d.cts +19 -1
- package/dist/inspection/overview.d.mts +19 -1
- package/dist/inspection/overview.d.ts +19 -1
- package/dist/inspection/overview.js +4 -2
- package/dist/inspection/project-input.cjs +9 -0
- package/dist/inspection/project-input.cjs.map +1 -0
- package/dist/inspection/project-input.d.cts +20 -0
- package/dist/inspection/project-input.d.mts +20 -0
- package/dist/inspection/project-input.d.ts +20 -0
- package/dist/inspection/project-input.js +8 -0
- package/dist/inspection/project-input.js.map +1 -0
- package/dist/inspection/project-result.cjs +60 -0
- package/dist/inspection/project-result.cjs.map +1 -0
- package/dist/inspection/project-result.d.cts +1264 -0
- package/dist/inspection/project-result.d.mts +1264 -0
- package/dist/inspection/project-result.d.ts +1264 -0
- package/dist/inspection/project-result.js +10 -0
- package/dist/inspection/project-result.js.map +1 -0
- package/dist/inspection/project-source.cjs +109 -0
- package/dist/inspection/project-source.cjs.map +1 -0
- package/dist/inspection/project-source.d.cts +10 -0
- package/dist/inspection/project-source.d.mts +10 -0
- package/dist/inspection/project-source.d.ts +10 -0
- package/dist/inspection/project-source.js +6 -0
- package/dist/inspection/project-source.js.map +1 -0
- package/dist/inspection/project.cjs +100 -0
- package/dist/inspection/project.cjs.map +1 -0
- package/dist/inspection/project.d.cts +3 -0
- package/dist/inspection/project.d.mts +3 -0
- package/dist/inspection/project.d.ts +3 -0
- package/dist/inspection/project.js +6 -0
- package/dist/inspection/project.js.map +1 -0
- package/dist/inspection/protocol.cjs +19 -9
- package/dist/inspection/protocol.cjs.map +1 -1
- package/dist/inspection/protocol.d.cts +5506 -38189
- package/dist/inspection/protocol.d.mts +5506 -38189
- package/dist/inspection/protocol.d.ts +5506 -38189
- package/dist/inspection/public.mjs +896 -84
- package/dist/inspection/query.cjs +2 -0
- package/dist/inspection/query.cjs.map +1 -1
- package/dist/inspection/results.cjs +234 -29
- package/dist/inspection/results.cjs.map +1 -1
- package/dist/inspection/results.d.cts +870 -13
- package/dist/inspection/results.d.mts +870 -13
- package/dist/inspection/results.d.ts +870 -13
- package/dist/inspection/results.js +36 -34
- package/dist/inspection/select.cjs +126 -14
- package/dist/inspection/select.cjs.map +1 -1
- package/dist/inspection/select.d.cts +1 -1
- package/dist/inspection/select.d.mts +1 -1
- package/dist/inspection/select.d.ts +1 -1
- package/dist/inspection/source.cjs +4 -0
- package/dist/inspection/source.cjs.map +1 -1
- package/dist/inspection/sources.cjs +5 -0
- package/dist/inspection/sources.cjs.map +1 -1
- package/dist/inspection/trace.cjs +82 -84
- package/dist/inspection/trace.cjs.map +1 -1
- package/dist/inspection/trace.d.cts +7 -2
- package/dist/inspection/trace.d.mts +7 -2
- package/dist/inspection/trace.d.ts +7 -2
- package/dist/model-slots.cjs +35 -0
- package/dist/model-slots.cjs.map +1 -0
- package/dist/model-slots.d.cts +19 -0
- package/dist/model-slots.d.mts +19 -0
- package/dist/model-slots.d.ts +19 -0
- package/dist/model-slots.js +8 -0
- package/dist/model-slots.js.map +1 -0
- package/dist/o11y/adapter-call-price.cjs +4 -0
- package/dist/o11y/adapter-call-price.cjs.map +1 -1
- package/dist/o11y/adapter-call-price.d.cts +24 -0
- package/dist/o11y/adapter-call-price.d.mts +24 -0
- package/dist/o11y/adapter-call-price.d.ts +24 -0
- package/dist/o11y/adapter-call-price.js +6 -2
- package/dist/o11y/adapter-usage-projection.cjs +158 -0
- package/dist/o11y/adapter-usage-projection.cjs.map +1 -0
- package/dist/o11y/adapter-usage-projection.d.cts +141 -0
- package/dist/o11y/adapter-usage-projection.d.mts +141 -0
- package/dist/o11y/adapter-usage-projection.d.ts +141 -0
- package/dist/o11y/adapter-usage-projection.js +20 -0
- package/dist/o11y/adapter-usage-projection.js.map +1 -0
- package/dist/o11y/eval-usage.cjs +149 -0
- package/dist/o11y/eval-usage.cjs.map +1 -0
- package/dist/o11y/eval-usage.d.cts +46 -0
- package/dist/o11y/eval-usage.d.mts +46 -0
- package/dist/o11y/eval-usage.d.ts +46 -0
- package/dist/o11y/eval-usage.js +8 -0
- package/dist/o11y/eval-usage.js.map +1 -0
- package/dist/o11y/judge-call-price.cjs +62 -0
- package/dist/o11y/judge-call-price.cjs.map +1 -0
- package/dist/o11y/judge-call-price.d.cts +3 -0
- package/dist/o11y/judge-call-price.d.mts +3 -0
- package/dist/o11y/judge-call-price.d.ts +3 -0
- package/dist/o11y/judge-call-price.js +6 -0
- package/dist/o11y/judge-call-price.js.map +1 -0
- package/dist/o11y/judge-usage-projection.cjs +134 -0
- package/dist/o11y/judge-usage-projection.cjs.map +1 -0
- package/dist/o11y/judge-usage-projection.d.cts +18 -0
- package/dist/o11y/judge-usage-projection.d.mts +18 -0
- package/dist/o11y/judge-usage-projection.d.ts +18 -0
- package/dist/o11y/judge-usage-projection.js +20 -0
- package/dist/o11y/judge-usage-projection.js.map +1 -0
- package/dist/o11y/judge-usage-receipt.cjs +135 -0
- package/dist/o11y/judge-usage-receipt.cjs.map +1 -0
- package/dist/o11y/judge-usage-receipt.d.cts +5 -0
- package/dist/o11y/judge-usage-receipt.d.mts +5 -0
- package/dist/o11y/judge-usage-receipt.d.ts +5 -0
- package/dist/o11y/judge-usage-receipt.js +6 -0
- package/dist/o11y/judge-usage-receipt.js.map +1 -0
- package/dist/o11y/judge-usage.cjs +171 -0
- package/dist/o11y/judge-usage.cjs.map +1 -0
- package/dist/o11y/judge-usage.d.cts +35 -0
- package/dist/o11y/judge-usage.d.mts +35 -0
- package/dist/o11y/judge-usage.d.ts +35 -0
- package/dist/o11y/judge-usage.js +6 -0
- package/dist/o11y/judge-usage.js.map +1 -0
- package/dist/plugin/contracts.cjs +2 -0
- package/dist/plugin/contracts.cjs.map +1 -1
- package/dist/plugin/link.cjs +7 -0
- package/dist/plugin/link.cjs.map +1 -1
- package/dist/record/attachment/protocol.cjs +8 -6
- package/dist/record/attachment/protocol.cjs.map +1 -1
- package/dist/record/attachment/protocol.d.cts +10 -0
- package/dist/record/attachment/protocol.d.mts +10 -0
- package/dist/record/attachment/protocol.d.ts +10 -0
- package/dist/record/attachment/protocol.js +38 -36
- package/dist/record/codec/seal-manifest.d.cts +3 -3
- package/dist/record/codec/seal-manifest.d.mts +3 -3
- package/dist/record/codec/seal-manifest.d.ts +3 -3
- package/dist/record/family/adapter-usage/definition.d.cts +1 -0
- package/dist/record/family/adapter-usage/definition.d.mts +1 -0
- package/dist/record/family/adapter-usage/definition.d.ts +1 -0
- package/dist/record/family/adapter-usage/persistence.cjs +1 -1
- package/dist/record/family/adapter-usage/persistence.cjs.map +1 -1
- package/dist/record/family/adapter-usage/persistence.d.cts +2 -1
- package/dist/record/family/adapter-usage/persistence.d.mts +2 -1
- package/dist/record/family/adapter-usage/persistence.d.ts +2 -1
- package/dist/record/family/adapter-usage/schema.cjs +21 -2
- package/dist/record/family/adapter-usage/schema.cjs.map +1 -1
- package/dist/record/family/adapter-usage/schema.d.cts +85 -0
- package/dist/record/family/adapter-usage/schema.d.mts +85 -0
- package/dist/record/family/adapter-usage/schema.d.ts +85 -0
- package/dist/record/family/adapter-usage/schema.js +18 -12
- package/dist/record/family/catalog.cjs +31 -27
- package/dist/record/family/catalog.cjs.map +1 -1
- package/dist/record/family/catalog.d.cts +94 -3
- package/dist/record/family/catalog.d.mts +94 -3
- package/dist/record/family/catalog.d.ts +94 -3
- package/dist/record/family/current.cjs +45 -42
- package/dist/record/family/current.cjs.map +1 -1
- package/dist/record/family/current.d.cts +240 -1
- package/dist/record/family/current.d.mts +240 -1
- package/dist/record/family/current.d.ts +240 -1
- package/dist/record/family/execution-traces/definition.d.cts +26 -0
- package/dist/record/family/execution-traces/definition.d.mts +26 -0
- package/dist/record/family/execution-traces/definition.d.ts +26 -0
- package/dist/record/family/execution-traces/definition.js +20 -14
- package/dist/record/family/execution-traces/schema.cjs +57 -1
- package/dist/record/family/execution-traces/schema.cjs.map +1 -1
- package/dist/record/family/execution-traces/schema.d.cts +114 -0
- package/dist/record/family/execution-traces/schema.d.mts +114 -0
- package/dist/record/family/execution-traces/schema.d.ts +114 -0
- package/dist/record/family/execution-traces/schema.js +18 -12
- package/dist/record/family/judge-usage/definition.cjs +12 -0
- package/dist/record/family/judge-usage/definition.cjs.map +1 -0
- package/dist/record/family/judge-usage/definition.d.cts +91 -0
- package/dist/record/family/judge-usage/definition.d.mts +91 -0
- package/dist/record/family/judge-usage/definition.d.ts +91 -0
- package/dist/record/family/judge-usage/definition.js +6 -0
- package/dist/record/family/judge-usage/definition.js.map +1 -0
- package/dist/record/family/judge-usage/persistence.cjs +10 -0
- package/dist/record/family/judge-usage/persistence.cjs.map +1 -0
- package/dist/record/family/judge-usage/persistence.d.cts +91 -0
- package/dist/record/family/judge-usage/persistence.d.mts +91 -0
- package/dist/record/family/judge-usage/persistence.d.ts +91 -0
- package/dist/record/family/judge-usage/persistence.js +6 -0
- package/dist/record/family/judge-usage/persistence.js.map +1 -0
- package/dist/record/family/judge-usage/schema.cjs +307 -0
- package/dist/record/family/judge-usage/schema.cjs.map +1 -0
- package/dist/record/family/judge-usage/schema.d.cts +351 -0
- package/dist/record/family/judge-usage/schema.d.mts +351 -0
- package/dist/record/family/judge-usage/schema.d.ts +351 -0
- package/dist/record/family/judge-usage/schema.js +18 -0
- package/dist/record/family/judge-usage/schema.js.map +1 -0
- package/dist/record/host/sqlite-host.cjs +55 -9
- package/dist/record/host/sqlite-host.cjs.map +1 -1
- package/dist/record/host/types.cjs.map +1 -1
- package/dist/record/host/types.d.cts +7 -0
- package/dist/record/host/types.d.mts +7 -0
- package/dist/record/host/types.d.ts +7 -0
- package/dist/record/model/run-context.cjs +7 -1
- package/dist/record/model/run-context.cjs.map +1 -1
- package/dist/record/model/run-context.d.cts +4 -0
- package/dist/record/model/run-context.d.mts +4 -0
- package/dist/record/model/run-context.d.ts +4 -0
- package/dist/record/model/seal-manifest.d.cts +1 -1
- package/dist/record/model/seal-manifest.d.mts +1 -1
- package/dist/record/model/seal-manifest.d.ts +1 -1
- package/dist/record/sqlite/client.cjs +18 -5
- package/dist/record/sqlite/client.cjs.map +1 -1
- package/dist/record/sqlite/client.d.cts +1 -1
- package/dist/record/sqlite/client.d.mts +1 -1
- package/dist/record/sqlite/client.d.ts +1 -1
- package/dist/record/sqlite/project-state-database.cjs +29 -8
- package/dist/record/sqlite/project-state-database.cjs.map +1 -1
- package/dist/run/host/runtime.cjs +4 -0
- package/dist/run/host/runtime.cjs.map +1 -1
- package/dist/run/storage/sqlite.cjs +20 -0
- package/dist/run/storage/sqlite.cjs.map +1 -1
- package/dist/runner/adapter-execution-trace.cjs +125 -2
- package/dist/runner/adapter-execution-trace.cjs.map +1 -1
- package/dist/runner/adapter-execution-trace.d.cts +1 -1
- package/dist/runner/adapter-execution-trace.d.mts +1 -1
- package/dist/runner/adapter-execution-trace.d.ts +1 -1
- package/dist/runner/adapter-usage.cjs +55 -7
- package/dist/runner/adapter-usage.cjs.map +1 -1
- package/dist/runner/adapter-usage.d.cts +9 -2
- package/dist/runner/adapter-usage.d.mts +9 -2
- package/dist/runner/adapter-usage.d.ts +9 -2
- package/dist/runner/adoption.cjs +9 -0
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/attempt-cancellation.cjs +12 -0
- package/dist/runner/attempt-cancellation.cjs.map +1 -0
- package/dist/runner/attempt-cancellation.d.cts +6 -0
- package/dist/runner/attempt-cancellation.d.mts +6 -0
- package/dist/runner/attempt-cancellation.d.ts +6 -0
- package/dist/runner/attempt-cancellation.js +6 -0
- package/dist/runner/attempt-cancellation.js.map +1 -0
- package/dist/runner/attempt-resources.cjs +10 -4
- package/dist/runner/attempt-resources.cjs.map +1 -1
- package/dist/runner/attempt-resources.d.cts +2 -1
- package/dist/runner/attempt-resources.d.mts +2 -1
- package/dist/runner/attempt-resources.d.ts +2 -1
- package/dist/runner/attempt.cjs +1177 -1139
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/runner/config-identity.cjs +20 -1
- package/dist/runner/config-identity.cjs.map +1 -1
- package/dist/runner/config-identity.d.cts +5 -0
- package/dist/runner/config-identity.d.mts +5 -0
- package/dist/runner/config-identity.d.ts +5 -0
- package/dist/runner/discover.cjs +14 -0
- package/dist/runner/discover.cjs.map +1 -1
- package/dist/runner/discover.d.cts +3 -0
- package/dist/runner/discover.d.mts +3 -0
- package/dist/runner/discover.d.ts +3 -0
- package/dist/runner/feedback/human.cjs +9 -4
- package/dist/runner/feedback/human.cjs.map +1 -1
- package/dist/runner/fingerprint.cjs +1 -0
- package/dist/runner/fingerprint.cjs.map +1 -1
- package/dist/runner/judge-usage.cjs +18 -0
- package/dist/runner/judge-usage.cjs.map +1 -0
- package/dist/runner/judge-usage.d.cts +5 -0
- package/dist/runner/judge-usage.d.mts +5 -0
- package/dist/runner/judge-usage.d.ts +5 -0
- package/dist/runner/judge-usage.js +8 -0
- package/dist/runner/judge-usage.js.map +1 -0
- package/dist/runner/project-target.cjs.map +1 -1
- package/dist/runner/project-target.d.cts +2 -0
- package/dist/runner/project-target.d.mts +2 -0
- package/dist/runner/project-target.d.ts +2 -0
- package/dist/runner/record/planning.cjs +1 -0
- package/dist/runner/record/planning.cjs.map +1 -1
- package/dist/runner/record.cjs +4 -0
- package/dist/runner/record.cjs.map +1 -1
- package/dist/runner/reporters/braintrust.cjs +2 -0
- package/dist/runner/reporters/braintrust.cjs.map +1 -1
- package/dist/runner/reuse-diagnostics.cjs +9 -10
- package/dist/runner/reuse-diagnostics.cjs.map +1 -1
- package/dist/runner/reuse-diagnostics.d.cts +5 -6
- package/dist/runner/reuse-diagnostics.d.mts +5 -6
- package/dist/runner/reuse-diagnostics.d.ts +5 -6
- package/dist/runner/reuse-diagnostics.js +4 -4
- package/dist/runner/reuse-plan.cjs +100 -48
- package/dist/runner/reuse-plan.cjs.map +1 -1
- package/dist/runner/reuse-plan.d.cts +60 -3
- package/dist/runner/reuse-plan.d.mts +60 -3
- package/dist/runner/reuse-plan.d.ts +60 -3
- package/dist/runner/reuse-plan.js +14 -10
- package/dist/runner/run.cjs +8 -6
- package/dist/runner/run.cjs.map +1 -1
- package/dist/runner/session.cjs +1 -1
- package/dist/runner/session.cjs.map +1 -1
- package/dist/runner/session.d.cts +1 -1
- package/dist/runner/session.d.mts +1 -1
- package/dist/runner/session.d.ts +1 -1
- package/dist/runner/source-producer.cjs +3 -1
- package/dist/runner/source-producer.cjs.map +1 -1
- package/dist/runner/types.cjs.map +1 -1
- package/dist/runner/types.d.cts +26 -5
- package/dist/runner/types.d.mts +26 -5
- package/dist/runner/types.d.ts +26 -5
- package/dist/sandbox/action.cjs +3 -0
- package/dist/sandbox/action.cjs.map +1 -1
- package/dist/sandbox/commands.cjs +3 -0
- package/dist/sandbox/commands.cjs.map +1 -1
- package/dist/sandbox/compose.cjs +6 -0
- package/dist/sandbox/compose.cjs.map +1 -1
- package/dist/sandbox/docker-profile/registry.cjs +7 -0
- package/dist/sandbox/docker-profile/registry.cjs.map +1 -1
- package/dist/sandbox/docker-profile/runtime.cjs +3 -0
- package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.cjs +7 -0
- package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
- package/dist/sandbox/incus.cjs +7 -0
- package/dist/sandbox/incus.cjs.map +1 -1
- package/dist/sandbox/layer.cjs +12 -0
- package/dist/sandbox/layer.cjs.map +1 -1
- package/dist/shared/adapter-cleanup.cjs +18 -0
- package/dist/shared/adapter-cleanup.cjs.map +1 -0
- package/dist/shared/adapter-cleanup.d.cts +4 -0
- package/dist/shared/adapter-cleanup.d.mts +4 -0
- package/dist/shared/adapter-cleanup.d.ts +4 -0
- package/dist/shared/adapter-cleanup.js +10 -0
- package/dist/shared/adapter-cleanup.js.map +1 -0
- package/dist/shared/attempt-lifecycle.cjs +3 -0
- package/dist/shared/attempt-lifecycle.cjs.map +1 -0
- package/dist/shared/attempt-lifecycle.d.cts +13 -0
- package/dist/shared/attempt-lifecycle.d.mts +13 -0
- package/dist/shared/attempt-lifecycle.d.ts +13 -0
- package/dist/shared/attempt-lifecycle.js +4 -0
- package/dist/shared/attempt-lifecycle.js.map +1 -0
- package/dist/show/contribution.cjs +52 -14
- package/dist/show/contribution.cjs.map +1 -1
- package/dist/show/contribution.d.cts +23 -1
- package/dist/show/contribution.d.mts +23 -1
- package/dist/show/contribution.d.ts +23 -1
- package/dist/show/model.cjs +8 -1
- package/dist/show/model.cjs.map +1 -1
- package/dist/show/model.d.cts +10 -1
- package/dist/show/model.d.mts +10 -1
- package/dist/show/model.d.ts +10 -1
- package/dist/show/render.cjs +287 -49
- package/dist/show/render.cjs.map +1 -1
- package/dist/show/render.d.cts +3 -0
- package/dist/show/render.d.mts +3 -0
- package/dist/show/render.d.ts +3 -0
- package/dist/sources/projector.cjs +3 -0
- package/dist/sources/projector.cjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/view/app-dist/.vite/manifest.json +2 -2
- package/dist/view/app-dist/assets/index-CmVoXbwG.js +63 -0
- package/dist/view/app-dist/assets/{quality-cost-scatter-CFB3wnkN.js → quality-cost-scatter-BuLISaH4.js} +1 -1
- package/dist/view/app-dist/index.html +1 -1
- package/dist/view/cli/contribution.cjs +54 -21
- package/dist/view/cli/contribution.cjs.map +1 -1
- package/dist/view/cli/contribution.d.cts +2 -1
- package/dist/view/cli/contribution.d.mts +2 -1
- package/dist/view/cli/contribution.d.ts +2 -1
- package/dist/view/function-runtime.mjs +13231 -11647
- package/dist/view/http-protocol.cjs +3 -0
- package/dist/view/http-protocol.cjs.map +1 -1
- package/dist/view/http-protocol.d.cts +8 -0
- package/dist/view/http-protocol.d.mts +8 -0
- package/dist/view/http-protocol.d.ts +8 -0
- package/dist/view/inspection-host.cjs +17 -1
- package/dist/view/inspection-host.cjs.map +1 -1
- package/dist/view/render.cjs +1 -0
- package/dist/view/render.cjs.map +1 -1
- package/dist/view/render.d.cts +2 -1
- package/dist/view/render.d.mts +2 -1
- package/dist/view/render.d.ts +2 -1
- package/dist/view/revision.cjs.map +1 -1
- package/dist/view/revision.d.cts +12 -0
- package/dist/view/revision.d.mts +12 -0
- package/dist/view/revision.d.ts +12 -0
- package/dist/view/server.cjs +10 -9
- package/dist/view/server.cjs.map +1 -1
- package/docs-site/zh/examples/ai-agent-application.mdx +1 -1
- package/docs-site/zh/explanation/adapter.mdx +2 -2
- package/docs-site/zh/explanation/assert.mdx +60 -24
- package/docs-site/zh/explanation/drive.mdx +1 -1
- package/docs-site/zh/explanation/evals.mdx +31 -29
- package/docs-site/zh/explanation/experiment.mdx +15 -15
- package/docs-site/zh/explanation/judge.mdx +23 -15
- package/docs-site/zh/explanation/overview.mdx +44 -21
- package/docs-site/zh/explanation/record.mdx +28 -13
- package/docs-site/zh/explanation/results-flow.mdx +37 -0
- package/docs-site/zh/explanation/runner.mdx +27 -6
- package/docs-site/zh/index.mdx +22 -115
- package/docs-site/zh/introduction.mdx +89 -61
- package/docs-site/zh/reference/cli.mdx +50 -26
- package/docs-site/zh/reference/define-agent.mdx +37 -5
- package/docs-site/zh/reference/define-eval.mdx +130 -29
- package/docs-site/zh/reference/define-experiment.mdx +251 -0
- package/docs-site/zh/reference/events.mdx +34 -30
- package/docs-site/zh/reference/expect.mdx +77 -2
- package/docs-site/zh/reference/official-adapters.mdx +2 -2
- package/docs-site/zh/troubleshooting/debug-sandbox.mdx +43 -24
- package/docs-site/zh/troubleshooting/debugging.mdx +65 -42
- package/docs-site/zh/troubleshooting/recover-after-kill.mdx +35 -28
- package/docs-site/zh/tutorials/accept-results.mdx +34 -24
- package/docs-site/zh/tutorials/agent-feedback-loop.mdx +74 -43
- package/docs-site/zh/tutorials/agent-onboarding.mdx +27 -20
- package/docs-site/zh/tutorials/authoring.mdx +138 -121
- package/docs-site/zh/tutorials/ci-integration.mdx +46 -22
- package/docs-site/zh/tutorials/compare-runs.mdx +40 -13
- package/docs-site/zh/tutorials/concurrency.mdx +66 -62
- package/docs-site/zh/tutorials/configuration.mdx +17 -17
- package/docs-site/zh/tutorials/connect-otel.mdx +48 -37
- package/docs-site/zh/tutorials/connect-your-agent.mdx +80 -173
- package/docs-site/zh/tutorials/control-run-cost.mdx +63 -12
- package/docs-site/zh/tutorials/criteria-files.mdx +28 -21
- package/docs-site/zh/tutorials/custom-application.mdx +75 -55
- package/docs-site/zh/tutorials/dataset-fanout.mdx +32 -22
- package/docs-site/zh/tutorials/debug-lifecycle-plan.mdx +38 -31
- package/docs-site/zh/tutorials/docker-in-docker.mdx +83 -89
- package/docs-site/zh/tutorials/eval-groups.mdx +70 -89
- package/docs-site/zh/tutorials/evaluation-kinds.mdx +12 -5
- package/docs-site/zh/tutorials/experiment-services.mdx +243 -0
- package/docs-site/zh/tutorials/fixtures.mdx +42 -26
- package/docs-site/zh/tutorials/handle-execution-failures.mdx +41 -19
- package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +21 -16
- package/docs-site/zh/tutorials/niceeval-taste-application.mdx +394 -0
- package/docs-site/zh/tutorials/niceeval-taste.mdx +190 -0
- package/docs-site/zh/tutorials/nixos-managed-dind.mdx +51 -39
- package/docs-site/zh/tutorials/plugins.mdx +55 -31
- package/docs-site/zh/tutorials/prebuilt-sandbox.mdx +204 -0
- package/docs-site/zh/tutorials/quickstart.mdx +91 -47
- package/docs-site/zh/tutorials/reporters.mdx +45 -30
- package/docs-site/zh/tutorials/rerun-and-cache.mdx +39 -40
- package/docs-site/zh/tutorials/sandbox-agent.mdx +65 -40
- package/docs-site/zh/tutorials/sandbox-providers.mdx +104 -282
- package/docs-site/zh/tutorials/sandbox-reuse.mdx +65 -97
- package/docs-site/zh/tutorials/select-and-preview.mdx +25 -20
- package/docs-site/zh/tutorials/verify-judge.mdx +49 -26
- package/docs-site/zh/tutorials/viewing-results.mdx +130 -80
- package/docs-site/zh/tutorials/write-experiment.mdx +116 -298
- package/docs-site/zh/tutorials/write-send.mdx +53 -52
- package/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/undici/docs/docs/api/Errors.md +25 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
- package/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/undici/lib/core/util.js +0 -39
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
- package/node_modules/undici/lib/dispatcher/client.js +1 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -2
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
- package/node_modules/undici/lib/dispatcher/pool.js +90 -7
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
- package/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -0
- package/node_modules/undici/lib/handler/retry-handler.js +72 -13
- package/node_modules/undici/lib/interceptor/cache.js +4 -1
- package/node_modules/undici/lib/interceptor/decompress.js +236 -69
- package/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/undici/lib/web/cookies/util.js +3 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
- package/node_modules/undici/lib/web/fetch/body.js +22 -15
- package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/undici/lib/web/fetch/headers.js +34 -31
- package/node_modules/undici/lib/web/fetch/index.js +38 -14
- package/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/undici/lib/web/websocket/receiver.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/diagnostics-channel.d.ts +2 -1
- package/node_modules/undici/types/interceptors.d.ts +1 -1
- package/node_modules/undici/types/webidl.d.ts +13 -7
- package/package.json +4 -4
- package/dist/view/app-dist/assets/index-DFzw1L97.js +0 -63
- package/docs-site/zh/tutorials/experiments.mdx +0 -101
|
@@ -37,6 +37,7 @@ exports.validateSchema = validateSchema;
|
|
|
37
37
|
exports.satisfies = satisfies;
|
|
38
38
|
exports.defineValueMatch = defineValueMatch;
|
|
39
39
|
exports.defineScoreMatch = defineScoreMatch;
|
|
40
|
+
exports.exactLlmOptions = exactLlmOptions;
|
|
40
41
|
exports.referencesAnyPath = referencesAnyPath;
|
|
41
42
|
exports.jsonMatch = jsonMatch;
|
|
42
43
|
exports.toolMatch = toolMatch;
|
|
@@ -50,6 +51,10 @@ exports.inOrder = inOrder;
|
|
|
50
51
|
exports.isManagedCollectionMatch = isManagedCollectionMatch;
|
|
51
52
|
exports.looksLikeCollectionMatch = looksLikeCollectionMatch;
|
|
52
53
|
exports.collectionMatchSpecOf = collectionMatchSpecOf;
|
|
54
|
+
exports.mapValue = mapValue;
|
|
55
|
+
exports.mapEach = mapEach;
|
|
56
|
+
exports.filterWhere = filterWhere;
|
|
57
|
+
exports.countWhere = countWhere;
|
|
53
58
|
const effect_1 = require("effect");
|
|
54
59
|
const json_match_ts_1 = require("../shared/json-match.cjs");
|
|
55
60
|
const util_ts_1 = require("../util.cjs");
|
|
@@ -539,6 +544,9 @@ function textCandidate(value, options) {
|
|
|
539
544
|
return undefined;
|
|
540
545
|
return options.stripComments === true ? (0, util_ts_1.stripComments)(value) : value;
|
|
541
546
|
}
|
|
547
|
+
// @concord-code ne-eval-assertions-includes-match
|
|
548
|
+
// @concord-implements docs/feature/assertions/library/value-assertions.md
|
|
549
|
+
// @concord-implements docs/feature/eval/use-case/first-single-turn.md
|
|
542
550
|
function includes(text, options) {
|
|
543
551
|
assertNonEmptyString(text, "includes() text");
|
|
544
552
|
const normalizedOptions = normalizeTextOptions(options, "includes() options");
|
|
@@ -819,6 +827,8 @@ function satisfies(label, predicate) {
|
|
|
819
827
|
return mismatched(diagnostic("value-mismatch", `satisfies(${label}) did not match`));
|
|
820
828
|
});
|
|
821
829
|
}
|
|
830
|
+
// @concord-code ne-eval-assertions-define-value-match
|
|
831
|
+
// @concord-implements docs/feature/assertions/library/value-assertions.md
|
|
822
832
|
function defineValueMatch(spec) {
|
|
823
833
|
if (!isRecord(spec))
|
|
824
834
|
throw new TypeError("defineValueMatch() spec must be an object");
|
|
@@ -827,6 +837,8 @@ function defineValueMatch(spec) {
|
|
|
827
837
|
throw new TypeError("defineValueMatch() spec.evaluate must be a function");
|
|
828
838
|
return createBooleanMatch("value", spec.name, async (candidate) => {
|
|
829
839
|
const value = await spec.evaluate(candidate);
|
|
840
|
+
if (typeof value === "object" && value !== null && value.state === "unavailable" && typeof value.reason === "string" && value.reason.trim() !== "")
|
|
841
|
+
return unavailable(value.reason, diagnostic("value-unavailable", value.reason));
|
|
830
842
|
if (typeof value !== "boolean")
|
|
831
843
|
throw new TypeError(`matcher ${spec.name} returned a non-boolean result`);
|
|
832
844
|
if (value)
|
|
@@ -898,6 +910,7 @@ function boundedPositiveInteger(value, fallback, maximum, label) {
|
|
|
898
910
|
}
|
|
899
911
|
return resolved;
|
|
900
912
|
}
|
|
913
|
+
/** @internal Shared managed-model budget validation. */
|
|
901
914
|
function exactLlmOptions(value) {
|
|
902
915
|
if (!isRecord(value) || Array.isArray(value))
|
|
903
916
|
throw new TypeError("defineScoreMatch() spec.llm must be an object");
|
|
@@ -913,8 +926,8 @@ function exactLlmOptions(value) {
|
|
|
913
926
|
}
|
|
914
927
|
return Object.freeze({
|
|
915
928
|
maxCalls: boundedPositiveInteger(output.maxCalls, 4, 16, "defineScoreMatch() spec.llm.maxCalls"),
|
|
916
|
-
maxMaterialBytes: boundedPositiveInteger(output.maxMaterialBytes, 32 * 1024,
|
|
917
|
-
maxAuditBytes: boundedPositiveInteger(output.maxAuditBytes, 96 * 1024,
|
|
929
|
+
maxMaterialBytes: boundedPositiveInteger(output.maxMaterialBytes, 32 * 1024, 4 * 1024 * 1024, "defineScoreMatch() spec.llm.maxMaterialBytes"),
|
|
930
|
+
maxAuditBytes: boundedPositiveInteger(output.maxAuditBytes, 96 * 1024, 8 * 1024 * 1024, "defineScoreMatch() spec.llm.maxAuditBytes"),
|
|
918
931
|
});
|
|
919
932
|
}
|
|
920
933
|
function snapshotScoreMatchJson(value, label, state = { nodes: 0 }, ancestors = new WeakSet(), depth = 0) {
|
|
@@ -1548,14 +1561,19 @@ function quantifiedOccurrenceMatch(item, kind, count) {
|
|
|
1548
1561
|
}
|
|
1549
1562
|
function inOrder(matches) {
|
|
1550
1563
|
if (!Array.isArray(matches) || matches.length < 2) {
|
|
1551
|
-
throw new TypeError("inOrder() requires at least two
|
|
1564
|
+
throw new TypeError("inOrder() requires at least two BooleanMatch values");
|
|
1552
1565
|
}
|
|
1553
1566
|
if (matches.length > MAX_ORDER_STEPS) {
|
|
1554
1567
|
throw new TypeError(`inOrder() supports at most ${MAX_ORDER_STEPS} steps`);
|
|
1555
1568
|
}
|
|
1556
1569
|
const first = internalMatchOf(matches[0], "inOrder() match 1");
|
|
1557
|
-
if (first.domain
|
|
1558
|
-
|
|
1570
|
+
if (first.domain === "value") {
|
|
1571
|
+
const steps = Array.from(matches, (match, index) => {
|
|
1572
|
+
assertBooleanMatch(match, `inOrder() match ${index + 1}`, "value");
|
|
1573
|
+
return match;
|
|
1574
|
+
});
|
|
1575
|
+
return valueSequenceMatch(Object.freeze(steps));
|
|
1576
|
+
}
|
|
1559
1577
|
const domain = first.domain;
|
|
1560
1578
|
const normalized = matches.map((match, index) => domain === "tool"
|
|
1561
1579
|
? assertManagedToolMatch(match, `inOrder() match ${index + 1}`)
|
|
@@ -1566,6 +1584,45 @@ function inOrder(matches) {
|
|
|
1566
1584
|
matches: Object.freeze(normalized),
|
|
1567
1585
|
}, `${domain}-sequence`);
|
|
1568
1586
|
}
|
|
1587
|
+
function valueSequenceMatch(steps) {
|
|
1588
|
+
const name = `inOrder(${steps.map(step => step.name).join(", ")})`;
|
|
1589
|
+
return createBooleanMatch("value", name, async (subject) => {
|
|
1590
|
+
const collection = compositionCollection(subject, name);
|
|
1591
|
+
if (collection.state === "unavailable")
|
|
1592
|
+
return collection;
|
|
1593
|
+
const certain = new Array(steps.length + 1).fill(false);
|
|
1594
|
+
const possible = new Array(steps.length + 1).fill(false);
|
|
1595
|
+
certain[0] = possible[0] = true;
|
|
1596
|
+
const children = [];
|
|
1597
|
+
let unknownReason;
|
|
1598
|
+
for (let index = 0; index < collection.values.length; index += 1) {
|
|
1599
|
+
const value = collection.values[index];
|
|
1600
|
+
// Descending updates only consume prefixes reached by earlier items.
|
|
1601
|
+
for (let step = steps.length - 1; step >= 0; step -= 1) {
|
|
1602
|
+
if (!possible[step] || certain[step + 1])
|
|
1603
|
+
continue;
|
|
1604
|
+
const result = !Object.hasOwn(collection.values, index) || compositionUnknown(value)
|
|
1605
|
+
? compositionMissing(name) : await evaluateBooleanMatch(steps[step], value);
|
|
1606
|
+
children.push(resultChild({ ...result, diagnostic: diagnostic("composition-order-item", `${name} evaluated original item ${index}, step ${step}`, {
|
|
1607
|
+
path: ["items", index],
|
|
1608
|
+
children: [resultChild(result, step, steps[step].name)],
|
|
1609
|
+
}) }, index, collection.items?.[index]?.id));
|
|
1610
|
+
if (result.state !== "mismatched")
|
|
1611
|
+
possible[step + 1] = true;
|
|
1612
|
+
if (result.state === "matched" && certain[step])
|
|
1613
|
+
certain[step + 1] = true;
|
|
1614
|
+
if (result.state === "unavailable")
|
|
1615
|
+
unknownReason ??= result.reason;
|
|
1616
|
+
}
|
|
1617
|
+
if (certain[steps.length])
|
|
1618
|
+
return compositionResult(subject, name, children, matched(subject));
|
|
1619
|
+
}
|
|
1620
|
+
const result = possible[steps.length]
|
|
1621
|
+
? unavailable(unknownReason ?? "unknown-composition-value", diagnostic("composition-order-unavailable", "Only an unknown sequence can satisfy the order"))
|
|
1622
|
+
: mismatched(diagnostic("composition-order-mismatched", "No increasing sequence can satisfy the order"));
|
|
1623
|
+
return compositionResult(subject, name, children, result);
|
|
1624
|
+
});
|
|
1625
|
+
}
|
|
1569
1626
|
function isManagedCollectionMatch(value) {
|
|
1570
1627
|
return isRecord(value) && collectionMatches.has(value);
|
|
1571
1628
|
}
|
|
@@ -1579,4 +1636,186 @@ function collectionMatchSpecOf(value) {
|
|
|
1579
1636
|
}
|
|
1580
1637
|
return spec;
|
|
1581
1638
|
}
|
|
1639
|
+
async function compositionEvaluate(match, value) {
|
|
1640
|
+
return evaluateBooleanMatch(match, value);
|
|
1641
|
+
}
|
|
1642
|
+
function compositionUnknown(value) {
|
|
1643
|
+
return value === undefined || value === null || typeof value === "number" && !Number.isFinite(value);
|
|
1644
|
+
}
|
|
1645
|
+
function compositionMissing(name, path = []) {
|
|
1646
|
+
return unavailable("unknown-composition-value", diagnostic("composition-value-unavailable", `${name} requires a known, finite value`, {
|
|
1647
|
+
path, reason: "unknown-composition-value",
|
|
1648
|
+
}));
|
|
1649
|
+
}
|
|
1650
|
+
function compositionProject(name, project, value) {
|
|
1651
|
+
const projected = project(value);
|
|
1652
|
+
if (projected !== null && (typeof projected === "object" || typeof projected === "function") &&
|
|
1653
|
+
typeof projected.then === "function") {
|
|
1654
|
+
throw new TypeError(`${name} projection must return a synchronous value`);
|
|
1655
|
+
}
|
|
1656
|
+
return projected;
|
|
1657
|
+
}
|
|
1658
|
+
function compositionResult(subject, name, children, result) {
|
|
1659
|
+
const detail = diagnostic(`composition-${result.state}`, `${name} ${result.state}`, {
|
|
1660
|
+
children, ...(result.state === "unavailable" ? { reason: result.reason } : {}),
|
|
1661
|
+
});
|
|
1662
|
+
if (result.state === "unavailable")
|
|
1663
|
+
return unavailable(result.reason, detail);
|
|
1664
|
+
if (result.state === "mismatched")
|
|
1665
|
+
return mismatched(detail);
|
|
1666
|
+
return matched(subject, detail);
|
|
1667
|
+
}
|
|
1668
|
+
function compositionCollection(subject, name) {
|
|
1669
|
+
if (Array.isArray(subject))
|
|
1670
|
+
return { state: "complete", values: subject };
|
|
1671
|
+
if (!isRecord(subject) || !["complete", "partial", "unavailable"].includes(String(subject.state))) {
|
|
1672
|
+
throw new TypeError(`${name} subject must be an array or MaterialCollection`);
|
|
1673
|
+
}
|
|
1674
|
+
if (subject.state !== "complete") {
|
|
1675
|
+
if (typeof subject.reason !== "string" || subject.reason.trim() === "") {
|
|
1676
|
+
throw new TypeError(`${name} incomplete collection requires a reason`);
|
|
1677
|
+
}
|
|
1678
|
+
return unavailable(subject.reason, diagnostic("composition-collection-unavailable", `${name} requires a complete collection`, {
|
|
1679
|
+
reason: subject.reason,
|
|
1680
|
+
}));
|
|
1681
|
+
}
|
|
1682
|
+
if (!Array.isArray(subject.items))
|
|
1683
|
+
throw new TypeError(`${name} material items must be an array`);
|
|
1684
|
+
const items = subject.items;
|
|
1685
|
+
const ids = new Set();
|
|
1686
|
+
const values = new Array(items.length);
|
|
1687
|
+
for (let index = 0; index < items.length; index += 1) {
|
|
1688
|
+
if (!Object.hasOwn(items, index) || compositionUnknown(items[index]))
|
|
1689
|
+
continue;
|
|
1690
|
+
const item = items[index];
|
|
1691
|
+
if (!isRecord(item) || typeof item.id !== "string" || item.id.trim() === "" || ids.has(item.id)) {
|
|
1692
|
+
throw new TypeError(`${name} material items require unique nonempty IDs`);
|
|
1693
|
+
}
|
|
1694
|
+
ids.add(item.id);
|
|
1695
|
+
if (Object.hasOwn(item, "value"))
|
|
1696
|
+
values[index] = item.value;
|
|
1697
|
+
}
|
|
1698
|
+
return { state: "complete", values, items };
|
|
1699
|
+
}
|
|
1700
|
+
function compositionItemChild(result, index, id, label) {
|
|
1701
|
+
return resultChild({ ...result, diagnostic: diagnostic("composition-item", `${label} evaluated original item ${index}`, {
|
|
1702
|
+
path: ["items", index],
|
|
1703
|
+
children: [resultChild(result, 0, label)],
|
|
1704
|
+
}) }, index, id === undefined ? label : id);
|
|
1705
|
+
}
|
|
1706
|
+
function compositionSubset(values, indices, items) {
|
|
1707
|
+
if (items === undefined)
|
|
1708
|
+
return Object.freeze([...values]);
|
|
1709
|
+
return Object.freeze({ state: "complete", items: Object.freeze(values.map((value, index) => Object.freeze({
|
|
1710
|
+
id: items[indices[index]].id, value,
|
|
1711
|
+
}))) });
|
|
1712
|
+
}
|
|
1713
|
+
/** Project a single value without replacing the original subject's refinement. */
|
|
1714
|
+
function mapValue(label, project, match) {
|
|
1715
|
+
assertNonEmptyString(label, "mapValue() label");
|
|
1716
|
+
if (typeof project !== "function")
|
|
1717
|
+
throw new TypeError("mapValue() project must be a function");
|
|
1718
|
+
assertBooleanMatch(match, "mapValue() match", "value");
|
|
1719
|
+
const name = `mapValue(${label}, ${match.name})`;
|
|
1720
|
+
return createBooleanMatch("value", name, async (subject) => {
|
|
1721
|
+
if (compositionUnknown(subject))
|
|
1722
|
+
return compositionMissing(name);
|
|
1723
|
+
const value = compositionProject(name, project, subject);
|
|
1724
|
+
const result = compositionUnknown(value) ? compositionMissing(name) : await compositionEvaluate(match, value);
|
|
1725
|
+
return compositionResult(subject, name, [resultChild(result, 0, label)], result);
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
/** Project each complete item, retaining its material identity and order. */
|
|
1729
|
+
function mapEach(project, aggregate) {
|
|
1730
|
+
if (typeof project !== "function")
|
|
1731
|
+
throw new TypeError("mapEach() project must be a function");
|
|
1732
|
+
assertBooleanMatch(aggregate, "mapEach() aggregate", "value");
|
|
1733
|
+
const name = `mapEach(${aggregate.name})`;
|
|
1734
|
+
return createBooleanMatch("value", name, async (subject) => {
|
|
1735
|
+
const collection = compositionCollection(subject, name);
|
|
1736
|
+
if (collection.state === "unavailable")
|
|
1737
|
+
return collection;
|
|
1738
|
+
const values = [];
|
|
1739
|
+
const indices = [];
|
|
1740
|
+
const children = [];
|
|
1741
|
+
let unknown;
|
|
1742
|
+
for (let index = 0; index < collection.values.length; index += 1) {
|
|
1743
|
+
const item = collection.values[index];
|
|
1744
|
+
const value = !Object.hasOwn(collection.values, index) || compositionUnknown(item)
|
|
1745
|
+
? undefined : compositionProject(name, project, item);
|
|
1746
|
+
const result = compositionUnknown(value) ? compositionMissing(name) : matched(value);
|
|
1747
|
+
if (result.state === "unavailable")
|
|
1748
|
+
unknown ??= result;
|
|
1749
|
+
values.push(value);
|
|
1750
|
+
indices.push(index);
|
|
1751
|
+
children.push(compositionItemChild(result, index, collection.items?.[index]?.id, "projection"));
|
|
1752
|
+
}
|
|
1753
|
+
if (unknown !== undefined)
|
|
1754
|
+
return compositionResult(subject, name, children, unknown);
|
|
1755
|
+
const result = await compositionEvaluate(aggregate, compositionSubset(values, indices, collection.items));
|
|
1756
|
+
children.push(resultChild(result, collection.values.length, "aggregate"));
|
|
1757
|
+
return compositionResult(subject, name, children, result);
|
|
1758
|
+
});
|
|
1759
|
+
}
|
|
1760
|
+
/** Select only definite matches; an unknown selector makes the aggregate unavailable. */
|
|
1761
|
+
function filterWhere(selector, aggregate) {
|
|
1762
|
+
assertBooleanMatch(selector, "filterWhere() selector", "value");
|
|
1763
|
+
assertBooleanMatch(aggregate, "filterWhere() aggregate", "value");
|
|
1764
|
+
const name = `filterWhere(${selector.name}, ${aggregate.name})`;
|
|
1765
|
+
return createBooleanMatch("value", name, async (subject) => {
|
|
1766
|
+
const collection = compositionCollection(subject, name);
|
|
1767
|
+
if (collection.state === "unavailable")
|
|
1768
|
+
return collection;
|
|
1769
|
+
const values = [];
|
|
1770
|
+
const indices = [];
|
|
1771
|
+
const children = [];
|
|
1772
|
+
let unknown;
|
|
1773
|
+
for (let index = 0; index < collection.values.length; index += 1) {
|
|
1774
|
+
const value = collection.values[index];
|
|
1775
|
+
const result = !Object.hasOwn(collection.values, index) || compositionUnknown(value)
|
|
1776
|
+
? compositionMissing(name) : await evaluateBooleanMatch(selector, value);
|
|
1777
|
+
if (result.state === "matched") {
|
|
1778
|
+
values.push(value);
|
|
1779
|
+
indices.push(index);
|
|
1780
|
+
}
|
|
1781
|
+
if (result.state === "unavailable")
|
|
1782
|
+
unknown ??= result;
|
|
1783
|
+
children.push(compositionItemChild(result, index, collection.items?.[index]?.id, selector.name));
|
|
1784
|
+
}
|
|
1785
|
+
if (unknown !== undefined)
|
|
1786
|
+
return compositionResult(subject, name, children, unknown);
|
|
1787
|
+
const result = await compositionEvaluate(aggregate, compositionSubset(values, indices, collection.items));
|
|
1788
|
+
children.push(resultChild(result, collection.values.length, "aggregate"));
|
|
1789
|
+
return compositionResult(subject, name, children, result);
|
|
1790
|
+
});
|
|
1791
|
+
}
|
|
1792
|
+
/** Compare an exact match count only after every item in a complete collection is known. */
|
|
1793
|
+
function countWhere(item, count) {
|
|
1794
|
+
assertBooleanMatch(item, "countWhere() item", "value");
|
|
1795
|
+
assertBooleanMatch(count, "countWhere() count", "value");
|
|
1796
|
+
const name = `countWhere(${item.name}, ${count.name})`;
|
|
1797
|
+
return createBooleanMatch("value", name, async (subject) => {
|
|
1798
|
+
const collection = compositionCollection(subject, name);
|
|
1799
|
+
if (collection.state === "unavailable")
|
|
1800
|
+
return collection;
|
|
1801
|
+
let total = 0;
|
|
1802
|
+
const children = [];
|
|
1803
|
+
let unknown;
|
|
1804
|
+
for (let index = 0; index < collection.values.length; index += 1) {
|
|
1805
|
+
const value = collection.values[index];
|
|
1806
|
+
const result = !Object.hasOwn(collection.values, index) || compositionUnknown(value)
|
|
1807
|
+
? compositionMissing(name) : await evaluateBooleanMatch(item, value);
|
|
1808
|
+
if (result.state === "matched")
|
|
1809
|
+
total += 1;
|
|
1810
|
+
if (result.state === "unavailable")
|
|
1811
|
+
unknown ??= result;
|
|
1812
|
+
children.push(compositionItemChild(result, index, collection.items?.[index]?.id, item.name));
|
|
1813
|
+
}
|
|
1814
|
+
if (unknown !== undefined)
|
|
1815
|
+
return compositionResult(subject, name, children, unknown);
|
|
1816
|
+
const result = await compositionEvaluate(count, total);
|
|
1817
|
+
children.push(resultChild(result, collection.values.length, "count"));
|
|
1818
|
+
return compositionResult(subject, name, children, result);
|
|
1819
|
+
});
|
|
1820
|
+
}
|
|
1582
1821
|
//# sourceMappingURL=match.cjs.map
|