@botpress/adk 1.19.0-beta.2 → 1.19.0-beta.4

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 (152) hide show
  1. package/dist/agent-init/agent-project-generator.d.ts +1 -1
  2. package/dist/agent-init/agent-project-generator.d.ts.map +1 -1
  3. package/dist/agent0/capabilities/commands/adk-build.md +39 -0
  4. package/dist/agent0/capabilities/commands/adk-debug.md +23 -0
  5. package/dist/agent0/capabilities/commands/adk-dev-console.md +17 -0
  6. package/dist/agent0/capabilities/commands/adk-document.md +68 -0
  7. package/dist/agent0/capabilities/commands/adk-eval.md +17 -0
  8. package/dist/agent0/capabilities/commands/adk-explain.md +22 -0
  9. package/dist/agent0/capabilities/commands/adk-init.md +30 -0
  10. package/dist/agent0/capabilities/commands/adk-ship.md +29 -0
  11. package/dist/agent0/capabilities/commands/adk-test.md +27 -0
  12. package/dist/agent0/capabilities/commands/adk-validate.md +31 -0
  13. package/dist/agent0/capabilities/skills/adk/SKILL.md +548 -0
  14. package/dist/agent0/capabilities/skills/adk/references/actions.md +823 -0
  15. package/dist/agent0/capabilities/skills/adk/references/advanced-patterns.md +669 -0
  16. package/dist/agent0/capabilities/skills/adk/references/agent-config.md +450 -0
  17. package/dist/agent0/capabilities/skills/adk/references/assets.md +237 -0
  18. package/dist/agent0/capabilities/skills/adk/references/autonomous-execution.md +747 -0
  19. package/dist/agent0/capabilities/skills/adk/references/cli.md +1334 -0
  20. package/dist/agent0/capabilities/skills/adk/references/context-api.md +461 -0
  21. package/dist/agent0/capabilities/skills/adk/references/conversation-lifecycle.md +311 -0
  22. package/dist/agent0/capabilities/skills/adk/references/conversations.md +1111 -0
  23. package/dist/agent0/capabilities/skills/adk/references/custom-components.md +167 -0
  24. package/dist/agent0/capabilities/skills/adk/references/desk.md +852 -0
  25. package/dist/agent0/capabilities/skills/adk/references/evals.md +11 -0
  26. package/dist/agent0/capabilities/skills/adk/references/explain-config.md +424 -0
  27. package/dist/agent0/capabilities/skills/adk/references/files.md +918 -0
  28. package/dist/agent0/capabilities/skills/adk/references/integration-actions.md +659 -0
  29. package/dist/agent0/capabilities/skills/adk/references/integrations.md +266 -0
  30. package/dist/agent0/capabilities/skills/adk/references/interfaces.md +97 -0
  31. package/dist/agent0/capabilities/skills/adk/references/knowledge-bases.md +456 -0
  32. package/dist/agent0/capabilities/skills/adk/references/mcp-server.md +112 -0
  33. package/dist/agent0/capabilities/skills/adk/references/messages.md +769 -0
  34. package/dist/agent0/capabilities/skills/adk/references/model-configuration.md +201 -0
  35. package/dist/agent0/capabilities/skills/adk/references/patterns-mistakes.md +469 -0
  36. package/dist/agent0/capabilities/skills/adk/references/plugins.md +280 -0
  37. package/dist/agent0/capabilities/skills/adk/references/tables.md +1136 -0
  38. package/dist/agent0/capabilities/skills/adk/references/tags.md +516 -0
  39. package/dist/agent0/capabilities/skills/adk/references/tools.md +581 -0
  40. package/dist/agent0/capabilities/skills/adk/references/triggers.md +719 -0
  41. package/dist/agent0/capabilities/skills/adk/references/workflow-steps.md +851 -0
  42. package/dist/agent0/capabilities/skills/adk/references/workflows.md +1408 -0
  43. package/dist/agent0/capabilities/skills/adk/references/zai-agent-reference.md +454 -0
  44. package/dist/agent0/capabilities/skills/adk/references/zai-complete-guide.md +1408 -0
  45. package/dist/agent0/capabilities/skills/adk-debugger/SKILL.md +257 -0
  46. package/dist/agent0/capabilities/skills/adk-debugger/references/common-failures.md +231 -0
  47. package/dist/agent0/capabilities/skills/adk-debugger/references/conversation-analysis.md +420 -0
  48. package/dist/agent0/capabilities/skills/adk-debugger/references/debug-workflow.md +239 -0
  49. package/dist/agent0/capabilities/skills/adk-debugger/references/llm-debugging.md +209 -0
  50. package/dist/agent0/capabilities/skills/adk-debugger/references/trace-summarization.md +313 -0
  51. package/dist/agent0/capabilities/skills/adk-debugger/references/traces-and-logs.md +203 -0
  52. package/dist/agent0/capabilities/skills/adk-dev-console/SKILL.md +111 -0
  53. package/dist/agent0/capabilities/skills/adk-dev-console/references/agent-steps.md +115 -0
  54. package/dist/agent0/capabilities/skills/adk-dev-console/references/component-registry.md +43 -0
  55. package/dist/agent0/capabilities/skills/adk-dev-console/references/multi-agent-dashboard.md +70 -0
  56. package/dist/agent0/capabilities/skills/adk-dev-console/references/pages.md +273 -0
  57. package/dist/agent0/capabilities/skills/adk-docs/SKILL.md +114 -0
  58. package/dist/agent0/capabilities/skills/adk-docs/references/doc-standards.md +124 -0
  59. package/dist/agent0/capabilities/skills/adk-evals/SKILL.md +244 -0
  60. package/dist/agent0/capabilities/skills/adk-evals/references/eval-format.md +354 -0
  61. package/dist/agent0/capabilities/skills/adk-evals/references/test-patterns.md +355 -0
  62. package/dist/agent0/capabilities/skills/adk-evals/references/testing-workflow.md +225 -0
  63. package/dist/agent0/config/index.d.ts +5 -0
  64. package/dist/agent0/config/index.d.ts.map +1 -0
  65. package/dist/agent0/config/paths.d.ts +12 -0
  66. package/dist/agent0/config/paths.d.ts.map +1 -0
  67. package/dist/agent0/config/schema.d.ts +171 -0
  68. package/dist/agent0/config/schema.d.ts.map +1 -0
  69. package/dist/agent0/config/secrets.d.ts +4 -0
  70. package/dist/agent0/config/secrets.d.ts.map +1 -0
  71. package/dist/agent0/config/store.d.ts +21 -0
  72. package/dist/agent0/config/store.d.ts.map +1 -0
  73. package/dist/agent0/index.d.ts +6 -0
  74. package/dist/agent0/index.d.ts.map +1 -0
  75. package/dist/agent0/index.js +3226 -0
  76. package/dist/agent0/index.js.map +27 -0
  77. package/dist/agent0/providers/catalog.d.ts +189 -0
  78. package/dist/agent0/providers/catalog.d.ts.map +1 -0
  79. package/dist/agent0/providers/index.d.ts +4 -0
  80. package/dist/agent0/providers/index.d.ts.map +1 -0
  81. package/dist/agent0/providers/registry.d.ts +32 -0
  82. package/dist/agent0/providers/registry.d.ts.map +1 -0
  83. package/dist/agent0/providers/source.d.ts +100 -0
  84. package/dist/agent0/providers/source.d.ts.map +1 -0
  85. package/dist/agent0/runtime/client.d.ts +50 -0
  86. package/dist/agent0/runtime/client.d.ts.map +1 -0
  87. package/dist/agent0/runtime/engine.d.ts +74 -0
  88. package/dist/agent0/runtime/engine.d.ts.map +1 -0
  89. package/dist/agent0/runtime/index.d.ts +7 -0
  90. package/dist/agent0/runtime/index.d.ts.map +1 -0
  91. package/dist/agent0/runtime/manager.d.ts +82 -0
  92. package/dist/agent0/runtime/manager.d.ts.map +1 -0
  93. package/dist/agent0/runtime/permissions.d.ts +9 -0
  94. package/dist/agent0/runtime/permissions.d.ts.map +1 -0
  95. package/dist/agent0/runtime/process.d.ts +43 -0
  96. package/dist/agent0/runtime/process.d.ts.map +1 -0
  97. package/dist/agent0/runtime/project-discovery.d.ts +5 -0
  98. package/dist/agent0/runtime/project-discovery.d.ts.map +1 -0
  99. package/dist/agent0/types.d.ts +447 -0
  100. package/dist/agent0/types.d.ts.map +1 -0
  101. package/dist/auth/index.d.ts +1 -0
  102. package/dist/auth/index.d.ts.map +1 -1
  103. package/dist/cognitive/models.d.ts +32 -0
  104. package/dist/cognitive/models.d.ts.map +1 -0
  105. package/dist/commands/bp-dev-command.d.ts.map +1 -1
  106. package/dist/commands/bp-dev-stderr.d.ts +21 -0
  107. package/dist/commands/bp-dev-stderr.d.ts.map +1 -0
  108. package/dist/commands/index.d.ts +0 -5
  109. package/dist/commands/index.d.ts.map +1 -1
  110. package/dist/dependencies/dependency-manager.d.ts +0 -1
  111. package/dist/dependencies/dependency-manager.d.ts.map +1 -1
  112. package/dist/dependencies/errors.d.ts +1 -1
  113. package/dist/dependencies/errors.d.ts.map +1 -1
  114. package/dist/dependencies/index.d.ts +0 -2
  115. package/dist/dependencies/index.d.ts.map +1 -1
  116. package/dist/dependencies/index.js +125 -149
  117. package/dist/dependencies/index.js.map +11 -13
  118. package/dist/dependencies/migration.d.ts +0 -2
  119. package/dist/dependencies/migration.d.ts.map +1 -1
  120. package/dist/dependencies/resolvers/integration-resolver.d.ts +0 -1
  121. package/dist/dependencies/resolvers/integration-resolver.d.ts.map +1 -1
  122. package/dist/dependencies/resolvers/plugin-resolver.d.ts +0 -1
  123. package/dist/dependencies/resolvers/plugin-resolver.d.ts.map +1 -1
  124. package/dist/dependencies/types.d.ts +1 -2
  125. package/dist/dependencies/types.d.ts.map +1 -1
  126. package/dist/generators/tests.d.ts.map +1 -1
  127. package/dist/index.js +501 -998
  128. package/dist/index.js.map +16 -20
  129. package/dist/runner/script-runner.d.ts.map +1 -1
  130. package/dist/runner/supervise-child.d.ts +24 -0
  131. package/dist/runner/supervise-child.d.ts.map +1 -0
  132. package/dist/templates/blank/package.json +0 -1
  133. package/dist/templates/template.config.json +10 -9
  134. package/package.json +12 -8
  135. package/dist/commands/copilot-config-reader.d.ts +0 -3
  136. package/dist/commands/copilot-config-reader.d.ts.map +0 -1
  137. package/dist/commands/copilot-config.d.ts +0 -42
  138. package/dist/commands/copilot-config.d.ts.map +0 -1
  139. package/dist/commands/copilot-server.d.ts +0 -29
  140. package/dist/commands/copilot-server.d.ts.map +0 -1
  141. package/dist/commands/opencode-config.d.ts +0 -30
  142. package/dist/commands/opencode-config.d.ts.map +0 -1
  143. package/dist/dependencies/env-substitution.d.ts +0 -3
  144. package/dist/dependencies/env-substitution.d.ts.map +0 -1
  145. package/dist/dependencies/secrets-rewriter.d.ts +0 -25
  146. package/dist/dependencies/secrets-rewriter.d.ts.map +0 -1
  147. package/dist/templates/blank/dependencies.dev.lock.json +0 -6
  148. package/dist/templates/botpress-desk/dependencies.dev.lock.json +0 -6
  149. package/dist/templates/crm-enrichment/dependencies.dev.lock.json +0 -6
  150. package/dist/templates/hello-world/dependencies.dev.lock.json +0 -6
  151. package/dist/templates/knowledge-assistant/dependencies.dev.lock.json +0 -6
  152. package/dist/templates/slack-triage/dependencies.dev.lock.json +0 -6
@@ -0,0 +1,167 @@
1
+ # Custom Components
2
+
3
+ Custom components are React UI elements that render in webchat. The LLM can yield them during autonomous execution, or you can send them explicitly from conversation handlers.
4
+
5
+ The dev console has a **Component Registry** page (`/components`) where you can browse installed components with live previews, inspect their props, and discover new components from the registry. See the `component-registry` reference in the adk-dev-console skill for details on the UI.
6
+
7
+ ## Creating a Component
8
+
9
+ ### 1. Create a `.bp.tsx` file
10
+
11
+ Place React function components in `src/components/` with the `.bp.tsx` extension:
12
+
13
+ ```tsx
14
+ // src/components/TicketCard.bp.tsx
15
+ import React from 'react'
16
+
17
+ type Props = {
18
+ ticketId: string
19
+ title: string
20
+ priority: 'low' | 'medium' | 'high' | 'urgent'
21
+ status: string
22
+ }
23
+
24
+ const TicketCard: React.FC<Props> = ({ ticketId, title, priority, status }) => (
25
+ <div style={{ padding: 16, borderRadius: 8, background: '#f8fafc', fontFamily: 'sans-serif' }}>
26
+ <strong>{title}</strong>
27
+ <p style={{ margin: '4px 0', fontSize: 13, color: '#64748b' }}>
28
+ {ticketId} · {priority} · {status}
29
+ </p>
30
+ </div>
31
+ )
32
+
33
+ export default TicketCard
34
+ ```
35
+
36
+ A component without props also works:
37
+
38
+ ```tsx
39
+ // src/components/WelcomeBanner.bp.tsx
40
+ import React from 'react'
41
+
42
+ const WelcomeBanner: React.FC = () => (
43
+ <div style={{ padding: 12, borderRadius: 8, background: '#f0f4ff', color: '#1e3a5f', fontFamily: 'sans-serif' }}>
44
+ <strong>Acme IT Help Desk</strong>
45
+ <p style={{ margin: '4px 0 0', fontSize: 13 }}>How can we help you today?</p>
46
+ </div>
47
+ )
48
+
49
+ export default WelcomeBanner
50
+ ```
51
+
52
+ ### 2. Register in `src/components/index.ts`
53
+
54
+ Wrap each component with `CustomComponent` and provide metadata so the dev console can preview it and the LLM knows when and how to use it:
55
+
56
+ ```typescript
57
+ import { CustomComponent, z } from '@botpress/runtime'
58
+ import TicketCard from './TicketCard.bp.tsx'
59
+ import WelcomeBanner from './WelcomeBanner.bp.tsx'
60
+
61
+ export const TicketCardComponent = new CustomComponent(TicketCard, {
62
+ description: 'Display a ticket summary card. Use after creating or looking up a ticket.',
63
+ props: z.object({
64
+ ticketId: z.string().describe('The ticket ID'),
65
+ title: z.string().describe('Short summary of the issue'),
66
+ priority: z.enum(['low', 'medium', 'high', 'urgent']).describe('Priority level'),
67
+ status: z.string().describe('Current ticket status'),
68
+ }),
69
+ exampleValues: [
70
+ { ticketId: 'TKT-001', title: 'VPN not working', priority: 'high', status: 'open' },
71
+ { ticketId: 'TKT-042', title: "Can't access email", priority: 'low', status: 'in-progress' },
72
+ ],
73
+ })
74
+
75
+ // Components without metadata can be sent directly but can't be listed
76
+ // in Conversation.components (the LLM won't know about them).
77
+ export const WelcomeBannerComponent = new CustomComponent(WelcomeBanner)
78
+ ```
79
+
80
+ ### Metadata Fields
81
+
82
+ All three fields are required together — provide all or none:
83
+
84
+ - **description** — shown in the dev console and tells the LLM when to use this component
85
+ - **props** — Zod schema for the component's props; drives dev console forms and LLM prop validation
86
+ - **exampleValues** — seed values for dev console previews and LLM usage examples
87
+
88
+ ## Using Components in Conversations
89
+
90
+ ### LLM Autonomous Usage
91
+
92
+ List components in the `components` array so the LLM can yield them during `execute()`:
93
+
94
+ ```typescript
95
+ import { Conversation } from '@botpress/runtime'
96
+ import { TicketCardComponent } from '../components'
97
+
98
+ export const Chat = new Conversation({
99
+ channel: 'webchat.channel',
100
+ components: [TicketCardComponent],
101
+
102
+ async handler({ execute }) {
103
+ await execute({
104
+ instructions: 'Always use the TicketCard component to display ticket details.',
105
+ tools: [lookupTicket]
106
+ })
107
+ },
108
+ })
109
+ ```
110
+
111
+ Components in the `components` array must have metadata — the runtime throws an error otherwise.
112
+
113
+ ### Sending Directly
114
+
115
+ Outside of autonomous execution, send a component message explicitly:
116
+
117
+ ```typescript
118
+ import { WelcomeBannerComponent } from '../components'
119
+
120
+ await conversation.send({
121
+ type: 'customComponent',
122
+ payload: {
123
+ component: WelcomeBannerComponent,
124
+ props: {},
125
+ },
126
+ })
127
+ ```
128
+
129
+ This works for any component, with or without metadata.
130
+
131
+ ### Channel Fallback
132
+
133
+ Custom components only work in webchat. For multi-channel bots, fall back to agnostic message types:
134
+
135
+ ```typescript
136
+ if (conversation.channel === 'webchat.channel') {
137
+ await conversation.send({
138
+ type: 'customComponent',
139
+ payload: {
140
+ component: TicketCardComponent,
141
+ props: { ticketId: 'TKT-001', title: 'VPN issue', priority: 'high', status: 'open' },
142
+ },
143
+ })
144
+ } else {
145
+ await conversation.send({
146
+ type: 'card',
147
+ payload: {
148
+ title: 'TKT-001: VPN issue',
149
+ subtitle: 'Priority: high · Status: open',
150
+ actions: [],
151
+ },
152
+ })
153
+ }
154
+ ```
155
+
156
+ ## Component Lifecycle
157
+
158
+ 1. **Create** — Add a `.bp.tsx` file in `src/components/` and register it in `index.ts`
159
+ 2. **Preview** — The dev console Installed tab shows live previews with hot reload
160
+ 3. **Register** — List the component in a `Conversation`'s `components` array for LLM usage
161
+ 4. **Deploy** — `adk deploy` bundles and uploads components; URLs are resolved automatically
162
+ 5. **Render** — The webchat renders the component when the LLM yields it or you send it explicitly
163
+
164
+ ## File Naming Conventions
165
+
166
+ - `.bp.tsx` — React component source
167
+ - `.bp.css` — Optional component styles (scoped via shadow DOM in the dev console and webchat)