@botpress/adk 1.18.2 → 1.19.0-beta.10

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 (299) hide show
  1. package/dist/agent-init/agent-project-generator.d.ts +10 -7
  2. package/dist/agent-init/agent-project-generator.d.ts.map +1 -1
  3. package/dist/agent-project/agent-project.d.ts +1 -1
  4. package/dist/agent-project/agent-project.d.ts.map +1 -1
  5. package/dist/agent-project/component-files.d.ts +10 -0
  6. package/dist/agent-project/component-files.d.ts.map +1 -0
  7. package/dist/agent-project/component-index-writer.d.ts +22 -0
  8. package/dist/agent-project/component-index-writer.d.ts.map +1 -0
  9. package/dist/agent-project/config-writer.d.ts +5 -0
  10. package/dist/agent-project/config-writer.d.ts.map +1 -1
  11. package/dist/agent-project/dependencies-parser.d.ts.map +1 -1
  12. package/dist/agent-project/file-watcher.d.ts.map +1 -1
  13. package/dist/agent-project/index.d.ts +3 -0
  14. package/dist/agent-project/index.d.ts.map +1 -1
  15. package/dist/agent-project/lock-to-dependencies.d.ts +11 -0
  16. package/dist/agent-project/lock-to-dependencies.d.ts.map +1 -0
  17. package/dist/agent-project/types.d.ts +1 -0
  18. package/dist/agent-project/types.d.ts.map +1 -1
  19. package/dist/agent-project/validation-errors.d.ts +1 -0
  20. package/dist/agent-project/validation-errors.d.ts.map +1 -1
  21. package/dist/agent0/capabilities/commands/adk-build.md +39 -0
  22. package/dist/agent0/capabilities/commands/adk-debug.md +23 -0
  23. package/dist/agent0/capabilities/commands/adk-dev-console.md +17 -0
  24. package/dist/agent0/capabilities/commands/adk-document.md +68 -0
  25. package/dist/agent0/capabilities/commands/adk-eval.md +17 -0
  26. package/dist/agent0/capabilities/commands/adk-explain.md +22 -0
  27. package/dist/agent0/capabilities/commands/adk-init.md +30 -0
  28. package/dist/agent0/capabilities/commands/adk-ship.md +29 -0
  29. package/dist/agent0/capabilities/commands/adk-test.md +27 -0
  30. package/dist/agent0/capabilities/commands/adk-validate.md +31 -0
  31. package/dist/agent0/capabilities/skills/adk/SKILL.md +548 -0
  32. package/dist/agent0/capabilities/skills/adk/references/actions.md +823 -0
  33. package/dist/agent0/capabilities/skills/adk/references/advanced-patterns.md +669 -0
  34. package/dist/agent0/capabilities/skills/adk/references/agent-config.md +450 -0
  35. package/dist/agent0/capabilities/skills/adk/references/assets.md +237 -0
  36. package/dist/agent0/capabilities/skills/adk/references/autonomous-execution.md +747 -0
  37. package/dist/agent0/capabilities/skills/adk/references/cli.md +1334 -0
  38. package/dist/agent0/capabilities/skills/adk/references/context-api.md +461 -0
  39. package/dist/agent0/capabilities/skills/adk/references/conversation-lifecycle.md +311 -0
  40. package/dist/agent0/capabilities/skills/adk/references/conversations.md +1111 -0
  41. package/dist/agent0/capabilities/skills/adk/references/custom-components.md +167 -0
  42. package/dist/agent0/capabilities/skills/adk/references/desk.md +852 -0
  43. package/dist/agent0/capabilities/skills/adk/references/evals.md +11 -0
  44. package/dist/agent0/capabilities/skills/adk/references/explain-config.md +424 -0
  45. package/dist/agent0/capabilities/skills/adk/references/files.md +918 -0
  46. package/dist/agent0/capabilities/skills/adk/references/integration-actions.md +659 -0
  47. package/dist/agent0/capabilities/skills/adk/references/integrations.md +266 -0
  48. package/dist/agent0/capabilities/skills/adk/references/interfaces.md +97 -0
  49. package/dist/agent0/capabilities/skills/adk/references/knowledge-bases.md +456 -0
  50. package/dist/agent0/capabilities/skills/adk/references/mcp-server.md +112 -0
  51. package/dist/agent0/capabilities/skills/adk/references/messages.md +769 -0
  52. package/dist/agent0/capabilities/skills/adk/references/model-configuration.md +201 -0
  53. package/dist/agent0/capabilities/skills/adk/references/patterns-mistakes.md +469 -0
  54. package/dist/agent0/capabilities/skills/adk/references/plugins.md +280 -0
  55. package/dist/agent0/capabilities/skills/adk/references/tables.md +1136 -0
  56. package/dist/agent0/capabilities/skills/adk/references/tags.md +516 -0
  57. package/dist/agent0/capabilities/skills/adk/references/tools.md +581 -0
  58. package/dist/agent0/capabilities/skills/adk/references/triggers.md +719 -0
  59. package/dist/agent0/capabilities/skills/adk/references/workflow-steps.md +851 -0
  60. package/dist/agent0/capabilities/skills/adk/references/workflows.md +1408 -0
  61. package/dist/agent0/capabilities/skills/adk/references/zai-agent-reference.md +454 -0
  62. package/dist/agent0/capabilities/skills/adk/references/zai-complete-guide.md +1408 -0
  63. package/dist/agent0/capabilities/skills/adk-debugger/SKILL.md +257 -0
  64. package/dist/agent0/capabilities/skills/adk-debugger/references/common-failures.md +231 -0
  65. package/dist/agent0/capabilities/skills/adk-debugger/references/conversation-analysis.md +420 -0
  66. package/dist/agent0/capabilities/skills/adk-debugger/references/debug-workflow.md +239 -0
  67. package/dist/agent0/capabilities/skills/adk-debugger/references/llm-debugging.md +209 -0
  68. package/dist/agent0/capabilities/skills/adk-debugger/references/trace-summarization.md +313 -0
  69. package/dist/agent0/capabilities/skills/adk-debugger/references/traces-and-logs.md +203 -0
  70. package/dist/agent0/capabilities/skills/adk-dev-console/SKILL.md +111 -0
  71. package/dist/agent0/capabilities/skills/adk-dev-console/references/agent-steps.md +115 -0
  72. package/dist/agent0/capabilities/skills/adk-dev-console/references/component-registry.md +43 -0
  73. package/dist/agent0/capabilities/skills/adk-dev-console/references/multi-agent-dashboard.md +70 -0
  74. package/dist/agent0/capabilities/skills/adk-dev-console/references/pages.md +273 -0
  75. package/dist/agent0/capabilities/skills/adk-docs/SKILL.md +114 -0
  76. package/dist/agent0/capabilities/skills/adk-docs/references/doc-standards.md +124 -0
  77. package/dist/agent0/capabilities/skills/adk-evals/SKILL.md +244 -0
  78. package/dist/agent0/capabilities/skills/adk-evals/references/eval-format.md +354 -0
  79. package/dist/agent0/capabilities/skills/adk-evals/references/test-patterns.md +355 -0
  80. package/dist/agent0/capabilities/skills/adk-evals/references/testing-workflow.md +225 -0
  81. package/dist/agent0/config/index.d.ts +5 -0
  82. package/dist/agent0/config/index.d.ts.map +1 -0
  83. package/dist/agent0/config/paths.d.ts +12 -0
  84. package/dist/agent0/config/paths.d.ts.map +1 -0
  85. package/dist/agent0/config/schema.d.ts +171 -0
  86. package/dist/agent0/config/schema.d.ts.map +1 -0
  87. package/dist/agent0/config/secrets.d.ts +4 -0
  88. package/dist/agent0/config/secrets.d.ts.map +1 -0
  89. package/dist/agent0/config/store.d.ts +26 -0
  90. package/dist/agent0/config/store.d.ts.map +1 -0
  91. package/dist/agent0/index.d.ts +6 -0
  92. package/dist/agent0/index.d.ts.map +1 -0
  93. package/dist/agent0/index.js +3381 -0
  94. package/dist/agent0/index.js.map +29 -0
  95. package/dist/agent0/providers/catalog.d.ts +189 -0
  96. package/dist/agent0/providers/catalog.d.ts.map +1 -0
  97. package/dist/agent0/providers/index.d.ts +4 -0
  98. package/dist/agent0/providers/index.d.ts.map +1 -0
  99. package/dist/agent0/providers/registry.d.ts +32 -0
  100. package/dist/agent0/providers/registry.d.ts.map +1 -0
  101. package/dist/agent0/providers/source.d.ts +105 -0
  102. package/dist/agent0/providers/source.d.ts.map +1 -0
  103. package/dist/agent0/runtime/client.d.ts +49 -0
  104. package/dist/agent0/runtime/client.d.ts.map +1 -0
  105. package/dist/agent0/runtime/engine.d.ts +79 -0
  106. package/dist/agent0/runtime/engine.d.ts.map +1 -0
  107. package/dist/agent0/runtime/index.d.ts +7 -0
  108. package/dist/agent0/runtime/index.d.ts.map +1 -0
  109. package/dist/agent0/runtime/manager.d.ts +81 -0
  110. package/dist/agent0/runtime/manager.d.ts.map +1 -0
  111. package/dist/agent0/runtime/permissions.d.ts +6 -0
  112. package/dist/agent0/runtime/permissions.d.ts.map +1 -0
  113. package/dist/agent0/runtime/process.d.ts +52 -0
  114. package/dist/agent0/runtime/process.d.ts.map +1 -0
  115. package/dist/agent0/runtime/project-discovery.d.ts +5 -0
  116. package/dist/agent0/runtime/project-discovery.d.ts.map +1 -0
  117. package/dist/agent0/types.d.ts +447 -0
  118. package/dist/agent0/types.d.ts.map +1 -0
  119. package/dist/assets/manager.d.ts +0 -2
  120. package/dist/assets/manager.d.ts.map +1 -1
  121. package/dist/assets/types.d.ts +3 -1
  122. package/dist/assets/types.d.ts.map +1 -1
  123. package/dist/auth/credentials.d.ts.map +1 -1
  124. package/dist/auth/index.d.ts +30 -0
  125. package/dist/auth/index.d.ts.map +1 -1
  126. package/dist/auth/service.d.ts.map +1 -1
  127. package/dist/bot-generator/dev-id-manager.d.ts.map +1 -1
  128. package/dist/bot-generator/generator.d.ts +5 -1
  129. package/dist/bot-generator/generator.d.ts.map +1 -1
  130. package/dist/bot-generator/integration-sync.d.ts +2 -0
  131. package/dist/bot-generator/integration-sync.d.ts.map +1 -1
  132. package/dist/bot-generator/interface-sync.d.ts +2 -0
  133. package/dist/bot-generator/interface-sync.d.ts.map +1 -1
  134. package/dist/bot-generator/plugin-sync.d.ts +2 -0
  135. package/dist/bot-generator/plugin-sync.d.ts.map +1 -1
  136. package/dist/bot-generator/table-validation.d.ts +17 -0
  137. package/dist/bot-generator/table-validation.d.ts.map +1 -0
  138. package/dist/chat-bundle.cjs +31 -0
  139. package/dist/cognitive/models.d.ts +32 -0
  140. package/dist/cognitive/models.d.ts.map +1 -0
  141. package/dist/commands/base-command.d.ts +1 -0
  142. package/dist/commands/base-command.d.ts.map +1 -1
  143. package/dist/commands/bp-add-command.d.ts.map +1 -1
  144. package/dist/commands/bp-build-command.d.ts.map +1 -1
  145. package/dist/commands/bp-chat-command.d.ts.map +1 -1
  146. package/dist/commands/bp-cli.d.ts +1 -0
  147. package/dist/commands/bp-cli.d.ts.map +1 -1
  148. package/dist/commands/bp-cli.js +147 -0
  149. package/dist/commands/bp-cli.js.map +12 -0
  150. package/dist/commands/bp-deploy-command.d.ts.map +1 -1
  151. package/dist/commands/bp-dev-command.d.ts +7 -0
  152. package/dist/commands/bp-dev-command.d.ts.map +1 -1
  153. package/dist/commands/bp-dev-stderr.d.ts +21 -0
  154. package/dist/commands/bp-dev-stderr.d.ts.map +1 -0
  155. package/dist/commands/bp-dev-worker-env.d.ts +7 -0
  156. package/dist/commands/bp-dev-worker-env.d.ts.map +1 -0
  157. package/dist/commands/index.d.ts +0 -5
  158. package/dist/commands/index.d.ts.map +1 -1
  159. package/dist/config/manager.d.ts +9 -1
  160. package/dist/config/manager.d.ts.map +1 -1
  161. package/dist/constants.d.ts +1 -0
  162. package/dist/constants.d.ts.map +1 -1
  163. package/dist/dependencies/alias-utils.d.ts +13 -0
  164. package/dist/dependencies/alias-utils.d.ts.map +1 -0
  165. package/dist/dependencies/dependency-manager.d.ts +89 -0
  166. package/dist/dependencies/dependency-manager.d.ts.map +1 -0
  167. package/dist/dependencies/errors.d.ts +19 -0
  168. package/dist/dependencies/errors.d.ts.map +1 -0
  169. package/dist/dependencies/index.d.ts +17 -0
  170. package/dist/dependencies/index.d.ts.map +1 -0
  171. package/dist/dependencies/index.js +6233 -0
  172. package/dist/dependencies/index.js.map +61 -0
  173. package/dist/dependencies/json-utils.d.ts +3 -0
  174. package/dist/dependencies/json-utils.d.ts.map +1 -0
  175. package/dist/dependencies/lock-file.d.ts +15 -0
  176. package/dist/dependencies/lock-file.d.ts.map +1 -0
  177. package/dist/dependencies/migration.d.ts +8 -0
  178. package/dist/dependencies/migration.d.ts.map +1 -0
  179. package/dist/dependencies/registry/integration-registry.d.ts +17 -0
  180. package/dist/dependencies/registry/integration-registry.d.ts.map +1 -0
  181. package/dist/dependencies/registry/interface-registry.d.ts +11 -0
  182. package/dist/dependencies/registry/interface-registry.d.ts.map +1 -0
  183. package/dist/dependencies/registry/plugin-registry.d.ts +16 -0
  184. package/dist/dependencies/registry/plugin-registry.d.ts.map +1 -0
  185. package/dist/dependencies/resolvers/integration-resolver.d.ts +30 -0
  186. package/dist/dependencies/resolvers/integration-resolver.d.ts.map +1 -0
  187. package/dist/dependencies/resolvers/plugin-resolver.d.ts +38 -0
  188. package/dist/dependencies/resolvers/plugin-resolver.d.ts.map +1 -0
  189. package/dist/dependencies/types.d.ts +254 -0
  190. package/dist/dependencies/types.d.ts.map +1 -0
  191. package/dist/deploy-manifest/index.d.ts +608 -0
  192. package/dist/deploy-manifest/index.d.ts.map +1 -0
  193. package/dist/file-watcher/watcher.d.ts +21 -5
  194. package/dist/file-watcher/watcher.d.ts.map +1 -1
  195. package/dist/generators/action-types.d.ts.map +1 -1
  196. package/dist/generators/assets.d.ts +2 -2
  197. package/dist/generators/assets.d.ts.map +1 -1
  198. package/dist/generators/client-wrapper.d.ts.map +1 -1
  199. package/dist/generators/tests.d.ts +6 -6
  200. package/dist/generators/tests.d.ts.map +1 -1
  201. package/dist/generators/utils.d.ts.map +1 -1
  202. package/dist/index.d.ts +15 -12
  203. package/dist/index.d.ts.map +1 -1
  204. package/dist/index.js +17612 -5520
  205. package/dist/index.js.map +83 -66
  206. package/dist/integrations/config-utils.d.ts.map +1 -1
  207. package/dist/integrations/hub-cache.d.ts.map +1 -1
  208. package/dist/integrations/index.d.ts +0 -6
  209. package/dist/integrations/index.d.ts.map +1 -1
  210. package/dist/integrations/manager.d.ts +17 -1
  211. package/dist/integrations/manager.d.ts.map +1 -1
  212. package/dist/interfaces/index.d.ts +0 -2
  213. package/dist/interfaces/index.d.ts.map +1 -1
  214. package/dist/interfaces/manager.d.ts +3 -1
  215. package/dist/interfaces/manager.d.ts.map +1 -1
  216. package/dist/interfaces/parser.d.ts.map +1 -1
  217. package/dist/knowledge/manager.d.ts +3 -1
  218. package/dist/knowledge/manager.d.ts.map +1 -1
  219. package/dist/knowledge/types.d.ts +2 -2
  220. package/dist/knowledge/types.d.ts.map +1 -1
  221. package/dist/plugins/manager.d.ts +34 -1
  222. package/dist/plugins/manager.d.ts.map +1 -1
  223. package/dist/preflight/checker.d.ts +5 -6
  224. package/dist/preflight/checker.d.ts.map +1 -1
  225. package/dist/preflight/index.d.ts +2 -2
  226. package/dist/preflight/index.d.ts.map +1 -1
  227. package/dist/preflight/types.d.ts +30 -32
  228. package/dist/preflight/types.d.ts.map +1 -1
  229. package/dist/runner/script-runner.d.ts +2 -0
  230. package/dist/runner/script-runner.d.ts.map +1 -1
  231. package/dist/runner/supervise-child.d.ts +24 -0
  232. package/dist/runner/supervise-child.d.ts.map +1 -0
  233. package/dist/secrets/manager.d.ts.map +1 -1
  234. package/dist/tables/table-manager.d.ts.map +1 -1
  235. package/dist/tables/types.d.ts +3 -2
  236. package/dist/tables/types.d.ts.map +1 -1
  237. package/dist/templates/README.md +14 -13
  238. package/dist/templates/blank/agent.config.ts +0 -3
  239. package/dist/templates/blank/evals/index.eval.ts +30 -0
  240. package/dist/templates/blank/src/conversations/index.ts +16 -16
  241. package/dist/templates/blank/tsconfig.json +1 -1
  242. package/dist/templates/botpress-desk/README.md +87 -0
  243. package/dist/templates/botpress-desk/agent.config.ts +19 -0
  244. package/dist/templates/botpress-desk/evals/index.eval.ts +30 -0
  245. package/dist/templates/botpress-desk/package.json +17 -0
  246. package/dist/templates/botpress-desk/src/actions/index.ts +19 -0
  247. package/dist/templates/botpress-desk/src/conversations/index.ts +16 -0
  248. package/dist/templates/botpress-desk/src/knowledge/index.ts +20 -0
  249. package/dist/templates/botpress-desk/src/tables/index.ts +16 -0
  250. package/dist/templates/botpress-desk/src/tools/handToSupport.ts +23 -0
  251. package/dist/templates/botpress-desk/src/triggers/index.ts +17 -0
  252. package/dist/templates/botpress-desk/src/workflows/index.ts +21 -0
  253. package/dist/templates/crm-enrichment/agent.config.ts +0 -3
  254. package/dist/templates/crm-enrichment/evals/example.eval.ts +29 -0
  255. package/dist/templates/crm-enrichment/package.json +1 -0
  256. package/dist/templates/crm-enrichment/tsconfig.json +1 -1
  257. package/dist/templates/hello-world/agent.config.ts +0 -3
  258. package/dist/templates/hello-world/evals/context-retention.eval.ts +37 -0
  259. package/dist/templates/hello-world/evals/greeting.eval.ts +43 -0
  260. package/dist/templates/hello-world/package.json +1 -0
  261. package/dist/templates/hello-world/tsconfig.json +1 -1
  262. package/dist/templates/knowledge-assistant/agent.config.ts +0 -3
  263. package/dist/templates/knowledge-assistant/evals/engineering-practices.eval.ts +45 -0
  264. package/dist/templates/knowledge-assistant/evals/out-of-scope.eval.ts +33 -0
  265. package/dist/templates/knowledge-assistant/evals/pto-policy.eval.ts +44 -0
  266. package/dist/templates/knowledge-assistant/package.json +1 -0
  267. package/dist/templates/knowledge-assistant/tsconfig.json +1 -1
  268. package/dist/templates/slack-triage/agent.config.ts +0 -8
  269. package/dist/templates/slack-triage/evals/triage-basic.eval.ts +9 -39
  270. package/dist/templates/slack-triage/package.json +1 -0
  271. package/dist/templates/slack-triage/src/conversations/slack-dm.ts +4 -1
  272. package/dist/templates/slack-triage/tsconfig.json +1 -1
  273. package/dist/templates/template.config.json +16 -16
  274. package/dist/test-utils/mock-module.d.ts +29 -0
  275. package/dist/test-utils/mock-module.d.ts.map +1 -0
  276. package/dist/utils/require-chat.d.ts +3 -24
  277. package/dist/utils/require-chat.d.ts.map +1 -1
  278. package/dist/utils/search-ranking.d.ts +15 -0
  279. package/dist/utils/search-ranking.d.ts.map +1 -0
  280. package/dist/utils/source-map-optimizer.d.ts +10 -11
  281. package/dist/utils/source-map-optimizer.d.ts.map +1 -1
  282. package/dist/workspace/workspace-cache.d.ts.map +1 -1
  283. package/package.json +23 -11
  284. package/dist/commands/copilot-config-reader.d.ts +0 -12
  285. package/dist/commands/copilot-config-reader.d.ts.map +0 -1
  286. package/dist/commands/copilot-server.d.ts +0 -26
  287. package/dist/commands/copilot-server.d.ts.map +0 -1
  288. package/dist/commands/opencode-config.d.ts +0 -29
  289. package/dist/commands/opencode-config.d.ts.map +0 -1
  290. package/dist/integrations/checker.d.ts +0 -41
  291. package/dist/integrations/checker.d.ts.map +0 -1
  292. package/dist/integrations/operations.d.ts +0 -140
  293. package/dist/integrations/operations.d.ts.map +0 -1
  294. package/dist/integrations/sync-manager.d.ts +0 -19
  295. package/dist/integrations/sync-manager.d.ts.map +0 -1
  296. package/dist/interfaces/operations.d.ts +0 -48
  297. package/dist/interfaces/operations.d.ts.map +0 -1
  298. package/dist/preflight/formatter.d.ts +0 -12
  299. package/dist/preflight/formatter.d.ts.map +0 -1
@@ -0,0 +1,244 @@
1
+ ---
2
+ name: adk-evals
3
+ description: Complete reference for writing, running, and iterating on evals (automated conversation tests) for ADK agents. Covers eval file format, all assertion types, CLI usage, and per-primitive testing patterns.
4
+ license: MIT
5
+ ---
6
+
7
+ # ADK Evals Skill
8
+
9
+ ## What are Evals?
10
+
11
+ Evals are automated conversation tests for ADK agents. Each eval defines a scenario — a sequence of user messages or events — and asserts on what the bot should do: what it says, which tools it calls, how state changes, which workflows run, and more.
12
+
13
+ Evals run against a live dev bot (`adk dev`), so they test the full stack — not mocks.
14
+
15
+ ## When to Use This Skill
16
+
17
+ Use this skill when the developer asks about:
18
+
19
+ - **Writing evals** — file format, assertions, turn types, setup
20
+ - **Running evals** — CLI commands, filtering, output interpretation
21
+ - **Testing specific primitives** — how to test actions, tools, workflows, conversations, state
22
+ - **The testing loop** — write → run → inspect traces → iterate
23
+ - **CI integration** — exit codes, `--format json` flag, tagging strategies
24
+ - **Eval configuration** — idleTimeout, judgePassThreshold, judgeModel
25
+
26
+ Or when you are developing an ADK bot and need to write the equivalent of unit/end-to-end tests.
27
+
28
+ **Trigger questions:**
29
+ - "How do I write an eval?"
30
+ - "How do I test my workflow?"
31
+ - "How do I assert that a tool was called with specific params?"
32
+ - "My eval is failing, how do I debug it?"
33
+ - "How do I test that the bot stays silent?"
34
+ - "How do I run evals in CI?"
35
+ - "How do I seed state before an eval?"
36
+ - "How do I trigger a workflow in an eval?"
37
+
38
+ ## Available Documentation
39
+
40
+ | File | Contents |
41
+ |------|----------|
42
+ | `references/eval-format.md` | Complete file format — all fields, turn types, assertion categories, match operators, setup, outcome, options |
43
+ | `references/testing-workflow.md` | Running evals, interpreting output, using traces, the write → test → iterate loop, CI integration |
44
+ | `references/test-patterns.md` | Per-primitive patterns for actions, tools, workflows, conversations, and state |
45
+
46
+ ## How to Answer
47
+
48
+ 1. **Writing an eval** → Read `eval-format.md` for structure and assertions
49
+ 2. **Running evals** → Read `testing-workflow.md` for CLI commands and output
50
+ 3. **Testing a specific primitive** → Read `test-patterns.md` for the relevant section
51
+ 4. **Debugging a failure** → Combine `testing-workflow.md` (inspect traces) + `eval-format.md` (check assertion syntax)
52
+
53
+ ---
54
+
55
+ ## Quick Reference
56
+
57
+ ### Eval file structure
58
+
59
+ ```typescript
60
+ import { Eval } from '@botpress/evals'
61
+
62
+ export default new Eval({
63
+ name: 'greeting',
64
+ type: 'regression',
65
+ tags: ['basic'],
66
+
67
+ setup: {
68
+ state: { bot: { welcomeSent: false } },
69
+ workflow: { trigger: 'onboarding', input: { userId: 'test-1' } },
70
+ },
71
+
72
+ conversation: [
73
+ {
74
+ user: 'Hi!',
75
+ assert: {
76
+ response: [
77
+ { not_contains: 'error' },
78
+ { llm_judge: 'Response is friendly and offers to help' },
79
+ ],
80
+ tools: [{ not_called: 'createTicket' }],
81
+ state: [{ path: 'conversation.greeted', equals: true }],
82
+ },
83
+ },
84
+ ],
85
+
86
+ outcome: {
87
+ state: [{ path: 'conversation.greeted', equals: true }],
88
+ },
89
+
90
+ options: {
91
+ idleTimeout: 60000,
92
+ judgePassThreshold: 4,
93
+ },
94
+ })
95
+ ```
96
+
97
+ ### Turn types
98
+
99
+ | Turn | When to use |
100
+ |------|------------|
101
+ | `user: 'message'` | Standard user message |
102
+ | `event: { type, payload }` | Non-message trigger (webhook, integration event) |
103
+ | `expectSilence: true` | Assert bot does NOT respond |
104
+
105
+ ### Assertion categories
106
+
107
+ | Category | What it checks |
108
+ |----------|---------------|
109
+ | `response` | Bot reply text (contains, not_contains, matches, llm_judge) |
110
+ | `tools` | Tool calls (called, not_called, call_order, params) |
111
+ | `state` | Bot/user/conversation state (equals, changed) |
112
+ | `workflow` | Workflow execution (entered, completed) |
113
+ | `timing` | Response time in ms (lte, gte) |
114
+
115
+ ### CLI commands
116
+
117
+ ```bash
118
+ adk evals # run all evals
119
+ adk evals <name> # run one eval
120
+ adk evals --tag <tag> # filter by tag
121
+ adk evals --type regression # filter by type
122
+ adk evals --verbose # show all assertions
123
+ adk evals --format json # JSON output for CI
124
+
125
+ adk evals runs # list recent runs
126
+ adk evals runs --latest # most recent run
127
+ adk evals runs --latest -v # with full details
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Critical Patterns
133
+
134
+ ✅ **Every turn needs `user` or `event`**
135
+
136
+ ```typescript
137
+ // CORRECT
138
+ { user: 'hello', expectSilence: true }
139
+ { event: { type: 'payment.failed' }, expectSilence: true }
140
+ ```
141
+
142
+ ❌ **`expectSilence` alone is not a valid turn**
143
+
144
+ ```typescript
145
+ // WRONG — missing user or event
146
+ { expectSilence: true }
147
+ ```
148
+
149
+ ---
150
+
151
+ ✅ **Assert tool params to verify correct extraction**
152
+
153
+ ```typescript
154
+ // CORRECT — verifies the LLM extracted the right values
155
+ { called: 'createTicket', params: { priority: { equals: 'high' } } }
156
+ ```
157
+
158
+ ❌ **Only asserting the tool was called**
159
+
160
+ ```typescript
161
+ // INCOMPLETE — doesn't verify params were correct
162
+ { called: 'createTicket' }
163
+ ```
164
+
165
+ ---
166
+
167
+ ✅ **Use `outcome` for post-conversation state and workflow assertions**
168
+
169
+ ```typescript
170
+ // CORRECT — final state checked once after all turns
171
+ outcome: {
172
+ state: [{ path: 'conversation.resolved', equals: true }],
173
+ workflow: [{ name: 'ticketFlow', completed: true }],
174
+ }
175
+ ```
176
+
177
+ ---
178
+
179
+ ✅ **Seed state to test conditional behavior without running setup turns**
180
+
181
+ ```typescript
182
+ // CORRECT — start in a known state
183
+ setup: {
184
+ state: {
185
+ user: { plan: 'pro' },
186
+ conversation: { phase: 'support' },
187
+ },
188
+ }
189
+ ```
190
+
191
+ ❌ **Using conversation turns to set up state (slow and fragile)**
192
+
193
+ ```typescript
194
+ // WRONG — depends on the bot correctly processing setup turns
195
+ conversation: [
196
+ { user: 'I am on the pro plan' }, // hoping bot sets user.plan
197
+ { user: 'I need help with billing' }, // actual test turn
198
+ ]
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Example Questions
204
+
205
+ **Writing evals:**
206
+ - "Write an eval that tests my createTicket tool is called with the right priority"
207
+ - "How do I assert that the bot stays silent after an internal event?"
208
+ - "How do I test a multi-turn conversation where context is retained?"
209
+
210
+ **Running evals:**
211
+ - "How do I run only regression evals?"
212
+ - "How do I see which assertions failed and why?"
213
+ - "How do I integrate evals into GitHub Actions?"
214
+
215
+ **Debugging:**
216
+ - "My eval says the tool wasn't called but I think it was — how do I check?"
217
+ - "How do I inspect what the bot actually did during an eval?"
218
+
219
+ **Per-primitive:**
220
+ - "How do I test a workflow that uses step.sleep()?"
221
+ - "How do I test that state changed from the seeded value?"
222
+
223
+ ---
224
+
225
+ ## Response Format
226
+
227
+ **Match depth to the question.**
228
+
229
+ ### Simple questions ("what assertions are available?", "how do I run evals?")
230
+
231
+ Answer directly — show the relevant table or CLI command. Don't generate a full eval file for an informational question.
232
+
233
+ ### Writing an eval
234
+
235
+ 1. Show the complete `new Eval({})` call with realistic field values
236
+ 2. Include imports (`import { Eval } from '@botpress/evals'`)
237
+ 3. Briefly explain non-obvious assertions — skip if the assertion is self-explanatory
238
+ 4. Suggest the CLI command to run it: `adk evals <name>`
239
+
240
+ ### Debugging a failing eval
241
+
242
+ 1. Ask for or show the failing assertion (`expected` / `actual` diff)
243
+ 2. Suggest opening traces in the Dev Console to see what the bot did
244
+ 3. Identify whether the issue is in the eval assertion or the bot's behavior
@@ -0,0 +1,354 @@
1
+ # Eval File Format
2
+
3
+ Evals are TypeScript files in the `evals/` directory. Each file exports one or more eval definitions using `new Eval`.
4
+
5
+ ## File Location
6
+
7
+ Evals live in `evals/` at the **project root** (not inside `src/`). Create it if it doesn't exist:
8
+
9
+ ```
10
+ my-agent/
11
+ ├── agent.config.ts
12
+ ├── src/
13
+ │ ├── actions/
14
+ │ └── workflows/
15
+ └── evals/ ← create this
16
+ ├── greeting.eval.ts
17
+ └── billing.eval.ts
18
+ ```
19
+
20
+ - **Naming**: `*.eval.ts` convention (recommended)
21
+ - **Auto-discovery**: All files in `evals/` are picked up by `adk evals`
22
+
23
+ ## Full Structure
24
+
25
+ ```typescript
26
+ import { Eval } from '@botpress/evals'
27
+
28
+ export default new Eval({
29
+ name: 'my-eval', // unique identifier (required)
30
+ description: 'What this tests', // optional
31
+ type: 'regression', // 'capability' or 'regression' — optional, for filtering
32
+ tags: ['tools', 'multi-turn'], // optional, for filtering
33
+
34
+ setup: {
35
+ // Seed state or trigger a workflow before the conversation (optional)
36
+ },
37
+
38
+ conversation: [
39
+ {
40
+ user: 'message from user', // or: event, expectSilence
41
+ assert: { /* per-turn assertions */ },
42
+ },
43
+ ],
44
+
45
+ outcome: { /* post-conversation assertions (optional) */ },
46
+
47
+ options: { /* per-eval overrides (optional) */ },
48
+ })
49
+ ```
50
+
51
+ ## Types
52
+
53
+ | Type | Purpose |
54
+ |------|---------|
55
+ | `capability` | Verify the bot can do something new |
56
+ | `regression` | Verify the bot still does it correctly |
57
+
58
+ ## Multiple Evals Per File
59
+
60
+ ```typescript
61
+ export const greeting = new Eval({ name: 'greeting', ... })
62
+ export const farewell = new Eval({ name: 'farewell', ... })
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Conversation Turns
68
+
69
+ Each entry in `conversation` is one turn. A turn must have either `user` or `event`.
70
+
71
+ ### User Message
72
+
73
+ ```typescript
74
+ {
75
+ user: 'What is my account balance?',
76
+ assert: { /* assertions on the bot's response */ },
77
+ }
78
+ ```
79
+
80
+ ### Event Trigger
81
+
82
+ Fire a non-message event (webhook, integration event) instead of a user message.
83
+
84
+ ```typescript
85
+ {
86
+ event: {
87
+ type: 'checkout:order_placed',
88
+ payload: { orderId: 'ORD-001', total: 49.99 },
89
+ },
90
+ assert: {
91
+ workflow: [{ name: 'orderConfirmation', entered: true }],
92
+ },
93
+ }
94
+ ```
95
+
96
+ ### Expect Silence
97
+
98
+ Assert the bot does **not** respond. Add `expectSilence: true` to any turn.
99
+
100
+ ```typescript
101
+ // Silence after a user message
102
+ { user: 'Please ignore this.', expectSilence: true }
103
+
104
+ // Silence after an event
105
+ { event: { type: 'internal:ping' }, expectSilence: true }
106
+ ```
107
+
108
+ > **Note:** `expectSilence` is mutually exclusive with `assert.response`. Every turn must have `user` or `event` — `expectSilence` is a flag on top of that, not a standalone turn type.
109
+
110
+ ---
111
+
112
+ ## Assertion Categories
113
+
114
+ ### Response
115
+
116
+ What the bot said back.
117
+
118
+ ```typescript
119
+ assert: {
120
+ response: [
121
+ { contains: 'ticket' }, // substring present
122
+ { not_contains: 'error' }, // substring absent
123
+ { matches: 'TKT-\\d{3}' }, // regex match
124
+ { llm_judge: 'Response confirms the ticket was created' }, // AI judge, scores 1–5
125
+ ],
126
+ }
127
+ ```
128
+
129
+ ### Tools
130
+
131
+ Which tools the bot called and with what parameters.
132
+
133
+ ```typescript
134
+ assert: {
135
+ tools: [
136
+ { called: 'createTicket' }, // tool was invoked
137
+ { called: 'createTicket', params: { // with specific params
138
+ priority: { equals: 'high' },
139
+ department: { contains: 'Engineering' },
140
+ }},
141
+ { not_called: 'deleteTicket' }, // tool was NOT invoked
142
+ { call_order: ['lookupUser', 'createTicket'] }, // ordered calls
143
+ ],
144
+ }
145
+ ```
146
+
147
+ ### State
148
+
149
+ Bot, user, or conversation state values after the turn.
150
+
151
+ ```typescript
152
+ assert: {
153
+ state: [
154
+ { path: 'conversation.topic', equals: 'support' }, // exact value
155
+ { path: 'conversation.topic', changed: true }, // value changed from before
156
+ { path: 'bot.ticketCount', equals: 3 },
157
+ ],
158
+ }
159
+ ```
160
+
161
+ ### Workflow
162
+
163
+ Workflow execution (verified via trace spans).
164
+
165
+ ```typescript
166
+ assert: {
167
+ workflow: [
168
+ { name: 'onboarding', entered: true }, // workflow was started
169
+ { name: 'onboarding', completed: true }, // workflow finished
170
+ ],
171
+ }
172
+ ```
173
+
174
+ ### Timing
175
+
176
+ How long the bot took to respond (milliseconds).
177
+
178
+ ```typescript
179
+ assert: {
180
+ timing: [
181
+ { response_time: { lte: 5000 } }, // must respond within 5s
182
+ { response_time: { gte: 100 } }, // sanity-check: not suspiciously fast
183
+ ],
184
+ }
185
+ ```
186
+
187
+ ---
188
+
189
+ ## Match Operators
190
+
191
+ Used in tool params, state values, and workflow params:
192
+
193
+ | Operator | Example | Description |
194
+ |----------|---------|-------------|
195
+ | `equals` | `{ equals: 'urgent' }` | Exact match |
196
+ | `contains` | `{ contains: 'HR' }` | Substring |
197
+ | `not_contains` | `{ not_contains: 'test' }` | Excludes substring |
198
+ | `matches` | `{ matches: '\\d+' }` | Regex |
199
+ | `in` | `{ in: ['high', 'urgent'] }` | One of |
200
+ | `exists` | `{ exists: true }` | Property exists |
201
+
202
+ **Numeric-only operators** (for `timing` and numeric state values):
203
+
204
+ | Operator | Example | Description |
205
+ |----------|---------|-------------|
206
+ | `gte` | `{ gte: 100 }` | Greater than or equal |
207
+ | `lte` | `{ lte: 5000 }` | Less than or equal |
208
+
209
+ ---
210
+
211
+ ## Eval Setup
212
+
213
+ Use `setup` to put the bot in a known state before the conversation starts.
214
+
215
+ ### Seed State
216
+
217
+ Pre-populate bot, user, or conversation state.
218
+
219
+ ```typescript
220
+ setup: {
221
+ state: {
222
+ bot: { welcomeMessageSent: true },
223
+ user: { plan: 'pro' },
224
+ conversation: { topic: 'billing' },
225
+ },
226
+ }
227
+ ```
228
+
229
+ The seeded state becomes the baseline for `changed` assertions — `{ changed: false }` passes if the value matches the seeded value at the end.
230
+
231
+ ### Trigger a Workflow
232
+
233
+ Start a workflow before the conversation begins.
234
+
235
+ ```typescript
236
+ setup: {
237
+ workflow: {
238
+ trigger: 'onboarding',
239
+ input: { userId: 'test-user-1' },
240
+ },
241
+ }
242
+ ```
243
+
244
+ Both can be combined:
245
+
246
+ ```typescript
247
+ setup: {
248
+ state: {
249
+ bot: { sleepDurationMs: 3000 }, // 3 seconds instead of default 10 minutes
250
+ },
251
+ workflow: {
252
+ trigger: 'reminderFlow',
253
+ input: { userId: 'test-user-1' },
254
+ },
255
+ }
256
+ ```
257
+
258
+ > **Testing `step.sleep()`:** Server-side scheduling can't be fast-forwarded. Workaround: make the sleep duration configurable by reading it from bot state in the workflow, then seed a short value in ms (e.g. `3000`) in `setup.state.bot`.
259
+
260
+ ---
261
+
262
+ ## Outcome Assertions
263
+
264
+ Run once after all conversation turns complete. Supports `state` and `workflow` (not `response` or `tools` — those are per-turn only).
265
+
266
+ ```typescript
267
+ outcome: {
268
+ state: [
269
+ { path: 'conversation.resolved', equals: true },
270
+ ],
271
+ workflow: [
272
+ { name: 'ticketFlow', completed: true },
273
+ ],
274
+ }
275
+ ```
276
+
277
+ ---
278
+
279
+ ## Options
280
+
281
+ Override defaults for a specific eval. Cascades: **eval options → agent config → default**.
282
+
283
+ ```typescript
284
+ options: {
285
+ idleTimeout: 60000, // ms to wait for bot response (default: 30000)
286
+ judgePassThreshold: 4, // llm_judge score required to pass, 1–5 (default: 3)
287
+ }
288
+ ```
289
+
290
+ Agent-level defaults in `agent.config.ts`:
291
+
292
+ ```typescript
293
+ export default defineConfig({
294
+ evals: {
295
+ idleTimeout: 20000,
296
+ judgePassThreshold: 3,
297
+ judgeModel: 'fast', // 'fast', 'best', or a model ref like 'openai:gpt-4o'
298
+ },
299
+ })
300
+ ```
301
+
302
+ ---
303
+
304
+ ## Common Mistakes
305
+
306
+ ❌ **Turn with neither `user` nor `event`**
307
+
308
+ ```typescript
309
+ // WRONG — every turn needs a trigger
310
+ { expectSilence: true }
311
+ ```
312
+
313
+ ✅ **Correct**
314
+
315
+ ```typescript
316
+ { user: 'hello', expectSilence: true }
317
+ ```
318
+
319
+ ---
320
+
321
+ ❌ **`expectSilence` with `assert.response`**
322
+
323
+ ```typescript
324
+ // WRONG — mutually exclusive
325
+ { user: 'hello', expectSilence: true, assert: { response: [{ contains: 'hi' }] } }
326
+ ```
327
+
328
+ ✅ **Correct — pick one**
329
+
330
+ ```typescript
331
+ { user: 'hello', expectSilence: true }
332
+ // or
333
+ { user: 'hello', assert: { response: [{ contains: 'hi' }] } }
334
+ ```
335
+
336
+ ---
337
+
338
+ ❌ **Both `user` and `event` on the same turn**
339
+
340
+ ```typescript
341
+ // WRONG — mutually exclusive
342
+ { user: 'hello', event: { type: 'payment.failed' } }
343
+ ```
344
+
345
+ ✅ **Correct — use separate turns**
346
+
347
+ ```typescript
348
+ { event: { type: 'payment.failed', payload: { amount: 50 } } }
349
+ ```
350
+
351
+ ## See Also
352
+
353
+ - [testing-workflow.md](./testing-workflow.md) — Running evals, interpreting output, the write → test → iterate loop
354
+ - [test-patterns.md](./test-patterns.md) — Per-primitive testing patterns