niceeval 0.13.1 → 0.13.2
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 +25 -2
- package/README.md +9 -10
- package/README.zh.md +9 -10
- package/dist/agents/ai-sdk.cjs.map +1 -1
- package/dist/agents/ai-sdk.d.cts +1 -1
- package/dist/agents/ai-sdk.d.mts +1 -1
- package/dist/agents/ai-sdk.d.ts +1 -1
- package/dist/agents/bub-install-spec.cjs +19 -5
- package/dist/agents/bub-install-spec.cjs.map +1 -1
- package/dist/agents/bub-install-spec.d.cts +9 -2
- package/dist/agents/bub-install-spec.d.mts +9 -2
- package/dist/agents/bub-install-spec.d.ts +9 -2
- package/dist/agents/bub-install-spec.js +14 -12
- package/dist/agents/bub.cjs +10 -6
- package/dist/agents/bub.cjs.map +1 -1
- package/dist/agents/bub.d.cts +2 -2
- package/dist/agents/bub.d.mts +2 -2
- package/dist/agents/bub.d.ts +2 -2
- package/dist/agents/claude-code.cjs.map +1 -1
- package/dist/agents/claude-code.d.cts +2 -2
- package/dist/agents/claude-code.d.mts +2 -2
- package/dist/agents/claude-code.d.ts +2 -2
- package/dist/agents/codex.cjs +4 -4
- package/dist/agents/codex.cjs.map +1 -1
- package/dist/agents/codex.d.cts +3 -3
- package/dist/agents/codex.d.mts +3 -3
- package/dist/agents/codex.d.ts +3 -3
- package/dist/agents/coding-cli-versions.cjs +10 -1
- package/dist/agents/coding-cli-versions.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.d.cts +8 -3
- package/dist/agents/coding-cli-versions.d.mts +8 -3
- package/dist/agents/coding-cli-versions.d.ts +8 -3
- package/dist/agents/coding-cli-versions.js +18 -12
- package/dist/agents/deepseek-harness.cjs +151 -0
- package/dist/agents/deepseek-harness.cjs.map +1 -0
- package/dist/agents/deepseek-harness.d.cts +14 -0
- package/dist/agents/deepseek-harness.d.mts +14 -0
- package/dist/agents/deepseek-harness.d.ts +14 -0
- package/dist/agents/deepseek-harness.js +7 -0
- package/dist/agents/deepseek-harness.js.map +1 -0
- package/dist/agents/exact-npm-plugins.cjs +28 -0
- package/dist/agents/exact-npm-plugins.cjs.map +1 -0
- package/dist/agents/exact-npm-plugins.d.cts +10 -0
- package/dist/agents/exact-npm-plugins.d.mts +10 -0
- package/dist/agents/exact-npm-plugins.d.ts +10 -0
- package/dist/agents/exact-npm-plugins.js +8 -0
- package/dist/agents/exact-npm-plugins.js.map +1 -0
- package/dist/agents/index.cjs +5 -1
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +4 -0
- package/dist/agents/index.d.mts +4 -0
- package/dist/agents/index.d.ts +4 -0
- package/dist/agents/index.js +54 -50
- package/dist/agents/index.mjs +54 -50
- package/dist/agents/omp.cjs +170 -0
- package/dist/agents/omp.cjs.map +1 -0
- package/dist/agents/omp.d.cts +14 -0
- package/dist/agents/omp.d.mts +14 -0
- package/dist/agents/omp.d.ts +14 -0
- package/dist/agents/omp.js +7 -0
- package/dist/agents/omp.js.map +1 -0
- package/dist/agents/openclaw.cjs +51 -2
- package/dist/agents/openclaw.cjs.map +1 -1
- package/dist/agents/openclaw.d.cts +2 -0
- package/dist/agents/openclaw.d.mts +2 -0
- package/dist/agents/openclaw.d.ts +2 -0
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.d.cts +4 -4
- package/dist/agents/types.d.mts +4 -4
- package/dist/agents/types.d.ts +4 -4
- package/dist/agents/ui-message-stream.cjs +24 -7
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/analysis/api.cjs +28 -2
- package/dist/analysis/api.cjs.map +1 -1
- package/dist/analysis/api.d.cts +22 -1
- package/dist/analysis/api.d.mts +22 -1
- package/dist/analysis/api.d.ts +22 -1
- package/dist/analysis/api.js +8 -6
- package/dist/analysis/bindings.cjs +11 -18
- package/dist/analysis/bindings.cjs.map +1 -1
- package/dist/analysis/bindings.d.cts +177 -49
- package/dist/analysis/bindings.d.mts +177 -49
- package/dist/analysis/bindings.d.ts +177 -49
- package/dist/analysis/contracts.cjs +1 -0
- package/dist/analysis/contracts.cjs.map +1 -1
- package/dist/analysis/contracts.d.cts +43 -3
- package/dist/analysis/contracts.d.mts +43 -3
- package/dist/analysis/contracts.d.ts +43 -3
- package/dist/analysis/cost-projection.cjs +2 -1
- package/dist/analysis/cost-projection.cjs.map +1 -1
- package/dist/analysis/cost-projection.d.cts +1 -1
- package/dist/analysis/cost-projection.d.mts +1 -1
- package/dist/analysis/cost-projection.d.ts +1 -1
- package/dist/analysis/cost.cjs +13 -3
- package/dist/analysis/cost.cjs.map +1 -1
- package/dist/analysis/cost.d.cts +10 -3
- package/dist/analysis/cost.d.mts +10 -3
- package/dist/analysis/cost.d.ts +10 -3
- package/dist/analysis/experiment-groups.cjs +96 -0
- package/dist/analysis/experiment-groups.cjs.map +1 -0
- package/dist/analysis/experiment-groups.d.cts +9 -0
- package/dist/analysis/experiment-groups.d.mts +9 -0
- package/dist/analysis/experiment-groups.d.ts +9 -0
- package/dist/analysis/experiment-groups.js +10 -0
- package/dist/analysis/experiment-groups.js.map +1 -0
- package/dist/analysis/index.cjs +4 -1
- package/dist/analysis/index.cjs.map +1 -1
- package/dist/analysis/index.d.cts +4 -2
- package/dist/analysis/index.d.mts +4 -2
- package/dist/analysis/index.d.ts +4 -2
- package/dist/analysis/index.js +40 -36
- package/dist/analysis/index.mjs +40 -36
- package/dist/assertions/limits.cjs +4 -0
- package/dist/assertions/limits.cjs.map +1 -1
- package/dist/assertions/limits.d.cts +4 -0
- package/dist/assertions/limits.d.mts +4 -0
- package/dist/assertions/limits.d.ts +4 -0
- package/dist/assertions/match.cjs +63 -25
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +7 -0
- package/dist/assertions/match.d.mts +7 -0
- package/dist/assertions/match.d.ts +7 -0
- package/dist/assertions/record/attachment.cjs +32 -4
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/diff.cjs +10 -4
- package/dist/assertions/record/diff.cjs.map +1 -1
- package/dist/assertions/record/producer.cjs +101 -4
- package/dist/assertions/record/producer.cjs.map +1 -1
- package/dist/assertions/record/producer.d.cts +4 -1
- package/dist/assertions/record/producer.d.mts +4 -1
- package/dist/assertions/record/producer.d.ts +4 -1
- package/dist/assertions/runtime.cjs +45 -5
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/cli/record.cjs +113 -8
- package/dist/cli/record.cjs.map +1 -1
- package/dist/cli/record.d.cts +20 -1
- package/dist/cli/record.d.mts +20 -1
- package/dist/cli/record.d.ts +20 -1
- package/dist/cli/record.js +4 -2
- package/dist/cli.cjs +386 -31
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +10 -2
- package/dist/cli.d.mts +10 -2
- package/dist/cli.d.ts +10 -2
- package/dist/context/send-retry.cjs +4 -4
- package/dist/context/send-retry.cjs.map +1 -1
- package/dist/coordination/host/runtime.cjs +8 -30
- package/dist/coordination/host/runtime.cjs.map +1 -1
- package/dist/coordination/host/runtime.d.cts +3 -3
- package/dist/coordination/host/runtime.d.mts +3 -3
- package/dist/coordination/host/runtime.d.ts +3 -3
- package/dist/coordination/host/types.cjs.map +1 -1
- package/dist/coordination/host/types.d.cts +0 -5
- package/dist/coordination/host/types.d.mts +0 -5
- package/dist/coordination/host/types.d.ts +0 -5
- package/dist/coordination/platform/node.cjs +90 -9
- package/dist/coordination/platform/node.cjs.map +1 -1
- package/dist/define.cjs +25 -1
- package/dist/define.cjs.map +1 -1
- package/dist/experiment/host/index.cjs +1 -0
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/i18n/en.cjs +26 -8
- package/dist/i18n/en.cjs.map +1 -1
- package/dist/i18n/en.d.cts +19 -6
- package/dist/i18n/en.d.mts +19 -6
- package/dist/i18n/en.d.ts +19 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/o11y/parsers/hermes.cjs +1 -1
- package/dist/o11y/parsers/hermes.cjs.map +1 -1
- package/dist/o11y/prices.json +1 -1
- package/dist/o11y/record/families.cjs +12 -3
- package/dist/o11y/record/families.cjs.map +1 -1
- package/dist/o11y/record/families.d.cts +8 -8
- package/dist/o11y/record/families.d.mts +8 -8
- package/dist/o11y/record/families.d.ts +8 -8
- package/dist/o11y/record/family-projectors.d.cts +66 -18
- package/dist/o11y/record/family-projectors.d.mts +66 -18
- package/dist/o11y/record/family-projectors.d.ts +66 -18
- package/dist/o11y/record/family-writers.d.cts +11 -3
- package/dist/o11y/record/family-writers.d.mts +11 -3
- package/dist/o11y/record/family-writers.d.ts +11 -3
- package/dist/o11y/record/runner-producer.cjs +14 -4
- package/dist/o11y/record/runner-producer.cjs.map +1 -1
- package/dist/record/codec/core.d.cts +2 -2
- package/dist/record/codec/core.d.mts +2 -2
- package/dist/record/codec/core.d.ts +2 -2
- package/dist/record/family/catalog.d.cts +44 -12
- package/dist/record/family/catalog.d.mts +44 -12
- package/dist/record/family/catalog.d.ts +44 -12
- package/dist/record/family/index.js +128 -124
- package/dist/record/family/observability-v1.cjs +35 -0
- package/dist/record/family/observability-v1.cjs.map +1 -0
- package/dist/record/family/observability-v1.d.cts +3 -0
- package/dist/record/family/observability-v1.d.mts +3 -0
- package/dist/record/family/observability-v1.d.ts +3 -0
- package/dist/record/family/observability-v1.js +6 -0
- package/dist/record/family/observability-v1.js.map +1 -0
- package/dist/record/family/observability.cjs +58 -9
- package/dist/record/family/observability.cjs.map +1 -1
- package/dist/record/family/observability.d.cts +1014 -15
- package/dist/record/family/observability.d.mts +1014 -15
- package/dist/record/family/observability.d.ts +1014 -15
- package/dist/record/family/observability.js +22 -18
- package/dist/record/host/runtime.cjs +600 -31
- package/dist/record/host/runtime.cjs.map +1 -1
- package/dist/record/host/types.cjs.map +1 -1
- package/dist/record/host/types.d.cts +33 -9
- package/dist/record/host/types.d.mts +33 -9
- package/dist/record/host/types.d.ts +33 -9
- package/dist/record/maintenance/runtime.cjs +1 -2
- package/dist/record/maintenance/runtime.cjs.map +1 -1
- package/dist/record/model/core.cjs.map +1 -1
- package/dist/record/model/core.d.cts +1 -1
- package/dist/record/model/core.d.mts +1 -1
- package/dist/record/model/core.d.ts +1 -1
- package/dist/record/model/definition.d.cts +6 -6
- package/dist/record/model/definition.d.mts +6 -6
- package/dist/record/model/definition.d.ts +6 -6
- package/dist/record/model/identifiers.cjs +1 -1
- package/dist/record/model/identifiers.cjs.map +1 -1
- package/dist/record/model/identifiers.d.cts +1 -1
- package/dist/record/model/identifiers.d.mts +1 -1
- package/dist/record/model/identifiers.d.ts +1 -1
- package/dist/record/platform/node.cjs +159 -23
- package/dist/record/platform/node.cjs.map +1 -1
- package/dist/record/platform/services.cjs.map +1 -1
- package/dist/record/platform/services.d.cts +15 -2
- package/dist/record/platform/services.d.mts +15 -2
- package/dist/record/platform/services.d.ts +15 -2
- package/dist/record/reader/errors.cjs +37 -1
- package/dist/record/reader/errors.cjs.map +1 -1
- package/dist/record/reader/errors.d.cts +49 -1
- package/dist/record/reader/errors.d.mts +49 -1
- package/dist/record/reader/errors.d.ts +49 -1
- package/dist/record/reader/errors.js +22 -12
- package/dist/record/reader/format.cjs +76 -17
- package/dist/record/reader/format.cjs.map +1 -1
- package/dist/record/reader/format.d.cts +11 -4
- package/dist/record/reader/format.d.mts +11 -4
- package/dist/record/reader/format.d.ts +11 -4
- package/dist/record/reader/format.js +2 -0
- package/dist/record/reader/index.js +32 -18
- package/dist/record/reader/runtime.cjs +64 -0
- package/dist/record/reader/runtime.cjs.map +1 -1
- package/dist/record/reader/runtime.d.cts +15 -0
- package/dist/record/reader/runtime.d.mts +15 -0
- package/dist/record/reader/runtime.d.ts +15 -0
- package/dist/record/reader/runtime.js +2 -0
- package/dist/report/assets/styles.css +53 -29
- package/dist/report/built-in/analysis-values.cjs +21 -13
- package/dist/report/built-in/analysis-values.cjs.map +1 -1
- package/dist/report/built-in/analysis-values.d.cts +11 -22
- package/dist/report/built-in/analysis-values.d.mts +11 -22
- package/dist/report/built-in/analysis-values.d.ts +11 -22
- package/dist/report/built-in/analysis-values.js +4 -6
- package/dist/report/built-in/index.cjs +1 -3
- package/dist/report/built-in/index.cjs.map +1 -1
- package/dist/report/built-in/index.d.cts +1 -1
- package/dist/report/built-in/index.d.mts +1 -1
- package/dist/report/built-in/index.d.ts +1 -1
- package/dist/report/built-in/index.js +4 -8
- package/dist/report/built-in/index.mjs +4 -8
- package/dist/report/built-in/machine.cjs +0 -2
- package/dist/report/built-in/machine.cjs.map +1 -1
- package/dist/report/built-in/machine.d.cts +0 -2
- package/dist/report/built-in/machine.d.mts +0 -2
- package/dist/report/built-in/machine.d.ts +0 -2
- package/dist/report/built-in/result-components.cjs +49 -51
- package/dist/report/built-in/result-components.cjs.map +1 -1
- package/dist/report/built-in/result-components.d.cts +16 -17
- package/dist/report/built-in/result-components.d.mts +16 -17
- package/dist/report/built-in/result-components.d.ts +16 -17
- package/dist/report/built-in/result-components.js +0 -4
- package/dist/report/built-in/run-membership-overview.cjs +126 -17
- package/dist/report/built-in/run-membership-overview.cjs.map +1 -1
- package/dist/report/built-in/run-membership-overview.d.cts +14 -0
- package/dist/report/built-in/run-membership-overview.d.mts +14 -0
- package/dist/report/built-in/run-membership-overview.d.ts +14 -0
- package/dist/report/built-in/run-membership-overview.js +4 -2
- package/dist/report/built-in/standard.cjs +80 -45
- package/dist/report/built-in/standard.cjs.map +1 -1
- package/dist/report/built-in/standard.d.cts +19 -41
- package/dist/report/built-in/standard.d.mts +19 -41
- package/dist/report/built-in/standard.d.ts +19 -41
- package/dist/report/built-in/standard.js +6 -6
- package/dist/report/components/attempt-detail/compute.cjs +78 -2
- package/dist/report/components/attempt-detail/compute.cjs.map +1 -1
- package/dist/report/components/attempt-detail/compute.d.cts +1 -1
- package/dist/report/components/attempt-detail/compute.d.mts +1 -1
- package/dist/report/components/attempt-detail/compute.d.ts +1 -1
- package/dist/report/components/attempt-detail/content.cjs +1 -1
- package/dist/report/components/attempt-detail/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.cjs +42 -5
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.d.cts +10 -8
- package/dist/report/components/entity-lists/compute.d.mts +10 -8
- package/dist/report/components/entity-lists/compute.d.ts +10 -8
- package/dist/report/components/entity-lists/content.cjs +31 -6
- package/dist/report/components/entity-lists/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.cjs +9 -4
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.d.cts +4 -7
- package/dist/report/components/entity-lists/index.d.mts +4 -7
- package/dist/report/components/entity-lists/index.d.ts +4 -7
- package/dist/report/components/summaries/compute.cjs +8 -1
- package/dist/report/components/summaries/compute.cjs.map +1 -1
- package/dist/report/components/summaries/compute.d.cts +9 -1
- package/dist/report/components/summaries/compute.d.mts +9 -1
- package/dist/report/components/summaries/compute.d.ts +9 -1
- package/dist/report/components/summaries/index.cjs +48 -4
- package/dist/report/components/summaries/index.cjs.map +1 -1
- package/dist/report/components/summaries/index.d.cts +7 -4
- package/dist/report/components/summaries/index.d.mts +7 -4
- package/dist/report/components/summaries/index.d.ts +7 -4
- package/dist/report/definition/cell.cjs +3 -0
- package/dist/report/definition/cell.cjs.map +1 -1
- package/dist/report/definition/cell.d.cts +2 -0
- package/dist/report/definition/cell.d.mts +2 -0
- package/dist/report/definition/cell.d.ts +2 -0
- package/dist/report/definition/primitives/chart.cjs +8 -5
- package/dist/report/definition/primitives/chart.cjs.map +1 -1
- package/dist/report/definition/primitives/points-dataset.cjs +1 -0
- package/dist/report/definition/primitives/points-dataset.cjs.map +1 -1
- package/dist/report/definition/primitives.cjs +15 -2
- package/dist/report/definition/primitives.cjs.map +1 -1
- package/dist/report/definition/report.cjs +27 -3
- package/dist/report/definition/report.cjs.map +1 -1
- package/dist/report/definition/report.d.cts +8 -0
- package/dist/report/definition/report.d.mts +8 -0
- package/dist/report/definition/report.d.ts +8 -0
- package/dist/report/execution/machine.cjs +30 -14
- package/dist/report/execution/machine.cjs.map +1 -1
- package/dist/report/execution/machine.d.cts +20 -10
- package/dist/report/execution/machine.d.mts +20 -10
- package/dist/report/execution/machine.d.ts +20 -10
- package/dist/report/execution/machine.js +6 -6
- package/dist/report/host/execute.cjs +25 -16
- package/dist/report/host/execute.cjs.map +1 -1
- package/dist/report/host/execute.d.cts +4 -0
- package/dist/report/host/execute.d.mts +4 -0
- package/dist/report/host/execute.d.ts +4 -0
- package/dist/report/host/from-record.cjs +22 -5
- package/dist/report/host/from-record.cjs.map +1 -1
- package/dist/report/host/machine.cjs +53 -11
- package/dist/report/host/machine.cjs.map +1 -1
- package/dist/report/host/site-runtime.cjs +9 -8
- package/dist/report/host/site-runtime.cjs.map +1 -1
- package/dist/report/host/site-runtime.d.cts +1 -1
- package/dist/report/host/site-runtime.d.mts +1 -1
- package/dist/report/host/site-runtime.d.ts +1 -1
- package/dist/report/host/static.cjs +56 -9
- package/dist/report/host/static.cjs.map +1 -1
- package/dist/report/index.cjs.map +1 -1
- package/dist/report/index.d.cts +1 -1
- package/dist/report/index.d.mts +1 -1
- package/dist/report/index.d.ts +1 -1
- package/dist/report/model/dataset.cjs +7 -2
- package/dist/report/model/dataset.cjs.map +1 -1
- package/dist/report/model/locale.cjs +2 -0
- package/dist/report/model/locale.cjs.map +1 -1
- package/dist/report/model/locale.d.cts +1 -0
- package/dist/report/model/locale.d.mts +1 -0
- package/dist/report/model/locale.d.ts +1 -0
- package/dist/report/model/metrics.cjs +3 -1
- package/dist/report/model/metrics.cjs.map +1 -1
- package/dist/report/model/pricing.cjs +16 -11
- package/dist/report/model/pricing.cjs.map +1 -1
- package/dist/report/react/styles.css +53 -29
- package/dist/runner/adoption.cjs +1 -0
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/attempt.cjs +44 -5
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/runner/attempt.d.cts +13 -1
- package/dist/runner/attempt.d.mts +13 -1
- package/dist/runner/attempt.d.ts +13 -1
- package/dist/runner/config-identity.cjs +10 -2
- package/dist/runner/config-identity.cjs.map +1 -1
- package/dist/runner/config-identity.d.cts +4 -2
- package/dist/runner/config-identity.d.mts +4 -2
- package/dist/runner/config-identity.d.ts +4 -2
- package/dist/runner/feedback/human.cjs +298 -59
- package/dist/runner/feedback/human.cjs.map +1 -1
- package/dist/runner/feedback/json.cjs +14 -6
- package/dist/runner/feedback/json.cjs.map +1 -1
- package/dist/runner/feedback/json.d.cts +3 -2
- package/dist/runner/feedback/json.d.mts +3 -2
- package/dist/runner/feedback/json.d.ts +3 -2
- package/dist/runner/feedback/reducer.cjs +2 -0
- package/dist/runner/feedback/reducer.cjs.map +1 -1
- package/dist/runner/judge-config.cjs +1 -1
- package/dist/runner/judge-config.cjs.map +1 -1
- package/dist/runner/ledger.cjs +124 -12
- package/dist/runner/ledger.cjs.map +1 -1
- package/dist/runner/project-current.cjs +13 -5
- package/dist/runner/project-current.cjs.map +1 -1
- package/dist/runner/run.cjs +564 -256
- package/dist/runner/run.cjs.map +1 -1
- package/dist/runner/sandbox-pool.cjs +161 -30
- package/dist/runner/sandbox-pool.cjs.map +1 -1
- package/dist/runner/sandbox-pool.d.cts +34 -2
- package/dist/runner/sandbox-pool.d.mts +34 -2
- package/dist/runner/sandbox-pool.d.ts +34 -2
- package/dist/runner/shared-state-lease.cjs +803 -0
- package/dist/runner/shared-state-lease.cjs.map +1 -0
- package/dist/runner/shared-state-lease.d.cts +121 -0
- package/dist/runner/shared-state-lease.d.mts +121 -0
- package/dist/runner/shared-state-lease.d.ts +121 -0
- package/dist/runner/shared-state-lease.js +24 -0
- package/dist/runner/shared-state-lease.js.map +1 -0
- package/dist/runner/teardown-registry.cjs +97 -34
- package/dist/runner/teardown-registry.cjs.map +1 -1
- package/dist/runner/teardown-registry.d.cts +27 -1
- package/dist/runner/teardown-registry.d.mts +27 -1
- package/dist/runner/teardown-registry.d.ts +27 -1
- package/dist/runner/teardown-registry.js +20 -16
- package/dist/runner/types.cjs.map +1 -1
- package/dist/runner/types.d.cts +31 -5
- package/dist/runner/types.d.mts +31 -5
- package/dist/runner/types.d.ts +31 -5
- package/dist/sample/analysis.cjs +249 -459
- package/dist/sample/analysis.cjs.map +1 -1
- package/dist/sample/capability.cjs +138 -7
- package/dist/sample/capability.cjs.map +1 -1
- package/dist/sample/capability.d.cts +3 -1
- package/dist/sample/capability.d.mts +3 -1
- package/dist/sample/capability.d.ts +3 -1
- package/dist/sample/capability.js +8 -6
- package/dist/sandbox/docker-agent-image.cjs +5 -1
- package/dist/sandbox/docker-agent-image.cjs.map +1 -1
- package/dist/sandbox/docker-agent-image.d.cts +2 -0
- package/dist/sandbox/docker-agent-image.d.mts +2 -0
- package/dist/sandbox/docker-agent-image.d.ts +2 -0
- package/dist/sandbox/docker-agent-image.js +14 -10
- package/dist/sandbox/docker-profile/schema.cjs +283 -534
- package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.d.cts +10 -27
- package/dist/sandbox/docker-profile/schema.d.mts +10 -27
- package/dist/sandbox/docker-profile/schema.d.ts +10 -27
- package/dist/sandbox/e2b-agent-template.cjs +5 -2
- package/dist/sandbox/e2b-agent-template.cjs.map +1 -1
- package/dist/sandbox/index.cjs +4 -2
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +1 -1
- package/dist/sandbox/index.d.mts +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.js +120 -116
- package/dist/sandbox/index.mjs +120 -116
- package/dist/sandbox/keep-registry.cjs +28 -66
- package/dist/sandbox/keep-registry.cjs.map +1 -1
- package/dist/sandbox/types.cjs.map +1 -1
- package/dist/sandbox/types.d.cts +1 -1
- package/dist/sandbox/types.d.mts +1 -1
- package/dist/sandbox/types.d.ts +1 -1
- package/dist/shared/aggregate.cjs +16 -6
- package/dist/shared/aggregate.cjs.map +1 -1
- package/dist/shared/aggregate.d.cts +12 -4
- package/dist/shared/aggregate.d.mts +12 -4
- package/dist/shared/aggregate.d.ts +12 -4
- package/dist/shared/turn-label.cjs +20 -2
- package/dist/shared/turn-label.cjs.map +1 -1
- package/dist/shared/turn-label.d.cts +2 -0
- package/dist/shared/turn-label.d.mts +2 -0
- package/dist/shared/turn-label.d.ts +2 -0
- package/dist/shared/turn-label.js +4 -2
- package/dist/vendor/remark/remark-gfm.cjs +7 -7
- package/dist/vendor/remark/remark-gfm.cjs.map +1 -1
- package/dist/vendor/remark/remark-parse.cjs +12 -12
- package/dist/vendor/remark/remark-parse.cjs.map +1 -1
- package/dist/vendor/remark/remark.cjs +13 -13
- package/dist/vendor/remark/remark.cjs.map +1 -1
- package/dist/view/server.cjs +6 -0
- package/dist/view/server.cjs.map +1 -1
- package/docs-site/images/hitl-handshake-zh.svg +3 -3
- package/docs-site/zh/examples/ai-agent-application.mdx +1 -1
- package/docs-site/zh/examples/coding-agent-extensions.mdx +1 -1
- package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +4 -3
- package/docs-site/zh/examples/integrations/claude-sdk.mdx +3 -3
- package/docs-site/zh/examples/integrations/codex-sdk.mdx +5 -5
- package/docs-site/zh/examples/integrations/langgraph.mdx +4 -4
- package/docs-site/zh/examples/integrations/pi-sdk.mdx +5 -5
- package/docs-site/zh/explanation/adapter.mdx +5 -5
- package/docs-site/zh/explanation/assert.mdx +7 -7
- package/docs-site/zh/explanation/drive.mdx +4 -2
- package/docs-site/zh/explanation/evals.mdx +10 -8
- package/docs-site/zh/explanation/experiment.mdx +2 -2
- package/docs-site/zh/explanation/hitl.mdx +9 -9
- package/docs-site/zh/explanation/judge.mdx +5 -5
- package/docs-site/zh/explanation/overview.mdx +3 -3
- package/docs-site/zh/explanation/runner.mdx +1 -1
- package/docs-site/zh/index.mdx +3 -3
- package/docs-site/zh/reference/builtin-agents.mdx +13 -13
- package/docs-site/zh/reference/capabilities.mdx +1 -1
- package/docs-site/zh/reference/cli.mdx +18 -12
- package/docs-site/zh/reference/define-agent.mdx +130 -5
- package/docs-site/zh/reference/define-config.mdx +2 -2
- package/docs-site/zh/reference/define-eval.mdx +4 -4
- package/docs-site/zh/reference/events.mdx +11 -11
- package/docs-site/zh/reference/official-adapters.mdx +6 -6
- package/docs-site/zh/reference/results-data.mdx +6 -0
- package/docs-site/zh/troubleshooting/debugging.mdx +1 -1
- package/docs-site/zh/troubleshooting/recover-after-kill.mdx +37 -5
- package/docs-site/zh/tutorials/accept-results.mdx +72 -0
- package/docs-site/zh/tutorials/agent-onboarding.mdx +6 -6
- package/docs-site/zh/tutorials/authoring.mdx +9 -13
- package/docs-site/zh/tutorials/ci-integration.mdx +6 -6
- package/docs-site/zh/tutorials/compare-runs.mdx +61 -0
- package/docs-site/zh/tutorials/concurrency.mdx +13 -12
- package/docs-site/zh/tutorials/configuration.mdx +4 -6
- package/docs-site/zh/tutorials/connect-your-agent.mdx +1 -1
- package/docs-site/zh/tutorials/control-run-cost.mdx +58 -0
- package/docs-site/zh/tutorials/criteria-files.mdx +2 -2
- package/docs-site/zh/tutorials/custom-reports.mdx +2 -2
- package/docs-site/zh/tutorials/debug-lifecycle-plan.mdx +46 -0
- package/docs-site/zh/tutorials/docker-in-docker.mdx +52 -43
- package/docs-site/zh/tutorials/eval-groups.mdx +6 -6
- package/docs-site/zh/tutorials/evaluation-kinds.mdx +3 -3
- package/docs-site/zh/tutorials/experiments.mdx +2 -3
- package/docs-site/zh/tutorials/handle-execution-failures.mdx +18 -10
- package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +16 -8
- package/docs-site/zh/tutorials/nixos-managed-dind.mdx +160 -0
- package/docs-site/zh/tutorials/plugins.mdx +14 -0
- package/docs-site/zh/tutorials/rerun-and-cache.mdx +4 -2
- package/docs-site/zh/tutorials/sandbox-agent.mdx +17 -11
- package/docs-site/zh/tutorials/sandbox-providers.mdx +17 -13
- package/docs-site/zh/tutorials/sandbox-reuse.mdx +12 -19
- package/docs-site/zh/tutorials/select-and-preview.mdx +65 -0
- package/docs-site/zh/tutorials/verify-judge.mdx +78 -0
- package/docs-site/zh/tutorials/viewing-results.mdx +38 -1
- package/docs-site/zh/tutorials/write-experiment.mdx +7 -5
- package/docs-site/zh/tutorials/write-send.mdx +9 -8
- package/package.json +9 -5
- package/dist/report/built-in/overview.cjs +0 -44
- package/dist/report/built-in/overview.cjs.map +0 -1
- package/dist/report/built-in/overview.d.cts +0 -6
- package/dist/report/built-in/overview.d.mts +0 -6
- package/dist/report/built-in/overview.d.ts +0 -6
- package/dist/report/built-in/overview.js +0 -9
- package/dist/report/built-in/overview.js.map +0 -1
- package/dist/runner/gate-lease.cjs +0 -283
- package/dist/runner/gate-lease.cjs.map +0 -1
- package/dist/runner/gate-lease.d.cts +0 -62
- package/dist/runner/gate-lease.d.mts +0 -62
- package/dist/runner/gate-lease.d.ts +0 -62
- package/dist/runner/gate-lease.js +0 -22
- package/dist/runner/gate-lease.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["format.ts"],"names":[],"mappings":";;;AAmEA,0DAcC;AAjFD,mCAAwC;AACxC,8CAAwD;AAExD,4DAA+E;AAE/E,yDAA4F;AAE5F,2CAA+E;AAC/E,mFAAmF;AACtE,QAAA,oCAAoC,GAAG,EAAE,GAAG,IAAI,CAAC;AAI9D,SAAS,gBAAgB,CAAC,MAA2E;IACjG,OAAO,IAAI,kCAAsB,CAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,CAAC,CAAC;AACpF,CAAC;AACD,SAAS,eAAe,CAAC,KAAiB;IACtC,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrE,OAAO,eAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,CAAC;QACH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AK,KAAK,SAAS;YACnB,OAAO,eAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,CAAC,CAAC;QACpE,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,eAAM,CAAC,MAAM,CAAC,MAAM,CAAC;YACrB,OAAO,eAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACpC,MAAM,UAAU,GAAG,sBAAsB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxD,OAAO,eAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,eAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,eAAM,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACvG,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { Effect, Either } from \"effect\";\nimport { decodeRecordDocument } from \"../codec/core.ts\";\nimport type { RecordDocument } from \"../model/core.ts\";\nimport { RECORD_FORMAT, RECORD_SCHEMA_VERSION } from \"../model/identifiers.ts\";\nimport type { RecordFileSystemError } from \"../platform/errors.ts\";\nimport { recordPortablePath, type RecordFileSystemService, } from \"../platform/services.ts\";\nimport type { RecordRoot } from \"../platform/root.ts\";\nimport { RecordBootstrapInvalid, RecordFormatUnsupported, } from \"./errors.ts\";\n/** `record.json` contains only root identity, so its read has a hard small cap. */\nexport const RECORD_FORMAT_DOCUMENT_MAXIMUM_BYTES = 64 * 1024;\nexport interface CurrentRecordFormatRead {\n readonly document: RecordDocument;\n}\nfunction bootstrapInvalid(reason: \"record-document-invalid\" | \"record-format-document-limit-exceeded\"): RecordBootstrapInvalid {\n return new RecordBootstrapInvalid({ code: \"record-bootstrap-invalid\", reason });\n}\nfunction parseRecordJson(bytes: Uint8Array): Either.Either<unknown, RecordBootstrapInvalid> {\n try {\n const text = new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes);\n return Either.right(JSON.parse(text) as unknown);\n }\n catch {\n return Either.left(bootstrapInvalid(\"record-document-invalid\"));\n }\n}\nfunction formatOf(value: unknown): string | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return undefined;\n }\n const descriptor = Object.getOwnPropertyDescriptor(value, \"format\");\n return descriptor !== undefined && \"value\" in descriptor && typeof descriptor.value === \"string\"\n ? descriptor.value\n : undefined;\n}\nfunction schemaVersionOf(value: unknown): number | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value))\n return undefined;\n const descriptor = Object.getOwnPropertyDescriptor(value, \"schemaVersion\");\n return descriptor !== undefined && \"value\" in descriptor &&\n Number.isSafeInteger(descriptor.value) && descriptor.value > 0\n ? descriptor.value\n : undefined;\n}\nfunction classifyRecordDocument(value: unknown): Either.Either<CurrentRecordFormatRead, RecordBootstrapInvalid | RecordFormatUnsupported> {\n const format = formatOf(value);\n if (format === undefined)\n return Either.left(bootstrapInvalid(\"record-document-invalid\"));\n if (format !== RECORD_FORMAT) {\n return Either.left(new RecordFormatUnsupported({ code: \"record-format-unsupported\", format }));\n }\n // A same-format numeric header is not automatically a reverse migration.\n // This package currently declares no adjacent root chain, so both a future\n // root and a hypothetical older root are unsupported rather than a fake\n // `N -> current` migration-required result.\n const schemaVersion = schemaVersionOf(value);\n if (schemaVersion !== undefined && schemaVersion !== RECORD_SCHEMA_VERSION) {\n return Either.left(new RecordFormatUnsupported({ code: \"record-format-unsupported\", format }));\n }\n const decoded = decodeRecordDocument(value);\n return Either.isLeft(decoded)\n ? Either.left(bootstrapInvalid(\"record-document-invalid\"))\n : Either.right(Object.freeze({ document: decoded.right }));\n}\n/**\n * Reads only the bounded current root header. Migration-required is emitted\n * only by an actually declared adjacent chain; this current root has none.\n */\nexport function readCurrentRecordFormat(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<CurrentRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported> {\n const readDocument = fileSystem.readFile({\n file: recordPortablePath(root, \"record.json\"),\n maximumBytes: RECORD_FORMAT_DOCUMENT_MAXIMUM_BYTES,\n }).pipe(Effect.catchTag(\"RecordResourceLimitExceeded\", () => Effect.fail(bootstrapInvalid(\"record-format-document-limit-exceeded\"))));\n return Effect.flatMap(readDocument, (bytes) => {\n if (bytes === undefined)\n return Effect.fail(bootstrapInvalid(\"record-document-invalid\"));\n const parsed = parseRecordJson(bytes);\n if (Either.isLeft(parsed))\n return Effect.fail(parsed.left);\n const classified = classifyRecordDocument(parsed.right);\n return Either.isLeft(classified) ? Effect.fail(classified.left) : Effect.succeed(classified.right);\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["format.ts"],"names":[],"mappings":";;;AAiGA,0DAaC;AAED,wEA+BC;AA/ID,mCAAgD;AAChD,8CAAiF;AACjF,4DAAyD;AAEzD,4DAA+E;AAE/E,yDAA4F;AAE5F,2CAAwG;AACxG,mFAAmF;AACtE,QAAA,oCAAoC,GAAG,EAAE,GAAG,IAAI,CAAC;AAQ9D,SAAS,gBAAgB,CAAC,MAA2E;IACjG,OAAO,IAAI,kCAAsB,CAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAE,CAAC,CAAC;AACpF,CAAC;AACD,SAAS,eAAe,CAAC,KAAiB;IACtC,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrE,OAAO,eAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAY,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,CAAC;QACH,OAAO,eAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,CAAC,CAAC;IACpE,CAAC;AACL,CAAC;AACD,SAAS,QAAQ,CAAC,KAAc;IAC5B,IAAI,OAAO,KAAK,KAAK,QAAQ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,EAAE,CAAC;YAChB,MAAM,QAAQ,GAAG,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACpD,IAAI,QAAQ,KAAK,SAAS;gBACtB,OAAO,KAAK,CAAC,CAAC,eAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,CAAC,CAAC;YAC3E,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAU,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5F,CAAC;QACD,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtC,OAAO,KAAK,CAAC,CAAC,eAAM,CAAC,IAAI,CAAC,IAAI,mCAAuB,CAAC;YAClD,IAAI,EAAE,2BAA2B;YACjC,MAAM,EAAE,MAAM,IAAI,SAAS;SAC9B,CAAC,CAAC,CAAC;IACR,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { Effect, Either, Schema } from \"effect\";\nimport { decodeRecordDocument, RecordExactParseOptions } from \"../codec/core.ts\";\nimport { RecordIdSchema } from \"../codec/identifiers.ts\";\nimport type { RecordDocument } from \"../model/core.ts\";\nimport { RECORD_FORMAT, RECORD_SCHEMA_VERSION } from \"../model/identifiers.ts\";\nimport type { RecordFileSystemError } from \"../platform/errors.ts\";\nimport { recordPortablePath, type RecordFileSystemService, } from \"../platform/services.ts\";\nimport type { RecordRoot } from \"../platform/root.ts\";\nimport { RecordBootstrapInvalid, RecordFormatUnsupported, RecordMigrationRequired, } from \"./errors.ts\";\n/** `record.json` contains only root identity, so its read has a hard small cap. */\nexport const RECORD_FORMAT_DOCUMENT_MAXIMUM_BYTES = 64 * 1024;\nexport interface CurrentRecordFormatRead {\n readonly document: RecordDocument;\n}\nexport interface MaintenanceRecordFormatRead extends CurrentRecordFormatRead {\n readonly sourceSchemaVersion: 1 | typeof RECORD_SCHEMA_VERSION;\n readonly sourceBytes: Uint8Array;\n}\nfunction bootstrapInvalid(reason: \"record-document-invalid\" | \"record-format-document-limit-exceeded\"): RecordBootstrapInvalid {\n return new RecordBootstrapInvalid({ code: \"record-bootstrap-invalid\", reason });\n}\nfunction parseRecordJson(bytes: Uint8Array): Either.Either<unknown, RecordBootstrapInvalid> {\n try {\n const text = new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes);\n return Either.right(JSON.parse(text) as unknown);\n }\n catch {\n return Either.left(bootstrapInvalid(\"record-document-invalid\"));\n }\n}\nfunction formatOf(value: unknown): string | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return undefined;\n }\n const descriptor = Object.getOwnPropertyDescriptor(value, \"format\");\n return descriptor !== undefined && \"value\" in descriptor && typeof descriptor.value === \"string\"\n ? descriptor.value\n : undefined;\n}\nfunction schemaVersionOf(value: unknown): number | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value))\n return undefined;\n const descriptor = Object.getOwnPropertyDescriptor(value, \"schemaVersion\");\n return descriptor !== undefined && \"value\" in descriptor &&\n Number.isSafeInteger(descriptor.value) && descriptor.value > 0\n ? descriptor.value\n : undefined;\n}\nfunction classifyRecordDocument(value: unknown): Either.Either<CurrentRecordFormatRead, RecordBootstrapInvalid | RecordFormatUnsupported | RecordMigrationRequired> {\n const format = formatOf(value);\n if (format === undefined)\n return Either.left(bootstrapInvalid(\"record-document-invalid\"));\n if (format !== RECORD_FORMAT) {\n return Either.left(new RecordFormatUnsupported({ code: \"record-format-unsupported\", format }));\n }\n const schemaVersion = schemaVersionOf(value);\n if (schemaVersion === 1) {\n return Either.left(new RecordMigrationRequired({\n code: \"record-migration-required\",\n source: `${RECORD_FORMAT}@1`,\n target: `${RECORD_FORMAT}@${RECORD_SCHEMA_VERSION}`,\n command: \"niceeval migrate\",\n }));\n }\n if (schemaVersion !== RECORD_SCHEMA_VERSION) {\n return Either.left(new RecordFormatUnsupported({ code: \"record-format-unsupported\", format }));\n }\n const decoded = decodeRecordDocument(value);\n return Either.isLeft(decoded)\n ? Either.left(bootstrapInvalid(\"record-document-invalid\"))\n : Either.right(Object.freeze({ document: decoded.right }));\n}\nfunction legacyRecordDocument(value: unknown): RecordDocument | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value))\n return undefined;\n const record = value as Record<string, unknown>;\n if (Object.keys(record).length !== 3 ||\n record.format !== RECORD_FORMAT ||\n record.schemaVersion !== 1)\n return undefined;\n const recordId = Schema.decodeUnknownEither(RecordIdSchema, RecordExactParseOptions)(record.recordId);\n return Either.isLeft(recordId) ? undefined : Object.freeze({\n format: RECORD_FORMAT as RecordDocument[\"format\"],\n schemaVersion: RECORD_SCHEMA_VERSION,\n recordId: recordId.right,\n });\n}\nfunction readFormatBytes(fileSystem: RecordFileSystemService, root: RecordRoot) {\n return fileSystem.readFile({\n file: recordPortablePath(root, \"record.json\"),\n maximumBytes: RECORD_FORMAT_DOCUMENT_MAXIMUM_BYTES,\n }).pipe(Effect.catchTag(\"RecordResourceLimitExceeded\", () => Effect.fail(bootstrapInvalid(\"record-format-document-limit-exceeded\"))));\n}\n/**\n * Reads only the bounded exact-current root header. The one published\n * predecessor is reported as migration-required but is never decoded as current.\n */\nexport function readCurrentRecordFormat(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<CurrentRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported | RecordMigrationRequired> {\n return Effect.gen(function* () {\n const bytes = yield* readFormatBytes(fileSystem, root);\n if (bytes === undefined)\n return yield* Effect.fail(bootstrapInvalid(\"record-document-invalid\"));\n const parsed = parseRecordJson(bytes);\n if (Either.isLeft(parsed))\n return yield* Effect.fail(parsed.left);\n const classified = classifyRecordDocument(parsed.right);\n if (Either.isLeft(classified))\n return yield* Effect.fail(classified.left);\n return classified.right;\n });\n}\n/** Maintenance-only exact recognition of the one published root predecessor. */\nexport function readRecordFormatForMaintenance(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<MaintenanceRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported> {\n return Effect.gen(function* () {\n const bytes = yield* readFormatBytes(fileSystem, root);\n if (bytes === undefined)\n return yield* Effect.fail(bootstrapInvalid(\"record-document-invalid\"));\n const parsed = parseRecordJson(bytes);\n if (Either.isLeft(parsed))\n return yield* Effect.fail(parsed.left);\n const version = schemaVersionOf(parsed.right);\n if (version === RECORD_SCHEMA_VERSION) {\n const decoded = decodeRecordDocument(parsed.right);\n if (Either.isLeft(decoded))\n return yield* Effect.fail(bootstrapInvalid(\"record-document-invalid\"));\n return Object.freeze({\n document: decoded.right,\n sourceSchemaVersion: RECORD_SCHEMA_VERSION,\n sourceBytes: bytes,\n });\n }\n if (version === 1) {\n const document = legacyRecordDocument(parsed.right);\n if (document === undefined)\n return yield* Effect.fail(bootstrapInvalid(\"record-document-invalid\"));\n return Object.freeze({ document, sourceSchemaVersion: 1 as const, sourceBytes: bytes });\n }\n const format = formatOf(parsed.right);\n return yield* Effect.fail(new RecordFormatUnsupported({\n code: \"record-format-unsupported\",\n format: format ?? \"unknown\",\n }));\n });\n}\n"]}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { RecordDocument } from "../model/core.cjs";
|
|
3
|
+
import { RECORD_SCHEMA_VERSION } from "../model/identifiers.cjs";
|
|
3
4
|
import type { RecordFileSystemError } from "../platform/errors.cjs";
|
|
4
5
|
import { type RecordFileSystemService } from "../platform/services.cjs";
|
|
5
6
|
import type { RecordRoot } from "../platform/root.cjs";
|
|
6
|
-
import { RecordBootstrapInvalid, RecordFormatUnsupported } from "./errors.cjs";
|
|
7
|
+
import { RecordBootstrapInvalid, RecordFormatUnsupported, RecordMigrationRequired } from "./errors.cjs";
|
|
7
8
|
/** `record.json` contains only root identity, so its read has a hard small cap. */
|
|
8
9
|
export declare const RECORD_FORMAT_DOCUMENT_MAXIMUM_BYTES: number;
|
|
9
10
|
export interface CurrentRecordFormatRead {
|
|
10
11
|
readonly document: RecordDocument;
|
|
11
12
|
}
|
|
13
|
+
export interface MaintenanceRecordFormatRead extends CurrentRecordFormatRead {
|
|
14
|
+
readonly sourceSchemaVersion: 1 | typeof RECORD_SCHEMA_VERSION;
|
|
15
|
+
readonly sourceBytes: Uint8Array;
|
|
16
|
+
}
|
|
12
17
|
/**
|
|
13
|
-
* Reads only the bounded current root header.
|
|
14
|
-
*
|
|
18
|
+
* Reads only the bounded exact-current root header. The one published
|
|
19
|
+
* predecessor is reported as migration-required but is never decoded as current.
|
|
15
20
|
*/
|
|
16
|
-
export declare function readCurrentRecordFormat(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<CurrentRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported>;
|
|
21
|
+
export declare function readCurrentRecordFormat(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<CurrentRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported | RecordMigrationRequired>;
|
|
22
|
+
/** Maintenance-only exact recognition of the one published root predecessor. */
|
|
23
|
+
export declare function readRecordFormatForMaintenance(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<MaintenanceRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported>;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { RecordDocument } from "../model/core.mjs";
|
|
3
|
+
import { RECORD_SCHEMA_VERSION } from "../model/identifiers.mjs";
|
|
3
4
|
import type { RecordFileSystemError } from "../platform/errors.mjs";
|
|
4
5
|
import { type RecordFileSystemService } from "../platform/services.mjs";
|
|
5
6
|
import type { RecordRoot } from "../platform/root.mjs";
|
|
6
|
-
import { RecordBootstrapInvalid, RecordFormatUnsupported } from "./errors.mjs";
|
|
7
|
+
import { RecordBootstrapInvalid, RecordFormatUnsupported, RecordMigrationRequired } from "./errors.mjs";
|
|
7
8
|
/** `record.json` contains only root identity, so its read has a hard small cap. */
|
|
8
9
|
export declare const RECORD_FORMAT_DOCUMENT_MAXIMUM_BYTES: number;
|
|
9
10
|
export interface CurrentRecordFormatRead {
|
|
10
11
|
readonly document: RecordDocument;
|
|
11
12
|
}
|
|
13
|
+
export interface MaintenanceRecordFormatRead extends CurrentRecordFormatRead {
|
|
14
|
+
readonly sourceSchemaVersion: 1 | typeof RECORD_SCHEMA_VERSION;
|
|
15
|
+
readonly sourceBytes: Uint8Array;
|
|
16
|
+
}
|
|
12
17
|
/**
|
|
13
|
-
* Reads only the bounded current root header.
|
|
14
|
-
*
|
|
18
|
+
* Reads only the bounded exact-current root header. The one published
|
|
19
|
+
* predecessor is reported as migration-required but is never decoded as current.
|
|
15
20
|
*/
|
|
16
|
-
export declare function readCurrentRecordFormat(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<CurrentRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported>;
|
|
21
|
+
export declare function readCurrentRecordFormat(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<CurrentRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported | RecordMigrationRequired>;
|
|
22
|
+
/** Maintenance-only exact recognition of the one published root predecessor. */
|
|
23
|
+
export declare function readRecordFormatForMaintenance(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<MaintenanceRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported>;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import type { RecordDocument } from "../model/core.js";
|
|
3
|
+
import { RECORD_SCHEMA_VERSION } from "../model/identifiers.js";
|
|
3
4
|
import type { RecordFileSystemError } from "../platform/errors.js";
|
|
4
5
|
import { type RecordFileSystemService } from "../platform/services.js";
|
|
5
6
|
import type { RecordRoot } from "../platform/root.js";
|
|
6
|
-
import { RecordBootstrapInvalid, RecordFormatUnsupported } from "./errors.js";
|
|
7
|
+
import { RecordBootstrapInvalid, RecordFormatUnsupported, RecordMigrationRequired } from "./errors.js";
|
|
7
8
|
/** `record.json` contains only root identity, so its read has a hard small cap. */
|
|
8
9
|
export declare const RECORD_FORMAT_DOCUMENT_MAXIMUM_BYTES: number;
|
|
9
10
|
export interface CurrentRecordFormatRead {
|
|
10
11
|
readonly document: RecordDocument;
|
|
11
12
|
}
|
|
13
|
+
export interface MaintenanceRecordFormatRead extends CurrentRecordFormatRead {
|
|
14
|
+
readonly sourceSchemaVersion: 1 | typeof RECORD_SCHEMA_VERSION;
|
|
15
|
+
readonly sourceBytes: Uint8Array;
|
|
16
|
+
}
|
|
12
17
|
/**
|
|
13
|
-
* Reads only the bounded current root header.
|
|
14
|
-
*
|
|
18
|
+
* Reads only the bounded exact-current root header. The one published
|
|
19
|
+
* predecessor is reported as migration-required but is never decoded as current.
|
|
15
20
|
*/
|
|
16
|
-
export declare function readCurrentRecordFormat(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<CurrentRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported>;
|
|
21
|
+
export declare function readCurrentRecordFormat(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<CurrentRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported | RecordMigrationRequired>;
|
|
22
|
+
/** Maintenance-only exact recognition of the one published root predecessor. */
|
|
23
|
+
export declare function readRecordFormatForMaintenance(fileSystem: RecordFileSystemService, root: RecordRoot): Effect.Effect<MaintenanceRecordFormatRead, RecordFileSystemError | RecordBootstrapInvalid | RecordFormatUnsupported>;
|
|
@@ -5,4 +5,6 @@ const __niceevalExport0 = __niceevalCanonical["RECORD_FORMAT_DOCUMENT_MAXIMUM_BY
|
|
|
5
5
|
export { __niceevalExport0 as RECORD_FORMAT_DOCUMENT_MAXIMUM_BYTES };
|
|
6
6
|
const __niceevalExport1 = __niceevalCanonical["readCurrentRecordFormat"];
|
|
7
7
|
export { __niceevalExport1 as readCurrentRecordFormat };
|
|
8
|
+
const __niceevalExport2 = __niceevalCanonical["readRecordFormatForMaintenance"];
|
|
9
|
+
export { __niceevalExport2 as readRecordFormatForMaintenance };
|
|
8
10
|
//# sourceMappingURL=format.js.map
|
|
@@ -13,22 +13,36 @@ const __niceevalExport4 = __niceevalCanonical["RECORD_READER_MAXIMUM_ATTACHMENT_
|
|
|
13
13
|
export { __niceevalExport4 as RECORD_READER_MAXIMUM_ATTACHMENT_DOCUMENT_BYTES };
|
|
14
14
|
const __niceevalExport5 = __niceevalCanonical["RECORD_READER_MAXIMUM_ATTACHMENT_TOTAL_BYTES"];
|
|
15
15
|
export { __niceevalExport5 as RECORD_READER_MAXIMUM_ATTACHMENT_TOTAL_BYTES };
|
|
16
|
-
const __niceevalExport6 = __niceevalCanonical["
|
|
17
|
-
export { __niceevalExport6 as
|
|
18
|
-
const __niceevalExport7 = __niceevalCanonical["
|
|
19
|
-
export { __niceevalExport7 as
|
|
20
|
-
const __niceevalExport8 = __niceevalCanonical["
|
|
21
|
-
export { __niceevalExport8 as
|
|
22
|
-
const __niceevalExport9 = __niceevalCanonical["
|
|
23
|
-
export { __niceevalExport9 as
|
|
24
|
-
const __niceevalExport10 = __niceevalCanonical["
|
|
25
|
-
export { __niceevalExport10 as
|
|
26
|
-
const __niceevalExport11 = __niceevalCanonical["
|
|
27
|
-
export { __niceevalExport11 as
|
|
28
|
-
const __niceevalExport12 = __niceevalCanonical["
|
|
29
|
-
export { __niceevalExport12 as
|
|
30
|
-
const __niceevalExport13 = __niceevalCanonical["
|
|
31
|
-
export { __niceevalExport13 as
|
|
32
|
-
const __niceevalExport14 = __niceevalCanonical["
|
|
33
|
-
export { __niceevalExport14 as
|
|
16
|
+
const __niceevalExport6 = __niceevalCanonical["RecordAutoMigrationGitSaveRequired"];
|
|
17
|
+
export { __niceevalExport6 as RecordAutoMigrationGitSaveRequired };
|
|
18
|
+
const __niceevalExport7 = __niceevalCanonical["RecordBootstrapInvalid"];
|
|
19
|
+
export { __niceevalExport7 as RecordBootstrapInvalid };
|
|
20
|
+
const __niceevalExport8 = __niceevalCanonical["RecordFormatUnsupported"];
|
|
21
|
+
export { __niceevalExport8 as RecordFormatUnsupported };
|
|
22
|
+
const __niceevalExport9 = __niceevalCanonical["RecordHandleInvalid"];
|
|
23
|
+
export { __niceevalExport9 as RecordHandleInvalid };
|
|
24
|
+
const __niceevalExport10 = __niceevalCanonical["RecordMigrationGitRestoreRequired"];
|
|
25
|
+
export { __niceevalExport10 as RecordMigrationGitRestoreRequired };
|
|
26
|
+
const __niceevalExport11 = __niceevalCanonical["RecordMigrationInterruptedState"];
|
|
27
|
+
export { __niceevalExport11 as RecordMigrationInterruptedState };
|
|
28
|
+
const __niceevalExport12 = __niceevalCanonical["RecordMigrationInvalid"];
|
|
29
|
+
export { __niceevalExport12 as RecordMigrationInvalid };
|
|
30
|
+
const __niceevalExport13 = __niceevalCanonical["RecordMigrationPlanStale"];
|
|
31
|
+
export { __niceevalExport13 as RecordMigrationPlanStale };
|
|
32
|
+
const __niceevalExport14 = __niceevalCanonical["RecordMigrationRecoveryRequired"];
|
|
33
|
+
export { __niceevalExport14 as RecordMigrationRecoveryRequired };
|
|
34
|
+
const __niceevalExport15 = __niceevalCanonical["RecordMigrationRequired"];
|
|
35
|
+
export { __niceevalExport15 as RecordMigrationRequired };
|
|
36
|
+
const __niceevalExport16 = __niceevalCanonical["RecordReaderClosed"];
|
|
37
|
+
export { __niceevalExport16 as RecordReaderClosed };
|
|
38
|
+
const __niceevalExport17 = __niceevalCanonical["frozenRecordAttemptBrand"];
|
|
39
|
+
export { __niceevalExport17 as frozenRecordAttemptBrand };
|
|
40
|
+
const __niceevalExport18 = __niceevalCanonical["readCurrentRecordFormat"];
|
|
41
|
+
export { __niceevalExport18 as readCurrentRecordFormat };
|
|
42
|
+
const __niceevalExport19 = __niceevalCanonical["readFixedRecordAttachment"];
|
|
43
|
+
export { __niceevalExport19 as readFixedRecordAttachment };
|
|
44
|
+
const __niceevalExport20 = __niceevalCanonical["readRecordFormatForMaintenance"];
|
|
45
|
+
export { __niceevalExport20 as readRecordFormatForMaintenance };
|
|
46
|
+
const __niceevalExport21 = __niceevalCanonical["validateFixedRecordAttachmentMigrationSource"];
|
|
47
|
+
export { __niceevalExport21 as validateFixedRecordAttachmentMigrationSource };
|
|
34
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RECORD_DURABLE_BLOB_REF_KEY = exports.RECORD_READER_MAXIMUM_ATTACHMENT_DOCUMENT_BYTES = exports.RECORD_READER_MAXIMUM_ATTACHMENT_TOTAL_BYTES = exports.RECORD_READER_MAXIMUM_ATTACHMENT_BLOB_BYTES = exports.RECORD_READER_MAXIMUM_ATTACHMENT_BLOB_ENTRIES = void 0;
|
|
4
4
|
exports.readFixedRecordAttachment = readFixedRecordAttachment;
|
|
5
|
+
exports.validateFixedRecordAttachmentMigrationSource = validateFixedRecordAttachmentMigrationSource;
|
|
5
6
|
const effect_1 = require("effect");
|
|
6
7
|
const internal_ts_1 = require("../attachment/internal.cjs");
|
|
7
8
|
const core_ts_1 = require("../codec/core.cjs");
|
|
@@ -201,4 +202,67 @@ function readFixedRecordAttachment(input) {
|
|
|
201
202
|
return Object.freeze({ state: "available", ...materializedValue.right });
|
|
202
203
|
});
|
|
203
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Maintenance-only validation of one exact historical attachment before its
|
|
207
|
+
* envelope advances. The durable payload and blob bytes are never rewritten:
|
|
208
|
+
* the historical decoder proves the old shape, while the current descriptor
|
|
209
|
+
* proves that the unchanged bytes and closure are valid after the step.
|
|
210
|
+
*/
|
|
211
|
+
function validateFixedRecordAttachmentMigrationSource(input) {
|
|
212
|
+
return effect_1.Effect.gen(function* () {
|
|
213
|
+
const directory = attachmentPath(input.root, input.location, input.descriptor.family);
|
|
214
|
+
if ((yield* input.fileSystem.pathKind(directory)) !== "directory")
|
|
215
|
+
return false;
|
|
216
|
+
const envelopeDocument = yield* readJson(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, "attachment.json"));
|
|
217
|
+
if (envelopeDocument.state !== "available")
|
|
218
|
+
return false;
|
|
219
|
+
const envelope = (0, core_ts_1.decodeRecordAttachmentEnvelope)(envelopeDocument.value);
|
|
220
|
+
if (effect_1.Either.isLeft(envelope) ||
|
|
221
|
+
envelope.right.family !== input.descriptor.family ||
|
|
222
|
+
envelope.right.schemaVersion !== input.fromSchemaVersion) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
const payloadDocument = yield* readJson(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, "payload.json"));
|
|
226
|
+
if (payloadDocument.state !== "available")
|
|
227
|
+
return false;
|
|
228
|
+
const blobs = yield* readBlobDirectory(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, "blobs"), input.descriptor.write.budget.maximumBlobs);
|
|
229
|
+
if (blobs.state === "invalid")
|
|
230
|
+
return false;
|
|
231
|
+
const hydrated = hydrateDurablePayload(payloadDocument.value);
|
|
232
|
+
if (hydrated.invalid)
|
|
233
|
+
return false;
|
|
234
|
+
const entries = blobs.state === "available" ? blobs.entries : [];
|
|
235
|
+
if (entries.length > input.descriptor.write.budget.maximumBlobs)
|
|
236
|
+
return false;
|
|
237
|
+
const entriesByKey = new Map(entries.map((entry) => [entry.name, entry]));
|
|
238
|
+
if (entriesByKey.size !== hydrated.refsByKey.size ||
|
|
239
|
+
[...hydrated.refsByKey.keys()].some((key) => !entriesByKey.has(key))) {
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
let migrated;
|
|
243
|
+
try {
|
|
244
|
+
migrated = input.migrate(input.decodeHistorical(hydrated.value));
|
|
245
|
+
}
|
|
246
|
+
catch {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
if (effect_1.Either.isLeft(input.descriptor.write.decodePayload(migrated)))
|
|
250
|
+
return false;
|
|
251
|
+
const payload = input.descriptor.write.decodePayload(hydrated.value);
|
|
252
|
+
if (effect_1.Either.isLeft(payload))
|
|
253
|
+
return false;
|
|
254
|
+
let totalBytes = 0;
|
|
255
|
+
const materialized = [];
|
|
256
|
+
for (const [key, ref] of hydrated.refsByKey) {
|
|
257
|
+
const bytes = yield* readBlob(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, "blobs", key), input.descriptor.write.budget.maximumBlobBytes);
|
|
258
|
+
if (bytes === undefined)
|
|
259
|
+
return false;
|
|
260
|
+
totalBytes += bytes.byteLength;
|
|
261
|
+
if (totalBytes > input.descriptor.write.budget.maximumTotalBytes)
|
|
262
|
+
return false;
|
|
263
|
+
materialized.push(Object.freeze({ ref, bytes }));
|
|
264
|
+
}
|
|
265
|
+
return effect_1.Either.isRight((0, internal_ts_1.makeFixedRecordAttachmentValueFromDecoded)(input.descriptor.write, payload.right, materialized));
|
|
266
|
+
});
|
|
267
|
+
}
|
|
204
268
|
//# sourceMappingURL=runtime.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["runtime.ts"],"names":[],"mappings":";;;AA4KA,8DAoFC;AAhQD,mCAAwC;AACxC,2DAAiJ;AAEjJ,8CAAkE;AAIlE,iEAA2G;AAG3G,yDAAuH;AACvH,4DAA4D;AAC5D,kFAAkF;AACrE,QAAA,6CAA6C,GAAG,MAAM,CAAC;AACvD,QAAA,2CAA2C,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/D,QAAA,4CAA4C,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AACjE,QAAA,+CAA+C,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAChF,+EAA+E;AAClE,QAAA,2BAA2B,GAAG,uBAAuB,CAAC;AAgDnE,SAAS,iBAAiB,CAAU,IAAuB;IACvD,MAAM,MAAM,GAAG,IAAA,uCAAoB,EAAC,CAAC,IAAA,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ttachmentValueFromDecoded, makeRecordBlobRef, type RecordAttachmentMaterializedBlob, } from \"../attachment/internal.ts\";\nimport type { RecordAttachmentBlobs, RecordAttachmentPayloadSnapshot, RecordBlobRef, } from \"../attachment/types.ts\";\nimport { decodeRecordAttachmentEnvelope } from \"../codec/core.ts\";\nimport type { FixedRecordFamilyDescriptor, NiceEvalFamily, } from \"../family/catalog.ts\";\nimport type { RecordAttachmentOwner } from \"../model/core.ts\";\nimport type { AttemptId, RunId } from \"../model/identifiers.ts\";\nimport { nonEmptyRecordIssues, recordIssue, type NonEmptyRecordIssues, } from \"../errors/record-errors.ts\";\nimport { RecordPathTypeInvalid, type RecordFileSystemError, } from \"../platform/errors.ts\";\nimport type { RecordRoot } from \"../platform/root.ts\";\nimport { recordPortablePath, type RecordDirectoryEntry, type RecordFileSystemService, } from \"../platform/services.ts\";\nimport { isPortableSegment } from \"../model/identifiers.ts\";\n/** Fixed readers materialize a family only when its explicit method is called. */\nexport const RECORD_READER_MAXIMUM_ATTACHMENT_BLOB_ENTRIES = 100000;\nexport const RECORD_READER_MAXIMUM_ATTACHMENT_BLOB_BYTES = 64 * 1024 * 1024;\nexport const RECORD_READER_MAXIMUM_ATTACHMENT_TOTAL_BYTES = 128 * 1024 * 1024;\nexport const RECORD_READER_MAXIMUM_ATTACHMENT_DOCUMENT_BYTES = 16 * 1024 * 1024;\n/** The storage-side ref codec reserves this exact one-property JSON object. */\nexport const RECORD_DURABLE_BLOB_REF_KEY = \"$niceeval.record.blob\";\ntype JsonDocument = {\n readonly state: \"available\";\n readonly value: unknown;\n} | {\n readonly state: \"missing\";\n} | {\n readonly state: \"invalid\";\n};\ntype BlobDirectory = {\n readonly state: \"available\";\n readonly entries: readonly RecordDirectoryEntry[];\n} | {\n readonly state: \"missing\";\n} | {\n readonly state: \"invalid\";\n};\ninterface HydratedPayload {\n readonly value: unknown;\n readonly refsByKey: ReadonlyMap<string, RecordBlobRef>;\n readonly invalid: boolean;\n}\nexport interface FixedRecordAttachmentLocation<Owner extends RecordAttachmentOwner> {\n readonly owner: Owner;\n readonly runId: RunId;\n readonly attemptId?: AttemptId;\n}\n/** @internal Storage result already flattened for the Host current API. */\nexport type FixedRecordAttachmentRead<Payload> = {\n readonly state: \"available\";\n readonly value: RecordAttachmentPayloadSnapshot<Payload>;\n readonly blobs: RecordAttachmentBlobs;\n} | {\n readonly state: \"unavailable\";\n} | {\n readonly state: \"migration-required\";\n readonly family: string;\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n readonly command: \"niceeval migrate\";\n} | {\n readonly state: \"unsupported\";\n readonly family: string;\n readonly schemaVersion: number;\n} | {\n readonly state: \"invalid\";\n readonly issues: NonEmptyRecordIssues;\n};\nfunction attachmentInvalid<Payload>(path: readonly string[]): FixedRecordAttachmentRead<Payload> {\n const issues = nonEmptyRecordIssues([recordIssue(\"record-schema-invalid\", path)]);\n if (issues === undefined)\n throw new Error(\"Attachment invalid state requires one issue\");\n return Object.freeze({ state: \"invalid\" as const, issues });\n}\nfunction attachmentPath(root: RecordRoot, location: FixedRecordAttachmentLocation<RecordAttachmentOwner>, family: string, ...segments: readonly string[]) {\n return location.owner === \"run\"\n ? recordPortablePath(root, \"runs\", location.runId, \"attachments\", family, ...segments)\n : recordPortablePath(root, \"runs\", location.runId, \"attempts\", location.attemptId!, \"attachments\", family, ...segments);\n}\nfunction parseJson(bytes: Uint8Array): JsonDocument {\n try {\n return Object.freeze({\n state: \"available\" as const,\n value: JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes)) as unknown,\n });\n }\n catch {\n return Object.freeze({ state: \"invalid\" as const });\n }\n}\nfunction readJson(fileSystem: RecordFileSystemService, file: ReturnType<typeof recordPortablePath>): Effect.Effect<JsonDocument, RecordFileSystemError> {\n return fileSystem.readFile({ file, maximumBytes: RECORD_READER_MAXIMUM_ATTACHMENT_DOCUMENT_BYTES }).pipe(Effect.map((bytes) => bytes === undefined ? Object.freeze({ state: \"missing\" as const }) : parseJson(bytes)), Effect.catchTag(\"RecordPathTypeInvalid\", () => Effect.succeed(Object.freeze({ state: \"invalid\" as const }))));\n}\nfunction stableEntries(entries: readonly RecordDirectoryEntry[]): readonly RecordDirectoryEntry[] | undefined {\n if (!entries.every((entry) => entry.kind === \"file\" && isPortableSegment(entry.name)))\n return undefined;\n const sorted = [...entries].sort((left, right) => left.name.localeCompare(right.name));\n return new Set(sorted.map((entry) => entry.name)).size === sorted.length ? Object.freeze(sorted) : undefined;\n}\nfunction readBlobDirectory(fileSystem: RecordFileSystemService, directory: ReturnType<typeof recordPortablePath>, maximumEntries: number): Effect.Effect<BlobDirectory, RecordFileSystemError> {\n return fileSystem.pathKind(directory).pipe(Effect.flatMap((kind): Effect.Effect<BlobDirectory, RecordFileSystemError> => {\n if (kind === \"missing\")\n return Effect.succeed<BlobDirectory>(Object.freeze({ state: \"missing\" as const }));\n if (kind !== \"directory\")\n return Effect.succeed<BlobDirectory>(Object.freeze({ state: \"invalid\" as const }));\n return fileSystem.listDirectory({\n directory,\n maximumEntries: Math.min(RECORD_READER_MAXIMUM_ATTACHMENT_BLOB_ENTRIES, maximumEntries),\n }).pipe(Effect.map((entries): BlobDirectory => {\n const stable = stableEntries(entries);\n return stable === undefined\n ? Object.freeze({ state: \"invalid\" as const })\n : Object.freeze({ state: \"available\" as const, entries: stable });\n }));\n }), Effect.catchTag(\"RecordPathTypeInvalid\", () => Effect.succeed<BlobDirectory>(Object.freeze({ state: \"invalid\" as const }))));\n}\nfunction hydrateDurablePayload(input: unknown): HydratedPayload {\n const refsByKey = new Map<string, RecordBlobRef>();\n let invalid = false;\n const hydrate = (value: unknown): unknown => {\n if (value === null || typeof value !== \"object\")\n return value;\n if (Array.isArray(value))\n return value.map(hydrate);\n const source = value as Record<string, unknown>;\n const keys = Object.keys(source);\n if (keys.length === 1 && keys[0] === RECORD_DURABLE_BLOB_REF_KEY) {\n const key = source[RECORD_DURABLE_BLOB_REF_KEY];\n if (typeof key !== \"string\" || !isPortableSegment(key)) {\n invalid = true;\n return source;\n }\n const prior = refsByKey.get(key);\n if (prior !== undefined)\n return prior;\n const ref = makeRecordBlobRef();\n refsByKey.set(key, ref);\n return ref;\n }\n const clone: Record<string, unknown> = Object.create(null) as Record<string, unknown>;\n for (const key of keys)\n clone[key] = hydrate(source[key]);\n return clone;\n };\n try {\n return Object.freeze({ value: hydrate(input), refsByKey, invalid });\n }\n catch {\n return Object.freeze({ value: input, refsByKey, invalid: true });\n }\n}\nfunction readBlob(fileSystem: RecordFileSystemService, file: ReturnType<typeof recordPortablePath>, maximumBytes: number): Effect.Effect<Uint8Array | undefined, RecordFileSystemError> {\n return fileSystem.readFile({\n file,\n maximumBytes: Math.min(RECORD_READER_MAXIMUM_ATTACHMENT_BLOB_BYTES, maximumBytes),\n }).pipe(Effect.catchTag(\"RecordPathTypeInvalid\", () => Effect.succeed(undefined)), Effect.catchTag(\"RecordResourceLimitExceeded\", () => Effect.succeed(undefined)));\n}\nfunction hasReachableAdjacentMigration<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>, fromSchemaVersion: number): boolean {\n if (fromSchemaVersion >= descriptor.schemaVersion)\n return false;\n let version = fromSchemaVersion;\n while (version < descriptor.schemaVersion) {\n const step = descriptor.adjacentMigrationLinks.find((link) => link.fromSchemaVersion === version && link.toSchemaVersion === version + 1);\n if (step === undefined)\n return false;\n version = step.toSchemaVersion;\n }\n return true;\n}\n/**\n * Reads precisely one known static family. Unknown sibling directories are\n * intentionally neither enumerated nor decoded, so future independent\n * families remain preserved and ignored by the normal graph.\n */\nexport function readFixedRecordAttachment<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {\n readonly fileSystem: RecordFileSystemService;\n readonly root: RecordRoot;\n readonly location: FixedRecordAttachmentLocation<Owner>;\n readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;\n}): Effect.Effect<FixedRecordAttachmentRead<Payload>, RecordFileSystemError> {\n return Effect.gen(function* () {\n const directory = attachmentPath(input.root, input.location, input.descriptor.family);\n const kind = yield* input.fileSystem.pathKind(directory);\n if (kind === \"missing\")\n return Object.freeze({ state: \"unavailable\" as const });\n if (kind !== \"directory\")\n return attachmentInvalid<Payload>([\"attachment\"]);\n const envelopeDocument = yield* readJson(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"attachment.json\"));\n if (envelopeDocument.state !== \"available\")\n return attachmentInvalid<Payload>([\"attachment.json\"]);\n const envelope = decodeRecordAttachmentEnvelope(envelopeDocument.value);\n if (Either.isLeft(envelope))\n return attachmentInvalid<Payload>([\"attachment.json\"]);\n // We reached a directory for one known fixed family. Its envelope must\n // declare that same family; treating a swapped envelope as an unknown\n // sibling would let a corrupted known directory masquerade as tolerated\n // future data.\n if (envelope.right.family !== input.descriptor.family) {\n return attachmentInvalid<Payload>([\"attachment.json\", \"family\"]);\n }\n if (envelope.right.schemaVersion < input.descriptor.schemaVersion &&\n hasReachableAdjacentMigration(input.descriptor, envelope.right.schemaVersion)) {\n return Object.freeze({\n state: \"migration-required\" as const,\n family: input.descriptor.family,\n fromSchemaVersion: envelope.right.schemaVersion,\n toSchemaVersion: input.descriptor.schemaVersion,\n command: \"niceeval migrate\" as const,\n });\n }\n if (envelope.right.schemaVersion !== input.descriptor.schemaVersion) {\n // A well-formed envelope for a known family can still carry a version\n // this reader cannot interpret. Only a reachable older version asks for\n // migration; all other non-current versions remain local unsupported\n // data, rather than being misclassified as corrupt bytes.\n return Object.freeze({\n state: \"unsupported\" as const,\n family: input.descriptor.family,\n schemaVersion: envelope.right.schemaVersion,\n });\n }\n const payloadDocument = yield* readJson(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"payload.json\"));\n if (payloadDocument.state !== \"available\")\n return attachmentInvalid<Payload>([\"payload.json\"]);\n const blobs = yield* readBlobDirectory(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"blobs\"), input.descriptor.write.budget.maximumBlobs);\n if (blobs.state === \"invalid\")\n return attachmentInvalid<Payload>([\"blobs\"]);\n const hydrated = hydrateDurablePayload(payloadDocument.value);\n if (hydrated.invalid)\n return attachmentInvalid<Payload>([\"payload.json\"]);\n const entries = blobs.state === \"available\" ? blobs.entries : [];\n if (entries.length > input.descriptor.write.budget.maximumBlobs) {\n return attachmentInvalid<Payload>([\"blobs\"]);\n }\n const entriesByKey = new Map(entries.map((entry) => [entry.name, entry] as const));\n if (entriesByKey.size !== hydrated.refsByKey.size || [...hydrated.refsByKey.keys()].some((key) => !entriesByKey.has(key))) {\n return attachmentInvalid<Payload>([\"blobs\"]);\n }\n const payload = input.descriptor.write.decodePayload(hydrated.value);\n if (Either.isLeft(payload))\n return attachmentInvalid<Payload>([\"payload.json\"]);\n let totalBytes = 0;\n const materialized: RecordAttachmentMaterializedBlob[] = [];\n for (const [key, ref] of hydrated.refsByKey) {\n const bytes = yield* readBlob(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"blobs\", key), input.descriptor.write.budget.maximumBlobBytes);\n if (bytes === undefined)\n return attachmentInvalid<Payload>([\"blobs\", key]);\n totalBytes += bytes.byteLength;\n if (totalBytes > input.descriptor.write.budget.maximumTotalBytes) {\n return attachmentInvalid<Payload>([\"blobs\", key]);\n }\n materialized.push(Object.freeze({ ref, bytes }));\n }\n const materializedValue = makeFixedRecordAttachmentValueFromDecoded(input.descriptor.write, payload.right, materialized);\n if (Either.isLeft(materializedValue))\n return attachmentInvalid<Payload>([\"payload.json\"]);\n return Object.freeze({ state: \"available\" as const, ...materializedValue.right });\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["runtime.ts"],"names":[],"mappings":";;;AA4KA,8DAoFC;AAOD,oGAgEC;AAvUD,mCAAwC;AACxC,2DAAiJ;AAEjJ,8CAAkE;AAIlE,iEAA2G;AAG3G,yDAAuH;AACvH,4DAA4D;AAC5D,kFAAkF;AACrE,QAAA,6CAA6C,GAAG,MAAM,CAAC;A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,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB;gBAC5D,OAAO,KAAK,CAAC;YACjB,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,eAAM,CAAC,OAAO,CAAC,IAAA,uDAAyC,EAAC,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;IAC1H,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { Effect, Either } from \"effect\";\nimport { makeFixedRecordAttachmentValueFromDecoded, makeRecordBlobRef, type RecordAttachmentMaterializedBlob, } from \"../attachment/internal.ts\";\nimport type { RecordAttachmentBlobs, RecordAttachmentPayloadSnapshot, RecordBlobRef, } from \"../attachment/types.ts\";\nimport { decodeRecordAttachmentEnvelope } from \"../codec/core.ts\";\nimport type { FixedRecordFamilyDescriptor, NiceEvalFamily, } from \"../family/catalog.ts\";\nimport type { RecordAttachmentOwner } from \"../model/core.ts\";\nimport type { AttemptId, RunId } from \"../model/identifiers.ts\";\nimport { nonEmptyRecordIssues, recordIssue, type NonEmptyRecordIssues, } from \"../errors/record-errors.ts\";\nimport { RecordPathTypeInvalid, type RecordFileSystemError, } from \"../platform/errors.ts\";\nimport type { RecordRoot } from \"../platform/root.ts\";\nimport { recordPortablePath, type RecordDirectoryEntry, type RecordFileSystemService, } from \"../platform/services.ts\";\nimport { isPortableSegment } from \"../model/identifiers.ts\";\n/** Fixed readers materialize a family only when its explicit method is called. */\nexport const RECORD_READER_MAXIMUM_ATTACHMENT_BLOB_ENTRIES = 100000;\nexport const RECORD_READER_MAXIMUM_ATTACHMENT_BLOB_BYTES = 64 * 1024 * 1024;\nexport const RECORD_READER_MAXIMUM_ATTACHMENT_TOTAL_BYTES = 128 * 1024 * 1024;\nexport const RECORD_READER_MAXIMUM_ATTACHMENT_DOCUMENT_BYTES = 16 * 1024 * 1024;\n/** The storage-side ref codec reserves this exact one-property JSON object. */\nexport const RECORD_DURABLE_BLOB_REF_KEY = \"$niceeval.record.blob\";\ntype JsonDocument = {\n readonly state: \"available\";\n readonly value: unknown;\n} | {\n readonly state: \"missing\";\n} | {\n readonly state: \"invalid\";\n};\ntype BlobDirectory = {\n readonly state: \"available\";\n readonly entries: readonly RecordDirectoryEntry[];\n} | {\n readonly state: \"missing\";\n} | {\n readonly state: \"invalid\";\n};\ninterface HydratedPayload {\n readonly value: unknown;\n readonly refsByKey: ReadonlyMap<string, RecordBlobRef>;\n readonly invalid: boolean;\n}\nexport interface FixedRecordAttachmentLocation<Owner extends RecordAttachmentOwner> {\n readonly owner: Owner;\n readonly runId: RunId;\n readonly attemptId?: AttemptId;\n}\n/** @internal Storage result already flattened for the Host current API. */\nexport type FixedRecordAttachmentRead<Payload> = {\n readonly state: \"available\";\n readonly value: RecordAttachmentPayloadSnapshot<Payload>;\n readonly blobs: RecordAttachmentBlobs;\n} | {\n readonly state: \"unavailable\";\n} | {\n readonly state: \"migration-required\";\n readonly family: string;\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n readonly command: \"niceeval migrate\";\n} | {\n readonly state: \"unsupported\";\n readonly family: string;\n readonly schemaVersion: number;\n} | {\n readonly state: \"invalid\";\n readonly issues: NonEmptyRecordIssues;\n};\nfunction attachmentInvalid<Payload>(path: readonly string[]): FixedRecordAttachmentRead<Payload> {\n const issues = nonEmptyRecordIssues([recordIssue(\"record-schema-invalid\", path)]);\n if (issues === undefined)\n throw new Error(\"Attachment invalid state requires one issue\");\n return Object.freeze({ state: \"invalid\" as const, issues });\n}\nfunction attachmentPath(root: RecordRoot, location: FixedRecordAttachmentLocation<RecordAttachmentOwner>, family: string, ...segments: readonly string[]) {\n return location.owner === \"run\"\n ? recordPortablePath(root, \"runs\", location.runId, \"attachments\", family, ...segments)\n : recordPortablePath(root, \"runs\", location.runId, \"attempts\", location.attemptId!, \"attachments\", family, ...segments);\n}\nfunction parseJson(bytes: Uint8Array): JsonDocument {\n try {\n return Object.freeze({\n state: \"available\" as const,\n value: JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes)) as unknown,\n });\n }\n catch {\n return Object.freeze({ state: \"invalid\" as const });\n }\n}\nfunction readJson(fileSystem: RecordFileSystemService, file: ReturnType<typeof recordPortablePath>): Effect.Effect<JsonDocument, RecordFileSystemError> {\n return fileSystem.readFile({ file, maximumBytes: RECORD_READER_MAXIMUM_ATTACHMENT_DOCUMENT_BYTES }).pipe(Effect.map((bytes) => bytes === undefined ? Object.freeze({ state: \"missing\" as const }) : parseJson(bytes)), Effect.catchTag(\"RecordPathTypeInvalid\", () => Effect.succeed(Object.freeze({ state: \"invalid\" as const }))));\n}\nfunction stableEntries(entries: readonly RecordDirectoryEntry[]): readonly RecordDirectoryEntry[] | undefined {\n if (!entries.every((entry) => entry.kind === \"file\" && isPortableSegment(entry.name)))\n return undefined;\n const sorted = [...entries].sort((left, right) => left.name.localeCompare(right.name));\n return new Set(sorted.map((entry) => entry.name)).size === sorted.length ? Object.freeze(sorted) : undefined;\n}\nfunction readBlobDirectory(fileSystem: RecordFileSystemService, directory: ReturnType<typeof recordPortablePath>, maximumEntries: number): Effect.Effect<BlobDirectory, RecordFileSystemError> {\n return fileSystem.pathKind(directory).pipe(Effect.flatMap((kind): Effect.Effect<BlobDirectory, RecordFileSystemError> => {\n if (kind === \"missing\")\n return Effect.succeed<BlobDirectory>(Object.freeze({ state: \"missing\" as const }));\n if (kind !== \"directory\")\n return Effect.succeed<BlobDirectory>(Object.freeze({ state: \"invalid\" as const }));\n return fileSystem.listDirectory({\n directory,\n maximumEntries: Math.min(RECORD_READER_MAXIMUM_ATTACHMENT_BLOB_ENTRIES, maximumEntries),\n }).pipe(Effect.map((entries): BlobDirectory => {\n const stable = stableEntries(entries);\n return stable === undefined\n ? Object.freeze({ state: \"invalid\" as const })\n : Object.freeze({ state: \"available\" as const, entries: stable });\n }));\n }), Effect.catchTag(\"RecordPathTypeInvalid\", () => Effect.succeed<BlobDirectory>(Object.freeze({ state: \"invalid\" as const }))));\n}\nfunction hydrateDurablePayload(input: unknown): HydratedPayload {\n const refsByKey = new Map<string, RecordBlobRef>();\n let invalid = false;\n const hydrate = (value: unknown): unknown => {\n if (value === null || typeof value !== \"object\")\n return value;\n if (Array.isArray(value))\n return value.map(hydrate);\n const source = value as Record<string, unknown>;\n const keys = Object.keys(source);\n if (keys.length === 1 && keys[0] === RECORD_DURABLE_BLOB_REF_KEY) {\n const key = source[RECORD_DURABLE_BLOB_REF_KEY];\n if (typeof key !== \"string\" || !isPortableSegment(key)) {\n invalid = true;\n return source;\n }\n const prior = refsByKey.get(key);\n if (prior !== undefined)\n return prior;\n const ref = makeRecordBlobRef();\n refsByKey.set(key, ref);\n return ref;\n }\n const clone: Record<string, unknown> = Object.create(null) as Record<string, unknown>;\n for (const key of keys)\n clone[key] = hydrate(source[key]);\n return clone;\n };\n try {\n return Object.freeze({ value: hydrate(input), refsByKey, invalid });\n }\n catch {\n return Object.freeze({ value: input, refsByKey, invalid: true });\n }\n}\nfunction readBlob(fileSystem: RecordFileSystemService, file: ReturnType<typeof recordPortablePath>, maximumBytes: number): Effect.Effect<Uint8Array | undefined, RecordFileSystemError> {\n return fileSystem.readFile({\n file,\n maximumBytes: Math.min(RECORD_READER_MAXIMUM_ATTACHMENT_BLOB_BYTES, maximumBytes),\n }).pipe(Effect.catchTag(\"RecordPathTypeInvalid\", () => Effect.succeed(undefined)), Effect.catchTag(\"RecordResourceLimitExceeded\", () => Effect.succeed(undefined)));\n}\nfunction hasReachableAdjacentMigration<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>, fromSchemaVersion: number): boolean {\n if (fromSchemaVersion >= descriptor.schemaVersion)\n return false;\n let version = fromSchemaVersion;\n while (version < descriptor.schemaVersion) {\n const step = descriptor.adjacentMigrationLinks.find((link) => link.fromSchemaVersion === version && link.toSchemaVersion === version + 1);\n if (step === undefined)\n return false;\n version = step.toSchemaVersion;\n }\n return true;\n}\n/**\n * Reads precisely one known static family. Unknown sibling directories are\n * intentionally neither enumerated nor decoded, so future independent\n * families remain preserved and ignored by the normal graph.\n */\nexport function readFixedRecordAttachment<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {\n readonly fileSystem: RecordFileSystemService;\n readonly root: RecordRoot;\n readonly location: FixedRecordAttachmentLocation<Owner>;\n readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;\n}): Effect.Effect<FixedRecordAttachmentRead<Payload>, RecordFileSystemError> {\n return Effect.gen(function* () {\n const directory = attachmentPath(input.root, input.location, input.descriptor.family);\n const kind = yield* input.fileSystem.pathKind(directory);\n if (kind === \"missing\")\n return Object.freeze({ state: \"unavailable\" as const });\n if (kind !== \"directory\")\n return attachmentInvalid<Payload>([\"attachment\"]);\n const envelopeDocument = yield* readJson(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"attachment.json\"));\n if (envelopeDocument.state !== \"available\")\n return attachmentInvalid<Payload>([\"attachment.json\"]);\n const envelope = decodeRecordAttachmentEnvelope(envelopeDocument.value);\n if (Either.isLeft(envelope))\n return attachmentInvalid<Payload>([\"attachment.json\"]);\n // We reached a directory for one known fixed family. Its envelope must\n // declare that same family; treating a swapped envelope as an unknown\n // sibling would let a corrupted known directory masquerade as tolerated\n // future data.\n if (envelope.right.family !== input.descriptor.family) {\n return attachmentInvalid<Payload>([\"attachment.json\", \"family\"]);\n }\n if (envelope.right.schemaVersion < input.descriptor.schemaVersion &&\n hasReachableAdjacentMigration(input.descriptor, envelope.right.schemaVersion)) {\n return Object.freeze({\n state: \"migration-required\" as const,\n family: input.descriptor.family,\n fromSchemaVersion: envelope.right.schemaVersion,\n toSchemaVersion: input.descriptor.schemaVersion,\n command: \"niceeval migrate\" as const,\n });\n }\n if (envelope.right.schemaVersion !== input.descriptor.schemaVersion) {\n // A well-formed envelope for a known family can still carry a version\n // this reader cannot interpret. Only a reachable older version asks for\n // migration; all other non-current versions remain local unsupported\n // data, rather than being misclassified as corrupt bytes.\n return Object.freeze({\n state: \"unsupported\" as const,\n family: input.descriptor.family,\n schemaVersion: envelope.right.schemaVersion,\n });\n }\n const payloadDocument = yield* readJson(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"payload.json\"));\n if (payloadDocument.state !== \"available\")\n return attachmentInvalid<Payload>([\"payload.json\"]);\n const blobs = yield* readBlobDirectory(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"blobs\"), input.descriptor.write.budget.maximumBlobs);\n if (blobs.state === \"invalid\")\n return attachmentInvalid<Payload>([\"blobs\"]);\n const hydrated = hydrateDurablePayload(payloadDocument.value);\n if (hydrated.invalid)\n return attachmentInvalid<Payload>([\"payload.json\"]);\n const entries = blobs.state === \"available\" ? blobs.entries : [];\n if (entries.length > input.descriptor.write.budget.maximumBlobs) {\n return attachmentInvalid<Payload>([\"blobs\"]);\n }\n const entriesByKey = new Map(entries.map((entry) => [entry.name, entry] as const));\n if (entriesByKey.size !== hydrated.refsByKey.size || [...hydrated.refsByKey.keys()].some((key) => !entriesByKey.has(key))) {\n return attachmentInvalid<Payload>([\"blobs\"]);\n }\n const payload = input.descriptor.write.decodePayload(hydrated.value);\n if (Either.isLeft(payload))\n return attachmentInvalid<Payload>([\"payload.json\"]);\n let totalBytes = 0;\n const materialized: RecordAttachmentMaterializedBlob[] = [];\n for (const [key, ref] of hydrated.refsByKey) {\n const bytes = yield* readBlob(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"blobs\", key), input.descriptor.write.budget.maximumBlobBytes);\n if (bytes === undefined)\n return attachmentInvalid<Payload>([\"blobs\", key]);\n totalBytes += bytes.byteLength;\n if (totalBytes > input.descriptor.write.budget.maximumTotalBytes) {\n return attachmentInvalid<Payload>([\"blobs\", key]);\n }\n materialized.push(Object.freeze({ ref, bytes }));\n }\n const materializedValue = makeFixedRecordAttachmentValueFromDecoded(input.descriptor.write, payload.right, materialized);\n if (Either.isLeft(materializedValue))\n return attachmentInvalid<Payload>([\"payload.json\"]);\n return Object.freeze({ state: \"available\" as const, ...materializedValue.right });\n });\n}\n/**\n * Maintenance-only validation of one exact historical attachment before its\n * envelope advances. The durable payload and blob bytes are never rewritten:\n * the historical decoder proves the old shape, while the current descriptor\n * proves that the unchanged bytes and closure are valid after the step.\n */\nexport function validateFixedRecordAttachmentMigrationSource<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {\n readonly fileSystem: RecordFileSystemService;\n readonly root: RecordRoot;\n readonly location: FixedRecordAttachmentLocation<Owner>;\n readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;\n readonly fromSchemaVersion: number;\n readonly decodeHistorical: (value: unknown) => unknown;\n readonly migrate: (value: unknown) => unknown;\n}): Effect.Effect<boolean, RecordFileSystemError> {\n return Effect.gen(function* () {\n const directory = attachmentPath(input.root, input.location, input.descriptor.family);\n if ((yield* input.fileSystem.pathKind(directory)) !== \"directory\")\n return false;\n const envelopeDocument = yield* readJson(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"attachment.json\"));\n if (envelopeDocument.state !== \"available\")\n return false;\n const envelope = decodeRecordAttachmentEnvelope(envelopeDocument.value);\n if (Either.isLeft(envelope) ||\n envelope.right.family !== input.descriptor.family ||\n envelope.right.schemaVersion !== input.fromSchemaVersion) {\n return false;\n }\n const payloadDocument = yield* readJson(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"payload.json\"));\n if (payloadDocument.state !== \"available\")\n return false;\n const blobs = yield* readBlobDirectory(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"blobs\"), input.descriptor.write.budget.maximumBlobs);\n if (blobs.state === \"invalid\")\n return false;\n const hydrated = hydrateDurablePayload(payloadDocument.value);\n if (hydrated.invalid)\n return false;\n const entries = blobs.state === \"available\" ? blobs.entries : [];\n if (entries.length > input.descriptor.write.budget.maximumBlobs)\n return false;\n const entriesByKey = new Map(entries.map((entry) => [entry.name, entry] as const));\n if (entriesByKey.size !== hydrated.refsByKey.size ||\n [...hydrated.refsByKey.keys()].some((key) => !entriesByKey.has(key))) {\n return false;\n }\n let migrated: unknown;\n try {\n migrated = input.migrate(input.decodeHistorical(hydrated.value));\n }\n catch {\n return false;\n }\n if (Either.isLeft(input.descriptor.write.decodePayload(migrated)))\n return false;\n const payload = input.descriptor.write.decodePayload(hydrated.value);\n if (Either.isLeft(payload))\n return false;\n let totalBytes = 0;\n const materialized: RecordAttachmentMaterializedBlob[] = [];\n for (const [key, ref] of hydrated.refsByKey) {\n const bytes = yield* readBlob(input.fileSystem, attachmentPath(input.root, input.location, input.descriptor.family, \"blobs\", key), input.descriptor.write.budget.maximumBlobBytes);\n if (bytes === undefined)\n return false;\n totalBytes += bytes.byteLength;\n if (totalBytes > input.descriptor.write.budget.maximumTotalBytes)\n return false;\n materialized.push(Object.freeze({ ref, bytes }));\n }\n return Either.isRight(makeFixedRecordAttachmentValueFromDecoded(input.descriptor.write, payload.right, materialized));\n });\n}\n"]}
|
|
@@ -51,3 +51,18 @@ export declare function readFixedRecordAttachment<Family extends NiceEvalFamily,
|
|
|
51
51
|
readonly location: FixedRecordAttachmentLocation<Owner>;
|
|
52
52
|
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
53
53
|
}): Effect.Effect<FixedRecordAttachmentRead<Payload>, RecordFileSystemError>;
|
|
54
|
+
/**
|
|
55
|
+
* Maintenance-only validation of one exact historical attachment before its
|
|
56
|
+
* envelope advances. The durable payload and blob bytes are never rewritten:
|
|
57
|
+
* the historical decoder proves the old shape, while the current descriptor
|
|
58
|
+
* proves that the unchanged bytes and closure are valid after the step.
|
|
59
|
+
*/
|
|
60
|
+
export declare function validateFixedRecordAttachmentMigrationSource<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {
|
|
61
|
+
readonly fileSystem: RecordFileSystemService;
|
|
62
|
+
readonly root: RecordRoot;
|
|
63
|
+
readonly location: FixedRecordAttachmentLocation<Owner>;
|
|
64
|
+
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
65
|
+
readonly fromSchemaVersion: number;
|
|
66
|
+
readonly decodeHistorical: (value: unknown) => unknown;
|
|
67
|
+
readonly migrate: (value: unknown) => unknown;
|
|
68
|
+
}): Effect.Effect<boolean, RecordFileSystemError>;
|
|
@@ -51,3 +51,18 @@ export declare function readFixedRecordAttachment<Family extends NiceEvalFamily,
|
|
|
51
51
|
readonly location: FixedRecordAttachmentLocation<Owner>;
|
|
52
52
|
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
53
53
|
}): Effect.Effect<FixedRecordAttachmentRead<Payload>, RecordFileSystemError>;
|
|
54
|
+
/**
|
|
55
|
+
* Maintenance-only validation of one exact historical attachment before its
|
|
56
|
+
* envelope advances. The durable payload and blob bytes are never rewritten:
|
|
57
|
+
* the historical decoder proves the old shape, while the current descriptor
|
|
58
|
+
* proves that the unchanged bytes and closure are valid after the step.
|
|
59
|
+
*/
|
|
60
|
+
export declare function validateFixedRecordAttachmentMigrationSource<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {
|
|
61
|
+
readonly fileSystem: RecordFileSystemService;
|
|
62
|
+
readonly root: RecordRoot;
|
|
63
|
+
readonly location: FixedRecordAttachmentLocation<Owner>;
|
|
64
|
+
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
65
|
+
readonly fromSchemaVersion: number;
|
|
66
|
+
readonly decodeHistorical: (value: unknown) => unknown;
|
|
67
|
+
readonly migrate: (value: unknown) => unknown;
|
|
68
|
+
}): Effect.Effect<boolean, RecordFileSystemError>;
|
|
@@ -51,3 +51,18 @@ export declare function readFixedRecordAttachment<Family extends NiceEvalFamily,
|
|
|
51
51
|
readonly location: FixedRecordAttachmentLocation<Owner>;
|
|
52
52
|
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
53
53
|
}): Effect.Effect<FixedRecordAttachmentRead<Payload>, RecordFileSystemError>;
|
|
54
|
+
/**
|
|
55
|
+
* Maintenance-only validation of one exact historical attachment before its
|
|
56
|
+
* envelope advances. The durable payload and blob bytes are never rewritten:
|
|
57
|
+
* the historical decoder proves the old shape, while the current descriptor
|
|
58
|
+
* proves that the unchanged bytes and closure are valid after the step.
|
|
59
|
+
*/
|
|
60
|
+
export declare function validateFixedRecordAttachmentMigrationSource<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {
|
|
61
|
+
readonly fileSystem: RecordFileSystemService;
|
|
62
|
+
readonly root: RecordRoot;
|
|
63
|
+
readonly location: FixedRecordAttachmentLocation<Owner>;
|
|
64
|
+
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
65
|
+
readonly fromSchemaVersion: number;
|
|
66
|
+
readonly decodeHistorical: (value: unknown) => unknown;
|
|
67
|
+
readonly migrate: (value: unknown) => unknown;
|
|
68
|
+
}): Effect.Effect<boolean, RecordFileSystemError>;
|
|
@@ -13,4 +13,6 @@ const __niceevalExport4 = __niceevalCanonical["RECORD_READER_MAXIMUM_ATTACHMENT_
|
|
|
13
13
|
export { __niceevalExport4 as RECORD_READER_MAXIMUM_ATTACHMENT_TOTAL_BYTES };
|
|
14
14
|
const __niceevalExport5 = __niceevalCanonical["readFixedRecordAttachment"];
|
|
15
15
|
export { __niceevalExport5 as readFixedRecordAttachment };
|
|
16
|
+
const __niceevalExport6 = __niceevalCanonical["validateFixedRecordAttachmentMigrationSource"];
|
|
17
|
+
export { __niceevalExport6 as validateFixedRecordAttachmentMigrationSource };
|
|
16
18
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -2456,9 +2456,9 @@ html.niceeval-view-document body {
|
|
|
2456
2456
|
position: sticky;
|
|
2457
2457
|
top: 0;
|
|
2458
2458
|
z-index: 10;
|
|
2459
|
-
display:
|
|
2459
|
+
display: grid;
|
|
2460
|
+
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
|
2460
2461
|
align-items: center;
|
|
2461
|
-
justify-content: space-between;
|
|
2462
2462
|
gap: 28px;
|
|
2463
2463
|
}
|
|
2464
2464
|
|
|
@@ -2470,6 +2470,7 @@ html.niceeval-view-document body {
|
|
|
2470
2470
|
|
|
2471
2471
|
.niceeval-view-brand {
|
|
2472
2472
|
display: flex;
|
|
2473
|
+
justify-self: start;
|
|
2473
2474
|
flex: 0 0 auto;
|
|
2474
2475
|
align-items: baseline;
|
|
2475
2476
|
gap: 12px;
|
|
@@ -2477,6 +2478,20 @@ html.niceeval-view-document body {
|
|
|
2477
2478
|
font-weight: 690;
|
|
2478
2479
|
}
|
|
2479
2480
|
|
|
2481
|
+
.niceeval-view-pages {
|
|
2482
|
+
display: flex;
|
|
2483
|
+
min-width: 0;
|
|
2484
|
+
justify-self: center;
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
.niceeval-view-controls {
|
|
2488
|
+
display: flex;
|
|
2489
|
+
min-width: 0;
|
|
2490
|
+
align-items: center;
|
|
2491
|
+
justify-self: end;
|
|
2492
|
+
gap: 12px;
|
|
2493
|
+
}
|
|
2494
|
+
|
|
2480
2495
|
.niceeval-view-mark {
|
|
2481
2496
|
display: inline-block;
|
|
2482
2497
|
width: 18px;
|
|
@@ -2516,40 +2531,42 @@ html.niceeval-view-document body {
|
|
|
2516
2531
|
|
|
2517
2532
|
.niceeval-view-nav a[aria-current="page"] { font-weight: 560; }
|
|
2518
2533
|
|
|
2519
|
-
.niceeval-view-
|
|
2520
|
-
|
|
2521
|
-
|
|
2534
|
+
.niceeval-view-experiment {
|
|
2535
|
+
min-width: 0;
|
|
2536
|
+
color: var(--niceeval-color-text-secondary, #a1a1aa);
|
|
2537
|
+
font-size: 12px;
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2540
|
+
.niceeval-view-experiment label {
|
|
2541
|
+
display: flex;
|
|
2522
2542
|
align-items: center;
|
|
2523
|
-
|
|
2543
|
+
gap: 8px;
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
.niceeval-view-experiment select,
|
|
2547
|
+
.niceeval-view-language select {
|
|
2548
|
+
min-width: 132px;
|
|
2549
|
+
height: 32px;
|
|
2524
2550
|
border: 1px solid var(--niceeval-color-border, #262626);
|
|
2525
2551
|
border-radius: var(--niceeval-radius, 0);
|
|
2552
|
+
padding: 0 28px 0 10px;
|
|
2553
|
+
color: var(--niceeval-color-text, #ededed);
|
|
2526
2554
|
background: var(--niceeval-color-surface, #0b0b0b);
|
|
2527
|
-
}
|
|
2528
|
-
|
|
2529
|
-
.niceeval-view-locale button {
|
|
2530
|
-
height: 30px;
|
|
2531
|
-
min-width: 44px;
|
|
2532
|
-
border: 0;
|
|
2533
|
-
border-right: 1px solid var(--niceeval-color-border, #262626);
|
|
2534
|
-
padding: 0;
|
|
2535
|
-
color: var(--niceeval-color-text-secondary, #a1a1aa);
|
|
2536
|
-
background: transparent;
|
|
2537
2555
|
font: inherit;
|
|
2538
|
-
font-size:
|
|
2539
|
-
line-height: 1;
|
|
2556
|
+
font-size: 14px;
|
|
2540
2557
|
cursor: pointer;
|
|
2541
2558
|
}
|
|
2542
2559
|
|
|
2543
|
-
.niceeval-view-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
color: var(--niceeval-color-text, #ededed);
|
|
2547
|
-
background: var(--niceeval-color-surface-subtle, #111111);
|
|
2548
|
-
font-weight: 620;
|
|
2560
|
+
.niceeval-view-language {
|
|
2561
|
+
display: block;
|
|
2562
|
+
flex: 0 0 auto;
|
|
2549
2563
|
}
|
|
2550
2564
|
|
|
2565
|
+
.niceeval-view-language select { min-width: 76px; }
|
|
2566
|
+
|
|
2551
2567
|
.niceeval-view-nav a:focus-visible,
|
|
2552
|
-
.niceeval-view-
|
|
2568
|
+
.niceeval-view-experiment select:focus-visible,
|
|
2569
|
+
.niceeval-view-language select:focus-visible,
|
|
2553
2570
|
.niceeval-view-brand:focus-visible {
|
|
2554
2571
|
outline: 1px solid var(--niceeval-color-focus, #cbd6dc);
|
|
2555
2572
|
outline-offset: 2px;
|
|
@@ -2665,14 +2682,21 @@ html.niceeval-view-document body {
|
|
|
2665
2682
|
[data-niceeval-locale][hidden] { display: none !important; }
|
|
2666
2683
|
|
|
2667
2684
|
@media (max-width: 760px) {
|
|
2668
|
-
.niceeval-view-shell {
|
|
2669
|
-
|
|
2670
|
-
|
|
2685
|
+
.niceeval-view-shell {
|
|
2686
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
2687
|
+
padding: 0 20px;
|
|
2688
|
+
}
|
|
2689
|
+
.niceeval-view-pages { display: none; }
|
|
2690
|
+
.niceeval-view-controls { grid-column: 2; }
|
|
2691
|
+
.niceeval-view-experiment noscript .niceeval-view-nav { display: none; }
|
|
2692
|
+
.niceeval-view-experiment label > span { display: none; }
|
|
2693
|
+
.niceeval-view-experiment select { min-width: 108px; }
|
|
2694
|
+
.niceeval-view-language select { min-width: 68px; }
|
|
2671
2695
|
.niceeval-view-main { width: min(calc(100vw - 28px), 1120px); padding-top: 42px; }
|
|
2672
2696
|
}
|
|
2673
2697
|
|
|
2674
2698
|
@media print {
|
|
2675
2699
|
.niceeval-view-shell { position: static; }
|
|
2676
|
-
.niceeval-view-
|
|
2700
|
+
.niceeval-view-controls { display: none; }
|
|
2677
2701
|
.niceeval-view-main { width: auto; padding: 0; }
|
|
2678
2702
|
}
|