| 285 | } |
| 286 | |
| 287 | async runAgent(input?: { |
| 288 | context?: ContextEntry[]; |
| 289 | tools?: BotTool[]; |
| 290 | /** |
| 291 | * A user message to inject before running. Needed when the input isn't |
| 292 | * already in the conversation history the adapter reconstructs — e.g. a |
| 293 | * slash command, whose args are never posted to the channel. A |
| 294 | * `AgentContentPart[]` carries multimodal content (e.g. inbound image/file |
| 295 | * attachments) the model can read. |
| 296 | */ |
| 297 | prompt?: string | AgentContentPart[]; |
| 298 | /** |
| 299 | * Auto-bridge cross-platform transcripts for this run. When truthy AND the |
| 300 | * thread has a resolved `userKey` AND a `Transcripts` instance, this: |
| 301 | * 1. injects prior history (`transcripts.list`, default limit 20) as a |
| 302 | * context entry, |
| 303 | * 2. appends the current user turn, |
| 304 | * 3. runs the agent, |
| 305 | * 4. captures the assistant reply and appends it. |
| 306 | * This flag OWNS the bridge — callers using it should NOT also manually |
| 307 | * append the same user/assistant turn via `bot.transcripts.append`. |
| 308 | * No-ops with a one-time warning when identity/transcripts aren't configured. |
| 309 | */ |
| 310 | transcript?: boolean | { limit?: number }; |
| 311 | }): Promise<MessageRef | undefined> { |
| 312 | return this.run(undefined, input); |
| 313 | } |
| 314 | |
| 315 | async resume(value: unknown): Promise<MessageRef | undefined> { |
| 316 | return this.run({ resume: value }); |