@botpress/adk-cli 1.19.0-beta.4 → 1.19.0-beta.6

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 (87) hide show
  1. package/{dist/index-a3ZL0_Jr-q145h35p.js → assets/ui-dist/assets/index-BC_iUF2d.js} +2 -2
  2. package/assets/ui-dist/assets/index-BxpvDT_K.css +1 -0
  3. package/{dist/index-BESZeTO5-2rpmcefa.js → assets/ui-dist/assets/index-C7gAokRv.js} +2 -2
  4. package/assets/ui-dist/assets/{index-B3b7PPgV.js → index-exyr_Djl.js} +424 -424
  5. package/assets/ui-dist/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  6. package/assets/ui-dist/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  7. package/assets/ui-dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  8. package/assets/ui-dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  9. package/assets/ui-dist/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  10. package/assets/ui-dist/index.html +2 -2
  11. package/dist/{README-wjb7z7f0.md → README-824wa4jj.md} +1 -1
  12. package/dist/SKILL-75ym6tcj.md +257 -0
  13. package/dist/SKILL-chnwzmt1.md +548 -0
  14. package/dist/SKILL-d4bs53y3.md +244 -0
  15. package/dist/SKILL-h4b2f1n9.md +114 -0
  16. package/dist/SKILL-hbw5nt95.md +111 -0
  17. package/dist/actions-h7hxxvxr.md +823 -0
  18. package/dist/adk-build-emhwd0tg.md +39 -0
  19. package/dist/adk-debug-yrrdtpmb.md +23 -0
  20. package/dist/adk-dev-console-7z9rtjpy.md +17 -0
  21. package/dist/adk-document-ras6zzzh.md +68 -0
  22. package/dist/adk-eval-vx76dwq0.md +17 -0
  23. package/dist/adk-explain-fcsaw852.md +22 -0
  24. package/dist/adk-init-9kmxmbbe.md +30 -0
  25. package/dist/adk-ship-dybzn884.md +29 -0
  26. package/dist/adk-test-xq67savs.md +27 -0
  27. package/dist/adk-validate-1p4skv4m.md +31 -0
  28. package/dist/advanced-patterns-z86m9h1a.md +669 -0
  29. package/dist/agent-config-1aqvkrgf.md +450 -0
  30. package/dist/agent-steps-zj4c1n9t.md +115 -0
  31. package/dist/assets-q7jt8r2q.md +237 -0
  32. package/dist/autonomous-execution-fymc12e5.md +747 -0
  33. package/dist/cli-c31e06yr.md +1334 -0
  34. package/dist/cli.js +4241 -6449
  35. package/dist/commands.json +25 -4
  36. package/dist/common-failures-ht29w2db.md +231 -0
  37. package/dist/component-registry-bbpw0see.md +43 -0
  38. package/dist/context-api-760cvh0h.md +461 -0
  39. package/dist/conversation-analysis-8ka4nrm4.md +420 -0
  40. package/dist/conversation-lifecycle-4seqqjc1.md +311 -0
  41. package/dist/conversations-gwfvxaee.md +1111 -0
  42. package/dist/custom-components-y5wdgpey.md +167 -0
  43. package/dist/debug-workflow-vz84q80v.md +239 -0
  44. package/dist/desk-k54ktvsd.md +852 -0
  45. package/dist/doc-standards-ck6ax2jd.md +124 -0
  46. package/dist/eval-format-7n9brja4.md +354 -0
  47. package/dist/evals-y1zcr1mc.md +11 -0
  48. package/dist/explain-config-1yaq3zzd.md +424 -0
  49. package/dist/files-dzt0wxn3.md +918 -0
  50. package/dist/{index-3t354nbw.html → index-0qts7wfk.html} +2 -2
  51. package/{assets/ui-dist/assets/index-a3ZL0_Jr.js → dist/index-BC_iUF2d-3h9mqazs.js} +2 -2
  52. package/dist/index-BxpvDT_K-62864175.css +1 -0
  53. package/{assets/ui-dist/assets/index-BESZeTO5.js → dist/index-C7gAokRv-zr7dzkba.js} +2 -2
  54. package/dist/{index-B3b7PPgV-zetkb01w.js → index-exyr_Djl-ksys08wc.js} +424 -424
  55. package/dist/integration-actions-xang7tma.md +659 -0
  56. package/dist/integrations-k5ss07f4.md +266 -0
  57. package/dist/interfaces-6t0bpxs4.md +97 -0
  58. package/dist/jetbrains-mono-cyrillic-wght-normal-D73BlboJ-6vpq1jfh.woff2 +0 -0
  59. package/dist/jetbrains-mono-greek-wght-normal-Bw9x6K1M-jv5dqe09.woff2 +0 -0
  60. package/dist/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a-h2ysfc3f.woff2 +0 -0
  61. package/dist/jetbrains-mono-latin-wght-normal-B9CIFXIH-hj2e42wt.woff2 +0 -0
  62. package/dist/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq-wttk1pwp.woff2 +0 -0
  63. package/dist/knowledge-bases-20rg8p5c.md +456 -0
  64. package/dist/llm-debugging-76ng8rzm.md +209 -0
  65. package/dist/mcp-server-n1asyzhv.md +112 -0
  66. package/dist/messages-gkkg0b54.md +769 -0
  67. package/dist/model-configuration-f273kgd0.md +201 -0
  68. package/dist/multi-agent-dashboard-1mdfjdts.md +70 -0
  69. package/dist/pages-xn18xn73.md +273 -0
  70. package/dist/patterns-mistakes-5vb99dhf.md +469 -0
  71. package/dist/plugins-ttnx8f49.md +280 -0
  72. package/dist/tables-x45t36dd.md +1136 -0
  73. package/dist/tags-46td3qrg.md +516 -0
  74. package/dist/test-patterns-hj47w4nc.md +355 -0
  75. package/dist/testing-workflow-2vkp932f.md +225 -0
  76. package/dist/tools-wk7bq24z.md +581 -0
  77. package/dist/trace-summarization-hdyx1c2e.md +313 -0
  78. package/dist/traces-and-logs-f2kjfh19.md +203 -0
  79. package/dist/triggers-4j2cc86x.md +719 -0
  80. package/dist/ui-server-entry.js +1839 -791
  81. package/dist/workflow-steps-mrdrf1c5.md +851 -0
  82. package/dist/workflows-gadx3s69.md +1408 -0
  83. package/dist/zai-agent-reference-e6644aad.md +454 -0
  84. package/dist/zai-complete-guide-mnna5d6f.md +1408 -0
  85. package/package.json +4 -4
  86. package/assets/ui-dist/assets/index-DIFGtVmI.css +0 -1
  87. package/dist/index-DIFGtVmI-d4dhjg97.css +0 -1
@@ -0,0 +1,659 @@
1
+ # Integration Actions
2
+
3
+ Call actions from installed integrations using a simple, type-safe API.
4
+
5
+ ## Quick Start
6
+
7
+ ```typescript
8
+ import { actions } from "@botpress/runtime";
9
+
10
+ // Call integration action
11
+ const { items } = await actions.linear.issueList({
12
+ first: 10,
13
+ filter: { state: { name: { eq: "In Progress" } } }
14
+ });
15
+ ```
16
+
17
+ ## Overview
18
+
19
+ Integration actions allow you to call functionality from installed integrations (Slack, Linear, GitHub, etc.) using a unified, type-safe API. Each integration exposes actions that map to its capabilities.
20
+
21
+ **Pattern:**
22
+ ```typescript
23
+ await actions.{integration}.{actionName}(params);
24
+ ```
25
+
26
+ **Available in:**
27
+ - Actions
28
+ - Tools
29
+ - Workflows
30
+ - Conversations
31
+ - Triggers
32
+
33
+ ## Installation
34
+
35
+ Before using integration actions, add the integration to your project:
36
+
37
+ ```bash
38
+ # Add integration
39
+ adk integrations add slack@2.5.5
40
+
41
+ # Or with custom alias
42
+ adk integrations add linear@2.0.0 --alias my-linear
43
+
44
+ # Start dev to configure
45
+ adk dev
46
+ ```
47
+
48
+ Then configure the integration in the Dev Console at `localhost:3001` or via `adk integrations configure`.
49
+
50
+ ## Basic Usage
51
+
52
+ ### Importing Actions
53
+
54
+ ```typescript
55
+ import { actions } from "@botpress/runtime";
56
+ ```
57
+
58
+ ### Calling Actions
59
+
60
+ ```typescript
61
+ // Slack - Send message
62
+ await actions.slack.sendMessage({
63
+ channel: "#general",
64
+ text: "Hello from bot!"
65
+ });
66
+
67
+ // Linear - List issues
68
+ const { items } = await actions.linear.issueList({
69
+ first: 10,
70
+ filter: { state: { name: { eq: "In Progress" } } }
71
+ });
72
+
73
+ // GitHub - Create issue
74
+ await actions.github.createIssue({
75
+ owner: "myorg",
76
+ repo: "myrepo",
77
+ title: "Bug report",
78
+ body: "Issue description"
79
+ });
80
+ ```
81
+
82
+ ### Alternative: Bracket Notation
83
+
84
+ Use bracket notation when integration names contain special characters or when accessing them dynamically:
85
+
86
+ ```typescript
87
+ // Useful for dynamic integration names
88
+ const integrationName = "intercom";
89
+ await actions[integrationName].getConversation({
90
+ intercomConversationId: "conv_123"
91
+ });
92
+
93
+ // Or when the integration name has special characters
94
+ await actions["my-integration"].someAction({
95
+ param: "value"
96
+ });
97
+ ```
98
+
99
+ ### Type Safety
100
+
101
+ All integration actions are fully typed with TypeScript:
102
+
103
+ ```typescript
104
+ type LinearIssue = Awaited<ReturnType<typeof actions.linear.getIssue>>;
105
+
106
+ // TypeScript knows the exact shape of the result
107
+ const issue = await actions.linear.getIssue({ id: "ISS-123" });
108
+ // issue.title, issue.description, issue.state, etc. are all typed
109
+ ```
110
+
111
+ ## Converting to AI Tools
112
+
113
+ Integration actions can be converted to AI-callable tools using `.asTool()`:
114
+
115
+ ```typescript
116
+ await execute({
117
+ instructions: "Help the user browse the web",
118
+ tools: [
119
+ // Convert integration action to tool
120
+ actions.browser.captureScreenshot.asTool(),
121
+
122
+ // Mix with custom tools
123
+ customSearchTool,
124
+ ]
125
+ });
126
+ ```
127
+
128
+ **How it works:**
129
+ - The action's input/output schemas become the tool's parameters
130
+ - The action's description (if any) helps the AI understand when to use it
131
+ - The AI can call the tool during autonomous execution
132
+
133
+ ## Common Integration Actions
134
+
135
+ ### Slack Integration
136
+
137
+ ```typescript
138
+ // Send message
139
+ await actions.slack.sendMessage({
140
+ channel: "#general",
141
+ text: "Hello!",
142
+ blocks: [
143
+ {
144
+ type: "section",
145
+ text: { type: "mrkdwn", text: "*Hello* from bot!" }
146
+ }
147
+ ]
148
+ });
149
+
150
+ // Add reaction
151
+ await actions.slack.addReaction({
152
+ channel: "C123456",
153
+ timestamp: "1234567890.123456",
154
+ name: "thumbsup"
155
+ });
156
+
157
+ // Upload file
158
+ await actions.slack.uploadFile({
159
+ channels: ["#general"],
160
+ file: fileBuffer,
161
+ filename: "report.pdf",
162
+ title: "Monthly Report"
163
+ });
164
+ ```
165
+
166
+ ### Linear Integration
167
+
168
+ ```typescript
169
+ // List issues with filters
170
+ const { items, meta } = await actions.linear.issueList({
171
+ first: 50,
172
+ filter: {
173
+ state: { name: { eq: "In Progress" } },
174
+ assignee: { email: { eq: "user@example.com" } }
175
+ },
176
+ orderBy: { createdAt: "desc" }
177
+ });
178
+
179
+ // Get specific issue
180
+ const issue = await actions.linear.getIssue({
181
+ id: "ISS-123"
182
+ });
183
+
184
+ // Create issue
185
+ await actions.linear.issueCreate({
186
+ teamId: "team_123",
187
+ title: "New feature request",
188
+ description: "Detailed description",
189
+ priority: 1,
190
+ assigneeId: "user_456"
191
+ });
192
+
193
+ // Update issue
194
+ await actions.linear.issueUpdate({
195
+ id: "ISS-123",
196
+ stateId: "state_done"
197
+ });
198
+ ```
199
+
200
+ ### Browser Integration
201
+
202
+ ```typescript
203
+ // Browse pages (web scraping)
204
+ const { results } = await actions.browser.browsePages({
205
+ urls: ["https://docs.example.com"],
206
+ extractType: "markdown",
207
+ maxPages: 10
208
+ });
209
+
210
+ // Web search
211
+ const output = await actions.browser.webSearch({
212
+ query: "Botpress ADK documentation",
213
+ maxResults: 5
214
+ });
215
+
216
+ // Capture screenshot
217
+ const screenshot = await actions.browser.captureScreenshot({
218
+ url: "https://example.com",
219
+ fullPage: true,
220
+ format: "png"
221
+ });
222
+ ```
223
+
224
+ ### GitHub Integration
225
+
226
+ ```typescript
227
+ // Create issue
228
+ await actions.github.createIssue({
229
+ owner: "myorg",
230
+ repo: "myrepo",
231
+ title: "Bug: Login not working",
232
+ body: "Steps to reproduce:\n1. ...",
233
+ labels: ["bug", "priority-high"]
234
+ });
235
+
236
+ // Get repository
237
+ const repo = await actions.github.getRepository({
238
+ owner: "myorg",
239
+ repo: "myrepo"
240
+ });
241
+
242
+ // Create pull request
243
+ await actions.github.createPullRequest({
244
+ owner: "myorg",
245
+ repo: "myrepo",
246
+ title: "Fix login issue",
247
+ head: "feature-branch",
248
+ base: "main",
249
+ body: "This PR fixes the login issue"
250
+ });
251
+ ```
252
+
253
+ ### Discord Integration
254
+
255
+ ```typescript
256
+ // Send message
257
+ await actions.discord.sendMessage({
258
+ channelId: "123456789",
259
+ content: "Hello from bot!",
260
+ embeds: [
261
+ {
262
+ title: "Notification",
263
+ description: "Your task is complete",
264
+ color: 0x00ff00
265
+ }
266
+ ]
267
+ });
268
+
269
+ // Add reaction
270
+ await actions.discord.addReaction({
271
+ channelId: "123456789",
272
+ messageId: "987654321",
273
+ emoji: "✅"
274
+ });
275
+ ```
276
+
277
+ ### WhatsApp Integration
278
+
279
+ ```typescript
280
+ // Send text message
281
+ await actions.whatsapp.sendMessage({
282
+ to: "+1234567890",
283
+ type: "text",
284
+ text: { body: "Hello from bot!" }
285
+ });
286
+
287
+ // Send template message
288
+ await actions.whatsapp.sendTemplate({
289
+ to: "+1234567890",
290
+ template: {
291
+ name: "order_confirmation",
292
+ language: { code: "en" },
293
+ components: [
294
+ {
295
+ type: "body",
296
+ parameters: [{ type: "text", text: "12345" }]
297
+ }
298
+ ]
299
+ }
300
+ });
301
+ ```
302
+
303
+ ### Intercom Integration
304
+
305
+ ```typescript
306
+ // Send admin message with attachments
307
+ await actions.intercom.sendAdminMessage({
308
+ adminId: "admin_123",
309
+ intercomConversationId: "conv_456",
310
+ messageType: "comment",
311
+ body: "Thank you for contacting us!",
312
+ attachment_urls: ["https://example.com/image.png"]
313
+ });
314
+
315
+ // Close/open conversation
316
+ await actions.intercom.closeConversation({
317
+ intercomConversationId: "conv_456",
318
+ adminId: "admin_123"
319
+ });
320
+
321
+ // Manage tags
322
+ await actions.intercom.updateConversationTags({
323
+ intercomConversationId: "conv_456",
324
+ adminId: "admin_123",
325
+ tagsToAdd: ["priority"],
326
+ tagsToRemove: ["pending"]
327
+ });
328
+ ```
329
+
330
+ ## Advanced: Building Custom Integration Actions
331
+
332
+ > **Note**: This section is for integration developers building custom integrations. If you're building a bot and using existing integrations (Slack, Linear, etc.), you can skip this section.
333
+
334
+ When building a custom integration, you define actions that bot developers can call via `actions.{yourIntegration}.{actionName}()`.
335
+
336
+ ### Integration Action Structure
337
+
338
+ Here's how integration actions are implemented (example from Intercom integration):
339
+
340
+ ```typescript
341
+ // In integrations/intercom/src/actions/send-admin-message.ts
342
+ import { RuntimeError } from "@botpress/client";
343
+ import * as bp from "../../.botpress";
344
+
345
+ export const sendAdminMessage: bp.IntegrationProps["actions"]["sendAdminMessage"] =
346
+ async ({ input }) => {
347
+ const url = new URL(
348
+ `https://api.intercom.io/conversations/${input.intercomConversationId}/reply`
349
+ );
350
+
351
+ const requestBody: Record<string, unknown> = {
352
+ message_type: input.messageType ?? "comment",
353
+ type: "admin",
354
+ body: input.body,
355
+ admin_id: input.adminId,
356
+ };
357
+
358
+ // Add optional parameters
359
+ if (input.attachment_urls && input.attachment_urls.length > 0) {
360
+ requestBody.attachment_urls = input.attachment_urls;
361
+ }
362
+
363
+ // Call external API
364
+ const response = await fetch(url.toString(), {
365
+ method: "POST",
366
+ headers: {
367
+ Authorization: `Bearer ${bp.secrets.TOKEN}`,
368
+ "Intercom-Version": "2.14",
369
+ "Content-Type": "application/json",
370
+ },
371
+ body: JSON.stringify(requestBody),
372
+ });
373
+
374
+ // Error handling
375
+ if (!response.ok) {
376
+ const errorText = await response.text();
377
+ throw new RuntimeError(
378
+ `Failed to send admin message: ${response.status} - ${errorText}`
379
+ );
380
+ }
381
+
382
+ return await response.json();
383
+ };
384
+ ```
385
+
386
+ ### Integration Action Definition
387
+
388
+ Actions are defined in the integration's definition file:
389
+
390
+ ```typescript
391
+ // In integrations/intercom/integration.definition.ts
392
+ import { Integration, z } from "@botpress/sdk";
393
+
394
+ export default new Integration({
395
+ actions: {
396
+ sendAdminMessage: {
397
+ title: "Send Admin Message",
398
+ description: "Send a message as an admin with optional attachments",
399
+ input: {
400
+ schema: z.object({
401
+ adminId: z.string(),
402
+ intercomConversationId: z.string(),
403
+ body: z.string(),
404
+ messageType: z.enum(["comment", "note"]).optional(),
405
+ attachment_urls: z.array(z.string().url()).max(10).optional(),
406
+ }),
407
+ },
408
+ output: {
409
+ schema: z.object({
410
+ id: z.string(),
411
+ body: z.string(),
412
+ createdAt: z.string(),
413
+ }),
414
+ },
415
+ },
416
+ // ... more actions
417
+ },
418
+ });
419
+ ```
420
+
421
+ ### Key Integration Action Patterns
422
+
423
+ 1. **Use RuntimeError for failures** - Provides better error context to bot developers
424
+ 2. **Validate external API responses** - Always check `response.ok` and handle errors
425
+ 3. **Transform external data** - Map external API schemas to your action output schema
426
+ 4. **Use bp.secrets for credentials** - Never hardcode tokens or API keys
427
+ 5. **Handle optional parameters** - Check before adding to request body
428
+ 6. **Type external API responses** - Use TypeScript types from SDK if available
429
+
430
+ ## Using Integration Actions
431
+
432
+ ### Composing Actions
433
+
434
+ ```typescript
435
+ // In a workflow step
436
+ await step("sync-to-slack", async () => {
437
+ // Get data from Linear
438
+ const { items } = await actions.linear.issueList({
439
+ first: 10,
440
+ filter: { state: { name: { eq: "Done" } } }
441
+ });
442
+
443
+ // Send to Slack
444
+ for (const issue of items) {
445
+ await actions.slack.sendMessage({
446
+ channel: "#updates",
447
+ text: `✅ Completed: ${issue.title}`
448
+ });
449
+ }
450
+ });
451
+ ```
452
+
453
+ ### Using in Workflows
454
+
455
+ ```typescript
456
+ export const SyncLinearWorkflow = new Workflow({
457
+ name: "syncLinear",
458
+ async handler({ step }) {
459
+ // Step 1: Fetch from Linear
460
+ const issues = await step("fetch-issues", async () => {
461
+ const { items } = await actions.linear.issueList({
462
+ first: 50,
463
+ orderBy: { updatedAt: "desc" }
464
+ });
465
+ return items;
466
+ });
467
+
468
+ // Step 2: Process and update
469
+ await step("update-database", async () => {
470
+ for (const issue of issues) {
471
+ await updateDatabase(issue);
472
+ }
473
+ });
474
+ }
475
+ });
476
+ ```
477
+
478
+ ### Using in Tools
479
+
480
+ ```typescript
481
+ import { Autonomous, z } from "@botpress/runtime";
482
+
483
+ export const searchWebTool = new Autonomous.Tool({
484
+ name: "searchWeb",
485
+ description: "Search the web for information",
486
+ input: z.object({
487
+ query: z.string().describe("Search query")
488
+ }),
489
+ output: z.string(),
490
+ handler: async ({ query }) => {
491
+ const results = await actions.browser.webSearch({
492
+ query,
493
+ maxResults: 5
494
+ });
495
+
496
+ return results
497
+ .map((r, i) => `${i + 1}. ${r.title}\n${r.snippet}`)
498
+ .join("\n\n");
499
+ }
500
+ });
501
+ ```
502
+
503
+ ## Type Inference
504
+
505
+ TypeScript automatically infers types from integration actions:
506
+
507
+ ```typescript
508
+ // Infer return type
509
+ type SearchResult = Awaited<ReturnType<typeof actions.browser.webSearch>>;
510
+ // SearchResult is { title: string; url: string; snippet: string }[]
511
+
512
+ // Infer parameter type
513
+ type IssueListParams = Parameters<typeof actions.linear.issueList>[0];
514
+ // IssueListParams is { first?: number; filter?: {...}; ... }
515
+
516
+ // Use in function signatures
517
+ async function processIssues(
518
+ params: Parameters<typeof actions.linear.issueList>[0]
519
+ ) {
520
+ const { items } = await actions.linear.issueList(params);
521
+ // ...
522
+ }
523
+ ```
524
+
525
+ ## Bot Actions vs Integration Actions
526
+
527
+ The `actions` proxy handles both:
528
+
529
+ **Bot Actions** (from `src/actions/*.ts`):
530
+ ```typescript
531
+ // Direct access to your bot's actions
532
+ await actions.myCustomAction({ param: "value" });
533
+ ```
534
+
535
+ **Integration Actions** (from installed integrations):
536
+ ```typescript
537
+ // Nested under integration name
538
+ await actions.slack.sendMessage({ channel: "#general", text: "Hi" });
539
+ ```
540
+
541
+ The actions proxy automatically determines whether you're calling a bot action (top-level) or an integration action (nested under integration name).
542
+
543
+ ## Troubleshooting
544
+
545
+ ### Integration Not Found
546
+
547
+ ```typescript
548
+ // Error: Could not find integration "slack" and action "sendMessage"
549
+ ```
550
+
551
+ **Solutions:**
552
+ 1. Add integration: `adk integrations add slack@2.5.5`
553
+ 2. Enable: `adk integrations enable slack`
554
+ 3. Configure credentials in Dev Console (localhost:3001) or via `adk integrations configure`
555
+ 4. Restart dev server: `adk dev`
556
+
557
+ ### Action Not Found
558
+
559
+ ```typescript
560
+ // Error: Action "nonexistentAction" not found in integration "slack"
561
+ ```
562
+
563
+ **Solutions:**
564
+ 1. Check integration documentation for available actions
565
+ 2. Verify integration version supports the action
566
+ 3. Check for typos in action name
567
+
568
+ ### Type Errors
569
+
570
+ ```typescript
571
+ // Error: Property 'wrongParam' does not exist on type ...
572
+ ```
573
+
574
+ **Solutions:**
575
+ 1. Check IntelliSense for correct parameter names
576
+ 2. Verify integration version matches your usage
577
+ 3. Run `adk dev` to regenerate types
578
+
579
+ ### Authentication Errors
580
+
581
+ ```typescript
582
+ // Error: Integration not authenticated
583
+ ```
584
+
585
+ **Solutions:**
586
+ 1. Configure credentials in Dev Console (localhost:3001 during dev)
587
+ 2. Set credentials via `adk integrations configure <alias> --set key=value`
588
+ 3. Check environment variables are set
589
+ 4. Verify API keys/tokens are valid
590
+
591
+ ## Best Practices
592
+
593
+ ### 1. Handle Errors Gracefully
594
+
595
+ ```typescript
596
+ try {
597
+ await actions.slack.sendMessage({ channel: "#general", text: "Hi" });
598
+ } catch (error) {
599
+ console.error("Failed to send Slack message:", error);
600
+ // Fallback or retry logic
601
+ }
602
+ ```
603
+
604
+ ### 2. Use Type Inference
605
+
606
+ ```typescript
607
+ // ✅ Good - Let TypeScript infer types
608
+ const issue = await actions.linear.getIssue({ id: "ISS-123" });
609
+
610
+ // ❌ Bad - Manual typing (can get out of sync)
611
+ const issue: { id: string; title: string } = await actions.linear.getIssue(...);
612
+ ```
613
+
614
+ ### 3. Check Integration Availability
615
+
616
+ ```typescript
617
+ // For optional integrations
618
+ const slack = adk.project.integrations.get("slack");
619
+ if (slack) {
620
+ await actions.slack.sendMessage(...);
621
+ } else {
622
+ console.log("Slack not configured, skipping notification");
623
+ }
624
+ ```
625
+
626
+ ### 4. Batch When Possible
627
+
628
+ ```typescript
629
+ // ✅ Good - Parallel requests
630
+ await Promise.all([
631
+ actions.slack.sendMessage({ channel: "#team1", text: "Update" }),
632
+ actions.slack.sendMessage({ channel: "#team2", text: "Update" })
633
+ ]);
634
+
635
+ // ❌ Bad - Sequential (slower)
636
+ await actions.slack.sendMessage({ channel: "#team1", text: "Update" });
637
+ await actions.slack.sendMessage({ channel: "#team2", text: "Update" });
638
+ ```
639
+
640
+ ### 5. Use .asTool() for AI
641
+
642
+ ```typescript
643
+ // Make integration actions available to AI
644
+ await execute({
645
+ instructions: "Help the user",
646
+ tools: [
647
+ actions.linear.issueCreate.asTool(),
648
+ actions.slack.sendMessage.asTool(),
649
+ ]
650
+ });
651
+ ```
652
+
653
+ ## See Also
654
+
655
+ - **[Agent Configuration](./agent-config.md)** - Installing and configuring integrations
656
+ - **[Actions](./actions.md)** - Creating custom actions
657
+ - **[Tools](./tools.md)** - Creating AI-callable tools
658
+ - **[Workflows](./workflows.md)** - Using actions in workflows
659
+ - **[Context API](./context-api.md)** - Accessing integrations via context