@botpress/adk 1.19.0-beta.9 → 2.0.0-alpha.1

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 (199) hide show
  1. package/dist/agent-init/agent-project-generator.d.ts +5 -1
  2. package/dist/agent-init/agent-project-generator.d.ts.map +1 -1
  3. package/dist/agent-project/agent-project.d.ts +3 -3
  4. package/dist/agent-project/agent-project.d.ts.map +1 -1
  5. package/dist/agent-project/agent-resolver.d.ts.map +1 -1
  6. package/dist/agent-project/config-writer.d.ts +1 -1
  7. package/dist/agent-project/dependency-state-to-dependencies.d.ts +11 -0
  8. package/dist/agent-project/dependency-state-to-dependencies.d.ts.map +1 -0
  9. package/dist/agent-project/types.d.ts +9 -4
  10. package/dist/agent-project/types.d.ts.map +1 -1
  11. package/dist/agent0/capabilities/commands/adk-build.md +6 -5
  12. package/dist/agent0/capabilities/commands/adk-debug.md +1 -1
  13. package/dist/agent0/capabilities/commands/adk-dev-console.md +1 -1
  14. package/dist/agent0/capabilities/commands/adk-document.md +10 -2
  15. package/dist/agent0/capabilities/commands/adk-eval.md +1 -1
  16. package/dist/agent0/capabilities/commands/adk-explain.md +2 -2
  17. package/dist/agent0/capabilities/commands/adk-init.md +2 -2
  18. package/dist/agent0/capabilities/commands/adk-ship.md +1 -1
  19. package/dist/agent0/capabilities/commands/adk-test.md +3 -3
  20. package/dist/agent0/capabilities/commands/adk-validate.md +3 -3
  21. package/dist/agent0/capabilities/skills/adk/SKILL.md +21 -21
  22. package/dist/agent0/capabilities/skills/adk/references/actions.md +245 -239
  23. package/dist/agent0/capabilities/skills/adk/references/advanced-patterns.md +185 -218
  24. package/dist/agent0/capabilities/skills/adk/references/agent-config.md +74 -71
  25. package/dist/agent0/capabilities/skills/adk/references/assets.md +45 -48
  26. package/dist/agent0/capabilities/skills/adk/references/autonomous-execution.md +40 -46
  27. package/dist/agent0/capabilities/skills/adk/references/cli.md +17 -7
  28. package/dist/agent0/capabilities/skills/adk/references/context-api.md +98 -94
  29. package/dist/agent0/capabilities/skills/adk/references/conversation-lifecycle.md +65 -62
  30. package/dist/agent0/capabilities/skills/adk/references/conversations.md +395 -385
  31. package/dist/agent0/capabilities/skills/adk/references/custom-components.md +1 -1
  32. package/dist/agent0/capabilities/skills/adk/references/desk.md +236 -234
  33. package/dist/agent0/capabilities/skills/adk/references/explain-config.md +54 -37
  34. package/dist/agent0/capabilities/skills/adk/references/files.md +301 -306
  35. package/dist/agent0/capabilities/skills/adk/references/integration-actions.md +211 -214
  36. package/dist/agent0/capabilities/skills/adk/references/integrations.md +33 -31
  37. package/dist/agent0/capabilities/skills/adk/references/interfaces.md +13 -12
  38. package/dist/agent0/capabilities/skills/adk/references/knowledge-bases.md +98 -111
  39. package/dist/agent0/capabilities/skills/adk/references/mcp-server.md +6 -0
  40. package/dist/agent0/capabilities/skills/adk/references/messages.md +280 -256
  41. package/dist/agent0/capabilities/skills/adk/references/model-configuration.md +52 -49
  42. package/dist/agent0/capabilities/skills/adk/references/patterns-mistakes.md +102 -101
  43. package/dist/agent0/capabilities/skills/adk/references/plugins.md +15 -15
  44. package/dist/agent0/capabilities/skills/adk/references/tables.md +204 -210
  45. package/dist/agent0/capabilities/skills/adk/references/tags.md +141 -143
  46. package/dist/agent0/capabilities/skills/adk/references/tools.md +191 -199
  47. package/dist/agent0/capabilities/skills/adk/references/triggers.md +331 -336
  48. package/dist/agent0/capabilities/skills/adk/references/workflow-steps.md +132 -96
  49. package/dist/agent0/capabilities/skills/adk/references/workflows.md +479 -464
  50. package/dist/agent0/capabilities/skills/adk/references/zai-agent-reference.md +127 -129
  51. package/dist/agent0/capabilities/skills/adk/references/zai-complete-guide.md +255 -276
  52. package/dist/agent0/capabilities/skills/adk-debugger/SKILL.md +21 -17
  53. package/dist/agent0/capabilities/skills/adk-debugger/references/common-failures.md +25 -25
  54. package/dist/agent0/capabilities/skills/adk-debugger/references/conversation-analysis.md +49 -41
  55. package/dist/agent0/capabilities/skills/adk-debugger/references/debug-workflow.md +20 -14
  56. package/dist/agent0/capabilities/skills/adk-debugger/references/llm-debugging.md +13 -13
  57. package/dist/agent0/capabilities/skills/adk-debugger/references/trace-summarization.md +18 -18
  58. package/dist/agent0/capabilities/skills/adk-debugger/references/traces-and-logs.md +67 -67
  59. package/dist/agent0/capabilities/skills/adk-dev-console/SKILL.md +36 -36
  60. package/dist/agent0/capabilities/skills/adk-dev-console/references/agent-steps.md +14 -6
  61. package/dist/agent0/capabilities/skills/adk-dev-console/references/multi-agent-dashboard.md +13 -13
  62. package/dist/agent0/capabilities/skills/adk-dev-console/references/pages.md +18 -0
  63. package/dist/agent0/capabilities/skills/adk-docs/SKILL.md +13 -13
  64. package/dist/agent0/capabilities/skills/adk-docs/references/doc-standards.md +15 -0
  65. package/dist/agent0/capabilities/skills/adk-evals/SKILL.md +29 -23
  66. package/dist/agent0/capabilities/skills/adk-evals/references/eval-format.md +31 -23
  67. package/dist/agent0/capabilities/skills/adk-evals/references/test-patterns.md +25 -36
  68. package/dist/agent0/capabilities/skills/adk-evals/references/testing-workflow.md +6 -4
  69. package/dist/agent0/index.js +41 -19
  70. package/dist/agent0/index.js.map +7 -7
  71. package/dist/agent0/runtime/client.d.ts +2 -0
  72. package/dist/agent0/runtime/client.d.ts.map +1 -1
  73. package/dist/agent0/runtime/engine.d.ts +2 -1
  74. package/dist/agent0/runtime/engine.d.ts.map +1 -1
  75. package/dist/agent0/runtime/process.d.ts +1 -0
  76. package/dist/agent0/runtime/process.d.ts.map +1 -1
  77. package/dist/assets/manager.d.ts +3 -0
  78. package/dist/assets/manager.d.ts.map +1 -1
  79. package/dist/auth/credentials.d.ts +1 -1
  80. package/dist/bot-generator/generator.d.ts +22 -0
  81. package/dist/bot-generator/generator.d.ts.map +1 -1
  82. package/dist/bot-generator/plugin-sync.d.ts.map +1 -1
  83. package/dist/commands/base-command.d.ts +1 -0
  84. package/dist/commands/base-command.d.ts.map +1 -1
  85. package/dist/commands/bp-dev-command.d.ts +1 -1
  86. package/dist/commands/bp-dev-command.d.ts.map +1 -1
  87. package/dist/commands/bp-dev-stderr.d.ts +9 -0
  88. package/dist/commands/bp-dev-stderr.d.ts.map +1 -1
  89. package/dist/commands/index.d.ts +1 -0
  90. package/dist/commands/index.d.ts.map +1 -1
  91. package/dist/dependencies/catalog/catalog-service.d.ts +53 -0
  92. package/dist/dependencies/catalog/catalog-service.d.ts.map +1 -0
  93. package/dist/dependencies/catalog/client-factory.d.ts +33 -0
  94. package/dist/dependencies/catalog/client-factory.d.ts.map +1 -0
  95. package/dist/dependencies/catalog/integration-source.d.ts +34 -0
  96. package/dist/dependencies/catalog/integration-source.d.ts.map +1 -0
  97. package/dist/dependencies/catalog/interface-source.d.ts +23 -0
  98. package/dist/dependencies/catalog/interface-source.d.ts.map +1 -0
  99. package/dist/dependencies/catalog/plugin-source.d.ts +49 -0
  100. package/dist/dependencies/catalog/plugin-source.d.ts.map +1 -0
  101. package/dist/dependencies/catalog/resolution-cache.d.ts +76 -0
  102. package/dist/dependencies/catalog/resolution-cache.d.ts.map +1 -0
  103. package/dist/dependencies/dependency-manager.d.ts +31 -16
  104. package/dist/dependencies/dependency-manager.d.ts.map +1 -1
  105. package/dist/dependencies/errors.d.ts +2 -2
  106. package/dist/dependencies/errors.d.ts.map +1 -1
  107. package/dist/dependencies/index.d.ts +5 -4
  108. package/dist/dependencies/index.d.ts.map +1 -1
  109. package/dist/dependencies/index.js +2089 -1670
  110. package/dist/dependencies/index.js.map +37 -30
  111. package/dist/dependencies/legacy-lock-file.d.ts +15 -0
  112. package/dist/dependencies/legacy-lock-file.d.ts.map +1 -0
  113. package/dist/dependencies/migration.d.ts +19 -0
  114. package/dist/dependencies/migration.d.ts.map +1 -1
  115. package/dist/dependencies/resolvers/integration-resolver.d.ts +4 -3
  116. package/dist/dependencies/resolvers/integration-resolver.d.ts.map +1 -1
  117. package/dist/dependencies/resolvers/plugin-resolver.d.ts +4 -4
  118. package/dist/dependencies/resolvers/plugin-resolver.d.ts.map +1 -1
  119. package/dist/dependencies/snapshot-store.d.ts +59 -0
  120. package/dist/dependencies/snapshot-store.d.ts.map +1 -0
  121. package/dist/dependencies/status-resolver.d.ts +36 -0
  122. package/dist/dependencies/status-resolver.d.ts.map +1 -0
  123. package/dist/dependencies/status.d.ts +214 -0
  124. package/dist/dependencies/status.d.ts.map +1 -0
  125. package/dist/dependencies/types.d.ts +380 -29
  126. package/dist/dependencies/types.d.ts.map +1 -1
  127. package/dist/file-watcher/watcher.d.ts +21 -5
  128. package/dist/file-watcher/watcher.d.ts.map +1 -1
  129. package/dist/generators/action-types.d.ts.map +1 -1
  130. package/dist/generators/client-wrapper.d.ts.map +1 -1
  131. package/dist/index.d.ts +4 -5
  132. package/dist/index.d.ts.map +1 -1
  133. package/dist/index.js +3134 -2226
  134. package/dist/index.js.map +55 -48
  135. package/dist/integrations/config-utils.d.ts +11 -7
  136. package/dist/integrations/config-utils.d.ts.map +1 -1
  137. package/dist/integrations/hub-cache.d.ts +0 -58
  138. package/dist/integrations/hub-cache.d.ts.map +1 -1
  139. package/dist/integrations/index.d.ts +1 -3
  140. package/dist/integrations/index.d.ts.map +1 -1
  141. package/dist/integrations/manager.d.ts +19 -53
  142. package/dist/integrations/manager.d.ts.map +1 -1
  143. package/dist/interfaces/enhanced-cache.d.ts +7 -7
  144. package/dist/interfaces/enhanced-cache.d.ts.map +1 -1
  145. package/dist/interfaces/manager.d.ts +11 -17
  146. package/dist/interfaces/manager.d.ts.map +1 -1
  147. package/dist/knowledge/manager.d.ts +3 -0
  148. package/dist/knowledge/manager.d.ts.map +1 -1
  149. package/dist/plugins/index.d.ts +0 -1
  150. package/dist/plugins/index.d.ts.map +1 -1
  151. package/dist/plugins/manager.d.ts +16 -48
  152. package/dist/plugins/manager.d.ts.map +1 -1
  153. package/dist/preflight/checker.d.ts +6 -1
  154. package/dist/preflight/checker.d.ts.map +1 -1
  155. package/dist/preflight/dependency-gate.d.ts +37 -0
  156. package/dist/preflight/dependency-gate.d.ts.map +1 -0
  157. package/dist/preflight/index.d.ts +2 -1
  158. package/dist/preflight/index.d.ts.map +1 -1
  159. package/dist/preflight/types.d.ts +18 -0
  160. package/dist/preflight/types.d.ts.map +1 -1
  161. package/dist/runner/script-runner.d.ts.map +1 -1
  162. package/dist/tables/table-manager.d.ts +3 -0
  163. package/dist/tables/table-manager.d.ts.map +1 -1
  164. package/dist/templates/README.md +23 -13
  165. package/dist/templates/blank/agent.config.ts +3 -3
  166. package/dist/templates/blank/src/triggers/index.ts +1 -1
  167. package/dist/templates/botpress-desk/evals/index.eval.ts +1 -1
  168. package/dist/templates/botpress-desk/src/triggers/index.ts +1 -1
  169. package/dist/templates/crm-enrichment/README.md +3 -3
  170. package/dist/templates/crm-enrichment/agent.config.ts +2 -2
  171. package/dist/templates/crm-enrichment/src/conversations/index.ts +1 -1
  172. package/dist/templates/hello-world/agent.config.ts +3 -3
  173. package/dist/templates/hello-world/src/triggers/index.ts +1 -1
  174. package/dist/templates/knowledge-assistant/src/triggers/index.ts +1 -1
  175. package/dist/templates/template.config.json +3 -3
  176. package/dist/utils/ids.d.ts +10 -0
  177. package/dist/utils/ids.d.ts.map +1 -1
  178. package/dist/workspace/workspace-cache.d.ts +2 -1
  179. package/dist/workspace/workspace-cache.d.ts.map +1 -1
  180. package/package.json +3 -3
  181. package/dist/agent-project/lock-to-dependencies.d.ts +0 -11
  182. package/dist/agent-project/lock-to-dependencies.d.ts.map +0 -1
  183. package/dist/dependencies/lock-file.d.ts +0 -15
  184. package/dist/dependencies/lock-file.d.ts.map +0 -1
  185. package/dist/integrations/enhanced-cache.d.ts +0 -53
  186. package/dist/integrations/enhanced-cache.d.ts.map +0 -1
  187. package/dist/plugins/enhanced-cache.d.ts +0 -53
  188. package/dist/plugins/enhanced-cache.d.ts.map +0 -1
  189. package/dist/templates/blank/package.json +0 -17
  190. package/dist/templates/blank/tsconfig.json +0 -25
  191. package/dist/templates/botpress-desk/package.json +0 -17
  192. package/dist/templates/crm-enrichment/package.json +0 -18
  193. package/dist/templates/crm-enrichment/tsconfig.json +0 -25
  194. package/dist/templates/hello-world/package.json +0 -18
  195. package/dist/templates/hello-world/tsconfig.json +0 -25
  196. package/dist/templates/knowledge-assistant/package.json +0 -18
  197. package/dist/templates/knowledge-assistant/tsconfig.json +0 -25
  198. package/dist/templates/slack-triage/package.json +0 -18
  199. package/dist/templates/slack-triage/tsconfig.json +0 -25
@@ -9,19 +9,19 @@ For basic conversation setup, channel routing, and handler parameters, see **[co
9
9
  Add a `lifecycle` object to any Conversation definition. Durations use `ms`-compatible strings (`"30s"`, `"5m"`, `"1h"`, `"1d"`).
10
10
 
11
11
  ```typescript
12
- import { Conversation, z } from "@botpress/runtime";
12
+ import { Conversation, z } from '@botpress/runtime'
13
13
 
14
14
  export const Chat = new Conversation({
15
- channel: "webchat.channel",
15
+ channel: 'webchat.channel',
16
16
 
17
17
  lifecycle: {
18
18
  nudge: {
19
- after: "5m", // First nudge fires 5 min after last user message
20
- interval: "10m", // Subsequent nudges fire every 10 min
21
- max: 3, // Stop after 3 nudges (omit for unlimited)
19
+ after: '5m', // First nudge fires 5 min after last user message
20
+ interval: '10m', // Subsequent nudges fire every 10 min
21
+ max: 3, // Stop after 3 nudges (omit for unlimited)
22
22
  },
23
23
  expire: {
24
- after: "1h", // Session expires 1 hour after last user message
24
+ after: '1h', // Session expires 1 hour after last user message
25
25
  },
26
26
  },
27
27
 
@@ -32,17 +32,17 @@ export const Chat = new Conversation({
32
32
  handler: async (props) => {
33
33
  // handler receives nudge and expire events alongside regular messages
34
34
  },
35
- });
35
+ })
36
36
  ```
37
37
 
38
38
  ### Configuration Fields
39
39
 
40
- | Field | Type | Required | Description |
41
- |-------|------|----------|-------------|
42
- | `nudge.after` | `string` | Yes (if nudge) | Duration of silence before the first nudge fires |
43
- | `nudge.interval` | `string` | No | Duration between subsequent nudges. Defaults to `nudge.after` |
44
- | `nudge.max` | `number` | No | Max nudges per session. Must be a positive integer. Omit for unlimited |
45
- | `expire.after` | `string` | Yes (if expire) | Duration of silence before the session expires |
40
+ | Field | Type | Required | Description |
41
+ | ---------------- | -------- | --------------- | ---------------------------------------------------------------------- |
42
+ | `nudge.after` | `string` | Yes (if nudge) | Duration of silence before the first nudge fires |
43
+ | `nudge.interval` | `string` | No | Duration between subsequent nudges. Defaults to `nudge.after` |
44
+ | `nudge.max` | `number` | No | Max nudges per session. Must be a positive integer. Omit for unlimited |
45
+ | `expire.after` | `string` | Yes (if expire) | Duration of silence before the session expires |
46
46
 
47
47
  Nudge and expire are independent -- you can configure either or both.
48
48
 
@@ -52,35 +52,35 @@ When lifecycle is enabled, the conversation handler receives two additional even
52
52
 
53
53
  ```typescript
54
54
  handler: async ({ type, conversation, state, execute }) => {
55
- if (type === "nudge") {
55
+ if (type === 'nudge') {
56
56
  // User has been silent -- send a re-engagement message
57
57
  await conversation.send({
58
- type: "text",
59
- payload: { text: "Still there? Let me know if you need anything." },
60
- });
61
- return;
58
+ type: 'text',
59
+ payload: { text: 'Still there? Let me know if you need anything.' },
60
+ })
61
+ return
62
62
  }
63
63
 
64
- if (type === "expire") {
64
+ if (type === 'expire') {
65
65
  // Session is about to be torn down -- send a farewell
66
66
  await conversation.send({
67
- type: "text",
68
- payload: { text: "This session has expired. Send a new message to start fresh." },
69
- });
67
+ type: 'text',
68
+ payload: { text: 'This session has expired. Send a new message to start fresh.' },
69
+ })
70
70
  // After the handler returns, the runtime automatically:
71
71
  // 1. Cancels all active workflows on the conversation
72
72
  // 2. Tags the conversation with sessionExpired = "true"
73
73
  // 3. Resets conversation state to defaults
74
74
  // 4. Clears the transcript
75
75
  // 5. Sets lifecycle status to "expired"
76
- return;
76
+ return
77
77
  }
78
78
 
79
- if (type === "message") {
79
+ if (type === 'message') {
80
80
  // Normal message handling
81
81
  await execute({
82
- instructions: "You are a helpful assistant",
83
- });
82
+ instructions: 'You are a helpful assistant',
83
+ })
84
84
  }
85
85
  }
86
86
  ```
@@ -88,10 +88,12 @@ handler: async ({ type, conversation, state, execute }) => {
88
88
  ### Handler Props by Type
89
89
 
90
90
  When `type === "nudge"`:
91
+
91
92
  - `event` is typed as `LifecycleNudgeEventType` with payload `{ conversationId, sessionId, scheduledAt }`
92
93
  - `message` is `undefined`
93
94
 
94
95
  When `type === "expire"`:
96
+
95
97
  - `event` is typed as `LifecycleExpireEventType` with payload `{ conversationId, sessionId, scheduledAt }`
96
98
  - `message` is `undefined`
97
99
 
@@ -103,28 +105,28 @@ Lifecycle-enabled conversations expose a read-only `conversation.session` proper
103
105
 
104
106
  ```typescript
105
107
  handler: async ({ type, conversation }) => {
106
- const session = conversation.session;
107
- if (!session) return; // undefined when lifecycle is not configured
108
-
109
- console.log(session.id); // ULID identifying the current session
110
- console.log(session.number); // Monotonically increasing (1, 2, 3...)
111
- console.log(session.status); // "active" or "expired"
112
- console.log(session.startedAt); // ISO timestamp
113
- console.log(session.lastActivityAt); // ISO timestamp of last user message
114
- console.log(session.nudgeCount); // Number of nudges fired this session
108
+ const session = conversation.session
109
+ if (!session) return // undefined when lifecycle is not configured
110
+
111
+ console.log(session.id) // ULID identifying the current session
112
+ console.log(session.number) // Monotonically increasing (1, 2, 3...)
113
+ console.log(session.status) // "active" or "expired"
114
+ console.log(session.startedAt) // ISO timestamp
115
+ console.log(session.lastActivityAt) // ISO timestamp of last user message
116
+ console.log(session.nudgeCount) // Number of nudges fired this session
115
117
  }
116
118
  ```
117
119
 
118
120
  ### Session Fields
119
121
 
120
- | Field | Type | Description |
121
- |-------|------|-------------|
122
- | `id` | `string` | ULID unique to the current session |
123
- | `number` | `number` | Session counter, increments on each expiration (starts at 1) |
124
- | `status` | `"active" \| "expired"` | Current session status |
125
- | `startedAt` | `string` | ISO timestamp when this session began |
126
- | `lastActivityAt` | `string` | ISO timestamp of the last user message |
127
- | `nudgeCount` | `number` | Number of nudges delivered in this session |
122
+ | Field | Type | Description |
123
+ | ---------------- | ----------------------- | ------------------------------------------------------------ |
124
+ | `id` | `string` | ULID unique to the current session |
125
+ | `number` | `number` | Session counter, increments on each expiration (starts at 1) |
126
+ | `status` | `"active" \| "expired"` | Current session status |
127
+ | `startedAt` | `string` | ISO timestamp when this session began |
128
+ | `lastActivityAt` | `string` | ISO timestamp of the last user message |
129
+ | `nudgeCount` | `number` | Number of nudges delivered in this session |
128
130
 
129
131
  ## How Timers Work
130
132
 
@@ -161,6 +163,7 @@ This means every user message resets the clock. Timers always measure silence fr
161
163
  ### Session Renewal
162
164
 
163
165
  When a message arrives on an expired session:
166
+
164
167
  1. A new `sessionId` (ULID) is generated
165
168
  2. `sessionNumber` increments
166
169
  3. `nudgeCount` resets to 0
@@ -175,15 +178,15 @@ Lifecycle automatically manages these tags without any user configuration:
175
178
 
176
179
  ### Conversation Tags
177
180
 
178
- | Tag | Description |
179
- |-----|-------------|
181
+ | Tag | Description |
182
+ | ---------------- | ---------------------------------------------------------- |
180
183
  | `sessionExpired` | Set to `"true"` when a session expires. Cleared on renewal |
181
184
 
182
185
  ### Message Tags
183
186
 
184
- | Tag | Description |
185
- |-----|-------------|
186
- | `sessionId` | ULID of the session this message belongs to |
187
+ | Tag | Description |
188
+ | --------------- | -------------------------------------------------------- |
189
+ | `sessionId` | ULID of the session this message belongs to |
187
190
  | `sessionNumber` | Session sequence number at the time the message was sent |
188
191
 
189
192
  Message tags are applied automatically to both incoming user messages and outgoing bot messages. They enable grouping messages by session.
@@ -204,26 +207,26 @@ Use `conversation.session.nudgeCount` to vary the message urgency:
204
207
 
205
208
  ```typescript
206
209
  handler: async ({ type, conversation }) => {
207
- if (type === "nudge") {
208
- const count = conversation.session?.nudgeCount ?? 0;
210
+ if (type === 'nudge') {
211
+ const count = conversation.session?.nudgeCount ?? 0
209
212
 
210
213
  if (count === 1) {
211
214
  await conversation.send({
212
- type: "text",
213
- payload: { text: "Just checking in -- do you still need help?" },
214
- });
215
+ type: 'text',
216
+ payload: { text: 'Just checking in -- do you still need help?' },
217
+ })
215
218
  } else if (count === 2) {
216
219
  await conversation.send({
217
- type: "text",
220
+ type: 'text',
218
221
  payload: { text: "I'm still here if you need me." },
219
- });
222
+ })
220
223
  } else {
221
224
  await conversation.send({
222
- type: "text",
225
+ type: 'text',
223
226
  payload: { text: "This conversation will expire soon if there's no activity." },
224
- });
227
+ })
225
228
  }
226
- return;
229
+ return
227
230
  }
228
231
  // ... handle messages
229
232
  }
@@ -235,17 +238,17 @@ Send a session summary before the session is torn down:
235
238
 
236
239
  ```typescript
237
240
  handler: async ({ type, conversation, state, execute }) => {
238
- if (type === "expire") {
241
+ if (type === 'expire') {
239
242
  if (state.topic) {
240
243
  await conversation.send({
241
- type: "text",
244
+ type: 'text',
242
245
  payload: {
243
246
  text: `Session expired. You were working on: ${state.topic}. Send a message to start a new session.`,
244
247
  },
245
- });
248
+ })
246
249
  }
247
250
  // State will be reset after this handler returns
248
- return;
251
+ return
249
252
  }
250
253
  // ... handle messages
251
254
  }