niceeval 0.6.1 → 0.7.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 +23 -23
- package/README.zh.md +6 -6
- package/dist/agents/types.d.ts +69 -7
- package/dist/context/types.d.ts +32 -12
- package/dist/i18n/en.d.ts +54 -0
- package/dist/i18n/zh-CN.d.ts +57 -3
- package/dist/o11y/types.d.ts +16 -2
- package/dist/report/aggregate.d.ts +32 -24
- package/dist/report/aggregate.js +158 -50
- package/dist/report/built-in/index.d.ts +2 -0
- package/dist/report/built-in/index.js +8 -0
- package/dist/report/components.d.ts +93 -160
- package/dist/report/components.js +377 -114
- package/dist/report/compute.d.ts +87 -81
- package/dist/report/compute.js +597 -417
- package/dist/report/flag.d.ts +32 -6
- package/dist/report/flag.js +92 -4
- package/dist/report/format.d.ts +19 -11
- package/dist/report/format.js +30 -13
- package/dist/report/index.d.ts +16 -16
- package/dist/report/index.js +20 -21
- package/dist/report/load.js +3 -2
- package/dist/report/locale.d.ts +57 -33
- package/dist/report/locale.js +122 -56
- package/dist/report/metrics.d.ts +23 -4
- package/dist/report/metrics.js +110 -25
- package/dist/report/primitives.d.ts +48 -15
- package/dist/report/primitives.js +135 -26
- package/dist/report/react/AttemptList.d.ts +9 -7
- package/dist/report/react/AttemptList.js +17 -10
- package/dist/report/react/DeltaTable.js +19 -18
- package/dist/report/react/EvalList.d.ts +4 -4
- package/dist/report/react/EvalList.js +0 -0
- package/dist/report/react/ExperimentComparison.d.ts +10 -0
- package/dist/report/react/ExperimentComparison.js +12 -0
- package/dist/report/react/ExperimentList.d.ts +4 -3
- package/dist/report/react/ExperimentList.js +17 -18
- package/dist/report/react/MetricBars.js +5 -4
- package/dist/report/react/MetricLine.js +12 -5
- package/dist/report/react/MetricMatrix.js +1 -1
- package/dist/report/react/MetricScatter.js +59 -28
- package/dist/report/react/MetricTable.js +2 -12
- package/dist/report/react/ScopeSummary.d.ts +10 -0
- package/dist/report/react/ScopeSummary.js +17 -0
- package/dist/report/react/Scoreboard.js +6 -6
- package/dist/report/react/cell.js +2 -2
- package/dist/report/react/chart-math.d.ts +23 -6
- package/dist/report/react/chart-math.js +71 -19
- package/dist/report/react/fixtures.d.ts +5 -9
- package/dist/report/react/fixtures.js +110 -147
- package/dist/report/react/index.d.ts +15 -5
- package/dist/report/react/index.js +18 -7
- package/dist/report/report.d.ts +137 -16
- package/dist/report/report.js +259 -28
- package/dist/report/text/faces.d.ts +17 -19
- package/dist/report/text/faces.js +253 -184
- package/dist/report/text/plot.js +1 -1
- package/dist/report/text/table.js +38 -7
- package/dist/report/tree.d.ts +90 -40
- package/dist/report/tree.js +252 -94
- package/dist/report/types.d.ts +247 -284
- package/dist/report/types.js +4 -3
- package/dist/report/web.d.ts +21 -5
- package/dist/report/web.js +42 -16
- package/dist/results/select.d.ts +38 -16
- package/dist/results/select.js +73 -25
- package/dist/results/types.d.ts +49 -14
- package/dist/runner/feedback/sink.d.ts +110 -0
- package/dist/runner/types.d.ts +513 -22
- package/dist/sandbox/docker.d.ts +23 -2
- package/dist/sandbox/e2b.d.ts +15 -1
- package/dist/sandbox/errors.d.ts +30 -3
- package/dist/sandbox/io-retry.d.ts +17 -0
- package/dist/sandbox/registry.d.ts +2 -0
- package/dist/sandbox/resolve.d.ts +18 -5
- package/dist/sandbox/retry.d.ts +11 -1
- package/dist/sandbox/types.d.ts +39 -5
- package/dist/sandbox/vercel.d.ts +7 -1
- package/dist/scoring/coverage.d.ts +30 -0
- package/dist/scoring/display.d.ts +21 -0
- package/dist/scoring/display.js +120 -0
- package/dist/scoring/types.d.ts +103 -20
- package/dist/shared/aggregate.d.ts +4 -2
- package/dist/shared/aggregate.js +8 -7
- package/dist/shared/types.d.ts +28 -0
- package/dist/tty-line.d.ts +0 -4
- package/dist/util.d.ts +23 -0
- package/docs-site/zh/README.md +44 -0
- package/docs-site/zh/examples/ai-agent-application.mdx +63 -0
- package/docs-site/zh/examples/coding-agent-extensions.mdx +57 -0
- package/docs-site/zh/examples/index.mdx +50 -0
- package/docs-site/zh/{concepts → explanation}/adapter.mdx +31 -13
- package/docs-site/zh/{concepts → explanation}/assert.mdx +7 -7
- package/docs-site/zh/{concepts → explanation}/drive.mdx +8 -8
- package/docs-site/zh/{concepts → explanation}/evals.mdx +4 -4
- package/docs-site/zh/{concepts → explanation}/experiment.mdx +8 -8
- package/docs-site/zh/{concepts → explanation}/hitl.mdx +8 -8
- package/docs-site/zh/{concepts → explanation}/judge.mdx +5 -5
- package/docs-site/zh/{concepts → explanation}/overview.mdx +11 -11
- package/docs-site/zh/{guides → explanation}/runner.mdx +18 -8
- package/docs-site/zh/{concepts → explanation}/tier.mdx +6 -6
- package/docs-site/zh/{guides → how-to}/agent-feedback-loop.mdx +35 -33
- package/docs-site/zh/{guides → how-to}/authoring.mdx +35 -2
- package/docs-site/zh/{guides → how-to}/ci-integration.mdx +23 -12
- package/docs-site/zh/{guides → how-to}/connect-otel.mdx +6 -6
- package/docs-site/zh/{guides → how-to}/connect-your-agent.mdx +47 -21
- package/docs-site/zh/{guides → how-to}/custom-reports.mdx +34 -39
- package/docs-site/zh/{guides → how-to}/dataset-fanout.mdx +25 -3
- package/docs-site/zh/{guides → how-to}/experiments.mdx +12 -5
- package/docs-site/zh/how-to/publish-report.mdx +105 -0
- package/docs-site/zh/{guides → how-to}/reporters.mdx +2 -2
- package/docs-site/zh/{guides → how-to}/sandbox-agent.mdx +56 -7
- package/docs-site/zh/how-to/sandbox-providers.mdx +350 -0
- package/docs-site/zh/{guides → how-to}/scoring-guide.mdx +4 -4
- package/docs-site/zh/{guides → how-to}/viewing-results.mdx +82 -39
- package/docs-site/zh/{guides → how-to}/write-experiment.mdx +6 -4
- package/docs-site/zh/{guides → how-to}/write-send.mdx +30 -14
- package/docs-site/zh/index.mdx +24 -26
- package/docs-site/zh/introduction.mdx +8 -8
- package/docs-site/zh/reference/builtin-agents.mdx +32 -5
- package/docs-site/zh/reference/capabilities.mdx +8 -8
- package/docs-site/zh/reference/cli.mdx +40 -12
- package/docs-site/zh/reference/define-agent.mdx +58 -5
- package/docs-site/zh/reference/define-config.mdx +1 -1
- package/docs-site/zh/reference/define-eval.mdx +42 -9
- package/docs-site/zh/reference/events.mdx +3 -3
- package/docs-site/zh/reference/expect.mdx +26 -1
- package/docs-site/zh/{guides → reference}/official-adapters.mdx +32 -8
- package/docs-site/zh/{guides → reference}/report-components.mdx +45 -33
- package/docs-site/zh/{guides → reference}/results-data.mdx +21 -13
- package/docs-site/zh/troubleshooting/debug-sandbox.mdx +57 -0
- package/docs-site/zh/troubleshooting/debugging.mdx +212 -0
- package/docs-site/zh/{quickstart.mdx → tutorials/quickstart.mdx} +5 -17
- package/package.json +10 -2
- package/src/agents/ai-sdk-otel.test.ts +1 -0
- package/src/agents/ai-sdk.test.ts +3 -0
- package/src/agents/ai-sdk.ts +3 -0
- package/src/agents/bub-install-spec.test.ts +34 -0
- package/src/agents/bub-install-spec.ts +32 -0
- package/src/agents/bub.ts +31 -32
- package/src/agents/claude-code.test.ts +130 -9
- package/src/agents/claude-code.ts +76 -4
- package/src/agents/codex.test.ts +189 -40
- package/src/agents/codex.ts +155 -14
- package/src/agents/coding-cli-versions.test.ts +15 -0
- package/src/agents/coding-cli-versions.ts +3 -0
- package/src/agents/index.ts +13 -2
- package/src/agents/langgraph.test.ts +204 -0
- package/src/agents/langgraph.ts +495 -0
- package/src/agents/marketplace.ts +85 -0
- package/src/agents/native-config.test.ts +179 -0
- package/src/agents/native-config.ts +267 -0
- package/src/agents/openai-compat.test.ts +1 -0
- package/src/agents/openai-compat.ts +1 -1
- package/src/agents/openclaw.test.ts +31 -0
- package/src/agents/openclaw.ts +171 -0
- package/src/agents/plugin-config.test.ts +1 -0
- package/src/agents/sdk-streams.test.ts +79 -0
- package/src/agents/sdk-streams.ts +55 -10
- package/src/agents/skills.test.ts +1 -0
- package/src/agents/streaming.test.ts +3 -9
- package/src/agents/streaming.ts +2 -2
- package/src/agents/types.ts +71 -8
- package/src/agents/ui-message-stream.test.ts +3 -0
- package/src/cli.ts +446 -124
- package/src/context/context.test.ts +51 -12
- package/src/context/context.ts +162 -30
- package/src/context/session.test.ts +2 -1
- package/src/context/session.ts +115 -7
- package/src/context/types.ts +30 -12
- package/src/define.test.ts +13 -8
- package/src/define.ts +25 -4
- package/src/expect/index.ts +53 -23
- package/src/i18n/en.ts +81 -17
- package/src/i18n/zh-CN.ts +80 -17
- package/src/o11y/cost.test.ts +1 -0
- package/src/o11y/execution-tree.test.ts +1 -20
- package/src/o11y/otlp/mappers/claude-code.test.ts +1 -0
- package/src/o11y/otlp/parse.test.ts +1 -0
- package/src/o11y/otlp/turn-otel.test.ts +1 -0
- package/src/o11y/parsers/bub.test.ts +1 -0
- package/src/o11y/parsers/claude-code.test.ts +1 -34
- package/src/o11y/parsers/openclaw.test.ts +154 -0
- package/src/o11y/parsers/openclaw.ts +310 -0
- package/src/o11y/prices.json +746 -311
- package/src/o11y/tool-names.test.ts +1 -0
- package/src/o11y/types.ts +16 -2
- package/src/report/aggregate.ts +178 -61
- package/src/report/built-in/index.tsx +9 -0
- package/src/report/components.tsx +625 -279
- package/src/report/compute.ts +723 -491
- package/src/report/dual-render.test.tsx +741 -1024
- package/src/report/flag.ts +104 -12
- package/src/report/format.ts +32 -12
- package/src/report/index.ts +119 -46
- package/src/report/load.ts +3 -2
- package/src/report/locale.ts +136 -65
- package/src/report/metrics.ts +108 -25
- package/src/report/primitives.tsx +196 -45
- package/src/report/react/AttemptList.tsx +30 -43
- package/src/report/react/DeltaTable.tsx +63 -45
- package/src/report/react/EvalList.tsx +0 -0
- package/src/report/react/ExperimentComparison.tsx +73 -0
- package/src/report/react/ExperimentList.tsx +50 -32
- package/src/report/react/MetricBars.tsx +5 -4
- package/src/report/react/MetricLine.tsx +13 -8
- package/src/report/react/MetricMatrix.tsx +2 -2
- package/src/report/react/MetricScatter.tsx +86 -34
- package/src/report/react/MetricTable.tsx +4 -76
- package/src/report/react/ScopeSummary.tsx +86 -0
- package/src/report/react/Scoreboard.tsx +28 -10
- package/src/report/react/cell.tsx +2 -2
- package/src/report/react/chart-math.test.ts +85 -0
- package/src/report/react/chart-math.ts +101 -22
- package/src/report/react/enhance.js +89 -5
- package/src/report/react/fixtures.ts +114 -154
- package/src/report/react/index.tsx +24 -39
- package/src/report/react/render.test.tsx +138 -158
- package/src/report/react/styles.css +243 -82
- package/src/report/report.test.ts +779 -841
- package/src/report/report.ts +423 -41
- package/src/report/text/faces.ts +290 -193
- package/src/report/text/plot.ts +1 -1
- package/src/report/text/table.ts +44 -7
- package/src/report/tree.ts +362 -104
- package/src/report/types.ts +261 -271
- package/src/report/web.ts +63 -20
- package/src/results/annotated-source.test.ts +62 -9
- package/src/results/annotated-source.ts +64 -6
- package/src/results/attempt-evidence.test.ts +13 -11
- package/src/results/attempt-evidence.ts +20 -13
- package/src/results/attempt-source.ts +6 -3
- package/src/results/copy.ts +150 -60
- package/src/results/host-equivalence.test.ts +34 -20
- package/src/results/index.ts +12 -4
- package/src/results/locator.test.ts +1 -22
- package/src/results/open.ts +15 -5
- package/src/results/publish.ts +149 -0
- package/src/results/results.test.ts +89 -54
- package/src/results/select.ts +104 -34
- package/src/results/truncate.ts +90 -0
- package/src/results/types.ts +43 -14
- package/src/results/writer.ts +31 -13
- package/src/runner/attempt.test.ts +138 -7
- package/src/runner/attempt.ts +603 -104
- package/src/runner/discover.test.ts +47 -0
- package/src/runner/discover.ts +36 -2
- package/src/runner/eval-source.test.ts +1 -27
- package/src/runner/feedback/agent.test.ts +504 -0
- package/src/runner/feedback/agent.ts +409 -0
- package/src/runner/feedback/ci.test.ts +562 -0
- package/src/runner/feedback/ci.ts +401 -0
- package/src/runner/feedback/coordinator.test.ts +317 -0
- package/src/runner/feedback/coordinator.ts +397 -0
- package/src/runner/feedback/failure.ts +40 -0
- package/src/runner/feedback/human.test.ts +616 -0
- package/src/runner/feedback/human.ts +535 -0
- package/src/runner/feedback/index.ts +66 -0
- package/src/runner/feedback/io.ts +78 -0
- package/src/runner/feedback/profile.test.ts +50 -0
- package/src/runner/feedback/profile.ts +58 -0
- package/src/runner/feedback/reducer.test.ts +395 -0
- package/src/runner/feedback/reducer.ts +260 -0
- package/src/runner/feedback/renderer.ts +82 -0
- package/src/runner/feedback/sink.ts +203 -0
- package/src/runner/feedback/testing.ts +106 -0
- package/src/runner/ledger.test.ts +230 -0
- package/src/runner/ledger.ts +329 -0
- package/src/runner/report.test.ts +128 -3
- package/src/runner/report.ts +33 -9
- package/src/runner/reporters/artifacts.ts +8 -2
- package/src/runner/reporters/braintrust.test.ts +8 -7
- package/src/runner/reporters/braintrust.ts +9 -2
- package/src/runner/reporters/index.ts +2 -2
- package/src/runner/reporters/json.test.ts +162 -0
- package/src/runner/reporters/json.ts +35 -8
- package/src/runner/reporters/shared.ts +1 -5
- package/src/runner/run.test.ts +760 -3
- package/src/runner/run.ts +243 -37
- package/src/runner/sandbox-prep.ts +3 -42
- package/src/runner/timing.ts +158 -0
- package/src/runner/types.ts +518 -22
- package/src/sandbox/checkpoint.test.ts +55 -0
- package/src/sandbox/checkpoint.ts +29 -8
- package/src/sandbox/cli-commands.ts +407 -0
- package/src/sandbox/docker.ts +115 -16
- package/src/sandbox/e2b-agent-template.test.ts +56 -0
- package/src/sandbox/e2b-agent-template.ts +94 -0
- package/src/sandbox/e2b.ts +74 -9
- package/src/sandbox/errors.ts +111 -4
- package/src/sandbox/index.ts +2 -0
- package/src/sandbox/io-retry.test.ts +58 -0
- package/src/sandbox/io-retry.ts +45 -0
- package/src/sandbox/keep-registry.test.ts +86 -0
- package/src/sandbox/keep-registry.ts +142 -0
- package/src/sandbox/keep.ts +178 -0
- package/src/sandbox/paths.test.ts +1 -0
- package/src/sandbox/paths.ts +19 -8
- package/src/sandbox/registry.ts +20 -3
- package/src/sandbox/resolve.ts +76 -11
- package/src/sandbox/retry.test.ts +70 -0
- package/src/sandbox/retry.ts +46 -4
- package/src/sandbox/types.ts +44 -6
- package/src/sandbox/vercel.ts +43 -20
- package/src/scoring/collector.ts +60 -17
- package/src/scoring/coverage.ts +95 -0
- package/src/scoring/diff.ts +81 -0
- package/src/scoring/display.test.ts +121 -0
- package/src/scoring/display.ts +133 -0
- package/src/scoring/evidence.test.ts +189 -0
- package/src/scoring/judge.test.ts +142 -0
- package/src/scoring/judge.ts +15 -18
- package/src/scoring/scoped.ts +217 -50
- package/src/scoring/types.ts +117 -20
- package/src/scoring/verdict.ts +16 -4
- package/src/shared/aggregate.ts +8 -6
- package/src/shared/types.ts +31 -0
- package/src/show/compose.ts +50 -67
- package/src/show/index.ts +127 -56
- package/src/show/render.ts +662 -131
- package/src/show/report-host.test.ts +188 -0
- package/src/show/report-host.ts +375 -0
- package/src/show/show.test.ts +320 -54
- package/src/tty-line.ts +8 -26
- package/src/util.test.ts +1 -0
- package/src/util.ts +41 -0
- package/src/view/app/App.test.tsx +69 -0
- package/src/view/app/App.tsx +144 -48
- package/src/view/app/components/AttemptModal.tsx +423 -11
- package/src/view/app/components/CodeView.tsx +41 -14
- package/src/view/app/components/CopyControls.tsx +2 -2
- package/src/view/app/i18n.ts +37 -17
- package/src/view/app/lib/attempt-route.test.ts +1 -0
- package/src/view/app/lib/verdict.ts +7 -9
- package/src/view/app/main.tsx +13 -8
- package/src/view/app/pages/{RunsPage.tsx → AttemptsPage.tsx} +6 -6
- package/src/view/app/types.ts +4 -1
- package/src/view/artifact-serving.test.ts +2 -1
- package/src/view/client-dist/app.css +1 -1
- package/src/view/client-dist/app.js +17 -17
- package/src/view/data.test.ts +10 -3
- package/src/view/data.ts +155 -49
- package/src/view/index.ts +56 -41
- package/src/view/server.ts +37 -15
- package/src/view/shared/types.ts +34 -5
- package/src/view/styles.css +227 -0
- package/src/view/view-report.test.ts +167 -62
- package/dist/report/built-ins/experiment-comparison.d.ts +0 -1
- package/dist/report/built-ins/experiment-comparison.js +0 -13
- package/dist/report/built-ins/index.d.ts +0 -1
- package/dist/report/built-ins/index.js +0 -2
- package/dist/report/react/GroupSummary.d.ts +0 -8
- package/dist/report/react/GroupSummary.js +0 -8
- package/dist/report/react/RunOverview.d.ts +0 -8
- package/dist/report/react/RunOverview.js +0 -12
- package/docs-site/zh/example/ai-agent-application.mdx +0 -152
- package/docs-site/zh/example/claude-code-codex-plugin.mdx +0 -167
- package/docs-site/zh/example/claude-code-codex-skill.mdx +0 -152
- package/docs-site/zh/example/showcase.mdx +0 -39
- package/docs-site/zh/guides/publish-report.mdx +0 -91
- package/docs-site/zh/guides/sandbox-providers.mdx +0 -102
- package/src/report/built-in-user-parity.test.tsx +0 -640
- package/src/report/built-ins/experiment-comparison.tsx +0 -19
- package/src/report/built-ins/index.ts +0 -2
- package/src/report/react/GroupSummary.tsx +0 -66
- package/src/report/react/RunOverview.tsx +0 -109
- package/src/runner/reporters/console.ts +0 -70
- package/src/runner/reporters/live.test.ts +0 -56
- package/src/runner/reporters/live.ts +0 -247
- package/src/runner/reporters/quiet.test.ts +0 -66
- package/src/runner/reporters/quiet.ts +0 -49
- package/src/runner/reporters/table.ts +0 -277
- /package/docs-site/zh/{example/tier1-ai-sdk-v7.mdx → examples/integrations/ai-sdk-v7.mdx} +0 -0
- /package/docs-site/zh/{example/tier1-claude-sdk.mdx → examples/integrations/claude-sdk.mdx} +0 -0
- /package/docs-site/zh/{example/tier1-codex-sdk.mdx → examples/integrations/codex-sdk.mdx} +0 -0
- /package/docs-site/zh/{example/tier1-langgraph.mdx → examples/integrations/langgraph.mdx} +0 -0
- /package/docs-site/zh/{example/tier1-pi-sdk.mdx → examples/integrations/pi-sdk.mdx} +0 -0
- /package/docs-site/zh/{guides → how-to}/fixtures.mdx +0 -0
package/INDEX.md
CHANGED
|
@@ -8,45 +8,45 @@
|
|
|
8
8
|
|
|
9
9
|
| 任务 | 读取 |
|
|
10
10
|
| --- | --- |
|
|
11
|
-
| 初始化并跑通第一条 Eval | `docs-site/zh/quickstart.mdx` |
|
|
12
|
-
| 理解 Adapter、Experiment、Eval 的分工 | `docs-site/zh/
|
|
13
|
-
| 接入自己的 Agent | `docs-site/zh/
|
|
14
|
-
| 选择官方 Adapter | `docs-site/zh/
|
|
15
|
-
| 接入 coding agent CLI | `docs-site/zh/
|
|
16
|
-
| 选择 Sandbox Provider | `docs-site/zh/
|
|
11
|
+
| 初始化并跑通第一条 Eval | `docs-site/zh/tutorials/quickstart.mdx` |
|
|
12
|
+
| 理解 Adapter、Experiment、Eval 的分工 | `docs-site/zh/explanation/overview.mdx` |
|
|
13
|
+
| 接入自己的 Agent | `docs-site/zh/how-to/connect-your-agent.mdx` |
|
|
14
|
+
| 选择官方 Adapter | `docs-site/zh/reference/official-adapters.mdx` |
|
|
15
|
+
| 接入 coding agent CLI | `docs-site/zh/how-to/sandbox-agent.mdx` |
|
|
16
|
+
| 选择 Sandbox Provider | `docs-site/zh/how-to/sandbox-providers.mdx` |
|
|
17
17
|
|
|
18
18
|
## 编写配置与 Eval
|
|
19
19
|
|
|
20
20
|
| 任务 | 读取 |
|
|
21
21
|
| --- | --- |
|
|
22
|
-
| 编写 Adapter | `docs-site/zh/
|
|
23
|
-
| 映射消息、工具调用和事件流 | `docs-site/zh/
|
|
24
|
-
| 编写 Experiment | `docs-site/zh/
|
|
25
|
-
| 编写 Eval | `docs-site/zh/
|
|
26
|
-
| 编写断言和评分 | `docs-site/zh/
|
|
27
|
-
| 配置 Judge | `docs-site/zh/
|
|
28
|
-
| 配置 OTel | `docs-site/zh/
|
|
22
|
+
| 编写 Adapter | `docs-site/zh/explanation/adapter.mdx`、`docs-site/zh/reference/define-agent.mdx` |
|
|
23
|
+
| 映射消息、工具调用和事件流 | `docs-site/zh/how-to/write-send.mdx`、`docs-site/zh/reference/events.mdx` |
|
|
24
|
+
| 编写 Experiment | `docs-site/zh/how-to/write-experiment.mdx` |
|
|
25
|
+
| 编写 Eval | `docs-site/zh/explanation/evals.mdx`、`docs-site/zh/reference/define-eval.mdx` |
|
|
26
|
+
| 编写断言和评分 | `docs-site/zh/how-to/authoring.mdx`、`docs-site/zh/how-to/scoring-guide.mdx`、`docs-site/zh/reference/expect.mdx` |
|
|
27
|
+
| 配置 Judge | `docs-site/zh/explanation/judge.mdx`、`docs-site/zh/reference/define-config.mdx` |
|
|
28
|
+
| 配置 OTel | `docs-site/zh/how-to/connect-otel.mdx` |
|
|
29
29
|
| 查 CLI 命令与 flag | `docs-site/zh/reference/cli.mdx` |
|
|
30
30
|
|
|
31
31
|
## 运行、调试与优化
|
|
32
32
|
|
|
33
33
|
| 任务 | 读取 |
|
|
34
34
|
| --- | --- |
|
|
35
|
-
| 让 AI 自主运行、观察、修改和重跑 | `docs-site/zh/
|
|
36
|
-
| 用 `show`、`view` 和 artifact 定位失败 | `docs-site/zh/
|
|
37
|
-
| 组织实验和对比 | `docs-site/zh/
|
|
38
|
-
| 编写自定义报告 | `docs-site/zh/
|
|
39
|
-
| 读取或转换结构化结果 | `docs-site/zh/
|
|
35
|
+
| 让 AI 自主运行、观察、修改和重跑 | `docs-site/zh/how-to/agent-feedback-loop.mdx` |
|
|
36
|
+
| 用 `show`、`view` 和 artifact 定位失败 | `docs-site/zh/how-to/viewing-results.mdx` |
|
|
37
|
+
| 组织实验和对比 | `docs-site/zh/how-to/experiments.mdx` |
|
|
38
|
+
| 编写自定义报告 | `docs-site/zh/how-to/custom-reports.mdx`、`docs-site/zh/reference/report-components.mdx` |
|
|
39
|
+
| 读取或转换结构化结果 | `docs-site/zh/reference/results-data.mdx` |
|
|
40
40
|
|
|
41
41
|
## 专项场景
|
|
42
42
|
|
|
43
43
|
| 任务 | 读取 |
|
|
44
44
|
| --- | --- |
|
|
45
|
-
| 评估 Claude Code / Codex Skill | `docs-site/zh/
|
|
46
|
-
| 评估 Plugin、Hook 或 MCP server | `docs-site/zh/
|
|
47
|
-
| 编写多轮会话 | `docs-site/zh/
|
|
48
|
-
| 编写人工审批流(HITL) | `docs-site/zh/
|
|
49
|
-
| 做 feature flag A/B 对比 | `docs-site/zh/
|
|
45
|
+
| 评估 Claude Code / Codex Skill | `docs-site/zh/examples/coding-agent-extensions.mdx` |
|
|
46
|
+
| 评估 Plugin、Hook 或 MCP server | `docs-site/zh/examples/coding-agent-extensions.mdx` |
|
|
47
|
+
| 编写多轮会话 | `docs-site/zh/explanation/adapter.mdx`、`docs-site/zh/how-to/write-send.mdx` |
|
|
48
|
+
| 编写人工审批流(HITL) | `docs-site/zh/explanation/hitl.mdx` |
|
|
49
|
+
| 做 feature flag A/B 对比 | `docs-site/zh/explanation/tier.mdx`、`docs-site/zh/explanation/experiment.mdx` |
|
|
50
50
|
|
|
51
51
|
## 版本规则
|
|
52
52
|
|
package/README.zh.md
CHANGED
|
@@ -80,7 +80,7 @@ NiceEval 支持两种接入方式,取决于被测 agent 是否需要隔离的
|
|
|
80
80
|
| Sandbox | 需要隔离工作区的 coding agent 才用得到;直连 Web Agent 不需要。 |
|
|
81
81
|
| Tier | 接入 Adapter 的三档投入:Tier 1 只接 send,Tier 2 加 OTel 换调用瀑布图,Tier 3 侵入改造做 feature A/B。 |
|
|
82
82
|
|
|
83
|
-
完整术语表见[架构概览](https://niceeval.com/docs/zh/
|
|
83
|
+
完整术语表见[架构概览](https://niceeval.com/docs/zh/explanation/overview)。
|
|
84
84
|
|
|
85
85
|
## 示例
|
|
86
86
|
|
|
@@ -134,9 +134,9 @@ READ https://niceeval.com/INIT.md and install niceeval for this repo.
|
|
|
134
134
|
|
|
135
135
|
从你的场景开始:
|
|
136
136
|
|
|
137
|
-
- [
|
|
138
|
-
- [
|
|
139
|
-
- [
|
|
137
|
+
- [浏览可运行示例](https://niceeval.com/docs/zh/examples)
|
|
138
|
+
- [评估 Coding Agent 扩展](https://niceeval.com/docs/zh/examples/coding-agent-extensions)
|
|
139
|
+
- [自写 Adapter 评估 AI Agent 应用](https://niceeval.com/docs/zh/examples/ai-agent-application)
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
## Roadmap
|
|
@@ -161,7 +161,7 @@ READ https://niceeval.com/INIT.md and install niceeval for this repo.
|
|
|
161
161
|
|
|
162
162
|
## 文档
|
|
163
163
|
|
|
164
|
-
- [快速开始](https://www.niceeval.com/docs/zh/quickstart)
|
|
164
|
+
- [快速开始](https://www.niceeval.com/docs/zh/tutorials/quickstart)
|
|
165
165
|
|
|
166
166
|
# 感谢
|
|
167
167
|
该项目受下面项目所启发或者是由AI从下面项目中学习代码所写
|
|
@@ -170,4 +170,4 @@ READ https://niceeval.com/INIT.md and install niceeval for this repo.
|
|
|
170
170
|
- [ponytail](https://github.com/DietrichGebert/ponytail)
|
|
171
171
|
|
|
172
172
|
感谢下列社区
|
|
173
|
-
- WIP
|
|
173
|
+
- WIP
|
package/dist/agents/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Cleanup } from "../shared/types.ts";
|
|
1
|
+
import type { Cleanup, DiagnosticInput, ProgressUpdate } from "../shared/types.ts";
|
|
2
2
|
import type { StreamEvent, TraceSpan, Usage } from "../o11y/types.ts";
|
|
3
3
|
import type { Sandbox } from "../sandbox/types.ts";
|
|
4
4
|
/**
|
|
@@ -75,11 +75,51 @@ export interface AgentSetupManifest {
|
|
|
75
75
|
command: string;
|
|
76
76
|
args?: string[];
|
|
77
77
|
}>;
|
|
78
|
+
/**
|
|
79
|
+
* 官方原生配置文件(Claude Code `settings.json` / Codex `config.toml`):只记 Agent 名、
|
|
80
|
+
* 项目相对来源路径与原始字节的 SHA-256,不落正文 —— 任意官方配置都可能携带敏感字符串,
|
|
81
|
+
* 不能靠字段白名单证明适合原样落盘。
|
|
82
|
+
*/
|
|
83
|
+
nativeConfigFile?: {
|
|
84
|
+
agent: "claude-code" | "codex";
|
|
85
|
+
path: string;
|
|
86
|
+
sha256: string;
|
|
87
|
+
};
|
|
78
88
|
/** Bub 的 Python Plugin(规范化后的 package 串)。 */
|
|
79
89
|
pythonPlugins?: Array<{
|
|
80
90
|
package: string;
|
|
81
91
|
}>;
|
|
82
92
|
}
|
|
93
|
+
/** 证据通道的覆盖状态。省略(不声明)= unknown,不是 complete——消费侧与 unavailable 同样保守。 */
|
|
94
|
+
export type CoverageStatus = "complete" | "partial" | "unavailable";
|
|
95
|
+
/** 单个证据通道的覆盖声明:状态 + 可选的人可读原因(如 "stream reconnected mid-turn")。 */
|
|
96
|
+
export interface CoverageDeclaration {
|
|
97
|
+
status: CoverageStatus;
|
|
98
|
+
reason?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* 覆盖声明(EvidenceCoverage):完整性不是口头承诺,是随数据走的声明
|
|
102
|
+
* (见 docs/feature/adapters/architecture/evidence.md)。两层:
|
|
103
|
+
* - Agent 级默认(`defineAgent` / `defineSandboxAgent` 的 `coverage`)声明该 Adapter 的常态覆盖;
|
|
104
|
+
* 官方 SDK 适配器显式声明全通道 complete(用 `completeCoverage` 常量)。
|
|
105
|
+
* - Turn 级降级(`Turn.coverage`)只用于相对 Agent 默认值降级(这一轮流断了 / 拿不到 usage),
|
|
106
|
+
* 不能把 Agent 未声明的通道升格成 complete。
|
|
107
|
+
* 整个 Agent 不声明时全部通道视为 unknown。
|
|
108
|
+
*/
|
|
109
|
+
export interface EvidenceCoverage {
|
|
110
|
+
/** 完整事件流(event / notEvent / order 的依据)。 */
|
|
111
|
+
events?: CoverageDeclaration;
|
|
112
|
+
/** action 生命周期(工具正负断言、顺序、失败的依据)。 */
|
|
113
|
+
actions?: CoverageDeclaration;
|
|
114
|
+
/** assistant / user message(reply、messageIncludes 的依据)。 */
|
|
115
|
+
messages?: CoverageDeclaration;
|
|
116
|
+
/** usage(token / cost 上限断言的依据)。 */
|
|
117
|
+
usage?: CoverageDeclaration;
|
|
118
|
+
/** Turn status 的真实性(succeeded / parked 的依据)——恒 completed 的映射必须声明非 complete。 */
|
|
119
|
+
status?: CoverageDeclaration;
|
|
120
|
+
/** Turn.data(outputEquals / outputMatches 的依据)。 */
|
|
121
|
+
data?: CoverageDeclaration;
|
|
122
|
+
}
|
|
83
123
|
/** 随一轮消息附带的文件(图片等多模态输入)。 */
|
|
84
124
|
export interface InputFile {
|
|
85
125
|
/** 文件名(可选,供 adapter / 模型参考)。 */
|
|
@@ -91,7 +131,7 @@ export interface InputFile {
|
|
|
91
131
|
}
|
|
92
132
|
/**
|
|
93
133
|
* HITL 回答轮里,人的裁决以结构化形式随 `input.responses` 到达——adapter 不需要解析
|
|
94
|
-
* `text` 去猜哪句回答对应哪个请求、算不算批准。见 docs-site/zh/
|
|
134
|
+
* `text` 去猜哪句回答对应哪个请求、算不算批准。见 docs-site/zh/explanation/adapter.mdx
|
|
95
135
|
* 「不同回答的入参」一节的四种典型形态。
|
|
96
136
|
*/
|
|
97
137
|
export interface InputResponse {
|
|
@@ -115,6 +155,11 @@ export interface Turn {
|
|
|
115
155
|
readonly data?: unknown;
|
|
116
156
|
readonly status: "completed" | "failed" | "waiting";
|
|
117
157
|
readonly usage?: Usage;
|
|
158
|
+
/**
|
|
159
|
+
* 本轮相对 Agent 默认覆盖的降级声明(这一轮流断了、拿不到 usage 等);
|
|
160
|
+
* 只能降级,不能把 Agent 未声明的通道升格成 complete(见 EvidenceCoverage)。
|
|
161
|
+
*/
|
|
162
|
+
readonly coverage?: EvidenceCoverage;
|
|
118
163
|
}
|
|
119
164
|
/**
|
|
120
165
|
* 本次运行的 OTLP traces 接收信息(仅当配置了 OTel 接入时有——agent 的 `tracing` 块 /
|
|
@@ -178,7 +223,7 @@ export interface AgentTracing {
|
|
|
178
223
|
* 新会话线(eval 第一轮 / t.newSession() 之后)拿到一个全新的。**
|
|
179
224
|
* 会话续接(`id`/`capture`、`history`)和 HITL 停轮现场(`hold`/`take`)的存取器都在它上面,
|
|
180
225
|
* "第一轮"是新会话线的自然形态,没有要判断的分支;`state` 是这些存取器之外的逃生舱,
|
|
181
|
-
* 框架从不往里写数据。见 docs-site/zh/
|
|
226
|
+
* 框架从不往里写数据。见 docs-site/zh/explanation/adapter.mdx「AgentContext」一节。
|
|
182
227
|
*/
|
|
183
228
|
export interface AgentSession {
|
|
184
229
|
/** 会话续接:服务端记历史。本线记过的会话 id;新会话线是 undefined。 */
|
|
@@ -241,10 +286,21 @@ export interface AgentContext {
|
|
|
241
286
|
*/
|
|
242
287
|
readonly telemetry?: Telemetry;
|
|
243
288
|
/**
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* (
|
|
289
|
+
* 作用域反馈:报告此刻正在做什么(turn / tool / 安装进度)。短命状态——Human profile
|
|
290
|
+
* 更新 active 行,`agent`/`ci` 不逐条打印,也不进最终结果;不要每个 token/delta 都调用。
|
|
291
|
+
* runner 按当前回调所处的生命周期阶段(agent.setup / agent.run / agent.teardown)归因,
|
|
292
|
+
* 调用方不能冒充其它阶段(见 docs/feature/experiments/library.md)。
|
|
293
|
+
*/
|
|
294
|
+
progress(update: ProgressUpdate): void;
|
|
295
|
+
/**
|
|
296
|
+
* 作用域反馈:报告运行结束后仍应保留的问题(协议降级、数据不完整、cleanup 问题)。
|
|
297
|
+
* 永久事件,落进 attempt 的 diagnostics 并进各 profile 的永久输出;`dedupeKey` 去重。
|
|
298
|
+
* 即使 level 为 "error" 也不改变 Turn.status / verdict——无法继续时抛异常。
|
|
299
|
+
*/
|
|
300
|
+
diagnostic(input: DiagnosticInput): void;
|
|
301
|
+
/**
|
|
302
|
+
* `progress({ message: msg })` 的别名,不是第二条通道(见 docs/feature/experiments/cli.md
|
|
303
|
+
* 「Attempt 阶段」)。超时失败时最近若干行会并入结果的 error 信息,方便定位卡在哪一步。
|
|
248
304
|
*/
|
|
249
305
|
log(msg: string): void;
|
|
250
306
|
}
|
|
@@ -272,6 +328,8 @@ export interface Agent {
|
|
|
272
328
|
* `t.sandbox`/`t.sandbox.fileChanged()` 等文件系统断言,见 docs-site「能力从哪来」一节。
|
|
273
329
|
*/
|
|
274
330
|
readonly kind: "sandbox" | "remote";
|
|
331
|
+
/** 该 Adapter 的常态证据覆盖声明;省略 = 全通道 unknown(见 EvidenceCoverage)。 */
|
|
332
|
+
coverage?: EvidenceCoverage;
|
|
275
333
|
setup?: AgentSetup;
|
|
276
334
|
/** OTLP 导出配置(仅当此字段存在时运行器才为该 agent 开 OTLP 接收);与 setup 分开,见 AgentTracing。 */
|
|
277
335
|
tracing?: AgentTracing;
|
|
@@ -284,6 +342,8 @@ export interface Agent {
|
|
|
284
342
|
export interface SandboxAgentDef {
|
|
285
343
|
/** agent 的显示名/标识,原样进入 `Agent.name`——不是注册表查找 key,只用于展示、结果归属与去重指纹。 */
|
|
286
344
|
name: string;
|
|
345
|
+
/** 该 Adapter 的常态证据覆盖声明(完整采集的用 `completeCoverage` 常量);省略 = 全通道 unknown。 */
|
|
346
|
+
coverage?: EvidenceCoverage;
|
|
287
347
|
/**
|
|
288
348
|
* 每个沙箱一次(不是每轮一次):装 CLI、写 config.toml / 鉴权配置(model/base/auth 等
|
|
289
349
|
* 本轮内不变的东西)。运行器在沙箱备好(上传/基线/eval.setup 之后)、第一次 send 前
|
|
@@ -303,6 +363,8 @@ export interface SandboxAgentDef {
|
|
|
303
363
|
export interface RemoteAgentDef {
|
|
304
364
|
/** agent 的显示名/标识,原样进入 `Agent.name`——不是注册表查找 key,只用于展示、结果归属与去重指纹。 */
|
|
305
365
|
name: string;
|
|
366
|
+
/** 该 Adapter 的常态证据覆盖声明(完整采集的用 `completeCoverage` 常量);省略 = 全通道 unknown。 */
|
|
367
|
+
coverage?: EvidenceCoverage;
|
|
306
368
|
/**
|
|
307
369
|
* 每个 attempt 一次(remote agent 没有真实沙箱,运行器会传入一个仅含 `workdir`/`sandboxId`/
|
|
308
370
|
* `otlpHost`/`stop` 等元信息的 stub `Sandbox`,其余方法调用即抛错——不要在这里调用
|
package/dist/context/types.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { InputRequest, StreamEvent, ToolCall, Usage } from "../o11y/types.ts";
|
|
2
|
+
import type { DiagnosticInput, ProgressUpdate } from "../shared/types.ts";
|
|
2
3
|
import type { AssertionHandle, ValueAssertion } from "../scoring/types.ts";
|
|
3
4
|
import type { CommandOptions, CommandResult, ReadSourceFilesOptions, SandboxFile, SourceFiles } from "../sandbox/types.ts";
|
|
5
|
+
/** `t.send()` / `session.send()` 的入参:字符串,或带附件的结构化消息。 */
|
|
6
|
+
export type SendInput = string | {
|
|
7
|
+
text: string;
|
|
8
|
+
files?: readonly import("../agents/types.ts").InputFile[];
|
|
9
|
+
};
|
|
4
10
|
/** t.send() 返回的句柄:从事件流派生便利字段 + expectOk。 */
|
|
5
11
|
export interface TurnHandle {
|
|
6
12
|
/** 本轮的原始事件流(工具调用、消息增量等);下面的派生字段都算自它。 */
|
|
@@ -51,8 +57,8 @@ export interface TurnHandle {
|
|
|
51
57
|
calledSubagent(name: string, match?: SubagentMatch): AssertionHandle;
|
|
52
58
|
/** 断言本轮事件按给定类型顺序出现(允许中间夹杂其它事件)。 */
|
|
53
59
|
eventOrder(types: StreamEvent["type"][]): AssertionHandle;
|
|
54
|
-
/**
|
|
55
|
-
eventsSatisfy(predicate: (events: readonly StreamEvent[]) => boolean
|
|
60
|
+
/** 用自定义谓词对本轮整段事件流断言;label 必填、进断言标题(谓词不透明,解释责任在 label)。 */
|
|
61
|
+
eventsSatisfy(label: string, predicate: (events: readonly StreamEvent[]) => boolean): AssertionHandle;
|
|
56
62
|
/** 断言本轮 token 用量不超过 max。 */
|
|
57
63
|
maxTokens(max: number): AssertionHandle;
|
|
58
64
|
/** 断言本轮花费(USD)不超过 usd。 */
|
|
@@ -90,7 +96,11 @@ export interface DiffView {
|
|
|
90
96
|
}
|
|
91
97
|
/** 工具匹配小语言。 */
|
|
92
98
|
export interface ToolMatch {
|
|
93
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* 只匹配入参包含这些键值的调用:**深度部分匹配**——嵌套对象逐键下钻,数组按值比较;
|
|
101
|
+
* 值可以是 RegExp(对字符串字段测试,不命中时再对整个 input 的序列化串兜底测一次)
|
|
102
|
+
* 或谓词函数。不要求深度相等,多余的入参键不影响命中。
|
|
103
|
+
*/
|
|
94
104
|
input?: Record<string, unknown>;
|
|
95
105
|
/** 精确匹配调用次数,省略则只要求「至少一次」。 */
|
|
96
106
|
count?: number;
|
|
@@ -173,8 +183,8 @@ export interface SandboxHandle {
|
|
|
173
183
|
* 只看最后一轮要用 `send()` 返回的 TurnHandle。
|
|
174
184
|
*/
|
|
175
185
|
export interface SessionHandle {
|
|
176
|
-
/**
|
|
177
|
-
send(
|
|
186
|
+
/** 在这个会话里发一条消息(字符串或结构化消息),返回该轮的 TurnHandle。 */
|
|
187
|
+
send(input: SendInput): Promise<TurnHandle>;
|
|
178
188
|
/** 在这个会话里发一条带文件的消息,语义同 TestContext.sendFile。 */
|
|
179
189
|
sendFile(path: string, text?: string): Promise<TurnHandle>;
|
|
180
190
|
/** 取这个会话里等待中的 HITL 输入请求;拿不到就抛,语义同 TestContext.requireInputRequest。 */
|
|
@@ -219,8 +229,8 @@ export interface SessionHandle {
|
|
|
219
229
|
calledSubagent(name: string, match?: SubagentMatch): AssertionHandle;
|
|
220
230
|
/** 断言这个会话累计事件按给定类型顺序出现。 */
|
|
221
231
|
eventOrder(types: StreamEvent["type"][]): AssertionHandle;
|
|
222
|
-
/**
|
|
223
|
-
eventsSatisfy(predicate: (events: readonly StreamEvent[]) => boolean
|
|
232
|
+
/** 用自定义谓词对这个会话累计的整段事件流断言;label 必填、进断言标题。 */
|
|
233
|
+
eventsSatisfy(label: string, predicate: (events: readonly StreamEvent[]) => boolean): AssertionHandle;
|
|
224
234
|
/** 断言这个会话累计 token 用量不超过 max。 */
|
|
225
235
|
maxTokens(max: number): AssertionHandle;
|
|
226
236
|
/** 断言这个会话累计花费(USD)不超过 usd。 */
|
|
@@ -235,8 +245,8 @@ export interface SessionHandle {
|
|
|
235
245
|
* 用一个宽接口承载全部动作(运行时按 capability 守卫)。
|
|
236
246
|
*/
|
|
237
247
|
export interface TestContext {
|
|
238
|
-
/**
|
|
239
|
-
send(
|
|
248
|
+
/** 向默认会话发一条消息(字符串或结构化消息),返回该轮的 TurnHandle。事件同时累加进默认会话的累计事件流,供下面的作用域断言使用。 */
|
|
249
|
+
send(input: SendInput): Promise<TurnHandle>;
|
|
240
250
|
/** 发一条带文件(图片等多模态输入)的消息。`path` 相对项目根;读出后 base64 随 TurnInput.files 交给 adapter。 */
|
|
241
251
|
sendFile(path: string, text?: string): Promise<TurnHandle>;
|
|
242
252
|
/** 取默认会话里等待中的 HITL 输入请求;不传 filter 要求恰好一条,拿不到就抛。 */
|
|
@@ -268,7 +278,17 @@ export interface TestContext {
|
|
|
268
278
|
readonly reasoningEffort?: string;
|
|
269
279
|
/** 本次 attempt 生效的实验 flags(experiment.flags 的只读视图;实验条件,非命令行开关)。 */
|
|
270
280
|
readonly flags: Readonly<Record<string, unknown>>;
|
|
271
|
-
/**
|
|
281
|
+
/**
|
|
282
|
+
* 作用域反馈:报告 eval 自己执行的长步骤(上传 fixture、跑构建……)。短命状态,scope 固定
|
|
283
|
+
* 为 `eval.run`;只报告不断言(见 docs/feature/eval/library/context.md「向运行反馈长步骤」)。
|
|
284
|
+
*/
|
|
285
|
+
progress(update: ProgressUpdate): void;
|
|
286
|
+
/**
|
|
287
|
+
* 作用域反馈:报告运行结束后仍需保留的问题(永久事件,落 attempt diagnostics)。
|
|
288
|
+
* 即使 level 为 "error" 也不自动改变 verdict——测试结论仍由断言决定。
|
|
289
|
+
*/
|
|
290
|
+
diagnostic(input: DiagnosticInput): void;
|
|
291
|
+
/** `progress({ message: msg })` 的别名(调试日志),不出现在最终结果里。 */
|
|
272
292
|
log(msg: string): void;
|
|
273
293
|
/** 立即中止本 eval 并标记为 skipped(verdict / EvalResult.skipReason),reason 不能为空。 */
|
|
274
294
|
skip(reason: string): never;
|
|
@@ -320,8 +340,8 @@ export interface TestContext {
|
|
|
320
340
|
calledSubagent(name: string, match?: SubagentMatch): AssertionHandle;
|
|
321
341
|
/** 断言默认会话累计事件按给定类型顺序出现(允许中间夹杂其它事件)。 */
|
|
322
342
|
eventOrder(types: StreamEvent["type"][]): AssertionHandle;
|
|
323
|
-
/**
|
|
324
|
-
eventsSatisfy(predicate: (events: readonly StreamEvent[]) => boolean
|
|
343
|
+
/** 用自定义谓词对默认会话累计的整段事件流断言;label 必填、进断言标题。 */
|
|
344
|
+
eventsSatisfy(label: string, predicate: (events: readonly StreamEvent[]) => boolean): AssertionHandle;
|
|
325
345
|
/** 受限沙箱视图:能执行命令 / 读写文件 / 看最终 diff,不能 stop 沙箱本身(见 SandboxHandle)。 */
|
|
326
346
|
readonly sandbox: SandboxHandle;
|
|
327
347
|
/** 默认会话累计的 token 用量与估算成本。 */
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare const en: {
|
|
|
12
12
|
"bub.installFailed": string;
|
|
13
13
|
"bub.setupNotRun": string;
|
|
14
14
|
"checkpoint.emptyTar": string;
|
|
15
|
+
"checkpoint.archiveFailed": string;
|
|
16
|
+
"checkpoint.restoreFailed": string;
|
|
15
17
|
"skill.localMissing": string;
|
|
16
18
|
"skill.localDirNoSkillFile": string;
|
|
17
19
|
"skill.localUnsupportedShape": string;
|
|
@@ -21,7 +23,16 @@ export declare const en: {
|
|
|
21
23
|
"skill.repoUnknownSkill": string;
|
|
22
24
|
"skill.copyFailed": string;
|
|
23
25
|
"plugin.marketplaceFailed": string;
|
|
26
|
+
"plugin.marketplaceVerifyFailed": string;
|
|
27
|
+
"plugin.marketplaceNameMismatch": string;
|
|
24
28
|
"plugin.installFailed": string;
|
|
29
|
+
"nativeConfig.pathNotProjectRelative": string;
|
|
30
|
+
"nativeConfig.missing": string;
|
|
31
|
+
"nativeConfig.escapesRoot": string;
|
|
32
|
+
"nativeConfig.notFile": string;
|
|
33
|
+
"nativeConfig.invalidSyntax": string;
|
|
34
|
+
"nativeConfig.reservedKeys": string;
|
|
35
|
+
"nativeConfig.uploadFailed": string;
|
|
25
36
|
"cli.all": string;
|
|
26
37
|
"cli.browserOpenFailed": string;
|
|
27
38
|
"cli.clean.done": string;
|
|
@@ -32,6 +43,7 @@ export declare const en: {
|
|
|
32
43
|
"cli.dry.row": string;
|
|
33
44
|
"cli.error": string;
|
|
34
45
|
"cli.flag.invalidNumber": string;
|
|
46
|
+
"cli.flag.invalidOutput": string;
|
|
35
47
|
"runner.budgetUnenforceable": string;
|
|
36
48
|
"judge.modelMissing": string;
|
|
37
49
|
"loaders.yamlMissing": string;
|
|
@@ -50,7 +62,10 @@ export declare const en: {
|
|
|
50
62
|
"cli.eval.noMatchHintExperiment": string;
|
|
51
63
|
"cli.eval.noMatchKnown": string;
|
|
52
64
|
"cli.exp.agentModelFlagUnsupported": string;
|
|
65
|
+
"cli.exp.viewerFlagUnsupported": string;
|
|
53
66
|
"cli.experiment.noMatch": string;
|
|
67
|
+
"cli.experiment.viewerCommandHint": string;
|
|
68
|
+
"cli.experiment.noEvalsSelected": string;
|
|
54
69
|
"cli.experimentGroup": string;
|
|
55
70
|
"cli.fallbackCleanupTimeout": string;
|
|
56
71
|
"cli.forceCleanupExit": string;
|
|
@@ -78,6 +93,7 @@ export declare const en: {
|
|
|
78
93
|
"define.evalIdRejected": string;
|
|
79
94
|
"define.evalTestRequired": string;
|
|
80
95
|
"define.experimentAgentRequired": string;
|
|
96
|
+
"define.experimentFlagNotJson": string;
|
|
81
97
|
"define.experimentIdRejected": string;
|
|
82
98
|
"define.sandboxAgentNameRequired": string;
|
|
83
99
|
"define.sandboxCreateRequired": string;
|
|
@@ -88,6 +104,41 @@ export declare const en: {
|
|
|
88
104
|
"docker.imagePullStart": string;
|
|
89
105
|
"docker.readFileFailed": string;
|
|
90
106
|
"docker.unsupportedRuntime": string;
|
|
107
|
+
"feedback.human.active": string;
|
|
108
|
+
"feedback.human.budgetExhausted": string;
|
|
109
|
+
"feedback.human.compare": string;
|
|
110
|
+
"feedback.human.counts": string;
|
|
111
|
+
"feedback.human.diffHint": string;
|
|
112
|
+
"feedback.human.evalHint": string;
|
|
113
|
+
"feedback.human.failuresHeader": string;
|
|
114
|
+
"feedback.human.heartbeat": string;
|
|
115
|
+
"feedback.human.inspect": string;
|
|
116
|
+
"feedback.human.moreActive": string;
|
|
117
|
+
"feedback.human.plan": string;
|
|
118
|
+
"feedback.human.resultFailed": string;
|
|
119
|
+
"feedback.human.resultIncomplete": string;
|
|
120
|
+
"feedback.human.resultInterrupted": string;
|
|
121
|
+
"feedback.human.resultPassed": string;
|
|
122
|
+
"feedback.human.resultsHeader": string;
|
|
123
|
+
"feedback.human.resultsMore": string;
|
|
124
|
+
"feedback.human.reuse": string;
|
|
125
|
+
"feedback.human.summaryLine": string;
|
|
126
|
+
"feedback.human.summaryAllReusedLine": string;
|
|
127
|
+
"feedback.human.suppressedFailures": string;
|
|
128
|
+
"feedback.human.trace": string;
|
|
129
|
+
"feedback.phase.agentSetup": string;
|
|
130
|
+
"feedback.phase.evalRun": string;
|
|
131
|
+
"feedback.phase.evalSetup": string;
|
|
132
|
+
"feedback.phase.sandboxCreate": string;
|
|
133
|
+
"feedback.phase.sandboxQueue": string;
|
|
134
|
+
"feedback.phase.sandboxSetup": string;
|
|
135
|
+
"feedback.phase.scoring": string;
|
|
136
|
+
"feedback.phase.teardown": string;
|
|
137
|
+
"feedback.phase.telemetryCollect": string;
|
|
138
|
+
"feedback.phase.telemetryConfigure": string;
|
|
139
|
+
"feedback.phase.workspaceBaseline": string;
|
|
140
|
+
"feedback.phase.workspaceDiff": string;
|
|
141
|
+
"feedback.rendererError": string;
|
|
91
142
|
"hitl.answerNeedsOptionOrText": string;
|
|
92
143
|
"hitl.invalidOption": string;
|
|
93
144
|
"hitl.noOptions": string;
|
|
@@ -139,6 +190,7 @@ export declare const en: {
|
|
|
139
190
|
"otel.portInUse": string;
|
|
140
191
|
"otel.windowAttribution": string;
|
|
141
192
|
"runner.diffProgress": string;
|
|
193
|
+
"runner.failFast": string;
|
|
142
194
|
"runner.driveAgent": string;
|
|
143
195
|
"runner.evalSetup": string;
|
|
144
196
|
"runner.interrupted": string;
|
|
@@ -167,6 +219,8 @@ export declare const en: {
|
|
|
167
219
|
"sandbox.dependencyMissing.e2b": string;
|
|
168
220
|
"sandbox.dependencyMissing.vercel": string;
|
|
169
221
|
"sandbox.forceCleanup": string;
|
|
222
|
+
"sandbox.provisionReconcileFailed": string;
|
|
223
|
+
"sandbox.provisionRetry": string;
|
|
170
224
|
"sandbox.stopFailed": string;
|
|
171
225
|
"sandbox.stopTimeout": string;
|
|
172
226
|
"scoring.evalError": string;
|
package/dist/i18n/zh-CN.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare const zhCN: {
|
|
|
12
12
|
readonly "bub.installFailed": "bub 安装失败(重试 {{attempts}} 次):\n{{tail}}";
|
|
13
13
|
readonly "bub.setupNotRun": "bub adapter 的 setup() 尚未在该沙箱运行(缺 home/workspace 信息);运行器应先调 setup 再 send。";
|
|
14
14
|
readonly "checkpoint.emptyTar": "checkpoint: tar 为空(paths: {{paths}})";
|
|
15
|
+
readonly "checkpoint.archiveFailed": "checkpoint 归档失败(exit {{exitCode}}): {{detail}}";
|
|
16
|
+
readonly "checkpoint.restoreFailed": "checkpoint 恢复失败(exit {{exitCode}}): {{detail}}";
|
|
15
17
|
readonly "skill.localMissing": "本地 skill 路径不存在:\"{{path}}\"(解析到 {{resolved}})。path 相对跑 niceeval 的项目根解析。";
|
|
16
18
|
readonly "skill.localDirNoSkillFile": "本地 skill 目录 \"{{path}}\" 里没有 SKILL.md。目录形态的 skill 必须在根下带一个 SKILL.md。";
|
|
17
19
|
readonly "skill.localUnsupportedShape": "本地 skill 路径 \"{{path}}\" 形态不支持。只接受:含 SKILL.md 的目录,或单个 .md 文件。";
|
|
@@ -21,7 +23,16 @@ export declare const zhCN: {
|
|
|
21
23
|
readonly "skill.repoUnknownSkill": "repo skill {{source}}(ref: {{ref}})里没有名为 \"{{skill}}\" 的 skill。可选:{{available}}。";
|
|
22
24
|
readonly "skill.copyFailed": "skill \"{{name}}\" 装进 {{dest}} 失败:\n{{tail}}";
|
|
23
25
|
readonly "plugin.marketplaceFailed": "{{agent}} marketplace \"{{name}}\" 连接失败(source: {{source}}, ref: {{ref}}):\n{{tail}}";
|
|
26
|
+
readonly "plugin.marketplaceVerifyFailed": "{{agent}} marketplace \"{{name}}\" add 后回读注册列表失败({{command}}):\n{{tail}}";
|
|
27
|
+
readonly "plugin.marketplaceNameMismatch": string;
|
|
24
28
|
readonly "plugin.installFailed": "{{agent}} plugin \"{{name}}\"(marketplace: {{marketplace}})安装失败:\n{{tail}}";
|
|
29
|
+
readonly "nativeConfig.pathNotProjectRelative": "{{agent}} {{field}} 只接受项目根内的相对路径,收到 \"{{path}}\"。绝对路径、包含 `..` 的路径和 `~` 路径都不行;项目根外的配置先复制进项目再引用。";
|
|
30
|
+
readonly "nativeConfig.missing": "{{agent}} {{field}} 指向的文件不存在:\"{{path}}\"(解析到 {{resolved}})。路径相对运行 niceeval 的项目根(含 niceeval.config.ts 的目录)解析,不相对 eval / experiment 源码文件。";
|
|
31
|
+
readonly "nativeConfig.escapesRoot": "{{agent}} {{field}} \"{{path}}\" 经符号链接解析到项目根之外({{resolved}})。配置文件必须真实位于项目根内。";
|
|
32
|
+
readonly "nativeConfig.notFile": "{{agent}} {{field}} \"{{path}}\" 不是普通文件。指向一份完整的官方配置文件。";
|
|
33
|
+
readonly "nativeConfig.invalidSyntax": "{{agent}} {{field}} \"{{path}}\" 不是合法的 {{format}}:{{detail}}";
|
|
34
|
+
readonly "nativeConfig.reservedKeys": "{{agent}} {{field}} \"{{path}}\" 含保留键:{{keys}}。这些键由 experiment 与 Adapter 拥有(model、鉴权、MCP、OTel 经独立配置层叠加),从文件里删掉再跑。";
|
|
35
|
+
readonly "nativeConfig.uploadFailed": "原生配置文件 \"{{path}}\" 上传沙箱失败({{dest}}):\n{{tail}}";
|
|
25
36
|
readonly "cli.all": "(全部)";
|
|
26
37
|
readonly "cli.browserOpenFailed": "无法自动打开浏览器,请手动访问:{{url}}\n";
|
|
27
38
|
readonly "cli.clean.done": "已删除 .niceeval/ 历史运行 artifact。\n";
|
|
@@ -32,6 +43,7 @@ export declare const zhCN: {
|
|
|
32
43
|
readonly "cli.dry.row": " {{who}}{{experiment}}: {{evals}} ×{{runs}}\n";
|
|
33
44
|
readonly "cli.error": "niceeval 出错:{{error}}\n";
|
|
34
45
|
readonly "cli.flag.invalidNumber": "标志 --{{flag}} 需要数字,收到 \"{{value}}\"。\n";
|
|
46
|
+
readonly "cli.flag.invalidOutput": "标志 --output 需要 auto|human|agent|ci 之一,收到 \"{{value}}\"。\n";
|
|
35
47
|
readonly "runner.budgetUnenforceable": "{{budgetKey}} 的 budget:连续多个 attempt 完成后都拿不到成本数据(agent 不上报用量且模型不在价格表)——该 agent 的 budget 无法执行,取消护栏继续跑。\n";
|
|
36
48
|
readonly "judge.modelMissing": string;
|
|
37
49
|
readonly "loaders.yamlMissing": "loadYaml(\"{{path}}\") 需要 YAML 解析器:请先 `pnpm add yaml`(或改用 loadJson + JSON 数据集)。";
|
|
@@ -42,15 +54,18 @@ export declare const zhCN: {
|
|
|
42
54
|
readonly "cli.show.runDirMissing": "Results directory not found: {{dir}}\n";
|
|
43
55
|
readonly "cli.show.noEvalMatch": "No results matched: {{patterns}}. Evals with results: {{evals}}\n";
|
|
44
56
|
readonly "cli.show.noExperimentMatch": "No experiment matched --experiment {{arg}}. Experiments with results: {{experiments}}\n";
|
|
45
|
-
readonly "cli.show.historyReportConflict": "`--history` and `--report` are mutually exclusive: --history is the
|
|
46
|
-
readonly "cli.show.evidenceNeedsEval": "--
|
|
57
|
+
readonly "cli.show.historyReportConflict": "`--history` and `--report` are mutually exclusive: both take over the main output. --history is the host's per-attempt execution timeline; for snapshot-level trends, compose exp.snapshots inside your report file instead.\n";
|
|
58
|
+
readonly "cli.show.evidenceNeedsEval": "--source / --execution / --diff show one attempt's evidence, but the selection matched {{matched}} evals. Pick an attempt locator from the index below:\n{{index}}\n";
|
|
47
59
|
readonly "cli.show.locatorMalformed": "{{message}}\n";
|
|
48
60
|
readonly "cli.show.locatorNotFound": "{{message}}\n";
|
|
49
61
|
readonly "cli.eval.noMatch": "没有匹配的 eval:{{patterns}}。\n";
|
|
50
62
|
readonly "cli.eval.noMatchHintExperiment": "提示:\"{{pattern}}\" 是实验{{kind}},你大概想跑:niceeval exp {{pattern}}\n";
|
|
51
63
|
readonly "cli.eval.noMatchKnown": "已发现 {{count}} 个 eval:{{evals}}\n";
|
|
52
|
-
readonly "cli.exp.agentModelFlagUnsupported": "
|
|
64
|
+
readonly "cli.exp.agentModelFlagUnsupported": "experiment 运行不支持 --agent / --model。请新增或复制一个 experiment 文件并修改 model。\n";
|
|
65
|
+
readonly "cli.exp.viewerFlagUnsupported": "`{{flag}}` 只适用于 niceeval {{command}},不能用于 niceeval exp。\n";
|
|
53
66
|
readonly "cli.experiment.noMatch": "没有匹配的实验:{{arg}}。已发现:{{experiments}}\n";
|
|
67
|
+
readonly "cli.experiment.viewerCommandHint": "你可能想运行:niceeval {{command}}{{args}}\n";
|
|
68
|
+
readonly "cli.experiment.noEvalsSelected": "未选择任何 eval:{{selection}} 匹配到 0 个 eval。可用实验:{{experiments}}。\n";
|
|
54
69
|
readonly "cli.experimentGroup": "组";
|
|
55
70
|
readonly "cli.fallbackCleanupTimeout": "\ngraceful 清理超时,强制清理沙箱…\n";
|
|
56
71
|
readonly "cli.forceCleanupExit": "\n强制清理沙箱并退出…\n";
|
|
@@ -78,6 +93,7 @@ export declare const zhCN: {
|
|
|
78
93
|
readonly "define.evalIdRejected": "defineEval 不接受 id —— id 由文件路径推导。";
|
|
79
94
|
readonly "define.evalTestRequired": "defineEval 需要一个 async test(t) 函数。";
|
|
80
95
|
readonly "define.experimentAgentRequired": "defineExperiment 需要 agent。";
|
|
96
|
+
readonly "define.experimentFlagNotJson": "experiment.flags.{{key}} 不是可 JSON 序列化的值(函数 / undefined / 循环引用 / bigint 不允许);flags 会原样进入结果快照,必须是纯 JSON。";
|
|
81
97
|
readonly "define.experimentIdRejected": "defineExperiment 不接受 id —— id 由文件路径推导。";
|
|
82
98
|
readonly "define.sandboxAgentNameRequired": "defineSandboxAgent 需要 name。";
|
|
83
99
|
readonly "define.sandboxCreateRequired": "defineSandbox 需要一个 create() 函数。";
|
|
@@ -88,6 +104,41 @@ export declare const zhCN: {
|
|
|
88
104
|
readonly "docker.imagePullStart": "Pulling Docker image: {{image}}...";
|
|
89
105
|
readonly "docker.readFileFailed": "Failed to read file {{path}}: {{stderr}}";
|
|
90
106
|
readonly "docker.unsupportedRuntime": "Unsupported runtime: {{runtime}}";
|
|
107
|
+
readonly "feedback.human.active": "ACTIVE";
|
|
108
|
+
readonly "feedback.human.budgetExhausted": "{{experimentId}} 预算已耗尽(已花 {{spent}},未跑 {{unstarted}})";
|
|
109
|
+
readonly "feedback.human.compare": "Compare: niceeval view {{group}}";
|
|
110
|
+
readonly "feedback.human.counts": "共 {{total}} · 复用 {{reused}} · 运行中 {{running}} · 排队 {{queued}} · 已完成 {{completed}}";
|
|
111
|
+
readonly "feedback.human.diffHint": "Diff: niceeval show {{locator}} --diff";
|
|
112
|
+
readonly "feedback.human.evalHint": "Eval: niceeval show {{locator}} --source";
|
|
113
|
+
readonly "feedback.human.failuresHeader": "FAILURES";
|
|
114
|
+
readonly "feedback.human.heartbeat": "已运行 {{elapsed}} · {{counts}}";
|
|
115
|
+
readonly "feedback.human.inspect": "Inspect: niceeval show {{locator}}";
|
|
116
|
+
readonly "feedback.human.moreActive": "… 还有 {{count}} 项运行中";
|
|
117
|
+
readonly "feedback.human.plan": "计划:{{total}} 个 attempt · {{evals}} 个 eval × {{configs}} 个配置 · 并发 {{concurrency}}";
|
|
118
|
+
readonly "feedback.human.resultFailed": "FAILED";
|
|
119
|
+
readonly "feedback.human.resultIncomplete": "INCOMPLETE";
|
|
120
|
+
readonly "feedback.human.resultInterrupted": "INTERRUPTED";
|
|
121
|
+
readonly "feedback.human.resultPassed": "PASSED";
|
|
122
|
+
readonly "feedback.human.resultsHeader": "Results:";
|
|
123
|
+
readonly "feedback.human.resultsMore": "… 还有 {{count}} 个";
|
|
124
|
+
readonly "feedback.human.reuse": "复用:{{total}} 中 {{reused}} 条来自缓存 · {{toRun}} 待跑";
|
|
125
|
+
readonly "feedback.human.summaryLine": "{{passed}} 通过 · {{failed}} 失败 · {{errored}} 出错 (复用 {{reused}})";
|
|
126
|
+
readonly "feedback.human.summaryAllReusedLine": "{{passed}} 通过 · {{failed}} 失败 · {{errored}} 出错 (全部 {{reused}} 条复用)";
|
|
127
|
+
readonly "feedback.human.suppressedFailures": "… 还有 {{count}} 条失败被折叠";
|
|
128
|
+
readonly "feedback.human.trace": "Trace: niceeval show {{locator}} --execution";
|
|
129
|
+
readonly "feedback.phase.agentSetup": "agent 预置";
|
|
130
|
+
readonly "feedback.phase.evalRun": "运行 eval";
|
|
131
|
+
readonly "feedback.phase.evalSetup": "eval 预置";
|
|
132
|
+
readonly "feedback.phase.sandboxCreate": "创建沙箱";
|
|
133
|
+
readonly "feedback.phase.sandboxQueue": "排队等沙箱";
|
|
134
|
+
readonly "feedback.phase.sandboxSetup": "沙箱预置";
|
|
135
|
+
readonly "feedback.phase.scoring": "评分";
|
|
136
|
+
readonly "feedback.phase.teardown": "清理中";
|
|
137
|
+
readonly "feedback.phase.telemetryCollect": "收集 trace";
|
|
138
|
+
readonly "feedback.phase.telemetryConfigure": "配置 telemetry";
|
|
139
|
+
readonly "feedback.phase.workspaceBaseline": "准备工作区";
|
|
140
|
+
readonly "feedback.phase.workspaceDiff": "采集 diff";
|
|
141
|
+
readonly "feedback.rendererError": " · [feedback] renderer 处理 {{context}} 失败(已忽略):{{message}}\n";
|
|
91
142
|
readonly "hitl.answerNeedsOptionOrText": "t.respond 的对象形式需要 optionId 或 text 二选一(两者都没给)。";
|
|
92
143
|
readonly "hitl.invalidOption": "回答 \"{{optionId}}\" 不是请求 {{requestId}} 的可选项({{options}})。";
|
|
93
144
|
readonly "hitl.noOptions": "该请求没有可选项";
|
|
@@ -139,6 +190,7 @@ export declare const zhCN: {
|
|
|
139
190
|
readonly "otel.portInUse": "OTLP 接收端口 {{port}} 已被占用(另一个进程占着这个端口)。在 defineConfig({ telemetry: { port } }) 里换一个空闲端口,或者停掉占用 {{port}} 的进程后重试。";
|
|
140
191
|
readonly "otel.windowAttribution": "otel:span 未带本轮 traceparent,按时间窗口归属(该 agent 的轮次已串行;应用支持 W3C 传播后自动并发)";
|
|
141
192
|
readonly "runner.diffProgress": "采 diff:{{changed}} 改 / {{deleted}} 删";
|
|
193
|
+
readonly "runner.failFast": "{{evalId}} 的错误 {{code}} 连续复现,判定为确定性错误;停止派发该配置剩余的 attempt(fail-fast)。";
|
|
142
194
|
readonly "runner.driveAgent": "驱动 agent…";
|
|
143
195
|
readonly "runner.evalSetup": "eval setup(装依赖)…";
|
|
144
196
|
readonly "runner.interrupted": " · 已中断:沙箱容器已清理,输出本次已完成的部分结果。\n";
|
|
@@ -167,6 +219,8 @@ export declare const zhCN: {
|
|
|
167
219
|
readonly "sandbox.dependencyMissing.e2b": "E2B sandbox requires 'e2b'. Install it with: pnpm add e2b";
|
|
168
220
|
readonly "sandbox.dependencyMissing.vercel": "Vercel sandbox requires '@vercel/sandbox'. Install it with: pnpm add @vercel/sandbox";
|
|
169
221
|
readonly "sandbox.forceCleanup": " · [sandbox] 强制清理 {{count}} 个沙箱…\n";
|
|
222
|
+
readonly "sandbox.provisionReconcileFailed": " · [sandbox] 创建重试前对账失败,放弃重试(可能已创建的实例无法核实/销毁):{{error}}\n";
|
|
223
|
+
readonly "sandbox.provisionRetry": " · [sandbox] 创建被限流,{{delayMs}}ms 后重试(第 {{attempt}}/{{maxAttempts}} 次)…\n";
|
|
170
224
|
readonly "sandbox.stopFailed": " · [sandbox] 停沙箱 {{id}} 失败(已忽略,靠 provider 过期兜底):{{message}}\n";
|
|
171
225
|
readonly "sandbox.stopTimeout": "stop 超时({{timeoutMs}}ms)";
|
|
172
226
|
readonly "scoring.evalError": "评估出错: {{error}}";
|
package/dist/o11y/types.d.ts
CHANGED
|
@@ -38,11 +38,23 @@ export interface InputRequest {
|
|
|
38
38
|
label?: string;
|
|
39
39
|
}[];
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* 落盘截断的结构化标记(见 docs/feature/results/architecture.md「大值截断」):
|
|
43
|
+
* `path` 是被截断的位置(事件里是字段名,如 "output";span 里是 attribute key,如 "output.value"),
|
|
44
|
+
* `originalBytes` 是截断前的 UTF-8 字节数。view 显示「输出过大,已截断」靠它,不正则匹配 marker。
|
|
45
|
+
*/
|
|
46
|
+
export interface Truncation {
|
|
47
|
+
path: string;
|
|
48
|
+
originalBytes: number;
|
|
49
|
+
}
|
|
41
50
|
/**
|
|
42
51
|
* 标准事件流的词汇(对标 docs/feature/adapters/architecture/events.md)。adapter 唯一的硬活就是把
|
|
43
52
|
* 各 agent 五花八门的原始 transcript 映射成 StreamEvent[];映射完,整套断言免费。
|
|
53
|
+
* `truncated` 只由 results writer 在落盘时刻写入(运行时全量,落盘截断);adapter 不产出它。
|
|
44
54
|
*/
|
|
45
|
-
export type StreamEvent =
|
|
55
|
+
export type StreamEvent = {
|
|
56
|
+
truncated?: Truncation[];
|
|
57
|
+
} & (
|
|
46
58
|
/** 一条文本消息(assistant 回复或 user 输入);`loc` 是可选的源码位置,用于把消息叠回 eval 源码。 */
|
|
47
59
|
{
|
|
48
60
|
type: "message";
|
|
@@ -107,7 +119,7 @@ export type StreamEvent =
|
|
|
107
119
|
| {
|
|
108
120
|
type: "error";
|
|
109
121
|
message: string;
|
|
110
|
-
};
|
|
122
|
+
});
|
|
111
123
|
/** core 从事件流折叠出的结构化事实(deriveRunFacts)。 */
|
|
112
124
|
export interface ToolCall {
|
|
113
125
|
callId: string;
|
|
@@ -162,6 +174,8 @@ export interface TraceSpan {
|
|
|
162
174
|
kind?: SpanKind;
|
|
163
175
|
/** OTLP span 属性(gen_ai.* / tool 名 / token 等),按 key 摊平。raw 属性始终保留供下钻。 */
|
|
164
176
|
attributes?: Record<string, JsonValue>;
|
|
177
|
+
/** 落盘截断标记(只由 results writer 在序列化时写入,运行时全量;见 Truncation)。 */
|
|
178
|
+
truncated?: Truncation[];
|
|
165
179
|
}
|
|
166
180
|
/** 给人 / 给 EVAL.ts 看的 o11y 摘要(注入沙箱 __niceeval__/results.json)。 */
|
|
167
181
|
export interface O11ySummary {
|