@botpress/adk 1.17.0 → 1.18.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/agent-init/agent-project-generator.d.ts +32 -8
  2. package/dist/agent-init/agent-project-generator.d.ts.map +1 -1
  3. package/dist/agent-init/index.d.ts +1 -0
  4. package/dist/agent-init/index.d.ts.map +1 -1
  5. package/dist/agent-project/agent-project.d.ts +5 -1
  6. package/dist/agent-project/agent-project.d.ts.map +1 -1
  7. package/dist/agent-project/agent-resolver.d.ts +4 -3
  8. package/dist/agent-project/agent-resolver.d.ts.map +1 -1
  9. package/dist/agent-project/config-writer.d.ts +33 -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/index.d.ts +1 -1
  13. package/dist/agent-project/index.d.ts.map +1 -1
  14. package/dist/agent-project/types.d.ts +22 -4
  15. package/dist/agent-project/types.d.ts.map +1 -1
  16. package/dist/auth/credentials.d.ts.map +1 -1
  17. package/dist/bot-generator/dev-id-manager.d.ts.map +1 -1
  18. package/dist/bot-generator/generator.d.ts.map +1 -1
  19. package/dist/eval/index.d.ts +1 -1
  20. package/dist/eval/index.d.ts.map +1 -1
  21. package/dist/eval/loader.d.ts +2 -1
  22. package/dist/eval/loader.d.ts.map +1 -1
  23. package/dist/eval/types.d.ts +15 -2
  24. package/dist/eval/types.d.ts.map +1 -1
  25. package/dist/generators/tests.d.ts.map +1 -1
  26. package/dist/index.d.ts +4 -3
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +704 -468
  29. package/dist/index.js.map +21 -21
  30. package/dist/integrations/checker.d.ts.map +1 -1
  31. package/dist/integrations/config-utils.d.ts +1 -0
  32. package/dist/integrations/config-utils.d.ts.map +1 -1
  33. package/dist/integrations/operations.d.ts +19 -6
  34. package/dist/integrations/operations.d.ts.map +1 -1
  35. package/dist/knowledge/manager.d.ts.map +1 -1
  36. package/dist/preflight/checker.d.ts.map +1 -1
  37. package/dist/templates/README.md +101 -0
  38. package/dist/templates/blank/README.md +36 -0
  39. package/dist/templates/blank/agent.config.ts +49 -0
  40. package/dist/templates/blank/package.json +17 -0
  41. package/dist/templates/blank/src/actions/index.ts +19 -0
  42. package/dist/templates/blank/src/conversations/index.ts +16 -0
  43. package/dist/templates/blank/src/knowledge/index.ts +17 -0
  44. package/dist/templates/blank/src/tables/index.ts +19 -0
  45. package/dist/templates/blank/src/triggers/index.ts +20 -0
  46. package/dist/templates/blank/src/workflows/index.ts +23 -0
  47. package/dist/templates/blank/tsconfig.json +22 -0
  48. package/dist/templates/crm-enrichment/README.md +85 -0
  49. package/dist/templates/crm-enrichment/agent.config.ts +33 -0
  50. package/dist/templates/crm-enrichment/package.json +17 -0
  51. package/dist/templates/crm-enrichment/src/actions/enrich-contact.ts +81 -0
  52. package/dist/templates/crm-enrichment/src/conversations/index.ts +14 -0
  53. package/dist/templates/crm-enrichment/src/knowledge/index.ts +17 -0
  54. package/dist/templates/crm-enrichment/src/tables/contacts.ts +43 -0
  55. package/dist/templates/crm-enrichment/src/triggers/daily-enrichment.ts +30 -0
  56. package/dist/templates/crm-enrichment/src/workflows/enrichment-pipeline.ts +171 -0
  57. package/dist/templates/crm-enrichment/tsconfig.json +22 -0
  58. package/dist/templates/hello-world/README.md +46 -0
  59. package/dist/templates/hello-world/agent.config.ts +48 -0
  60. package/dist/templates/hello-world/package.json +17 -0
  61. package/dist/templates/hello-world/src/actions/index.ts +19 -0
  62. package/dist/templates/hello-world/src/conversations/index.ts +10 -0
  63. package/dist/templates/hello-world/src/knowledge/index.ts +17 -0
  64. package/dist/templates/hello-world/src/tables/index.ts +19 -0
  65. package/dist/templates/hello-world/src/triggers/index.ts +20 -0
  66. package/dist/templates/hello-world/src/workflows/index.ts +23 -0
  67. package/dist/templates/hello-world/tsconfig.json +22 -0
  68. package/dist/templates/knowledge-assistant/README.md +66 -0
  69. package/dist/templates/knowledge-assistant/agent.config.ts +26 -0
  70. package/dist/templates/knowledge-assistant/package.json +17 -0
  71. package/dist/templates/knowledge-assistant/src/actions/index.ts +19 -0
  72. package/dist/templates/knowledge-assistant/src/actions/search-docs.ts +50 -0
  73. package/dist/templates/knowledge-assistant/src/conversations/index.ts +33 -0
  74. package/dist/templates/knowledge-assistant/src/knowledge/docs.ts +23 -0
  75. package/dist/templates/knowledge-assistant/src/knowledge/getting-started.md +49 -0
  76. package/dist/templates/knowledge-assistant/src/tables/index.ts +21 -0
  77. package/dist/templates/knowledge-assistant/src/triggers/index.ts +17 -0
  78. package/dist/templates/knowledge-assistant/src/workflows/index.ts +28 -0
  79. package/dist/templates/knowledge-assistant/tsconfig.json +22 -0
  80. package/dist/templates/slack-triage/README.md +74 -0
  81. package/dist/templates/slack-triage/agent.config.ts +35 -0
  82. package/dist/templates/slack-triage/evals/triage-basic.eval.ts +55 -0
  83. package/dist/templates/slack-triage/package.json +17 -0
  84. package/dist/templates/slack-triage/src/actions/classify-request.ts +65 -0
  85. package/dist/templates/slack-triage/src/conversations/slack-dm.ts +72 -0
  86. package/dist/templates/slack-triage/src/knowledge/team-directory.md +33 -0
  87. package/dist/templates/slack-triage/src/tables/routing-rules.ts +38 -0
  88. package/dist/templates/slack-triage/src/triggers/new-message.ts +44 -0
  89. package/dist/templates/slack-triage/src/workflows/triage-flow.ts +104 -0
  90. package/dist/templates/slack-triage/tsconfig.json +22 -0
  91. package/dist/templates/template.config.json +47 -0
  92. package/dist/utils/json-ordering.d.ts +1 -1
  93. package/dist/utils/json-ordering.d.ts.map +1 -1
  94. package/package.json +7 -15
@@ -1 +1 @@
1
- {"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../../src/integrations/checker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,WAAW,EAAY,MAAM,kBAAkB,CAAA;AAOrE,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,eAAe,GAAG,UAAU,CAAA;AAC/E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GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC;YAyE3D,gBAAgB;CAgI/B"}
@@ -14,6 +14,7 @@ export declare function mergeIntegrationConfig(current: Record<string, unknown>
14
14
  export declare function configsMatch(current: Record<string, unknown> | undefined, desired: Record<string, unknown>, schemaDefaults?: Record<string, unknown>): boolean;
15
15
  export interface FetchServerConfigsResult {
16
16
  configs: Record<string, Record<string, unknown>>;
17
+ enabledStates: Record<string, boolean>;
17
18
  fetched: boolean;
18
19
  skipped: boolean;
19
20
  error?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"config-utils.d.ts","sourceRoot":"","sources":["../../src/integrations/config-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAErE;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAC3C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKzB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,cAAc,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAC3C,OAAO,CAMT;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAChD,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,YAAY,EACrB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,wBAAwB,CAAC,CAiCnC"}
1
+ {"version":3,"file":"config-utils.d.ts","sourceRoot":"","sources":["../../src/integrations/config-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAErE;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAC3C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAKzB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC5C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,cAAc,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAC3C,OAAO,CAMT;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAChD,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,YAAY,EACrB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,wBAAwB,CAAC,CAuCnC"}
@@ -12,9 +12,21 @@ export interface AddIntegrationOptions {
12
12
  export interface AddIntegrationResult {
13
13
  success: boolean;
14
14
  message?: string;
15
- requiresConfiguration?: boolean;
16
15
  existingVersion?: string;
17
16
  newVersion?: string;
17
+ name?: string;
18
+ fullName?: string;
19
+ alias?: string;
20
+ version?: string;
21
+ ref?: string;
22
+ }
23
+ interface ResolvedAddIntegrationInput {
24
+ name: string;
25
+ fullName: string;
26
+ version: string;
27
+ alias: string;
28
+ ref: string;
29
+ isIntegrationId: boolean;
18
30
  }
19
31
  export interface UpgradeIntegrationOptions {
20
32
  name?: string;
@@ -37,6 +49,11 @@ export declare class IntegrationOperations {
37
49
  * Parse integration reference from string (e.g., "slack@latest", "slack@1.0.0")
38
50
  */
39
51
  private parseIntegrationRef;
52
+ private isIntegrationVersionId;
53
+ private isResourceNotFoundError;
54
+ private getCanonicalIntegrationFullName;
55
+ private resolveIntegrationVersionId;
56
+ resolveAddIntegrationInput(options: AddIntegrationOptions): Promise<ResolvedAddIntegrationInput>;
40
57
  /**
41
58
  * Get available versions for an integration
42
59
  */
@@ -45,11 +62,6 @@ export declare class IntegrationOperations {
45
62
  * Add an integration to agent.config.ts dependencies
46
63
  */
47
64
  addIntegration(options: AddIntegrationOptions): Promise<AddIntegrationResult>;
48
- private selectBestConfigurationType;
49
- /**
50
- * Generate placeholder config values from integration schema
51
- */
52
- private getPlaceholderConfig;
53
65
  /**
54
66
  * Remove an integration from agent.config.ts dependencies
55
67
  */
@@ -87,4 +99,5 @@ export declare class IntegrationOperations {
87
99
  title?: string;
88
100
  }>>;
89
101
  }
102
+ export {};
90
103
  //# sourceMappingURL=operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/integrations/operations.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf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CAAC,eAAe;IA8BvB,OAAO,CAAC,qBAAqB;IAavB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAQrE,aAAa,CACjB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QACP,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;QACnF,SAAS,CAAC,EAAE,aAAa,CAAA;KACrB,GACL,OAAO,CAAC;QAAE,MAAM,EAAE,oBAAoB,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;YAmBhD,KAAK;CA2CpB"}
@@ -0,0 +1,101 @@
1
+ # ADK Templates
2
+
3
+ Templates for `adk init --template <name>`. Each template is a complete, runnable ADK project.
4
+
5
+ ## How Templates Work
6
+
7
+ ### Build Time
8
+
9
+ ```mermaid
10
+ flowchart LR
11
+ subgraph "packages/adk"
12
+ T[templates/] -->|"cpSync (build.ts)"| D[dist/templates/]
13
+ end
14
+ subgraph "packages/cli"
15
+ D -->|"embed-assets.ts"| E[embedded-assets.ts<br/>base64 encoded]
16
+ E -->|"bun build --compile"| B[dist/cli binary]
17
+ end
18
+ ```
19
+
20
+ Templates are distributed two ways:
21
+
22
+ 1. **Filesystem** — `build.ts` copies `templates/` to `dist/templates/`. Available via `require.resolve('@botpress/adk')`.
23
+ 2. **Embedded** — `embed-assets.ts` base64-encodes all template files into the CLI binary. Extracted to a versioned `/tmp` dir at runtime.
24
+
25
+ ### Runtime
26
+
27
+ ```mermaid
28
+ flowchart TD
29
+ A["adk init --template X"] --> B{Embedded assets?}
30
+ B -->|"Yes (compiled binary)"| C["Extract to /tmp/adk-templates-{hash}/"]
31
+ B -->|"No (dev / npm)"| D["require.resolve → dist/templates/"]
32
+ C --> E[copyDirRecursive]
33
+ D --> E
34
+ E --> F["Replace {{projectName}}, {{runtimeVersion}}, {{packageManager}}"]
35
+ F --> G[Write CLAUDE.md + agent.json if missing]
36
+ G --> H["Run postInit commands (adk add X@latest)"]
37
+ ```
38
+
39
+ ### Placeholder Substitution
40
+
41
+ Template files use `{{placeholder}}` syntax. Three placeholders are supported:
42
+
43
+ | Placeholder | Replaced with | Example |
44
+ | -------------------- | --------------------------------------- | -------- |
45
+ | `{{projectName}}` | The project name from `adk init <name>` | `my-bot` |
46
+ | `{{runtimeVersion}}` | Current `@botpress/runtime` version | `1.17.0` |
47
+ | `{{packageManager}}` | Detected package manager | `bun` |
48
+
49
+ Text files (`.ts`, `.json`, `.md`, etc.) get substitution. Binary files are copied as-is.
50
+
51
+ ## Available Templates
52
+
53
+ | Template | Description | Integrations | postInit |
54
+ | --------------------- | ------------------------------------ | ------------- | ----------------------------------------------- |
55
+ | `blank` | Empty project with placeholder files | — | — |
56
+ | `hello-world` | Working chatbot | chat, webchat | `adk add chat@latest`, `adk add webchat@latest` |
57
+ | `slack-triage` | Classify + route help requests | slack | `adk add slack@latest` |
58
+ | `knowledge-assistant` | RAG Q&A with company docs | chat, webchat | `adk add chat@latest`, `adk add webchat@latest` |
59
+ | `crm-enrichment` | Scheduled contact enrichment | — | — |
60
+
61
+ ## Adding a New Template
62
+
63
+ 1. Create a directory: `templates/<name>/`
64
+ 2. Add at minimum: `agent.config.ts`, `package.json`, `tsconfig.json`, `.gitignore`, `README.md`
65
+ 3. Add source files under `src/` (actions, conversations, workflows, tables, triggers, knowledge)
66
+ 4. Register in `template.config.json`
67
+ 5. Use `{{projectName}}`, `{{runtimeVersion}}`, `{{packageManager}}` for substitution
68
+ 6. For unused primitives, use contextual commented-out examples relevant to the template's use case
69
+ 7. Integrations go in `postInit` (not hardcoded in agent.config.ts) so `adk add` resolves real versions
70
+
71
+ ### Template Structure
72
+
73
+ ```
74
+ templates/<name>/
75
+ ├── agent.config.ts # Use {{projectName}}, empty integrations: {}
76
+ ├── package.json # Use {{projectName}} and {{runtimeVersion}}
77
+ ├── tsconfig.json
78
+ ├── .gitignore
79
+ ├── README.md # Use {{projectName}} and {{packageManager}}
80
+ └── src/
81
+ ├── actions/ # Real files or index.ts placeholder
82
+ ├── conversations/ # Real files or index.ts placeholder
83
+ ├── knowledge/ # Real files or index.ts placeholder
84
+ ├── tables/ # Real files or index.ts placeholder
85
+ ├── triggers/ # Real files or index.ts placeholder
86
+ └── workflows/ # Real files or index.ts placeholder
87
+ ```
88
+
89
+ ### Registry (`template.config.json`)
90
+
91
+ ```json
92
+ {
93
+ "name": "my-template",
94
+ "description": "One-line description shown in --list-templates",
95
+ "category": "starter",
96
+ "integrations": ["slack"],
97
+ "primitives": ["actions", "workflows"],
98
+ "complexity": "intermediate",
99
+ "postInit": ["adk add slack@latest"]
100
+ }
101
+ ```
@@ -0,0 +1,36 @@
1
+ # {{projectName}}
2
+
3
+ A Botpress Agent built with the ADK.
4
+
5
+ ## Getting Started
6
+
7
+ 1. Install dependencies:
8
+
9
+ ```bash
10
+ {{packageManager}} install
11
+ ```
12
+
13
+ 2. Start development server:
14
+
15
+ ```bash
16
+ adk dev
17
+ ```
18
+
19
+ 3. Deploy your agent:
20
+ ```bash
21
+ adk deploy
22
+ ```
23
+
24
+ ## Project Structure
25
+
26
+ - `src/actions/` - Define callable functions
27
+ - `src/workflows/` - Define long-running processes
28
+ - `src/conversations/` - Define conversation handlers
29
+ - `src/tables/` - Define data storage schemas
30
+ - `src/triggers/` - Define event subscriptions
31
+ - `src/knowledge/` - Add knowledge base files
32
+
33
+ ## Learn More
34
+
35
+ - [ADK Documentation](https://botpress.com/docs/adk)
36
+ - [Botpress Platform](https://botpress.com)
@@ -0,0 +1,49 @@
1
+ import { z, defineConfig } from '@botpress/runtime'
2
+
3
+ export default defineConfig({
4
+ name: '{{projectName}}',
5
+ description: 'An AI agent built with Botpress ADK',
6
+
7
+ // defaultModels: {
8
+ // autonomous: "openai:gpt-4.1-mini-2025-04-14", // Model used by execute() in conversations/workflows
9
+ // zai: "openai:gpt-4.1-2025-04-14", // Model used by Zai (extract, check, summarize, etc.)
10
+ // // Supports arrays for fallback: autonomous: ["openai:gpt-4.1", "anthropic:claude-3-5-sonnet"]
11
+ // },
12
+
13
+ // Per-bot persistent state — add fields here to store data across conversations.
14
+ bot: {
15
+ state: z.object({}),
16
+ },
17
+
18
+ // Per-user persistent state — add fields here to remember things about each user.
19
+ user: {
20
+ state: z.object({}),
21
+ },
22
+
23
+ // Static bot-level config — import { configuration } from '@botpress/runtime' to read it anywhere.
24
+ // Great for feature flags, API endpoints, and other deploy-time settings.
25
+ // configuration: {
26
+ // schema: z.object({
27
+ // apiEndpoint: z.string().default("https://api.example.com"),
28
+ // featureFlags: z.object({
29
+ // enableBeta: z.boolean().default(false),
30
+ // }).default({}),
31
+ // }),
32
+ // },
33
+
34
+ // Custom events your agent can emit and subscribe to via triggers.
35
+ // events: {
36
+ // myEvent: {
37
+ // schema: z.object({ userId: z.string(), message: z.string() }),
38
+ // description: 'Emitted when something noteworthy happens',
39
+ // },
40
+ // },
41
+
42
+ // Integrations extend your agent with actions, channels, and events.
43
+ // Browse available integrations: adk search <name> | adk list --available
44
+ // Install one: adk add <integration> (e.g. adk add browser)
45
+ // See actions/events/channels: adk info <integration>
46
+ dependencies: {
47
+ integrations: {},
48
+ },
49
+ })
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "1.0.0",
4
+ "description": "A Botpress Agent 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
+ //
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
+ // })
@@ -0,0 +1,17 @@
1
+ // import { Knowledge, DataSource } from '@botpress/runtime'
2
+ //
3
+ // /**
4
+ // * A RAG-powered knowledge base for semantic search and AI-grounded responses.
5
+ // * Data sources: Directory (local .md/.pdf), Website (sitemap/URLs), or Table.
6
+ // * Pass to `execute({ knowledge: [MyKB] })` to make the AI use it when answering.
7
+ // */
8
+ // const mySource = DataSource.Directory.fromPath('src/knowledge', {
9
+ // id: 'my-docs',
10
+ // filter: (filePath) => filePath.endsWith('.md') || filePath.endsWith('.pdf'),
11
+ // })
12
+ //
13
+ // export const MyKB = new Knowledge({
14
+ // name: 'my-knowledge',
15
+ // description: 'My knowledge base',
16
+ // sources: [mySource],
17
+ // })
@@ -0,0 +1,19 @@
1
+ // import { Table, z } from '@botpress/runtime'
2
+ //
3
+ // /**
4
+ // * Structured data storage with CRUD and optional semantic search.
5
+ // * Table names must end with "Table" (e.g. UsersTable, OrdersTable).
6
+ // * Mark string columns as `{ searchable: true, schema: z.string() }` to enable search.
7
+ // * @reserved id, createdAt, updatedAt — auto-managed by the system, do not define them.
8
+ // */
9
+ // export const MyTable = new Table({
10
+ // name: 'myTable',
11
+ // description: 'Stores my data',
12
+ // columns: {
13
+ // title: {
14
+ // searchable: true,
15
+ // schema: z.string().describe('Title of the entry'),
16
+ // },
17
+ // status: z.string().describe('Current status of the entry'),
18
+ // },
19
+ // })
@@ -0,0 +1,20 @@
1
+ // import { Trigger } from '@botpress/runtime'
2
+ //
3
+ // /**
4
+ // * An event subscription that fires automatically when the specified events occur.
5
+ // * Bot events: 'register', 'message.created', 'conversation.started', 'conversation.ended',
6
+ // * 'user.created', 'workflow.started', 'workflow.completed', 'workflow.failed'
7
+ // * Webchat: 'webchat:conversationStarted', 'webchat:trigger'
8
+ // * Slack: 'slack:reactionAdded', 'slack:memberJoinedChannel'
9
+ // * Linear: 'linear:issueCreated', 'linear:issueUpdated'
10
+ // * GitHub: 'github:issueOpened', 'github:pullRequestMerged'
11
+ // * Run `adk info <integration>` to see all events for an integration.
12
+ // */
13
+ // export default new Trigger({
14
+ // name: 'onRegister',
15
+ // description: 'Runs on bot startup to initialize state',
16
+ // events: ['register'],
17
+ // handler: async () => {
18
+ // console.log('Bot started!')
19
+ // },
20
+ // })
@@ -0,0 +1,23 @@
1
+ // import { Workflow, z } from '@botpress/runtime'
2
+ //
3
+ // /**
4
+ // * A multi-step, resumable process that persists state across executions.
5
+ // * Each `step()` call is checkpointed — safe to retry on failure.
6
+ // * Use `step.sleep()`, `step.request()`, or `step.listen()` to pause execution.
7
+ // * Start from a trigger or conversation via `MyWorkflow.start({ input })`.
8
+ // */
9
+ // export const MyWorkflow = new Workflow({
10
+ // name: 'myWorkflow',
11
+ // input: z.object({
12
+ // data: z.string().describe('Input data to process'),
13
+ // }),
14
+ // output: z.object({
15
+ // result: z.string().describe('The processed result'),
16
+ // }),
17
+ // handler: async ({ input, step }) => {
18
+ // const result = await step('process', async () => {
19
+ // return `Processed: ${input.data}`
20
+ // })
21
+ // return { result }
22
+ // },
23
+ // })
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ES2022",
5
+ "moduleResolution": "Bundler",
6
+ "lib": ["ES2022", "DOM"],
7
+ "outDir": "./dist",
8
+ "rootDir": ".",
9
+ "strict": true,
10
+ "esModuleInterop": true,
11
+ "allowSyntheticDefaultImports": true,
12
+ "skipLibCheck": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "moduleDetection": "force",
15
+ "resolveJsonModule": true,
16
+ "paths": {
17
+ "@botpress/runtime/_types/*": ["./.adk/*-types"]
18
+ }
19
+ },
20
+ "include": ["src/**/*", ".adk/**/*"],
21
+ "exclude": ["node_modules", "dist"]
22
+ }
@@ -0,0 +1,85 @@
1
+ # {{projectName}}
2
+
3
+ A backend CRM enrichment agent built with the Botpress ADK. This agent runs scheduled workflows to classify, score, and enrich contacts in a table using AI -- no chat interface required.
4
+
5
+ ## How It Works
6
+
7
+ 1. **Contacts table** (`src/tables/contacts.ts`) stores raw and enriched contact data.
8
+ 2. **Enrich action** (`src/actions/enrich-contact.ts`) uses Zai to classify a single contact's use case, industry, and lead score.
9
+ 3. **Enrichment pipeline** (`src/workflows/enrichment-pipeline.ts`) fetches unenriched contacts, enriches each one, and writes results back.
10
+ 4. **Daily trigger** (`src/triggers/daily-enrichment.ts`) kicks off the pipeline on a schedule and on initial bot registration.
11
+
12
+ ## Getting Started
13
+
14
+ 1. Install dependencies:
15
+
16
+ ```bash
17
+ {{packageManager}} install
18
+ ```
19
+
20
+ 2. Start development server:
21
+
22
+ ```bash
23
+ adk dev
24
+ ```
25
+
26
+ 3. Add some contacts to the `ContactsTable` (via `adk run` script or the dev UI), then watch the enrichment pipeline process them.
27
+
28
+ 4. Deploy your agent:
29
+ ```bash
30
+ adk deploy
31
+ ```
32
+
33
+ ## Customizing the Enrichment Logic
34
+
35
+ The core AI classification lives in `src/actions/enrich-contact.ts`. You can customize:
36
+
37
+ - **Use case categories** -- edit the `useCase` enum in the Zai extract schema to match your business.
38
+ - **Industry list** -- expand or narrow the `industry` enum.
39
+ - **Scoring criteria** -- change the `score` enum and the `instructions` string to reflect your ideal customer profile.
40
+ - **Additional fields** -- add more columns to the table and more fields to the extract schema.
41
+
42
+ ## Scheduling
43
+
44
+ The workflow runs on a cron schedule defined in `src/workflows/enrichment-pipeline.ts`:
45
+
46
+ ```typescript
47
+ schedule: '0 9 * * *' // Every day at 9:00 AM UTC
48
+ ```
49
+
50
+ Common alternatives:
51
+
52
+ - `"0 */6 * * *"` -- every 6 hours
53
+ - `"0 9 * * 1-5"` -- weekday mornings only
54
+ - `"*/30 * * * *"` -- every 30 minutes
55
+
56
+ The trigger in `src/triggers/daily-enrichment.ts` also fires on `register` (bot startup) so the pipeline runs once immediately during development.
57
+
58
+ ## Adding Integrations
59
+
60
+ This template starts with no integrations. To extend it:
61
+
62
+ ```bash
63
+ # Send enrichment reports to Slack
64
+ adk add slack@latest
65
+
66
+ # Sync contacts from a CRM
67
+ adk add salesforce@latest
68
+
69
+ # Send email summaries
70
+ adk add sendgrid@latest
71
+ ```
72
+
73
+ ## Project Structure
74
+
75
+ - `src/tables/` -- ContactsTable schema
76
+ - `src/actions/` -- AI enrichment action
77
+ - `src/workflows/` -- Enrichment pipeline workflow
78
+ - `src/triggers/` -- Scheduled trigger
79
+ - `src/conversations/` -- Unused (backend agent)
80
+ - `src/knowledge/` -- Unused (no RAG needed)
81
+
82
+ ## Learn More
83
+
84
+ - [ADK Documentation](https://botpress.com/docs/adk)
85
+ - [Botpress Platform](https://botpress.com)
@@ -0,0 +1,33 @@
1
+ import { z, defineConfig } from '@botpress/runtime'
2
+
3
+ export default defineConfig({
4
+ name: '{{projectName}}',
5
+ description:
6
+ 'A backend agent that enriches CRM contacts with AI-driven classification, scoring, and industry detection',
7
+
8
+ defaultModels: {
9
+ autonomous: 'openai:gpt-4.1-mini-2025-04-14',
10
+ zai: 'openai:gpt-4.1-2025-04-14',
11
+ },
12
+
13
+ // Bot-level persistent state — tracks enrichment run metadata across executions.
14
+ bot: {
15
+ state: z.object({
16
+ lastEnrichmentRunAt: z.string().optional().describe('ISO timestamp of the last completed enrichment run'),
17
+ totalContactsEnriched: z.number().default(0).describe('Cumulative count of contacts enriched across all runs'),
18
+ }),
19
+ },
20
+
21
+ // Per-user state is unused in this backend-only agent.
22
+ user: {
23
+ state: z.object({}),
24
+ },
25
+
26
+ // No integration dependencies — this is a pure backend workflow agent.
27
+ // If you want to send enrichment reports to Slack or email, add integrations here:
28
+ // adk add slack@latest
29
+ // adk add sendgrid@latest
30
+ dependencies: {
31
+ integrations: {},
32
+ },
33
+ })
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "1.0.0",
4
+ "description": "A CRM enrichment agent built with the ADK — scheduled workflows that classify and score contacts using AI",
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
+ }