@botpress/adk 1.18.3 → 1.19.0-beta.11

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 +17614 -5514
  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
@@ -1,16 +1,16 @@
1
- // import { Conversation } from '@botpress/runtime'
2
- //
3
- // /**
4
- // * A channel-specific message handler. Use `channel: '*'` to match all channels,
5
- // * or target specific ones: 'webchat.channel', 'slack.dm', 'slack.channel',
6
- // * 'discord.dm', 'whatsapp.channel', 'teams.channel', etc.
7
- // * Use `execute()` to let the AI respond autonomously with tools and knowledge bases.
8
- // */
9
- // export default new Conversation({
10
- // channel: '*',
11
- // handler: async ({ execute }) => {
12
- // await execute({
13
- // instructions: 'You are a helpful assistant.',
14
- // })
15
- // },
16
- // })
1
+ import { Conversation } from '@botpress/runtime'
2
+
3
+ /**
4
+ * A channel-specific message handler. Use `channel: '*'` to match all channels,
5
+ * or target specific ones: 'webchat.channel', 'slack.dm', 'slack.channel',
6
+ * 'discord.dm', 'whatsapp.channel', 'teams.channel', etc.
7
+ * Use `execute()` to let the AI respond autonomously with tools and knowledge bases.
8
+ */
9
+ export default new Conversation({
10
+ channel: '*',
11
+ handler: async ({ execute }) => {
12
+ await execute({
13
+ instructions: 'You are a helpful assistant.',
14
+ })
15
+ },
16
+ })
@@ -20,6 +20,6 @@
20
20
  "@botpress/runtime/_types/*": ["./.adk/*-types"]
21
21
  }
22
22
  },
23
- "include": ["src/**/*", ".adk/**/*"],
23
+ "include": ["src/**/*", "*.ts", ".adk/*.d.ts"],
24
24
  "exclude": ["node_modules", "dist"]
25
25
  }
@@ -0,0 +1,87 @@
1
+ # {{projectName}}
2
+
3
+ A support bot built with the Botpress ADK. It handles common questions autonomously and escalates to a support agent via [Botpress Desk](https://botpress.com/docs/adk/advanced/desk-hitl) when needed.
4
+
5
+ ## How It Works
6
+
7
+ 1. **Conversation**: The bot greets users and answers their questions via webchat
8
+ 2. **Escalation**: When the user asks for a support agent (or the issue is too complex), the bot calls `handToSupport`, which creates a Botpress Desk ticket and transfers the conversation
9
+ 3. **Handoff**: A support agent takes over in Botpress Desk — the bot stays silent until the session ends
10
+
11
+ ## Getting Started
12
+
13
+ 1. Install dependencies:
14
+
15
+ ```bash
16
+ {{packageManager}} install
17
+ ```
18
+
19
+ 2. Start the development server:
20
+
21
+ ```bash
22
+ adk dev
23
+ ```
24
+
25
+ 3. Deploy your bot (required before connecting to Botpress Desk):
26
+
27
+ ```bash
28
+ adk deploy
29
+ ```
30
+
31
+ 4. Connect your bot in Botpress Desk:
32
+ - Open Botpress Desk → **AI Bots** → **Deflecting Bots**
33
+ - Add your deployed bot to enable escalations
34
+
35
+ > **Important:** `handToSupport` will fail if the bot is not connected in Botpress Desk settings.
36
+
37
+ ## Project Structure
38
+
39
+ - `src/conversations/index.ts` — Main conversation handler with the `handToSupport` tool
40
+ - `src/tools/handToSupport.ts` — Tool that triggers the handoff to Botpress Desk
41
+ - `src/knowledge/` — Add FAQ files here (`.md`, `.txt`, `.pdf`) to reduce escalations
42
+ - `src/actions/` — Add reusable actions here
43
+ - `src/workflows/` — Add long-running workflows here
44
+ - `src/triggers/` — Add event-driven triggers here
45
+
46
+ ## Customization
47
+
48
+ ### Changing the Escalation Conditions
49
+
50
+ Edit the `instructions` in `src/conversations/index.ts` to control when the bot escalates:
51
+
52
+ ```typescript
53
+ instructions: `You are a helpful support bot.
54
+ You can only help with billing and account questions.
55
+ For technical issues, always escalate to a support agent.`
56
+ ```
57
+
58
+ ### Adding a Knowledge Base
59
+
60
+ Uncomment the knowledge base in `src/knowledge/index.ts` and drop `.md` or `.txt` files into the folder with your product FAQs. The bot will search them automatically before escalating, reducing ticket volume.
61
+
62
+ ### Customizing Handoff Messages
63
+
64
+ Configure the messages users see during a handoff in `agent.config.ts`:
65
+
66
+ ```typescript
67
+ dependencies: {
68
+ plugins: {
69
+ 'desk-hitl': {
70
+ version: 'desk-hitl@latest',
71
+ config: {
72
+ agentAssignedMessage: 'A support agent has joined the conversation.',
73
+ sessionEndedMessage: 'The support session has ended. Let me know if you need anything else.',
74
+ },
75
+ },
76
+ },
77
+ },
78
+ ```
79
+
80
+ ### Reacting to Botpress Desk Activity
81
+
82
+ Uncomment the trigger in `src/triggers/index.ts` to run logic when a support agent adds a comment or note to a ticket.
83
+
84
+ ## Learn More
85
+
86
+ - [Botpress Desk HITL Documentation](https://botpress.com/docs/adk/advanced/desk-hitl)
87
+ - [ADK Documentation](https://botpress.com/docs/adk)
@@ -0,0 +1,19 @@
1
+ import { z, defineConfig } from '@botpress/runtime'
2
+
3
+ export default defineConfig({
4
+ name: '{{projectName}}',
5
+ description: 'Customer support bot with human handoff via Botpress Desk',
6
+
7
+ defaultModels: {
8
+ autonomous: 'openai:gpt-4.1-mini-2025-04-14',
9
+ zai: 'openai:gpt-4.1-2025-04-14',
10
+ },
11
+
12
+ bot: {
13
+ state: z.object({}),
14
+ },
15
+
16
+ user: {
17
+ state: z.object({}),
18
+ },
19
+ })
@@ -0,0 +1,30 @@
1
+ // import { Eval } from '@botpress/runtime'
2
+ //
3
+ // /**
4
+ // * An eval is a simulated conversation with assertions on the bot's responses,
5
+ // * tool usage, state, tables, and workflows. Files named `*.eval.ts` under
6
+ // * `evals/` are auto-discovered — rename this file or add more alongside it.
7
+ // *
8
+ // * Run with:
9
+ // * adk evals # run every eval
10
+ // * adk evals my-first-eval # run only this one
11
+ // * adk evals --tag basic # filter by tag
12
+ // */
13
+ // export default new Eval({
14
+ // name: 'my-first-eval',
15
+ // description: 'Bot responds coherently to a basic greeting',
16
+ // tags: ['basic', 'single-turn'],
17
+ // type: 'regression',
18
+ //
19
+ // conversation: [
20
+ // {
21
+ // user: 'Hello',
22
+ // assert: {
23
+ // response: [
24
+ // { not_contains: 'error' },
25
+ // { llm_judge: 'Response is a friendly reply to a greeting, not an error or empty output.' },
26
+ // ],
27
+ // },
28
+ // },
29
+ // ],
30
+ // })
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "1.0.0",
4
+ "description": "A Botpress bot built with the ADK",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "adk dev",
8
+ "build": "adk build",
9
+ "deploy": "adk deploy"
10
+ },
11
+ "dependencies": {
12
+ "@botpress/runtime": "^{{runtimeVersion}}"
13
+ },
14
+ "devDependencies": {
15
+ "typescript": "^5.9.3"
16
+ }
17
+ }
@@ -0,0 +1,19 @@
1
+ // import { Action, z } from '@botpress/runtime'
2
+ //
3
+ // /**
4
+ // * A strongly-typed callable function — use `new Action(...)` (it's a class constructor).
5
+ // * Handler always receives `{ input, client }` as props, not the input fields directly.
6
+ // * Can be converted to an AI tool via `.asTool()` and passed to `execute()`.
7
+ // */
8
+ // export default new Action({
9
+ // name: 'myAction',
10
+ // input: z.object({
11
+ // message: z.string().describe('The message to process'),
12
+ // }),
13
+ // output: z.object({
14
+ // result: z.string().describe('The processed result'),
15
+ // }),
16
+ // handler: async ({ input }) => {
17
+ // return { result: `Processed: ${input.message}` }
18
+ // },
19
+ // })
@@ -0,0 +1,16 @@
1
+ import { Conversation } from '@botpress/runtime'
2
+ import handToSupport from '../tools/handToSupport'
3
+
4
+ export default new Conversation({
5
+ channel: '*',
6
+ handler: async ({ execute }) => {
7
+ await execute({
8
+ instructions: `You are a helpful support bot.
9
+ Always start by greeting the user with "How can I help you today? If you'd like to speak with a support agent at any time, just let me know."
10
+ Help users with their questions as best you can.
11
+ If the user asks to speak with a support agent, or their issue is beyond your capabilities, use the handToSupport tool.
12
+ After calling handToSupport, do not send any further messages — a support agent will take over the conversation.`,
13
+ tools: [handToSupport],
14
+ })
15
+ },
16
+ })
@@ -0,0 +1,20 @@
1
+ // import { Knowledge, DataSource } from '@botpress/runtime'
2
+ //
3
+ // /**
4
+ // * Add FAQ documents (.md, .txt, .pdf) to this folder and the bot will search them
5
+ // * automatically before escalating to a support agent, reducing ticket volume.
6
+ // *
7
+ // * Sync your knowledge base:
8
+ // * adk kb sync (manual sync)
9
+ // * adk dev (auto-syncs on startup and file changes)
10
+ // */
11
+ // const faqSource = DataSource.Directory.fromPath('src/knowledge', {
12
+ // id: 'faq',
13
+ // filter: (filePath) => filePath.endsWith('.md') || filePath.endsWith('.pdf') || filePath.endsWith('.txt'),
14
+ // })
15
+ //
16
+ // export const FaqKB = new Knowledge({
17
+ // name: 'faqKB',
18
+ // description: 'FAQ documents for answering common support questions',
19
+ // sources: [faqSource],
20
+ // })
@@ -0,0 +1,16 @@
1
+ // import { Table, z } from '@botpress/runtime'
2
+ //
3
+ // /**
4
+ // * Table names must end with "Table" (e.g. TicketsTable, FeedbackTable).
5
+ // * Mark string columns as `{ searchable: true, schema: z.string() }` to enable semantic search.
6
+ // * @reserved id, createdAt, updatedAt — auto-managed by the system, do not define them.
7
+ // */
8
+ // export const TicketsTable = new Table({
9
+ // name: 'ticketsTable',
10
+ // description: 'Tracks escalated support tickets',
11
+ // columns: {
12
+ // ticketId: z.string().describe('The Botpress Desk ticket ID'),
13
+ // reason: z.string().describe('Why the conversation was escalated'),
14
+ // priority: z.string().describe('Ticket priority'),
15
+ // },
16
+ // })
@@ -0,0 +1,23 @@
1
+ import { Autonomous, context, plugins, z } from '@botpress/runtime'
2
+
3
+ export default new Autonomous.Tool({
4
+ name: 'handToSupport',
5
+ description:
6
+ "Transfer the conversation to a support agent via Botpress Desk. Use when the user's issue is beyond the bot's capabilities, or when they explicitly ask for a support agent.",
7
+ input: z.object({
8
+ reason: z.string().describe('Why the conversation needs a support agent — becomes the Botpress Desk ticket title'),
9
+ priority: z
10
+ .enum(['low', 'medium', 'high', 'urgent'])
11
+ .default('medium')
12
+ .describe('Ticket priority in Botpress Desk'),
13
+ }),
14
+ handler: async ({ reason, priority }) => {
15
+ const conversation = context.get('conversation')
16
+
17
+ await plugins['desk-hitl'].actions.startHitl({
18
+ conversationId: conversation.id,
19
+ title: reason,
20
+ priority,
21
+ })
22
+ },
23
+ })
@@ -0,0 +1,17 @@
1
+ // import { Trigger, actions } from '@botpress/runtime'
2
+ //
3
+ // /**
4
+ // * Example: React when a support agent adds a comment or note to a Botpress Desk ticket.
5
+ // *
6
+ // * Run `adk info desk` to see all available Botpress Desk events.
7
+ // */
8
+ // export default new Trigger({
9
+ // name: 'onDeskTicketActivity',
10
+ // description: 'Fires when new activity is added to a Botpress Desk ticket assigned to this bot',
11
+ // events: ['desk:ticketActivity'],
12
+ // handler: async ({ event }) => {
13
+ // const ticketId = event.payload.ticketId
14
+ // const { activities } = await actions.desk.listTicketActivities({ ticketId, limit: 10 })
15
+ // console.log('Latest activity:', activities.at(-1))
16
+ // },
17
+ // })
@@ -0,0 +1,21 @@
1
+ // import { Workflow, z } from '@botpress/runtime'
2
+ //
3
+ // /**
4
+ // * Each `step()` call is checkpointed — safe to retry on failure.
5
+ // * Start from a trigger or conversation via `MyWorkflow.start({ input })`.
6
+ // */
7
+ // export const MyWorkflow = new Workflow({
8
+ // name: 'myWorkflow',
9
+ // input: z.object({
10
+ // topic: z.string().describe('The topic to process'),
11
+ // }),
12
+ // output: z.object({
13
+ // result: z.string().describe('The result'),
14
+ // }),
15
+ // handler: async ({ input, step }) => {
16
+ // const result = await step('process', async () => {
17
+ // return `Processed: ${input.topic}`
18
+ // })
19
+ // return { result }
20
+ // },
21
+ // })
@@ -27,7 +27,4 @@ export default defineConfig({
27
27
  // If you want to send enrichment reports to Slack or email, add integrations here:
28
28
  // adk add slack@latest
29
29
  // adk add sendgrid@latest
30
- dependencies: {
31
- integrations: {},
32
- },
33
30
  })
@@ -0,0 +1,29 @@
1
+ /**
2
+ * This template is a backend-only agent — it has no conversation handler by
3
+ * default, so there's no chat turn to assert against. To get started writing
4
+ * evals here, uncomment the example below and tailor it to whatever you build:
5
+ *
6
+ * - For chat: add a Conversation in src/conversations/, then write turn-based
7
+ * evals like the example.
8
+ * - For workflows: use `setup.workflow.trigger` to kick off a workflow and
9
+ * assert on `outcome.workflow` / `outcome.state` / `outcome.tables`.
10
+ *
11
+ * Run with:
12
+ * adk evals
13
+ * adk evals my-first-eval
14
+ */
15
+
16
+ // import { Eval } from '@botpress/evals'
17
+ //
18
+ // export default new Eval({
19
+ // name: 'my-first-eval',
20
+ // description: 'Bot replies without erroring',
21
+ // type: 'regression',
22
+ //
23
+ // conversation: [
24
+ // {
25
+ // user: 'Hi',
26
+ // assert: { response: [{ not_contains: 'error' }] },
27
+ // },
28
+ // ],
29
+ // })
@@ -9,6 +9,7 @@
9
9
  "deploy": "adk deploy"
10
10
  },
11
11
  "dependencies": {
12
+ "@botpress/evals": "^{{runtimeVersion}}",
12
13
  "@botpress/runtime": "^{{runtimeVersion}}"
13
14
  },
14
15
  "devDependencies": {
@@ -20,6 +20,6 @@
20
20
  "@botpress/runtime/_types/*": ["./.adk/*-types"]
21
21
  }
22
22
  },
23
- "include": ["src/**/*", ".adk/**/*"],
23
+ "include": ["src/**/*", "*.ts", ".adk/*.d.ts"],
24
24
  "exclude": ["node_modules", "dist"]
25
25
  }
@@ -42,7 +42,4 @@ export default defineConfig({
42
42
  // Browse available integrations: adk search <name> | adk list --available
43
43
  // Install one: adk add <integration> (e.g. adk add browser)
44
44
  // See actions/events/channels: adk info <integration>
45
- dependencies: {
46
- integrations: {},
47
- },
48
45
  })
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Eval: context-retention
3
+ * Verifies the bot remembers details the user shares earlier in the conversation.
4
+ * Assertion types exercised: response.contains, response.matches, response.not_contains
5
+ *
6
+ * Run with:
7
+ * adk evals context-retention
8
+ */
9
+ import { Eval } from '@botpress/evals'
10
+
11
+ export default new Eval({
12
+ name: 'context-retention',
13
+ description: "Bot should remember the user's name and favorite color across turns",
14
+ tags: ['multi-turn', 'memory'],
15
+ type: 'regression',
16
+
17
+ conversation: [
18
+ {
19
+ user: "Hi, I'm Sam and my favorite color is teal.",
20
+ assert: {
21
+ response: [{ not_contains: 'error' }],
22
+ },
23
+ },
24
+ {
25
+ user: "What's my name?",
26
+ assert: {
27
+ response: [{ contains: 'Sam' }],
28
+ },
29
+ },
30
+ {
31
+ user: 'And what did I say was my favorite color?',
32
+ assert: {
33
+ response: [{ matches: '\\b[Tt]eal\\b' }],
34
+ },
35
+ },
36
+ ],
37
+ })
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Eval: greeting
3
+ * Verifies the bot responds to a basic greeting and can describe what it does when asked.
4
+ * Assertion types exercised: response.not_contains, response.llm_judge
5
+ *
6
+ * Run with:
7
+ * adk evals
8
+ * adk evals greeting
9
+ */
10
+ import { Eval } from '@botpress/evals'
11
+
12
+ export default new Eval({
13
+ name: 'greeting',
14
+ description: 'Bot should respond to a basic greeting and describe its capabilities when asked',
15
+ tags: ['basic', 'single-turn'],
16
+ type: 'regression',
17
+
18
+ conversation: [
19
+ {
20
+ user: 'Hi there!',
21
+ assert: {
22
+ response: [
23
+ { not_contains: 'error' },
24
+ {
25
+ llm_judge:
26
+ 'Response is a friendly reply acknowledging the greeting. It may offer to help or ask what the user needs.',
27
+ },
28
+ ],
29
+ },
30
+ },
31
+ {
32
+ user: 'What can you help me with?',
33
+ assert: {
34
+ response: [
35
+ {
36
+ llm_judge:
37
+ 'Response describes the bot as a helpful AI assistant, or invites the user to ask questions / describe a task. A brief general offer to help is acceptable.',
38
+ },
39
+ ],
40
+ },
41
+ },
42
+ ],
43
+ })
@@ -9,6 +9,7 @@
9
9
  "deploy": "adk deploy"
10
10
  },
11
11
  "dependencies": {
12
+ "@botpress/evals": "^{{runtimeVersion}}",
12
13
  "@botpress/runtime": "^{{runtimeVersion}}"
13
14
  },
14
15
  "devDependencies": {
@@ -20,6 +20,6 @@
20
20
  "@botpress/runtime/_types/*": ["./.adk/*-types"]
21
21
  }
22
22
  },
23
- "include": ["src/**/*", ".adk/**/*"],
23
+ "include": ["src/**/*", "*.ts", ".adk/*.d.ts"],
24
24
  "exclude": ["node_modules", "dist"]
25
25
  }
@@ -20,7 +20,4 @@ export default defineConfig({
20
20
  },
21
21
 
22
22
  // Integrations extend your agent with actions, channels, and events.
23
- dependencies: {
24
- integrations: {},
25
- },
26
23
  })
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Eval: engineering-practices
3
+ * Verifies the bot cites multi-section handbook content (code review + deployment).
4
+ * Demonstrates multi-turn knowledge retrieval across different doc sections.
5
+ * Assertion types exercised: response.contains, response.matches, response.llm_judge
6
+ *
7
+ * Run with:
8
+ * adk evals engineering-practices
9
+ */
10
+ import { Eval } from '@botpress/evals'
11
+
12
+ export default new Eval({
13
+ name: 'engineering-practices',
14
+ description: 'Bot should answer code review and deployment questions from the handbook',
15
+ tags: ['knowledge', 'multi-turn'],
16
+ type: 'regression',
17
+
18
+ conversation: [
19
+ {
20
+ user: 'How many approvals do I need on a PR that touches payments?',
21
+ assert: {
22
+ response: [
23
+ { matches: '\\btwo\\b|\\b2\\b' },
24
+ {
25
+ llm_judge:
26
+ 'Response says two approvals are required for PRs touching auth, payments, or data deletion. It clearly distinguishes this from the default one-approval rule.',
27
+ },
28
+ ],
29
+ },
30
+ },
31
+ {
32
+ user: 'When do we deploy to production?',
33
+ assert: {
34
+ response: [
35
+ { contains: '11 AM' },
36
+ { contains: '4 PM' },
37
+ {
38
+ llm_judge:
39
+ 'Response mentions production deploys happen twice daily at 11 AM and 4 PM UTC, and may reference that feature flags are required for user-facing changes.',
40
+ },
41
+ ],
42
+ },
43
+ },
44
+ ],
45
+ })
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Eval: out-of-scope
3
+ * Verifies the bot refuses to guess when the docs don't cover a question,
4
+ * and instead suggests who to ask (HR, manager, IT). This guards against hallucinations.
5
+ * Assertion types exercised: response.llm_judge, response.not_contains
6
+ *
7
+ * Run with:
8
+ * adk evals out-of-scope
9
+ */
10
+ import { Eval } from '@botpress/evals'
11
+
12
+ export default new Eval({
13
+ name: 'out-of-scope',
14
+ description: 'Bot should decline to answer questions outside the knowledge base and redirect appropriately',
15
+ tags: ['knowledge', 'edge-case', 'single-turn'],
16
+ type: 'regression',
17
+
18
+ conversation: [
19
+ {
20
+ user: "What's the company's policy on hiring interns from abroad?",
21
+ assert: {
22
+ response: [
23
+ { not_contains: 'approximately' },
24
+ { not_contains: 'generally speaking' },
25
+ {
26
+ llm_judge:
27
+ 'Response makes it clear that this topic is not covered in the docs (e.g. says something like "I don\'t have information about that") and points the user to a human contact such as HR. It does NOT invent a made-up policy.',
28
+ },
29
+ ],
30
+ },
31
+ },
32
+ ],
33
+ })
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Eval: pto-policy
3
+ * Verifies the bot answers time-off questions from the company handbook accurately.
4
+ * Exercises a single-turn knowledge-base lookup and forces grounding in the docs.
5
+ * Assertion types exercised: response.contains, response.matches, response.llm_judge
6
+ *
7
+ * Run with:
8
+ * adk evals pto-policy
9
+ */
10
+ import { Eval } from '@botpress/evals'
11
+
12
+ export default new Eval({
13
+ name: 'pto-policy',
14
+ description: 'Bot should answer PTO and parental-leave questions using facts from the handbook',
15
+ tags: ['knowledge', 'single-turn'],
16
+ type: 'regression',
17
+
18
+ conversation: [
19
+ {
20
+ user: 'How many days of PTO do I get per year?',
21
+ assert: {
22
+ response: [
23
+ { matches: '\\b20\\b' },
24
+ {
25
+ llm_judge:
26
+ 'Response states employees get 20 days of PTO per year and mentions that it accrues monthly. It answers directly from the handbook rather than guessing.',
27
+ },
28
+ ],
29
+ },
30
+ },
31
+ {
32
+ user: 'How much parental leave is offered?',
33
+ assert: {
34
+ response: [
35
+ { contains: '16 weeks' },
36
+ {
37
+ llm_judge:
38
+ 'Response says 16 weeks of paid parental leave, and mentions the policy applies to all parents regardless of gender.',
39
+ },
40
+ ],
41
+ },
42
+ },
43
+ ],
44
+ })
@@ -9,6 +9,7 @@
9
9
  "deploy": "adk deploy"
10
10
  },
11
11
  "dependencies": {
12
+ "@botpress/evals": "^{{runtimeVersion}}",
12
13
  "@botpress/runtime": "^{{runtimeVersion}}"
13
14
  },
14
15
  "devDependencies": {
@@ -20,6 +20,6 @@
20
20
  "@botpress/runtime/_types/*": ["./.adk/*-types"]
21
21
  }
22
22
  },
23
- "include": ["src/**/*", ".adk/**/*"],
23
+ "include": ["src/**/*", "*.ts", ".adk/*.d.ts"],
24
24
  "exclude": ["node_modules", "dist"]
25
25
  }