@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.
- package/dist/agent-init/agent-project-generator.d.ts +1 -1
- package/dist/agent-init/agent-project-generator.d.ts.map +1 -1
- package/dist/agent0/capabilities/commands/adk-build.md +39 -0
- package/dist/agent0/capabilities/commands/adk-debug.md +23 -0
- package/dist/agent0/capabilities/commands/adk-dev-console.md +17 -0
- package/dist/agent0/capabilities/commands/adk-document.md +68 -0
- package/dist/agent0/capabilities/commands/adk-eval.md +17 -0
- package/dist/agent0/capabilities/commands/adk-explain.md +22 -0
- package/dist/agent0/capabilities/commands/adk-init.md +30 -0
- package/dist/agent0/capabilities/commands/adk-ship.md +29 -0
- package/dist/agent0/capabilities/commands/adk-test.md +27 -0
- package/dist/agent0/capabilities/commands/adk-validate.md +31 -0
- package/dist/agent0/capabilities/skills/adk/SKILL.md +548 -0
- package/dist/agent0/capabilities/skills/adk/references/actions.md +823 -0
- package/dist/agent0/capabilities/skills/adk/references/advanced-patterns.md +669 -0
- package/dist/agent0/capabilities/skills/adk/references/agent-config.md +450 -0
- package/dist/agent0/capabilities/skills/adk/references/assets.md +237 -0
- package/dist/agent0/capabilities/skills/adk/references/autonomous-execution.md +747 -0
- package/dist/agent0/capabilities/skills/adk/references/cli.md +1334 -0
- package/dist/agent0/capabilities/skills/adk/references/context-api.md +461 -0
- package/dist/agent0/capabilities/skills/adk/references/conversation-lifecycle.md +311 -0
- package/dist/agent0/capabilities/skills/adk/references/conversations.md +1111 -0
- package/dist/agent0/capabilities/skills/adk/references/custom-components.md +167 -0
- package/dist/agent0/capabilities/skills/adk/references/desk.md +852 -0
- package/dist/agent0/capabilities/skills/adk/references/evals.md +11 -0
- package/dist/agent0/capabilities/skills/adk/references/explain-config.md +424 -0
- package/dist/agent0/capabilities/skills/adk/references/files.md +918 -0
- package/dist/agent0/capabilities/skills/adk/references/integration-actions.md +659 -0
- package/dist/agent0/capabilities/skills/adk/references/integrations.md +266 -0
- package/dist/agent0/capabilities/skills/adk/references/interfaces.md +97 -0
- package/dist/agent0/capabilities/skills/adk/references/knowledge-bases.md +456 -0
- package/dist/agent0/capabilities/skills/adk/references/mcp-server.md +112 -0
- package/dist/agent0/capabilities/skills/adk/references/messages.md +769 -0
- package/dist/agent0/capabilities/skills/adk/references/model-configuration.md +201 -0
- package/dist/agent0/capabilities/skills/adk/references/patterns-mistakes.md +469 -0
- package/dist/agent0/capabilities/skills/adk/references/plugins.md +280 -0
- package/dist/agent0/capabilities/skills/adk/references/tables.md +1136 -0
- package/dist/agent0/capabilities/skills/adk/references/tags.md +516 -0
- package/dist/agent0/capabilities/skills/adk/references/tools.md +581 -0
- package/dist/agent0/capabilities/skills/adk/references/triggers.md +719 -0
- package/dist/agent0/capabilities/skills/adk/references/workflow-steps.md +851 -0
- package/dist/agent0/capabilities/skills/adk/references/workflows.md +1408 -0
- package/dist/agent0/capabilities/skills/adk/references/zai-agent-reference.md +454 -0
- package/dist/agent0/capabilities/skills/adk/references/zai-complete-guide.md +1408 -0
- package/dist/agent0/capabilities/skills/adk-debugger/SKILL.md +257 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/common-failures.md +231 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/conversation-analysis.md +420 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/debug-workflow.md +239 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/llm-debugging.md +209 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/trace-summarization.md +313 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/traces-and-logs.md +203 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/SKILL.md +111 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/agent-steps.md +115 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/component-registry.md +43 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/multi-agent-dashboard.md +70 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/pages.md +273 -0
- package/dist/agent0/capabilities/skills/adk-docs/SKILL.md +114 -0
- package/dist/agent0/capabilities/skills/adk-docs/references/doc-standards.md +124 -0
- package/dist/agent0/capabilities/skills/adk-evals/SKILL.md +244 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/eval-format.md +354 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/test-patterns.md +355 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/testing-workflow.md +225 -0
- package/dist/agent0/config/index.d.ts +5 -0
- package/dist/agent0/config/index.d.ts.map +1 -0
- package/dist/agent0/config/paths.d.ts +12 -0
- package/dist/agent0/config/paths.d.ts.map +1 -0
- package/dist/agent0/config/schema.d.ts +171 -0
- package/dist/agent0/config/schema.d.ts.map +1 -0
- package/dist/agent0/config/secrets.d.ts +4 -0
- package/dist/agent0/config/secrets.d.ts.map +1 -0
- package/dist/agent0/config/store.d.ts +21 -0
- package/dist/agent0/config/store.d.ts.map +1 -0
- package/dist/agent0/index.d.ts +6 -0
- package/dist/agent0/index.d.ts.map +1 -0
- package/dist/agent0/index.js +3226 -0
- package/dist/agent0/index.js.map +27 -0
- package/dist/agent0/providers/catalog.d.ts +189 -0
- package/dist/agent0/providers/catalog.d.ts.map +1 -0
- package/dist/agent0/providers/index.d.ts +4 -0
- package/dist/agent0/providers/index.d.ts.map +1 -0
- package/dist/agent0/providers/registry.d.ts +32 -0
- package/dist/agent0/providers/registry.d.ts.map +1 -0
- package/dist/agent0/providers/source.d.ts +100 -0
- package/dist/agent0/providers/source.d.ts.map +1 -0
- package/dist/agent0/runtime/client.d.ts +50 -0
- package/dist/agent0/runtime/client.d.ts.map +1 -0
- package/dist/agent0/runtime/engine.d.ts +74 -0
- package/dist/agent0/runtime/engine.d.ts.map +1 -0
- package/dist/agent0/runtime/index.d.ts +7 -0
- package/dist/agent0/runtime/index.d.ts.map +1 -0
- package/dist/agent0/runtime/manager.d.ts +82 -0
- package/dist/agent0/runtime/manager.d.ts.map +1 -0
- package/dist/agent0/runtime/permissions.d.ts +9 -0
- package/dist/agent0/runtime/permissions.d.ts.map +1 -0
- package/dist/agent0/runtime/process.d.ts +43 -0
- package/dist/agent0/runtime/process.d.ts.map +1 -0
- package/dist/agent0/runtime/project-discovery.d.ts +5 -0
- package/dist/agent0/runtime/project-discovery.d.ts.map +1 -0
- package/dist/agent0/types.d.ts +447 -0
- package/dist/agent0/types.d.ts.map +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/cognitive/models.d.ts +32 -0
- package/dist/cognitive/models.d.ts.map +1 -0
- package/dist/commands/bp-dev-command.d.ts.map +1 -1
- package/dist/commands/bp-dev-stderr.d.ts +21 -0
- package/dist/commands/bp-dev-stderr.d.ts.map +1 -0
- package/dist/commands/index.d.ts +0 -5
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/dependencies/dependency-manager.d.ts +0 -1
- package/dist/dependencies/dependency-manager.d.ts.map +1 -1
- package/dist/dependencies/errors.d.ts +1 -1
- package/dist/dependencies/errors.d.ts.map +1 -1
- package/dist/dependencies/index.d.ts +0 -2
- package/dist/dependencies/index.d.ts.map +1 -1
- package/dist/dependencies/index.js +125 -149
- package/dist/dependencies/index.js.map +11 -13
- package/dist/dependencies/migration.d.ts +0 -2
- package/dist/dependencies/migration.d.ts.map +1 -1
- package/dist/dependencies/resolvers/integration-resolver.d.ts +0 -1
- package/dist/dependencies/resolvers/integration-resolver.d.ts.map +1 -1
- package/dist/dependencies/resolvers/plugin-resolver.d.ts +0 -1
- package/dist/dependencies/resolvers/plugin-resolver.d.ts.map +1 -1
- package/dist/dependencies/types.d.ts +1 -2
- package/dist/dependencies/types.d.ts.map +1 -1
- package/dist/generators/tests.d.ts.map +1 -1
- package/dist/index.js +501 -998
- package/dist/index.js.map +16 -20
- package/dist/runner/script-runner.d.ts.map +1 -1
- package/dist/runner/supervise-child.d.ts +24 -0
- package/dist/runner/supervise-child.d.ts.map +1 -0
- package/dist/templates/blank/package.json +0 -1
- package/dist/templates/template.config.json +10 -9
- package/package.json +12 -8
- package/dist/commands/copilot-config-reader.d.ts +0 -3
- package/dist/commands/copilot-config-reader.d.ts.map +0 -1
- package/dist/commands/copilot-config.d.ts +0 -42
- package/dist/commands/copilot-config.d.ts.map +0 -1
- package/dist/commands/copilot-server.d.ts +0 -29
- package/dist/commands/copilot-server.d.ts.map +0 -1
- package/dist/commands/opencode-config.d.ts +0 -30
- package/dist/commands/opencode-config.d.ts.map +0 -1
- package/dist/dependencies/env-substitution.d.ts +0 -3
- package/dist/dependencies/env-substitution.d.ts.map +0 -1
- package/dist/dependencies/secrets-rewriter.d.ts +0 -25
- package/dist/dependencies/secrets-rewriter.d.ts.map +0 -1
- package/dist/templates/blank/dependencies.dev.lock.json +0 -6
- package/dist/templates/botpress-desk/dependencies.dev.lock.json +0 -6
- package/dist/templates/crm-enrichment/dependencies.dev.lock.json +0 -6
- package/dist/templates/hello-world/dependencies.dev.lock.json +0 -6
- package/dist/templates/knowledge-assistant/dependencies.dev.lock.json +0 -6
- 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)
|