niceeval 0.9.1 → 0.10.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 +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 +10 -0
- package/dist/report/components/attempt-detail/AttemptConversation.js +74 -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 +97 -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 +297 -0
- package/dist/report/components/attempt-detail/faces.d.ts +14 -0
- package/dist/report/components/attempt-detail/faces.js +239 -0
- package/dist/report/components/attempt-detail/index.d.ts +38 -0
- package/dist/report/components/attempt-detail/index.js +547 -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 +4 -5
- package/dist/report/{react → components/entity-lists}/ExperimentList.js +12 -11
- 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 +175 -0
- package/dist/report/components/entity-lists/index.d.ts +49 -0
- package/dist/report/components/entity-lists/index.js +169 -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 +27 -60
- 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} +13 -7
- package/dist/report/{format.js → model/format.js} +79 -9
- 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} +154 -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 +151 -24
- package/dist/sandbox/docker.d.ts +6 -0
- package/dist/sandbox/e2b.d.ts +0 -1
- 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 +6 -6
- 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 +17 -13
- 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 +36 -33
- 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 +195 -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 +102 -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 +60 -57
- package/docs-site/zh/tutorials/write-experiment.mdx +353 -0
- package/docs-site/zh/{how-to → tutorials}/write-send.mdx +40 -40
- package/package.json +10 -7
- 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 +75 -59
- 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/o11y/prices.json +176 -99
- package/src/report/{react → assets}/colors.ts +22 -0
- package/src/report/{react → assets}/enhance.js +1 -33
- package/src/report/assets/styles.css +1785 -0
- 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 +158 -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 +224 -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 +758 -0
- package/src/report/components/attempt-detail/compute.ts +336 -0
- package/src/report/components/attempt-detail/faces.ts +260 -0
- package/src/report/components/attempt-detail/index.tsx +600 -0
- package/src/report/components/attempt-detail/validate.test.ts +252 -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 +33 -27
- package/src/report/components/entity-lists/compute.ts +196 -0
- package/src/report/components/entity-lists/faces.ts +208 -0
- package/src/report/components/entity-lists/index.tsx +238 -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 +42 -70
- 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 +66 -26
- 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 +128 -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} +89 -10
- 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} +159 -22
- package/src/report/react/index.tsx +54 -26
- package/src/report/{dual-render.test.tsx → runtime/dual-render.test.tsx} +601 -53
- 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 +160 -24
- package/src/sandbox/docker.ts +7 -0
- package/src/sandbox/e2b-reconcile.test.ts +125 -0
- package/src/sandbox/e2b.ts +47 -12
- 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 +143 -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/react/styles.css +0 -945
- 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
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "接入你的 Agent"
|
|
3
3
|
sidebarTitle: "接入 Agent"
|
|
4
|
-
description: "
|
|
4
|
+
description: "写一个 Adapter、配置一个 Experiment,并运行第一条评估用例;再把配置和参数从 Experiment 传给 Adapter 与被测应用。"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
把一个被测对象接入 [NiceEval](https://niceeval.com/) 需要一个 **Adapter**。`defineAgent` 包住一个 `send` 函数;该函数接收输入、驱动 Agent,并返回本轮结果。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
本教程先用 Adapter、Experiment 和评估用例跑通最小接入,再说明参数从 Experiment 到 Adapter 和被测应用的传递路径。事件流、多轮、HITL 与 tracing 属于可选能力,文末列出对应教程。
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 按被测对象选择接入方式
|
|
12
12
|
|
|
13
13
|
<CardGroup cols={3}>
|
|
14
14
|
<Card title="AI SDK 应用" icon="bolt" href="/zh/reference/builtin-agents">
|
|
15
|
-
|
|
15
|
+
Vercel AI SDK 应用可使用内置适配器连接现有 HTTP 接口。
|
|
16
16
|
</Card>
|
|
17
|
-
<Card title="
|
|
18
|
-
|
|
17
|
+
<Card title="Agent" icon="terminal" href="/zh/tutorials/sandbox-agent">
|
|
18
|
+
评估 Claude Code / Codex / bub 这种独立的 Agent:用内置 Sandbox Agent。
|
|
19
19
|
</Card>
|
|
20
20
|
<Card title="其它 AI Agent" icon="plug">
|
|
21
|
-
|
|
21
|
+
自己的 Agent 需要 [编写 Send](/zh/tutorials/write-send)。如应用已有 OTel 埋点,可 [接入OTel ](/zh/tutorials/connect-otel)
|
|
22
22
|
</Card>
|
|
23
23
|
</CardGroup>
|
|
24
24
|
|
|
25
|
-
##
|
|
25
|
+
## 最小接入示例
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
以下步骤假设项目已经运行 `npx niceeval init`,并包含 `niceeval.config.ts` 和 `evals/` 目录。三个文件各有一项职责:**Adapter 连接被测系统,Experiment 固定运行配置,评估用例定义交互和断言。**
|
|
28
28
|
|
|
29
|
-
**1. 写
|
|
29
|
+
**1. 写 Adapter。** 最小接入只填 `status` 和 `events`,把 Agent 回复放进一条 `message` 事件。
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
|
-
// agents/my-
|
|
32
|
+
// agents/my-agent.ts
|
|
33
33
|
import { defineAgent } from "niceeval/adapter";
|
|
34
34
|
|
|
35
35
|
export default defineAgent({
|
|
36
|
-
name: "my-
|
|
36
|
+
name: "my-agent",
|
|
37
37
|
async send(input, ctx) {
|
|
38
38
|
// 示例地址:换成你自己 agent 的真实端点(HTTP、CLI、SDK 都行,只要 send 里能拿到回复文本)
|
|
39
39
|
const r = await fetch("http://localhost:3000/chat", {
|
|
@@ -51,33 +51,28 @@ export default defineAgent({
|
|
|
51
51
|
});
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
URL
|
|
54
|
+
最小示例先使用固定 URL。需要按环境传入 URL 时,使用下文的[参数传递方式](#实验-flag)。`send` 的完整契约(`TurnInput` / `AgentContext` / `Turn` 各字段)见 [Adapter](/zh/explanation/adapter)。
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
即使 Agent runtime 和评估用例位于同一个代码库,也应通过像前端用户一样调用接口,也不要把 `fetch` 换成进程内函数调用,因为
|
|
57
|
+
- **代码内部调用不是用户走的那条链路。** HTTP 层、序列化、中间件、流式传输全被绕过,评估用例通过不代表线上行为正确。
|
|
58
|
+
- **Adapter 无法复用于其它部署环境。** HTTP Adapter 只需更换 `baseUrl`,即可连接本地、预发或生产环境(见下文两个 Experiment 文件);进程内调用依赖当前代码库。
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
- **进程不隔离,结果不可复现。** 被测代码的崩溃、全局状态、内存泄漏会连累运行器;并发跑多条 eval 时共享状态互相污染。
|
|
60
|
-
- **超时与取消会失效。** `ctx.signal` 挂在请求上才能真正掐掉一轮跑飞的 agent;进程内的函数调用停不下来。
|
|
61
|
-
- **adapter 会被焊死在这个代码库里。** 走 HTTP 的 adapter 换个 `baseUrl` 就能对着本地 / 预发 / 生产跑(见下文两个 experiment 文件的写法);直调做不到。
|
|
62
|
-
|
|
63
|
-
起一个本地 dev server 的成本只是一条命令,上面这些换不来。
|
|
64
|
-
|
|
65
|
-
**2. 注册进一个 experiment:**
|
|
60
|
+
**2. 实验**
|
|
66
61
|
|
|
67
62
|
```ts
|
|
68
|
-
// experiments/my-
|
|
63
|
+
// experiments/my-agent.ts
|
|
69
64
|
import { defineExperiment } from "niceeval";
|
|
70
|
-
import
|
|
65
|
+
import myAgent from "../agents/my-agent.ts";
|
|
71
66
|
|
|
72
67
|
export default defineExperiment({
|
|
73
|
-
description: "my-
|
|
74
|
-
agent:
|
|
68
|
+
description: "my-agent 基线",
|
|
69
|
+
agent: myAgent,
|
|
75
70
|
model: "gpt-4o",
|
|
76
71
|
runs: 1,
|
|
77
72
|
});
|
|
78
73
|
```
|
|
79
74
|
|
|
80
|
-
**3.
|
|
75
|
+
**3. 评估用例**
|
|
81
76
|
|
|
82
77
|
```ts
|
|
83
78
|
// evals/refund-policy.eval.ts
|
|
@@ -96,12 +91,12 @@ export default defineEval({
|
|
|
96
91
|
```
|
|
97
92
|
|
|
98
93
|
```bash
|
|
99
|
-
npx niceeval exp my-
|
|
100
|
-
npx niceeval exp my-
|
|
94
|
+
npx niceeval exp my-agent # 跑这个 experiment 下的全部 eval
|
|
95
|
+
npx niceeval exp my-agent refund # 只跑 ID 以 refund 开头的
|
|
101
96
|
npx niceeval view # 本地查看器里看结果
|
|
102
97
|
```
|
|
103
98
|
|
|
104
|
-
|
|
99
|
+
**验证运行结果**:终端会显示动态 dashboard,完成和排队数量在原位更新;失败、错误和 warning 会保留在输出中。运行结束后会打印摘要、失败 locator 和结果路径。`npx niceeval view` 会显示每条评估用例逐轮的输入、事件和评分明细。
|
|
105
100
|
|
|
106
101
|
没跑通时,按报错的位置分三类排查:
|
|
107
102
|
|
|
@@ -109,25 +104,25 @@ npx niceeval view # 本地查看器里看结果
|
|
|
109
104
|
- **`t.succeeded()` 没过、本轮判定是 failed**:请求发出去了,但应用返回的 Turn 是 `failed`。把协议中的失败映射到 `Turn.status` 或标准 `error` event;需要额外保留的有限上下文用 `ctx.diagnostic(...)`,不要打印完整响应体。
|
|
110
105
|
- **只有内容断言没过**:接入本身已经通了——在 `view` 里对照 `t.reply` 的实际值,调断言或调应用。
|
|
111
106
|
|
|
112
|
-
|
|
107
|
+
完成这些步骤后,文本断言和 Judge 评分即可使用。工具、多轮和审批流断言需要继续添加文末列出的可选能力。
|
|
113
108
|
|
|
114
|
-
##
|
|
109
|
+
## 实验 Flag
|
|
115
110
|
|
|
116
111
|
配置归属只有两条通道,分清它们,接入就不会乱:
|
|
117
112
|
|
|
118
|
-
1. **静态配置走 Adapter 工厂。** URL
|
|
113
|
+
1. **静态配置走 Adapter 工厂。** URL、鉴权和协议细节等环境级配置作为工厂参数写在 Experiment 文件里。`defineExperiment` 的 `agent` 字段接收**已经配置好的实例**。
|
|
119
114
|
2. **每轮动态值走 `ctx`。** experiment 声明的 `model`、`flags`,运行器每轮经 `ctx` 原样递给 `send`;Adapter 不解释它们的含义,只随请求转发给应用。
|
|
120
115
|
|
|
121
|
-
|
|
116
|
+
把第一步的 `my-agent` 从固定 URL 的实例改成接收配置的工厂。将 default export 改为返回 `defineAgent(...)` 的函数,并让 `send` 读取工厂参数。Experiment 声明的 `model` 和 `flags` 每轮经 `ctx` 到达,再由 `send` 随请求转发:
|
|
122
117
|
|
|
123
118
|
```ts
|
|
124
|
-
// agents/my-
|
|
119
|
+
// agents/my-agent.ts —— 工厂:静态配置进闭包
|
|
125
120
|
import { defineAgent } from "niceeval/adapter";
|
|
126
121
|
import type { Agent } from "niceeval/adapter";
|
|
127
122
|
|
|
128
|
-
export function
|
|
123
|
+
export function myAgent(options: { baseUrl: string }): Agent {
|
|
129
124
|
return defineAgent({
|
|
130
|
-
name: "my-
|
|
125
|
+
name: "my-agent",
|
|
131
126
|
async send(input, ctx) {
|
|
132
127
|
const r = await fetch(`${options.baseUrl}/chat`, { // ← 工厂配置:连哪
|
|
133
128
|
method: "POST",
|
|
@@ -152,13 +147,13 @@ export function myBot(options: { baseUrl: string }): Agent {
|
|
|
152
147
|
鉴权 header、协议开关这类同属静态配置,一样加进 `options`。experiment 侧对应两处小改:具名导入工厂,`agent` 字段从「引用实例」变成「调用工厂」:
|
|
153
148
|
|
|
154
149
|
```ts
|
|
155
|
-
// experiments/my-
|
|
150
|
+
// experiments/my-agent.ts —— 参数的声明处
|
|
156
151
|
import { defineExperiment } from "niceeval";
|
|
157
|
-
import {
|
|
152
|
+
import { myAgent } from "../agents/my-agent.ts";
|
|
158
153
|
|
|
159
154
|
export default defineExperiment({
|
|
160
|
-
description: "my-
|
|
161
|
-
agent:
|
|
155
|
+
description: "my-agent 基线",
|
|
156
|
+
agent: myAgent({ baseUrl: "http://localhost:3000" }), // ← 静态配置:实例化时传
|
|
162
157
|
model: "gpt-5.4", // ← 动态值:经 ctx.model 到 send
|
|
163
158
|
flags: { promptVariant: "concise" }, // ← 动态值:经 ctx.flags 到 send
|
|
164
159
|
});
|
|
@@ -166,13 +161,13 @@ export default defineExperiment({
|
|
|
166
161
|
|
|
167
162
|
`ctx` 上每轮可能用到的字段和消费方式:
|
|
168
163
|
|
|
169
|
-
| `ctx` 字段 |
|
|
164
|
+
| `ctx` 字段 | 来源 | Adapter 用法 |
|
|
170
165
|
|---|---|---|
|
|
171
166
|
| `signal` | 运行器(超时与取消) | 挂到发出的每个请求上 |
|
|
172
167
|
| `model` | experiment 的 `model` | 应用接口收模型选择就随请求转发;不收就忽略 |
|
|
173
168
|
| `flags` | experiment 的 `flags` | 原样转发(请求体、header 都行),应用按参数切换变体 |
|
|
174
|
-
| `telemetry` | 配置了 OTel 接入时出现 | 只碰 `headers`:每轮新的 W3C `traceparent`,spread 进请求头。接收端点每次运行都一样,在 `defineConfig` 里固定、应用启动时指向它,不从 send 传——见 [OTel 接入](/zh/
|
|
175
|
-
| `session` | 运行器(每条会话线一份) | 会话续接与 HITL 停轮现场的存取器都在它上面:`history()`、`id` / `capture()`、`hold()` / `take()`,见[写 send](/zh/
|
|
169
|
+
| `telemetry` | 配置了 OTel 接入时出现 | 只碰 `headers`:每轮新的 W3C `traceparent`,spread 进请求头。接收端点每次运行都一样,在 `defineConfig` 里固定、应用启动时指向它,不从 send 传——见 [OTel 接入](/zh/tutorials/connect-otel) |
|
|
170
|
+
| `session` | 运行器(每条会话线一份) | 会话续接与 HITL 停轮现场的存取器都在它上面:`history()`、`id` / `capture()`、`hold()` / `take()`,见[写 send](/zh/tutorials/write-send) |
|
|
176
171
|
| `progress(update)` | 运行器(绑定当前 `agent.run`) | 报告 Turn/tool 的短期状态;Human dashboard 可显示,结果不保存 |
|
|
177
172
|
| `diagnostic(input)` | 运行器(绑定当前 `agent.run`) | 保存协议退化、响应不完整等 warning/error;可由 locator 下钻回顾 |
|
|
178
173
|
|
|
@@ -201,18 +196,18 @@ async send(input, ctx) {
|
|
|
201
196
|
|
|
202
197
|
终端只显示错误的一层摘要和 locator。完整 code、message、cause、stack 与 diagnostics 在 `result.json` 中,使用 `niceeval show @<locator>` 查看。OTel trace 只补充调用关系和耗时,不是错误记录的前提。
|
|
203
198
|
|
|
204
|
-
|
|
199
|
+
要分别评估本地和生产环境,创建两个 Experiment 文件,并传入不同的工厂参数:
|
|
205
200
|
|
|
206
201
|
```ts
|
|
207
202
|
// experiments/local.ts
|
|
208
203
|
export default defineExperiment({
|
|
209
|
-
agent:
|
|
204
|
+
agent: myAgent({ baseUrl: "http://localhost:3000" }),
|
|
210
205
|
model: "gpt-5.4",
|
|
211
206
|
});
|
|
212
207
|
|
|
213
208
|
// experiments/prod.ts
|
|
214
209
|
export default defineExperiment({
|
|
215
|
-
agent:
|
|
210
|
+
agent: myAgent({ baseUrl: "https://api.example.com" }),
|
|
216
211
|
model: "gpt-5.4",
|
|
217
212
|
});
|
|
218
213
|
```
|
|
@@ -222,31 +217,31 @@ npx niceeval exp local
|
|
|
222
217
|
npx niceeval exp prod
|
|
223
218
|
```
|
|
224
219
|
|
|
225
|
-
不要把 URL 放进 CLI 位置参数——experiment
|
|
220
|
+
不要把 URL 放进 CLI 位置参数——experiment 名之后的位置参数只用于过滤评估用例 ID。experiment 的完整字段(`runs`、`budget`、并发、`sandbox`)见[写实验](/zh/tutorials/write-experiment)。
|
|
226
221
|
|
|
227
|
-
##
|
|
222
|
+
## 添加可选能力
|
|
228
223
|
|
|
229
|
-
|
|
224
|
+
最小接入完成后,可以按需扩展 Adapter。已有评估用例不需要修改:
|
|
230
225
|
|
|
231
|
-
|
|
|
226
|
+
| 目标能力 | Adapter 改动 | 教程 |
|
|
232
227
|
|---|---|---|
|
|
233
|
-
| 工具断言(`calledTool` / `toolOrder` / 负断言) | 把应用返回映射成标准事件流 | [写 send](/zh/
|
|
234
|
-
| 多轮对话、`t.newSession()` 隔离 | 接上 `ctx.session`:`history()` 或 `id` + `capture()` | [写 send](/zh/
|
|
228
|
+
| 工具断言(`calledTool` / `toolOrder` / 负断言) | 把应用返回映射成标准事件流 | [写 send](/zh/tutorials/write-send)、[事件流参考](/zh/reference/events) |
|
|
229
|
+
| 多轮对话、`t.newSession()` 隔离 | 接上 `ctx.session`:`history()` 或 `id` + `capture()` | [写 send](/zh/tutorials/write-send) |
|
|
235
230
|
| 审批流(HITL,人工介入) | 停轮返回 `waiting` + `input.requested`,回答轮续跑 | [HITL](/zh/explanation/hitl) |
|
|
236
|
-
| `niceeval view` 的调用瀑布图 | 应用把 OTel span 发给 NiceEval(不影响断言) | [OTel 接入](/zh/
|
|
237
|
-
| feature A/B 对比 | 应用把变体暴露成 `flags` 可切换的配置 | [Tier](/zh/explanation/tier)、[写实验](/zh/
|
|
231
|
+
| `niceeval view` 的调用瀑布图 | 应用把 OTel span 发给 NiceEval(不影响断言) | [OTel 接入](/zh/tutorials/connect-otel) |
|
|
232
|
+
| feature A/B 对比 | 应用把变体暴露成 `flags` 可切换的配置 | [Tier](/zh/explanation/tier)、[写实验](/zh/tutorials/write-experiment) |
|
|
238
233
|
|
|
239
|
-
|
|
234
|
+
各项能力对应的接入等级和功能范围见 [Tier](/zh/explanation/tier)。
|
|
240
235
|
|
|
241
236
|
## 参考实现
|
|
242
237
|
|
|
243
|
-
|
|
238
|
+
[`examples/zh/tier1`](https://github.com/CorrectRoadH/niceeval/tree/main/examples/zh/tier1) 提供五个可运行的无侵入接入示例(ai-sdk-v7、claude-sdk、codex-sdk、pi-sdk、langgraph),覆盖事件流断言、多轮隔离、HITL 批准与拒绝,以及 trace 瀑布图。手写 `send` 只需实现 transport 和映射表;会话续接与 HITL 暂停恢复由 `ctx.session` 提供,逐帧驱动可使用内置实现,见[内置 Agent 能力](/zh/reference/builtin-agents)。
|
|
244
239
|
|
|
245
240
|
## 相关阅读
|
|
246
241
|
|
|
247
|
-
- [官方适配器一览](/zh/reference/official-adapters) ——
|
|
248
|
-
- [写 send](/zh/
|
|
242
|
+
- [官方适配器一览](/zh/reference/official-adapters) —— 查看 Sandbox 与非 Sandbox Adapter 及其配置项。
|
|
243
|
+
- [写 send](/zh/tutorials/write-send) —— 手写 Adapter 的完整教程:七步递进,从发一条消息到 HITL、OTel、flags。
|
|
249
244
|
- [Adapter](/zh/explanation/adapter) —— `send` 的契约:`TurnInput` / `AgentContext` / `Turn` 逐字段。
|
|
250
|
-
- [OTel 接入](/zh/
|
|
251
|
-
- [Tier](/zh/explanation/tier) ——
|
|
252
|
-
- [写实验](/zh/
|
|
245
|
+
- [OTel 接入](/zh/tutorials/connect-otel) —— 把应用的 span 也发给 [NiceEval](https://niceeval.com/),换 `niceeval view` 的调用瀑布图。
|
|
246
|
+
- [Tier](/zh/explanation/tier) —— 查看三个接入等级的要求与能力。
|
|
247
|
+
- [写实验](/zh/tutorials/write-experiment) —— `defineExperiment` 的完整字段。
|