niceeval 0.9.1 → 0.10.0
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 +31 -33
- package/dist/agents/types.d.ts +20 -17
- package/dist/context/types.d.ts +21 -21
- package/dist/i18n/en.d.ts +10 -2
- package/dist/i18n/zh-CN.d.ts +14 -6
- package/dist/o11y/execution-tree.d.ts +103 -0
- package/dist/o11y/otlp/select.d.ts +22 -0
- package/dist/report/{react → assets}/colors.d.ts +8 -0
- package/dist/report/{react → assets}/colors.js +23 -0
- package/dist/report/built-in/index.d.ts +2 -2
- package/dist/report/built-in/index.js +2 -2
- package/dist/report/built-in/standard.d.ts +8 -1
- package/dist/report/built-in/standard.js +17 -7
- package/dist/report/components/attempt-detail/AttemptAssertions.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptAssertions.js +17 -0
- package/dist/report/components/attempt-detail/AttemptConversation.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptConversation.js +34 -0
- package/dist/report/components/attempt-detail/AttemptDiagnostics.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptDiagnostics.js +7 -0
- package/dist/report/components/attempt-detail/AttemptDiff.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptDiff.js +11 -0
- package/dist/report/components/attempt-detail/AttemptError.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptError.js +16 -0
- package/dist/report/components/attempt-detail/AttemptFixPrompt.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptFixPrompt.js +7 -0
- package/dist/report/components/attempt-detail/AttemptSource.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptSource.js +27 -0
- package/dist/report/components/attempt-detail/AttemptSummary.d.ts +8 -0
- package/dist/report/components/attempt-detail/AttemptSummary.js +20 -0
- package/dist/report/components/attempt-detail/AttemptTimeline.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptTimeline.js +28 -0
- package/dist/report/components/attempt-detail/AttemptTrace.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptTrace.js +29 -0
- package/dist/report/components/attempt-detail/AttemptUsage.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptUsage.js +20 -0
- package/dist/report/components/attempt-detail/compute.d.ts +24 -0
- package/dist/report/components/attempt-detail/compute.js +254 -0
- package/dist/report/components/attempt-detail/faces.d.ts +14 -0
- package/dist/report/components/attempt-detail/faces.js +235 -0
- package/dist/report/components/attempt-detail/index.d.ts +38 -0
- package/dist/report/components/attempt-detail/index.js +527 -0
- package/dist/report/{react → components}/cell.d.ts +5 -3
- package/dist/report/{react → components}/cell.js +3 -3
- package/dist/report/{react → components/entity-lists}/AttemptList.d.ts +8 -4
- package/dist/report/{react → components/entity-lists}/AttemptList.js +16 -10
- package/dist/report/{react → components/entity-lists}/EvalList.d.ts +3 -3
- package/dist/report/{react → components/entity-lists}/EvalList.js +0 -0
- package/dist/report/{react → components/entity-lists}/ExperimentList.d.ts +3 -3
- package/dist/report/{react → components/entity-lists}/ExperimentList.js +10 -10
- package/dist/report/components/entity-lists/compute.d.ts +23 -0
- package/dist/report/components/entity-lists/compute.js +171 -0
- package/dist/report/components/entity-lists/faces.d.ts +5 -0
- package/dist/report/components/entity-lists/faces.js +174 -0
- package/dist/report/components/entity-lists/index.d.ts +51 -0
- package/dist/report/components/entity-lists/index.js +165 -0
- package/dist/report/{react → components}/fixtures.d.ts +2 -2
- package/dist/report/{react → components}/fixtures.js +1 -1
- package/dist/report/{react → components/metric-views}/DeltaTable.d.ts +2 -2
- package/dist/report/{react → components/metric-views}/DeltaTable.js +4 -4
- package/dist/report/{react → components/metric-views}/MetricBars.d.ts +3 -3
- package/dist/report/{react → components/metric-views}/MetricBars.js +3 -3
- package/dist/report/{react → components/metric-views}/MetricLine.d.ts +2 -2
- package/dist/report/{react → components/metric-views}/MetricLine.js +8 -5
- package/dist/report/{react → components/metric-views}/MetricMatrix.d.ts +3 -3
- package/dist/report/{react → components/metric-views}/MetricMatrix.js +4 -4
- package/dist/report/components/metric-views/MetricScatter.d.ts +11 -0
- package/dist/report/{react → components/metric-views}/MetricScatter.js +26 -23
- package/dist/report/{react → components/metric-views}/MetricTable.d.ts +3 -3
- package/dist/report/{react → components/metric-views}/MetricTable.js +4 -4
- package/dist/report/{react → components/metric-views}/Scoreboard.d.ts +2 -2
- package/dist/report/{react → components/metric-views}/Scoreboard.js +3 -3
- package/dist/report/components/metric-views/compute.d.ts +89 -0
- package/dist/report/{compute.js → components/metric-views/compute.js} +32 -415
- package/dist/report/components/metric-views/faces.d.ts +13 -0
- package/dist/report/components/metric-views/faces.js +381 -0
- package/dist/report/components/metric-views/index.d.ts +50 -0
- package/dist/report/components/metric-views/index.js +273 -0
- package/dist/report/{text → components/metric-views}/plot.js +1 -1
- package/dist/report/components/shared-compute.d.ts +22 -0
- package/dist/report/components/shared-compute.js +47 -0
- package/dist/report/components/shared-faces.d.ts +9 -0
- package/dist/report/components/shared-faces.js +26 -0
- package/dist/report/components/shared.d.ts +68 -0
- package/dist/report/components/shared.js +125 -0
- package/dist/report/{react → components/site-components}/CopyFixPrompt.d.ts +2 -2
- package/dist/report/{react → components/site-components}/CopyFixPrompt.js +2 -2
- package/dist/report/{react → components/site-components}/HeroCard.d.ts +2 -2
- package/dist/report/{react → components/site-components}/HeroCard.js +2 -2
- package/dist/report/{react → components/site-components}/ScopeWarnings.d.ts +2 -2
- package/dist/report/{react → components/site-components}/ScopeWarnings.js +3 -3
- package/dist/report/{react → components/site-components}/TraceWaterfall.d.ts +3 -3
- package/dist/report/{react → components/site-components}/TraceWaterfall.js +5 -5
- package/dist/report/components/site-components/compute.d.ts +28 -0
- package/dist/report/components/site-components/compute.js +132 -0
- package/dist/report/components/site-components/faces.d.ts +21 -0
- package/dist/report/components/site-components/faces.js +75 -0
- package/dist/report/components/site-components/index.d.ts +74 -0
- package/dist/report/components/site-components/index.js +220 -0
- package/dist/report/{scope-warnings.d.ts → components/site-components/scope-warnings.d.ts} +2 -2
- package/dist/report/{scope-warnings.js → components/site-components/scope-warnings.js} +2 -2
- package/dist/report/{react → components/summaries}/ScopeSummary.d.ts +2 -2
- package/dist/report/{react → components/summaries}/ScopeSummary.js +17 -8
- package/dist/report/components/summaries/compute.d.ts +7 -0
- package/dist/report/components/summaries/compute.js +51 -0
- package/dist/report/components/summaries/faces.d.ts +7 -0
- package/dist/report/components/summaries/faces.js +38 -0
- package/dist/report/components/summaries/index.d.ts +27 -0
- package/dist/report/components/summaries/index.js +78 -0
- package/dist/report/definition/grid-layout.d.ts +50 -0
- package/dist/report/definition/grid-layout.js +89 -0
- package/dist/report/{primitives.d.ts → definition/primitives.d.ts} +34 -4
- package/dist/report/{primitives.js → definition/primitives.js} +101 -10
- package/dist/report/{report.d.ts → definition/report.d.ts} +36 -65
- package/dist/report/{report.js → definition/report.js} +58 -90
- package/dist/report/{text/table.d.ts → definition/table-text.d.ts} +2 -2
- package/dist/report/{text/table.js → definition/table-text.js} +2 -2
- package/dist/report/{tree.d.ts → definition/tree.d.ts} +43 -11
- package/dist/report/{tree.js → definition/tree.js} +9 -11
- package/dist/report/index.d.ts +33 -18
- package/dist/report/index.js +23 -14
- package/dist/report/{aggregate.d.ts → model/aggregate.d.ts} +12 -4
- package/dist/report/{aggregate.js → model/aggregate.js} +28 -8
- package/dist/report/{flag.d.ts → model/flag.d.ts} +14 -1
- package/dist/report/{flag.js → model/flag.js} +35 -0
- package/dist/report/{format.d.ts → model/format.d.ts} +11 -5
- package/dist/report/{format.js → model/format.js} +48 -4
- package/dist/report/{locale.d.ts → model/locale.d.ts} +17 -17
- package/dist/report/{locale.js → model/locale.js} +31 -33
- package/dist/report/{metrics.d.ts → model/metrics.d.ts} +2 -2
- package/dist/report/{metrics.js → model/metrics.js} +2 -2
- package/dist/report/{types.d.ts → model/types.d.ts} +140 -20
- package/dist/report/react/index.d.ts +32 -21
- package/dist/report/react/index.js +33 -21
- package/dist/report/{load.d.ts → runtime/load.d.ts} +1 -1
- package/dist/report/{load.js → runtime/load.js} +1 -1
- package/dist/report/runtime/text.d.ts +67 -0
- package/dist/report/runtime/text.js +114 -0
- package/dist/report/runtime/web.d.ts +35 -0
- package/dist/report/runtime/web.js +70 -0
- package/dist/results/annotated-source.d.ts +87 -0
- package/dist/results/attempt-evidence.d.ts +74 -0
- package/dist/results/attempt-source.d.ts +15 -0
- package/dist/results/select.d.ts +11 -1
- package/dist/results/select.js +27 -5
- package/dist/runner/eval-selection.d.ts +26 -0
- package/dist/runner/feedback/sink.d.ts +26 -1
- package/dist/runner/types.d.ts +149 -23
- package/dist/sandbox/docker.d.ts +6 -0
- package/dist/sandbox/types.d.ts +23 -21
- package/dist/scoring/display.d.ts +7 -2
- package/dist/scoring/display.js +42 -4
- package/dist/scoring/types.d.ts +3 -3
- package/dist/shared/aggregate.d.ts +14 -0
- package/dist/shared/aggregate.js +31 -0
- package/dist/shared/types.d.ts +6 -1
- package/docs-site/images/logo-dark.svg +7 -0
- package/docs-site/images/logo.svg +6 -5
- package/docs-site/zh/README.md +8 -7
- package/docs-site/zh/examples/ai-agent-application.mdx +5 -5
- package/docs-site/zh/examples/coding-agent-extensions.mdx +4 -4
- package/docs-site/zh/examples/index.mdx +3 -3
- package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +1 -1
- package/docs-site/zh/examples/integrations/claude-sdk.mdx +3 -3
- package/docs-site/zh/examples/integrations/codex-sdk.mdx +3 -3
- package/docs-site/zh/examples/integrations/langgraph.mdx +3 -3
- package/docs-site/zh/examples/integrations/pi-sdk.mdx +2 -2
- package/docs-site/zh/explanation/adapter.mdx +19 -19
- package/docs-site/zh/explanation/assert.mdx +9 -9
- package/docs-site/zh/explanation/drive.mdx +4 -4
- package/docs-site/zh/explanation/evals.mdx +8 -8
- package/docs-site/zh/explanation/experiment.mdx +8 -8
- package/docs-site/zh/explanation/hitl.mdx +13 -13
- package/docs-site/zh/explanation/judge.mdx +3 -3
- package/docs-site/zh/explanation/overview.mdx +7 -7
- package/docs-site/zh/explanation/runner.mdx +11 -11
- package/docs-site/zh/explanation/tier.mdx +6 -6
- package/docs-site/zh/index.mdx +14 -14
- package/docs-site/zh/introduction.mdx +13 -16
- package/docs-site/zh/reference/builtin-agents.mdx +61 -28
- package/docs-site/zh/reference/capabilities.mdx +7 -27
- package/docs-site/zh/reference/cli.mdx +35 -32
- package/docs-site/zh/reference/define-agent.mdx +32 -31
- package/docs-site/zh/reference/define-config.mdx +6 -6
- package/docs-site/zh/reference/define-eval.mdx +33 -20
- package/docs-site/zh/reference/events.mdx +4 -4
- package/docs-site/zh/reference/expect.mdx +3 -3
- package/docs-site/zh/reference/official-adapters.mdx +17 -17
- package/docs-site/zh/reference/report-components.mdx +193 -121
- package/docs-site/zh/reference/results-data.mdx +13 -13
- package/docs-site/zh/troubleshooting/debug-sandbox.mdx +11 -11
- package/docs-site/zh/troubleshooting/debugging.mdx +40 -16
- package/docs-site/zh/{how-to → tutorials}/agent-feedback-loop.mdx +38 -38
- package/docs-site/zh/tutorials/agent-onboarding.mdx +100 -0
- package/docs-site/zh/tutorials/authoring.mdx +211 -0
- package/docs-site/zh/{how-to → tutorials}/ci-integration.mdx +8 -8
- package/docs-site/zh/{how-to → tutorials}/connect-otel.mdx +22 -22
- package/docs-site/zh/{how-to → tutorials}/connect-your-agent.mdx +58 -63
- package/docs-site/zh/tutorials/custom-reports.mdx +453 -0
- package/docs-site/zh/{how-to → tutorials}/dataset-fanout.mdx +4 -4
- package/docs-site/zh/tutorials/experiments.mdx +103 -0
- package/docs-site/zh/{how-to → tutorials}/fixtures.mdx +9 -9
- package/docs-site/zh/{how-to → tutorials}/publish-report.mdx +6 -6
- package/docs-site/zh/tutorials/quickstart.mdx +18 -18
- package/docs-site/zh/{how-to → tutorials}/reporters.mdx +6 -6
- package/docs-site/zh/{how-to → tutorials}/sandbox-agent.mdx +6 -6
- package/docs-site/zh/{how-to → tutorials}/sandbox-providers.mdx +41 -19
- package/docs-site/zh/{how-to → tutorials}/scoring-guide.mdx +4 -4
- package/docs-site/zh/{how-to → tutorials}/viewing-results.mdx +49 -49
- package/docs-site/zh/tutorials/write-experiment.mdx +355 -0
- package/docs-site/zh/{how-to → tutorials}/write-send.mdx +40 -40
- package/package.json +8 -4
- package/src/agents/bub.ts +21 -8
- package/src/agents/claude-code.ts +23 -10
- package/src/agents/codex.test.ts +22 -7
- package/src/agents/codex.ts +22 -9
- package/src/agents/index.ts +2 -2
- package/src/agents/openai-compat.ts +1 -1
- package/src/agents/post-setup.ts +45 -22
- package/src/agents/streaming.ts +1 -1
- package/src/agents/types.ts +20 -17
- package/src/agents/ui-message-stream.test.ts +10 -0
- package/src/agents/ui-message-stream.ts +12 -1
- package/src/cli.ts +71 -57
- package/src/context/types.ts +21 -21
- package/src/define.ts +13 -0
- package/src/i18n/en.ts +27 -12
- package/src/i18n/zh-CN.ts +27 -12
- package/src/index.ts +2 -0
- package/src/report/{react → assets}/colors.ts +22 -0
- package/src/report/{react → assets}/enhance.js +1 -33
- package/src/report/{react → assets}/styles.css +124 -106
- package/src/report/built-in/index.tsx +2 -2
- package/src/report/built-in/standard.tsx +18 -6
- package/src/report/components/attempt-detail/AttemptAssertions.tsx +67 -0
- package/src/report/components/attempt-detail/AttemptConversation.tsx +110 -0
- package/src/report/components/attempt-detail/AttemptDiagnostics.tsx +38 -0
- package/src/report/components/attempt-detail/AttemptDiff.tsx +35 -0
- package/src/report/components/attempt-detail/AttemptError.tsx +31 -0
- package/src/report/components/attempt-detail/AttemptFixPrompt.tsx +26 -0
- package/src/report/components/attempt-detail/AttemptSource.tsx +80 -0
- package/src/report/components/attempt-detail/AttemptSummary.tsx +74 -0
- package/src/report/components/attempt-detail/AttemptTimeline.tsx +108 -0
- package/src/report/components/attempt-detail/AttemptTrace.tsx +63 -0
- package/src/report/components/attempt-detail/AttemptUsage.tsx +29 -0
- package/src/report/components/attempt-detail/attempt-components.test.tsx +680 -0
- package/src/report/components/attempt-detail/compute.ts +287 -0
- package/src/report/components/attempt-detail/faces.ts +257 -0
- package/src/report/components/attempt-detail/index.tsx +583 -0
- package/src/report/components/attempt-detail/validate.test.ts +235 -0
- package/src/report/{react → components}/cell.tsx +6 -3
- package/src/report/{report.test.ts → components/compute.test.ts} +316 -46
- package/src/report/{react → components/entity-lists}/AttemptList.tsx +24 -16
- package/src/report/{react → components/entity-lists}/EvalList.tsx +0 -0
- package/src/report/{react → components/entity-lists}/ExperimentList.tsx +23 -20
- package/src/report/components/entity-lists/compute.ts +196 -0
- package/src/report/components/entity-lists/faces.ts +207 -0
- package/src/report/components/entity-lists/index.tsx +241 -0
- package/src/report/components/entity-lists/validate.test.ts +114 -0
- package/src/report/{react → components}/fixtures.ts +2 -2
- package/src/report/{react → components/metric-views}/DeltaTable.tsx +5 -5
- package/src/report/{react → components/metric-views}/MetricBars.tsx +5 -5
- package/src/report/{react → components/metric-views}/MetricLine.tsx +9 -6
- package/src/report/{react → components/metric-views}/MetricMatrix.tsx +6 -6
- package/src/report/{react → components/metric-views}/MetricScatter.tsx +41 -33
- package/src/report/{react → components/metric-views}/MetricTable.tsx +6 -6
- package/src/report/{react → components/metric-views}/Scoreboard.tsx +4 -4
- package/src/report/{compute.ts → components/metric-views/compute.ts} +51 -477
- package/src/report/components/metric-views/faces.ts +423 -0
- package/src/report/components/metric-views/index.tsx +352 -0
- package/src/report/{text → components/metric-views}/plot.ts +1 -1
- package/src/report/components/metric-views/validate.test.ts +211 -0
- package/src/report/{react → components}/render.test.tsx +47 -17
- package/src/report/components/shared-compute.ts +59 -0
- package/src/report/components/shared-faces.ts +30 -0
- package/src/report/components/shared.ts +192 -0
- package/src/report/{react → components/site-components}/CopyFixPrompt.tsx +3 -3
- package/src/report/{react → components/site-components}/HeroCard.tsx +3 -3
- package/src/report/{react → components/site-components}/ScopeWarnings.tsx +4 -4
- package/src/report/{react → components/site-components}/TraceWaterfall.tsx +13 -10
- package/src/report/components/site-components/compute.ts +144 -0
- package/src/report/components/site-components/faces.ts +80 -0
- package/src/report/components/site-components/index.tsx +265 -0
- package/src/report/{scope-warnings.ts → components/site-components/scope-warnings.ts} +3 -3
- package/src/report/{site-components.test.tsx → components/site-components/site-components.test.tsx} +23 -21
- package/src/report/components/site-components/validate.test.ts +89 -0
- package/src/report/{react → components/summaries}/ScopeSummary.tsx +26 -11
- package/src/report/components/summaries/compute.ts +56 -0
- package/src/report/components/summaries/faces.ts +48 -0
- package/src/report/components/summaries/index.tsx +127 -0
- package/src/report/components/summaries/validate.test.ts +49 -0
- package/src/report/definition/grid-layout.test.ts +124 -0
- package/src/report/definition/grid-layout.ts +146 -0
- package/src/report/{primitives.tsx → definition/primitives.tsx} +168 -18
- package/src/report/{report.ts → definition/report.ts} +98 -165
- package/src/report/{shell-head.test.ts → definition/shell-head.test.ts} +2 -2
- package/src/report/{text/table.ts → definition/table-text.ts} +4 -4
- package/src/report/{tree.ts → definition/tree.ts} +56 -20
- package/src/report/index.ts +126 -66
- package/src/report/{aggregate.ts → model/aggregate.ts} +31 -9
- package/src/report/{flag.ts → model/flag.ts} +39 -1
- package/src/report/{format.ts → model/format.ts} +59 -5
- package/src/report/{locale.ts → model/locale.ts} +34 -36
- package/src/report/{metrics.ts → model/metrics.ts} +3 -3
- package/src/report/{types.ts → model/types.ts} +143 -22
- package/src/report/react/index.tsx +52 -26
- package/src/report/{dual-render.test.tsx → runtime/dual-render.test.tsx} +564 -49
- package/src/report/runtime/host.test.ts +44 -0
- package/src/report/runtime/host.ts +138 -0
- package/src/report/{load.ts → runtime/load.ts} +1 -1
- package/src/report/runtime/text.ts +192 -0
- package/src/report/runtime/web.ts +106 -0
- package/src/results/attempt-evidence.ts +5 -1
- package/src/results/host-equivalence.test.ts +53 -2
- package/src/results/select.ts +29 -5
- package/src/runner/attempt.test.ts +48 -1
- package/src/runner/attempt.ts +62 -42
- package/src/runner/cleanup-timeout.test.ts +16 -0
- package/src/runner/cleanup-timeout.ts +23 -0
- package/src/runner/discover.ts +1 -2
- package/src/runner/eval-selection.test.ts +187 -0
- package/src/runner/eval-selection.ts +109 -0
- package/src/runner/experiment-cleanup-registry.test.ts +89 -0
- package/src/runner/experiment-cleanup-registry.ts +39 -0
- package/src/runner/experiment-labels.test.ts +71 -0
- package/src/runner/feedback/agent.test.ts +33 -1
- package/src/runner/feedback/agent.ts +12 -16
- package/src/runner/feedback/ci.test.ts +35 -1
- package/src/runner/feedback/ci.ts +16 -18
- package/src/runner/feedback/coordinator.ts +28 -0
- package/src/runner/feedback/human.test.ts +108 -1
- package/src/runner/feedback/human.ts +71 -21
- package/src/runner/feedback/reducer.test.ts +64 -0
- package/src/runner/feedback/reducer.ts +26 -0
- package/src/runner/feedback/sink.ts +40 -1
- package/src/runner/fingerprint.ts +2 -1
- package/src/runner/report.test.ts +14 -0
- package/src/runner/report.ts +3 -1
- package/src/runner/run.test.ts +390 -12
- package/src/runner/run.ts +259 -26
- package/src/runner/sandbox-selection.test.ts +13 -3
- package/src/runner/sandbox-selection.ts +4 -2
- package/src/runner/types.ts +158 -23
- package/src/sandbox/docker.ts +7 -0
- package/src/sandbox/e2b.ts +12 -13
- package/src/sandbox/types.ts +23 -21
- package/src/scoring/display.test.ts +28 -2
- package/src/scoring/display.ts +38 -5
- package/src/scoring/types.ts +3 -3
- package/src/shared/aggregate.test.ts +52 -0
- package/src/shared/aggregate.ts +29 -0
- package/src/shared/types.ts +6 -1
- package/src/show/command.test.ts +34 -0
- package/src/show/command.ts +16 -0
- package/src/show/compose.ts +1 -1
- package/src/show/index.ts +56 -20
- package/src/show/render.ts +15 -239
- package/src/show/show.test.ts +127 -34
- package/src/view/app/App.test.tsx +1 -1
- package/src/view/app/App.tsx +119 -47
- package/src/view/app/i18n.ts +7 -147
- package/src/view/app/lib/attempt-dialog.test.ts +65 -0
- package/src/view/app/lib/attempt-dialog.ts +69 -0
- package/src/view/app/main.tsx +0 -1
- package/src/view/app/types.ts +3 -86
- package/src/view/artifact-serving.test.ts +22 -38
- package/src/view/client-dist/app.css +1 -1
- package/src/view/client-dist/app.js +15 -22
- package/src/view/data.test.ts +48 -36
- package/src/view/data.ts +105 -83
- package/src/view/index.ts +1 -1
- package/src/view/server.ts +32 -2
- package/src/view/shared/types.ts +6 -31
- package/src/view/site-parity.test.ts +24 -1
- package/src/view/site.ts +144 -17
- package/src/view/styles.css +0 -805
- package/src/view/view-report.test.ts +141 -22
- package/dist/report/components.d.ts +0 -179
- package/dist/report/components.js +0 -544
- package/dist/report/compute.d.ts +0 -139
- package/dist/report/react/ExperimentComparison.d.ts +0 -10
- package/dist/report/react/ExperimentComparison.js +0 -12
- package/dist/report/react/MetricScatter.d.ts +0 -9
- package/dist/report/react/format.d.ts +0 -3
- package/dist/report/react/format.js +0 -7
- package/dist/report/text/faces.d.ts +0 -45
- package/dist/report/text/faces.js +0 -671
- package/dist/report/web.d.ts +0 -32
- package/dist/report/web.js +0 -48
- package/docs-site/zh/how-to/authoring.mdx +0 -162
- package/docs-site/zh/how-to/custom-reports.mdx +0 -414
- package/docs-site/zh/how-to/experiments.mdx +0 -86
- package/docs-site/zh/how-to/write-experiment.mdx +0 -164
- package/src/report/components.tsx +0 -925
- package/src/report/react/ExperimentComparison.tsx +0 -73
- package/src/report/react/format.ts +0 -9
- package/src/report/text/faces.ts +0 -767
- package/src/report/web.ts +0 -77
- package/src/show/report-host.test.ts +0 -205
- package/src/show/report-host.ts +0 -389
- package/src/view/app/components/AttemptModal.tsx +0 -496
- package/src/view/app/components/CodeView.test.tsx +0 -142
- package/src/view/app/components/CodeView.tsx +0 -310
- package/src/view/app/components/CopyControls.tsx +0 -106
- package/src/view/app/components/Trace.tsx +0 -100
- package/src/view/app/components/Transcript.tsx +0 -157
- package/src/view/app/components/ui/badge.tsx +0 -21
- package/src/view/app/lib/artifact-url.ts +0 -17
- package/src/view/app/lib/attempt-route.test.ts +0 -80
- package/src/view/app/lib/attempt-route.ts +0 -52
- package/src/view/app/lib/format.ts +0 -70
- package/src/view/app/lib/guards.test.ts +0 -108
- package/src/view/app/lib/guards.ts +0 -71
- package/src/view/app/lib/rows.ts +0 -22
- package/src/view/app/lib/transcript-data.tsx +0 -151
- package/src/view/app/lib/verdict.ts +0 -23
- package/src/view/app/shared.ts +0 -8
- /package/dist/report/{react → components/metric-views}/chart-math.d.ts +0 -0
- /package/dist/report/{react → components/metric-views}/chart-math.js +0 -0
- /package/dist/report/{text → components/metric-views}/plot.d.ts +0 -0
- /package/dist/report/{react → components/site-components}/PoweredBy.d.ts +0 -0
- /package/dist/report/{react → components/site-components}/PoweredBy.js +0 -0
- /package/dist/report/{text/layout.d.ts → model/text-layout.d.ts} +0 -0
- /package/dist/report/{text/layout.js → model/text-layout.js} +0 -0
- /package/dist/report/{types.js → model/types.js} +0 -0
- /package/src/report/{react → components/metric-views}/chart-math.test.ts +0 -0
- /package/src/report/{react → components/metric-views}/chart-math.ts +0 -0
- /package/src/report/{react → components/site-components}/PoweredBy.tsx +0 -0
- /package/src/report/{text/layout.ts → model/text-layout.ts} +0 -0
|
@@ -34,23 +34,23 @@ description: "NiceEval 内置的 claude-code、codex、bub 适配器分别做到
|
|
|
34
34
|
|
|
35
35
|
### claude-code
|
|
36
36
|
|
|
37
|
-
-
|
|
37
|
+
- 连接方式:Sandbox 里 spawn `claude --print --dangerously-skip-permissions`,读回 `~/.claude/projects/**/*.jsonl` 最新一份 transcript。
|
|
38
38
|
- 会话续接:`ctx.session.id` 有值时追加 `--resume <id>`;transcript 解出的会话 id 经 `ctx.session.capture()` 写回。
|
|
39
39
|
- 鉴权:`ANTHROPIC_API_KEY`,可选 `ANTHROPIC_BASE_URL`;配置项见下方 `ClaudeCodeConfig`。
|
|
40
40
|
- `tracing` 通过 claude CLI 原生 OTLP trace spans(beta)配置,协议 `http/protobuf`:env 里设置 `CLAUDE_CODE_ENABLE_TELEMETRY` 与 `CLAUDE_CODE_ENHANCED_TELEMETRY_BETA`(beta 开关,须显式开启)把 endpoint 交给 CLI;`EvalResult.trace` 能看到 interaction / llm_request / tool 层级的瀑布图。
|
|
41
41
|
|
|
42
42
|
### codex
|
|
43
43
|
|
|
44
|
-
-
|
|
44
|
+
- 连接方式:Sandbox 里跑 `codex exec --json`(续接时是 `codex exec resume <id> --json`),stdout JSONL 当 transcript。命令带 `--dangerously-bypass-approvals-and-sandbox` 与 `--dangerously-bypass-hook-trust`:Sandbox 里没人能回答 codex 的交互确认,插件或 `postSetup` 装好的 hook 因此不需要交互授信就能生效。
|
|
45
45
|
- 鉴权:`CODEX_API_KEY`(不是 `OPENAI_API_KEY`),可选 `CODEX_BASE_URL` 接 OpenAI 兼容代理;配置项见下方 `CodexConfig`。
|
|
46
46
|
- `tracing` 通过 `~/.codex/config.toml` 的 `[otel.trace_exporter.otlp-http]` 段配置,协议 `http/json`。
|
|
47
47
|
|
|
48
48
|
### bub
|
|
49
49
|
|
|
50
|
-
-
|
|
50
|
+
- 连接方式:Sandbox 里跑 `bub run` + `--session-id`,从 `~/.bub/tapes/<hash>.jsonl` 读 tape 当 transcript。
|
|
51
51
|
- 鉴权:`BUB_API_KEY` + `BUB_API_BASE`(OpenAI 兼容代理);配置项见下方 `BubConfig`。
|
|
52
52
|
- `tracing` 通过环境变量注入(`OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` 等),协议 `http/protobuf`。
|
|
53
|
-
- 安装走 `uv tool install`(非 npm 包),首次安装带 checkpoint
|
|
53
|
+
- 安装走 `uv tool install`(非 npm 包),首次安装带 checkpoint 缓存以加速后续 Sandbox。
|
|
54
54
|
|
|
55
55
|
## 三个内置 sandbox agent 的配置项
|
|
56
56
|
|
|
@@ -84,7 +84,7 @@ maxTurns?: number;
|
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
最多跑几个 tool-use 轮次(→ `--max-turns`)。
|
|
87
|
-
|
|
87
|
+
控制评估用例成本上限;省略时用 CLI 原生默认(无限制)。
|
|
88
88
|
|
|
89
89
|
#### `mcpServers`
|
|
90
90
|
|
|
@@ -92,7 +92,7 @@ maxTurns?: number;
|
|
|
92
92
|
mcpServers?: McpServer[];
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
额外 MCP server(
|
|
95
|
+
额外 MCP server(每个 Sandbox setup 时写进用户级 ~/.claude.json)。
|
|
96
96
|
stdio 形态写 command(可带 args / env);Streamable HTTP 形态写 url(可带 headers,
|
|
97
97
|
逐字进请求头),落成 { "type": "http", "url": …, "headers": … } 条目。
|
|
98
98
|
|
|
@@ -102,7 +102,7 @@ stdio 形态写 command(可带 args / env);Streamable HTTP 形态写 url(可带
|
|
|
102
102
|
skills?: SkillSpec[];
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
装进 Sandbox 的 Skill(本地目录/文件,或 repo + 可钉 ref + 可选启用集)。
|
|
106
106
|
落在 project 级 `.claude/skills/<name>/`,claude CLI 原生发现。
|
|
107
107
|
|
|
108
108
|
#### `plugins`
|
|
@@ -122,7 +122,7 @@ settingsFile?: string;
|
|
|
122
122
|
一份完整的 Claude Code `settings.json`(官方格式)在本地项目里的路径 —— 相对运行
|
|
123
123
|
niceeval 的项目根(含 `niceeval.config.ts` 的目录)解析,不是 Sandbox 内路径;只接受
|
|
124
124
|
项目根内的相对路径,包含 `..` 的路径、绝对路径、`~` 路径和解析后逃出项目根的符号链接
|
|
125
|
-
都在 setup
|
|
125
|
+
都在 setup 阶段报错。原始字节原样上传为 Sandbox 里原本为空的用户级 `~/.claude/settings.json`
|
|
126
126
|
(不继承宿主机配置、不拼接、不重新序列化);保留键 `model` 与 `env` 出现在文件里
|
|
127
127
|
setup 报错。manifest 只记项目相对路径与字节 SHA-256,不落正文。
|
|
128
128
|
|
|
@@ -132,10 +132,21 @@ setup 报错。manifest 只记项目相对路径与字节 SHA-256,不落正文
|
|
|
132
132
|
postSetup?: SandboxHook[];
|
|
133
133
|
```
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
安装后按数组顺序运行的用户 Hook(复用 SandboxHook 的窄上下文):在写 settings、挂 MCP、
|
|
136
136
|
装 Skills / Plugin、写 manifest 全部完成后执行,适合跑插件自带的 setup 脚本这类
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
「安装产物就位后才能跑」的过程动作。抛错按基础设施错误计(attempt errored)。
|
|
138
|
+
见 docs/feature/adapters/library/coding-agent-extensions.md「安装后运行脚本」。
|
|
139
|
+
|
|
140
|
+
#### `preTeardown`
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
preTeardown?: SandboxHook[];
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
与 `postSetup` 成对的收尾 Hook:按 `postSetup` 的逆序语义,在 agent 自己的 teardown 步骤
|
|
147
|
+
之前执行(LIFO 镜像 —— `postSetup` 跑在 agent 安装之后,`preTeardown` 就跑在 agent 收尾
|
|
148
|
+
之前),当且仅当 `postSetup` 的时点走到过才触发。抛错按基础设施错误计,由 teardown 段
|
|
149
|
+
按 teardown-failed 诊断收束。
|
|
139
150
|
见 docs/feature/adapters/library/coding-agent-extensions.md「安装后运行脚本」。
|
|
140
151
|
|
|
141
152
|
### `CodexConfig`
|
|
@@ -162,7 +173,7 @@ OpenAI 兼容代理 base URL(如 `https://s2a.example.com/v1`)。省略时读 CO
|
|
|
162
173
|
mcpServers?: McpServer[];
|
|
163
174
|
```
|
|
164
175
|
|
|
165
|
-
额外 MCP server(
|
|
176
|
+
额外 MCP server(每个 Sandbox setup 时追加进 ~/.codex/config.toml)。
|
|
166
177
|
stdio 形态(command/args/env)写 [mcp_servers.<name>] 的 command 行;
|
|
167
178
|
Streamable HTTP 形态(url/headers)写 url 行,headers 进 [mcp_servers.<name>.http_headers] 子表。
|
|
168
179
|
|
|
@@ -172,7 +183,7 @@ Streamable HTTP 形态(url/headers)写 url 行,headers 进 [mcp_servers.<name
|
|
|
172
183
|
skills?: SkillSpec[];
|
|
173
184
|
```
|
|
174
185
|
|
|
175
|
-
|
|
186
|
+
装进 Sandbox 的 Skill(本地目录/文件,或 repo + 可钉 ref + 可选启用集)。
|
|
176
187
|
落在 `.agents/skills/<name>/`,并写一段发现指引进 AGENTS.md —— codex 没有 Claude Code 那种
|
|
177
188
|
原生 Skill 工具,只把文件装进去它不会自己去读(见 memory/codex-no-native-skill-tool.md)。
|
|
178
189
|
|
|
@@ -193,7 +204,7 @@ configFile?: string;
|
|
|
193
204
|
一份完整的 Codex `config.toml`(官方 TOML 格式)在本地项目里的路径 —— 相对运行
|
|
194
205
|
niceeval 的项目根(含 `niceeval.config.ts` 的目录)解析,不是 Sandbox 内路径;只接受
|
|
195
206
|
项目根内的相对路径,包含 `..` 的路径、绝对路径、`~` 路径和解析后逃出项目根的符号链接
|
|
196
|
-
都在 setup
|
|
207
|
+
都在 setup 阶段报错。原始字节原样并入 Sandbox 里原本为空的用户级 `~/.codex/config.toml`
|
|
197
208
|
(不继承宿主机配置、不解析后重写);保留键 `model`、`model_provider`、`model_providers`、
|
|
198
209
|
`model_reasoning_effort`、`mcp_servers`、`otel` 出现在文件里 setup 报错。manifest 只记
|
|
199
210
|
项目相对路径与字节 SHA-256,不落正文。
|
|
@@ -204,10 +215,21 @@ niceeval 的项目根(含 `niceeval.config.ts` 的目录)解析,不是 Sandbox
|
|
|
204
215
|
postSetup?: SandboxHook[];
|
|
205
216
|
```
|
|
206
217
|
|
|
207
|
-
|
|
218
|
+
安装后按数组顺序运行的用户 Hook(复用 SandboxHook 的窄上下文):在写主配置、挂 MCP、
|
|
208
219
|
装 Skills / Plugin、写 manifest 全部完成后执行,适合跑插件自带的 setup 脚本这类
|
|
209
|
-
|
|
210
|
-
|
|
220
|
+
「安装产物就位后才能跑」的过程动作。抛错按基础设施错误计(attempt errored)。
|
|
221
|
+
见 docs/feature/adapters/library/coding-agent-extensions.md「安装后运行脚本」。
|
|
222
|
+
|
|
223
|
+
#### `preTeardown`
|
|
224
|
+
|
|
225
|
+
```ts
|
|
226
|
+
preTeardown?: SandboxHook[];
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
与 `postSetup` 成对的收尾 Hook:按 `postSetup` 的逆序语义,在 agent 自己的 teardown 步骤
|
|
230
|
+
之前执行(LIFO 镜像 —— `postSetup` 跑在 agent 安装之后,`preTeardown` 就跑在 agent 收尾
|
|
231
|
+
之前),当且仅当 `postSetup` 的时点走到过才触发。抛错按基础设施错误计,由 teardown 段
|
|
232
|
+
按 teardown-failed 诊断收束。
|
|
211
233
|
见 docs/feature/adapters/library/coding-agent-extensions.md「安装后运行脚本」。
|
|
212
234
|
|
|
213
235
|
### `BubConfig`
|
|
@@ -234,7 +256,7 @@ OpenAI 兼容代理的 base URL。省略时读 BUB_API_BASE env。
|
|
|
234
256
|
skills?: SkillSpec[];
|
|
235
257
|
```
|
|
236
258
|
|
|
237
|
-
|
|
259
|
+
装进 Sandbox 的 Skill(本地目录/文件,或 repo + 可钉 ref + 可选启用集)。
|
|
238
260
|
落在 `.agents/skills/<name>/`,并写一段发现指引进 AGENTS.md(bub 没有原生 Skill 加载机制)。
|
|
239
261
|
|
|
240
262
|
#### `pythonPlugins`
|
|
@@ -243,7 +265,7 @@ skills?: SkillSpec[];
|
|
|
243
265
|
pythonPlugins?: PythonPluginSpec[];
|
|
244
266
|
```
|
|
245
267
|
|
|
246
|
-
额外装进 bub tool 环境的 Python Package
|
|
268
|
+
额外装进 bub tool 环境的 Python Package,每个 Sandbox setup 时进 `uv tool install … --with <pkg>`。
|
|
247
269
|
规范化后的 package 列表进安装 checkpoint key:plugin 集合不同的两个 agent 变体不会复用同一个
|
|
248
270
|
安装 checkpoint(否则第二个变体会静默拿到第一个变体的环境)。
|
|
249
271
|
|
|
@@ -253,9 +275,20 @@ pythonPlugins?: PythonPluginSpec[];
|
|
|
253
275
|
postSetup?: SandboxHook[];
|
|
254
276
|
```
|
|
255
277
|
|
|
256
|
-
|
|
257
|
-
Python package、写 manifest
|
|
258
|
-
|
|
278
|
+
安装后按数组顺序运行的用户 Hook(复用 SandboxHook 的窄上下文):在装 bub、装 Skills /
|
|
279
|
+
Python package、写 manifest 全部完成后执行。抛错按基础设施错误计(attempt errored)。
|
|
280
|
+
见 docs/feature/adapters/library/coding-agent-extensions.md「安装后运行脚本」。
|
|
281
|
+
|
|
282
|
+
#### `preTeardown`
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
preTeardown?: SandboxHook[];
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
与 `postSetup` 成对的收尾 Hook:按 `postSetup` 的逆序语义,在 agent 自己的 teardown 步骤
|
|
289
|
+
之前执行(LIFO 镜像 —— `postSetup` 跑在 agent 安装之后,`preTeardown` 就跑在 agent 收尾
|
|
290
|
+
之前),当且仅当 `postSetup` 的时点走到过才触发。抛错按基础设施错误计,由 teardown 段
|
|
291
|
+
按 teardown-failed 诊断收束。
|
|
259
292
|
见 docs/feature/adapters/library/coding-agent-extensions.md「安装后运行脚本」。
|
|
260
293
|
|
|
261
294
|
{/* GENERATED:END builtin-agent-config */}
|
|
@@ -279,9 +312,9 @@ export default uiMessageStreamAgent({
|
|
|
279
312
|
- **收发 + 事件流**:SSE 帧经 `ai` 包官方的框架无关 reducer `readUIMessageStream`(`useChat` 内部同款)归约,工具调用/结果/消息文本从消息 parts 直构——**不要求应用接 OTel**。
|
|
280
313
|
- **会话续接**:协议是服务端零状态、「客户端带全量历史」——工厂用 `ctx.session.history()` 存整份 `UIMessage[]`,每轮原样重放;新会话线(`t.newSession()` 之后)拿到的是空历史。
|
|
281
314
|
- **HITL**:AI SDK v7 tool approval(工具带 `needsApproval: true`)原生映射——part 停在 `approval-requested` 时该 Turn 的 `status: "waiting"` + `input.requested`;`t.respond("approve" / "deny")` 翻译成 `approval-responded` 原地改写该 part、原样重发 `messages` 触发服务端续跑(和真实前端 `addToolApprovalResponse()` + `sendMessage()` 的协议行为一致,没有单独的 approve 端点)。拒绝的调用以 `rejected` 落进事件流,且默认带「不要重试」的 reason(`denyReason` 可覆盖)——不带的话模型经常原样重发同一个调用。
|
|
282
|
-
- **usage / 瀑布图**:UI Message Stream 协议帧里没有 usage,所以 `t.maxTokens` 这类用量断言在这个内置件上默认没有数据(应用把 usage 放进 message metadata 属于应用自己的协议扩展)。瀑布图是另一回事:应用有 OTel 埋点(如官方 `@ai-sdk/otel`)时,按 [OTel 接入](/zh/
|
|
315
|
+
- **usage / 瀑布图**:UI Message Stream 协议帧里没有 usage,所以 `t.maxTokens` 这类用量断言在这个内置件上默认没有数据(应用把 usage 放进 message metadata 属于应用自己的协议扩展)。瀑布图是另一回事:应用有 OTel 埋点(如官方 `@ai-sdk/otel`)时,按 [OTel 接入](/zh/tutorials/connect-otel)把 span 发给 [NiceEval](https://niceeval.com/),`niceeval view` 就有完整瀑布图——span 只进瀑布图,不喂断言。
|
|
283
316
|
|
|
284
|
-
|
|
317
|
+
需要在评估用例项目里安装 `ai`(可选 peer 依赖,协议 reducer 来自它)。完整可跑示例:[`examples/zh/tier1/ai-sdk-v7`](https://github.com/CorrectRoadH/niceeval/tree/main/examples/zh/tier1/ai-sdk-v7)。
|
|
285
318
|
|
|
286
319
|
`uiMessageStreamAgent(options)` 完整参数(`UiMessageStreamAgentOptions`):
|
|
287
320
|
|
|
@@ -445,13 +478,13 @@ export default defineAgent({
|
|
|
445
478
|
- 被测对象是 AI SDK 应用(`useChat` 后端):内置 `uiMessageStreamAgent` 无侵入接入,零映射(含 HITL)。
|
|
446
479
|
- 被测对象是其它 agent 系统(HTTP / gRPC 服务):无侵入接入,手写事件映射(官方转换器能覆盖大半)——[`examples/zh/tier1`](https://github.com/CorrectRoadH/niceeval/tree/main/examples/zh/tier1) 下五个示例全是这条路;应用已埋 OTel 的话顺手接上,多一张瀑布图。
|
|
447
480
|
- 需要调用瀑布图(`niceeval view` 的 trace):`claude-code` / `codex` / `bub` 三个都自发 OTLP(claude-code 走 CLI 的 beta 遥测,span 只有结构与计时);自己写的 adapter 声明 `tracing` 即可(见 OTel 指南)。
|
|
448
|
-
- 需要人工审批 / 多步确认(HITL):`uiMessageStreamAgent` 原生支持(AI SDK v7 tool approval
|
|
481
|
+
- 需要人工审批 / 多步确认(HITL):`uiMessageStreamAgent` 原生支持(AI SDK v7 tool approval);Sandbox 型三个都不支持,其它被测对象自己写 adapter,拿 `driveFrameStream` + `ctx.session.hold`/`take` 拼(Tier 1 示例里 pi-sdk / claude-sdk 有现成写法)。
|
|
449
482
|
- 想跑一个 coding agent 改代码、看 diff、判断工具调用:`claude-code` / `codex` / `bub`(收发 + 事件流 + 会话续接 + workspace + sandbox)。
|
|
450
483
|
- 后端协议是自己发明的、没有官方 SDK 转换器可用:别从零手写 send——挑一种 reduce 形状(整段落地写小映射,逐 token 增量用 `deltaStream`),会话续接直接取用 `ctx.session.id`/`capture` 或 `ctx.session.history`,有 HITL 再加 `ctx.session.hold`/`take`,拼起来就是 send。
|
|
451
484
|
|
|
452
485
|
## 相关阅读
|
|
453
486
|
|
|
454
|
-
- [接入你的 agent](/zh/
|
|
455
|
-
- [Sandbox Agent](/zh/
|
|
487
|
+
- [接入你的 agent](/zh/tutorials/connect-your-agent) — 自己写 adapter 时每个能力怎么做、对应什么断言。
|
|
488
|
+
- [Sandbox Agent](/zh/tutorials/sandbox-agent) — 怎么运行内置 sandbox agent,以及怎么写自己的。
|
|
456
489
|
- [defineAgent 参考](/zh/reference/define-agent) — `defineAgent` / `defineSandboxAgent` 完整参数。
|
|
457
|
-
- [OTel 接入](/zh/
|
|
490
|
+
- [OTel 接入](/zh/tutorials/connect-otel) — 把应用的 span 发给 [NiceEval](https://niceeval.com/),换 `niceeval view` 的调用瀑布图。
|
|
@@ -20,26 +20,6 @@ description: "NiceEval 怎么知道你的 adapter 做到了什么:没有声明
|
|
|
20
20
|
|
|
21
21
|
没做到的能力 = 没有对应的事件/字段出现,相关断言组不可用(不是"报错",是断言本身没有可判断的依据);基础断言(文本、结构化、judge)永远可用。
|
|
22
22
|
|
|
23
|
-
## 为什么没有声明这一层
|
|
24
|
-
|
|
25
|
-
NiceEval 不设 `capabilities: { conversation, toolObservability }` 这类布尔声明层来补"代码证明不了的部分",因为这类声明承诺的事情本身就不该由声明来担保:
|
|
26
|
-
|
|
27
|
-
- **构造即证明**:用了 `defineSandboxAgent`,说明被测对象在沙箱里改文件——不需要再声明一遍 `workspace: true`。
|
|
28
|
-
- **字段即证明**:写了 `tracing`(怎么把 OTLP 端点交给 CLI),tracing 就成立。字段本身就是使用凭证,不需要旁边再放一个布尔值重复一遍。
|
|
29
|
-
- **来源即证明**:`fromAiSdk(result)` 消费的 `result.steps` 是 AI SDK 契约保证的**全量**工具循环记录,返回值自带"事件流完整"的证明;内置 CLI 的 parser 同理。手工映射时,事件完不完整取决于你的映射代码写没写全——这不是一个可以靠声明担保的东西,声明了也不会让代码更完整。
|
|
30
|
-
- **行为即证明**:HITL 没有能力位——`send` 返回 `status: "waiting"` + `input.requested` 事件,行为本身可见。
|
|
31
|
-
- **接了就续得上**:会话续接没有"声明了才有"的开关。`ctx.session` 一直都在;用了 `id`/`capture` 或 `history` 存取器就会续接上下文,不用就每轮都是全新会话——两种都是正常状态,都不会报错,区别只在你的 adapter 实际怎么写。
|
|
32
|
-
|
|
33
|
-
```ts
|
|
34
|
-
export default defineAgent({
|
|
35
|
-
name: "my-ai-sdk-agent",
|
|
36
|
-
async send(input, ctx) {
|
|
37
|
-
const result = await generateText({ model, tools, prompt: input.text });
|
|
38
|
-
return { ...fromAiSdk(result), data: result.text };
|
|
39
|
-
// ↑ 返回值自带完整的工具事件,不需要任何能力声明
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
```
|
|
43
23
|
|
|
44
24
|
## 手工映射时事件不全,会怎样
|
|
45
25
|
|
|
@@ -49,19 +29,19 @@ export default defineAgent({
|
|
|
49
29
|
|
|
50
30
|
### 工具/动作事件完整性
|
|
51
31
|
|
|
52
|
-
含义:这一轮的每次工具调用是否都以 `action.called` + `action.result` 出现在 events 里([事件流参考](/zh/reference/events))。来源只有两个:官方转换器按被测协议的契约保证;手工映射由你的代码决定。OTel span 不是来源——span 只进瀑布图,不进事件流(见 [OTel 接入](/zh/
|
|
32
|
+
含义:这一轮的每次工具调用是否都以 `action.called` + `action.result` 出现在 events 里([事件流参考](/zh/reference/events))。来源只有两个:官方转换器按被测协议的契约保证;手工映射由你的代码决定。OTel span 不是来源——span 只进瀑布图,不进事件流(见 [OTel 接入](/zh/tutorials/connect-otel))。
|
|
53
33
|
|
|
54
34
|
### 会话续接
|
|
55
35
|
|
|
56
|
-
含义:用 `ctx.session.id` / `capture` 或 `ctx.session.history` 把请求连到同一个后端会话/累计历史上。有它,跨轮记忆断言、`t.newSession()` 隔离断言才有意义。两种实现写法见[写 send](/zh/
|
|
36
|
+
含义:用 `ctx.session.id` / `capture` 或 `ctx.session.history` 把请求连到同一个后端会话/累计历史上。有它,跨轮记忆断言、`t.newSession()` 隔离断言才有意义。两种实现写法见[写 send](/zh/tutorials/write-send)。
|
|
57
37
|
|
|
58
38
|
### `tracing` —— 发 OTLP trace
|
|
59
39
|
|
|
60
|
-
runner 消费:运行时起一个本机 OTLP 接收器,把本轮 trace context 经 `ctx.telemetry.headers` 交给你;span 归一后在 `niceeval view` 画瀑布图——只画图,不喂断言。来源:CLI 型写 `tracing` 字段(env / configure 把端点交给被测进程);长驻应用在 `niceeval.config.ts` 配 `telemetry: { port }` 固定端口(见 [OTel 接入](/zh/
|
|
40
|
+
runner 消费:运行时起一个本机 OTLP 接收器,把本轮 trace context 经 `ctx.telemetry.headers` 交给你;span 归一后在 `niceeval view` 画瀑布图——只画图,不喂断言。来源:CLI 型写 `tracing` 字段(env / configure 把端点交给被测进程);长驻应用在 `niceeval.config.ts` 配 `telemetry: { port }` 固定端口(见 [OTel 接入](/zh/tutorials/connect-otel))。
|
|
61
41
|
|
|
62
|
-
### `kind: "sandbox"` ——
|
|
42
|
+
### `kind: "sandbox"` —— Sandbox 与改文件
|
|
63
43
|
|
|
64
|
-
runner 消费:为每次 attempt
|
|
44
|
+
runner 消费:为每次 attempt 准备 Sandbox(Docker / Vercel / E2B),经 `ctx.sandbox` 交给 adapter;解锁 `t.sandbox.fileChanged()` 等 diff 断言。来源:`defineSandboxAgent` 构造,内部判别字段,不用你写。
|
|
65
45
|
|
|
66
46
|
### 压缩可见(compaction)
|
|
67
47
|
|
|
@@ -71,6 +51,6 @@ runner 消费:为每次 attempt 准备沙箱(Docker / Vercel / E2B),经
|
|
|
71
51
|
|
|
72
52
|
- [事件流参考](/zh/reference/events) —— 事件流承诺的具体内容。
|
|
73
53
|
- [Adapter 概念](/zh/explanation/adapter) —— `ctx`/`Turn` 的完整契约、能力从哪来。
|
|
74
|
-
- [接入你的 agent](/zh/
|
|
75
|
-
- [OTel 接入](/zh/
|
|
54
|
+
- [接入你的 agent](/zh/tutorials/connect-your-agent) —— 每种接入路径怎么做。
|
|
55
|
+
- [OTel 接入](/zh/tutorials/connect-otel) —— span 只进瀑布图、不喂断言的完整走法。
|
|
76
56
|
- [内置 Agent 能力](/zh/reference/builtin-agents) —— 内置 adapter 各自做到什么。
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "NiceEval CLI:命令、flags 和退出码参考"
|
|
3
3
|
sidebarTitle: "命令行"
|
|
4
|
-
description: "NiceEval CLI 参考:exp、show、view、init、list 和 clean 命令,以及结果下钻、experiment
|
|
4
|
+
description: "NiceEval CLI 参考:exp、show、view、init、list 和 clean 命令,以及结果下钻、experiment、评估用例过滤、并发、预算和 CI 输出。"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
[NiceEval](https://niceeval.com/) CLI
|
|
7
|
+
[NiceEval](https://niceeval.com/) CLI 是发现、运行和查看评估用例的入口。实际执行评估用例时采用 experiment-first 模型:**`exp` 选择可签入的运行配置**,experiment 后的位置参数才按评估用例 ID 前缀过滤。agent、model 和 flags 写在 `experiments/`,不靠临时 CLI 参数。
|
|
8
8
|
|
|
9
9
|
## 命令
|
|
10
10
|
|
|
11
11
|
<CardGroup cols={2}>
|
|
12
|
-
<Card title="npx niceeval exp
|
|
13
|
-
|
|
12
|
+
<Card title="npx niceeval exp [path] [id-prefix]" icon="flask">
|
|
13
|
+
按 experiment id 路径运行;每个配置的 `evals` 决定覆盖哪些评估用例。
|
|
14
14
|
</Card>
|
|
15
15
|
<Card title="npx niceeval init" icon="wand-magic-sparkles">
|
|
16
|
-
创建空的 `evals/` 目录和最小的 `niceeval.config.ts
|
|
16
|
+
创建空的 `evals/` 目录和最小的 `niceeval.config.ts`;不生成示例评估用例文件。同时写入/刷新 niceeval 指引区块——项目已有 `AGENTS.md` 就写那份,只有 `CLAUDE.md` 就写进 `CLAUDE.md`,都没有则新建 `AGENTS.md`(见[Agent 反馈闭环](/zh/tutorials/agent-feedback-loop))。
|
|
17
17
|
</Card>
|
|
18
18
|
<Card title="npx niceeval list" icon="list">
|
|
19
|
-
|
|
19
|
+
发现并打印所有评估用例,不运行。
|
|
20
20
|
</Card>
|
|
21
21
|
<Card title="npx niceeval clean" icon="trash">
|
|
22
22
|
删除 `.niceeval/` 下历史快照 artifacts。
|
|
23
23
|
</Card>
|
|
24
24
|
<Card title="npx niceeval show [id-prefix | @locator]" icon="terminal">
|
|
25
|
-
在终端读取结果;用 `@<locator>`
|
|
25
|
+
在终端读取结果;用 `@<locator>` 或评估用例 ID 前缀下钻断言、评估用例源码、执行事件流、diff 和历史。
|
|
26
26
|
</Card>
|
|
27
27
|
<Card title="npx niceeval view" icon="eye">
|
|
28
|
-
|
|
28
|
+
打开网页结果查看器,读默认报告并交互浏览评估用例源码、执行事件流与 diff;默认范围与 `show` 相同。跨 run 时间轴(`--history`)是 `show` 专用的终端能力。
|
|
29
29
|
</Card>
|
|
30
30
|
</CardGroup>
|
|
31
31
|
|
|
@@ -40,31 +40,34 @@ NICEEVAL_LANG=zh-CN npx niceeval list
|
|
|
40
40
|
|
|
41
41
|
检测顺序是 `NICEEVAL_LANG`、`NICEEVAL_LOCALE`、`LC_ALL`、`LC_MESSAGES`、`LANG`。以 `zh` 开头的值使用 `zh-CN`,其它语言使用 `en`;都没有时默认 `zh-CN`。这只影响终端/runtime 文案,不改变结果 JSON 里的机器字段,也不翻译 LLM judge prompt。
|
|
42
42
|
|
|
43
|
-
## `npx niceeval exp [
|
|
43
|
+
## `npx niceeval exp [path|config] [id-prefix...]`
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
# 运行 experiments/ 下全部实验
|
|
47
47
|
npx niceeval exp
|
|
48
48
|
|
|
49
|
-
#
|
|
50
|
-
npx niceeval exp
|
|
49
|
+
# 按多层目录运行一批 experiment
|
|
50
|
+
npx niceeval exp models
|
|
51
|
+
|
|
52
|
+
# 只运行一个配置
|
|
53
|
+
npx niceeval exp models/openai/gpt-5.4
|
|
51
54
|
|
|
52
|
-
#
|
|
53
|
-
npx niceeval exp
|
|
55
|
+
# 运行一个多层目录下全部配置
|
|
56
|
+
npx niceeval exp models/openai
|
|
54
57
|
|
|
55
|
-
#
|
|
56
|
-
npx niceeval exp
|
|
58
|
+
# 在这一批里只运行 ID 以 weather 开头的 eval
|
|
59
|
+
npx niceeval exp models weather
|
|
57
60
|
```
|
|
58
61
|
|
|
59
62
|
<Note>
|
|
60
|
-
|
|
63
|
+
评估用例过滤参数只出现在 experiment 选择之后。裸 `npx niceeval weather` 不会运行;请使用 `npx niceeval exp local weather` 或 `npx niceeval exp compare weather`。
|
|
61
64
|
</Note>
|
|
62
65
|
|
|
63
|
-
|
|
66
|
+
第一个位置参数只解释为 experiment id、目录路径或文件名前缀;尾随位置参数按评估用例 id 前缀继续收窄。
|
|
64
67
|
|
|
65
68
|
## 常用 flags
|
|
66
69
|
|
|
67
|
-
下表由 CLI 的 flag 解析表生成,表外的 flag 一律按未知 flag 报错并以非零状态退出。**没有**用于选择
|
|
70
|
+
下表由 CLI 的 flag 解析表生成,表外的 flag 一律按未知 flag 报错并以非零状态退出。**没有**用于选择 Sandbox provider 的 CLI flag:Sandbox provider 只能写在代码里——在 experiment(`defineExperiment`)里设置 `sandbox`,或者在 `niceeval.config.ts`(`defineConfig`)里设置作为项目级兜底,值来自 `niceeval/sandbox` 的 `dockerSandbox()` / `vercelSandbox()` / `e2bSandbox()`。
|
|
68
71
|
|
|
69
72
|
{/* GENERATED:BEGIN cli-flags */}
|
|
70
73
|
|
|
@@ -78,8 +81,8 @@ npx niceeval exp compare-models weather
|
|
|
78
81
|
| `--max-concurrency` | number | 设置同时运行的 eval 数量。 |
|
|
79
82
|
| `--timeout` | number | 单个 attempt 的超时时间,单位毫秒。 |
|
|
80
83
|
| `--budget` | number | 整次运行的预算上限(美元)。 |
|
|
81
|
-
| `--keep-sandbox` | boolean | `exp` 命令专用:跑完留下 failed/errored attempt
|
|
82
|
-
| `--all` | boolean | `sandbox stop`
|
|
84
|
+
| `--keep-sandbox` | boolean | `exp` 命令专用:跑完留下 failed/errored attempt 的 Sandbox 现场(= `--keep-sandbox=failed`);`--keep-sandbox=all` 连 passed 也留。事后用 `niceeval sandbox list/enter/stop` 查看与销毁。 |
|
|
85
|
+
| `--all` | boolean | `sandbox stop` 专用:销毁全部留存 Sandbox。 |
|
|
83
86
|
| `--window` | string | `sandbox diff` 专用:只看某个 send 窗口(如 `--window s1/t2`);省略输出全部窗口的串联视图。 |
|
|
84
87
|
| `--path` | string | `sandbox diff` 专用:只看某个文件的 patch;省略输出该窗口的全部文件。 |
|
|
85
88
|
| `--leave-running` | boolean | `sandbox enter` 专用:shell 退出后让现场保持运行,不送回休眠。 |
|
|
@@ -93,7 +96,7 @@ npx niceeval exp compare-models weather
|
|
|
93
96
|
| `--timing` | boolean | `show` 命令专用:整个 Attempt 的统一时间树;裸 `--timing` 给有界诊断投影,`--timing=full` 逐节点展开全部 runner/已关联 OTel 节点。 |
|
|
94
97
|
| `--diff` | boolean | `show` 命令专用:sandbox 里的文件改动摘要;`--diff=<文件路径>` 看单个文件的完整改动(路径必须 `=` 连写)。 |
|
|
95
98
|
| `--history` | boolean | `show` 命令专用:执行时间轴——对匹配的每个 experiment × eval 分节,逐 attempt 列时间 / verdict / 摘要 / 耗时 / 成本 / locator;与 `--report` 互斥。 |
|
|
96
|
-
| `--exp` | string | `show` / `view` 命令专用:按路径段前缀收窄 experiment(与 `niceeval exp` 位置参数同一套匹配)
|
|
99
|
+
| `--exp` | string | `show` / `view` 命令专用:按路径段前缀收窄 experiment(与 `niceeval exp` 位置参数同一套匹配);目录路径会选中其下全部配置。`view --out` 时同一收窄决定出站内容。 |
|
|
97
100
|
| `--results` | string | `show` / `view` / `sandbox enter\|list\|stop` 共用:结果根目录(`.niceeval` 之外的另一个根,如 `copySnapshots` 产出的发布根)。 |
|
|
98
101
|
| `--snapshot` | string | `view` 命令专用:只打开这一份快照文件(`snapshot.json`);文件不可读时命令失败(扫描模式只跳过)。 |
|
|
99
102
|
| `--report` | string | `show` / `view` 命令专用:用文件默认导出的 `defineReport(...)` 替换两者共用的默认报告。 |
|
|
@@ -115,7 +118,7 @@ npx niceeval exp compare-models weather
|
|
|
115
118
|
npx niceeval list
|
|
116
119
|
```
|
|
117
120
|
|
|
118
|
-
|
|
121
|
+
用于检查评估用例发现、ID 和配置加载是否正常。
|
|
119
122
|
|
|
120
123
|
## `exp`
|
|
121
124
|
|
|
@@ -124,7 +127,7 @@ npx niceeval exp compare-models
|
|
|
124
127
|
npx niceeval exp compare-models weather-tool
|
|
125
128
|
```
|
|
126
129
|
|
|
127
|
-
运行命名 experiment,用矩阵比较 agents、models 或 flags
|
|
130
|
+
运行命名 experiment,用矩阵比较 agents、models 或 flags。第二个参数开始是评估用例 ID 前缀过滤。
|
|
128
131
|
|
|
129
132
|
`show` 与 `view` 是顶层命令,应写成 `npx niceeval show`、`npx niceeval view`。误写成 `npx niceeval exp show` / `exp view` 且没有同名 experiment 时,CLI 会在“不存在的实验”错误后提示正确命令;仓库确实存在同名 experiment 时仍按合法 id 执行。
|
|
130
133
|
|
|
@@ -143,7 +146,7 @@ npx niceeval exp compare --output agent
|
|
|
143
146
|
npx niceeval exp compare --output ci --strict --json .niceeval/ci-summary.json --junit .niceeval/junit.xml
|
|
144
147
|
```
|
|
145
148
|
|
|
146
|
-
三种 profile 的完整对比见[运行器 · Reporter](/zh/explanation/runner#reporter);人在终端里怎么读 dashboard 与结束摘要见上面的[常用 flags](#常用-flags)与本页各命令示例;AI 反馈闭环的完整用法(读输出、按 locator 下钻、局部重跑)见 [AI 反馈闭环](/zh/
|
|
149
|
+
三种 profile 的完整对比见[运行器 · Reporter](/zh/explanation/runner#reporter);人在终端里怎么读 dashboard 与结束摘要见上面的[常用 flags](#常用-flags)与本页各命令示例;AI 反馈闭环的完整用法(读输出、按 locator 下钻、局部重跑)见 [AI 反馈闭环](/zh/tutorials/agent-feedback-loop);CI 集成(GitHub Actions、退出码、JSON/JUnit)见 [CI 集成](/zh/tutorials/ci-integration)。
|
|
147
150
|
|
|
148
151
|
## `view`
|
|
149
152
|
|
|
@@ -151,7 +154,7 @@ npx niceeval exp compare --output ci --strict --json .niceeval/ci-summary.json -
|
|
|
151
154
|
npx niceeval view
|
|
152
155
|
```
|
|
153
156
|
|
|
154
|
-
打开本地结果查看器。它和 `show` 共用同一份默认报告和同一套默认选择——对每个 experiment
|
|
157
|
+
打开本地结果查看器。它和 `show` 共用同一份默认报告和同一套默认选择——对每个 experiment、每个评估用例,取历次运行里最新的判定;每个 experiment 的集合来自快照 `selectedEvalIds`。默认报告直接比较当前 Scope。评估用例 ID 前缀、`--exp`、`--results` 对两者的收窄一致。
|
|
155
158
|
|
|
156
159
|
## `show [id-prefix...]`
|
|
157
160
|
|
|
@@ -159,21 +162,21 @@ npx niceeval view
|
|
|
159
162
|
npx niceeval show
|
|
160
163
|
npx niceeval show weather/brooklyn
|
|
161
164
|
npx niceeval show @1k2m9qrs
|
|
162
|
-
npx niceeval show @1k2m9qrs --
|
|
165
|
+
npx niceeval show @1k2m9qrs --source
|
|
163
166
|
npx niceeval show @1k2m9qrs --execution
|
|
164
167
|
npx niceeval show fixtures/button --diff
|
|
165
168
|
npx niceeval show weather/brooklyn --history
|
|
166
169
|
```
|
|
167
170
|
|
|
168
|
-
`show` 是终端结果入口,适合人直接阅读,也适合 coding agent
|
|
171
|
+
`show` 是终端结果入口,适合人直接阅读,也适合 coding agent 在上下文窗口里逐级下钻。位置参数选「看哪些评估用例」(ID 前缀)或直接用 `@<locator>` 精确选一个 attempt;不带位置参数时直接比较当前 Scope,`--exp` 按 experiment id 路径收窄。
|
|
169
172
|
|
|
170
|
-
`@<locator>` 不带证据 flag 时给出该 attempt 的紧凑全景(断言摘要、执行摘要、可选 OTel 时间、diff 摘要);`--
|
|
173
|
+
`@<locator>` 不带证据 flag 时给出该 attempt 的紧凑全景(断言摘要、执行摘要、可选 OTel 时间、diff 摘要);`--source`、`--execution`、`--diff` 是同一 attempt 的证据切面,分别展开运行时保存的评估用例源码、标准执行事件流、工作区文件改动,因此必须搭配 `@<locator>` 精确指名一个 attempt。`--results <目录>` 指定结果根,`--history` 查看跨 run 趋势。完整的阅读顺序、输出示例和 artifact 说明见[查看结果](/zh/tutorials/viewing-results)。
|
|
171
174
|
|
|
172
175
|
## `--early-exit` 与 `--strict`
|
|
173
176
|
|
|
174
|
-
`--early-exit` 默认就是 `true
|
|
177
|
+
`--early-exit` 默认就是 `true`:某个评估用例的一次 attempt 通过后,会自动停止该评估用例剩余的 attempts(省钱)。所以显式传 `--early-exit` 没有效果,真正有用的是反过来关掉它——`--no-early-exit`,让 `--runs` > 1 时把每次 attempt 都跑完(测真实通过率而非提前收尾)。
|
|
175
178
|
|
|
176
|
-
`--strict` 不是"更严格地报错",而是改变软阈值断言的判定:`.atLeast(n)` 这类软阈值(`soft` severity
|
|
179
|
+
`--strict` 不是"更严格地报错",而是改变软阈值断言的判定:`.atLeast(n)` 这类软阈值(`soft` severity)平时失败不会把整条评估用例判为 `failed`(只是记一条不达标的断言),加了 `--strict` 之后,软阈值没达标也会让整条评估用例的 verdict 计为 `failed`。CI 中推荐加上,避免"断言分数不够但评估用例显示通过"的情况被放过。
|
|
177
180
|
|
|
178
181
|
## 环境变量覆盖
|
|
179
182
|
|
|
@@ -194,8 +197,8 @@ npx niceeval show weather/brooklyn --history
|
|
|
194
197
|
|
|
195
198
|
| 退出码 | 含义 |
|
|
196
199
|
|---|---|
|
|
197
|
-
| `0` |
|
|
198
|
-
| `1` | 存在 `failed` / `errored`
|
|
200
|
+
| `0` | 全部评估用例通过(或 `list`、`init`、`clean` 等命令正常完成)。 |
|
|
201
|
+
| `1` | 存在 `failed` / `errored` 的评估用例;或命令用法错误(如 `exp` 没匹配到任何实验、传了不支持的 flag 组合)。 |
|
|
199
202
|
| `2` | 运行时崩溃(未捕获异常),CLI 顶层兜底捕获后退出。 |
|
|
200
203
|
| `130` | 收到中断信号(Ctrl-C / SIGTERM)后退出。 |
|
|
201
204
|
|