niceeval 0.13.2 → 0.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/bub.cjs +4 -4
- 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-native.cjs +213 -0
- package/dist/agents/claude-code-native.cjs.map +1 -0
- package/dist/agents/claude-code-native.d.cts +5 -0
- package/dist/agents/claude-code-native.d.mts +5 -0
- package/dist/agents/claude-code-native.d.ts +5 -0
- package/dist/agents/claude-code-native.js +6 -0
- package/dist/agents/claude-code-native.js.map +1 -0
- package/dist/agents/claude-code.cjs +26 -80
- package/dist/agents/claude-code.cjs.map +1 -1
- package/dist/agents/codex-app-server.cjs +314 -0
- package/dist/agents/codex-app-server.cjs.map +1 -0
- package/dist/agents/codex-app-server.d.cts +9 -0
- package/dist/agents/codex-app-server.d.mts +9 -0
- package/dist/agents/codex-app-server.d.ts +9 -0
- package/dist/agents/codex-app-server.js +6 -0
- package/dist/agents/codex-app-server.js.map +1 -0
- package/dist/agents/codex.cjs +19 -68
- 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/index.cjs +3 -1
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +1 -0
- package/dist/agents/index.d.mts +1 -0
- package/dist/agents/index.d.ts +1 -0
- package/dist/agents/index.js +84 -82
- package/dist/agents/index.mjs +84 -82
- package/dist/agents/managed-jsonl.cjs +207 -0
- package/dist/agents/managed-jsonl.cjs.map +1 -0
- package/dist/agents/managed-jsonl.d.cts +39 -0
- package/dist/agents/managed-jsonl.d.mts +39 -0
- package/dist/agents/managed-jsonl.d.ts +39 -0
- package/dist/agents/managed-jsonl.js +6 -0
- package/dist/agents/managed-jsonl.js.map +1 -0
- package/dist/agents/managed-process.cjs +31 -0
- package/dist/agents/managed-process.cjs.map +1 -0
- package/dist/agents/managed-process.d.cts +3 -0
- package/dist/agents/managed-process.d.mts +3 -0
- package/dist/agents/managed-process.d.ts +3 -0
- package/dist/agents/managed-process.js +6 -0
- package/dist/agents/managed-process.js.map +1 -0
- package/dist/agents/omp.cjs +18 -1
- package/dist/agents/omp.cjs.map +1 -1
- package/dist/agents/sdk-streams.cjs +11 -4
- package/dist/agents/sdk-streams.cjs.map +1 -1
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.d.cts +8 -0
- package/dist/agents/types.d.mts +8 -0
- package/dist/agents/types.d.ts +8 -0
- package/dist/analysis/bindings.cjs +74 -19
- package/dist/analysis/bindings.cjs.map +1 -1
- package/dist/analysis/bindings.d.cts +534 -156
- package/dist/analysis/bindings.d.mts +534 -156
- package/dist/analysis/bindings.d.ts +534 -156
- package/dist/analysis/domain-view.cjs.map +1 -1
- package/dist/analysis/domain-view.d.cts +137 -8
- package/dist/analysis/domain-view.d.mts +137 -8
- package/dist/analysis/domain-view.d.ts +137 -8
- package/dist/analysis/index.cjs.map +1 -1
- package/dist/analysis/index.d.cts +1 -1
- package/dist/analysis/index.d.mts +1 -1
- package/dist/analysis/index.d.ts +1 -1
- package/dist/assertions/api.cjs.map +1 -1
- package/dist/assertions/api.d.cts +62 -0
- package/dist/assertions/api.d.mts +62 -0
- package/dist/assertions/api.d.ts +62 -0
- package/dist/assertions/judge.cjs +56 -5
- package/dist/assertions/judge.cjs.map +1 -1
- package/dist/assertions/match.cjs +66 -42
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +13 -0
- package/dist/assertions/match.d.mts +13 -0
- package/dist/assertions/match.d.ts +13 -0
- package/dist/assertions/record/attachment.cjs +104 -33
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/attachment.d.cts +294 -57
- package/dist/assertions/record/attachment.d.mts +294 -57
- package/dist/assertions/record/attachment.d.ts +294 -57
- package/dist/assertions/record/codec.cjs +91 -17
- package/dist/assertions/record/codec.cjs.map +1 -1
- package/dist/assertions/record/codec.d.cts +280 -52
- package/dist/assertions/record/codec.d.mts +280 -52
- package/dist/assertions/record/codec.d.ts +280 -52
- package/dist/assertions/record/index.js +2 -0
- package/dist/assertions/record/model.cjs +16 -0
- package/dist/assertions/record/model.cjs.map +1 -1
- package/dist/assertions/record/model.d.cts +120 -13
- package/dist/assertions/record/model.d.mts +120 -13
- package/dist/assertions/record/model.d.ts +120 -13
- package/dist/assertions/record/model.js +2 -0
- package/dist/assertions/record/producer.cjs +70 -50
- package/dist/assertions/record/producer.cjs.map +1 -1
- package/dist/assertions/record/producer.d.cts +8 -7
- package/dist/assertions/record/producer.d.mts +8 -7
- package/dist/assertions/record/producer.d.ts +8 -7
- package/dist/assertions/runtime.cjs +49 -7
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/cli/application.cjs +40 -0
- package/dist/cli/application.cjs.map +1 -0
- package/dist/cli/application.d.cts +129 -0
- package/dist/cli/application.d.mts +129 -0
- package/dist/cli/application.d.ts +129 -0
- package/dist/cli/application.js +24 -0
- package/dist/cli/application.js.map +1 -0
- package/dist/cli/bootstrap.cjs +10 -4
- package/dist/cli/bootstrap.cjs.map +1 -1
- package/dist/cli/node-application.cjs +123 -0
- package/dist/cli/node-application.cjs.map +1 -0
- package/dist/cli/node-application.d.cts +14 -0
- package/dist/cli/node-application.d.mts +14 -0
- package/dist/cli/node-application.d.ts +14 -0
- package/dist/cli/node-application.js +26 -0
- package/dist/cli/node-application.js.map +1 -0
- package/dist/cli/program.cjs +2807 -0
- package/dist/cli/program.cjs.map +1 -0
- package/dist/cli/program.d.cts +352 -0
- package/dist/cli/program.d.mts +352 -0
- package/dist/cli/program.d.ts +352 -0
- package/dist/cli/program.js +36 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/cli/project-configuration.cjs +134 -0
- package/dist/cli/project-configuration.cjs.map +1 -0
- package/dist/cli/project-configuration.d.cts +64 -0
- package/dist/cli/project-configuration.d.mts +64 -0
- package/dist/cli/project-configuration.d.ts +64 -0
- package/dist/cli/project-configuration.js +22 -0
- package/dist/cli/project-configuration.js.map +1 -0
- package/dist/cli/record.cjs +20 -4
- package/dist/cli/record.cjs.map +1 -1
- package/dist/cli/record.d.cts +3 -3
- package/dist/cli/record.d.mts +3 -3
- package/dist/cli/record.d.ts +3 -3
- package/dist/cli.cjs +19 -3130
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +2 -148
- package/dist/cli.d.mts +2 -148
- package/dist/cli.d.ts +2 -148
- package/dist/cli.js +22 -30
- package/dist/context/assert-first.cjs +21 -15
- package/dist/context/assert-first.cjs.map +1 -1
- package/dist/context/assert-first.d.cts +1 -0
- package/dist/context/assert-first.d.mts +1 -0
- package/dist/context/assert-first.d.ts +1 -0
- package/dist/context/attempt-resources.cjs +13 -0
- package/dist/context/attempt-resources.cjs.map +1 -0
- package/dist/context/attempt-resources.d.cts +3 -0
- package/dist/context/attempt-resources.d.mts +3 -0
- package/dist/context/attempt-resources.d.ts +3 -0
- package/dist/context/attempt-resources.js +8 -0
- package/dist/context/attempt-resources.js.map +1 -0
- package/dist/context/session.cjs +4 -3
- package/dist/context/session.cjs.map +1 -1
- package/dist/context/session.d.cts +1 -0
- package/dist/context/session.d.mts +1 -0
- package/dist/context/session.d.ts +1 -0
- package/dist/eval/record/verdict.cjs +3 -2
- package/dist/eval/record/verdict.cjs.map +1 -1
- package/dist/experiment/host/index.cjs +1 -6
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/experiment/host/index.d.cts +1 -0
- package/dist/experiment/host/index.d.mts +1 -0
- package/dist/experiment/host/index.d.ts +1 -0
- package/dist/load-config.cjs +13 -4
- package/dist/load-config.cjs.map +1 -1
- package/dist/load-config.d.cts +4 -3
- package/dist/load-config.d.mts +4 -3
- package/dist/load-config.d.ts +4 -3
- package/dist/load-config.js +4 -2
- package/dist/o11y/parsers/codex.cjs +29 -7
- package/dist/o11y/parsers/codex.cjs.map +1 -1
- package/dist/record/codec/core.d.cts +0 -2
- package/dist/record/codec/core.d.mts +0 -2
- package/dist/record/codec/core.d.ts +0 -2
- package/dist/record/codec/identifiers.cjs +2 -3
- package/dist/record/codec/identifiers.cjs.map +1 -1
- package/dist/record/codec/identifiers.d.cts +1 -2
- package/dist/record/codec/identifiers.d.mts +1 -2
- package/dist/record/codec/identifiers.d.ts +1 -2
- package/dist/record/codec/identifiers.js +10 -12
- package/dist/record/codec/index.js +42 -44
- package/dist/record/definition/attachment.cjs +1 -0
- package/dist/record/definition/attachment.cjs.map +1 -1
- package/dist/record/definition/attachment.d.cts +14 -0
- package/dist/record/definition/attachment.d.mts +14 -0
- package/dist/record/definition/attachment.d.ts +14 -0
- package/dist/record/family/assertions-v1.cjs +104 -0
- package/dist/record/family/assertions-v1.cjs.map +1 -0
- package/dist/record/family/assertions-v1.d.cts +2 -0
- package/dist/record/family/assertions-v1.d.mts +2 -0
- package/dist/record/family/assertions-v1.d.ts +2 -0
- package/dist/record/family/assertions-v1.js +6 -0
- package/dist/record/family/assertions-v1.js.map +1 -0
- package/dist/record/family/assertions.cjs +16 -5
- package/dist/record/family/assertions.cjs.map +1 -1
- package/dist/record/family/assertions.d.cts +510 -56
- package/dist/record/family/assertions.d.mts +510 -56
- package/dist/record/family/assertions.d.ts +510 -56
- package/dist/record/family/assertions.js +14 -10
- package/dist/record/family/catalog.cjs +17 -1
- package/dist/record/family/catalog.cjs.map +1 -1
- package/dist/record/family/catalog.d.cts +1292 -104
- package/dist/record/family/catalog.d.mts +1292 -104
- package/dist/record/family/catalog.d.ts +1292 -104
- package/dist/record/family/catalog.js +22 -20
- package/dist/record/family/index.js +144 -138
- package/dist/record/family/observability-v1.cjs +5 -0
- package/dist/record/family/observability-v1.cjs.map +1 -1
- package/dist/record/family/observability.cjs +1 -1
- package/dist/record/family/observability.cjs.map +1 -1
- package/dist/record/host/runtime.cjs +323 -173
- 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 +9 -7
- package/dist/record/host/types.d.mts +9 -7
- package/dist/record/host/types.d.ts +9 -7
- package/dist/record/model/core.cjs.map +1 -1
- package/dist/record/model/core.d.cts +1 -2
- package/dist/record/model/core.d.mts +1 -2
- package/dist/record/model/core.d.ts +1 -2
- package/dist/record/model/definition.cjs +1 -2
- package/dist/record/model/definition.cjs.map +1 -1
- package/dist/record/model/definition.d.cts +1 -7
- package/dist/record/model/definition.d.mts +1 -7
- package/dist/record/model/definition.d.ts +1 -7
- package/dist/record/model/identifiers.cjs +2 -3
- package/dist/record/model/identifiers.cjs.map +1 -1
- package/dist/record/model/identifiers.d.cts +1 -3
- package/dist/record/model/identifiers.d.mts +1 -3
- package/dist/record/model/identifiers.d.ts +1 -3
- package/dist/record/model/identifiers.js +36 -38
- package/dist/record/model/index.js +60 -62
- package/dist/record/platform/node.cjs +17 -7
- 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 +8 -3
- package/dist/record/platform/services.d.mts +8 -3
- package/dist/record/platform/services.d.ts +8 -3
- package/dist/record/reader/format.cjs +16 -65
- package/dist/record/reader/format.cjs.map +1 -1
- package/dist/record/reader/format.d.cts +5 -9
- package/dist/record/reader/format.d.mts +5 -9
- package/dist/record/reader/format.d.ts +5 -9
- package/dist/record/reader/index.js +10 -8
- package/dist/record/reader/runtime.cjs +63 -32
- package/dist/record/reader/runtime.cjs.map +1 -1
- package/dist/record/reader/runtime.d.cts +40 -4
- package/dist/record/reader/runtime.d.mts +40 -4
- package/dist/record/reader/runtime.d.ts +40 -4
- package/dist/record/reader/runtime.js +6 -4
- package/dist/report/assets/enhance.js +5 -5
- package/dist/report/assets/styles.css +190 -24
- package/dist/report/built-in/result-components.cjs +8 -5
- package/dist/report/built-in/result-components.cjs.map +1 -1
- package/dist/report/built-in/standard.cjs +3 -0
- package/dist/report/built-in/standard.cjs.map +1 -1
- package/dist/report/built-in/standard.d.cts +2 -0
- package/dist/report/built-in/standard.d.mts +2 -0
- package/dist/report/built-in/standard.d.ts +2 -0
- package/dist/report/client-dist/app.js +53 -0
- package/dist/report/components/attempt-detail/compute.cjs +108 -231
- package/dist/report/components/attempt-detail/compute.cjs.map +1 -1
- package/dist/report/components/attempt-detail/compute.d.cts +11 -45
- package/dist/report/components/attempt-detail/compute.d.mts +11 -45
- package/dist/report/components/attempt-detail/compute.d.ts +11 -45
- package/dist/report/components/attempt-detail/compute.js +2 -4
- package/dist/report/components/attempt-detail/content.cjs +4 -4
- package/dist/report/components/attempt-detail/content.cjs.map +1 -1
- package/dist/report/components/attempt-detail/validate.cjs +47 -4
- package/dist/report/components/attempt-detail/validate.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.cjs +9 -15
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/content.cjs +53 -40
- package/dist/report/components/entity-lists/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.cjs +1 -3
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/experiment-detail/compute.cjs +4 -6
- package/dist/report/components/experiment-detail/compute.cjs.map +1 -1
- package/dist/report/components/summaries/index.cjs +5 -1
- package/dist/report/components/summaries/index.cjs.map +1 -1
- package/dist/report/definition/cell.cjs +14 -7
- package/dist/report/definition/cell.cjs.map +1 -1
- package/dist/report/definition/cell.d.cts +4 -0
- package/dist/report/definition/cell.d.mts +4 -0
- package/dist/report/definition/cell.d.ts +4 -0
- package/dist/report/definition/primitives/assertion-evidence.cjs +96 -0
- package/dist/report/definition/primitives/assertion-evidence.cjs.map +1 -0
- package/dist/report/definition/primitives/assertion-evidence.d.cts +11 -0
- package/dist/report/definition/primitives/assertion-evidence.d.mts +11 -0
- package/dist/report/definition/primitives/assertion-evidence.d.ts +11 -0
- package/dist/report/definition/primitives/assertion-evidence.js +6 -0
- package/dist/report/definition/primitives/assertion-evidence.js.map +1 -0
- package/dist/report/definition/primitives/conversation.cjs +7 -0
- package/dist/report/definition/primitives/conversation.cjs.map +1 -1
- package/dist/report/definition/primitives/conversation.d.cts +2 -0
- package/dist/report/definition/primitives/conversation.d.mts +2 -0
- package/dist/report/definition/primitives/conversation.d.ts +2 -0
- package/dist/report/definition/primitives/turn-trace.cjs +53 -3
- package/dist/report/definition/primitives/turn-trace.cjs.map +1 -1
- package/dist/report/definition/primitives.cjs +14 -1
- package/dist/report/definition/primitives.cjs.map +1 -1
- package/dist/report/definition/report.cjs +16 -8
- package/dist/report/definition/report.cjs.map +1 -1
- package/dist/report/definition/report.d.cts +6 -0
- package/dist/report/definition/report.d.mts +6 -0
- package/dist/report/definition/report.d.ts +6 -0
- package/dist/report/definition/table-text.cjs +12 -3
- package/dist/report/definition/table-text.cjs.map +1 -1
- package/dist/report/definition/table-text.d.cts +6 -1
- package/dist/report/definition/table-text.d.mts +6 -1
- package/dist/report/definition/table-text.d.ts +6 -1
- package/dist/report/execution/model.cjs +6 -14
- package/dist/report/execution/model.cjs.map +1 -1
- package/dist/report/execution/model.d.cts +5 -10
- package/dist/report/execution/model.d.mts +5 -10
- package/dist/report/execution/model.d.ts +5 -10
- package/dist/report/execution/model.js +6 -6
- package/dist/report/execution/paths.cjs +0 -11
- package/dist/report/execution/paths.cjs.map +1 -1
- package/dist/report/execution/paths.d.cts +0 -1
- package/dist/report/execution/paths.d.mts +0 -1
- package/dist/report/execution/paths.d.ts +0 -1
- package/dist/report/execution/paths.js +6 -8
- package/dist/report/host/execute.cjs +13 -22
- package/dist/report/host/execute.cjs.map +1 -1
- package/dist/report/host/execute.d.cts +1 -4
- package/dist/report/host/execute.d.mts +1 -4
- package/dist/report/host/execute.d.ts +1 -4
- package/dist/report/host/from-record.cjs +3 -0
- package/dist/report/host/from-record.cjs.map +1 -1
- package/dist/report/host/from-record.d.cts +4 -1
- package/dist/report/host/from-record.d.mts +4 -1
- package/dist/report/host/from-record.d.ts +4 -1
- package/dist/report/host/site-assets.cjs +1 -2
- package/dist/report/host/site-assets.cjs.map +1 -1
- package/dist/report/host/site-assets.d.cts +0 -1
- package/dist/report/host/site-assets.d.mts +0 -1
- package/dist/report/host/site-assets.d.ts +0 -1
- package/dist/report/host/site-assets.js +2 -4
- package/dist/report/host/static.cjs +71 -346
- package/dist/report/host/static.cjs.map +1 -1
- package/dist/report/host/static.d.cts +1 -3
- package/dist/report/host/static.d.mts +1 -3
- package/dist/report/host/static.d.ts +1 -3
- package/dist/report/host/static.js +2 -2
- package/dist/report/host/view-session.cjs.map +1 -1
- package/dist/report/host/view-session.d.cts +1 -1
- package/dist/report/host/view-session.d.mts +1 -1
- package/dist/report/host/view-session.d.ts +1 -1
- package/dist/report/model/locale.cjs +1 -1
- package/dist/report/model/locale.cjs.map +1 -1
- package/dist/report/model/locale.d.cts +1 -1
- package/dist/report/model/locale.d.mts +1 -1
- package/dist/report/model/locale.d.ts +1 -1
- package/dist/report/model/pricing.cjs +2 -2
- package/dist/report/model/pricing.cjs.map +1 -1
- package/dist/report/react/enhance.js +5 -5
- package/dist/report/react/styles.css +190 -24
- package/dist/runner/adoption.cjs +4 -7
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/attempt-resources.cjs +60 -0
- package/dist/runner/attempt-resources.cjs.map +1 -0
- package/dist/runner/attempt-resources.d.cts +13 -0
- package/dist/runner/attempt-resources.d.mts +13 -0
- package/dist/runner/attempt-resources.d.ts +13 -0
- package/dist/runner/attempt-resources.js +6 -0
- package/dist/runner/attempt-resources.js.map +1 -0
- package/dist/runner/attempt.cjs +37 -3
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/runner/feedback/failure.cjs +77 -2
- package/dist/runner/feedback/failure.cjs.map +1 -1
- package/dist/runner/feedback/failure.d.cts +2 -1
- package/dist/runner/feedback/failure.d.mts +2 -1
- package/dist/runner/feedback/failure.d.ts +2 -1
- package/dist/runner/project-current.cjs +2 -13
- package/dist/runner/project-current.cjs.map +1 -1
- package/dist/runner/project-current.d.cts +4 -2
- package/dist/runner/project-current.d.mts +4 -2
- package/dist/runner/project-current.d.ts +4 -2
- package/dist/runner/reporters/braintrust.cjs +7 -7
- package/dist/runner/reporters/braintrust.cjs.map +1 -1
- package/dist/runner/reuse-readback.cjs +3 -4
- package/dist/runner/reuse-readback.cjs.map +1 -1
- package/dist/runner/run.cjs +5 -2
- package/dist/runner/run.cjs.map +1 -1
- package/dist/sandbox/backend.cjs +32 -2
- package/dist/sandbox/backend.cjs.map +1 -1
- package/dist/sandbox/backend.d.cts +12 -1
- package/dist/sandbox/backend.d.mts +12 -1
- package/dist/sandbox/backend.d.ts +12 -1
- package/dist/sandbox/backend.js +28 -22
- package/dist/sandbox/docker.cjs +140 -0
- package/dist/sandbox/docker.cjs.map +1 -1
- package/dist/sandbox/docker.d.cts +3 -1
- package/dist/sandbox/docker.d.mts +3 -1
- package/dist/sandbox/docker.d.ts +3 -1
- package/dist/sandbox/e2b.cjs +42 -0
- package/dist/sandbox/e2b.cjs.map +1 -1
- package/dist/sandbox/e2b.d.cts +2 -0
- package/dist/sandbox/e2b.d.mts +2 -0
- package/dist/sandbox/e2b.d.ts +2 -0
- package/dist/sandbox/local.cjs +64 -0
- package/dist/sandbox/local.cjs.map +1 -1
- package/dist/sandbox/local.d.cts +3 -1
- package/dist/sandbox/local.d.mts +3 -1
- package/dist/sandbox/local.d.ts +3 -1
- package/dist/sandbox/managed-process.cjs +49 -0
- package/dist/sandbox/managed-process.cjs.map +1 -0
- package/dist/sandbox/managed-process.d.cts +11 -0
- package/dist/sandbox/managed-process.d.mts +11 -0
- package/dist/sandbox/managed-process.d.ts +11 -0
- package/dist/sandbox/managed-process.js +6 -0
- package/dist/sandbox/managed-process.js.map +1 -0
- package/dist/sandbox/types.cjs.map +1 -1
- package/dist/sandbox/types.d.cts +24 -0
- package/dist/sandbox/types.d.mts +24 -0
- package/dist/sandbox/types.d.ts +24 -0
- package/dist/sandbox/vercel.cjs +1 -0
- package/dist/sandbox/vercel.cjs.map +1 -1
- package/dist/sandbox/vercel.d.cts +1 -0
- package/dist/sandbox/vercel.d.mts +1 -0
- package/dist/sandbox/vercel.d.ts +1 -0
- package/dist/view/server.cjs +2 -37
- package/dist/view/server.cjs.map +1 -1
- package/dist/view/server.d.cts +0 -3
- package/dist/view/server.d.mts +0 -3
- package/dist/view/server.d.ts +0 -3
- package/docs-site/zh/reference/builtin-agents.mdx +7 -7
- package/docs-site/zh/reference/official-adapters.mdx +4 -4
- package/docs-site/zh/reference/report-components.mdx +2 -2
- package/docs-site/zh/tutorials/configuration.mdx +2 -2
- package/docs-site/zh/tutorials/deploy-report-site.mdx +24 -2
- package/docs-site/zh/tutorials/publish-report.mdx +4 -4
- package/docs-site/zh/tutorials/sandbox-agent.mdx +5 -5
- package/docs-site/zh/tutorials/theming.mdx +2 -2
- package/package.json +4 -6
- package/dist/record/migration/index.cjs +0 -5
- package/dist/record/migration/index.cjs.map +0 -1
- package/dist/record/migration/index.d.cts +0 -11
- package/dist/record/migration/index.d.mts +0 -11
- package/dist/record/migration/index.d.ts +0 -11
- package/dist/record/migration/index.js +0 -6
- package/dist/record/migration/index.js.map +0 -1
- package/dist/report/host/site-runtime.cjs +0 -92
- package/dist/report/host/site-runtime.cjs.map +0 -1
- package/dist/report/host/site-runtime.d.cts +0 -9
- package/dist/report/host/site-runtime.d.mts +0 -9
- package/dist/report/host/site-runtime.d.ts +0 -9
- package/dist/report/host/site-runtime.js +0 -10
- package/dist/report/host/site-runtime.js.map +0 -1
- package/dist/view/client-dist/app.css +0 -2
- package/dist/view/client-dist/app.js +0 -49
- package/dist/view/data.cjs +0 -3
- package/dist/view/data.cjs.map +0 -1
- package/dist/view/data.d.cts +0 -9
- package/dist/view/data.d.mts +0 -9
- package/dist/view/data.d.ts +0 -9
- package/dist/view/data.js +0 -4
- package/dist/view/data.js.map +0 -1
- package/dist/view/index.cjs +0 -24
- package/dist/view/index.cjs.map +0 -1
- package/dist/view/index.d.cts +0 -9
- package/dist/view/index.d.mts +0 -9
- package/dist/view/index.d.ts +0 -9
- package/dist/view/index.js +0 -28
- package/dist/view/index.js.map +0 -1
- package/dist/view/report-view-cache.cjs +0 -200
- package/dist/view/report-view-cache.cjs.map +0 -1
- package/dist/view/report-view-cache.d.cts +0 -67
- package/dist/view/report-view-cache.d.mts +0 -67
- package/dist/view/report-view-cache.d.ts +0 -67
- package/dist/view/report-view-cache.js +0 -8
- package/dist/view/report-view-cache.js.map +0 -1
- package/dist/view/shared/types.cjs +0 -3
- package/dist/view/shared/types.cjs.map +0 -1
- package/dist/view/shared/types.d.cts +0 -51
- package/dist/view/shared/types.d.mts +0 -51
- package/dist/view/shared/types.d.ts +0 -51
- package/dist/view/shared/types.js +0 -4
- package/dist/view/shared/types.js.map +0 -1
- package/dist/view/site.cjs +0 -32
- package/dist/view/site.cjs.map +0 -1
- package/dist/view/site.d.cts +0 -24
- package/dist/view/site.d.mts +0 -24
- package/dist/view/site.d.ts +0 -24
- package/dist/view/site.js +0 -8
- package/dist/view/site.js.map +0 -1
- package/dist/view/styles.css +0 -170
- package/dist/view/template.html +0 -17
|
@@ -1 +1 @@
|
|
|
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;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,IA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AC,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"]}
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["runtime.ts"],"names":[],"mappings":";;;AAgMA,oFAwCC;AAMD,8DA+CC;AAQD,oGAgGC;AArYD,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;AAkEnE,SAAS,iBAAiB,CAAU,IAAuB;IACvD,MAAM,MAAM,GAAG,IAAA,uCAAoB,EAAC,CAAC,IAAA,8BAAW,EAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAClF,IAAI,MAAM,KAAK,SAAS;QACpB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACnE,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,S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AC,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,GAAG,CAAE,EAAE,CAAC,CAAC,CAAC;QAC9E,OAAO,MAAM,CAAC,MAAM,CAAC;YACjB,OAAO,EAAE,OAAO,CAAC,KAAK;YACtB,QAAQ,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC;iBACpC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;iBACzC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,GAAa,EAAE,GAAG,CAAU,CAAC,CAAC;YACxD,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;YACzC,cAAc,EAAE,QAAQ,KAAK,UAAU;SAC1C,CAAC,CAAC;IACP,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}\nexport type FixedRecordAttachmentEnvelopeRead = {\n readonly state: \"current\";\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};\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 attachmentEnvelopeInvalid(path: readonly string[]): FixedRecordAttachmentEnvelopeRead {\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/** Open-session gate: inspect only directory identity and exact envelope/version. */\nexport function inspectFixedRecordAttachmentEnvelope<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<FixedRecordAttachmentEnvelopeRead, 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 attachmentEnvelopeInvalid([\"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 attachmentEnvelopeInvalid([\"attachment.json\"]);\n const envelope = decodeRecordAttachmentEnvelope(envelopeDocument.value);\n if (Either.isLeft(envelope))\n return attachmentEnvelopeInvalid([\"attachment.json\"]);\n if (envelope.right.family !== input.descriptor.family) {\n return attachmentEnvelopeInvalid([\"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 return envelope.right.schemaVersion === input.descriptor.schemaVersion\n ? Object.freeze({ state: \"current\" as const })\n : Object.freeze({\n state: \"unsupported\" as const,\n family: input.descriptor.family,\n schemaVersion: envelope.right.schemaVersion,\n });\n });\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 envelope = yield* inspectFixedRecordAttachmentEnvelope(input);\n if (envelope.state !== \"current\")\n return envelope;\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 historical decoder proves the old shape, the pure\n * adjacent migration constructs the current payload, and the current\n * descriptor proves its exact shape and blob closure. Physical rewrite policy\n * remains host-owned metadata; `rewritePayload` is only its consistency check.\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 verifyHistorical?: (payload: unknown, blobs: readonly RecordAttachmentMaterializedBlob[]) => boolean;\n readonly migrate: (value: unknown) => unknown;\n}): Effect.Effect<false | {\n readonly payload: Payload;\n readonly blobKeys: ReadonlyMap<object, string>;\n readonly removedBlobs: readonly {\n readonly key: string;\n readonly bytes: Uint8Array;\n }[];\n readonly rewritePayload: boolean;\n}, 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 historical: unknown;\n try {\n historical = input.decodeHistorical(hydrated.value);\n }\n catch {\n return false;\n }\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 if (input.verifyHistorical !== undefined && !input.verifyHistorical(historical, materialized)) {\n return false;\n }\n let migrated: unknown;\n try {\n migrated = input.migrate(historical);\n }\n catch {\n return false;\n }\n const payload = input.descriptor.write.decodePayload(migrated);\n if (Either.isLeft(payload))\n return false;\n const currentRefs = new Set(input.descriptor.write.refs(payload.right));\n const currentMaterialized = materialized.filter((blob) => currentRefs.has(blob.ref));\n if (Either.isLeft(makeFixedRecordAttachmentValueFromDecoded(input.descriptor.write, payload.right, currentMaterialized)))\n return false;\n const bytesByRef = new Map(materialized.map((blob) => [blob.ref, blob.bytes] as const));\n const removedBlobs = [...hydrated.refsByKey]\n .filter(([, ref]) => !currentRefs.has(ref))\n .map(([key, ref]) => Object.freeze({ key, bytes: bytesByRef.get(ref)! }));\n return Object.freeze({\n payload: payload.right,\n blobKeys: new Map([...hydrated.refsByKey]\n .filter(([, ref]) => currentRefs.has(ref))\n .map(([key, ref]) => [ref as object, key] as const)),\n removedBlobs: Object.freeze(removedBlobs),\n rewritePayload: migrated !== historical,\n });\n });\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import { type RecordAttachmentMaterializedBlob } from "../attachment/internal.cjs";
|
|
2
3
|
import type { RecordAttachmentBlobs, RecordAttachmentPayloadSnapshot } from "../attachment/types.cjs";
|
|
3
4
|
import type { FixedRecordFamilyDescriptor, NiceEvalFamily } from "../family/catalog.cjs";
|
|
4
5
|
import type { RecordAttachmentOwner } from "../model/core.cjs";
|
|
@@ -19,6 +20,24 @@ export interface FixedRecordAttachmentLocation<Owner extends RecordAttachmentOwn
|
|
|
19
20
|
readonly runId: RunId;
|
|
20
21
|
readonly attemptId?: AttemptId;
|
|
21
22
|
}
|
|
23
|
+
export type FixedRecordAttachmentEnvelopeRead = {
|
|
24
|
+
readonly state: "current";
|
|
25
|
+
} | {
|
|
26
|
+
readonly state: "unavailable";
|
|
27
|
+
} | {
|
|
28
|
+
readonly state: "migration-required";
|
|
29
|
+
readonly family: string;
|
|
30
|
+
readonly fromSchemaVersion: number;
|
|
31
|
+
readonly toSchemaVersion: number;
|
|
32
|
+
readonly command: "niceeval migrate";
|
|
33
|
+
} | {
|
|
34
|
+
readonly state: "unsupported";
|
|
35
|
+
readonly family: string;
|
|
36
|
+
readonly schemaVersion: number;
|
|
37
|
+
} | {
|
|
38
|
+
readonly state: "invalid";
|
|
39
|
+
readonly issues: NonEmptyRecordIssues;
|
|
40
|
+
};
|
|
22
41
|
/** @internal Storage result already flattened for the Host current API. */
|
|
23
42
|
export type FixedRecordAttachmentRead<Payload> = {
|
|
24
43
|
readonly state: "available";
|
|
@@ -40,6 +59,13 @@ export type FixedRecordAttachmentRead<Payload> = {
|
|
|
40
59
|
readonly state: "invalid";
|
|
41
60
|
readonly issues: NonEmptyRecordIssues;
|
|
42
61
|
};
|
|
62
|
+
/** Open-session gate: inspect only directory identity and exact envelope/version. */
|
|
63
|
+
export declare function inspectFixedRecordAttachmentEnvelope<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {
|
|
64
|
+
readonly fileSystem: RecordFileSystemService;
|
|
65
|
+
readonly root: RecordRoot;
|
|
66
|
+
readonly location: FixedRecordAttachmentLocation<Owner>;
|
|
67
|
+
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
68
|
+
}): Effect.Effect<FixedRecordAttachmentEnvelopeRead, RecordFileSystemError>;
|
|
43
69
|
/**
|
|
44
70
|
* Reads precisely one known static family. Unknown sibling directories are
|
|
45
71
|
* intentionally neither enumerated nor decoded, so future independent
|
|
@@ -53,9 +79,10 @@ export declare function readFixedRecordAttachment<Family extends NiceEvalFamily,
|
|
|
53
79
|
}): Effect.Effect<FixedRecordAttachmentRead<Payload>, RecordFileSystemError>;
|
|
54
80
|
/**
|
|
55
81
|
* Maintenance-only validation of one exact historical attachment before its
|
|
56
|
-
* envelope advances. The
|
|
57
|
-
*
|
|
58
|
-
* proves
|
|
82
|
+
* envelope advances. The historical decoder proves the old shape, the pure
|
|
83
|
+
* adjacent migration constructs the current payload, and the current
|
|
84
|
+
* descriptor proves its exact shape and blob closure. Physical rewrite policy
|
|
85
|
+
* remains host-owned metadata; `rewritePayload` is only its consistency check.
|
|
59
86
|
*/
|
|
60
87
|
export declare function validateFixedRecordAttachmentMigrationSource<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {
|
|
61
88
|
readonly fileSystem: RecordFileSystemService;
|
|
@@ -64,5 +91,14 @@ export declare function validateFixedRecordAttachmentMigrationSource<Family exte
|
|
|
64
91
|
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
65
92
|
readonly fromSchemaVersion: number;
|
|
66
93
|
readonly decodeHistorical: (value: unknown) => unknown;
|
|
94
|
+
readonly verifyHistorical?: (payload: unknown, blobs: readonly RecordAttachmentMaterializedBlob[]) => boolean;
|
|
67
95
|
readonly migrate: (value: unknown) => unknown;
|
|
68
|
-
}): Effect.Effect<
|
|
96
|
+
}): Effect.Effect<false | {
|
|
97
|
+
readonly payload: Payload;
|
|
98
|
+
readonly blobKeys: ReadonlyMap<object, string>;
|
|
99
|
+
readonly removedBlobs: readonly {
|
|
100
|
+
readonly key: string;
|
|
101
|
+
readonly bytes: Uint8Array;
|
|
102
|
+
}[];
|
|
103
|
+
readonly rewritePayload: boolean;
|
|
104
|
+
}, RecordFileSystemError>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import { type RecordAttachmentMaterializedBlob } from "../attachment/internal.mjs";
|
|
2
3
|
import type { RecordAttachmentBlobs, RecordAttachmentPayloadSnapshot } from "../attachment/types.mjs";
|
|
3
4
|
import type { FixedRecordFamilyDescriptor, NiceEvalFamily } from "../family/catalog.mjs";
|
|
4
5
|
import type { RecordAttachmentOwner } from "../model/core.mjs";
|
|
@@ -19,6 +20,24 @@ export interface FixedRecordAttachmentLocation<Owner extends RecordAttachmentOwn
|
|
|
19
20
|
readonly runId: RunId;
|
|
20
21
|
readonly attemptId?: AttemptId;
|
|
21
22
|
}
|
|
23
|
+
export type FixedRecordAttachmentEnvelopeRead = {
|
|
24
|
+
readonly state: "current";
|
|
25
|
+
} | {
|
|
26
|
+
readonly state: "unavailable";
|
|
27
|
+
} | {
|
|
28
|
+
readonly state: "migration-required";
|
|
29
|
+
readonly family: string;
|
|
30
|
+
readonly fromSchemaVersion: number;
|
|
31
|
+
readonly toSchemaVersion: number;
|
|
32
|
+
readonly command: "niceeval migrate";
|
|
33
|
+
} | {
|
|
34
|
+
readonly state: "unsupported";
|
|
35
|
+
readonly family: string;
|
|
36
|
+
readonly schemaVersion: number;
|
|
37
|
+
} | {
|
|
38
|
+
readonly state: "invalid";
|
|
39
|
+
readonly issues: NonEmptyRecordIssues;
|
|
40
|
+
};
|
|
22
41
|
/** @internal Storage result already flattened for the Host current API. */
|
|
23
42
|
export type FixedRecordAttachmentRead<Payload> = {
|
|
24
43
|
readonly state: "available";
|
|
@@ -40,6 +59,13 @@ export type FixedRecordAttachmentRead<Payload> = {
|
|
|
40
59
|
readonly state: "invalid";
|
|
41
60
|
readonly issues: NonEmptyRecordIssues;
|
|
42
61
|
};
|
|
62
|
+
/** Open-session gate: inspect only directory identity and exact envelope/version. */
|
|
63
|
+
export declare function inspectFixedRecordAttachmentEnvelope<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {
|
|
64
|
+
readonly fileSystem: RecordFileSystemService;
|
|
65
|
+
readonly root: RecordRoot;
|
|
66
|
+
readonly location: FixedRecordAttachmentLocation<Owner>;
|
|
67
|
+
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
68
|
+
}): Effect.Effect<FixedRecordAttachmentEnvelopeRead, RecordFileSystemError>;
|
|
43
69
|
/**
|
|
44
70
|
* Reads precisely one known static family. Unknown sibling directories are
|
|
45
71
|
* intentionally neither enumerated nor decoded, so future independent
|
|
@@ -53,9 +79,10 @@ export declare function readFixedRecordAttachment<Family extends NiceEvalFamily,
|
|
|
53
79
|
}): Effect.Effect<FixedRecordAttachmentRead<Payload>, RecordFileSystemError>;
|
|
54
80
|
/**
|
|
55
81
|
* Maintenance-only validation of one exact historical attachment before its
|
|
56
|
-
* envelope advances. The
|
|
57
|
-
*
|
|
58
|
-
* proves
|
|
82
|
+
* envelope advances. The historical decoder proves the old shape, the pure
|
|
83
|
+
* adjacent migration constructs the current payload, and the current
|
|
84
|
+
* descriptor proves its exact shape and blob closure. Physical rewrite policy
|
|
85
|
+
* remains host-owned metadata; `rewritePayload` is only its consistency check.
|
|
59
86
|
*/
|
|
60
87
|
export declare function validateFixedRecordAttachmentMigrationSource<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {
|
|
61
88
|
readonly fileSystem: RecordFileSystemService;
|
|
@@ -64,5 +91,14 @@ export declare function validateFixedRecordAttachmentMigrationSource<Family exte
|
|
|
64
91
|
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
65
92
|
readonly fromSchemaVersion: number;
|
|
66
93
|
readonly decodeHistorical: (value: unknown) => unknown;
|
|
94
|
+
readonly verifyHistorical?: (payload: unknown, blobs: readonly RecordAttachmentMaterializedBlob[]) => boolean;
|
|
67
95
|
readonly migrate: (value: unknown) => unknown;
|
|
68
|
-
}): Effect.Effect<
|
|
96
|
+
}): Effect.Effect<false | {
|
|
97
|
+
readonly payload: Payload;
|
|
98
|
+
readonly blobKeys: ReadonlyMap<object, string>;
|
|
99
|
+
readonly removedBlobs: readonly {
|
|
100
|
+
readonly key: string;
|
|
101
|
+
readonly bytes: Uint8Array;
|
|
102
|
+
}[];
|
|
103
|
+
readonly rewritePayload: boolean;
|
|
104
|
+
}, RecordFileSystemError>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import { type RecordAttachmentMaterializedBlob } from "../attachment/internal.js";
|
|
2
3
|
import type { RecordAttachmentBlobs, RecordAttachmentPayloadSnapshot } from "../attachment/types.js";
|
|
3
4
|
import type { FixedRecordFamilyDescriptor, NiceEvalFamily } from "../family/catalog.js";
|
|
4
5
|
import type { RecordAttachmentOwner } from "../model/core.js";
|
|
@@ -19,6 +20,24 @@ export interface FixedRecordAttachmentLocation<Owner extends RecordAttachmentOwn
|
|
|
19
20
|
readonly runId: RunId;
|
|
20
21
|
readonly attemptId?: AttemptId;
|
|
21
22
|
}
|
|
23
|
+
export type FixedRecordAttachmentEnvelopeRead = {
|
|
24
|
+
readonly state: "current";
|
|
25
|
+
} | {
|
|
26
|
+
readonly state: "unavailable";
|
|
27
|
+
} | {
|
|
28
|
+
readonly state: "migration-required";
|
|
29
|
+
readonly family: string;
|
|
30
|
+
readonly fromSchemaVersion: number;
|
|
31
|
+
readonly toSchemaVersion: number;
|
|
32
|
+
readonly command: "niceeval migrate";
|
|
33
|
+
} | {
|
|
34
|
+
readonly state: "unsupported";
|
|
35
|
+
readonly family: string;
|
|
36
|
+
readonly schemaVersion: number;
|
|
37
|
+
} | {
|
|
38
|
+
readonly state: "invalid";
|
|
39
|
+
readonly issues: NonEmptyRecordIssues;
|
|
40
|
+
};
|
|
22
41
|
/** @internal Storage result already flattened for the Host current API. */
|
|
23
42
|
export type FixedRecordAttachmentRead<Payload> = {
|
|
24
43
|
readonly state: "available";
|
|
@@ -40,6 +59,13 @@ export type FixedRecordAttachmentRead<Payload> = {
|
|
|
40
59
|
readonly state: "invalid";
|
|
41
60
|
readonly issues: NonEmptyRecordIssues;
|
|
42
61
|
};
|
|
62
|
+
/** Open-session gate: inspect only directory identity and exact envelope/version. */
|
|
63
|
+
export declare function inspectFixedRecordAttachmentEnvelope<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {
|
|
64
|
+
readonly fileSystem: RecordFileSystemService;
|
|
65
|
+
readonly root: RecordRoot;
|
|
66
|
+
readonly location: FixedRecordAttachmentLocation<Owner>;
|
|
67
|
+
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
68
|
+
}): Effect.Effect<FixedRecordAttachmentEnvelopeRead, RecordFileSystemError>;
|
|
43
69
|
/**
|
|
44
70
|
* Reads precisely one known static family. Unknown sibling directories are
|
|
45
71
|
* intentionally neither enumerated nor decoded, so future independent
|
|
@@ -53,9 +79,10 @@ export declare function readFixedRecordAttachment<Family extends NiceEvalFamily,
|
|
|
53
79
|
}): Effect.Effect<FixedRecordAttachmentRead<Payload>, RecordFileSystemError>;
|
|
54
80
|
/**
|
|
55
81
|
* Maintenance-only validation of one exact historical attachment before its
|
|
56
|
-
* envelope advances. The
|
|
57
|
-
*
|
|
58
|
-
* proves
|
|
82
|
+
* envelope advances. The historical decoder proves the old shape, the pure
|
|
83
|
+
* adjacent migration constructs the current payload, and the current
|
|
84
|
+
* descriptor proves its exact shape and blob closure. Physical rewrite policy
|
|
85
|
+
* remains host-owned metadata; `rewritePayload` is only its consistency check.
|
|
59
86
|
*/
|
|
60
87
|
export declare function validateFixedRecordAttachmentMigrationSource<Family extends NiceEvalFamily, Owner extends RecordAttachmentOwner, Payload>(input: {
|
|
61
88
|
readonly fileSystem: RecordFileSystemService;
|
|
@@ -64,5 +91,14 @@ export declare function validateFixedRecordAttachmentMigrationSource<Family exte
|
|
|
64
91
|
readonly descriptor: FixedRecordFamilyDescriptor<Family, Owner, Payload>;
|
|
65
92
|
readonly fromSchemaVersion: number;
|
|
66
93
|
readonly decodeHistorical: (value: unknown) => unknown;
|
|
94
|
+
readonly verifyHistorical?: (payload: unknown, blobs: readonly RecordAttachmentMaterializedBlob[]) => boolean;
|
|
67
95
|
readonly migrate: (value: unknown) => unknown;
|
|
68
|
-
}): Effect.Effect<
|
|
96
|
+
}): Effect.Effect<false | {
|
|
97
|
+
readonly payload: Payload;
|
|
98
|
+
readonly blobKeys: ReadonlyMap<object, string>;
|
|
99
|
+
readonly removedBlobs: readonly {
|
|
100
|
+
readonly key: string;
|
|
101
|
+
readonly bytes: Uint8Array;
|
|
102
|
+
}[];
|
|
103
|
+
readonly rewritePayload: boolean;
|
|
104
|
+
}, RecordFileSystemError>;
|
|
@@ -11,8 +11,10 @@ const __niceevalExport3 = __niceevalCanonical["RECORD_READER_MAXIMUM_ATTACHMENT_
|
|
|
11
11
|
export { __niceevalExport3 as RECORD_READER_MAXIMUM_ATTACHMENT_DOCUMENT_BYTES };
|
|
12
12
|
const __niceevalExport4 = __niceevalCanonical["RECORD_READER_MAXIMUM_ATTACHMENT_TOTAL_BYTES"];
|
|
13
13
|
export { __niceevalExport4 as RECORD_READER_MAXIMUM_ATTACHMENT_TOTAL_BYTES };
|
|
14
|
-
const __niceevalExport5 = __niceevalCanonical["
|
|
15
|
-
export { __niceevalExport5 as
|
|
16
|
-
const __niceevalExport6 = __niceevalCanonical["
|
|
17
|
-
export { __niceevalExport6 as
|
|
14
|
+
const __niceevalExport5 = __niceevalCanonical["inspectFixedRecordAttachmentEnvelope"];
|
|
15
|
+
export { __niceevalExport5 as inspectFixedRecordAttachmentEnvelope };
|
|
16
|
+
const __niceevalExport6 = __niceevalCanonical["readFixedRecordAttachment"];
|
|
17
|
+
export { __niceevalExport6 as readFixedRecordAttachment };
|
|
18
|
+
const __niceevalExport7 = __niceevalCanonical["validateFixedRecordAttachmentMigrationSource"];
|
|
19
|
+
export { __niceevalExport7 as validateFixedRecordAttachmentMigrationSource };
|
|
18
20
|
//# sourceMappingURL=runtime.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// niceeval 报告的渐进增强 runtime:纯 vanilla JS、零依赖、IIFE、幂等。
|
|
2
2
|
// 只作用于 .niceeval-report DOM 与 data-niceeval-* 属性;六个行为——Tabs 单选切换、表格排序、
|
|
3
3
|
// 行过滤、SVG 点 tooltip、警告命令复制、源码语法着色。全部只改浏览状态,不改数据、指标口径或初始 HTML 数值。
|
|
4
|
-
//
|
|
5
|
-
//
|
|
4
|
+
// fragment 的初始 HTML 保留语义结构:排序有数据侧预排、tooltip 保留原生 <title>、
|
|
5
|
+
// Tabs 以原生 <details> 表达;app 挂载 fragment 后再增强浏览状态。
|
|
6
6
|
// 全部经 document 级事件委托绑定,重复注入本文件只在首次生效(window.__nreEnhanced 守卫),
|
|
7
|
-
//
|
|
7
|
+
// app 切换 fragment 并替换报告槽内容时也无需重新绑定。
|
|
8
8
|
|
|
9
9
|
(function () {
|
|
10
10
|
"use strict";
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
// ───────────────────────── SourceView:客户端语法着色 ─────────────────────────
|
|
23
23
|
// 静态 HTML 只保留完整、已转义的源码文本,避免全站构建为每个 token、每种 locale
|
|
24
|
-
// 预先创建 React
|
|
24
|
+
// 预先创建 React 节点。浏览器只给当前打开的 fragment 着色,源码文本始终保留。
|
|
25
25
|
// MutationObserver 覆盖 attempt 文档被 Host modal 插入后的同一行为。
|
|
26
26
|
|
|
27
27
|
var sourceTokenPattern =
|
|
@@ -412,7 +412,7 @@
|
|
|
412
412
|
|
|
413
413
|
// ───────────────────────── tooltip:.niceeval-chart-dot ─────────────────────────
|
|
414
414
|
// 首次 hover 时把点内 <title> 的内容搬进 data-niceeval-title(避免与原生 tooltip 重影),
|
|
415
|
-
// 渲染样式化 tooltip div
|
|
415
|
+
// 渲染样式化 tooltip div(定位在点上方并挂在所属 figure 中);增强前保留 <title>。
|
|
416
416
|
|
|
417
417
|
var tooltip = null;
|
|
418
418
|
|