@trigger.dev/sdk 0.0.0-python-preview-20250226140121 → 0.0.0-rc-4-8-0-20261021151928
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/README.md +29 -9
- package/dist/commonjs/imports/ai-runtime-cjs.cjs.map +1 -0
- package/dist/commonjs/imports/ai-runtime.d.ts +1 -0
- package/dist/commonjs/imports/ai-runtime.js +31 -0
- package/dist/commonjs/imports/uncrypto.js +4 -4
- package/dist/commonjs/package.json +2 -1
- package/dist/commonjs/v3/agentSkillsRuntime.d.ts +28 -0
- package/dist/commonjs/v3/agentSkillsRuntime.js +173 -0
- package/dist/commonjs/v3/agentSkillsRuntime.js.map +1 -0
- package/dist/commonjs/v3/ai-shared.d.ts +156 -0
- package/dist/commonjs/v3/ai-shared.js +215 -0
- package/dist/commonjs/v3/ai-shared.js.map +1 -0
- package/dist/commonjs/v3/ai.d.ts +4225 -0
- package/dist/commonjs/v3/ai.js +11569 -0
- package/dist/commonjs/v3/ai.js.map +1 -0
- package/dist/commonjs/v3/aiAutoTelemetry.d.ts +2 -0
- package/dist/commonjs/v3/aiAutoTelemetry.js +81 -0
- package/dist/commonjs/v3/aiAutoTelemetry.js.map +1 -0
- package/dist/commonjs/v3/auth.d.ts +71 -10
- package/dist/commonjs/v3/auth.js +85 -19
- package/dist/commonjs/v3/auth.js.map +1 -1
- package/dist/commonjs/v3/batch.d.ts +3 -3
- package/dist/commonjs/v3/batch.js.map +1 -1
- package/dist/commonjs/v3/cache.js.map +1 -1
- package/dist/commonjs/v3/chat-client.d.ts +324 -0
- package/dist/commonjs/v3/chat-client.js +774 -0
- package/dist/commonjs/v3/chat-client.js.map +1 -0
- package/dist/commonjs/v3/chat-react.d.ts +244 -0
- package/dist/commonjs/v3/chat-react.js +463 -0
- package/dist/commonjs/v3/chat-react.js.map +1 -0
- package/dist/commonjs/v3/chat-server.d.ts +350 -0
- package/dist/commonjs/v3/chat-server.js +965 -0
- package/dist/commonjs/v3/chat-server.js.map +1 -0
- package/dist/commonjs/v3/chat-tab-coordinator.d.ts +65 -0
- package/dist/commonjs/v3/chat-tab-coordinator.js +235 -0
- package/dist/commonjs/v3/chat-tab-coordinator.js.map +1 -0
- package/dist/commonjs/v3/chat.d.ts +792 -0
- package/dist/commonjs/v3/chat.js +1662 -0
- package/dist/commonjs/v3/chat.js.map +1 -0
- package/dist/commonjs/v3/chatRouteWait.d.ts +21 -0
- package/dist/commonjs/v3/chatRouteWait.js +43 -0
- package/dist/commonjs/v3/chatRouteWait.js.map +1 -0
- package/dist/commonjs/v3/chatSnapshotIo.d.ts +2 -0
- package/dist/commonjs/v3/chatSnapshotIo.js +173 -0
- package/dist/commonjs/v3/chatSnapshotIo.js.map +1 -0
- package/dist/commonjs/v3/chatVersionSkew.d.ts +12 -0
- package/dist/commonjs/v3/chatVersionSkew.js +30 -0
- package/dist/commonjs/v3/chatVersionSkew.js.map +1 -0
- package/dist/commonjs/v3/compactionResponse.d.ts +9 -0
- package/dist/commonjs/v3/compactionResponse.js +37 -0
- package/dist/commonjs/v3/compactionResponse.js.map +1 -0
- package/dist/commonjs/v3/concurrency-shared.d.ts +13 -0
- package/dist/commonjs/v3/concurrency-shared.js +35 -0
- package/dist/commonjs/v3/concurrency-shared.js.map +1 -0
- package/dist/commonjs/v3/concurrencyLimits.d.ts +103 -0
- package/dist/commonjs/v3/concurrencyLimits.js +134 -0
- package/dist/commonjs/v3/concurrencyLimits.js.map +1 -0
- package/dist/commonjs/v3/config.js.map +1 -1
- package/dist/commonjs/v3/deployments.d.ts +25 -0
- package/dist/commonjs/v3/deployments.js +37 -0
- package/dist/commonjs/v3/deployments.js.map +1 -0
- package/dist/commonjs/v3/envvars.d.ts +5 -5
- package/dist/commonjs/v3/envvars.js.map +1 -1
- package/dist/commonjs/v3/externalDeploymentId.d.ts +23 -0
- package/dist/commonjs/v3/externalDeploymentId.js +43 -0
- package/dist/commonjs/v3/externalDeploymentId.js.map +1 -0
- package/dist/commonjs/v3/heartbeats.d.ts +37 -0
- package/dist/commonjs/v3/heartbeats.js +45 -0
- package/dist/commonjs/v3/heartbeats.js.map +1 -0
- package/dist/commonjs/v3/hooks.d.ts +26 -0
- package/dist/commonjs/v3/hooks.js +79 -0
- package/dist/commonjs/v3/hooks.js.map +1 -0
- package/dist/commonjs/v3/idempotencyKeys.d.ts +2 -1
- package/dist/commonjs/v3/idempotencyKeys.js +1 -0
- package/dist/commonjs/v3/idempotencyKeys.js.map +1 -1
- package/dist/commonjs/v3/index.d.ts +20 -5
- package/dist/commonjs/v3/index.js +56 -20
- package/dist/commonjs/v3/index.js.map +1 -1
- package/dist/commonjs/v3/locals.d.ts +3 -0
- package/dist/commonjs/v3/locals.js +6 -0
- package/dist/commonjs/v3/locals.js.map +1 -0
- package/dist/commonjs/v3/managedChatResponse.d.ts +44 -0
- package/dist/commonjs/v3/managedChatResponse.js +221 -0
- package/dist/commonjs/v3/managedChatResponse.js.map +1 -0
- package/dist/commonjs/v3/metadata.d.ts +5 -2
- package/dist/commonjs/v3/metadata.js +8 -1
- package/dist/commonjs/v3/metadata.js.map +1 -1
- package/dist/commonjs/v3/modelFileDownload.d.ts +10 -0
- package/dist/commonjs/v3/modelFileDownload.js +164 -0
- package/dist/commonjs/v3/modelFileDownload.js.map +1 -0
- package/dist/commonjs/v3/otel.d.ts +4 -0
- package/dist/commonjs/v3/otel.js +12 -0
- package/dist/commonjs/v3/otel.js.map +1 -0
- package/dist/commonjs/v3/prompt.d.ts +38 -0
- package/dist/commonjs/v3/prompt.js +146 -0
- package/dist/commonjs/v3/prompt.js.map +1 -0
- package/dist/commonjs/v3/promptManagement.d.ts +26 -0
- package/dist/commonjs/v3/promptManagement.js +180 -0
- package/dist/commonjs/v3/promptManagement.js.map +1 -0
- package/dist/commonjs/v3/prompts.d.ts +3 -0
- package/dist/commonjs/v3/prompts.js +15 -0
- package/dist/commonjs/v3/prompts.js.map +1 -0
- package/dist/commonjs/v3/query.d.ts +545 -0
- package/dist/commonjs/v3/query.js +163 -0
- package/dist/commonjs/v3/query.js.map +1 -0
- package/dist/commonjs/v3/queues.d.ts +107 -0
- package/dist/commonjs/v3/queues.js +225 -0
- package/dist/commonjs/v3/queues.js.map +1 -0
- package/dist/commonjs/v3/retry.d.ts +6 -2
- package/dist/commonjs/v3/retry.js +34 -23
- package/dist/commonjs/v3/retry.js.map +1 -1
- package/dist/commonjs/v3/runs.d.ts +182 -101
- package/dist/commonjs/v3/runs.js +99 -5
- package/dist/commonjs/v3/runs.js.map +1 -1
- package/dist/commonjs/v3/schedules/api.d.ts +8 -1
- package/dist/commonjs/v3/schedules/index.d.ts +29 -9
- package/dist/commonjs/v3/schedules/index.js +5 -1
- package/dist/commonjs/v3/schedules/index.js.map +1 -1
- package/dist/commonjs/v3/schemas.d.ts +1 -0
- package/dist/commonjs/{integrations.js → v3/schemas.js} +1 -1
- package/dist/commonjs/v3/schemas.js.map +1 -0
- package/dist/commonjs/v3/sessionTracing.d.ts +7 -0
- package/dist/commonjs/v3/sessionTracing.js +44 -0
- package/dist/commonjs/v3/sessionTracing.js.map +1 -0
- package/dist/commonjs/v3/sessions.d.ts +268 -0
- package/dist/commonjs/v3/sessions.js +776 -0
- package/dist/commonjs/v3/sessions.js.map +1 -0
- package/dist/commonjs/v3/shared.d.ts +129 -24
- package/dist/commonjs/v3/shared.js +1527 -689
- package/dist/commonjs/v3/shared.js.map +1 -1
- package/dist/commonjs/v3/skill.d.ts +99 -0
- package/dist/commonjs/v3/skill.js +165 -0
- package/dist/commonjs/v3/skill.js.map +1 -0
- package/dist/commonjs/v3/skills.d.ts +2 -0
- package/dist/commonjs/v3/skills.js +6 -0
- package/dist/commonjs/v3/skills.js.map +1 -0
- package/dist/commonjs/v3/steeringContext.d.ts +41 -0
- package/dist/commonjs/v3/steeringContext.js +118 -0
- package/dist/commonjs/v3/steeringContext.js.map +1 -0
- package/dist/commonjs/v3/streams.d.ts +298 -0
- package/dist/commonjs/v3/streams.js +584 -0
- package/dist/commonjs/v3/streams.js.map +1 -0
- package/dist/commonjs/v3/tasks.d.ts +19 -4
- package/dist/commonjs/v3/tasks.js +15 -1
- package/dist/commonjs/v3/tasks.js.map +1 -1
- package/dist/commonjs/v3/test/index.d.ts +5 -0
- package/dist/commonjs/v3/test/index.js +23 -0
- package/dist/commonjs/v3/test/index.js.map +1 -0
- package/dist/commonjs/v3/test/mock-channel-connector.d.ts +172 -0
- package/dist/commonjs/v3/test/mock-channel-connector.js +173 -0
- package/dist/commonjs/v3/test/mock-channel-connector.js.map +1 -0
- package/dist/commonjs/v3/test/mock-chat-agent.d.ts +388 -0
- package/dist/commonjs/v3/test/mock-chat-agent.js +689 -0
- package/dist/commonjs/v3/test/mock-chat-agent.js.map +1 -0
- package/dist/commonjs/v3/test/setup-catalog.d.ts +1 -0
- package/dist/commonjs/v3/test/setup-catalog.js +18 -0
- package/dist/commonjs/v3/test/setup-catalog.js.map +1 -0
- package/dist/commonjs/v3/test/test-session-handle.d.ts +24 -0
- package/dist/commonjs/v3/test/test-session-handle.js +271 -0
- package/dist/commonjs/v3/test/test-session-handle.js.map +1 -0
- package/dist/commonjs/v3/test/transcript-storage-tests.d.ts +40 -0
- package/dist/commonjs/v3/test/transcript-storage-tests.js +258 -0
- package/dist/commonjs/v3/test/transcript-storage-tests.js.map +1 -0
- package/dist/commonjs/v3/toolResultOrder.d.ts +15 -0
- package/dist/commonjs/v3/toolResultOrder.js +58 -0
- package/dist/commonjs/v3/toolResultOrder.js.map +1 -0
- package/dist/commonjs/v3/transcriptStorage.d.ts +307 -0
- package/dist/commonjs/v3/transcriptStorage.js +445 -0
- package/dist/commonjs/v3/transcriptStorage.js.map +1 -0
- package/dist/commonjs/v3/triggerClient.d.ts +45 -0
- package/dist/commonjs/v3/triggerClient.js +114 -0
- package/dist/commonjs/v3/triggerClient.js.map +1 -0
- package/dist/commonjs/v3/uiMessageChunks.d.ts +1 -0
- package/dist/commonjs/v3/uiMessageChunks.js +119 -0
- package/dist/commonjs/v3/uiMessageChunks.js.map +1 -0
- package/dist/commonjs/v3/usage.js +7 -6
- package/dist/commonjs/v3/usage.js.map +1 -1
- package/dist/commonjs/v3/wait.d.ts +218 -3
- package/dist/commonjs/v3/wait.js +433 -7
- package/dist/commonjs/v3/wait.js.map +1 -1
- package/dist/commonjs/v3/waitUntil.js.map +1 -1
- package/dist/commonjs/v3/webhookWaiters.d.ts +80 -0
- package/dist/commonjs/v3/webhookWaiters.js +156 -0
- package/dist/commonjs/v3/webhookWaiters.js.map +1 -0
- package/dist/commonjs/v3/webhooks.d.ts +192 -2
- package/dist/commonjs/v3/webhooks.js +340 -2
- package/dist/commonjs/v3/webhooks.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/imports/ai-runtime.d.ts +2 -0
- package/dist/esm/imports/ai-runtime.js +16 -0
- package/dist/esm/imports/ai-runtime.js.map +1 -0
- package/dist/esm/package.json +2 -1
- package/dist/esm/v3/agentSkillsRuntime.d.ts +28 -0
- package/dist/esm/v3/agentSkillsRuntime.js +136 -0
- package/dist/esm/v3/agentSkillsRuntime.js.map +1 -0
- package/dist/esm/v3/ai-shared.d.ts +156 -0
- package/dist/esm/v3/ai-shared.js +208 -0
- package/dist/esm/v3/ai-shared.js.map +1 -0
- package/dist/esm/v3/ai.d.ts +4225 -0
- package/dist/esm/v3/ai.js +11550 -0
- package/dist/esm/v3/ai.js.map +1 -0
- package/dist/esm/v3/aiAutoTelemetry.d.ts +2 -0
- package/dist/esm/v3/aiAutoTelemetry.js +78 -0
- package/dist/esm/v3/aiAutoTelemetry.js.map +1 -0
- package/dist/esm/v3/auth.d.ts +71 -10
- package/dist/esm/v3/auth.js +83 -17
- package/dist/esm/v3/auth.js.map +1 -1
- package/dist/esm/v3/batch.d.ts +3 -3
- package/dist/esm/v3/batch.js +2 -2
- package/dist/esm/v3/batch.js.map +1 -1
- package/dist/esm/v3/chat-client.d.ts +324 -0
- package/dist/esm/v3/chat-client.js +769 -0
- package/dist/esm/v3/chat-client.js.map +1 -0
- package/dist/esm/v3/chat-react.d.ts +244 -0
- package/dist/esm/v3/chat-react.js +455 -0
- package/dist/esm/v3/chat-react.js.map +1 -0
- package/dist/esm/v3/chat-server.d.ts +350 -0
- package/dist/esm/v3/chat-server.js +962 -0
- package/dist/esm/v3/chat-server.js.map +1 -0
- package/dist/esm/v3/chat-tab-coordinator.d.ts +65 -0
- package/dist/esm/v3/chat-tab-coordinator.js +231 -0
- package/dist/esm/v3/chat-tab-coordinator.js.map +1 -0
- package/dist/esm/v3/chat.d.ts +792 -0
- package/dist/esm/v3/chat.js +1655 -0
- package/dist/esm/v3/chat.js.map +1 -0
- package/dist/esm/v3/chatRouteWait.d.ts +21 -0
- package/dist/esm/v3/chatRouteWait.js +40 -0
- package/dist/esm/v3/chatRouteWait.js.map +1 -0
- package/dist/esm/v3/chatSnapshotIo.d.ts +2 -0
- package/dist/esm/v3/chatSnapshotIo.js +165 -0
- package/dist/esm/v3/chatSnapshotIo.js.map +1 -0
- package/dist/esm/v3/chatVersionSkew.d.ts +12 -0
- package/dist/esm/v3/chatVersionSkew.js +27 -0
- package/dist/esm/v3/chatVersionSkew.js.map +1 -0
- package/dist/esm/v3/compactionResponse.d.ts +9 -0
- package/dist/esm/v3/compactionResponse.js +34 -0
- package/dist/esm/v3/compactionResponse.js.map +1 -0
- package/dist/esm/v3/concurrency-shared.d.ts +13 -0
- package/dist/esm/v3/concurrency-shared.js +31 -0
- package/dist/esm/v3/concurrency-shared.js.map +1 -0
- package/dist/esm/v3/concurrencyLimits.d.ts +103 -0
- package/dist/esm/v3/concurrencyLimits.js +126 -0
- package/dist/esm/v3/concurrencyLimits.js.map +1 -0
- package/dist/esm/v3/deployments.d.ts +25 -0
- package/dist/esm/v3/deployments.js +34 -0
- package/dist/esm/v3/deployments.js.map +1 -0
- package/dist/esm/v3/envvars.d.ts +5 -5
- package/dist/esm/v3/envvars.js.map +1 -1
- package/dist/esm/v3/externalDeploymentId.d.ts +23 -0
- package/dist/esm/v3/externalDeploymentId.js +38 -0
- package/dist/esm/v3/externalDeploymentId.js.map +1 -0
- package/dist/esm/v3/heartbeats.d.ts +37 -0
- package/dist/esm/v3/heartbeats.js +42 -0
- package/dist/esm/v3/heartbeats.js.map +1 -0
- package/dist/esm/v3/hooks.d.ts +26 -0
- package/dist/esm/v3/hooks.js +66 -0
- package/dist/esm/v3/hooks.js.map +1 -0
- package/dist/esm/v3/idempotencyKeys.d.ts +2 -1
- package/dist/esm/v3/idempotencyKeys.js +2 -1
- package/dist/esm/v3/idempotencyKeys.js.map +1 -1
- package/dist/esm/v3/index.d.ts +20 -5
- package/dist/esm/v3/index.js +16 -2
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/esm/v3/locals.d.ts +3 -0
- package/dist/esm/v3/locals.js +3 -0
- package/dist/esm/v3/locals.js.map +1 -0
- package/dist/esm/v3/managedChatResponse.d.ts +44 -0
- package/dist/esm/v3/managedChatResponse.js +216 -0
- package/dist/esm/v3/managedChatResponse.js.map +1 -0
- package/dist/esm/v3/metadata.d.ts +5 -2
- package/dist/esm/v3/metadata.js +8 -1
- package/dist/esm/v3/metadata.js.map +1 -1
- package/dist/esm/v3/modelFileDownload.d.ts +10 -0
- package/dist/esm/v3/modelFileDownload.js +161 -0
- package/dist/esm/v3/modelFileDownload.js.map +1 -0
- package/dist/esm/v3/otel.d.ts +4 -0
- package/dist/esm/v3/otel.js +9 -0
- package/dist/esm/v3/otel.js.map +1 -0
- package/dist/esm/v3/prompt.d.ts +38 -0
- package/dist/esm/v3/prompt.js +143 -0
- package/dist/esm/v3/prompt.js.map +1 -0
- package/dist/esm/v3/promptManagement.d.ts +26 -0
- package/dist/esm/v3/promptManagement.js +170 -0
- package/dist/esm/v3/promptManagement.js.map +1 -0
- package/dist/esm/v3/prompts.d.ts +3 -0
- package/dist/esm/v3/prompts.js +3 -0
- package/dist/esm/v3/prompts.js.map +1 -0
- package/dist/esm/v3/query.d.ts +545 -0
- package/dist/esm/v3/query.js +160 -0
- package/dist/esm/v3/query.js.map +1 -0
- package/dist/esm/v3/queues.d.ts +107 -0
- package/dist/esm/v3/queues.js +217 -0
- package/dist/esm/v3/queues.js.map +1 -0
- package/dist/esm/v3/retry.d.ts +6 -2
- package/dist/esm/v3/retry.js +27 -19
- package/dist/esm/v3/retry.js.map +1 -1
- package/dist/esm/v3/runs.d.ts +179 -98
- package/dist/esm/v3/runs.js +99 -5
- package/dist/esm/v3/runs.js.map +1 -1
- package/dist/esm/v3/schedules/api.d.ts +8 -1
- package/dist/esm/v3/schedules/index.d.ts +29 -9
- package/dist/esm/v3/schedules/index.js +6 -2
- package/dist/esm/v3/schedules/index.js.map +1 -1
- package/dist/esm/v3/schemas.d.ts +1 -0
- package/dist/esm/v3/schemas.js +2 -0
- package/dist/esm/v3/schemas.js.map +1 -0
- package/dist/esm/v3/sessionTracing.d.ts +7 -0
- package/dist/esm/v3/sessionTracing.js +40 -0
- package/dist/esm/v3/sessionTracing.js.map +1 -0
- package/dist/esm/v3/sessions.d.ts +268 -0
- package/dist/esm/v3/sessions.js +767 -0
- package/dist/esm/v3/sessions.js.map +1 -0
- package/dist/esm/v3/shared.d.ts +129 -24
- package/dist/esm/v3/shared.js +1521 -688
- package/dist/esm/v3/shared.js.map +1 -1
- package/dist/esm/v3/skill.d.ts +99 -0
- package/dist/esm/v3/skill.js +128 -0
- package/dist/esm/v3/skill.js.map +1 -0
- package/dist/esm/v3/skills.d.ts +2 -0
- package/dist/esm/v3/skills.js +2 -0
- package/dist/esm/v3/skills.js.map +1 -0
- package/dist/esm/v3/steeringContext.d.ts +41 -0
- package/dist/esm/v3/steeringContext.js +113 -0
- package/dist/esm/v3/steeringContext.js.map +1 -0
- package/dist/esm/v3/streams.d.ts +298 -0
- package/dist/esm/v3/streams.js +580 -0
- package/dist/esm/v3/streams.js.map +1 -0
- package/dist/esm/v3/tasks.d.ts +19 -4
- package/dist/esm/v3/tasks.js +16 -2
- package/dist/esm/v3/tasks.js.map +1 -1
- package/dist/esm/v3/test/index.d.ts +5 -0
- package/dist/esm/v3/test/index.js +15 -0
- package/dist/esm/v3/test/index.js.map +1 -0
- package/dist/esm/v3/test/mock-channel-connector.d.ts +172 -0
- package/dist/esm/v3/test/mock-channel-connector.js +170 -0
- package/dist/esm/v3/test/mock-channel-connector.js.map +1 -0
- package/dist/esm/v3/test/mock-chat-agent.d.ts +388 -0
- package/dist/esm/v3/test/mock-chat-agent.js +685 -0
- package/dist/esm/v3/test/mock-chat-agent.js.map +1 -0
- package/dist/esm/v3/test/setup-catalog.d.ts +1 -0
- package/dist/esm/v3/test/setup-catalog.js +16 -0
- package/dist/esm/v3/test/setup-catalog.js.map +1 -0
- package/dist/esm/v3/test/test-session-handle.d.ts +24 -0
- package/dist/esm/v3/test/test-session-handle.js +268 -0
- package/dist/esm/v3/test/test-session-handle.js.map +1 -0
- package/dist/esm/v3/test/transcript-storage-tests.d.ts +40 -0
- package/dist/esm/v3/test/transcript-storage-tests.js +255 -0
- package/dist/esm/v3/test/transcript-storage-tests.js.map +1 -0
- package/dist/esm/v3/toolResultOrder.d.ts +15 -0
- package/dist/esm/v3/toolResultOrder.js +55 -0
- package/dist/esm/v3/toolResultOrder.js.map +1 -0
- package/dist/esm/v3/transcriptStorage.d.ts +307 -0
- package/dist/esm/v3/transcriptStorage.js +431 -0
- package/dist/esm/v3/transcriptStorage.js.map +1 -0
- package/dist/esm/v3/triggerClient.d.ts +45 -0
- package/dist/esm/v3/triggerClient.js +77 -0
- package/dist/esm/v3/triggerClient.js.map +1 -0
- package/dist/esm/v3/uiMessageChunks.d.ts +1 -0
- package/dist/esm/v3/uiMessageChunks.js +116 -0
- package/dist/esm/v3/uiMessageChunks.js.map +1 -0
- package/dist/esm/v3/usage.js +7 -6
- package/dist/esm/v3/usage.js.map +1 -1
- package/dist/esm/v3/wait.d.ts +218 -3
- package/dist/esm/v3/wait.js +431 -7
- package/dist/esm/v3/wait.js.map +1 -1
- package/dist/esm/v3/webhookWaiters.d.ts +80 -0
- package/dist/esm/v3/webhookWaiters.js +149 -0
- package/dist/esm/v3/webhookWaiters.js.map +1 -0
- package/dist/esm/v3/webhooks.d.ts +192 -2
- package/dist/esm/v3/webhooks.js +336 -2
- package/dist/esm/v3/webhooks.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai/observability.mdx +174 -0
- package/docs/ai/prompts.mdx +426 -0
- package/docs/ai-chat/actions.mdx +148 -0
- package/docs/ai-chat/anatomy.mdx +87 -0
- package/docs/ai-chat/backend.mdx +933 -0
- package/docs/ai-chat/background-injection.mdx +320 -0
- package/docs/ai-chat/changelog.mdx +958 -0
- package/docs/ai-chat/chat-local.mdx +170 -0
- package/docs/ai-chat/client-protocol.mdx +1091 -0
- package/docs/ai-chat/compaction.mdx +413 -0
- package/docs/ai-chat/custom-agents.mdx +545 -0
- package/docs/ai-chat/error-handling.mdx +379 -0
- package/docs/ai-chat/fast-starts.mdx +764 -0
- package/docs/ai-chat/frontend.mdx +634 -0
- package/docs/ai-chat/how-it-works.mdx +226 -0
- package/docs/ai-chat/lifecycle-hooks.mdx +532 -0
- package/docs/ai-chat/mcp.mdx +97 -0
- package/docs/ai-chat/migrating-from-a-route-handler.mdx +594 -0
- package/docs/ai-chat/migrating-from-hydrate-messages.mdx +299 -0
- package/docs/ai-chat/overview.mdx +86 -0
- package/docs/ai-chat/patterns/branching-conversations.mdx +145 -0
- package/docs/ai-chat/patterns/code-sandbox.mdx +122 -0
- package/docs/ai-chat/patterns/database-persistence.mdx +425 -0
- package/docs/ai-chat/patterns/human-in-the-loop.mdx +281 -0
- package/docs/ai-chat/patterns/large-payloads.mdx +165 -0
- package/docs/ai-chat/patterns/native-compaction.mdx +310 -0
- package/docs/ai-chat/patterns/oom-resilience.mdx +116 -0
- package/docs/ai-chat/patterns/persistence-and-replay.mdx +218 -0
- package/docs/ai-chat/patterns/recovery-boot.mdx +233 -0
- package/docs/ai-chat/patterns/redacting-telemetry.mdx +117 -0
- package/docs/ai-chat/patterns/skills.mdx +214 -0
- package/docs/ai-chat/patterns/sub-agents.mdx +412 -0
- package/docs/ai-chat/patterns/tool-result-auditing.mdx +145 -0
- package/docs/ai-chat/patterns/trusted-edge-signals.mdx +333 -0
- package/docs/ai-chat/patterns/version-upgrades.mdx +261 -0
- package/docs/ai-chat/pending-messages.mdx +363 -0
- package/docs/ai-chat/prompt-caching.mdx +204 -0
- package/docs/ai-chat/quick-start.mdx +163 -0
- package/docs/ai-chat/reference.mdx +1071 -0
- package/docs/ai-chat/server-chat.mdx +259 -0
- package/docs/ai-chat/sessions.mdx +334 -0
- package/docs/ai-chat/side-channels.mdx +172 -0
- package/docs/ai-chat/testing.mdx +691 -0
- package/docs/ai-chat/tools.mdx +192 -0
- package/docs/ai-chat/transcript-storage.mdx +247 -0
- package/docs/ai-chat/types.mdx +242 -0
- package/docs/ai-chat/upgrade-guide.mdx +511 -0
- package/docs/apikeys.mdx +170 -0
- package/docs/billing-limits.mdx +73 -0
- package/docs/building-with-ai.mdx +261 -0
- package/docs/bulk-actions.mdx +77 -0
- package/docs/changelog.mdx +6 -0
- package/docs/cli-deploy-commands.mdx +9 -0
- package/docs/cli-dev-commands.mdx +9 -0
- package/docs/cli-env-commands.mdx +115 -0
- package/docs/cli-init-commands.mdx +84 -0
- package/docs/cli-introduction.mdx +25 -0
- package/docs/cli-list-profiles-commands.mdx +42 -0
- package/docs/cli-login-commands.mdx +53 -0
- package/docs/cli-logout-commands.mdx +33 -0
- package/docs/cli-preview-archive.mdx +59 -0
- package/docs/cli-projects-commands.mdx +74 -0
- package/docs/cli-promote-commands.mdx +9 -0
- package/docs/cli-runs-commands.mdx +95 -0
- package/docs/cli-switch.mdx +43 -0
- package/docs/cli-tasks-commands.mdx +95 -0
- package/docs/cli-update-commands.mdx +48 -0
- package/docs/cli-whoami-commands.mdx +45 -0
- package/docs/community.mdx +6 -0
- package/docs/concurrency.mdx +416 -0
- package/docs/config/config-file.mdx +662 -0
- package/docs/config/extensions/additionalFiles.mdx +38 -0
- package/docs/config/extensions/additionalPackages.mdx +40 -0
- package/docs/config/extensions/aptGet.mdx +34 -0
- package/docs/config/extensions/audioWaveform.mdx +23 -0
- package/docs/config/extensions/custom.mdx +393 -0
- package/docs/config/extensions/emitDecoratorMetadata.mdx +52 -0
- package/docs/config/extensions/esbuildPlugin.mdx +31 -0
- package/docs/config/extensions/ffmpeg.mdx +45 -0
- package/docs/config/extensions/lightpanda.mdx +56 -0
- package/docs/config/extensions/overview.mdx +69 -0
- package/docs/config/extensions/playwright.mdx +195 -0
- package/docs/config/extensions/prismaExtension.mdx +1013 -0
- package/docs/config/extensions/puppeteer.mdx +28 -0
- package/docs/config/extensions/pythonExtension.mdx +190 -0
- package/docs/config/extensions/syncEnvVars.mdx +330 -0
- package/docs/context.mdx +235 -0
- package/docs/database-connections.mdx +213 -0
- package/docs/deploy-environment-variables.mdx +466 -0
- package/docs/deployment/atomic-deployment.mdx +470 -0
- package/docs/deployment/dev-branches.mdx +92 -0
- package/docs/deployment/overview.mdx +260 -0
- package/docs/deployment/preview-branches.mdx +227 -0
- package/docs/errors-retrying.mdx +383 -0
- package/docs/github-actions.mdx +260 -0
- package/docs/github-integration.mdx +148 -0
- package/docs/github-repo.mdx +8 -0
- package/docs/help-email.mdx +6 -0
- package/docs/help-slack.mdx +12 -0
- package/docs/hidden-tasks.mdx +56 -0
- package/docs/how-it-works.mdx +454 -0
- package/docs/how-to-reduce-your-spend.mdx +211 -0
- package/docs/idempotency.mdx +542 -0
- package/docs/introduction.mdx +135 -0
- package/docs/limits.mdx +284 -0
- package/docs/logging.mdx +195 -0
- package/docs/machines.mdx +952 -0
- package/docs/manual-setup.mdx +632 -0
- package/docs/mcp-agent-rules.mdx +41 -0
- package/docs/mcp-introduction.mdx +386 -0
- package/docs/mcp-tools.mdx +425 -0
- package/docs/migrating-from-v3.mdx +332 -0
- package/docs/observability/dashboards.mdx +166 -0
- package/docs/observability/query.mdx +614 -0
- package/docs/open-source-contributing.mdx +16 -0
- package/docs/private-networking/aws-console-setup.mdx +304 -0
- package/docs/private-networking/overview.mdx +144 -0
- package/docs/private-networking/troubleshooting.mdx +78 -0
- package/docs/queues.mdx +271 -0
- package/docs/quick-start.mdx +60 -0
- package/docs/realtime/auth.mdx +228 -0
- package/docs/realtime/backend/input-streams.mdx +159 -0
- package/docs/realtime/backend/overview.mdx +45 -0
- package/docs/realtime/backend/streams.mdx +433 -0
- package/docs/realtime/backend/subscribe.mdx +225 -0
- package/docs/realtime/how-it-works.mdx +94 -0
- package/docs/realtime/overview.mdx +63 -0
- package/docs/realtime/react-hooks/overview.mdx +73 -0
- package/docs/realtime/react-hooks/session-stream.mdx +126 -0
- package/docs/realtime/react-hooks/streams.mdx +517 -0
- package/docs/realtime/react-hooks/subscribe.mdx +690 -0
- package/docs/realtime/react-hooks/swr.mdx +87 -0
- package/docs/realtime/react-hooks/triggering.mdx +194 -0
- package/docs/realtime/react-hooks/use-wait-token.mdx +34 -0
- package/docs/realtime/run-object.mdx +197 -0
- package/docs/replaying.mdx +97 -0
- package/docs/reports.mdx +159 -0
- package/docs/request-feature.mdx +6 -0
- package/docs/roadmap.mdx +6 -0
- package/docs/run-tests.mdx +21 -0
- package/docs/run-usage.mdx +113 -0
- package/docs/runs/bulk-actions.mdx +183 -0
- package/docs/runs/heartbeats.mdx +38 -0
- package/docs/runs/list-best-practices.mdx +234 -0
- package/docs/runs/max-duration.mdx +143 -0
- package/docs/runs/metadata.mdx +731 -0
- package/docs/runs/priority.mdx +8 -0
- package/docs/runs.mdx +406 -0
- package/docs/self-hosting/docker.mdx +512 -0
- package/docs/self-hosting/env/supervisor.mdx +78 -0
- package/docs/self-hosting/env/webapp.mdx +305 -0
- package/docs/self-hosting/kubernetes.mdx +725 -0
- package/docs/self-hosting/overview.mdx +145 -0
- package/docs/self-hosting/security.mdx +67 -0
- package/docs/skills.mdx +85 -0
- package/docs/tags.mdx +126 -0
- package/docs/tasks/overview.mdx +695 -0
- package/docs/tasks/scheduled.mdx +479 -0
- package/docs/tasks/schemaTask.mdx +413 -0
- package/docs/tasks/streams.mdx +887 -0
- package/docs/triggering.mdx +1340 -0
- package/docs/troubleshooting-alerts.mdx +607 -0
- package/docs/troubleshooting-debugging-in-vscode.mdx +9 -0
- package/docs/troubleshooting-github-issues.mdx +6 -0
- package/docs/troubleshooting-uptime-status.mdx +7 -0
- package/docs/troubleshooting-zod.mdx +158 -0
- package/docs/troubleshooting.mdx +414 -0
- package/docs/upgrading-packages.mdx +80 -0
- package/docs/vercel-integration.mdx +250 -0
- package/docs/versioning.mdx +58 -0
- package/docs/video-walkthrough.mdx +23 -0
- package/docs/wait-for-token.mdx +540 -0
- package/docs/wait-for.mdx +42 -0
- package/docs/wait-until.mdx +53 -0
- package/docs/wait.mdx +18 -0
- package/docs/webhooks/channels.mdx +154 -0
- package/docs/webhooks/connect.mdx +91 -0
- package/docs/webhooks/deliveries.mdx +99 -0
- package/docs/webhooks/filters.mdx +146 -0
- package/docs/webhooks/human-in-the-loop.mdx +158 -0
- package/docs/webhooks/linear.mdx +186 -0
- package/docs/webhooks/overview.mdx +115 -0
- package/docs/webhooks/session-routing.mdx +141 -0
- package/docs/webhooks/slack.mdx +393 -0
- package/docs/webhooks/sources.mdx +250 -0
- package/docs/webhooks/waiters.mdx +190 -0
- package/docs/writing-tasks-introduction.mdx +34 -0
- package/package.json +143 -42
- package/skills/trigger-authoring-chat-agent/SKILL.md +308 -0
- package/skills/trigger-authoring-tasks/SKILL.md +254 -0
- package/skills/trigger-chat-agent-advanced/SKILL.md +403 -0
- package/skills/trigger-cost-savings/SKILL.md +116 -0
- package/skills/trigger-realtime-and-frontend/SKILL.md +276 -0
- package/dist/commonjs/apiClient.d.ts +0 -727
- package/dist/commonjs/apiClient.js +0 -692
- package/dist/commonjs/apiClient.js.map +0 -1
- package/dist/commonjs/concurrencyLimit.d.ts +0 -10
- package/dist/commonjs/concurrencyLimit.js +0 -17
- package/dist/commonjs/concurrencyLimit.js.map +0 -1
- package/dist/commonjs/errors.d.ts +0 -66
- package/dist/commonjs/errors.js +0 -109
- package/dist/commonjs/errors.js.map +0 -1
- package/dist/commonjs/httpEndpoint.d.ts +0 -87
- package/dist/commonjs/httpEndpoint.js +0 -130
- package/dist/commonjs/httpEndpoint.js.map +0 -1
- package/dist/commonjs/index.d.ts +0 -23
- package/dist/commonjs/index.js +0 -55
- package/dist/commonjs/index.js.map +0 -1
- package/dist/commonjs/integrations.d.ts +0 -11
- package/dist/commonjs/integrations.js.map +0 -1
- package/dist/commonjs/io.d.ts +0 -441
- package/dist/commonjs/io.js +0 -1165
- package/dist/commonjs/io.js.map +0 -1
- package/dist/commonjs/ioWithIntegrations.d.ts +0 -4
- package/dist/commonjs/ioWithIntegrations.js +0 -32
- package/dist/commonjs/ioWithIntegrations.js.map +0 -1
- package/dist/commonjs/job.d.ts +0 -96
- package/dist/commonjs/job.js +0 -210
- package/dist/commonjs/job.js.map +0 -1
- package/dist/commonjs/retry.d.ts +0 -20
- package/dist/commonjs/retry.js +0 -22
- package/dist/commonjs/retry.js.map +0 -1
- package/dist/commonjs/runLocalStorage.d.ts +0 -8
- package/dist/commonjs/runLocalStorage.js +0 -6
- package/dist/commonjs/runLocalStorage.js.map +0 -1
- package/dist/commonjs/security.d.ts +0 -18
- package/dist/commonjs/security.js +0 -41
- package/dist/commonjs/security.js.map +0 -1
- package/dist/commonjs/status.d.ts +0 -19
- package/dist/commonjs/status.js +0 -38
- package/dist/commonjs/status.js.map +0 -1
- package/dist/commonjs/store/keyValueStore.d.ts +0 -17
- package/dist/commonjs/store/keyValueStore.js +0 -138
- package/dist/commonjs/store/keyValueStore.js.map +0 -1
- package/dist/commonjs/store/keyValueStoreClient.d.ts +0 -19
- package/dist/commonjs/store/keyValueStoreClient.js +0 -65
- package/dist/commonjs/store/keyValueStoreClient.js.map +0 -1
- package/dist/commonjs/triggerClient.d.ts +0 -290
- package/dist/commonjs/triggerClient.js +0 -1366
- package/dist/commonjs/triggerClient.js.map +0 -1
- package/dist/commonjs/triggers/dynamic.d.ts +0 -56
- package/dist/commonjs/triggers/dynamic.js +0 -97
- package/dist/commonjs/triggers/dynamic.js.map +0 -1
- package/dist/commonjs/triggers/eventTrigger.d.ts +0 -58
- package/dist/commonjs/triggers/eventTrigger.js +0 -69
- package/dist/commonjs/triggers/eventTrigger.js.map +0 -1
- package/dist/commonjs/triggers/externalSource.d.ts +0 -148
- package/dist/commonjs/triggers/externalSource.js +0 -106
- package/dist/commonjs/triggers/externalSource.js.map +0 -1
- package/dist/commonjs/triggers/invokeTrigger.d.ts +0 -39
- package/dist/commonjs/triggers/invokeTrigger.js +0 -58
- package/dist/commonjs/triggers/invokeTrigger.js.map +0 -1
- package/dist/commonjs/triggers/notifications.d.ts +0 -111
- package/dist/commonjs/triggers/notifications.js +0 -101
- package/dist/commonjs/triggers/notifications.js.map +0 -1
- package/dist/commonjs/triggers/scheduled.d.ts +0 -145
- package/dist/commonjs/triggers/scheduled.js +0 -208
- package/dist/commonjs/triggers/scheduled.js.map +0 -1
- package/dist/commonjs/triggers/webhook.d.ts +0 -143
- package/dist/commonjs/triggers/webhook.js +0 -133
- package/dist/commonjs/triggers/webhook.js.map +0 -1
- package/dist/commonjs/typed-emitter.d.ts +0 -37
- package/dist/commonjs/typed-emitter.js +0 -3
- package/dist/commonjs/typed-emitter.js.map +0 -1
- package/dist/commonjs/types.d.ts +0 -204
- package/dist/commonjs/types.js +0 -23
- package/dist/commonjs/types.js.map +0 -1
- package/dist/commonjs/utils/formatSchemaErrors.d.ts +0 -3
- package/dist/commonjs/utils/formatSchemaErrors.js +0 -10
- package/dist/commonjs/utils/formatSchemaErrors.js.map +0 -1
- package/dist/commonjs/utils/typedAsyncLocalStorage.d.ts +0 -6
- package/dist/commonjs/utils/typedAsyncLocalStorage.js +0 -18
- package/dist/commonjs/utils/typedAsyncLocalStorage.js.map +0 -1
- package/dist/commonjs/utils.d.ts +0 -1
- package/dist/commonjs/utils.js +0 -11
- package/dist/commonjs/utils.js.map +0 -1
- package/dist/esm/apiClient.d.ts +0 -727
- package/dist/esm/apiClient.js +0 -687
- package/dist/esm/apiClient.js.map +0 -1
- package/dist/esm/concurrencyLimit.d.ts +0 -10
- package/dist/esm/concurrencyLimit.js +0 -13
- package/dist/esm/concurrencyLimit.js.map +0 -1
- package/dist/esm/errors.d.ts +0 -66
- package/dist/esm/errors.js +0 -95
- package/dist/esm/errors.js.map +0 -1
- package/dist/esm/httpEndpoint.d.ts +0 -87
- package/dist/esm/httpEndpoint.js +0 -125
- package/dist/esm/httpEndpoint.js.map +0 -1
- package/dist/esm/index.d.ts +0 -23
- package/dist/esm/index.js +0 -35
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/integrations.d.ts +0 -11
- package/dist/esm/integrations.js +0 -2
- package/dist/esm/integrations.js.map +0 -1
- package/dist/esm/io.d.ts +0 -441
- package/dist/esm/io.js +0 -1159
- package/dist/esm/io.js.map +0 -1
- package/dist/esm/ioWithIntegrations.d.ts +0 -4
- package/dist/esm/ioWithIntegrations.js +0 -29
- package/dist/esm/ioWithIntegrations.js.map +0 -1
- package/dist/esm/job.d.ts +0 -96
- package/dist/esm/job.js +0 -206
- package/dist/esm/job.js.map +0 -1
- package/dist/esm/retry.d.ts +0 -20
- package/dist/esm/retry.js +0 -19
- package/dist/esm/retry.js.map +0 -1
- package/dist/esm/runLocalStorage.d.ts +0 -8
- package/dist/esm/runLocalStorage.js +0 -3
- package/dist/esm/runLocalStorage.js.map +0 -1
- package/dist/esm/security.d.ts +0 -18
- package/dist/esm/security.js +0 -34
- package/dist/esm/security.js.map +0 -1
- package/dist/esm/status.d.ts +0 -19
- package/dist/esm/status.js +0 -34
- package/dist/esm/status.js.map +0 -1
- package/dist/esm/store/keyValueStore.d.ts +0 -17
- package/dist/esm/store/keyValueStore.js +0 -134
- package/dist/esm/store/keyValueStore.js.map +0 -1
- package/dist/esm/store/keyValueStoreClient.d.ts +0 -19
- package/dist/esm/store/keyValueStoreClient.js +0 -61
- package/dist/esm/store/keyValueStoreClient.js.map +0 -1
- package/dist/esm/triggerClient.d.ts +0 -288
- package/dist/esm/triggerClient.js +0 -1359
- package/dist/esm/triggerClient.js.map +0 -1
- package/dist/esm/triggers/dynamic.d.ts +0 -56
- package/dist/esm/triggers/dynamic.js +0 -93
- package/dist/esm/triggers/dynamic.js.map +0 -1
- package/dist/esm/triggers/eventTrigger.d.ts +0 -58
- package/dist/esm/triggers/eventTrigger.js +0 -64
- package/dist/esm/triggers/eventTrigger.js.map +0 -1
- package/dist/esm/triggers/externalSource.d.ts +0 -148
- package/dist/esm/triggers/externalSource.js +0 -100
- package/dist/esm/triggers/externalSource.js.map +0 -1
- package/dist/esm/triggers/invokeTrigger.d.ts +0 -39
- package/dist/esm/triggers/invokeTrigger.js +0 -53
- package/dist/esm/triggers/invokeTrigger.js.map +0 -1
- package/dist/esm/triggers/notifications.d.ts +0 -111
- package/dist/esm/triggers/notifications.js +0 -94
- package/dist/esm/triggers/notifications.js.map +0 -1
- package/dist/esm/triggers/scheduled.d.ts +0 -145
- package/dist/esm/triggers/scheduled.js +0 -197
- package/dist/esm/triggers/scheduled.js.map +0 -1
- package/dist/esm/triggers/webhook.d.ts +0 -143
- package/dist/esm/triggers/webhook.js +0 -128
- package/dist/esm/triggers/webhook.js.map +0 -1
- package/dist/esm/typed-emitter.d.ts +0 -37
- package/dist/esm/typed-emitter.js +0 -2
- package/dist/esm/typed-emitter.js.map +0 -1
- package/dist/esm/types.d.ts +0 -204
- package/dist/esm/types.js +0 -19
- package/dist/esm/types.js.map +0 -1
- package/dist/esm/utils/formatSchemaErrors.d.ts +0 -3
- package/dist/esm/utils/formatSchemaErrors.js +0 -7
- package/dist/esm/utils/formatSchemaErrors.js.map +0 -1
- package/dist/esm/utils/typedAsyncLocalStorage.d.ts +0 -6
- package/dist/esm/utils/typedAsyncLocalStorage.js +0 -14
- package/dist/esm/utils/typedAsyncLocalStorage.js.map +0 -1
- package/dist/esm/utils.d.ts +0 -1
- package/dist/esm/utils.js +0 -8
- package/dist/esm/utils.js.map +0 -1
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Slack agents"
|
|
3
|
+
description: "Turn a chat.agent into a Slack agent: users message it in Slack, it shows its status while it works, streams its reply with its tool calls as a plan, asks for approvals, and stops on Slack's stop button."
|
|
4
|
+
sidebarTitle: "Slack agents"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**`slack()` from `@trigger.dev/slack` turns a `chat.agent` into a native Slack agent.** Each Slack agent session (a conversation with the agent, or a thread in a channel) becomes a durable Trigger.dev [session](/ai-chat/sessions). A message runs as a turn, the session shows the agent working, the reply streams into the thread as the model writes it, and Slack's stop button stops the turn.
|
|
8
|
+
|
|
9
|
+
```ts /trigger/support.ts
|
|
10
|
+
import { webhooks } from "@trigger.dev/sdk";
|
|
11
|
+
import { chat } from "@trigger.dev/sdk/ai";
|
|
12
|
+
import { appMentions, slack, webhookSource } from "@trigger.dev/slack";
|
|
13
|
+
import { anthropic } from "@ai-sdk/anthropic";
|
|
14
|
+
|
|
15
|
+
const slackEvents = webhooks.endpoint.define({ id: "slack", source: webhookSource() });
|
|
16
|
+
|
|
17
|
+
export const support = chat.agent({
|
|
18
|
+
id: "support",
|
|
19
|
+
channels: [
|
|
20
|
+
slack({
|
|
21
|
+
id: "slack",
|
|
22
|
+
endpoint: slackEvents,
|
|
23
|
+
token: process.env.SLACK_BOT_TOKEN!,
|
|
24
|
+
startOn: appMentions(),
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
tools: { searchDocs, refundOrder },
|
|
28
|
+
run: async ({ messages, tools, signal, streamText }) =>
|
|
29
|
+
streamText({ model: anthropic("claude-sonnet-4-5"), messages, tools, abortSignal: signal }),
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`run()` is the same function that answers a browser chat or a [Linear session](/webhooks/linear). Signature verification, Slack's `url_verification` handshake, retry dedup, per-thread state, status updates and streaming are handled by the connector.
|
|
34
|
+
|
|
35
|
+
## Setup
|
|
36
|
+
|
|
37
|
+
<Steps>
|
|
38
|
+
<Step title="Deploy the agent">
|
|
39
|
+
Declare the endpoint with `webhookSource()` from `@trigger.dev/slack` and pass it to `slack({ endpoint })`. Deploying registers the hosted [endpoint](/webhooks/connect) and gives you its URL.
|
|
40
|
+
</Step>
|
|
41
|
+
<Step title="Create the Slack app from a manifest">
|
|
42
|
+
At [api.slack.com/apps](https://api.slack.com/apps), create an app **From a manifest** and paste this, with the endpoint's URL in both request URLs:
|
|
43
|
+
|
|
44
|
+
```yaml manifest.yaml
|
|
45
|
+
display_information:
|
|
46
|
+
name: Support Agent
|
|
47
|
+
features:
|
|
48
|
+
bot_user:
|
|
49
|
+
display_name: Support Agent
|
|
50
|
+
always_online: true
|
|
51
|
+
app_home:
|
|
52
|
+
messages_tab_enabled: true
|
|
53
|
+
messages_tab_read_only_enabled: false
|
|
54
|
+
agent_view:
|
|
55
|
+
agent_description: Answers support questions and handles refunds.
|
|
56
|
+
oauth_config:
|
|
57
|
+
scopes:
|
|
58
|
+
bot:
|
|
59
|
+
- assistant:write
|
|
60
|
+
- chat:write
|
|
61
|
+
- files:read
|
|
62
|
+
- reactions:write
|
|
63
|
+
- im:history
|
|
64
|
+
- app_mentions:read
|
|
65
|
+
- channels:history
|
|
66
|
+
- groups:history
|
|
67
|
+
settings:
|
|
68
|
+
event_subscriptions:
|
|
69
|
+
request_url: https://your-endpoint-url
|
|
70
|
+
bot_events:
|
|
71
|
+
- message.im
|
|
72
|
+
- app_mention
|
|
73
|
+
- message.channels
|
|
74
|
+
- message.groups
|
|
75
|
+
- agent_session_stopped
|
|
76
|
+
interactivity:
|
|
77
|
+
is_enabled: true
|
|
78
|
+
request_url: https://your-endpoint-url
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`agent_view` makes the app an agent, `agent_session_stopped` turns on the stop button, interactivity delivers clicks on the agent's buttons, `files:read` lets the agent read the images and PDFs users share with it, `reactions:write` lets it mark a message it picked up mid-reply, and `app_mention` with `app_mentions:read` lets an @mention start a session in a channel (see [Channel threads](#channel-threads)). Drop `app_mention`, `message.channels`, `message.groups` and their scopes if the agent should only answer in its own conversations.
|
|
82
|
+
</Step>
|
|
83
|
+
<Step title="Connect the endpoint">
|
|
84
|
+
Paste the app's **Signing Secret** (Basic Information, App Credentials) as the endpoint's signing secret. Until it is set the endpoint rejects Slack's signed requests, so Slack shows the request URL as not verified: once the secret is in, click **Verify** on the app's Event Subscriptions page (or **Click here to verify** on the App Manifest page). Install the app to your workspace and pass the bot token (`xoxb-...`) as `token`. The endpoint's setup prompt walks an AI coding agent through these settings.
|
|
85
|
+
</Step>
|
|
86
|
+
<Step title="Try it">
|
|
87
|
+
Open the agent in Slack and send it a message. The session shows it working within a second, and the reply streams in. In a channel, invite the bot (`/invite @Support Agent`) and message it in a thread.
|
|
88
|
+
</Step>
|
|
89
|
+
</Steps>
|
|
90
|
+
|
|
91
|
+
## What Slack shows
|
|
92
|
+
|
|
93
|
+
| Moment | In Slack |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| A turn starts | The session's status is **processing**. On the first turn the session is titled with the prompt. |
|
|
96
|
+
| The model writes | The reply streams into the thread with `chat.startStream`, `chat.appendStream` and `chat.stopStream`, as markdown. |
|
|
97
|
+
| A tool is called | A task in the reply's plan, titled by the tool's `title` (or its name made readable), marked complete when the tool returns and failed if it throws. The plan reads "Working on it", then "Done", "Stopped" or "Waiting for approval" when the turn ends. |
|
|
98
|
+
| A tool needs a decision | Approve and Deny buttons, and the status is **suspended** (see [Approvals and buttons](#approvals-and-buttons)). |
|
|
99
|
+
| The turn fails | The reply ends with "Something went wrong answering this. Try again." (`errorMessage` changes it). The error is logged on the run. |
|
|
100
|
+
| The turn ends | The status goes back to **active**, whether it answered, stopped, failed or had nothing to say. |
|
|
101
|
+
| `chat.close()` | The status is **closed**. |
|
|
102
|
+
|
|
103
|
+
Set `title` to name the session yourself; return null to keep Slack's own. A title the user sets in Slack is never overwritten. Slack drops a processing status after an hour, so a longer turn re-sends it every 50 minutes. Give a tool a readable task title with the AI SDK's `tool({ title: "Search the archive", ... })`; without one the task shows the tool's name made readable (`searchArchive` shows "Search archive"). `progress: "tasks"` shows one task card per call between the reply's text instead of a plan, `progress: "off"` streams the reply without them, and `delivery: "final"` posts the whole reply once the turn ends instead of streaming it.
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
slack({
|
|
107
|
+
id: "slack",
|
|
108
|
+
endpoint: slackEvents,
|
|
109
|
+
token,
|
|
110
|
+
startOn: appMentions(),
|
|
111
|
+
title: (prompt) => `Support: ${prompt.slice(0, 80)}`,
|
|
112
|
+
});
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
If a streaming request fails in a way that leaves its outcome unknown (a timeout or a dropped connection), the connector does not retry it, since Slack may already have shown that text. It closes the stream and posts the rest of the reply as its own message, so nothing is lost, at the cost of possibly repeating one batch. If that post fails too, the whole reply is posted again as a normal message. Rate limits wait out `Retry-After` and resend the same batch. If the worker running a turn dies mid-stream, the next worker closes that stream with a short "Interrupted" note before it picks the conversation back up.
|
|
116
|
+
|
|
117
|
+
## Approvals and buttons
|
|
118
|
+
|
|
119
|
+
A tool with no `execute` pauses the turn until the user answers it in Slack. By default `slack()` posts Approve and Deny buttons, and a click resolves the tool to `{ approved: boolean }`, collapses the buttons to the decision and resumes the turn. See [human-in-the-loop](/webhooks/human-in-the-loop) for the tool definition.
|
|
120
|
+
|
|
121
|
+
`approval` replaces those buttons for every such tool. Build buttons with `button()`, whose `output` is what the click resolves the tool to:
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
slack({
|
|
125
|
+
id: "slack",
|
|
126
|
+
endpoint: slackEvents,
|
|
127
|
+
token,
|
|
128
|
+
startOn: appMentions(),
|
|
129
|
+
approval: (call, { button }) => ({
|
|
130
|
+
text: `Run ${call.toolName}?`,
|
|
131
|
+
blocks: [
|
|
132
|
+
{ type: "section", text: { type: "mrkdwn", text: `Run \`${call.toolName}\`?` } },
|
|
133
|
+
{
|
|
134
|
+
type: "actions",
|
|
135
|
+
elements: [
|
|
136
|
+
button({ text: "Ship it", style: "primary", output: { approved: true } }),
|
|
137
|
+
button({ text: "Not now", output: { approved: false } }),
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
}),
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`interactions` gives a single tool its own UI, keyed by tool name, so a tool can ask the user to pick, rate or choose and continue with the answer:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
export const moji = chat.agent({
|
|
149
|
+
id: "moji",
|
|
150
|
+
channels: [
|
|
151
|
+
slack({
|
|
152
|
+
id: "slack",
|
|
153
|
+
endpoint: slackEvents,
|
|
154
|
+
token,
|
|
155
|
+
startOn: appMentions(),
|
|
156
|
+
interactions: {
|
|
157
|
+
pickEmoji: (call, { button }) => {
|
|
158
|
+
const { options } = call.input as { options: { name: string }[] };
|
|
159
|
+
return {
|
|
160
|
+
text: "Pick one",
|
|
161
|
+
blocks: [
|
|
162
|
+
{ type: "section", text: { type: "mrkdwn", text: "Which one should I add?" } },
|
|
163
|
+
{
|
|
164
|
+
type: "actions",
|
|
165
|
+
elements: options.map((o) => button({ text: `:${o.name}:`, output: { picked: o.name } })),
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
};
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
}),
|
|
172
|
+
],
|
|
173
|
+
tools: {
|
|
174
|
+
pickEmoji: tool({
|
|
175
|
+
description: "Ask the user to pick one of the generated emoji",
|
|
176
|
+
inputSchema: z.object({ options: z.array(z.object({ name: z.string() })) }),
|
|
177
|
+
outputSchema: z.object({ picked: z.string() }),
|
|
178
|
+
}),
|
|
179
|
+
addEmoji,
|
|
180
|
+
},
|
|
181
|
+
run: async ({ messages, tools, signal, streamText }) =>
|
|
182
|
+
streamText({ model, messages, tools, abortSignal: signal, stopWhen: stepCountIs(10) }),
|
|
183
|
+
});
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
The click resolves `pickEmoji` to `{ picked: "wizard" }`, the buttons collapse to the choice, and the turn continues.
|
|
187
|
+
|
|
188
|
+
### Buttons that send the agent an action
|
|
189
|
+
|
|
190
|
+
Buttons that aren't answering a tool, such as follow-up questions, are built with `slackButton()` and posted with the surface's `post()`. A click reaches `onAction`, validated against `actionSchema` like a browser action, and returning `chat.turn(message)` answers it in the thread:
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
import { slackButton, type SlackRunSurface } from "@trigger.dev/slack";
|
|
194
|
+
|
|
195
|
+
export const support = chat.agent({
|
|
196
|
+
id: "support",
|
|
197
|
+
channels: [slack({ id: "slack", endpoint: slackEvents, token, startOn: appMentions() })],
|
|
198
|
+
actionSchema: z.object({ type: z.literal("ask"), question: z.string() }),
|
|
199
|
+
tools: {
|
|
200
|
+
offerFollowUps: tool({
|
|
201
|
+
description: "Offer the user up to three follow-up questions as buttons",
|
|
202
|
+
inputSchema: z.object({ questions: z.array(z.string()).max(3) }),
|
|
203
|
+
execute: async ({ questions }) => {
|
|
204
|
+
await chat.surface<SlackRunSurface>()?.post({
|
|
205
|
+
text: "Follow-up questions",
|
|
206
|
+
blocks: [
|
|
207
|
+
{
|
|
208
|
+
type: "actions",
|
|
209
|
+
elements: questions.map((question) =>
|
|
210
|
+
slackButton({ text: question, action: { type: "ask", question } })
|
|
211
|
+
),
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
});
|
|
215
|
+
return "offered";
|
|
216
|
+
},
|
|
217
|
+
}),
|
|
218
|
+
},
|
|
219
|
+
onAction: async ({ action }) => chat.turn(action.question),
|
|
220
|
+
run: async ({ messages, tools, signal, streamText }) =>
|
|
221
|
+
streamText({ model, messages, tools, abortSignal: signal, stopWhen: stepCountIs(10) }),
|
|
222
|
+
});
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
`onAction` also gets the click itself as `channel.event`, typed with `SlackBlockActions`: who clicked, and the message the button was on. An action doesn't have to answer; return nothing to only do work. Here `actionSchema` accepts a `pick` action alongside `ask`:
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
import type { SlackBlockActions } from "@trigger.dev/slack";
|
|
229
|
+
|
|
230
|
+
actionSchema: z.discriminatedUnion("type", [
|
|
231
|
+
z.object({ type: z.literal("ask"), question: z.string() }),
|
|
232
|
+
z.object({ type: z.literal("pick"), name: z.string() }),
|
|
233
|
+
]),
|
|
234
|
+
onAction: async ({ action, channel }) => {
|
|
235
|
+
const click = channel?.event as SlackBlockActions | undefined;
|
|
236
|
+
if (action.type === "pick") {
|
|
237
|
+
await addEmoji.trigger({ name: action.name, pickedBy: click?.user?.id });
|
|
238
|
+
return; // no turn
|
|
239
|
+
}
|
|
240
|
+
return chat.turn(action.question);
|
|
241
|
+
},
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Only buttons built with `button()` or `slackButton()` reach the agent. Buttons your own code builds by hand go to a [`webhook()`](/webhooks/overview) subscribed to the same endpoint, and never start a turn.
|
|
245
|
+
|
|
246
|
+
## Stopping
|
|
247
|
+
|
|
248
|
+
Slack shows a stop button while the agent is working. It aborts the running turn through the run's `signal`, exactly like a browser chat's stop: the model call and any tool that honours the signal stop, the partial reply stays in the thread, and the status goes back to active. The next message continues the conversation.
|
|
249
|
+
|
|
250
|
+
- A stop pressed while nothing is running does nothing, and a repeated or delayed stop never stops a later turn.
|
|
251
|
+
- A stop that reaches a session waiting on an approval cancels it: the buttons are replaced with "Stopped", the pending tool call is recorded as stopped so the model sees that on the next turn, and a later click resumes nothing.
|
|
252
|
+
- Stopping cannot undo what already happened. A tool that finished before the stop has had its effect.
|
|
253
|
+
|
|
254
|
+
## Channel threads
|
|
255
|
+
|
|
256
|
+
`startOn` is required: it decides which channel messages start a session. Pass `appMentions()` to have the agent answer only when it is @mentioned. A mention in a channel starts a session and the agent answers in a thread under it, then follows the rest of that thread without being mentioned again. `startOn` only applies to channels: a message in the agent's own conversation always starts a session.
|
|
257
|
+
|
|
258
|
+
```ts
|
|
259
|
+
import { slack, appMentions } from "@trigger.dev/slack";
|
|
260
|
+
|
|
261
|
+
slack({ id: "slack", endpoint: slackEvents, token, startOn: appMentions() });
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
`appMentions()` uses Slack's `app_mention` event, so the app needs the `app_mention` bot event and the `app_mentions:read` scope (both in the manifest above), and no bot user id. Slack also delivers each mention as an ordinary channel message; the connector ignores that copy, so one mention runs one turn.
|
|
265
|
+
|
|
266
|
+
What each value does:
|
|
267
|
+
|
|
268
|
+
| `startOn` | The agent starts a session in a channel |
|
|
269
|
+
| --- | --- |
|
|
270
|
+
| `appMentions()` | When it is @mentioned (recommended). |
|
|
271
|
+
| `mentions("U012BOT")` | When a message mentions that bot user id, from message events, without the `app_mention` subscription. |
|
|
272
|
+
| `"event.event.type == 'message'"` | On every message it can see. |
|
|
273
|
+
| `"event.event.channel_type == 'im'"` | Never: it answers only in its own conversation. |
|
|
274
|
+
|
|
275
|
+
In a channel shared with another organization through Slack Connect, pass `ownWorkspaceOnly: true` to answer only people from your own workspace. Messages, mentions and button clicks from the other organization's users are dropped before they reach the agent. In Enterprise Grid this also drops users whose home workspace is another workspace in the org.
|
|
276
|
+
|
|
277
|
+
When someone mentions the agent partway through a thread, `seedFromThread: true` loads the thread's earlier replies into the new session first, so the agent answers with the context a reader of the thread has. It loads the history once, on the session's first turn, paging through `conversations.replies` and keeping the newest 50 replies (`{ limit }` changes that). Slack limits new commercially distributed apps outside the Marketplace to 15 replies per call and one call a minute, so such an app may only get the thread's first page; internal apps keep the normal limits. A rate limit keeps what was fetched rather than failing the turn.
|
|
278
|
+
|
|
279
|
+
## Messages sent while the agent is working
|
|
280
|
+
|
|
281
|
+
A message sent while the agent is still answering gets 👀 as soon as it arrives, so the user knows it was seen (`receivedReaction` changes the emoji, null turns it off). It then waits and runs as the next turn, in the order messages arrived. With [`pendingMessages`](/ai-chat/pending-messages) on the agent, it can be folded into the reply the agent is already writing instead: `shouldInject` decides at each step, and the message reaches the model before its next step. A message `shouldInject` declines still runs as its own turn.
|
|
282
|
+
|
|
283
|
+
```ts
|
|
284
|
+
export const support = chat.agent({
|
|
285
|
+
id: "support",
|
|
286
|
+
channels: [slack({ id: "slack", endpoint: slackEvents, token, startOn: appMentions() })],
|
|
287
|
+
pendingMessages: { shouldInject: () => true },
|
|
288
|
+
run: async ({ messages, signal, streamText }) =>
|
|
289
|
+
streamText({ model, messages, abortSignal: signal, stopWhen: stepCountIs(10) }),
|
|
290
|
+
});
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
A message is only folded in at a step boundary, so a reply that is one long model step with no tool calls finishes first and the message runs next. The stop button and button clicks are never folded in.
|
|
294
|
+
|
|
295
|
+
## Files
|
|
296
|
+
|
|
297
|
+
Images (PNG, JPEG, GIF, WebP) and PDFs that a user shares in the conversation reach the model with their message, including a file sent with no text. The transcript keeps each file's Slack URL, and the `streamText` given to `run()` downloads it with the bot token when the model reads it, once per run. An image over 5 MB is sent as its largest Slack thumbnail.
|
|
298
|
+
|
|
299
|
+
Other file types, files over 20 MB, and files the app can't read (deleted, or shared from another workspace) reach the model as a one-line note naming the file, so it can say it can't open them. A file that is deleted after it was shared becomes the same note on later turns, and the conversation carries on.
|
|
300
|
+
|
|
301
|
+
A custom `inbound` keeps file support by adding `slackFileParts()` to its message:
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
import { slackFileParts } from "@trigger.dev/slack";
|
|
305
|
+
|
|
306
|
+
inbound: (event) => ({
|
|
307
|
+
message: {
|
|
308
|
+
id: event.event?.ts ?? "",
|
|
309
|
+
role: "user",
|
|
310
|
+
parts: [{ type: "text", text: event.event?.text ?? "" }, ...slackFileParts(event.event?.files)],
|
|
311
|
+
},
|
|
312
|
+
}),
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
The download happens in the `streamText` passed to `run()`. A `streamText` imported from `ai` sends the Slack URL to the model as is, which the model can't open.
|
|
316
|
+
|
|
317
|
+
## Answering into the session from elsewhere
|
|
318
|
+
|
|
319
|
+
The first Slack message binds the session to its thread and to the user it is answering. A [`chat.event`](/webhooks/session-routing#answering-into-a-channel) action that returns `chat.turn()`, or a browser client on the same session, answers into that Slack thread with the same status, streaming and approval buttons.
|
|
320
|
+
|
|
321
|
+
## Slash commands
|
|
322
|
+
|
|
323
|
+
Slack posts a slash command as a form, which reaches subscribers as an object of its fields, and the endpoint acknowledges it with an empty `200` so Slack shows the user nothing until you reply. Give slash commands their own endpoint, typed with `SlackSlashCommand`, and set its URL as the command's Request URL under Slash Commands in the Slack app's settings. Use the same Signing Secret as the agent's endpoint. Reply through the command's `response_url`:
|
|
324
|
+
|
|
325
|
+
```ts /trigger/commands.ts
|
|
326
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
327
|
+
import { webhookSource, type SlackSlashCommand } from "@trigger.dev/slack";
|
|
328
|
+
|
|
329
|
+
const slackCommands = webhooks.endpoint.define({
|
|
330
|
+
id: "slack-commands",
|
|
331
|
+
source: webhookSource<SlackSlashCommand>(),
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
export const deployCommand = webhook({
|
|
335
|
+
id: "deploy-command",
|
|
336
|
+
endpoint: slackCommands,
|
|
337
|
+
filter: "event.command == '/deploy'",
|
|
338
|
+
onEvent: async ({ event }) => {
|
|
339
|
+
await fetch(event.response_url, {
|
|
340
|
+
method: "POST",
|
|
341
|
+
headers: { "content-type": "application/json" },
|
|
342
|
+
body: JSON.stringify({ response_type: "ephemeral", text: `Deploying ${event.text}` }),
|
|
343
|
+
});
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Any subscriber works here: a [`chat.event`](/webhooks/session-routing) keyed on `{event.channel_id}:{event.user_id}` routes a user's commands to one session, and a [waiter](/webhooks/waiters) can match on `event.command`.
|
|
349
|
+
|
|
350
|
+
## Block Kit replies
|
|
351
|
+
|
|
352
|
+
Replies are sent as markdown. For a reply that is posted rather than streamed (`delivery: "final"`), return `blocks` from `outbound` to post Block Kit. `toSlackBlocks()` splits markdown into `section` blocks under Slack's 3000-character limit, never inside a code fence:
|
|
353
|
+
|
|
354
|
+
```ts
|
|
355
|
+
import { slack, toSlackBlocks } from "@trigger.dev/slack";
|
|
356
|
+
|
|
357
|
+
slack({
|
|
358
|
+
id: "slack",
|
|
359
|
+
endpoint: slackEvents,
|
|
360
|
+
token,
|
|
361
|
+
startOn: appMentions(),
|
|
362
|
+
delivery: "final",
|
|
363
|
+
outbound: (reply) =>
|
|
364
|
+
reply.text
|
|
365
|
+
? {
|
|
366
|
+
text: reply.text.slice(0, 3000), // notification fallback
|
|
367
|
+
blocks: [{ type: "header", text: { type: "plain_text", text: "Support" } }, ...toSlackBlocks(reply.text)],
|
|
368
|
+
}
|
|
369
|
+
: null,
|
|
370
|
+
});
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## Options
|
|
374
|
+
|
|
375
|
+
| Option | Type | Description |
|
|
376
|
+
| --- | --- | --- |
|
|
377
|
+
| `id` | `string` | Connector id, unique per agent. |
|
|
378
|
+
| `endpoint` | endpoint | The Slack endpoint, declared with `webhooks.endpoint.define({ id, source: webhookSource() })`. `webhook()` tasks can subscribe to the same endpoint. |
|
|
379
|
+
| `token` | `string` or resolver | Bot token (`xoxb-...`), or a function of the event (its `team_id`) for multi-workspace apps. |
|
|
380
|
+
| `delivery` | `"stream"` or `"final"` | `"stream"` (default) streams the reply natively. `"final"` posts it once when the turn ends. |
|
|
381
|
+
| `title` | `(prompt, event) => string \| null` | The session title, set on its first turn. Defaults to the first line of the prompt. |
|
|
382
|
+
| `progress` | `"plan"`, `"tasks"` or `"off"` | How tool calls show in the streamed reply: one plan block (default), a task card per call, or none. Task titles come from each tool's `title`. |
|
|
383
|
+
| `startOn` | filter string | Required. Which channel messages start a session, usually `appMentions()` (see [Channel threads](#channel-threads)). Existing sessions always resume, and the agent's own conversation always starts one. Checked against the endpoint's event type. |
|
|
384
|
+
| `filter` | filter string | Extra [filter](/webhooks/filters) for message events, composed with the built-in guard that drops the bot's own messages. Checked against the endpoint's event type, like `webhook()`'s `filter`. |
|
|
385
|
+
| `key` | `string` | Session [key](/webhooks/session-routing) template. Defaults to one session per thread. |
|
|
386
|
+
| `seedFromThread` | `boolean` or `{ limit }` | Load a thread's earlier replies into a new session. Off by default. |
|
|
387
|
+
| `approval` | `(call, { button }) => message` | The UI for a tool with no `execute`. Defaults to Approve and Deny resolving to `{ approved }`. |
|
|
388
|
+
| `interactions` | `{ [toolName]: (call, { button }) => message }` | A tool's own UI; a click resolves the tool with the button's `output`. |
|
|
389
|
+
| `receivedReaction` | `string \| null` | Emoji added, on arrival, to a message sent while the agent is answering. Default `"eyes"`, null for none. |
|
|
390
|
+
| `errorMessage` | `string \| (ctx) => string` | What the reply shows when a turn fails, fixed or built from the failure ([details](/webhooks/channels#when-a-turn-fails)). Default "Something went wrong answering this. Try again." |
|
|
391
|
+
| `ownWorkspaceOnly` | `boolean` | Drop messages, mentions and button clicks from people outside the app's workspace, such as Slack Connect guests. Off by default. |
|
|
392
|
+
| `inbound` / `outbound` | functions | Map a Slack event to the turn, and a posted reply to a Slack message. |
|
|
393
|
+
| `apiBaseUrl` | `string` | Override the Slack Web API base, for testing against a mock. |
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Sources and verification"
|
|
3
|
+
description: "Choose an endpoint's source, configure verification, and type the event its subscribers receive."
|
|
4
|
+
sidebarTitle: "Sources & verification"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
An endpoint's `source` defines how Trigger.dev verifies requests and types the event every subscriber receives. Choose a named provider source or supply a verification configuration with `webhooks.custom()`.
|
|
8
|
+
|
|
9
|
+
## Presets
|
|
10
|
+
|
|
11
|
+
Presets supply the verification configuration, and most also carry the provider's part of the endpoint's [setup prompt](/webhooks/connect#set-it-up-with-an-ai-agent). Set the endpoint's signing secret or public key as described in [Connect a provider](/webhooks/connect).
|
|
12
|
+
|
|
13
|
+
<CodeGroup>
|
|
14
|
+
|
|
15
|
+
```ts /trigger/stripe.ts
|
|
16
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
17
|
+
|
|
18
|
+
export const stripe = webhooks.endpoint.define({ id: "stripe", source: webhooks.stripe() });
|
|
19
|
+
|
|
20
|
+
export const stripeEvents = webhook({
|
|
21
|
+
id: "stripe-events",
|
|
22
|
+
endpoint: stripe,
|
|
23
|
+
onEvent: async ({ event }) => {
|
|
24
|
+
if (event.type === "payment_intent.succeeded") {
|
|
25
|
+
console.log(event.id);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```ts /trigger/github.ts
|
|
32
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
33
|
+
|
|
34
|
+
export const github = webhooks.endpoint.define({ id: "github", source: webhooks.github() });
|
|
35
|
+
|
|
36
|
+
export const githubEvents = webhook({
|
|
37
|
+
id: "github-events",
|
|
38
|
+
endpoint: github,
|
|
39
|
+
onEvent: async ({ headers }) => {
|
|
40
|
+
// GitHub puts the event type in a header
|
|
41
|
+
console.log(headers.get("x-github-event"));
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```ts /trigger/svix.ts
|
|
47
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
48
|
+
|
|
49
|
+
export const svix = webhooks.endpoint.define({ id: "svix", source: webhooks.svix() });
|
|
50
|
+
|
|
51
|
+
export const svixEvents = webhook({
|
|
52
|
+
id: "svix-events",
|
|
53
|
+
endpoint: svix,
|
|
54
|
+
onEvent: async ({ event }) => {
|
|
55
|
+
console.log(event);
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```ts /trigger/composio.ts
|
|
61
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
62
|
+
|
|
63
|
+
export const composio = webhooks.endpoint.define({ id: "composio", source: webhooks.standardWebhooks() });
|
|
64
|
+
|
|
65
|
+
export const composioEvents = webhook({
|
|
66
|
+
id: "composio-events",
|
|
67
|
+
endpoint: composio,
|
|
68
|
+
onEvent: async ({ event }) => {
|
|
69
|
+
console.log(event);
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
</CodeGroup>
|
|
75
|
+
|
|
76
|
+
The available presets are `stripe()`, `github()`, `svix()`, `standardWebhooks()`, `square()`, and `discord()`.
|
|
77
|
+
|
|
78
|
+
### Svix and Standard Webhooks
|
|
79
|
+
|
|
80
|
+
`svix()` and `standardWebhooks()` use HMAC-SHA256 over `id.timestamp.body` with a base64-encoded `whsec_` secret. Their header names differ:
|
|
81
|
+
|
|
82
|
+
| Source | Headers |
|
|
83
|
+
| --- | --- |
|
|
84
|
+
| `svix()` | `svix-id`, `svix-timestamp`, `svix-signature` |
|
|
85
|
+
| `standardWebhooks()` | `webhook-id`, `webhook-timestamp`, `webhook-signature` |
|
|
86
|
+
|
|
87
|
+
Named sources such as `webhooks.clerk()` and `webhooks.composio()` select the corresponding configuration.
|
|
88
|
+
|
|
89
|
+
## Named providers
|
|
90
|
+
|
|
91
|
+
Each function below returns a source with its provider's verification configuration. Call it through `webhooks`, for example `webhooks.calCom()`.
|
|
92
|
+
|
|
93
|
+
| Verification | Source functions |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| Svix | `clerk()`, `resend()`, `brex()`, `autumn()` |
|
|
96
|
+
| Standard Webhooks | `openai()`, `replicate()`, `recallai()`, `composio()`, `loops()`, `granola()` |
|
|
97
|
+
| HMAC-SHA256 with `X-Hub-Signature-256` | `whatsapp()` |
|
|
98
|
+
| Shared secret in `X-Gitlab-Token` | `gitlab()` |
|
|
99
|
+
| Shared secret as `Authorization: Bearer` | `supabase()` |
|
|
100
|
+
| Hookdeck relay (HMAC-SHA256 with `X-Hookdeck-Signature`) | `hookdeck()` |
|
|
101
|
+
| Provider-specific HMAC | `calendly()`, `calCom()`, `sentry()`, `pagerduty()`, `vercel()`, `linear()`, `notion()`, `typeform()`, `docusign()`, `jira()`, `intercom()`, `zendesk()`, `attio()`, `workos()`, `elevenlabs()`, `vapi()`, `retell()`, `shopify()`, `metronome()`, `mux()`, `tailscale()`, `langfuse()`, `infisical()`, `planetscale()`, `plain()`, `firecrawl()` |
|
|
102
|
+
|
|
103
|
+
Provider IDs containing a hyphen use a camel case function name: the `cal-com` provider is `webhooks.calCom()`.
|
|
104
|
+
|
|
105
|
+
Supabase database webhooks aren't signed, so `supabase()` checks a shared secret instead. Generate the endpoint's secret on Trigger.dev, then add an `Authorization` header with the value `Bearer <secret>` under the webhook's HTTP Headers in Supabase.
|
|
106
|
+
|
|
107
|
+
Slack also ships as a chat channel in `@trigger.dev/slack`.
|
|
108
|
+
|
|
109
|
+
### Hookdeck
|
|
110
|
+
|
|
111
|
+
`hookdeck()` verifies requests that a [Hookdeck](https://hookdeck.com) connection forwards to the endpoint. Hookdeck forwards the original provider's body unchanged, so pass that provider's event type:
|
|
112
|
+
|
|
113
|
+
```ts /trigger/stripe-via-hookdeck.ts
|
|
114
|
+
import type Stripe from "stripe";
|
|
115
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
116
|
+
|
|
117
|
+
export const stripeViaHookdeck = webhooks.endpoint.define({
|
|
118
|
+
id: "stripe-via-hookdeck",
|
|
119
|
+
source: webhooks.hookdeck<Stripe.Event>(),
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export const paymentSucceeded = webhook({
|
|
123
|
+
id: "payment-succeeded",
|
|
124
|
+
endpoint: stripeViaHookdeck,
|
|
125
|
+
filter: "event.type == 'payment_intent.succeeded'",
|
|
126
|
+
onEvent: async ({ event }) => {
|
|
127
|
+
console.log(event.id);
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Use the endpoint URL as the connection's HTTP destination, keep the destination's authentication on Hookdeck Signature (the default for new destinations), and store the Hookdeck project's signing secret from **Settings > Secrets** as the endpoint's signing secret.
|
|
133
|
+
|
|
134
|
+
- **Secret rotation:** when you roll the signing secret in Hookdeck with an expiry, Hookdeck also signs each request with the previous secret in `X-Hookdeck-Signature-2`, so deliveries keep verifying until you store the new secret.
|
|
135
|
+
- **Deduplication:** retries dedupe on `X-Hookdeck-Eventid`, which is the same on every attempt of a Hookdeck event.
|
|
136
|
+
- **Custom header prefix:** if you changed the header prefix in the Hookdeck project's settings, pass it with `webhooks.hookdeck({ headerPrefix: "x-acme" })`. The prefix renames the event id header; the signature headers keep the `X-Hookdeck-` name.
|
|
137
|
+
|
|
138
|
+
## Endpoint validation
|
|
139
|
+
|
|
140
|
+
Some sources also define a response for the provider's endpoint-validation request. These requests don't create deliveries or task runs.
|
|
141
|
+
|
|
142
|
+
`discord()` answers a verified `{ type: 0 }` PING with HTTP `204` and no body. It also returns `204` for accepted events and `401` for invalid signatures. Set the Discord application's public key as the endpoint's verification credential.
|
|
143
|
+
|
|
144
|
+
Slack's `url_verification` challenge is handled the same way by `@trigger.dev/slack`.
|
|
145
|
+
|
|
146
|
+
`whatsapp()` answers Meta's GET verification request when `hub.mode` is `subscribe` and `hub.verify_token` matches the endpoint's verify token. It returns `hub.challenge` as text. The verify token is separate from the App Secret used to verify event signatures; see [Verify a WhatsApp endpoint URL](/webhooks/connect#verify-a-whatsapp-endpoint-url). Endpoints without GET verification return `405` to GET requests.
|
|
147
|
+
|
|
148
|
+
## Custom providers
|
|
149
|
+
|
|
150
|
+
`webhooks.custom()` accepts a verification configuration. This source verifies an HMAC-SHA256 signature over the raw body in `x-webhook-signature` and uses the event's `id` for deduplication:
|
|
151
|
+
|
|
152
|
+
```ts /trigger/internal.ts
|
|
153
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
154
|
+
|
|
155
|
+
export const internal = webhooks.endpoint.define({
|
|
156
|
+
id: "internal",
|
|
157
|
+
source: webhooks.custom<{ id: string; message: string }>(
|
|
158
|
+
{
|
|
159
|
+
scheme: "hmac",
|
|
160
|
+
algorithm: "sha256",
|
|
161
|
+
encoding: "hex",
|
|
162
|
+
signatureHeader: "x-webhook-signature",
|
|
163
|
+
signingString: "raw",
|
|
164
|
+
idempotencyField: { from: "body", name: "id" },
|
|
165
|
+
},
|
|
166
|
+
{ setupPrompt: "Add the URL under Settings > Webhooks in the admin app and paste the secret there." }
|
|
167
|
+
),
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
export const internalEvents = webhook({
|
|
171
|
+
id: "internal-events",
|
|
172
|
+
endpoint: internal,
|
|
173
|
+
onEvent: async ({ event }) => {
|
|
174
|
+
console.log(event.message);
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The optional `setupPrompt` is the provider-specific part of the endpoint's [setup prompt](/webhooks/connect#set-it-up-with-an-ai-agent): where the provider's webhook settings are and how to register a URL there. Trigger.dev adds the URL, the subscribers' filters and the signing secret steps around it.
|
|
180
|
+
|
|
181
|
+
### Form-encoded bodies
|
|
182
|
+
|
|
183
|
+
A verified body sent as `application/x-www-form-urlencoded` reaches subscribers as an object of its fields, so filters, `chat.event` keys and waiter `match` paths read form fields the way they read JSON fields. A repeated field becomes an array of its values. Slack slash commands and other providers that post forms work this way.
|
|
184
|
+
|
|
185
|
+
By default an accepted request gets a `200` with a small JSON receipt. Some providers show the response body to the user who triggered the request, so pass `response: { acceptedBody: "empty" }` to answer with an empty `200` instead:
|
|
186
|
+
|
|
187
|
+
```ts /trigger/forms.ts
|
|
188
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
189
|
+
|
|
190
|
+
export const forms = webhooks.endpoint.define({
|
|
191
|
+
id: "forms",
|
|
192
|
+
source: webhooks.custom<{ command: string; text: string; user_id: string }>(
|
|
193
|
+
{ scheme: "url-secret", placement: "query", paramName: "token" },
|
|
194
|
+
{ response: { acceptedBody: "empty" } }
|
|
195
|
+
),
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
export const commands = webhook({
|
|
199
|
+
id: "commands",
|
|
200
|
+
endpoint: forms,
|
|
201
|
+
filter: "event.command == '/deploy'",
|
|
202
|
+
onEvent: async ({ event }) => {
|
|
203
|
+
console.log(event.user_id, event.text);
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Typing the event
|
|
209
|
+
|
|
210
|
+
Stripe and GitHub sources provide default event shapes; other sources default to `unknown`. Pass an event type to the source function for typed handler parameters and autocomplete. This example uses `Stripe.Event` from the `stripe` package, which must be installed in your project:
|
|
211
|
+
|
|
212
|
+
```ts /trigger/stripe.ts
|
|
213
|
+
import type Stripe from "stripe";
|
|
214
|
+
import { webhook, webhooks } from "@trigger.dev/sdk";
|
|
215
|
+
|
|
216
|
+
export const stripe = webhooks.endpoint.define({ id: "stripe", source: webhooks.stripe<Stripe.Event>() });
|
|
217
|
+
|
|
218
|
+
export const stripeEvents = webhook({
|
|
219
|
+
id: "stripe-events",
|
|
220
|
+
endpoint: stripe,
|
|
221
|
+
onEvent: async ({ event }) => {
|
|
222
|
+
console.log(event.type, event.id);
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
For `webhooks.custom<T>()`, pass your own event type as `T`. The endpoint's event type flows to every subscriber: `webhook()` handlers, `chat.event` keys and filters, and [waiter](/webhooks/waiters) `match` paths are all checked against it.
|
|
228
|
+
|
|
229
|
+
<Note>
|
|
230
|
+
Event types are compile-time annotations. Signature verification doesn't validate the body against
|
|
231
|
+
a TypeScript type. Validate `event` inside `onEvent` if your handler needs runtime schema checks.
|
|
232
|
+
</Note>
|
|
233
|
+
|
|
234
|
+
## Verification schemes
|
|
235
|
+
|
|
236
|
+
Requests must pass verification before they reach any subscriber. Sources can check a signature or credential, enforce a timestamp tolerance, and derive an idempotency key for [deduplication](/webhooks/deliveries#deduplication). Verification failures return the source's rejected HTTP status (`400` by default).
|
|
237
|
+
|
|
238
|
+
Custom sources support these schemes:
|
|
239
|
+
|
|
240
|
+
| Scheme | Verification |
|
|
241
|
+
| --- | --- |
|
|
242
|
+
| `hmac` | Computes an HMAC over the raw body or a signing template and compares it with a request header. |
|
|
243
|
+
| `shared-secret` | Compares a static token supplied in a header, bearer token, basic authentication, or request body. |
|
|
244
|
+
| `url-secret` | Compares a token in a URL query parameter. Hosted endpoints don't support path placement. |
|
|
245
|
+
| `asymmetric` | Verifies an Ed25519, ECDSA, or RSA signature using the provider's public key. |
|
|
246
|
+
|
|
247
|
+
<Warning>
|
|
248
|
+
Query parameters can appear in access logs, proxies, and traces. Prefer a header-based scheme when
|
|
249
|
+
the provider supports one.
|
|
250
|
+
</Warning>
|