@botpress/adk-cli 1.19.0-beta.3 → 1.19.0-beta.5

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 (81) hide show
  1. package/assets/ui-dist/assets/{index-CSTz-oTK.js → index-B3b7PPgV.js} +4 -4
  2. package/{dist/index-DNqXHLNi-27nvpkee.js → assets/ui-dist/assets/index-BESZeTO5.js} +2 -2
  3. package/{dist/index-DAztRXeA-vr85xnxs.css → assets/ui-dist/assets/index-DIFGtVmI.css} +1 -1
  4. package/{dist/index-DfjXY3Oo-szsanhnt.js → assets/ui-dist/assets/index-a3ZL0_Jr.js} +2 -2
  5. package/assets/ui-dist/index.html +2 -2
  6. package/dist/{README-wjb7z7f0.md → README-824wa4jj.md} +1 -1
  7. package/dist/SKILL-75ym6tcj.md +257 -0
  8. package/dist/SKILL-chnwzmt1.md +548 -0
  9. package/dist/SKILL-d4bs53y3.md +244 -0
  10. package/dist/SKILL-h4b2f1n9.md +114 -0
  11. package/dist/SKILL-hbw5nt95.md +111 -0
  12. package/dist/actions-h7hxxvxr.md +823 -0
  13. package/dist/adk-build-emhwd0tg.md +39 -0
  14. package/dist/adk-debug-yrrdtpmb.md +23 -0
  15. package/dist/adk-dev-console-7z9rtjpy.md +17 -0
  16. package/dist/adk-document-ras6zzzh.md +68 -0
  17. package/dist/adk-eval-vx76dwq0.md +17 -0
  18. package/dist/adk-explain-fcsaw852.md +22 -0
  19. package/dist/adk-init-9kmxmbbe.md +30 -0
  20. package/dist/adk-ship-dybzn884.md +29 -0
  21. package/dist/adk-test-xq67savs.md +27 -0
  22. package/dist/adk-validate-1p4skv4m.md +31 -0
  23. package/dist/advanced-patterns-z86m9h1a.md +669 -0
  24. package/dist/agent-config-1aqvkrgf.md +450 -0
  25. package/dist/agent-steps-zj4c1n9t.md +115 -0
  26. package/dist/agent0-assets/skills/adk/SKILL.md +5 -5
  27. package/dist/agent0-assets/skills/adk/references/cli.md +265 -24
  28. package/dist/agent0-assets/skills/adk-debugger/SKILL.md +5 -5
  29. package/dist/agent0-assets/skills/adk-debugger/references/common-failures.md +1 -1
  30. package/dist/agent0-assets/skills/adk-debugger/references/debug-workflow.md +3 -3
  31. package/dist/agent0-assets/skills/adk-debugger/references/traces-and-logs.md +15 -7
  32. package/dist/assets-q7jt8r2q.md +237 -0
  33. package/dist/autonomous-execution-fymc12e5.md +747 -0
  34. package/dist/cli-c31e06yr.md +1334 -0
  35. package/dist/cli.js +963 -548
  36. package/dist/commands.json +24 -3
  37. package/dist/common-failures-ht29w2db.md +231 -0
  38. package/dist/component-registry-bbpw0see.md +43 -0
  39. package/dist/context-api-760cvh0h.md +461 -0
  40. package/dist/conversation-analysis-8ka4nrm4.md +420 -0
  41. package/dist/conversation-lifecycle-4seqqjc1.md +311 -0
  42. package/dist/conversations-gwfvxaee.md +1111 -0
  43. package/dist/custom-components-y5wdgpey.md +167 -0
  44. package/dist/debug-workflow-vz84q80v.md +239 -0
  45. package/dist/desk-k54ktvsd.md +852 -0
  46. package/dist/doc-standards-ck6ax2jd.md +124 -0
  47. package/dist/eval-format-7n9brja4.md +354 -0
  48. package/dist/evals-y1zcr1mc.md +11 -0
  49. package/dist/explain-config-1yaq3zzd.md +424 -0
  50. package/dist/files-dzt0wxn3.md +918 -0
  51. package/dist/{index-gqxgqnyz.html → index-3t354nbw.html} +2 -2
  52. package/dist/{index-CSTz-oTK-mdfh47r8.js → index-B3b7PPgV-zetkb01w.js} +4 -4
  53. package/{assets/ui-dist/assets/index-DNqXHLNi.js → dist/index-BESZeTO5-2rpmcefa.js} +2 -2
  54. package/{assets/ui-dist/assets/index-DAztRXeA.css → dist/index-DIFGtVmI-d4dhjg97.css} +1 -1
  55. package/{assets/ui-dist/assets/index-DfjXY3Oo.js → dist/index-a3ZL0_Jr-q145h35p.js} +2 -2
  56. package/dist/integration-actions-xang7tma.md +659 -0
  57. package/dist/integrations-k5ss07f4.md +266 -0
  58. package/dist/interfaces-6t0bpxs4.md +97 -0
  59. package/dist/knowledge-bases-20rg8p5c.md +456 -0
  60. package/dist/llm-debugging-76ng8rzm.md +209 -0
  61. package/dist/mcp-server-n1asyzhv.md +112 -0
  62. package/dist/messages-gkkg0b54.md +769 -0
  63. package/dist/model-configuration-f273kgd0.md +201 -0
  64. package/dist/multi-agent-dashboard-1mdfjdts.md +70 -0
  65. package/dist/pages-xn18xn73.md +273 -0
  66. package/dist/patterns-mistakes-5vb99dhf.md +469 -0
  67. package/dist/plugins-ttnx8f49.md +280 -0
  68. package/dist/tables-x45t36dd.md +1136 -0
  69. package/dist/tags-46td3qrg.md +516 -0
  70. package/dist/test-patterns-hj47w4nc.md +355 -0
  71. package/dist/testing-workflow-2vkp932f.md +225 -0
  72. package/dist/tools-wk7bq24z.md +581 -0
  73. package/dist/trace-summarization-hdyx1c2e.md +313 -0
  74. package/dist/traces-and-logs-f2kjfh19.md +203 -0
  75. package/dist/triggers-4j2cc86x.md +719 -0
  76. package/dist/ui-server-entry.js +977 -162
  77. package/dist/workflow-steps-mrdrf1c5.md +851 -0
  78. package/dist/workflows-gadx3s69.md +1408 -0
  79. package/dist/zai-agent-reference-e6644aad.md +454 -0
  80. package/dist/zai-complete-guide-mnna5d6f.md +1408 -0
  81. package/package.json +4 -4
@@ -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)
@@ -0,0 +1,239 @@
1
+ # Systematic Debug Workflow
2
+
3
+ A step-by-step process for diagnosing and fixing issues in ADK agents. Follow these steps in order — each step narrows the problem space.
4
+
5
+ Most diagnostic CLI commands use `--format json` for structured, parseable output. Make sure `adk dev` is running in the background, once the project is validated.
6
+
7
+ ---
8
+
9
+ ## The Debug Loop
10
+
11
+ ```
12
+ 1. VALIDATE → adk check --format json
13
+ 2. REPRODUCE → adk chat --single "msg" --format json
14
+ 3. LOGS → adk logs error --format json
15
+ 4. TRACES → adk traces --format json
16
+ 5. CLASSIFY → Runtime error? LLM behavior? Config issue?
17
+ 6. FIX → Apply targeted fix
18
+ 7. VERIFY → Re-test with adk chat, confirm clean output
19
+ 8. PREVENT → Write a regression eval
20
+ ```
21
+
22
+ ---
23
+
24
+ ## Step 1: Validate
25
+
26
+ Before debugging runtime behavior, rule out project-level issues.
27
+
28
+ ```bash
29
+ adk check --format json
30
+ ```
31
+
32
+ This catches:
33
+ - Invalid `agent.config.ts`
34
+ - Schema mismatches in actions, tools, workflows
35
+ - Invalid entity names
36
+ - Missing dependencies
37
+ - Import errors
38
+
39
+ If `adk check` reports errors, fix them first. Many "runtime" issues are actually build/config problems.
40
+
41
+ ---
42
+
43
+ ## Step 2: Reproduce
44
+
45
+ Create a minimal reproduction with a single message.
46
+
47
+ ```bash
48
+ adk chat --single "the message that triggers the bug" --format json
49
+ ```
50
+
51
+ **Why minimal?** A single message isolates the problem. Most often, multi-turn conversations add noise — the issue might be in turn 3 but caused by context from turn 1. That being said, some bugs are only reproducible by going through many turns.
52
+
53
+ **Save the conversation ID** from the JSON output — you'll need it for trace queries and follow up conversations.
54
+
55
+ If the issue requires multi-turn context:
56
+
57
+ ```bash
58
+ # First message
59
+ adk chat --single "Setup message" --format json
60
+ # Note the conversation_id from output
61
+
62
+ # Trigger the bug
63
+ adk chat --single "Bug-triggering message" --conversation-id <id> --format json
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Step 3: Check Logs
69
+
70
+ Quick scan for errors and warnings.
71
+
72
+ ```bash
73
+ # Errors only
74
+ adk logs error --format json
75
+
76
+ # Errors and warnings from the last hour
77
+ adk logs warning since=1h --format json
78
+
79
+ # Stream live while reproducing
80
+ adk logs --follow --format json
81
+ ```
82
+
83
+ Logs give you a high-level view. If the error is obvious here (startup failure, integration auth error, missing config), fix it directly.
84
+
85
+ If logs don't explain the issue, move to traces.
86
+
87
+ ---
88
+
89
+ ## Step 4: Inspect Traces
90
+
91
+ Traces show everything the agent did during a conversation turn.
92
+
93
+ ```bash
94
+ # All recent traces
95
+ adk traces --format json
96
+
97
+ # For a specific conversation
98
+ adk traces conversation=<id> --format json
99
+ ```
100
+
101
+ **Read spans in order.** Look for:
102
+
103
+ 1. **`think` spans** — Does the model's reasoning make sense? Does it understand the user's intent?
104
+ 2. **`tool_call` spans** — Was the right tool called? Did it succeed? Are the parameters correct?
105
+ 3. **`code_execution_exception` spans** — Any runtime errors? Read the stack trace.
106
+ 4. **`end` span** — Did the turn complete normally?
107
+
108
+ **Find the divergence point:** Compare what happened vs what should have happened. The first span that doesn't match expectations is usually where the bug is.
109
+
110
+ ---
111
+
112
+ ## Step 5: Classify the Failure
113
+
114
+ Based on what you found in logs and traces, classify the issue:
115
+
116
+ ### Runtime Error
117
+ The code threw an exception or returned an error.
118
+ - **Traces show:** `code_execution_exception` or `tool_call` with `success: false`
119
+ - **Next:** See `common-failures.md` for specific patterns and fixes
120
+
121
+ ### LLM Behavior
122
+ The model made a bad decision — wrong tool, hallucinated values, refusal, or looping.
123
+ - **Traces show:** `think` span with incorrect reasoning, or `tool_call` with wrong tool/params
124
+ - **Next:** See `llm-debugging.md` for diagnosis and fixes
125
+
126
+ ### Config Issue
127
+ Missing or incorrect configuration — integration auth, agent.json, environment.
128
+ - **Traces show:** May not have traces at all, or errors mentioning config/auth
129
+ - **Logs show:** Startup errors, auth failures, missing config warnings
130
+ - **Next:** See `common-failures.md` sections on config, integration failures, and agent.json vs agent.local.json
131
+
132
+ ---
133
+
134
+ ## Step 6: Fix
135
+
136
+ Apply a targeted fix based on the classification:
137
+
138
+ | Classification | Where to Fix | Reference |
139
+ |---------------|-------------|-----------|
140
+ | Runtime error in handler | Action/tool/workflow handler code | `common-failures.md` |
141
+ | Schema mismatch | Input/output schema definitions | `common-failures.md` § Build Errors |
142
+ | Wrong tool selected | Tool descriptions, instructions | `llm-debugging.md` § Wrong Tool |
143
+ | Hallucinated params | Input schemas, validation | `llm-debugging.md` § Hallucinated Parameters |
144
+ | Model refusal | Instructions, tool descriptions | `llm-debugging.md` § Refusal |
145
+ | Model looping | `onBeforeTool` guard, output clarity | `llm-debugging.md` § Looping |
146
+ | Integration failure | Dev Console config, `adk add` | `common-failures.md` § Integration Failures |
147
+ | Config issue | `agent.json`, `agent.local.json` | `common-failures.md` § Config Confusion |
148
+
149
+ ---
150
+
151
+ ## Step 7: Verify
152
+
153
+ Re-run the exact reproduction from Step 2:
154
+
155
+ ```bash
156
+ adk chat --single "the message that triggered the bug" --format json
157
+ ```
158
+
159
+ Then confirm:
160
+
161
+ ```bash
162
+ # No errors in logs
163
+ adk logs error --format json
164
+
165
+ # Traces show correct behavior
166
+ adk traces --format json
167
+ ```
168
+
169
+ Check that:
170
+ - The bot responds correctly
171
+ - The right tools are called with the right parameters
172
+ - No error spans in the traces
173
+ - No new warnings in logs
174
+
175
+ ---
176
+
177
+ ## Step 8: Prevent with Evals
178
+
179
+ After fixing, write a regression eval so the bug can't come back. Use the **adk-evals** skill for full guidance.
180
+
181
+ Quick template:
182
+
183
+ ```typescript
184
+ import { Eval } from '@botpress/adk'
185
+
186
+ export default new Eval({
187
+ name: 'fix-description-here',
188
+ type: 'regression',
189
+ tags: ['bugfix'],
190
+
191
+ conversation: [
192
+ {
193
+ user: 'the message that triggered the bug',
194
+ assert: {
195
+ response: [
196
+ { not_contains: 'error' },
197
+ { llm_judge: 'Response correctly handles the scenario' },
198
+ ],
199
+ tools: [{ called: 'expectedTool' }],
200
+ },
201
+ },
202
+ ],
203
+ })
204
+ ```
205
+
206
+ Run it:
207
+
208
+ ```bash
209
+ adk evals fix-description-here --format json
210
+ ```
211
+
212
+ Tag regression evals as `type: 'regression'` so they run in CI and catch future regressions.
213
+
214
+ ---
215
+
216
+ ## When to Escalate
217
+
218
+ If you've gone through the loop and still can't resolve the issue, gather this information for a bug report:
219
+
220
+ ```bash
221
+ # Project validation
222
+ adk check --format json > check-output.json
223
+
224
+ # Recent errors
225
+ adk logs error --format json > error-logs.json
226
+
227
+ # Traces from the failing conversation
228
+ adk traces conversation=<id> --format json > traces.json
229
+ ```
230
+
231
+ Include:
232
+ 1. **Reproduction steps** — exact messages/events that trigger the issue
233
+ 2. **`adk check` output** — project state
234
+ 3. **Error logs** — relevant error entries
235
+ 4. **Trace output** — full trace with spans for the failing conversation
236
+ 5. **Expected vs actual behavior** — what should happen vs what does happen
237
+ 6. **ADK version** — `adk --version`
238
+
239
+ Let the human know and suggest reaching out to support with the above information.