niceeval 0.13.2-canary.35 → 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 +24 -2
- 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/deepseek-harness.cjs +50 -2
- package/dist/agents/deepseek-harness.cjs.map +1 -1
- package/dist/agents/deepseek-harness.d.cts +2 -0
- package/dist/agents/deepseek-harness.d.mts +2 -0
- package/dist/agents/deepseek-harness.d.ts +2 -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/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 +2 -2
- package/dist/agents/types.d.mts +2 -2
- package/dist/agents/types.d.ts +2 -2
- package/dist/agents/ui-message-stream.cjs +24 -7
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/analysis/api.cjs +19 -1
- package/dist/analysis/api.cjs.map +1 -1
- package/dist/analysis/api.d.cts +2 -2
- package/dist/analysis/api.d.mts +2 -2
- package/dist/analysis/api.d.ts +2 -2
- 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 +19 -6
- package/dist/i18n/en.cjs.map +1 -1
- package/dist/i18n/en.d.cts +12 -4
- package/dist/i18n/en.d.mts +12 -4
- package/dist/i18n/en.d.ts +12 -4
- 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/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 +0 -8
- package/dist/report/built-in/analysis-values.cjs.map +1 -1
- package/dist/report/built-in/analysis-values.d.cts +0 -13
- package/dist/report/built-in/analysis-values.d.mts +0 -13
- package/dist/report/built-in/analysis-values.d.ts +0 -13
- 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 +25 -73
- package/dist/report/built-in/result-components.cjs.map +1 -1
- package/dist/report/built-in/result-components.d.cts +3 -19
- package/dist/report/built-in/result-components.d.mts +3 -19
- package/dist/report/built-in/result-components.d.ts +3 -19
- package/dist/report/built-in/result-components.js +0 -4
- package/dist/report/built-in/run-membership-overview.cjs +30 -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 -46
- package/dist/report/built-in/standard.cjs.map +1 -1
- package/dist/report/built-in/standard.d.cts +19 -42
- package/dist/report/built-in/standard.d.mts +19 -42
- package/dist/report/built-in/standard.d.ts +19 -42
- 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 +2 -2
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.d.cts +2 -2
- package/dist/report/components/entity-lists/compute.d.mts +2 -2
- package/dist/report/components/entity-lists/compute.d.ts +2 -2
- package/dist/report/components/entity-lists/index.cjs +6 -2
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.d.cts +3 -6
- package/dist/report/components/entity-lists/index.d.mts +3 -6
- package/dist/report/components/entity-lists/index.d.ts +3 -6
- 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/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 +6 -0
- 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 +139 -64
- 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 +521 -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 +46 -8
- package/dist/sample/capability.cjs.map +1 -1
- 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/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/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 +1 -0
- package/docs-site/zh/examples/integrations/langgraph.mdx +1 -1
- package/docs-site/zh/explanation/assert.mdx +6 -6
- package/docs-site/zh/explanation/drive.mdx +1 -1
- package/docs-site/zh/explanation/evals.mdx +9 -9
- package/docs-site/zh/explanation/experiment.mdx +2 -2
- package/docs-site/zh/explanation/hitl.mdx +3 -3
- 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 +9 -9
- 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 +1 -1
- package/docs-site/zh/reference/official-adapters.mdx +5 -5
- 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 +50 -44
- 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/plugins.mdx +14 -0
- package/docs-site/zh/tutorials/rerun-and-cache.mdx +3 -17
- 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 +27 -8
- package/docs-site/zh/tutorials/write-experiment.mdx +7 -5
- package/docs-site/zh/tutorials/write-send.mdx +2 -2
- package/package.json +9 -5
- package/dist/report/built-in/overview.cjs +0 -45
- 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
package/dist/view/server.cjs
CHANGED
|
@@ -520,6 +520,12 @@ function siteFileForPath(pathname, site) {
|
|
|
520
520
|
const exact = requested === "" ? "index.html" : requested;
|
|
521
521
|
const revision = (0, model_ts_1.closedSiteRevisionData)(site);
|
|
522
522
|
const files = revision.files;
|
|
523
|
+
if (requested === "" && revision.defaultRoute !== undefined && revision.defaultRoute !== "/") {
|
|
524
|
+
const entryFile = staticPageFileForRoute(revision.defaultRoute);
|
|
525
|
+
if (files.some((file) => file.path === entryFile)) {
|
|
526
|
+
return Object.freeze({ state: "redirect", location: revision.defaultRoute });
|
|
527
|
+
}
|
|
528
|
+
}
|
|
523
529
|
const direct = files.find((file) => file.path === exact);
|
|
524
530
|
if (direct !== undefined)
|
|
525
531
|
return Object.freeze({ state: "file", file: direct });
|
package/dist/view/server.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["server.ts"],"names":[],"mappings":";;AAkLA,wCAsCC;AAxND,4EAA4E;AAC5E,4EAA4E;AAC5E,0CAA0C;AAC1C,qCAAuE;AACvE,yCAAiG;AAEjG,qCAA4C;AAC5C,yCAAuD;AACvD,mCAAgC;AAEhC,2DAAqH;AACrH,oEAAyL;AAoCzL,MAAM,WAAW,GAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,CAAC,CAAC;AAKrF,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC;;;;GAIG;AACH,MAAM,KAAK;IAIsB;IAHZ,MAAM,GAAY,EAAE,CAAC;IAC9B,MAAM,CAAoE;IAC1E,MAAM,GAAG,KAAK,CAAC;IACvB,YAA6B,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;IAAI,CAAC;IAClD,IAAI;QACA,OAAO,eAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;YAC3B,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzB,MAAM,CAAC,eAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC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I,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;YAClD,OAAO,SAAS,CAAC;QACrB,OAAO,GAAG,CAAC,IAAI,CAAC;IACpB,CAAC;IACD,MAAM,CAAC;QACH,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC;AACD,SAAS,UAAU,CAAC,IAAY;IAC5B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACnD,CAAC;AACD,SAAS,WAAW,CAAC,SAA2C,EAAE,MAAc;IAC5E,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,2BAA2B,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;AACnF,CAAC;AACD,SAAS,OAAO,CAAC,KAAc;IAC3B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE,CAAC;AACD,SAAS,aAAa,CAAC,KAAc;IACjC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAC3C,OAAO,KAAK,CAAC;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,CAAC;AACnD,CAAC","sourcesContent":["// The Node view host owns transport and watch lifetime only. Its caller has\n// already closed Record -> Sample -> Report into a fixed execution rebuild;\n// this module never reopens Record facts.\nimport { readdirSync, statSync, watch, type FSWatcher } from \"node:fs\";\nimport { createServer, type IncomingMessage, type Server, type ServerResponse } from \"node:http\";\nimport type { Socket } from \"node:net\";\nimport { networkInterfaces } from \"node:os\";\nimport { basename, dirname, resolve } from \"node:path\";\nimport { Effect } from \"effect\";\nimport type * as Scope from \"effect/Scope\";\nimport { closedSiteRevisionData, type ClosedSiteFile, type ClosedSiteRevision, } from \"../report/execution/model.ts\";\nimport { openReportViewSession, type OpenReportViewSessionInput, type ReportViewOpenError, type ReportViewSessionClosed, type ReportViewSession, } from \"../report/host/view-session.ts\";\nimport type { ViewScanOptions } from \"./data.ts\";\nexport interface NodeViewServerError {\n readonly code: \"report-view-server-failed\";\n readonly operation: \"open\" | \"listen\" | \"watch\";\n readonly reason: string;\n}\nexport interface ViewOptions<Requirements = never> {\n readonly input?: string;\n readonly out?: string;\n readonly port?: number;\n /** Defaults to loopback. An explicit address opts into that network exposure. */\n readonly host?: string;\n /** Retained for the CLI-shaped facade; it is never interpreted as Record data. */\n readonly scan?: ViewScanOptions;\n /**\n * Bootstrap watch inputs when the session/request has none yet. After each\n * successful rebuild the session revision owns the next-round watch set.\n */\n readonly watchInputs?: readonly string[];\n readonly onRebuild?: (completedAt: Date) => void;\n /** An already-open scoped session owned by the caller. */\n readonly session?: ReportViewSession<Requirements>;\n /** Or let this scope open a session from a caller-supplied current rebuild. */\n readonly request?: OpenReportViewSessionInput<Requirements>;\n}\n/** The native Effect-facing server handle. Its resources are also Scope-owned. */\nexport interface ReportViewServer {\n readonly url: string;\n readonly urls: readonly string[];\n readonly close: Effect.Effect<void>;\n}\nexport type RebuildReason = \"records\" | \"modules\";\ninterface InboxClosed {\n readonly code: \"report-view-inbox-closed\";\n}\nconst inboxClosed: InboxClosed = Object.freeze({ code: \"report-view-inbox-closed\" });\ninterface HttpRequest {\n readonly request: IncomingMessage;\n readonly response: ServerResponse;\n}\nconst HTTP_REQUEST_QUEUE_MAX = 128;\n/**\n * A small callback-to-Effect bridge. Node callbacks only enqueue a value; the\n * long-lived scoped Effect performs every session operation, so callbacks do\n * not create private runtimes or invoke `runPromise`/`runSync`.\n */\nclass Inbox<Value> {\n private readonly values: Value[] = [];\n private resume: ((effect: Effect.Effect<Value, InboxClosed>) => void) | undefined;\n private closed = false;\n constructor(private readonly capacity: number) { }\n take(): Effect.Effect<Value, InboxClosed> {\n return Effect.async((resume) => {\n if (this.values.length > 0) {\n resume(Effect.succeed(this.values.shift()!));\n return Effect.void;\n }\n if (this.closed) {\n resume(Effect.fail(inboxClosed));\n return Effect.void;\n }\n this.resume = resume;\n return Effect.sync(() => {\n if (this.resume === resume)\n this.resume = undefined;\n });\n });\n }\n offer(value: Value): boolean {\n if (this.closed)\n return false;\n const resume = this.resume;\n if (resume === undefined) {\n if (this.values.length >= this.capacity)\n return false;\n this.values.push(value);\n return true;\n }\n this.resume = undefined;\n resume(Effect.succeed(value));\n return true;\n }\n close(): void {\n if (this.closed)\n return;\n this.closed = true;\n const resume = this.resume;\n this.resume = undefined;\n resume?.(Effect.fail(inboxClosed));\n }\n}\n/** Coalesces a burst of filesystem events into sequential refresh requests. */\nclass RefreshInbox {\n private pending = false;\n private resume: ((effect: Effect.Effect<void, InboxClosed>) => void) | undefined;\n private closed = false;\n take(): Effect.Effect<void, InboxClosed> {\n return Effect.async((resume) => {\n if (this.pending) {\n this.pending = false;\n resume(Effect.void);\n return Effect.void;\n }\n if (this.closed) {\n resume(Effect.fail(inboxClosed));\n return Effect.void;\n }\n this.resume = resume;\n return Effect.sync(() => {\n if (this.resume === resume)\n this.resume = undefined;\n });\n });\n }\n request(): void {\n if (this.closed)\n return;\n const resume = this.resume;\n if (resume === undefined) {\n this.pending = true;\n return;\n }\n this.resume = undefined;\n resume(Effect.void);\n }\n close(): void {\n if (this.closed)\n return;\n this.closed = true;\n const resume = this.resume;\n this.resume = undefined;\n resume?.(Effect.fail(inboxClosed));\n }\n}\ninterface ServerResources {\n readonly server: Server;\n readonly sockets: Set<Socket>;\n readonly requests: Inbox<HttpRequest>;\n readonly refreshes: RefreshInbox;\n closed: boolean;\n}\ninterface WatchResources {\n /** The one currently published watcher closure. */\n current: WatchSet;\n /** Stable refresh request callback for the current server lifetime. */\n onChange: () => void;\n closed: boolean;\n}\n/**\n * A complete watcher closure. A candidate stays `opening` until every watch\n * for its current directory tree has opened. Callbacks test both this state\n * and the owning resource's current reference, so an old or failed candidate\n * cannot enqueue a late rebuild.\n */\ninterface WatchSet {\n readonly inputs: readonly string[];\n readonly watchers: Map<string, FSWatcher>;\n state: \"opening\" | \"active\" | \"closed\";\n}\n/**\n * Opens a real HTTP server, defaulting to loopback. A watcher event only requests\n * `session.refresh`; the session serializes rebuild and close, preserves the\n * last good immutable execution and recoverable watch set, and publishes a new\n * revision only on success. The Node server then atomically replaces its\n * fs.watch resources from that revision's watchInputs.\n */\nexport function openViewServer<Requirements>(options: ViewOptions<Requirements> = {}): Effect.Effect<ReportViewServer, NodeViewServerError | ReportViewOpenError, Scope.Scope | Requirements> {\n return Effect.gen(function* () {\n const serverScope = yield* Effect.scope;\n if (options.session !== undefined && options.request !== undefined) {\n return yield* Effect.fail(serverError(\"open\", \"provide either session or request, not both\"));\n }\n const host = (options.host ?? \"127.0.0.1\").trim();\n if (host.length === 0) {\n return yield* Effect.fail(serverError(\"open\", \"view host must not be empty\"));\n }\n if (host.includes(\"%\")) {\n return yield* Effect.fail(serverError(\"open\", \"scoped IPv6 view hosts are not supported\"));\n }\n const port = options.port ?? 0;\n if (!Number.isInteger(port) || port < 0 || port > 65535) {\n return yield* Effect.fail(serverError(\"open\", `view port must be an integer from 0 through 65535, got ${port}`));\n }\n const session = options.session ?? (options.request === undefined\n ? yield* Effect.fail(serverError(\"open\", \"view needs a scoped ReportViewSession or current rebuild request\"))\n : yield* openReportViewSession({\n ...options.request,\n // Bootstrap the opening revision when the request omitted a watch set.\n watchInputs: options.request.watchInputs ?? optionWatchInputs(options),\n }));\n const opening = yield* session.snapshot.pipe(Effect.mapError(() => serverError(\"open\", \"report view session closed before watchers opened\")));\n const initialWatchInputs = opening.current.watchInputs.length > 0\n ? opening.current.watchInputs\n : optionWatchInputs(options);\n const resources = yield* Effect.acquireRelease(Effect.sync(() => makeResources()), (value) => closeResources(value));\n const address = yield* listen(resources.server, host, port);\n const urls = viewUrls(host, address.port);\n const advertisedAuthorities = Object.freeze(new Set(urls.map((url) => new URL(url).host)));\n const watches = yield* Effect.acquireRelease(openWatchers(initialWatchInputs, () => resources.refreshes.request()), (value) => closeWatchers(value));\n yield* Effect.forkScoped(Effect.forever(Effect.flatMap(resources.requests.take(), (request) => serveRequest(session, request, advertisedAuthorities))).pipe(Effect.catchAll(() => Effect.void)));\n yield* Effect.forkScoped(Effect.forever(Effect.flatMap(resources.refreshes.take(), () => registerRefreshIntent(session, watches, options.onRebuild, serverScope))).pipe(Effect.catchAll(() => Effect.void)));\n const close = Effect.zipRight(closeWatchers(watches), closeResources(resources));\n return Object.freeze({ url: urls[0]!, urls, close });\n });\n}\nfunction makeResources(): ServerResources {\n const requests = new Inbox<HttpRequest>(HTTP_REQUEST_QUEUE_MAX);\n const refreshes = new RefreshInbox();\n const sockets = new Set<Socket>();\n const server = createServer((request, response) => {\n if (!requests.offer(Object.freeze({ request, response }))) {\n sendText(response, 503, \"report view is busy; retry shortly\");\n }\n });\n server.on(\"connection\", (socket) => {\n sockets.add(socket);\n socket.once(\"close\", () => sockets.delete(socket));\n });\n return { server, sockets, requests, refreshes, closed: false };\n}\nfunction listen(server: Server, host: string, port: number): Effect.Effect<{\n readonly host: string;\n readonly port: number;\n}, NodeViewServerError> {\n return Effect.async((resume) => {\n const cleanup = (): void => {\n server.off(\"error\", onError);\n server.off(\"listening\", onListening);\n };\n const onError = (error: Error): void => {\n cleanup();\n resume(Effect.fail(serverError(\"listen\", error.message)));\n };\n const onListening = (): void => {\n cleanup();\n const address = server.address();\n if (address === null || typeof address === \"string\") {\n resume(Effect.fail(serverError(\"listen\", \"server did not expose a TCP address\")));\n return;\n }\n resume(Effect.succeed(Object.freeze({ host: address.address, port: address.port })));\n };\n server.once(\"error\", onError);\n server.once(\"listening\", onListening);\n try {\n server.listen({ host, port });\n }\n catch (error) {\n onError(asError(error));\n }\n return Effect.sync(() => cleanup());\n });\n}\nfunction serveRequest<Requirements>(session: ReportViewSession<Requirements>, request: HttpRequest, advertisedAuthorities: ReadonlySet<string>): Effect.Effect<void> {\n const authority = requestAuthority(request.request.headers.host);\n if (authority === undefined || !advertisedAuthorities.has(authority)) {\n return Effect.sync(() => sendText(request.response, 421, \"view host is not advertised\"));\n }\n if (request.request.method !== \"GET\" && request.request.method !== \"HEAD\") {\n return Effect.sync(() => sendText(request.response, 405, \"method not allowed\", { allow: \"GET, HEAD\" }));\n }\n const url = requestUrl(request.request);\n if (url === undefined) {\n return Effect.sync(() => sendText(request.response, 400, \"bad request\"));\n }\n if (url.pathname === \"/healthz\") {\n return Effect.sync(() => sendText(request.response, 200, \"ok\"));\n }\n return session.snapshot.pipe(Effect.flatMap((state) => {\n const headers = Object.freeze({\n \"cache-control\": \"no-store\",\n \"x-niceeval-report-revision\": String(state.current.revision),\n \"x-niceeval-report-content-hash\": closedSiteRevisionData(state.current.site).identity.contentHash,\n ...(state.lastProblem === undefined ? {} : { \"x-niceeval-last-rebuild-problem\": \"1\" }),\n });\n // Optional host transport probe. It contains no Report body and does\n // not belong to the content-addressed file mapping. The HTML response\n // below establishes its own served revision through an HttpOnly cookie;\n // after publication this endpoint can report that the browser document\n // is stale without putting revision information into its body bytes.\n if (url.pathname === \"/_niceeval/refresh\") {\n const servedIdentity = reportRevisionCookieValue(request.request.headers.cookie);\n return Effect.sync(() => send(request.response, 204, new Uint8Array(), \"text/plain; charset=utf-8\", {\n ...headers,\n \"x-niceeval-view-stale\": servedIdentity === undefined || servedIdentity === closedSiteRevisionData(state.current.site).identity.contentHash\n ? \"0\"\n : \"1\",\n }));\n }\n const resolved = siteFileForPath(url.pathname, state.current.site);\n if (resolved.state === \"redirect\") {\n return Effect.sync(() => redirect(request.response, resolved.location, headers));\n }\n if (resolved.state === \"missing\") {\n return Effect.sync(() => sendText(request.response, 404, url.pathname.startsWith(\"/downloads/\") ? \"download not found\" : \"page not found\", headers));\n }\n return Effect.sync(() => send(request.response, 200, resolved.file.bytes, siteContentType(resolved.file.mediaType), resolved.file.path.startsWith(\"downloads/\")\n ? { ...headers, \"content-disposition\": \"attachment\", \"x-content-type-options\": \"nosniff\" }\n : resolved.file.mediaType.startsWith(\"text/html;\")\n ? { ...headers, \"set-cookie\": reportRevisionCookie(closedSiteRevisionData(state.current.site).identity.contentHash) }\n : headers));\n }), Effect.catchAll(() => Effect.sync(() => sendText(request.response, 503, \"report view session is closed\"))));\n}\n/**\n * Register immediately, then subscribe in a scoped waiter. The refresh inbox\n * can therefore accept a newer intent while this candidate still performs\n * author work; only a published outcome mutates watcher ownership or emits a\n * browser-facing rebuild notification.\n */\nfunction registerRefreshIntent<Requirements>(session: ReportViewSession<Requirements>, watches: WatchResources, onRebuild: ViewOptions[\"onRebuild\"], serverScope: Scope.Scope): Effect.Effect<void, ReportViewSessionClosed, Requirements> {\n return Effect.gen(function* () {\n const intent = yield* session.refresh;\n yield* Effect.forkIn(intent.outcome.pipe(Effect.flatMap((outcome) => outcome.state !== \"published\"\n ? Effect.void\n : Effect.gen(function* () {\n // One published revision owns its corresponding successful watch set.\n yield* Effect.sync(() => replaceWatchInputs(watches, outcome.revision.watchInputs));\n if (onRebuild !== undefined) {\n yield* Effect.try({\n try: () => onRebuild(new Date()),\n catch: () => undefined,\n }).pipe(Effect.ignore);\n }\n }))), serverScope);\n });\n}\nfunction optionWatchInputs<Requirements>(options: ViewOptions<Requirements>): readonly string[] {\n const values = options.watchInputs ?? [];\n return Object.freeze([...new Set(values.map((value) => resolve(value)))]);\n}\nfunction openWatchers(inputs: readonly string[], onChange: () => void): Effect.Effect<WatchResources, NodeViewServerError> {\n return Effect.try({\n try: () => {\n const resources: WatchResources = {\n current: closedWatchSet(),\n onChange,\n closed: false,\n };\n try {\n const opening = openWatchSet(resources, inputs);\n publishWatchSet(resources, opening);\n return resources;\n }\n catch (error) {\n closeWatchSet(resources.current);\n throw error;\n }\n },\n catch: (error): NodeViewServerError => serverError(\"watch\", asError(error).message),\n });\n}\n/**\n * Atomically swaps the next-round watch set after a successful revision. Failure\n * paths never call this, so last-good entry edges remain recoverable.\n */\nfunction replaceWatchInputs(resources: WatchResources, inputs: readonly string[]): void {\n if (resources.closed)\n return;\n try {\n const opening = openWatchSet(resources, inputs);\n if (resources.closed) {\n closeWatchSet(opening);\n return;\n }\n // No Effect boundary or callback can interleave this publication: the\n // replacement is entirely synchronous after the candidate validated.\n publishWatchSet(resources, opening);\n }\n catch {\n // A transient directory race must not discard the previous recoverable\n // closure. The next filesystem hint retries full reconciliation.\n }\n}\nfunction closedWatchSet(): WatchSet {\n return {\n inputs: Object.freeze([]),\n watchers: new Map(),\n state: \"closed\",\n };\n}\n/**\n * Opens a whole candidate closure without touching the published set. This is\n * also the full reconciliation path for directory-tree changes: fs.watch is a\n * hint, so every event rescans all inputs before requesting a rebuild.\n */\nfunction openWatchSet(resources: WatchResources, inputs: readonly string[]): WatchSet {\n const watchSet: WatchSet = {\n inputs: normalizeWatchInputs(inputs),\n watchers: new Map(),\n state: \"opening\",\n };\n try {\n synchronizeWatchSet(resources, watchSet);\n return watchSet;\n }\n catch (error) {\n closeWatchSet(watchSet);\n throw error;\n }\n}\n/** Watch the Record root and its current Run directories without a polling loop. */\nfunction synchronizeWatchSet(resources: WatchResources, watchSet: WatchSet): void {\n for (const input of watchSet.inputs) {\n let inputIsDirectory: boolean;\n try {\n inputIsDirectory = statSync(input).isDirectory();\n }\n catch (error) {\n if (!isMissingPath(error))\n throw error;\n // A missing config / module / Record root remains observable through its\n // parent directory. It can appear later without restarting the host.\n watchNamedInput(resources, watchSet, dirname(input), basename(input));\n continue;\n }\n if (inputIsDirectory) {\n watchDirectoryTree(resources, watchSet, input, 0);\n }\n else {\n watchNamedInput(resources, watchSet, dirname(input), basename(input));\n }\n }\n}\nfunction normalizeWatchInputs(inputs: readonly string[]): readonly string[] {\n return Object.freeze([...new Set(inputs.map((input) => resolve(input)))].sort());\n}\nconst WATCH_DIRECTORY_DEPTH_MAX = 4;\nfunction watchDirectoryTree(resources: WatchResources, watchSet: WatchSet, directory: string, depth: number): void {\n try {\n watchDirectory(resources, watchSet, directory);\n }\n catch (error) {\n if (!isMissingPath(error))\n throw error;\n watchNamedInput(resources, watchSet, dirname(directory), basename(directory));\n return;\n }\n if (depth >= WATCH_DIRECTORY_DEPTH_MAX)\n return;\n let entries: readonly {\n readonly name: string;\n isDirectory(): boolean;\n }[];\n try {\n entries = readdirSync(directory, { withFileTypes: true });\n }\n catch (error) {\n if (!isMissingPath(error))\n throw error;\n watchNamedInput(resources, watchSet, dirname(directory), basename(directory));\n return;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n watchDirectoryTree(resources, watchSet, resolve(directory, entry.name), depth + 1);\n }\n }\n}\nfunction watchDirectory(resources: WatchResources, watchSet: WatchSet, directory: string): void {\n const key = `directory:${directory}`;\n if (watchSet.watchers.has(key))\n return;\n const watcher = watch(directory, () => watchSetChanged(resources, watchSet));\n watchSet.watchers.set(key, watcher);\n watchFailure(resources, watchSet, key, watcher);\n}\nfunction watchNamedInput(resources: WatchResources, watchSet: WatchSet, directory: string, name: string): void {\n const key = `named:${directory}:${name}`;\n if (watchSet.watchers.has(key))\n return;\n const watcher = watch(directory, (_event, filename) => {\n if (filename === null || filename.toString() === name)\n watchSetChanged(resources, watchSet);\n });\n watchSet.watchers.set(key, watcher);\n watchFailure(resources, watchSet, key, watcher);\n}\nfunction watchFailure(resources: WatchResources, watchSet: WatchSet, key: string, watcher: FSWatcher): void {\n watcher.once(\"error\", () => {\n if (watchSet.watchers.get(key) === watcher) {\n watchSet.watchers.delete(key);\n closeWatcher(watcher);\n }\n watchSetChanged(resources, watchSet);\n });\n}\nfunction watchSetChanged(resources: WatchResources, watchSet: WatchSet): void {\n if (!isCurrentWatchSet(resources, watchSet))\n return;\n // A new Run gets its own directory before its completion marker. Reconcile\n // the whole closure now so the marker change is observed as well as the\n // first incomplete rebuild. Failure leaves this complete old set active.\n replaceWatchInputs(resources, watchSet.inputs);\n if (isCurrentWatchSet(resources, resources.current))\n resources.onChange();\n}\nfunction isCurrentWatchSet(resources: WatchResources, watchSet: WatchSet): boolean {\n return !resources.closed && resources.current === watchSet && watchSet.state === \"active\";\n}\n/** Publishes a fully opened candidate, then retires the old closure synchronously. */\nfunction publishWatchSet(resources: WatchResources, opening: WatchSet): void {\n if (resources.closed) {\n closeWatchSet(opening);\n return;\n }\n const previous = resources.current;\n opening.state = \"active\";\n resources.current = opening;\n closeWatchSet(previous);\n}\nfunction closeWatchSet(watchSet: WatchSet): void {\n if (watchSet.state === \"closed\")\n return;\n watchSet.state = \"closed\";\n const watchers = [...watchSet.watchers.values()];\n watchSet.watchers.clear();\n for (const watcher of watchers)\n closeWatcher(watcher);\n}\nfunction closeWatcher(watcher: FSWatcher): void {\n try {\n watcher.close();\n }\n catch {\n // Closing is best-effort and idempotent at the Node boundary.\n }\n}\nfunction closeResources(resources: ServerResources): Effect.Effect<void> {\n return Effect.suspend(() => {\n if (resources.closed)\n return Effect.void;\n resources.closed = true;\n return Effect.zipRight(Effect.sync(() => {\n resources.requests.close();\n resources.refreshes.close();\n for (const socket of resources.sockets)\n socket.destroy();\n }), closeServer(resources.server));\n });\n}\nfunction closeWatchers(resources: WatchResources): Effect.Effect<void> {\n return Effect.suspend(() => {\n if (resources.closed)\n return Effect.void;\n resources.closed = true;\n return Effect.sync(() => closeWatchSet(resources.current));\n });\n}\nfunction closeServer(server: Server): Effect.Effect<void> {\n return Effect.async((resume) => {\n if (!server.listening) {\n resume(Effect.void);\n return Effect.void;\n }\n try {\n server.close(() => resume(Effect.void));\n }\n catch {\n resume(Effect.void);\n }\n return Effect.void;\n });\n}\ntype SitePathLookup = {\n readonly state: \"file\";\n readonly file: ClosedSiteFile;\n} | {\n readonly state: \"redirect\";\n readonly location: string;\n} | {\n readonly state: \"missing\";\n};\n/**\n * Resolves HTTP paths strictly through the current revision's finished file\n * map. There is intentionally no route callback, renderer, Sample, or Record\n * fallback here, so a request can never splice two revisions together.\n */\nfunction siteFileForPath(pathname: string, site: ClosedSiteRevision): SitePathLookup {\n if (!pathname.startsWith(\"/\") || pathname.includes(\"%\") || pathname.includes(\"\\\\\")) {\n return Object.freeze({ state: \"missing\" as const });\n }\n const requested = pathname.slice(1);\n const exact = requested === \"\" ? \"index.html\" : requested;\n const revision = closedSiteRevisionData(site);\n const files = revision.files;\n const direct = files.find((file) => file.path === exact);\n if (direct !== undefined)\n return Object.freeze({ state: \"file\" as const, file: direct });\n // A report may deliberately declare its first Page at /overview (or another\n // route), so its immutable closure has no root index.html. The advertised\n // root must still land on that revision's canonical entry route rather than\n // becoming a host-generated 404 or re-entering Report execution.\n if (requested === \"\" && revision.defaultRoute !== undefined) {\n const entryFile = staticPageFileForRoute(revision.defaultRoute);\n if (files.some((file) => file.path === entryFile)) {\n return Object.freeze({ state: \"redirect\" as const, location: revision.defaultRoute });\n }\n }\n // Keep direct Page URLs convenient without manufacturing a different body.\n // The redirect selects the exact generated index.html path from this same map.\n const indexPath = requested.endsWith(\"/\")\n ? `${requested}index.html`\n : `${requested}/index.html`;\n const page = files.find((file) => file.path === indexPath);\n if (page !== undefined) {\n return Object.freeze({ state: \"redirect\" as const, location: `/${indexPath}` });\n }\n return Object.freeze({ state: \"missing\" as const });\n}\nfunction staticPageFileForRoute(route: string): string {\n return route === \"/\" ? \"index.html\" : `${route.slice(1)}/index.html`;\n}\nfunction requestUrl(request: IncomingMessage): URL | undefined {\n try {\n return new URL(request.url ?? \"/\", \"http://127.0.0.1\");\n }\n catch {\n return undefined;\n }\n}\nconst REPORT_REVISION_COOKIE = \"niceeval_report_revision\";\nfunction reportRevisionCookie(contentHash: string): string {\n return `${REPORT_REVISION_COOKIE}=${contentHash}; Path=/; SameSite=Strict; HttpOnly`;\n}\nfunction reportRevisionCookieValue(cookie: string | undefined): string | undefined {\n if (cookie === undefined)\n return undefined;\n for (const entry of cookie.split(\";\")) {\n const [name, ...value] = entry.trim().split(\"=\");\n if (name === REPORT_REVISION_COOKIE)\n return value.join(\"=\");\n }\n return undefined;\n}\nfunction sendText(response: ServerResponse, status: number, body: string, headers: Readonly<Record<string, string>> = {}): void {\n send(response, status, body, \"text/plain; charset=utf-8\", headers);\n}\nfunction send(response: ServerResponse, status: number, body: string | Uint8Array, contentType: string, headers: Readonly<Record<string, string>>): void {\n if (response.destroyed)\n return;\n response.writeHead(status, { \"content-type\": contentType, ...headers });\n response.end(body);\n}\nfunction redirect(response: ServerResponse, location: string, headers: Readonly<Record<string, string>>): void {\n if (response.destroyed)\n return;\n response.writeHead(308, { location, ...headers });\n response.end();\n}\nconst SAFE_MEDIA_TYPE = /^[A-Za-z0-9!#$%&'*+.^_`|~-]+\\/[A-Za-z0-9!#$%&'*+.^_`|~-]+$/;\nfunction siteContentType(mediaType: string): string {\n const base = mediaType.split(\";\", 1)[0]?.trim() ?? \"\";\n return SAFE_MEDIA_TYPE.test(base) ? base : \"application/octet-stream\";\n}\nfunction viewUrls(host: string, port: number): readonly string[] {\n if (host === \"0.0.0.0\") {\n return urlsForAddresses([\n \"127.0.0.1\",\n ...interfaceAddresses(\"IPv4\"),\n ], port);\n }\n if (host === \"::\") {\n return urlsForAddresses([\n \"::1\",\n ...interfaceAddresses(\"IPv6\"),\n ], port);\n }\n return Object.freeze([viewUrl(host, port)]);\n}\nfunction interfaceAddresses(family: \"IPv4\" | \"IPv6\"): readonly string[] {\n const addresses: string[] = [];\n for (const entries of Object.values(networkInterfaces())) {\n for (const entry of entries ?? []) {\n if (entry.family === family &&\n !entry.internal &&\n !entry.address.includes(\"%\") &&\n (family !== \"IPv6\" || entry.scopeid === 0)) {\n addresses.push(entry.address);\n }\n }\n }\n return addresses.sort((left, right) => left.localeCompare(right));\n}\nfunction urlsForAddresses(addresses: readonly string[], port: number): readonly string[] {\n return Object.freeze([...new Set(addresses)].map((address) => viewUrl(address, port)));\n}\nfunction viewUrl(host: string, port: number): string {\n return new URL(`http://${formatHost(host)}:${port}/`).toString();\n}\nfunction requestAuthority(value: string | undefined): string | undefined {\n if (value === undefined)\n return undefined;\n try {\n const url = new URL(`http://${value}`);\n if (url.username.length > 0 || url.password.length > 0)\n return undefined;\n return url.host;\n }\n catch {\n return undefined;\n }\n}\nfunction formatHost(host: string): string {\n return host.includes(\":\") ? `[${host}]` : host;\n}\nfunction serverError(operation: NodeViewServerError[\"operation\"], reason: string): NodeViewServerError {\n return Object.freeze({ code: \"report-view-server-failed\", operation, reason });\n}\nfunction asError(error: unknown): Error {\n return error instanceof Error ? error : new Error(String(error));\n}\nfunction isMissingPath(error: unknown): boolean {\n if (typeof error !== \"object\" || error === null)\n return false;\n const code = Reflect.get(error, \"code\");\n return code === \"ENOENT\" || code === \"ENOTDIR\";\n}\n"]}
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["server.ts"],"names":[],"mappings":";;AAkLA,wCAsCC;AAxND,4EAA4E;AAC5E,4EAA4E;AAC5E,0CAA0C;AAC1C,qCAAuE;AACvE,yCAAiG;AAEjG,qCAA4C;AAC5C,yCAAuD;AACvD,mCAAgC;AAEhC,2DAAqH;AACrH,oEAAyL;AAoCzL,MAAM,WAAW,GAAgB,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,0BAA0B,EAAE,CAAC,CAAC;AAKrF,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC;;;;GAIG;AACH,MAAM,KAAK;IAIsB;IAHZ,MAAM,GAAY,EAAE,CAAC;IAC9B,MAAM,CAAoE;IAC1E,MAAM,GAAG,KAAK,CAAC;IACvB,YAA6B,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;IAAI,CAAC;IAClD,IAAI;QACA,OAAO,eAAM,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;YAC3B,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzB,MAAM,CAAC,eAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAG,CAAC,CAAC,CAAC;gBAC7C,OAAO,eAAM,CAAC,IAAI,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G,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACxC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,CAAC;AACnD,CAAC","sourcesContent":["// The Node view host owns transport and watch lifetime only. Its caller has\n// already closed Record -> Sample -> Report into a fixed execution rebuild;\n// this module never reopens Record facts.\nimport { readdirSync, statSync, watch, type FSWatcher } from \"node:fs\";\nimport { createServer, type IncomingMessage, type Server, type ServerResponse } from \"node:http\";\nimport type { Socket } from \"node:net\";\nimport { networkInterfaces } from \"node:os\";\nimport { basename, dirname, resolve } from \"node:path\";\nimport { Effect } from \"effect\";\nimport type * as Scope from \"effect/Scope\";\nimport { closedSiteRevisionData, type ClosedSiteFile, type ClosedSiteRevision, } from \"../report/execution/model.ts\";\nimport { openReportViewSession, type OpenReportViewSessionInput, type ReportViewOpenError, type ReportViewSessionClosed, type ReportViewSession, } from \"../report/host/view-session.ts\";\nimport type { ViewScanOptions } from \"./data.ts\";\nexport interface NodeViewServerError {\n readonly code: \"report-view-server-failed\";\n readonly operation: \"open\" | \"listen\" | \"watch\";\n readonly reason: string;\n}\nexport interface ViewOptions<Requirements = never> {\n readonly input?: string;\n readonly out?: string;\n readonly port?: number;\n /** Defaults to loopback. An explicit address opts into that network exposure. */\n readonly host?: string;\n /** Retained for the CLI-shaped facade; it is never interpreted as Record data. */\n readonly scan?: ViewScanOptions;\n /**\n * Bootstrap watch inputs when the session/request has none yet. After each\n * successful rebuild the session revision owns the next-round watch set.\n */\n readonly watchInputs?: readonly string[];\n readonly onRebuild?: (completedAt: Date) => void;\n /** An already-open scoped session owned by the caller. */\n readonly session?: ReportViewSession<Requirements>;\n /** Or let this scope open a session from a caller-supplied current rebuild. */\n readonly request?: OpenReportViewSessionInput<Requirements>;\n}\n/** The native Effect-facing server handle. Its resources are also Scope-owned. */\nexport interface ReportViewServer {\n readonly url: string;\n readonly urls: readonly string[];\n readonly close: Effect.Effect<void>;\n}\nexport type RebuildReason = \"records\" | \"modules\";\ninterface InboxClosed {\n readonly code: \"report-view-inbox-closed\";\n}\nconst inboxClosed: InboxClosed = Object.freeze({ code: \"report-view-inbox-closed\" });\ninterface HttpRequest {\n readonly request: IncomingMessage;\n readonly response: ServerResponse;\n}\nconst HTTP_REQUEST_QUEUE_MAX = 128;\n/**\n * A small callback-to-Effect bridge. Node callbacks only enqueue a value; the\n * long-lived scoped Effect performs every session operation, so callbacks do\n * not create private runtimes or invoke `runPromise`/`runSync`.\n */\nclass Inbox<Value> {\n private readonly values: Value[] = [];\n private resume: ((effect: Effect.Effect<Value, InboxClosed>) => void) | undefined;\n private closed = false;\n constructor(private readonly capacity: number) { }\n take(): Effect.Effect<Value, InboxClosed> {\n return Effect.async((resume) => {\n if (this.values.length > 0) {\n resume(Effect.succeed(this.values.shift()!));\n return Effect.void;\n }\n if (this.closed) {\n resume(Effect.fail(inboxClosed));\n return Effect.void;\n }\n this.resume = resume;\n return Effect.sync(() => {\n if (this.resume === resume)\n this.resume = undefined;\n });\n });\n }\n offer(value: Value): boolean {\n if (this.closed)\n return false;\n const resume = this.resume;\n if (resume === undefined) {\n if (this.values.length >= this.capacity)\n return false;\n this.values.push(value);\n return true;\n }\n this.resume = undefined;\n resume(Effect.succeed(value));\n return true;\n }\n close(): void {\n if (this.closed)\n return;\n this.closed = true;\n const resume = this.resume;\n this.resume = undefined;\n resume?.(Effect.fail(inboxClosed));\n }\n}\n/** Coalesces a burst of filesystem events into sequential refresh requests. */\nclass RefreshInbox {\n private pending = false;\n private resume: ((effect: Effect.Effect<void, InboxClosed>) => void) | undefined;\n private closed = false;\n take(): Effect.Effect<void, InboxClosed> {\n return Effect.async((resume) => {\n if (this.pending) {\n this.pending = false;\n resume(Effect.void);\n return Effect.void;\n }\n if (this.closed) {\n resume(Effect.fail(inboxClosed));\n return Effect.void;\n }\n this.resume = resume;\n return Effect.sync(() => {\n if (this.resume === resume)\n this.resume = undefined;\n });\n });\n }\n request(): void {\n if (this.closed)\n return;\n const resume = this.resume;\n if (resume === undefined) {\n this.pending = true;\n return;\n }\n this.resume = undefined;\n resume(Effect.void);\n }\n close(): void {\n if (this.closed)\n return;\n this.closed = true;\n const resume = this.resume;\n this.resume = undefined;\n resume?.(Effect.fail(inboxClosed));\n }\n}\ninterface ServerResources {\n readonly server: Server;\n readonly sockets: Set<Socket>;\n readonly requests: Inbox<HttpRequest>;\n readonly refreshes: RefreshInbox;\n closed: boolean;\n}\ninterface WatchResources {\n /** The one currently published watcher closure. */\n current: WatchSet;\n /** Stable refresh request callback for the current server lifetime. */\n onChange: () => void;\n closed: boolean;\n}\n/**\n * A complete watcher closure. A candidate stays `opening` until every watch\n * for its current directory tree has opened. Callbacks test both this state\n * and the owning resource's current reference, so an old or failed candidate\n * cannot enqueue a late rebuild.\n */\ninterface WatchSet {\n readonly inputs: readonly string[];\n readonly watchers: Map<string, FSWatcher>;\n state: \"opening\" | \"active\" | \"closed\";\n}\n/**\n * Opens a real HTTP server, defaulting to loopback. A watcher event only requests\n * `session.refresh`; the session serializes rebuild and close, preserves the\n * last good immutable execution and recoverable watch set, and publishes a new\n * revision only on success. The Node server then atomically replaces its\n * fs.watch resources from that revision's watchInputs.\n */\nexport function openViewServer<Requirements>(options: ViewOptions<Requirements> = {}): Effect.Effect<ReportViewServer, NodeViewServerError | ReportViewOpenError, Scope.Scope | Requirements> {\n return Effect.gen(function* () {\n const serverScope = yield* Effect.scope;\n if (options.session !== undefined && options.request !== undefined) {\n return yield* Effect.fail(serverError(\"open\", \"provide either session or request, not both\"));\n }\n const host = (options.host ?? \"127.0.0.1\").trim();\n if (host.length === 0) {\n return yield* Effect.fail(serverError(\"open\", \"view host must not be empty\"));\n }\n if (host.includes(\"%\")) {\n return yield* Effect.fail(serverError(\"open\", \"scoped IPv6 view hosts are not supported\"));\n }\n const port = options.port ?? 0;\n if (!Number.isInteger(port) || port < 0 || port > 65535) {\n return yield* Effect.fail(serverError(\"open\", `view port must be an integer from 0 through 65535, got ${port}`));\n }\n const session = options.session ?? (options.request === undefined\n ? yield* Effect.fail(serverError(\"open\", \"view needs a scoped ReportViewSession or current rebuild request\"))\n : yield* openReportViewSession({\n ...options.request,\n // Bootstrap the opening revision when the request omitted a watch set.\n watchInputs: options.request.watchInputs ?? optionWatchInputs(options),\n }));\n const opening = yield* session.snapshot.pipe(Effect.mapError(() => serverError(\"open\", \"report view session closed before watchers opened\")));\n const initialWatchInputs = opening.current.watchInputs.length > 0\n ? opening.current.watchInputs\n : optionWatchInputs(options);\n const resources = yield* Effect.acquireRelease(Effect.sync(() => makeResources()), (value) => closeResources(value));\n const address = yield* listen(resources.server, host, port);\n const urls = viewUrls(host, address.port);\n const advertisedAuthorities = Object.freeze(new Set(urls.map((url) => new URL(url).host)));\n const watches = yield* Effect.acquireRelease(openWatchers(initialWatchInputs, () => resources.refreshes.request()), (value) => closeWatchers(value));\n yield* Effect.forkScoped(Effect.forever(Effect.flatMap(resources.requests.take(), (request) => serveRequest(session, request, advertisedAuthorities))).pipe(Effect.catchAll(() => Effect.void)));\n yield* Effect.forkScoped(Effect.forever(Effect.flatMap(resources.refreshes.take(), () => registerRefreshIntent(session, watches, options.onRebuild, serverScope))).pipe(Effect.catchAll(() => Effect.void)));\n const close = Effect.zipRight(closeWatchers(watches), closeResources(resources));\n return Object.freeze({ url: urls[0]!, urls, close });\n });\n}\nfunction makeResources(): ServerResources {\n const requests = new Inbox<HttpRequest>(HTTP_REQUEST_QUEUE_MAX);\n const refreshes = new RefreshInbox();\n const sockets = new Set<Socket>();\n const server = createServer((request, response) => {\n if (!requests.offer(Object.freeze({ request, response }))) {\n sendText(response, 503, \"report view is busy; retry shortly\");\n }\n });\n server.on(\"connection\", (socket) => {\n sockets.add(socket);\n socket.once(\"close\", () => sockets.delete(socket));\n });\n return { server, sockets, requests, refreshes, closed: false };\n}\nfunction listen(server: Server, host: string, port: number): Effect.Effect<{\n readonly host: string;\n readonly port: number;\n}, NodeViewServerError> {\n return Effect.async((resume) => {\n const cleanup = (): void => {\n server.off(\"error\", onError);\n server.off(\"listening\", onListening);\n };\n const onError = (error: Error): void => {\n cleanup();\n resume(Effect.fail(serverError(\"listen\", error.message)));\n };\n const onListening = (): void => {\n cleanup();\n const address = server.address();\n if (address === null || typeof address === \"string\") {\n resume(Effect.fail(serverError(\"listen\", \"server did not expose a TCP address\")));\n return;\n }\n resume(Effect.succeed(Object.freeze({ host: address.address, port: address.port })));\n };\n server.once(\"error\", onError);\n server.once(\"listening\", onListening);\n try {\n server.listen({ host, port });\n }\n catch (error) {\n onError(asError(error));\n }\n return Effect.sync(() => cleanup());\n });\n}\nfunction serveRequest<Requirements>(session: ReportViewSession<Requirements>, request: HttpRequest, advertisedAuthorities: ReadonlySet<string>): Effect.Effect<void> {\n const authority = requestAuthority(request.request.headers.host);\n if (authority === undefined || !advertisedAuthorities.has(authority)) {\n return Effect.sync(() => sendText(request.response, 421, \"view host is not advertised\"));\n }\n if (request.request.method !== \"GET\" && request.request.method !== \"HEAD\") {\n return Effect.sync(() => sendText(request.response, 405, \"method not allowed\", { allow: \"GET, HEAD\" }));\n }\n const url = requestUrl(request.request);\n if (url === undefined) {\n return Effect.sync(() => sendText(request.response, 400, \"bad request\"));\n }\n if (url.pathname === \"/healthz\") {\n return Effect.sync(() => sendText(request.response, 200, \"ok\"));\n }\n return session.snapshot.pipe(Effect.flatMap((state) => {\n const headers = Object.freeze({\n \"cache-control\": \"no-store\",\n \"x-niceeval-report-revision\": String(state.current.revision),\n \"x-niceeval-report-content-hash\": closedSiteRevisionData(state.current.site).identity.contentHash,\n ...(state.lastProblem === undefined ? {} : { \"x-niceeval-last-rebuild-problem\": \"1\" }),\n });\n // Optional host transport probe. It contains no Report body and does\n // not belong to the content-addressed file mapping. The HTML response\n // below establishes its own served revision through an HttpOnly cookie;\n // after publication this endpoint can report that the browser document\n // is stale without putting revision information into its body bytes.\n if (url.pathname === \"/_niceeval/refresh\") {\n const servedIdentity = reportRevisionCookieValue(request.request.headers.cookie);\n return Effect.sync(() => send(request.response, 204, new Uint8Array(), \"text/plain; charset=utf-8\", {\n ...headers,\n \"x-niceeval-view-stale\": servedIdentity === undefined || servedIdentity === closedSiteRevisionData(state.current.site).identity.contentHash\n ? \"0\"\n : \"1\",\n }));\n }\n const resolved = siteFileForPath(url.pathname, state.current.site);\n if (resolved.state === \"redirect\") {\n return Effect.sync(() => redirect(request.response, resolved.location, headers));\n }\n if (resolved.state === \"missing\") {\n return Effect.sync(() => sendText(request.response, 404, url.pathname.startsWith(\"/downloads/\") ? \"download not found\" : \"page not found\", headers));\n }\n return Effect.sync(() => send(request.response, 200, resolved.file.bytes, siteContentType(resolved.file.mediaType), resolved.file.path.startsWith(\"downloads/\")\n ? { ...headers, \"content-disposition\": \"attachment\", \"x-content-type-options\": \"nosniff\" }\n : resolved.file.mediaType.startsWith(\"text/html;\")\n ? { ...headers, \"set-cookie\": reportRevisionCookie(closedSiteRevisionData(state.current.site).identity.contentHash) }\n : headers));\n }), Effect.catchAll(() => Effect.sync(() => sendText(request.response, 503, \"report view session is closed\"))));\n}\n/**\n * Register immediately, then subscribe in a scoped waiter. The refresh inbox\n * can therefore accept a newer intent while this candidate still performs\n * author work; only a published outcome mutates watcher ownership or emits a\n * browser-facing rebuild notification.\n */\nfunction registerRefreshIntent<Requirements>(session: ReportViewSession<Requirements>, watches: WatchResources, onRebuild: ViewOptions[\"onRebuild\"], serverScope: Scope.Scope): Effect.Effect<void, ReportViewSessionClosed, Requirements> {\n return Effect.gen(function* () {\n const intent = yield* session.refresh;\n yield* Effect.forkIn(intent.outcome.pipe(Effect.flatMap((outcome) => outcome.state !== \"published\"\n ? Effect.void\n : Effect.gen(function* () {\n // One published revision owns its corresponding successful watch set.\n yield* Effect.sync(() => replaceWatchInputs(watches, outcome.revision.watchInputs));\n if (onRebuild !== undefined) {\n yield* Effect.try({\n try: () => onRebuild(new Date()),\n catch: () => undefined,\n }).pipe(Effect.ignore);\n }\n }))), serverScope);\n });\n}\nfunction optionWatchInputs<Requirements>(options: ViewOptions<Requirements>): readonly string[] {\n const values = options.watchInputs ?? [];\n return Object.freeze([...new Set(values.map((value) => resolve(value)))]);\n}\nfunction openWatchers(inputs: readonly string[], onChange: () => void): Effect.Effect<WatchResources, NodeViewServerError> {\n return Effect.try({\n try: () => {\n const resources: WatchResources = {\n current: closedWatchSet(),\n onChange,\n closed: false,\n };\n try {\n const opening = openWatchSet(resources, inputs);\n publishWatchSet(resources, opening);\n return resources;\n }\n catch (error) {\n closeWatchSet(resources.current);\n throw error;\n }\n },\n catch: (error): NodeViewServerError => serverError(\"watch\", asError(error).message),\n });\n}\n/**\n * Atomically swaps the next-round watch set after a successful revision. Failure\n * paths never call this, so last-good entry edges remain recoverable.\n */\nfunction replaceWatchInputs(resources: WatchResources, inputs: readonly string[]): void {\n if (resources.closed)\n return;\n try {\n const opening = openWatchSet(resources, inputs);\n if (resources.closed) {\n closeWatchSet(opening);\n return;\n }\n // No Effect boundary or callback can interleave this publication: the\n // replacement is entirely synchronous after the candidate validated.\n publishWatchSet(resources, opening);\n }\n catch {\n // A transient directory race must not discard the previous recoverable\n // closure. The next filesystem hint retries full reconciliation.\n }\n}\nfunction closedWatchSet(): WatchSet {\n return {\n inputs: Object.freeze([]),\n watchers: new Map(),\n state: \"closed\",\n };\n}\n/**\n * Opens a whole candidate closure without touching the published set. This is\n * also the full reconciliation path for directory-tree changes: fs.watch is a\n * hint, so every event rescans all inputs before requesting a rebuild.\n */\nfunction openWatchSet(resources: WatchResources, inputs: readonly string[]): WatchSet {\n const watchSet: WatchSet = {\n inputs: normalizeWatchInputs(inputs),\n watchers: new Map(),\n state: \"opening\",\n };\n try {\n synchronizeWatchSet(resources, watchSet);\n return watchSet;\n }\n catch (error) {\n closeWatchSet(watchSet);\n throw error;\n }\n}\n/** Watch the Record root and its current Run directories without a polling loop. */\nfunction synchronizeWatchSet(resources: WatchResources, watchSet: WatchSet): void {\n for (const input of watchSet.inputs) {\n let inputIsDirectory: boolean;\n try {\n inputIsDirectory = statSync(input).isDirectory();\n }\n catch (error) {\n if (!isMissingPath(error))\n throw error;\n // A missing config / module / Record root remains observable through its\n // parent directory. It can appear later without restarting the host.\n watchNamedInput(resources, watchSet, dirname(input), basename(input));\n continue;\n }\n if (inputIsDirectory) {\n watchDirectoryTree(resources, watchSet, input, 0);\n }\n else {\n watchNamedInput(resources, watchSet, dirname(input), basename(input));\n }\n }\n}\nfunction normalizeWatchInputs(inputs: readonly string[]): readonly string[] {\n return Object.freeze([...new Set(inputs.map((input) => resolve(input)))].sort());\n}\nconst WATCH_DIRECTORY_DEPTH_MAX = 4;\nfunction watchDirectoryTree(resources: WatchResources, watchSet: WatchSet, directory: string, depth: number): void {\n try {\n watchDirectory(resources, watchSet, directory);\n }\n catch (error) {\n if (!isMissingPath(error))\n throw error;\n watchNamedInput(resources, watchSet, dirname(directory), basename(directory));\n return;\n }\n if (depth >= WATCH_DIRECTORY_DEPTH_MAX)\n return;\n let entries: readonly {\n readonly name: string;\n isDirectory(): boolean;\n }[];\n try {\n entries = readdirSync(directory, { withFileTypes: true });\n }\n catch (error) {\n if (!isMissingPath(error))\n throw error;\n watchNamedInput(resources, watchSet, dirname(directory), basename(directory));\n return;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n watchDirectoryTree(resources, watchSet, resolve(directory, entry.name), depth + 1);\n }\n }\n}\nfunction watchDirectory(resources: WatchResources, watchSet: WatchSet, directory: string): void {\n const key = `directory:${directory}`;\n if (watchSet.watchers.has(key))\n return;\n const watcher = watch(directory, () => watchSetChanged(resources, watchSet));\n watchSet.watchers.set(key, watcher);\n watchFailure(resources, watchSet, key, watcher);\n}\nfunction watchNamedInput(resources: WatchResources, watchSet: WatchSet, directory: string, name: string): void {\n const key = `named:${directory}:${name}`;\n if (watchSet.watchers.has(key))\n return;\n const watcher = watch(directory, (_event, filename) => {\n if (filename === null || filename.toString() === name)\n watchSetChanged(resources, watchSet);\n });\n watchSet.watchers.set(key, watcher);\n watchFailure(resources, watchSet, key, watcher);\n}\nfunction watchFailure(resources: WatchResources, watchSet: WatchSet, key: string, watcher: FSWatcher): void {\n watcher.once(\"error\", () => {\n if (watchSet.watchers.get(key) === watcher) {\n watchSet.watchers.delete(key);\n closeWatcher(watcher);\n }\n watchSetChanged(resources, watchSet);\n });\n}\nfunction watchSetChanged(resources: WatchResources, watchSet: WatchSet): void {\n if (!isCurrentWatchSet(resources, watchSet))\n return;\n // A new Run gets its own directory before its completion marker. Reconcile\n // the whole closure now so the marker change is observed as well as the\n // first incomplete rebuild. Failure leaves this complete old set active.\n replaceWatchInputs(resources, watchSet.inputs);\n if (isCurrentWatchSet(resources, resources.current))\n resources.onChange();\n}\nfunction isCurrentWatchSet(resources: WatchResources, watchSet: WatchSet): boolean {\n return !resources.closed && resources.current === watchSet && watchSet.state === \"active\";\n}\n/** Publishes a fully opened candidate, then retires the old closure synchronously. */\nfunction publishWatchSet(resources: WatchResources, opening: WatchSet): void {\n if (resources.closed) {\n closeWatchSet(opening);\n return;\n }\n const previous = resources.current;\n opening.state = \"active\";\n resources.current = opening;\n closeWatchSet(previous);\n}\nfunction closeWatchSet(watchSet: WatchSet): void {\n if (watchSet.state === \"closed\")\n return;\n watchSet.state = \"closed\";\n const watchers = [...watchSet.watchers.values()];\n watchSet.watchers.clear();\n for (const watcher of watchers)\n closeWatcher(watcher);\n}\nfunction closeWatcher(watcher: FSWatcher): void {\n try {\n watcher.close();\n }\n catch {\n // Closing is best-effort and idempotent at the Node boundary.\n }\n}\nfunction closeResources(resources: ServerResources): Effect.Effect<void> {\n return Effect.suspend(() => {\n if (resources.closed)\n return Effect.void;\n resources.closed = true;\n return Effect.zipRight(Effect.sync(() => {\n resources.requests.close();\n resources.refreshes.close();\n for (const socket of resources.sockets)\n socket.destroy();\n }), closeServer(resources.server));\n });\n}\nfunction closeWatchers(resources: WatchResources): Effect.Effect<void> {\n return Effect.suspend(() => {\n if (resources.closed)\n return Effect.void;\n resources.closed = true;\n return Effect.sync(() => closeWatchSet(resources.current));\n });\n}\nfunction closeServer(server: Server): Effect.Effect<void> {\n return Effect.async((resume) => {\n if (!server.listening) {\n resume(Effect.void);\n return Effect.void;\n }\n try {\n server.close(() => resume(Effect.void));\n }\n catch {\n resume(Effect.void);\n }\n return Effect.void;\n });\n}\ntype SitePathLookup = {\n readonly state: \"file\";\n readonly file: ClosedSiteFile;\n} | {\n readonly state: \"redirect\";\n readonly location: string;\n} | {\n readonly state: \"missing\";\n};\n/**\n * Resolves HTTP paths strictly through the current revision's finished file\n * map. There is intentionally no route callback, renderer, Sample, or Record\n * fallback here, so a request can never splice two revisions together.\n */\nfunction siteFileForPath(pathname: string, site: ClosedSiteRevision): SitePathLookup {\n if (!pathname.startsWith(\"/\") || pathname.includes(\"%\") || pathname.includes(\"\\\\\")) {\n return Object.freeze({ state: \"missing\" as const });\n }\n const requested = pathname.slice(1);\n const exact = requested === \"\" ? \"index.html\" : requested;\n const revision = closedSiteRevisionData(site);\n const files = revision.files;\n if (requested === \"\" && revision.defaultRoute !== undefined && revision.defaultRoute !== \"/\") {\n const entryFile = staticPageFileForRoute(revision.defaultRoute);\n if (files.some((file) => file.path === entryFile)) {\n return Object.freeze({ state: \"redirect\" as const, location: revision.defaultRoute });\n }\n }\n const direct = files.find((file) => file.path === exact);\n if (direct !== undefined)\n return Object.freeze({ state: \"file\" as const, file: direct });\n // A report may deliberately declare its first Page at /overview (or another\n // route), so its immutable closure has no root index.html. The advertised\n // root must still land on that revision's canonical entry route rather than\n // becoming a host-generated 404 or re-entering Report execution.\n if (requested === \"\" && revision.defaultRoute !== undefined) {\n const entryFile = staticPageFileForRoute(revision.defaultRoute);\n if (files.some((file) => file.path === entryFile)) {\n return Object.freeze({ state: \"redirect\" as const, location: revision.defaultRoute });\n }\n }\n // Keep direct Page URLs convenient without manufacturing a different body.\n // The redirect selects the exact generated index.html path from this same map.\n const indexPath = requested.endsWith(\"/\")\n ? `${requested}index.html`\n : `${requested}/index.html`;\n const page = files.find((file) => file.path === indexPath);\n if (page !== undefined) {\n return Object.freeze({ state: \"redirect\" as const, location: `/${indexPath}` });\n }\n return Object.freeze({ state: \"missing\" as const });\n}\nfunction staticPageFileForRoute(route: string): string {\n return route === \"/\" ? \"index.html\" : `${route.slice(1)}/index.html`;\n}\nfunction requestUrl(request: IncomingMessage): URL | undefined {\n try {\n return new URL(request.url ?? \"/\", \"http://127.0.0.1\");\n }\n catch {\n return undefined;\n }\n}\nconst REPORT_REVISION_COOKIE = \"niceeval_report_revision\";\nfunction reportRevisionCookie(contentHash: string): string {\n return `${REPORT_REVISION_COOKIE}=${contentHash}; Path=/; SameSite=Strict; HttpOnly`;\n}\nfunction reportRevisionCookieValue(cookie: string | undefined): string | undefined {\n if (cookie === undefined)\n return undefined;\n for (const entry of cookie.split(\";\")) {\n const [name, ...value] = entry.trim().split(\"=\");\n if (name === REPORT_REVISION_COOKIE)\n return value.join(\"=\");\n }\n return undefined;\n}\nfunction sendText(response: ServerResponse, status: number, body: string, headers: Readonly<Record<string, string>> = {}): void {\n send(response, status, body, \"text/plain; charset=utf-8\", headers);\n}\nfunction send(response: ServerResponse, status: number, body: string | Uint8Array, contentType: string, headers: Readonly<Record<string, string>>): void {\n if (response.destroyed)\n return;\n response.writeHead(status, { \"content-type\": contentType, ...headers });\n response.end(body);\n}\nfunction redirect(response: ServerResponse, location: string, headers: Readonly<Record<string, string>>): void {\n if (response.destroyed)\n return;\n response.writeHead(308, { location, ...headers });\n response.end();\n}\nconst SAFE_MEDIA_TYPE = /^[A-Za-z0-9!#$%&'*+.^_`|~-]+\\/[A-Za-z0-9!#$%&'*+.^_`|~-]+$/;\nfunction siteContentType(mediaType: string): string {\n const base = mediaType.split(\";\", 1)[0]?.trim() ?? \"\";\n return SAFE_MEDIA_TYPE.test(base) ? base : \"application/octet-stream\";\n}\nfunction viewUrls(host: string, port: number): readonly string[] {\n if (host === \"0.0.0.0\") {\n return urlsForAddresses([\n \"127.0.0.1\",\n ...interfaceAddresses(\"IPv4\"),\n ], port);\n }\n if (host === \"::\") {\n return urlsForAddresses([\n \"::1\",\n ...interfaceAddresses(\"IPv6\"),\n ], port);\n }\n return Object.freeze([viewUrl(host, port)]);\n}\nfunction interfaceAddresses(family: \"IPv4\" | \"IPv6\"): readonly string[] {\n const addresses: string[] = [];\n for (const entries of Object.values(networkInterfaces())) {\n for (const entry of entries ?? []) {\n if (entry.family === family &&\n !entry.internal &&\n !entry.address.includes(\"%\") &&\n (family !== \"IPv6\" || entry.scopeid === 0)) {\n addresses.push(entry.address);\n }\n }\n }\n return addresses.sort((left, right) => left.localeCompare(right));\n}\nfunction urlsForAddresses(addresses: readonly string[], port: number): readonly string[] {\n return Object.freeze([...new Set(addresses)].map((address) => viewUrl(address, port)));\n}\nfunction viewUrl(host: string, port: number): string {\n return new URL(`http://${formatHost(host)}:${port}/`).toString();\n}\nfunction requestAuthority(value: string | undefined): string | undefined {\n if (value === undefined)\n return undefined;\n try {\n const url = new URL(`http://${value}`);\n if (url.username.length > 0 || url.password.length > 0)\n return undefined;\n return url.host;\n }\n catch {\n return undefined;\n }\n}\nfunction formatHost(host: string): string {\n return host.includes(\":\") ? `[${host}]` : host;\n}\nfunction serverError(operation: NodeViewServerError[\"operation\"], reason: string): NodeViewServerError {\n return Object.freeze({ code: \"report-view-server-failed\", operation, reason });\n}\nfunction asError(error: unknown): Error {\n return error instanceof Error ? error : new Error(String(error));\n}\nfunction isMissingPath(error: unknown): boolean {\n if (typeof error !== \"object\" || error === null)\n return false;\n const code = Reflect.get(error, \"code\");\n return code === \"ENOENT\" || code === \"ENOTDIR\";\n}\n"]}
|
|
@@ -25,7 +25,7 @@ Ponytail 这一组迁移自第三方 Plugin 的 Agentic Benchmark,但这个仓
|
|
|
25
25
|
```text
|
|
26
26
|
coding-agent-skill/
|
|
27
27
|
├── skills/ # 各 Arm 注入的内容
|
|
28
|
-
├── workspaces/ts-starter/ #
|
|
28
|
+
├── workspaces/ts-starter/ # 每个评估用例的初始项目
|
|
29
29
|
├── evals/ # 真实开发任务与验证
|
|
30
30
|
├── experiments/ # Baseline 和实验 Arm
|
|
31
31
|
└── reports/benchmark.tsx # Arm × Metric 自定义报告
|
|
@@ -13,6 +13,7 @@ description: "一个 AI SDK v7 聊天应用,对着它的 HTTP 接口无侵入
|
|
|
13
13
|
|
|
14
14
|
**接入方式**:内置的 `uiMessageStreamAgent` 可以直接连接 AI SDK UI Message Stream,也就是 `useChat` 后端使用的标准 SSE 协议。
|
|
15
15
|
Adapter 只需填写接口地址,并说明如何把 `model` 放进请求体。NiceEval 会处理会话重放、HITL 审批,以及工具和消息事件。
|
|
16
|
+
Endpoint 必须像标准 AI SDK 实现一样用 `data: [DONE]` 结束响应。自定义兼容 endpoint 若省略该标记,NiceEval 会把响应视为截断并返回 send failure;升级前请补上结束记录。
|
|
16
17
|
|
|
17
18
|
这个协议不提供用量数据,因此示例没有用量断言。接入过程没有修改应用的 `src/backend/*`。
|
|
18
19
|
|
|
@@ -71,7 +71,7 @@ langgraph/
|
|
|
71
71
|
<div className="gd-file">
|
|
72
72
|
<div className="gd-head"><span className="gd-name">{"niceeval.config.ts"}</span><span className="gd-stats"><span className="gd-plus">{"+13"}</span></span></div>
|
|
73
73
|
<div className="gd-body">
|
|
74
|
-
<table className="gd-table"><tbody><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"1"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt4">{"import"}</span><span className="gdt0">{" { defineConfig } "}</span><span className="gdt4">{"from"}</span><span className="gdt0">{" "}</span><span className="gdt2">{"\"niceeval\""}</span><span className="gdt0">{";"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"2"}</td><td className="gd-sign">{"+"}</td><td className="gd-code">{" "}</td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"3"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt6">{"// 注:这个 app 的 .env 把标准的 OPENAI_API_KEY / OPENAI_BASE_URL 挪用给了 DeepSeek"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"4"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt6">{"// (agent.py 里 ChatOpenAI 直接读这两个 env 名)。niceeval 的 judge(t.judge.autoevals.*)"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"5"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt6">{"// 不碰这两个名字:端点写在 judge.baseUrl
|
|
74
|
+
<table className="gd-table"><tbody><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"1"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt4">{"import"}</span><span className="gdt0">{" { defineConfig } "}</span><span className="gdt4">{"from"}</span><span className="gdt0">{" "}</span><span className="gdt2">{"\"niceeval\""}</span><span className="gdt0">{";"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"2"}</td><td className="gd-sign">{"+"}</td><td className="gd-code">{" "}</td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"3"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt6">{"// 注:这个 app 的 .env 把标准的 OPENAI_API_KEY / OPENAI_BASE_URL 挪用给了 DeepSeek"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"4"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt6">{"// (agent.py 里 ChatOpenAI 直接读这两个 env 名)。niceeval 的 judge(t.judge.autoevals.*)"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"5"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt6">{"// 不碰这两个名字:端点写在 judge.baseUrl,并用 judge.apiKeyEnv 显式改读"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"6"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt6">{"// NICEEVAL_JUDGE_KEY;judge 走独立凭证,不和应用的模型配置互相干扰。"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"7"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt4">{"export"}</span><span className="gdt0">{" "}</span><span className="gdt4">{"default"}</span><span className="gdt0">{" "}</span><span className="gdt5">{"defineConfig"}</span><span className="gdt0">{"({"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"8"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt0">{" name: { "}</span><span className="gdt2">{"\"zh-CN\""}</span><span className="gdt0">{": "}</span><span className="gdt2">{"\"LangGraph 示例\""}</span><span className="gdt0">{", en: "}</span><span className="gdt2">{"\"LangGraph example\""}</span><span className="gdt0">{" },"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"9"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt0">{" judge: { model: "}</span><span className="gdt2">{"\"gpt-5.4\""}</span><span className="gdt0">{", apiKeyEnv: "}</span><span className="gdt2">{"\"NICEEVAL_JUDGE_KEY\""}</span><span className="gdt0">{" },"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"10"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt0">{" timeoutMs: "}</span><span className="gdt1">{"120_000"}</span><span className="gdt0">{","}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"11"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt0">{" "}</span><span className="gdt6">{"// 被测应用是用户自己起的长驻服务,别开太高并发。"}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"12"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt0">{" maxConcurrency: "}</span><span className="gdt1">{"2"}</span><span className="gdt0">{","}</span></td></tr><tr className="gd-add"><td className="gd-ln"></td><td className="gd-ln">{"13"}</td><td className="gd-sign">{"+"}</td><td className="gd-code"><span className="gdt0">{"});"}</span></td></tr></tbody></table>
|
|
75
75
|
</div>
|
|
76
76
|
</div>
|
|
77
77
|
|
|
@@ -43,9 +43,9 @@ turn.calledTool("read_file", { count: 2 }).label("读取两次");
|
|
|
43
43
|
|
|
44
44
|
`calledTool` 的第二参数只控制 `count`。`input`、`output` 与 `status` 条件写进 `toolMatch`;JSON 结构交给 `jsonMatch`,命令 token 交给 `commandMatch`。`notCalledTool` 直接接收同一类 matcher。
|
|
45
45
|
|
|
46
|
-
##
|
|
46
|
+
## 两种评估用例
|
|
47
47
|
|
|
48
|
-
`defineEval`
|
|
48
|
+
`defineEval` 创建通过制评估。Boolean `matched` 进入 Attempt Verdict;`mismatched` 使最终 Verdict 为 `failed`,但不会阻止后续检查继续登记。连续 evaluator 与 Judge recipe 给出 `[0,1]` measurement;通过制评估使用 `.gate(n)` 才把它纳入 failed;`.atLeast(n)` 只记录局部 condition。
|
|
49
49
|
|
|
50
50
|
```ts
|
|
51
51
|
turn.judge.autoevals.closedQA("回答是否给出可执行步骤?")
|
|
@@ -53,7 +53,7 @@ turn.judge.autoevals.closedQA("回答是否给出可执行步骤?")
|
|
|
53
53
|
.label("步骤可执行");
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
`defineScoreEval`
|
|
56
|
+
`defineScoreEval` 创建计分制评估。它只有累计 `score`,没有 Attempt Verdict、总分、百分比或另一种数值单位。Assertion 默认只保存 evaluation,不计分;用 `.score(n)` 才让已有 Assertion 贡献 score。Boolean matched 贡献 `n`,mismatched 贡献 `0`;measurement `m` 贡献 `m * n`。`t.score(n)` 直接登记 contribution,返回的 handle 只能配置 `key` 与 `label`。
|
|
57
57
|
|
|
58
58
|
```ts
|
|
59
59
|
turn.calledTool("search"); // 只保存 evaluation
|
|
@@ -62,7 +62,7 @@ turn.judge.autoevals.closedQA("回答完整").score(5); // measurement 0.8 时 +
|
|
|
62
62
|
t.score(5); // 直接 +5
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
计分制评估的 measurement 不必 threshold 就能封口。`.atLeast(n)` 只增加局部 `met` / `below` condition,不改变 contribution。没有 `.score()` 的 Assertion 不显示 `+0`;正常没有计分项的计分制评估得到正式且可排名的 `score: 0`。
|
|
66
66
|
|
|
67
67
|
## 控制流
|
|
68
68
|
|
|
@@ -74,11 +74,11 @@ await turn.succeeded().orStop();
|
|
|
74
74
|
const search = await t.check(turn.message, includes("结论")).orStop();
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
正常 stop
|
|
77
|
+
正常 stop 后,通过制评估仍按触发 Assertion 得到 `failed` Verdict;计分制评估仍是 `scored`,保留正式 score 和 stop cause,因此可以排名。
|
|
78
78
|
|
|
79
79
|
## Judge
|
|
80
80
|
|
|
81
|
-
Judge recipe 调用时直接登记 measurement Assertion
|
|
81
|
+
Judge recipe 调用时直接登记 measurement Assertion。通过制评估对同一 handle 用 `.gate(n)`,计分制评估用 `.score(n)`;两种配置都只运行一次 Judge evaluator。材料、配置和失败语义见 [Judge](/zh/explanation/judge)。
|
|
82
82
|
|
|
83
83
|
## 不可用与读取
|
|
84
84
|
|
|
@@ -8,7 +8,7 @@ description: "t.send() 和它返回的 Turn、t.sendFile()、多轮对话、t.ne
|
|
|
8
8
|
|
|
9
9
|
## `t.send()` 和它返回的 `Turn`
|
|
10
10
|
|
|
11
|
-
`t.send(input)`
|
|
11
|
+
`t.send(input)` 是 Adapter 的基础执行动词。它底层调用 Adapter 的 `send(input, ctx)`,把返回值归一成一个 `Turn`:
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
14
|
const turn = await t.send("布鲁克林今天天气怎么样?");
|
|
@@ -4,7 +4,7 @@ sidebarTitle: "评估"
|
|
|
4
4
|
description: "评估用例是一个测试用例:描述和 test 函数,agent-neutral。了解评估用例如何被发现、调度、评分和报告。"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
一个评估用例是一个可运行的测试用例。它通常由一个 `*.eval.ts` 文件导出,通过 `defineEval` 声明。
|
|
8
8
|
|
|
9
9
|
## 评估用例的组成
|
|
10
10
|
|
|
@@ -31,7 +31,7 @@ export default defineEval({
|
|
|
31
31
|
| 字段 | 说明 |
|
|
32
32
|
|---|---|
|
|
33
33
|
| `description` | 给人看的描述,出现在报告里 |
|
|
34
|
-
| `
|
|
34
|
+
| `sandbox` | 评估用例拥有的可选 Sandbox layer;Experiment 提供 template-bearing layer 时省略 |
|
|
35
35
|
| `test(t)` | 交互和断言逻辑 |
|
|
36
36
|
|
|
37
37
|
评估用例本身不声明用哪个 Agent——它默认保持 agent-neutral,同一个评估用例可以在不同 experiment 下跑不同 Agent。选哪个 Agent 是 experiment 的字段,不由 CLI 临时覆盖。
|
|
@@ -67,7 +67,7 @@ npx niceeval exp local weather/brooklyn
|
|
|
67
67
|
[NiceEval](https://niceeval.com/) 收集值断言、作用域断言与 Judge measurement,并登记 score contribution。
|
|
68
68
|
</Step>
|
|
69
69
|
<Step title="终态">
|
|
70
|
-
|
|
70
|
+
通过制评估把断言结果折叠成最终 Verdict;计分制评估累计正式 score。
|
|
71
71
|
</Step>
|
|
72
72
|
<Step title="Report">
|
|
73
73
|
控制台和 reporters 输出结果,事实同时提交进 `.niceeval/` Record 根。
|
|
@@ -76,14 +76,14 @@ npx niceeval exp local weather/brooklyn
|
|
|
76
76
|
|
|
77
77
|
## Verdict 类型
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
通过制评估的 Attempt 终态只有四种:
|
|
80
80
|
|
|
81
81
|
<CardGroup cols={2}>
|
|
82
82
|
<Card title="passed" icon="circle-check" color="#22c55e">
|
|
83
|
-
所有 Boolean Assertion 都 matched,所有 measurement 都达到 `
|
|
83
|
+
所有 Boolean Assertion 都 matched,所有 gated measurement 都达到 `.gate(n)` 阈值,并且没有执行错误。
|
|
84
84
|
</Card>
|
|
85
85
|
<Card title="failed" icon="circle-xmark" color="#ef4444">
|
|
86
|
-
至少一个 Boolean condition mismatched,或 measurement
|
|
86
|
+
至少一个 Boolean condition mismatched,或 measurement 低于明确的 `.gate(n)` 阈值。
|
|
87
87
|
</Card>
|
|
88
88
|
<Card title="errored" icon="triangle-exclamation" color="#f59e0b">
|
|
89
89
|
执行异常、超时或作者错误,本次执行无法形成可信结论。
|
|
@@ -93,13 +93,13 @@ Pass Eval 的 Attempt 终态只有四种:
|
|
|
93
93
|
</Card>
|
|
94
94
|
</CardGroup>
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
计分制评估的主读数是累计 earned score,分数越高越好。正常没有计分项时 score 为 `0`。默认报告显示 earned score,不把正常封口状态算进通过率。
|
|
97
97
|
|
|
98
|
-
`.score(points)` 中的 `points` 是单项贡献权重,不是固定总分。默认报告不会把 earned score 自动换算成百分比。一个 Experiment
|
|
98
|
+
`.score(points)` 中的 `points` 是单项贡献权重,不是固定总分。默认报告不会把 earned score 自动换算成百分比。一个 Experiment 同时包含通过制评估与计分制评估时,报告分别显示两种主读数。
|
|
99
99
|
|
|
100
100
|
## 判定与测量值
|
|
101
101
|
|
|
102
|
-
Boolean `matched` 默认进入 Verdict。连续测量值与 Judge 输出是 `[0, 1]` 的 measurement
|
|
102
|
+
Boolean `matched` 默认进入 Verdict。连续测量值与 Judge 输出是 `[0, 1]` 的 measurement;通过制评估使用 `.gate(n)` 才把它纳入 failed,`.atLeast(n)` 只记录局部 condition。完整规则见 [Assert](/zh/explanation/assert)。
|
|
103
103
|
|
|
104
104
|
## `*.eval.ts` 约定
|
|
105
105
|
|
|
@@ -31,11 +31,11 @@ Experiment 还有一对实验级 Hook `setup` / `teardown`:整个实验只跑
|
|
|
31
31
|
|
|
32
32
|
要按实验在 Sandbox 里准备环境,把操作挂在 `sandbox` 字段的 spec 上。`dockerSandbox({ source: { type: "image", image: "node:24-slim" } })` 等工厂返回的对象可以链 `.setup()` / `.teardown()`。两者的边界与写法见[写实验 · 启动 Experiment 共享服务](/zh/tutorials/write-experiment#启动-experiment-共享服务)与[Sandbox provider · 生命周期](/zh/tutorials/sandbox-providers#生命周期)。
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
同一实验里的评估用例需要不同预制环境时,把对应的 template-bearing `sandbox` layer 直接放在各评估用例上,并让 Experiment 不再提供 template。重复 layer 用普通 TypeScript 辅助函数复用;这里没有 environment profile registry。同一个 Experiment 仍能覆盖全部评估用例,因为 link planning 会逐条把评估用例 layer 与 Experiment layer 配对。写法见[写实验 · 让不同评估用例使用不同预制环境](/zh/tutorials/write-experiment#让不同评估用例使用不同预制环境)。
|
|
35
35
|
|
|
36
36
|
## 矩阵对比
|
|
37
37
|
|
|
38
|
-
要比较的每个变体写一个 experiment 文件:两个模型就是两个文件,只差 `model` 一行。prompt A/B
|
|
38
|
+
要比较的每个变体写一个 experiment 文件:两个模型就是两个文件,只差 `model` 一行。prompt A/B 就是只差一个参数。同一批评估用例在多个 experiment 下各跑一遍,pass rate、成本、延迟就有了可比的横截面——`niceeval view` 里叠着看。适合比什么、结果怎么读,见[实验矩阵](/zh/tutorials/experiments)。
|
|
39
39
|
|
|
40
40
|
## 相关阅读
|
|
41
41
|
|
|
@@ -20,7 +20,7 @@ HITL(human-in-the-loop,人工介入)指 agent 在执行中间停下来,
|
|
|
20
20
|
|
|
21
21
|
`send` 返回的 `Turn.status` 有三个值:`"completed"`(跑完了)、`"failed"`(出错了)、`"waiting"`——**这一轮没跑完,agent 停在等人输入上**。waiting 不是失败,是挂起:回答到达后同一轮接着跑,不重发请求、不开新对话。
|
|
22
22
|
|
|
23
|
-
停下的轮次还要同时说明"在等什么":每个待回答的问题吐一条 `input.requested` 事件,带一个稳定的请求 `id`、停在哪个动作上(`action`)、可选的裁决项(`options`,如 approve / deny)。状态和事件缺一不可——`waiting`
|
|
23
|
+
停下的轮次还要同时说明"在等什么":每个待回答的问题吐一条 `input.requested` 事件,带一个稳定的请求 `id`、停在哪个动作上(`action`)、可选的裁决项(`options`,如 approve / deny)。状态和事件缺一不可——`waiting` 让评估用例知道该回答了,`input.requested` 让回答有的放矢。
|
|
24
24
|
|
|
25
25
|
## 一次完整握手
|
|
26
26
|
|
|
@@ -63,7 +63,7 @@ HITL 对 Adapter 的全部要求就三件事——前两件发生在停下的那
|
|
|
63
63
|
|
|
64
64
|
"挂起的现场"(比如读了一半的 SSE 流)存在本会话线的 `ctx.session` 上。Adapter 用 `createSessionSlot<Pending>()` 声明私有 slot,停轮时 `ctx.session.set(slot, pending)`,回答轮 `ctx.session.take(slot)` 取回,取到即清除。怎么和流式驱动拼起来,见[写 send](/zh/tutorials/write-send#第五步:hitl) 第五步的完整骨架。
|
|
65
65
|
|
|
66
|
-
和 [NiceEval](https://niceeval.com/) 的其它能力一样,HITL 没有布尔声明:**做到了就是有**。send 返回过 `"waiting"` 并吐了 `input.requested`,`t.respond`
|
|
66
|
+
和 [NiceEval](https://niceeval.com/) 的其它能力一样,HITL 没有布尔声明:**做到了就是有**。send 返回过 `"waiting"` 并吐了 `input.requested`,`t.respond` 就能工作。没做到,评估用例会在状态检查或 `requireInputRequest()` 上明确失败,而不是静默假通过。能力如何从构造中来,见 [Adapter](/zh/explanation/adapter#能力从哪来:构造证明,不是问卷)。
|
|
67
67
|
|
|
68
68
|
## 拒绝不是故障
|
|
69
69
|
|
|
@@ -71,7 +71,7 @@ HITL 对 Adapter 的全部要求就三件事——前两件发生在停下的那
|
|
|
71
71
|
|
|
72
72
|
## 哪些 agent 用不到 HITL
|
|
73
73
|
|
|
74
|
-
不是每个 agent 都有这条分支,没有就整个跳过——Adapter 不用管 `waiting
|
|
74
|
+
不是每个 agent 都有这条分支,没有就整个跳过——Adapter 不用管 `waiting`,评估用例里也不会出现 `t.respond`:
|
|
75
75
|
|
|
76
76
|
- **每轮一口气跑完的 agent**:问答、检索、翻译这类单发即回的服务,执行中没有等人的环节。
|
|
77
77
|
- **审批门被关掉的运行形态**:Claude Code、Codex 产品本身是 HITL 的,但作为被测对象在 Sandbox 里通常全自动跑(跳过权限确认)——内置的 `claude-code` / `codex` / `bub` sandbox agent 就是这样,所以它们都不做 HITL。
|
|
@@ -44,7 +44,7 @@ t.judge.autoevals.closedQA("文档是否说明了安装和回滚?", {
|
|
|
44
44
|
|
|
45
45
|
## 声明 capability 和配置
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
只有评估用例声明了 `judge` 才能创建 Judge Assertion:
|
|
48
48
|
|
|
49
49
|
```ts
|
|
50
50
|
export default defineEval({
|
|
@@ -72,12 +72,12 @@ export default defineConfig({
|
|
|
72
72
|
});
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
字段优先级是评估用例对象、Experiment、项目配置。未指定时,`baseUrl` 为 OpenAI 兼容端点,`apiKeyEnv` 为 `OPENAI_API_KEY`,`timeoutMs` 为 180000 毫秒。
|
|
76
76
|
运行器把解析结果冻结一次,并将同一份配置用于指纹、预检和实际 evaluator。
|
|
77
77
|
|
|
78
78
|
## 阈值与分数
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
通过制评估用 `.gate(n)` 把 Judge measurement 纳入 failed;`.atLeast(n)` 只记录局部 condition。
|
|
81
81
|
|
|
82
82
|
```ts
|
|
83
83
|
const quality = turn.judge.autoevals.closedQA("回答是否准确且完整?")
|
|
@@ -88,7 +88,7 @@ await quality.orStop();
|
|
|
88
88
|
|
|
89
89
|
`.orStop()` 是同一 handle 的 async barrier。低于阈值时它停止当前 continuation;正常 stop 后 Attempt 仍得到 `failed` Verdict。
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
计分制评估直接调用 `.score(n)`:measurement `m` 贡献 `m * n`。`.atLeast(n)` 只增加局部 condition,可以单独配置,也可以与 `.score(n)` 同一条 Assertion 共存。
|
|
92
92
|
|
|
93
93
|
```ts
|
|
94
94
|
turn.judge.autoevals.closedQA("回答质量如何?").score(20).atLeast(0.5);
|
|
@@ -110,6 +110,6 @@ Judge 给出的理由写入通用 `explanation`。`evidence` 只保存裁剪、
|
|
|
110
110
|
|
|
111
111
|
## 相关阅读
|
|
112
112
|
|
|
113
|
-
- [Assertion 与 Match](/zh/explanation/assert) —
|
|
113
|
+
- [Assertion 与 Match](/zh/explanation/assert) — 调用即登记与两种评估用例。
|
|
114
114
|
- [通过制与计分制](/zh/tutorials/evaluation-kinds) — `atLeast` 与 `score` 的选择。
|
|
115
115
|
- [驱动](/zh/explanation/drive) — Turn、session 与跨轮材料。
|
|
@@ -7,7 +7,7 @@ description: "理解 Experiment、Record、Analysis 与 Report 如何组成一
|
|
|
7
7
|
NiceEval 把评估定义、运行、已发布结果和报告分成清楚的职责。你定义评估用例与 Experiment,Runner 执行它们;完整 Run 发布到 Record;查看和分享时,Analysis 从选中的结果形成闭合值,Report 再把这些值组织成页面。
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
|
-
|
|
10
|
+
评估用例与 Experiment
|
|
11
11
|
↓
|
|
12
12
|
Runner
|
|
13
13
|
↓
|
|
@@ -24,7 +24,7 @@ Report
|
|
|
24
24
|
|
|
25
25
|
## 评估如何运行
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
评估用例定义任务、断言和需要的 Fixture。Experiment 选择评估用例,并声明 Agent、模型、并发、预算与其他运行条件。Adapter 连接被测系统;Sandbox 提供隔离的执行位置。
|
|
28
28
|
|
|
29
29
|
Runner 为每个选中的 Experiment 建立一个 Run。Run 列出本次应有的位置,因此它定义结果计算的分母。每个位置最多有一个 Member。
|
|
30
30
|
|
|
@@ -40,7 +40,7 @@ Record 是可携带、可复制并可进入 Git 的已发布结果集。应用
|
|
|
40
40
|
|
|
41
41
|
用户用不带 locator 或 `--run` 的命令选择仍匹配当前项目的结果,或用 locator、`--run` 选择历史事实。NiceEval 根据这个选择形成 `Sample`,它保留完整的预期范围和分母,但不允许页面重新选择或重新打开结果。
|
|
42
42
|
|
|
43
|
-
`project-current` 扫描所有已发布 Run,只保留 Experiment
|
|
43
|
+
`project-current` 扫描所有已发布 Run,只保留 Experiment、评估用例和执行身份仍匹配当前项目的位置。它不按时间只留一个 Run。
|
|
44
44
|
|
|
45
45
|
`--run` 保留具名 Run 的完整预期范围。每个已选位置都是 `included`、`not-recorded`、`core-invalid` 或 `excluded`。选择建立框架后,缺少分析输入不会悄悄缩小分母。
|
|
46
46
|
|