niceeval 0.5.4 → 0.6.1

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.
Files changed (337) hide show
  1. package/INDEX.md +55 -0
  2. package/dist/agents/types.d.ts +321 -0
  3. package/dist/context/types.d.ts +335 -0
  4. package/dist/i18n/core.d.ts +11 -0
  5. package/dist/i18n/en.d.ts +181 -0
  6. package/dist/i18n/index.d.ts +5 -0
  7. package/dist/i18n/zh-CN.d.ts +183 -0
  8. package/dist/o11y/otlp/parse.d.ts +3 -0
  9. package/dist/o11y/otlp/receiver.d.ts +21 -0
  10. package/dist/o11y/otlp/turn-otel.d.ts +43 -0
  11. package/dist/o11y/types.d.ts +190 -0
  12. package/dist/report/aggregate.d.ts +57 -0
  13. package/dist/report/aggregate.js +212 -0
  14. package/dist/report/built-ins/experiment-comparison.d.ts +1 -0
  15. package/dist/report/built-ins/experiment-comparison.js +13 -0
  16. package/dist/report/built-ins/index.d.ts +1 -0
  17. package/dist/report/built-ins/index.js +2 -0
  18. package/dist/report/components.d.ts +180 -0
  19. package/dist/report/components.js +132 -0
  20. package/dist/report/compute.d.ts +106 -0
  21. package/dist/report/compute.js +600 -0
  22. package/dist/report/flag.d.ts +6 -0
  23. package/dist/report/flag.js +8 -0
  24. package/dist/report/format.d.ts +26 -0
  25. package/dist/report/format.js +109 -0
  26. package/dist/report/index.d.ts +19 -0
  27. package/dist/report/index.js +30 -0
  28. package/dist/report/load.d.ts +12 -0
  29. package/dist/report/load.js +56 -0
  30. package/dist/report/locale.d.ts +94 -0
  31. package/dist/report/locale.js +183 -0
  32. package/dist/report/metrics.d.ts +21 -0
  33. package/dist/report/metrics.js +115 -0
  34. package/dist/report/primitives.d.ts +64 -0
  35. package/dist/report/primitives.js +113 -0
  36. package/dist/report/react/AttemptList.d.ts +23 -0
  37. package/dist/report/react/AttemptList.js +19 -0
  38. package/dist/report/react/DeltaTable.d.ts +8 -0
  39. package/dist/report/react/DeltaTable.js +24 -0
  40. package/dist/report/react/EvalList.d.ts +10 -0
  41. package/dist/report/react/EvalList.js +0 -0
  42. package/dist/report/react/ExperimentList.d.ts +11 -0
  43. package/dist/report/react/ExperimentList.js +67 -0
  44. package/dist/report/react/GroupSummary.d.ts +8 -0
  45. package/dist/report/react/GroupSummary.js +8 -0
  46. package/dist/report/react/MetricBars.d.ts +10 -0
  47. package/dist/report/react/MetricBars.js +48 -0
  48. package/dist/report/react/MetricLine.d.ts +9 -0
  49. package/dist/report/react/MetricLine.js +68 -0
  50. package/dist/report/react/MetricMatrix.d.ts +10 -0
  51. package/dist/report/react/MetricMatrix.js +23 -0
  52. package/dist/report/react/MetricScatter.d.ts +9 -0
  53. package/dist/report/react/MetricScatter.js +96 -0
  54. package/dist/report/react/MetricTable.d.ts +11 -0
  55. package/dist/report/react/MetricTable.js +26 -0
  56. package/dist/report/react/RunOverview.d.ts +8 -0
  57. package/dist/report/react/RunOverview.js +12 -0
  58. package/dist/report/react/Scoreboard.d.ts +8 -0
  59. package/dist/report/react/Scoreboard.js +26 -0
  60. package/dist/report/react/cell.d.ts +9 -0
  61. package/dist/report/react/cell.js +9 -0
  62. package/dist/report/react/chart-math.d.ts +14 -0
  63. package/dist/report/react/chart-math.js +68 -0
  64. package/dist/report/react/colors.d.ts +14 -0
  65. package/dist/report/react/colors.js +45 -0
  66. package/dist/report/react/fixtures.d.ts +19 -0
  67. package/dist/report/react/fixtures.js +398 -0
  68. package/dist/report/react/format.d.ts +3 -0
  69. package/dist/report/react/format.js +7 -0
  70. package/dist/report/react/index.d.ts +6 -0
  71. package/dist/report/react/index.js +14 -0
  72. package/dist/report/report.d.ts +24 -0
  73. package/dist/report/report.js +49 -0
  74. package/dist/report/text/faces.d.ts +29 -0
  75. package/dist/report/text/faces.js +541 -0
  76. package/dist/report/text/layout.d.ts +75 -0
  77. package/dist/report/text/layout.js +173 -0
  78. package/dist/report/text/plot.d.ts +37 -0
  79. package/dist/report/text/plot.js +81 -0
  80. package/dist/report/text/table.d.ts +8 -0
  81. package/dist/report/text/table.js +86 -0
  82. package/dist/report/tree.d.ts +99 -0
  83. package/dist/report/tree.js +228 -0
  84. package/dist/report/types.d.ts +408 -0
  85. package/dist/report/types.js +4 -0
  86. package/dist/report/web.d.ts +15 -0
  87. package/dist/report/web.js +37 -0
  88. package/dist/results/locator.d.ts +75 -0
  89. package/dist/results/locator.js +0 -0
  90. package/dist/results/select.d.ts +45 -0
  91. package/dist/results/select.js +230 -0
  92. package/dist/results/source-hash.d.ts +9 -0
  93. package/dist/results/types.d.ts +204 -0
  94. package/dist/runner/eval-source.d.ts +22 -0
  95. package/dist/runner/fingerprint.d.ts +23 -0
  96. package/dist/runner/types.d.ts +332 -0
  97. package/dist/sandbox/docker-stream.d.ts +24 -0
  98. package/dist/sandbox/docker.d.ts +84 -0
  99. package/dist/sandbox/e2b.d.ts +31 -0
  100. package/dist/sandbox/errors.d.ts +4 -0
  101. package/dist/sandbox/local-files.d.ts +6 -0
  102. package/dist/sandbox/paths.d.ts +4 -0
  103. package/dist/sandbox/registry.d.ts +13 -0
  104. package/dist/sandbox/resolve.d.ts +40 -0
  105. package/dist/sandbox/retry.d.ts +10 -0
  106. package/dist/sandbox/shell.d.ts +11 -0
  107. package/dist/sandbox/source-files.d.ts +13 -0
  108. package/dist/sandbox/types.d.ts +203 -0
  109. package/dist/sandbox/vercel.d.ts +37 -0
  110. package/dist/scoring/types.d.ts +70 -0
  111. package/dist/shared/aggregate.d.ts +29 -0
  112. package/dist/shared/aggregate.js +55 -0
  113. package/dist/shared/types.d.ts +27 -0
  114. package/dist/shared/verdict.d.ts +27 -0
  115. package/dist/shared/verdict.js +34 -0
  116. package/dist/tty-line.d.ts +6 -0
  117. package/dist/types.d.ts +7 -0
  118. package/dist/util.d.ts +22 -0
  119. package/docs-site/zh/concepts/adapter.mdx +7 -7
  120. package/docs-site/zh/concepts/assert.mdx +19 -18
  121. package/docs-site/zh/concepts/evals.mdx +12 -11
  122. package/docs-site/zh/concepts/experiment.mdx +2 -2
  123. package/docs-site/zh/concepts/judge.mdx +9 -9
  124. package/docs-site/zh/concepts/overview.mdx +3 -3
  125. package/docs-site/zh/concepts/tier.mdx +6 -6
  126. package/docs-site/zh/example/claude-code-codex-plugin.mdx +9 -5
  127. package/docs-site/zh/example/claude-code-codex-skill.mdx +12 -7
  128. package/docs-site/zh/guides/agent-feedback-loop.mdx +237 -78
  129. package/docs-site/zh/guides/connect-otel.mdx +3 -3
  130. package/docs-site/zh/guides/connect-your-agent.mdx +2 -2
  131. package/docs-site/zh/guides/custom-reports.mdx +196 -36
  132. package/docs-site/zh/guides/experiments.mdx +7 -1
  133. package/docs-site/zh/guides/fixtures.mdx +4 -2
  134. package/docs-site/zh/guides/official-adapters.mdx +31 -9
  135. package/docs-site/zh/guides/publish-report.mdx +4 -4
  136. package/docs-site/zh/guides/report-components.mdx +194 -55
  137. package/docs-site/zh/guides/reporters.mdx +2 -2
  138. package/docs-site/zh/guides/results-data.mdx +61 -34
  139. package/docs-site/zh/guides/runner.mdx +2 -2
  140. package/docs-site/zh/guides/sandbox-agent.mdx +3 -2
  141. package/docs-site/zh/guides/{sandbox-backends.mdx → sandbox-providers.mdx} +12 -12
  142. package/docs-site/zh/guides/viewing-results.mdx +200 -79
  143. package/docs-site/zh/guides/write-experiment.mdx +9 -1
  144. package/docs-site/zh/guides/write-send.mdx +4 -3
  145. package/docs-site/zh/index.mdx +4 -3
  146. package/docs-site/zh/introduction.mdx +2 -1
  147. package/docs-site/zh/quickstart.mdx +5 -3
  148. package/docs-site/zh/reference/builtin-agents.mdx +38 -13
  149. package/docs-site/zh/reference/capabilities.mdx +1 -1
  150. package/docs-site/zh/reference/cli.mdx +36 -13
  151. package/docs-site/zh/reference/define-agent.mdx +15 -13
  152. package/docs-site/zh/reference/define-config.mdx +1 -1
  153. package/docs-site/zh/reference/define-eval.mdx +3 -3
  154. package/docs-site/zh/reference/events.mdx +9 -3
  155. package/docs-site/zh/reference/expect.mdx +13 -8
  156. package/package.json +10 -6
  157. package/src/agents/bub.ts +129 -42
  158. package/src/agents/claude-code.test.ts +152 -0
  159. package/src/agents/claude-code.ts +127 -13
  160. package/src/agents/codex.test.ts +192 -0
  161. package/src/agents/codex.ts +151 -12
  162. package/src/agents/index.ts +9 -3
  163. package/src/agents/manifest.ts +41 -0
  164. package/src/agents/plugin-config.test.ts +94 -0
  165. package/src/agents/shared.ts +33 -2
  166. package/src/agents/skills.test.ts +214 -0
  167. package/src/agents/skills.ts +304 -0
  168. package/src/agents/streaming.ts +5 -5
  169. package/src/agents/types.ts +59 -3
  170. package/src/cli.ts +74 -47
  171. package/src/context/context.test.ts +20 -2
  172. package/src/context/control-flow.ts +1 -1
  173. package/src/context/session.test.ts +92 -1
  174. package/src/context/session.ts +23 -1
  175. package/src/context/types.ts +4 -4
  176. package/src/define.test.ts +8 -8
  177. package/src/define.ts +11 -11
  178. package/src/expect/index.ts +5 -5
  179. package/src/i18n/en.ts +33 -15
  180. package/src/i18n/zh-CN.ts +37 -21
  181. package/src/index.ts +1 -1
  182. package/src/o11y/execution-tree.test.ts +452 -0
  183. package/src/o11y/execution-tree.ts +367 -0
  184. package/src/o11y/otlp/receiver.ts +1 -1
  185. package/src/o11y/otlp/select.ts +7 -3
  186. package/src/o11y/parsers/claude-code.test.ts +175 -0
  187. package/src/o11y/parsers/claude-code.ts +32 -0
  188. package/src/o11y/types.ts +6 -1
  189. package/src/report/aggregate.ts +26 -20
  190. package/src/report/built-in-user-parity.test.tsx +640 -0
  191. package/src/report/built-ins/experiment-comparison.tsx +19 -0
  192. package/src/report/built-ins/index.ts +2 -0
  193. package/src/report/components.tsx +225 -50
  194. package/src/report/compute.ts +335 -54
  195. package/src/report/dual-render.test.tsx +1129 -0
  196. package/src/report/flag.ts +1 -1
  197. package/src/report/format.ts +35 -2
  198. package/src/report/index.ts +47 -14
  199. package/src/report/load.ts +1 -1
  200. package/src/report/locale.ts +229 -0
  201. package/src/report/metrics.ts +39 -15
  202. package/src/report/primitives.tsx +100 -2
  203. package/src/report/react/AttemptList.tsx +113 -0
  204. package/src/report/react/DeltaTable.tsx +9 -6
  205. package/src/report/react/EvalList.tsx +0 -0
  206. package/src/report/react/ExperimentList.tsx +220 -0
  207. package/src/report/react/GroupSummary.tsx +66 -0
  208. package/src/report/react/MetricBars.tsx +24 -13
  209. package/src/report/react/MetricLine.tsx +21 -21
  210. package/src/report/react/MetricMatrix.tsx +8 -4
  211. package/src/report/react/MetricScatter.tsx +126 -96
  212. package/src/report/react/MetricTable.tsx +115 -15
  213. package/src/report/react/RunOverview.tsx +48 -26
  214. package/src/report/react/Scoreboard.tsx +15 -7
  215. package/src/report/react/cell.tsx +18 -9
  216. package/src/{view/app/lib/chart.ts → report/react/chart-math.ts} +2 -6
  217. package/src/report/react/colors.ts +24 -15
  218. package/src/report/react/enhance.js +168 -0
  219. package/src/report/react/fixtures.ts +169 -34
  220. package/src/report/react/format.ts +1 -1
  221. package/src/report/react/index.tsx +21 -6
  222. package/src/report/react/render.test.tsx +180 -31
  223. package/src/report/react/styles.css +432 -213
  224. package/src/report/report.test.ts +398 -94
  225. package/src/report/report.ts +29 -11
  226. package/src/report/text/faces.ts +344 -96
  227. package/src/report/text/layout.ts +76 -11
  228. package/src/report/text/table.ts +98 -0
  229. package/src/report/tree.ts +103 -20
  230. package/src/report/types.ts +184 -25
  231. package/src/report/web.ts +46 -19
  232. package/src/results/annotated-source.test.ts +146 -0
  233. package/src/results/annotated-source.ts +128 -0
  234. package/src/results/attempt-evidence.test.ts +158 -0
  235. package/src/results/attempt-evidence.ts +158 -0
  236. package/src/results/attempt-source.ts +48 -0
  237. package/src/results/copy.ts +154 -139
  238. package/src/results/format.ts +54 -47
  239. package/src/results/host-equivalence.test.ts +527 -0
  240. package/src/results/index.ts +56 -14
  241. package/src/results/locator.test.ts +198 -0
  242. package/src/results/locator.ts +0 -0
  243. package/src/results/open.ts +392 -175
  244. package/src/results/results.test.ts +943 -494
  245. package/src/results/select.ts +129 -23
  246. package/src/results/skipped-notice.ts +0 -0
  247. package/src/results/source-hash.ts +28 -0
  248. package/src/results/types.ts +98 -62
  249. package/src/results/writer.ts +304 -176
  250. package/src/runner/attempt.test.ts +170 -0
  251. package/src/runner/attempt.ts +48 -13
  252. package/src/runner/discover.test.ts +65 -0
  253. package/src/runner/discover.ts +6 -2
  254. package/src/runner/eval-source.test.ts +121 -0
  255. package/src/runner/eval-source.ts +45 -0
  256. package/src/runner/fingerprint.ts +54 -1
  257. package/src/runner/remote-sandbox.ts +1 -1
  258. package/src/runner/report.test.ts +6 -8
  259. package/src/runner/report.ts +5 -4
  260. package/src/runner/reporters/artifacts.ts +27 -41
  261. package/src/runner/reporters/braintrust.test.ts +3 -3
  262. package/src/runner/reporters/braintrust.ts +1 -1
  263. package/src/runner/reporters/console.ts +6 -6
  264. package/src/runner/reporters/json.ts +4 -4
  265. package/src/runner/reporters/live.test.ts +56 -0
  266. package/src/runner/reporters/live.ts +36 -10
  267. package/src/runner/reporters/quiet.test.ts +66 -0
  268. package/src/runner/reporters/quiet.ts +49 -0
  269. package/src/runner/reporters/shared.ts +5 -5
  270. package/src/runner/reporters/table.ts +17 -17
  271. package/src/runner/run.ts +61 -102
  272. package/src/runner/types.ts +43 -32
  273. package/src/sandbox/checkpoint.ts +1 -1
  274. package/src/sandbox/docker.ts +15 -2
  275. package/src/sandbox/e2b.ts +11 -5
  276. package/src/sandbox/errors.ts +13 -0
  277. package/src/sandbox/index.ts +3 -3
  278. package/src/sandbox/local-files.ts +1 -1
  279. package/src/sandbox/registry.ts +6 -5
  280. package/src/sandbox/resolve.ts +38 -23
  281. package/src/sandbox/retry.test.ts +68 -0
  282. package/src/sandbox/retry.ts +44 -0
  283. package/src/sandbox/types.ts +24 -24
  284. package/src/sandbox/vercel.ts +17 -3
  285. package/src/scoring/collector.ts +3 -3
  286. package/src/scoring/judge.ts +2 -2
  287. package/src/scoring/scoped.ts +13 -1
  288. package/src/scoring/types.ts +7 -7
  289. package/src/scoring/verdict.ts +4 -4
  290. package/src/shared/aggregate.ts +23 -3
  291. package/src/shared/types.ts +2 -2
  292. package/src/shared/{outcome.ts → verdict.ts} +15 -15
  293. package/src/show/compose.ts +12 -132
  294. package/src/show/index.ts +119 -95
  295. package/src/show/render.ts +462 -159
  296. package/src/show/show.test.ts +471 -253
  297. package/src/source-loc.ts +1 -1
  298. package/src/tty-line.ts +32 -0
  299. package/src/types.ts +2 -2
  300. package/src/util.test.ts +21 -1
  301. package/src/util.ts +5 -1
  302. package/src/view/app/App.tsx +33 -198
  303. package/src/view/app/components/AttemptModal.tsx +6 -6
  304. package/src/view/app/components/CodeView.tsx +2 -2
  305. package/src/view/app/components/CopyControls.tsx +32 -36
  306. package/src/view/app/components/SkippedRunsBanner.tsx +140 -0
  307. package/src/view/app/components/ui/badge.tsx +1 -1
  308. package/src/view/app/components/ui/dialog.tsx +2 -2
  309. package/src/view/app/i18n.ts +40 -31
  310. package/src/view/app/lib/artifact-url.ts +1 -1
  311. package/src/view/app/lib/attempt-route.test.ts +37 -47
  312. package/src/view/app/lib/attempt-route.ts +26 -26
  313. package/src/view/app/lib/rows.ts +9 -112
  314. package/src/view/app/lib/verdict.ts +25 -0
  315. package/src/view/app/main.tsx +9 -12
  316. package/src/view/app/pages/RunsPage.tsx +4 -4
  317. package/src/view/app/pages/TracesPage.tsx +3 -3
  318. package/src/view/app/shared.ts +0 -1
  319. package/src/view/app/types.ts +6 -51
  320. package/src/view/artifact-serving.test.ts +136 -0
  321. package/src/view/client-dist/app.css +1 -1
  322. package/src/view/client-dist/app.js +21 -21
  323. package/src/view/data.test.ts +214 -143
  324. package/src/view/data.ts +166 -120
  325. package/src/view/index.ts +23 -11
  326. package/src/view/server.ts +52 -17
  327. package/src/view/shared/types.ts +22 -31
  328. package/src/view/styles.css +117 -327
  329. package/src/view/view-report.test.ts +146 -98
  330. package/src/report/default-report.tsx +0 -222
  331. package/src/report/dual-face.test.tsx +0 -527
  332. package/src/report/react/CaseList.tsx +0 -70
  333. package/src/view/app/components/CostScoreChart.tsx +0 -147
  334. package/src/view/app/components/ExperimentTable.tsx +0 -284
  335. package/src/view/app/components/GroupSelector.tsx +0 -61
  336. package/src/view/app/components/primitives.tsx +0 -43
  337. package/src/view/app/lib/outcome.ts +0 -82
@@ -20,8 +20,9 @@ description: "安装 NiceEval,写三个文件,10 分钟内对你自己的应
20
20
  ```
21
21
  </Step>
22
22
  <Step title="查看结果">
23
- ```text
24
- pnpm exec niceeval view
23
+ ```bash
24
+ pnpm exec niceeval show # 终端摘要,适合直接交给 AI 阅读
25
+ pnpm exec niceeval view # 网页查看器,适合人浏览证据
25
26
  ```
26
27
  </Step>
27
28
  </Steps>
@@ -94,7 +95,8 @@ export default defineEval({
94
95
 
95
96
  ```bash
96
97
  pnpm exec niceeval exp my-bot # 跑起来
97
- pnpm exec niceeval view # 本地查看器里看结果
98
+ pnpm exec niceeval show # 在终端读结果;失败项会给出继续下钻的命令
99
+ pnpm exec niceeval view # 需要交互浏览时打开本地查看器
98
100
  ```
99
101
 
100
102
  到这里第一条 eval 已经跑通。
@@ -98,12 +98,19 @@ mcpServers?: McpServer[];
98
98
  #### `skills`
99
99
 
100
100
  ```ts
101
- skills?: string[];
101
+ skills?: SkillSpec[];
102
102
  ```
103
103
 
104
- 额外安装的 skill,格式为 GitHub `"org/repo"`(如 `"Effect-TS/skills"`)。
105
- setup 阶段在沙箱里执行 `npx skills add <org/repo>`;
106
- 结果写进沙箱工作区的 skills-lock.json,claude CLI 启动时自动读取。
104
+ 装进沙箱的 Skill(本地目录/文件,或 repo + 可钉 ref + 可选启用集)。
105
+ 落在 project `.claude/skills/<name>/`,claude CLI 原生发现。
106
+
107
+ #### `plugins`
108
+
109
+ ```ts
110
+ plugins?: ClaudeCodePluginSpec[];
111
+ ```
112
+
113
+ Claude Code 原生 Plugin(先连 Marketplace,再从中装指定 Plugin)。
107
114
 
108
115
  ### `CodexConfig`
109
116
 
@@ -130,16 +137,25 @@ mcpServers?: McpServer[];
130
137
  ```
131
138
 
132
139
  额外 MCP server(每个沙箱 setup 时追加进 ~/.codex/config.toml)。
133
- 格式对应 codex config.toml 的 [mcp_server.&lt;name&gt;] 表。
140
+ 格式对应 codex config.toml 的 [mcp_servers.&lt;name&gt;] 表。
134
141
 
135
142
  #### `skills`
136
143
 
137
144
  ```ts
138
- skills?: string[];
145
+ skills?: SkillSpec[];
146
+ ```
147
+
148
+ 装进沙箱的 Skill(本地目录/文件,或 repo + 可钉 ref + 可选启用集)。
149
+ 落在 `.agents/skills/<name>/`,并写一段发现指引进 AGENTS.md —— codex 没有 Claude Code 那种
150
+ 原生 Skill 工具,只把文件装进去它不会自己去读(见 memory/codex-no-native-skill-tool.md)。
151
+
152
+ #### `plugins`
153
+
154
+ ```ts
155
+ plugins?: CodexPluginSpec[];
139
156
  ```
140
157
 
141
- 额外安装的 skill,格式为 GitHub `"org/repo"`(如 `"Effect-TS/skills"`)。
142
- setup 阶段执行 `npx skills add <org/repo>`,结果写进 skills-lock.json。
158
+ Codex 原生 Plugin(先连 Marketplace,再从中装指定 Plugin)。
143
159
 
144
160
  ### `BubConfig`
145
161
 
@@ -159,15 +175,24 @@ apiBase?: string;
159
175
 
160
176
  OpenAI 兼容代理的 base URL。省略时读 BUB_API_BASE env。
161
177
 
178
+ #### `skills`
179
+
180
+ ```ts
181
+ skills?: SkillSpec[];
182
+ ```
183
+
184
+ 装进沙箱的 Skill(本地目录/文件,或 repo + 可钉 ref + 可选启用集)。
185
+ 落在 `.agents/skills/<name>/`,并写一段发现指引进 AGENTS.md(bub 没有原生 Skill 加载机制)。
186
+
162
187
  #### `pythonPlugins`
163
188
 
164
189
  ```ts
165
- pythonPlugins?: string[];
190
+ pythonPlugins?: PythonPluginSpec[];
166
191
  ```
167
192
 
168
- 额外装进 bub tool 环境的 Python 包(pip 名或 git URL)。
169
- 每个沙箱 setup 时作为 `uv tool install --with <pkg>` 追加到 bub 环境里。
170
- 示例:["bub-plugin-memory", "git+`https://github.com/..."`]
193
+ 额外装进 bub tool 环境的 Python Package,每个沙箱 setup 时进 `uv tool install … --with <pkg>`。
194
+ 规范化后的 package 列表进安装 checkpoint key:plugin 集合不同的两个 agent 变体不会复用同一个
195
+ 安装 checkpoint(否则第二个变体会静默拿到第一个变体的环境)。
171
196
 
172
197
  {/* GENERATED:END builtin-agent-config */}
173
198
 
@@ -189,7 +214,7 @@ export default uiMessageStreamAgent({
189
214
 
190
215
  - **收发 + 事件流**:SSE 帧经 `ai` 包官方的框架无关 reducer `readUIMessageStream`(`useChat` 内部同款)归约,工具调用/结果/消息文本从消息 parts 直构——**不要求应用接 OTel**。
191
216
  - **会话续接**:协议是服务端零状态、「客户端带全量历史」——工厂用 `ctx.session.history()` 存整份 `UIMessage[]`,每轮原样重放;新会话线(`t.newSession()` 之后)拿到的是空历史。
192
- - **HITL**:AI SDK v7 tool approval(工具带 `needsApproval: true`)原生映射——part 停在 `approval-requested` 时整轮 `status: "waiting"` + `input.requested`;`t.respond("approve" / "deny")` 翻译成 `approval-responded` 原地改写该 part、原样重发 `messages` 触发服务端续跑(和真实前端 `addToolApprovalResponse()` + `sendMessage()` 的协议行为一致,没有单独的 approve 端点)。拒绝的调用以 `rejected` 落进事件流,且默认带「不要重试」的 reason(`denyReason` 可覆盖)——不带的话模型经常原样重发同一个调用。
217
+ - **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` 可覆盖)——不带的话模型经常原样重发同一个调用。
193
218
  - **usage / 瀑布图**:UI Message Stream 协议帧里没有 usage,所以 `t.maxTokens` 这类用量断言在这个内置件上默认没有数据(应用把 usage 放进 message metadata 属于应用自己的协议扩展)。瀑布图是另一回事:应用有 OTel 埋点(如官方 `@ai-sdk/otel`)时,按 [OTel 接入](/zh/guides/connect-otel)把 span 发给 [NiceEval](https://niceeval.com/),`niceeval view` 就有完整瀑布图——span 只进瀑布图,不喂断言。
194
219
 
195
220
  需要在 eval 项目里安装 `ai`(可选 peer 依赖,协议 reducer 来自它)。完整可跑示例:[`examples/zh/tier1/ai-sdk-v7`](https://github.com/CorrectRoadH/niceeval/tree/main/examples/zh/tier1/ai-sdk-v7)。
@@ -8,7 +8,7 @@ description: "NiceEval 怎么知道你的 adapter 做到了什么:没有声明
8
8
 
9
9
  `defineAgent` / `defineSandboxAgent` 上没有 `capabilities` 字段——**没有任何东西需要你声明**。每一项能力都由构造方式或实际返回的内容证明,判定表如下。
10
10
 
11
- ## 能力从哪来:一张判决表
11
+ ## 能力从哪来:一张对照表
12
12
 
13
13
  | 能力 | 怎么获得 | 你要写什么 |
14
14
  |---|---|---|
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: "NiceEval CLI:命令、flags 和退出码参考"
3
3
  sidebarTitle: "命令行"
4
- description: "NiceEval CLI 参考:exp、init、list、cleanview 命令,以及 experiment、eval 过滤、sandbox、并发、预算和 JUnit CI 输出。"
4
+ description: "NiceEval CLI 参考:exp、show、view、init、list 和 clean 命令,以及结果下钻、experiment、eval 过滤、并发、预算和 CI 输出。"
5
5
  ---
6
6
 
7
7
  [NiceEval](https://niceeval.com/) CLI 是发现、运行和查看 eval 的入口。实际执行 eval 时采用 experiment-first 模型:**`exp` 选择可签入的运行配置**,experiment 后的位置参数才按 eval ID 前缀过滤。agent、model 和 flags 写在 `experiments/`,不靠临时 CLI 参数。
@@ -19,10 +19,13 @@ description: "NiceEval CLI 参考:exp、init、list、clean 和 view 命令,
19
19
  发现并打印所有 eval,不运行。
20
20
  </Card>
21
21
  <Card title="npx niceeval clean" icon="trash">
22
- 删除 `.niceeval/` 历史运行 artifacts。
22
+ 删除 `.niceeval/` 下历史快照 artifacts。
23
+ </Card>
24
+ <Card title="npx niceeval show [id-prefix | @locator]" icon="terminal">
25
+ 在终端读取结果;用 `@<locator>` 或 eval ID 前缀下钻断言、Eval 源码、执行事件流、diff 和历史。
23
26
  </Card>
24
27
  <Card title="npx niceeval view" icon="eye">
25
- 打开结果查看器,查看最近一次运行的 artifacts。
28
+ 打开网页结果查看器,读默认报告并交互浏览 Eval 源码、执行事件流与 diff;默认范围与 `show` 相同。跨 run 时间轴(`--history`)是 `show` 专用的终端能力。
26
29
  </Card>
27
30
  </CardGroup>
28
31
 
@@ -46,6 +49,9 @@ npx niceeval exp
46
49
  # 运行一个实验组
47
50
  npx niceeval exp compare-models
48
51
 
52
+ # 只运行该组里的一个配置(id = 组/文件名,不带扩展名)
53
+ npx niceeval exp compare-models/gpt-5.4
54
+
49
55
  # 在该组里只运行 ID 以 weather 开头的 eval
50
56
  npx niceeval exp compare-models weather
51
57
  ```
@@ -54,6 +60,8 @@ npx niceeval exp compare-models weather
54
60
  eval 过滤参数只出现在 experiment 选择之后。裸 `npx niceeval weather` 不会运行;请使用 `npx niceeval exp local weather` 或 `npx niceeval exp compare weather`。
55
61
  </Note>
56
62
 
63
+ 第一个位置参数既能填实验组名,也能填单个配置的完整 id:精确匹配到 `组/文件名` 时只跑组内那一个配置,适合逐配置验证或对比排查某一格结果,不用把其它配置文件挪出目录。
64
+
57
65
  ## 常用 flags
58
66
 
59
67
  下表由 CLI 的 flag 解析表生成,表外的 flag 一律按未知 flag 报错并以非零状态退出。**没有**用于选择 sandbox 后端的 CLI flag:sandbox 后端只能写在代码里——在 experiment(`defineExperiment`)里设置 `sandbox`,或者在 `niceeval.config.ts`(`defineConfig`)里设置作为项目级兜底,值来自 `niceeval/sandbox` 的 `dockerSandbox()` / `vercelSandbox()` / `e2bSandbox()`。
@@ -75,18 +83,17 @@ npx niceeval exp compare-models weather
75
83
  | `--json` | string | 额外写一份 JSON 结果(`RunSummary` 原样序列化)到指定路径,供 CI 或下游脚本消费。 |
76
84
  | `--out` | string | `view` 命令专用:把结果查看器静态导出到指定目录。 |
77
85
  | `--port` | number | `view` 命令专用:指定本地服务器监听端口。 |
78
- | `--transcript` | boolean | `show` 命令专用:渲染单个 eval 的完整对话与工具调用(证据切面)。 |
79
- | `--trace` | boolean | `show` 命令专用:渲染单个 eval trace 瀑布文本版(证据切面)。 |
86
+ | `--eval` | boolean | `show` 命令专用:该 attempt 运行时保存的 Eval 源码,gate/soft 断言标回源码行(证据切面)。 |
87
+ | `--execution` | boolean | `show` 命令专用:该 attempt 的标准执行事件流(消息、thinking、Skill load、工具调用/结果);有 OTel 时同一节点补时间(证据切面)。 |
80
88
  | `--diff` | boolean | `show` 命令专用:sandbox 里的文件改动摘要;`--diff=<文件路径>` 看单个文件的完整改动(路径必须 `=` 连写)。 |
81
89
  | `--history` | boolean | `show` 命令专用:跨 run 时间轴,只列真实执行;与 `--report` 互斥。 |
82
- | `--experiment` | string | `show` / `view` 命令专用:选集只留该实验。 |
83
- | `--attempt` | number | `show` 命令专用:指定详情 / 证据切面看第几次 attempt(与展示一致的 1 计序号)。 |
84
- | `--run` | string | `show` / `view` 命令专用:钉死看某一个结果目录(历史 run 或 `copySnapshots` 产物) |
85
- | `--report` | string | `show` / `view` 命令专用:用你的报告文件替换默认报告(文件默认导出 `defineReport(...)`)。 |
90
+ | `--experiment` | string | `show` / `view` 命令专用:Selection 只留该实验。 |
91
+ | `--run` | string | `show` / `view` 命令专用:钉死看某一个结果目录(某次快照或 `copySnapshots` 产物)。 |
92
+ | `--report` | string | `show` / `view` 命令专用:渲染你的报告文件(文件默认导出 `defineReport(...)`);show 用它替换 Attempt 索引,view 用它替换默认分析报告。 |
86
93
  | `--dry` | boolean | 只打印本次会匹配到的 eval × 运行配置,不实际执行。 |
87
- | `--quiet` | boolean | 关闭控制台 / live 进度输出(reporter 仍会写 artifacts)。 |
94
+ | `--quiet` | boolean | 关闭控制台 / live 的逐条结果与末尾汇总(attempt 进度行仍写 stderr);errored / failed 的结果各在 stderr 补一行摘要,passed / skipped 静默;reporter 仍会写 artifacts。 |
88
95
  | `--force` | boolean | 忽略上次运行结果,不跳过已通过的 (experiment, eval) 组合,强制全部重跑。 |
89
- | `--strict` | boolean | CI 中推荐使用:让软阈值(`soft`)失败也计入整条 eval 的 outcome。 |
96
+ | `--strict` | boolean | CI 中推荐使用:让软阈值(`soft`)失败也计入整条 eval 的 verdict。 |
90
97
  | `--early-exit` / `--no-early-exit` | boolean | 某个 eval 的一次 attempt 通过后,停止该 eval 剩余的 attempts。 |
91
98
  | `--open` / `--no-open` | boolean | `view` 命令专用:启动后自动打开浏览器(默认行为)。 |
92
99
  | `--help` | boolean | 打印用法说明并退出。 |
@@ -117,13 +124,29 @@ npx niceeval exp compare-models weather-tool
117
124
  npx niceeval view
118
125
  ```
119
126
 
120
- 打开本地结果查看器。默认查看最近一次 `.niceeval/` 运行。
127
+ 打开本地结果查看器。它和 `show` 共用同一份默认报告和同一套默认选择——对每个 experiment、每个 eval,取历次运行里最新的那份判定;只补跑部分 eval 时,其余 eval 从更早的运行补齐。`show` 输出终端文本,`view` 输出网页并提供可交互的证据浏览;eval ID 前缀、`--experiment`、`--run` 对两者的收窄一致。完整说明见[查看结果](/zh/guides/viewing-results)。
128
+
129
+ ## `show [id-prefix...]`
130
+
131
+ ```bash
132
+ npx niceeval show
133
+ npx niceeval show weather/brooklyn
134
+ npx niceeval show @1k2m9qrs
135
+ npx niceeval show @1k2m9qrs --eval
136
+ npx niceeval show @1k2m9qrs --execution
137
+ npx niceeval show fixtures/button --diff
138
+ npx niceeval show weather/brooklyn --history
139
+ ```
140
+
141
+ `show` 是终端结果入口,适合人直接阅读,也适合 coding agent 在上下文窗口里逐级下钻。位置参数选「看哪些 eval」(ID 前缀)或直接用 `@<locator>` 精确选一个 attempt;不带位置参数时显示同一张紧凑 attempt 表,指定 eval ID 前缀只是收窄这张表的行数,不会切换成另一种视图。
142
+
143
+ `@<locator>` 不带证据 flag 时给出该 attempt 的紧凑全景(断言摘要、执行摘要、可选 OTel 时间、diff 摘要);`--eval`、`--execution`、`--diff` 是同一 attempt 的证据切面,分别展开运行时保存的 Eval 源码、标准执行事件流、工作区文件改动,因此必须搭配 `@<locator>` 精确指名一个 attempt。`--run` 钉住某次结果目录,`--history` 查看跨 run 趋势。完整的阅读顺序、输出示例和 artifact 说明见[查看结果](/zh/guides/viewing-results)。
121
144
 
122
145
  ## `--early-exit` 与 `--strict`
123
146
 
124
147
  `--early-exit` 默认就是 `true`:某个 eval 的一次 attempt 通过后,会自动停止该 eval 剩余的 attempts(省钱)。所以显式传 `--early-exit` 没有效果,真正有用的是反过来关掉它——`--no-early-exit`,让 `--runs` > 1 时把每次 attempt 都跑完(测真实通过率而非提前收尾)。
125
148
 
126
- `--strict` 不是"更严格地报错",而是改变软阈值断言的判定:`.atLeast(n)` 这类软阈值(`soft` severity)平时失败不会把整条 eval 判为 `failed`(只是记一条不达标的断言),加了 `--strict` 之后,软阈值没达标也会让整条 eval 的 outcome 计为 `failed`。CI 中推荐加上,避免"断言分数不够但 eval 显示通过"的情况被放过。
149
+ `--strict` 不是"更严格地报错",而是改变软阈值断言的判定:`.atLeast(n)` 这类软阈值(`soft` severity)平时失败不会把整条 eval 判为 `failed`(只是记一条不达标的断言),加了 `--strict` 之后,软阈值没达标也会让整条 eval 的 verdict 计为 `failed`。CI 中推荐加上,避免"断言分数不够但 eval 显示通过"的情况被放过。
127
150
 
128
151
  ## 环境变量覆盖
129
152
 
@@ -245,7 +245,9 @@ experiment 跑(如脱离 CLI、直接构造 `AgentRun` 的场景)时为 undefine
245
245
  readonly sandbox: Sandbox;
246
246
  ```
247
247
 
248
- 仅沙箱型 agent 有(运行器按 --sandbox 备好)。
248
+ 所有 agent 都有:沙箱型是运行器按项目/experiment 配置备好的真实沙箱句柄,remote 型是
249
+ `createRemoteSandbox()` 产出的 stub(仅含 `workdir`/`sandboxId`/`otlpHost`/`stop` 等
250
+ 元信息,其余方法调用即抛错)。
249
251
 
250
252
  #### `session`
251
253
 
@@ -338,7 +340,7 @@ readFile(path: string): Promise<string>;
338
340
  fileExists(path: string): Promise<boolean>;
339
341
  ```
340
342
 
341
- 检查沙箱内路径是否存在。跨后端语义不完全一致:仅保证对普通文件可靠,对目录路径的行为不同后端不保证一致。
343
+ 检查沙箱内路径是否存在。跨 provider 语义不完全一致:仅保证对普通文件可靠,对目录路径的行为不同 provider 不保证一致。
342
344
 
343
345
  #### `readSourceFiles`
344
346
 
@@ -379,7 +381,7 @@ uploadDirectory(localDir: string, targetDir?: string, opts?: { ignore?: string[]
379
381
  stop(): Promise<void>;
380
382
  ```
381
383
 
382
- 销毁沙箱占用的计算资源(容器/microVM)。调用后沙箱不可再用;是否可安全重复调用因后端而异,不要依赖这一点。
384
+ 销毁沙箱占用的计算资源(容器/microVM)。调用后沙箱不可再用;是否可安全重复调用因 provider 而异,不要依赖这一点。
383
385
 
384
386
  #### `sandboxId`
385
387
 
@@ -387,7 +389,7 @@ stop(): Promise<void>;
387
389
  readonly sandboxId: string;
388
390
  ```
389
391
 
390
- 本沙箱的稳定标识(各后端原生 ID,如 Docker 容器 ID 前缀);用于跨调用关联同一沙箱的会话状态,也用于日志展示。
392
+ 本沙箱的稳定标识( provider 原生 ID,如 Docker 容器 ID 前缀);用于跨调用关联同一沙箱的会话状态,也用于日志展示。
391
393
 
392
394
  #### `otlpHost`
393
395
 
@@ -407,7 +409,7 @@ appendLog?(line: string): Promise<void>;
407
409
  ```
408
410
 
409
411
  可选:把一行写进容器的「主日志」(PID1 在 tail 它)——于是 `docker logs` /
410
- Docker UI 的 Logs 标签页能实时看到 agent 逐轮活动。docker 后端实现,其它可省略。
412
+ Docker UI 的 Logs 标签页能实时看到 agent 逐轮活动。docker provider 实现,其它可省略。
411
413
 
412
414
  #### `downloadFile`
413
415
 
@@ -416,7 +418,7 @@ downloadFile(path: string): Promise<Buffer>;
416
418
  ```
417
419
 
418
420
  从沙箱内任意路径读取文件,返回二进制 Buffer。
419
- 对应各 backend:Docker getArchive / Vercel readFileToBuffer / e2b files.read(bytes) / …
421
+ 对应各 provider:Docker getArchive / Vercel readFileToBuffer / e2b files.read(bytes) / …
420
422
 
421
423
  #### `uploadFile`
422
424
 
@@ -425,7 +427,7 @@ uploadFile(path: string, content: Buffer): Promise<void>;
425
427
  ```
426
428
 
427
429
  向沙箱内任意路径写入文件(二进制)。
428
- 对应各 backend:Docker putArchive / Vercel fs.writeFile(Buffer) / e2b files.write / …
430
+ 对应各 provider:Docker putArchive / Vercel fs.writeFile(Buffer) / e2b files.write / …
429
431
 
430
432
  ### `CommandOptions`
431
433
 
@@ -435,7 +437,7 @@ uploadFile(path: string, content: Buffer): Promise<void>;
435
437
  env?: Record<string, string>;
436
438
  ```
437
439
 
438
- 追加/覆盖本命令的环境变量(与沙箱默认环境叠加,不清空默认值;各后端会保留自己固定的 `PATH` 等变量,不保证能被这里覆盖)。
440
+ 追加/覆盖本命令的环境变量(与沙箱默认环境叠加,不清空默认值;各 provider 会保留自己固定的 `PATH` 等变量,不保证能被这里覆盖)。
439
441
 
440
442
  #### `cwd`
441
443
 
@@ -453,8 +455,8 @@ stream?: boolean;
453
455
 
454
456
  把本命令的输出也送进沙箱的「原生日志流」(于是 `docker logs` / Docker UI 的 Logs
455
457
  标签页能实时看到它)。给 agent 命令(codex exec / bub run / claude)开它,就能在容器
456
- 日志里看到 agent 的【原始输出】。后端各自实现(docker:tee 到 PID1 tail 的文件;
457
- 不支持的后端忽略)—— 日志怎么浮现是 backend 的事,adapter 只声明意图。
458
+ 日志里看到 agent 的【原始输出】。provider 各自实现(docker:tee 到 PID1 tail 的文件;
459
+ 不支持的 provider 忽略)—— 日志怎么浮现是 provider 的事,adapter 只声明意图。
458
460
 
459
461
  #### `root`
460
462
 
@@ -465,10 +467,10 @@ root?: boolean;
465
467
  以 root 跑本命令。默认 `false` —— 命令以沙箱的标准**非 root** 用户跑(agent 的自然环境)。
466
468
  给 setup 阶段装系统依赖用(`apt-get install …`、`pip install --break-system-packages …`)。
467
469
 
468
- 语义跨后端一致:"本命令以 root 跑,否则以标准非 root 用户跑"。各后端映射到自己的原生机制
470
+ 语义跨 provider 一致:"本命令以 root 跑,否则以标准非 root 用户跑"。各 provider 映射到自己的原生机制
469
471
  (docker:`exec --user root`;E2B:`{ user: "root" }`;Vercel:`{ sudo: true }`;Daytona:`{ user }`)。
470
- 本就全程 root 的后端(如 Modal)视作 no-op;完全无法提权的后端可不支持(抛错)—— 但**默认值与
471
- 语义保持一致**,不因后端而变。
472
+ 本就全程 root 的 provider(如 Modal)视作 no-op;完全无法提权的 provider 可不支持(抛错)—— 但**默认值与
473
+ 语义保持一致**,不因 provider 而变。
472
474
 
473
475
  {/* GENERATED:END sandbox-methods */}
474
476
 
@@ -37,7 +37,7 @@ name?: LocalizedText;
37
37
  sandbox?: SandboxOption;
38
38
  ```
39
39
 
40
- 项目级默认沙箱后端(docker / vercel / e2b / custom);experiment / CLI flag 可覆盖。
40
+ 项目级默认沙箱 provider(docker / vercel / e2b / custom);experiment 可覆盖。
41
41
 
42
42
  #### `workspace`
43
43
 
@@ -92,7 +92,7 @@ setup?: (sandbox: Sandbox) => Promise<void | Cleanup> | void | Cleanup;
92
92
 
93
93
  eval 级预置:拿到沙箱(已上传 workspace + git 基线 + 装好依赖前)。
94
94
  默认命令以非 root 跑(agent 的自然环境);装系统依赖时给 `runCommand` 传 `{ root: true }`
95
- (如 `runCommand("apt-get", ["install", …], { root: true })`),跨后端语义一致。
95
+ (如 `runCommand("apt-get", ["install", …], { root: true })`),跨 provider 语义一致。
96
96
 
97
97
  #### `test`
98
98
 
@@ -193,7 +193,7 @@ newSession(): SessionHandle;
193
193
  readonly signal: AbortSignal;
194
194
  ```
195
195
 
196
- 本次 attempt 的中止信号;超时 / 早停 / 用户 Ctrl-C 时触发,传给 adapter 的长耗时调用做取消。
196
+ 本次 attempt 的中止信号;超时 / 首过即停 / 用户 Ctrl-C 时触发,传给 adapter 的长耗时调用做取消。
197
197
 
198
198
  #### `model`
199
199
 
@@ -233,7 +233,7 @@ log(msg: string): void;
233
233
  skip(reason: string): never;
234
234
  ```
235
235
 
236
- 立即中止本 eval 并标记为 skipped(outcome / EvalResult.skipReason),reason 不能为空。
236
+ 立即中止本 eval 并标记为 skipped(verdict / EvalResult.skipReason),reason 不能为空。
237
237
 
238
238
  #### `check`
239
239
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: "标准事件流参考"
3
3
  sidebarTitle: "事件流"
4
- description: "StreamEvent 的九种事件:每种的字段、什么时候吐、哪些断言消费它。adapter 的核心工作就是产出这条流。"
4
+ description: "StreamEvent 的十种事件:每种的字段、什么时候吐、哪些断言消费它。adapter 的核心工作就是产出这条流。"
5
5
  ---
6
6
 
7
7
  adapter 的 `send` 返回一个 `Turn`,其中 `events: StreamEvent[]` 是**断言的唯一数据源**:`t.calledTool()`、`t.reply`、`toolOrder`、`noFailedActions`……全部从这条流上读。把你的 agent"这一轮做了什么"翻成这条流,整套断言就都能用。
@@ -79,7 +79,7 @@ token 用量或 OTel span 反推得到)。存在时优先于按价格表(`define
79
79
 
80
80
  ## StreamEvent 变体一览
81
81
 
82
- `StreamEvent` 的九种变体,逐字段列出(消费它们的断言 / 使用细节见下面的「事件总表」和「逐事件说明」):
82
+ `StreamEvent` 的十种变体,逐字段列出(消费它们的断言 / 使用细节见下面的「事件总表」和「逐事件说明」):
83
83
 
84
84
  {/* GENERATED:BEGIN stream-events */}
85
85
 
@@ -108,6 +108,12 @@ token 用量或 OTel span 反推得到)。存在时优先于按价格表(`define
108
108
  }
109
109
  ```
110
110
 
111
+ #### `skill.loaded`
112
+
113
+ ```ts
114
+ { type: "skill.loaded"; skill: string; callId?: string }
115
+ ```
116
+
111
117
  #### `subagent.called`
112
118
 
113
119
  ```ts
@@ -206,7 +212,7 @@ token 用量或 OTel span 反推得到)。存在时优先于按价格表(`define
206
212
  } }
207
213
  ```
208
214
 
209
- agent 停轮等人时,每个待回答的问题吐一条,同时整轮 `status` 返回 `"waiting"`。`t.requireInputRequest(filter)` 的 filter 逐字段匹配这个 `request`——**能填的字段尽量填**,否则 eval 侧筛选不到。接法见[接入教程的 HITL 部分](/zh/guides/connect-your-agent)。
215
+ agent 停轮等人时,每个待回答的问题吐一条,同时该 Turn 的 `status` 返回 `"waiting"`。`t.requireInputRequest(filter)` 的 filter 逐字段匹配这个 `request`——**能填的字段尽量填**,否则 eval 侧筛选不到。接法见[接入教程的 HITL 部分](/zh/guides/connect-your-agent)。
210
216
 
211
217
  ### `thinking` / `compaction` / `error`
212
218
 
@@ -125,7 +125,7 @@ export function makeAssertion(spec: {
125
125
  }): ValueAssertion { ... }
126
126
  ```
127
127
 
128
- 自定义断言工厂:直接给名字 / 严重级 / 阈值 / score,一次调用即返回可用的 ValueAssertion——
128
+ 自定义断言工厂:直接给名字 / 严重度 / 阈值 / score,一次调用即返回可用的 ValueAssertion——
129
129
  不像 gate()/atLeast() 那样需要二段链式调用来定级。severity 省略默认 gate。
130
130
 
131
131
  {/* GENERATED:END expect-matchers */}
@@ -192,21 +192,26 @@ gate(threshold?: number): ValueAssertion;
192
192
  atLeast(threshold: number): ValueAssertion;
193
193
  ```
194
194
 
195
- 转成软阈值断言:未达 threshold 时该条记为 failed,但默认不拖累整条 eval 的 outcome;
196
- `--strict` 运行下,软阈值失败也会把整条 eval 的 outcome 计为 failed。返回新实例,不改原对象。
195
+ 转成软阈值断言:未达 threshold 时该条记为 failed,但默认不拖累整条 eval 的 verdict;
196
+ `--strict` 运行下,软阈值失败也会把整条 eval 的 verdict 计为 failed。返回新实例,不改原对象。
197
197
 
198
198
  {/* GENERATED:END value-assertion */}
199
199
 
200
200
  ## 自定义 matcher
201
201
 
202
202
  ```ts
203
- import { makeAssertion } from "niceeval/expect";
203
+ import { makeAssertion, type Assertion } from "niceeval/expect";
204
204
 
205
- const validEmail = makeAssertion("valid email", (value) => {
206
- return typeof value === "string" && value.includes("@") ? 1 : 0;
207
- });
205
+ function validEmail(): Assertion {
206
+ return makeAssertion({
207
+ name: "valid email",
208
+ score(value) {
209
+ return typeof value === "string" && value.includes("@") ? 1 : 0;
210
+ },
211
+ });
212
+ }
208
213
 
209
214
  t.check(t.reply, validEmail());
210
215
  ```
211
216
 
212
- 自定义 matcher 应返回 0 1 之间的分数,并给出清晰名称。
217
+ `makeAssertion` 接受单个 spec 对象(`name`、可选 `severity`/`threshold`、`score`),直接返回一个 `Assertion`;按惯例用一个同名函数包一层再调用,而不是把 `makeAssertion` 本身当工厂调用。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "niceeval",
3
- "version": "0.5.4",
3
+ "version": "0.6.1",
4
4
  "description": "Agent-native eval tool — eval agents, services, functions, and coding-agent fixtures",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -49,18 +49,21 @@
49
49
  "import": "./src/results/index.ts"
50
50
  },
51
51
  "./report": {
52
- "types": "./src/report/index.ts",
53
- "import": "./src/report/index.ts"
52
+ "types": "./dist/report/index.d.ts",
53
+ "import": "./dist/report/index.js"
54
54
  },
55
55
  "./report/react": {
56
- "types": "./src/report/react/index.tsx",
57
- "import": "./src/report/react/index.tsx"
56
+ "types": "./dist/report/react/index.d.ts",
57
+ "import": "./dist/report/react/index.js"
58
58
  },
59
- "./report/react/styles.css": "./src/report/react/styles.css"
59
+ "./report/react/styles.css": "./src/report/react/styles.css",
60
+ "./report/react/enhance.js": "./src/report/react/enhance.js"
60
61
  },
61
62
  "files": [
63
+ "INDEX.md",
62
64
  "src",
63
65
  "bin",
66
+ "dist",
64
67
  "docs-site/zh",
65
68
  "docs-site/images"
66
69
  ],
@@ -159,6 +162,7 @@
159
162
  "tiers:sync": "node scripts/sync-tiers.mjs sync",
160
163
  "tiers:check": "node scripts/sync-tiers.mjs check",
161
164
  "view:build": "vite build --config src/view/app/vite.config.ts",
165
+ "build:report": "tsc -p tsconfig.report-build.json && node scripts/prune-report-dist.mjs",
162
166
  "site:dev": "cd site && node scripts/dev.mjs",
163
167
  "site:build": "cd site && next build",
164
168
  "docs:dev": "cd docs-site && npx --yes mint@latest dev",