@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,388 @@
|
|
|
1
|
+
import type { UIMessage, UIMessageChunk } from "ai";
|
|
2
|
+
import type { LocalsKey, TranscriptSnapshotV2 } from "@trigger.dev/core/v3";
|
|
3
|
+
import { type MockTaskContextOptions } from "@trigger.dev/core/v3/test";
|
|
4
|
+
import { type ChatSnapshotV1 } from "../ai.js";
|
|
5
|
+
/** Pre-seed locals before the agent's `run()` starts. */
|
|
6
|
+
type SetupLocals = (locals: {
|
|
7
|
+
set<T>(key: LocalsKey<T>, value: T): void;
|
|
8
|
+
}) => void | Promise<void>;
|
|
9
|
+
/** A reference to a `chat.agent` task returned by `chat.agent({ id, ... })`. */
|
|
10
|
+
type ChatAgentHandle = {
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Options for `mockChatAgent`.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* A channel delivery to seed on the `session.in` tail for the next boot's replay, alongside browser
|
|
18
|
+
* messages, so a test can check that recovery dispatches both kinds in the order they arrived.
|
|
19
|
+
*/
|
|
20
|
+
export type SeededChannelDelivery = {
|
|
21
|
+
channelEvent: {
|
|
22
|
+
event: unknown;
|
|
23
|
+
connectorId?: string;
|
|
24
|
+
source?: string;
|
|
25
|
+
headers?: Record<string, string>;
|
|
26
|
+
deliveryId?: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export type MockChatAgentOptions = {
|
|
30
|
+
/** The chat session id passed into every wire payload. Defaults to `"test-chat"`. */
|
|
31
|
+
chatId?: string;
|
|
32
|
+
/** Client-provided metadata (`clientData`) for the session. */
|
|
33
|
+
clientData?: unknown;
|
|
34
|
+
/** Task context overrides passed through to {@link runInMockTaskContext}. */
|
|
35
|
+
taskContext?: MockTaskContextOptions;
|
|
36
|
+
/**
|
|
37
|
+
* Whether to start the task in preload mode. Defaults to `true` so the
|
|
38
|
+
* first `sendMessage()` triggers the first turn via the preload path.
|
|
39
|
+
* Set to `false` to skip preload — the first `sendMessage()` starts turn 0 directly.
|
|
40
|
+
*
|
|
41
|
+
* Ignored when `mode: "handover-prepare"` is set.
|
|
42
|
+
*/
|
|
43
|
+
preload?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Initial trigger the agent boots with. Defaults to `"preload"` (or
|
|
46
|
+
* `"submit-message"` when `preload: false`, or `"continuation"` when
|
|
47
|
+
* `continuation: true`).
|
|
48
|
+
*
|
|
49
|
+
* - `"preload"` — fresh chat preloaded via `transport.preload`. Fires
|
|
50
|
+
* `onPreload`, waits for the first message.
|
|
51
|
+
* - `"submit-message"` — fresh chat with the first message in the boot
|
|
52
|
+
* payload (the `chat.createStartSessionAction({ basePayload: { message } })`
|
|
53
|
+
* pattern). Goes straight to turn 0.
|
|
54
|
+
* - `"continuation"` — new run picking up an existing session after the
|
|
55
|
+
* prior run ended (`chat.endRun`, waitpoint timeout, `chat.requestUpgrade`).
|
|
56
|
+
* Boots with `trigger` omitted and `continuation: true` — mirrors what
|
|
57
|
+
* the server's `ensureRunForSession` / `swapSessionRun` produces in
|
|
58
|
+
* production. The SDK enters its continuation-wait branch; `onPreload`
|
|
59
|
+
* and `onChatStart` do NOT fire on this run.
|
|
60
|
+
* - `"handover-prepare"` — drives the chat.handover wait branch; call
|
|
61
|
+
* `sendHandover()` / `sendHandoverSkip()` to dispatch the handover signal.
|
|
62
|
+
*/
|
|
63
|
+
mode?: "preload" | "submit-message" | "handover-prepare" | "continuation";
|
|
64
|
+
/**
|
|
65
|
+
* First-turn UIMessage history shipped on the BOOT payload. Only
|
|
66
|
+
* meaningful with `mode: "handover-prepare"` — mirrors the
|
|
67
|
+
* `chat.headStart` route handler's `basePayload.headStartMessages`.
|
|
68
|
+
*/
|
|
69
|
+
headStartMessages?: UIMessage[];
|
|
70
|
+
/**
|
|
71
|
+
* Pre-seed the snapshot the agent reads at run boot. The runtime's
|
|
72
|
+
* snapshot read is replaced with one that returns this snapshot
|
|
73
|
+
* (skipping the real S3 GET). Use to drive boot scenarios — fresh
|
|
74
|
+
* boot with prior history, OOM-retry boot with stale snapshot, etc.
|
|
75
|
+
* Pass `undefined` (the default) to start with no snapshot.
|
|
76
|
+
*
|
|
77
|
+
* See plan section B.3 for the boot orchestration spec.
|
|
78
|
+
*/
|
|
79
|
+
snapshot?: ChatSnapshotV1 | TranscriptSnapshotV2;
|
|
80
|
+
/**
|
|
81
|
+
* Set `payload.continuation = true` on the initial wire payload. Used
|
|
82
|
+
* to simulate a continuation-run boot (a new run picking up after a
|
|
83
|
+
* prior run on the same session ended via `chat.endRun`, waitpoint
|
|
84
|
+
* timeout, or `chat.requestUpgrade`).
|
|
85
|
+
*
|
|
86
|
+
* Setting this without specifying `mode` auto-selects `mode:
|
|
87
|
+
* "continuation"` — the SDK boot path enters its continuation-wait
|
|
88
|
+
* branch and waits silently on `session.in` for the first user
|
|
89
|
+
* message. `onPreload` and `onChatStart` do NOT fire on this run.
|
|
90
|
+
*
|
|
91
|
+
* Defaults to `false` (fresh run).
|
|
92
|
+
*/
|
|
93
|
+
continuation?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Set `payload.previousRunId` on the initial wire payload. Forwarded
|
|
96
|
+
* to `onChatStart` / `onTurnStart` and used by the boot gate as a
|
|
97
|
+
* prior-state signal. Usually paired with `continuation: true`.
|
|
98
|
+
*/
|
|
99
|
+
previousRunId?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Callback that runs **before** the agent's `run()` is invoked, with a
|
|
102
|
+
* `set` function for pre-seeding locals. Use this to inject server-side
|
|
103
|
+
* dependencies (database clients, service stubs) that the agent reads
|
|
104
|
+
* via `locals.get()` in its hooks.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* import { dbKey } from "./db";
|
|
109
|
+
*
|
|
110
|
+
* const harness = mockChatAgent(agent, {
|
|
111
|
+
* chatId: "test-1",
|
|
112
|
+
* setupLocals: (locals) => {
|
|
113
|
+
* locals.set(dbKey, testDb);
|
|
114
|
+
* },
|
|
115
|
+
* });
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
setupLocals?: SetupLocals;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Result of a single turn, returned by driver methods like `sendMessage()`.
|
|
122
|
+
*/
|
|
123
|
+
export type MockChatAgentTurn = {
|
|
124
|
+
/** UIMessageChunks emitted during this turn (excludes control chunks like turn-complete). */
|
|
125
|
+
chunks: UIMessageChunk[];
|
|
126
|
+
/** All raw chunks including control chunks (turn-complete, upgrade-required, etc.). */
|
|
127
|
+
rawChunks: unknown[];
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Harness returned by `mockChatAgent`. Drives a `chat.agent` task end-to-end
|
|
131
|
+
* without network or task runtime.
|
|
132
|
+
*/
|
|
133
|
+
export type MockChatAgentHarness = {
|
|
134
|
+
/** The chat session id used by this harness. */
|
|
135
|
+
readonly chatId: string;
|
|
136
|
+
/**
|
|
137
|
+
* Send a single user message (or tool-approval-responded assistant
|
|
138
|
+
* message) and wait for the next turn-complete. Returns the chunks
|
|
139
|
+
* produced during this turn.
|
|
140
|
+
*
|
|
141
|
+
* Slim wire: at most ONE message per send. The agent reconstructs prior
|
|
142
|
+
* history from snapshot + session.out replay at run boot.
|
|
143
|
+
*/
|
|
144
|
+
sendMessage(message: UIMessage): Promise<MockChatAgentTurn>;
|
|
145
|
+
/**
|
|
146
|
+
* Send a regenerate signal (no message body — slim wire). The agent
|
|
147
|
+
* trims trailing assistant messages from its in-memory accumulator and
|
|
148
|
+
* re-runs. Waits for turn-complete.
|
|
149
|
+
*/
|
|
150
|
+
sendRegenerate(): Promise<MockChatAgentTurn>;
|
|
151
|
+
/**
|
|
152
|
+
* Drive the head-start path: sends `trigger: "handover-prepare"` with
|
|
153
|
+
* `headStartMessages` carrying the first-turn UIMessage history. Used
|
|
154
|
+
* only at the very first turn before any snapshot exists. The route
|
|
155
|
+
* handler ships full UIMessage history through this path because the
|
|
156
|
+
* customer's HTTP endpoint isn't subject to the `/in/append` cap.
|
|
157
|
+
*/
|
|
158
|
+
sendHeadStart(args: {
|
|
159
|
+
messages: UIMessage[];
|
|
160
|
+
}): Promise<MockChatAgentTurn>;
|
|
161
|
+
/** Send a custom action and wait for the next turn-complete. */
|
|
162
|
+
sendAction(action: unknown): Promise<MockChatAgentTurn>;
|
|
163
|
+
/**
|
|
164
|
+
* Deliver a `chat.event` webhook action: the `{ type, event, source, headers, deliveryId, externalDeliveryId }`
|
|
165
|
+
* envelope the hosted ingress appends to `session.in` with `actionSource: "webhook"`, so it
|
|
166
|
+
* bypasses `actionSchema` and reaches `onAction` typed by the listed events. Waits for the
|
|
167
|
+
* turn-complete the action (or the turn it becomes via `chat.turn()`) writes.
|
|
168
|
+
*/
|
|
169
|
+
sendWebhookAction(args: {
|
|
170
|
+
type: string;
|
|
171
|
+
event: unknown;
|
|
172
|
+
source?: string;
|
|
173
|
+
headers?: Record<string, string>;
|
|
174
|
+
deliveryId?: string;
|
|
175
|
+
externalDeliveryId?: string;
|
|
176
|
+
}): Promise<MockChatAgentTurn>;
|
|
177
|
+
/**
|
|
178
|
+
* Deliver a message mid-turn without waiting for it, the way the browser's
|
|
179
|
+
* steering path does. With a `pendingMessages` config the agent routes it into
|
|
180
|
+
* the steering queue for injection at the next step boundary; without one it
|
|
181
|
+
* buffers as the next turn.
|
|
182
|
+
*
|
|
183
|
+
* Send it while a turn is in flight — start the turn without awaiting it, then
|
|
184
|
+
* call this. Awaiting the turn first leaves nothing to steer.
|
|
185
|
+
*/
|
|
186
|
+
sendPendingMessage(message: UIMessage): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Deliver a channel event mid-turn without waiting for it, the way a Slack message lands while
|
|
189
|
+
* the agent is answering. With a `pendingMessages` config it can be steered into the running
|
|
190
|
+
* turn; otherwise, or when `shouldInject` declines, it runs as the next turn.
|
|
191
|
+
*/
|
|
192
|
+
sendPendingChannelEvent(args: {
|
|
193
|
+
event: unknown;
|
|
194
|
+
connectorId?: string;
|
|
195
|
+
source?: string;
|
|
196
|
+
deliveryId?: string;
|
|
197
|
+
}): Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* Deliver a verified channel event (Slack or any `chat.channels.*`
|
|
200
|
+
* connector) and wait for the next turn-complete. Mirrors what the hosted
|
|
201
|
+
* webhook ingress appends to `session.in`: a `submit-message` wire payload
|
|
202
|
+
* carrying `channelEvent` instead of `message`. The run resolves the
|
|
203
|
+
* connector by `connectorId`, maps the event with its `inbound()`, runs the
|
|
204
|
+
* turn, and posts the reply back through the connector's `send()`.
|
|
205
|
+
*
|
|
206
|
+
* `connectorId` defaults to `DEFAULT_TEST_CONNECTOR_ID`, which is also the id
|
|
207
|
+
* `recordingChannelConnector()` uses when you don't set one, so the common
|
|
208
|
+
* single-connector case lines up. Pass it explicitly for a connector with a
|
|
209
|
+
* custom id or for multi-connector agents.
|
|
210
|
+
*/
|
|
211
|
+
sendChannelEvent(args: {
|
|
212
|
+
event: unknown;
|
|
213
|
+
connectorId?: string;
|
|
214
|
+
source?: string;
|
|
215
|
+
headers?: Record<string, string>;
|
|
216
|
+
deliveryId?: string;
|
|
217
|
+
externalDeliveryId?: string;
|
|
218
|
+
}): Promise<MockChatAgentTurn>;
|
|
219
|
+
/**
|
|
220
|
+
* Deliver a channel event without waiting for a turn. Mirrors an event that
|
|
221
|
+
* the run may not turn into a turn: a filtered or deduped delivery, or a
|
|
222
|
+
* stale interaction callback that is dropped (matches no pending tool call).
|
|
223
|
+
* Resolves once the run has had a chance to process and possibly drop it.
|
|
224
|
+
*/
|
|
225
|
+
deliverChannelEvent(args: {
|
|
226
|
+
event: unknown;
|
|
227
|
+
connectorId?: string;
|
|
228
|
+
source?: string;
|
|
229
|
+
headers?: Record<string, string>;
|
|
230
|
+
deliveryId?: string;
|
|
231
|
+
externalDeliveryId?: string;
|
|
232
|
+
}): Promise<void>;
|
|
233
|
+
/** Fire a stop signal. Does not wait for the turn — the task keeps running. */
|
|
234
|
+
sendStop(message?: string): Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* Dispatch a `handover` signal — the agent picks up partial assistant
|
|
237
|
+
* messages and continues the turn. Only meaningful when the harness
|
|
238
|
+
* was started with `mode: "handover-prepare"`. Waits for turn-complete.
|
|
239
|
+
*
|
|
240
|
+
* `isFinal: false` (default) — agent runs `streamText` which executes
|
|
241
|
+
* any pending tool-calls (via the approval round) and resumes from
|
|
242
|
+
* step 2.
|
|
243
|
+
*
|
|
244
|
+
* `isFinal: true` — agent runs lifecycle hooks but skips `streamText`.
|
|
245
|
+
* The partial IS the response; `onTurnComplete` fires with it.
|
|
246
|
+
*/
|
|
247
|
+
sendHandover(args: {
|
|
248
|
+
partialAssistantMessage: unknown[];
|
|
249
|
+
isFinal?: boolean;
|
|
250
|
+
messageId?: string;
|
|
251
|
+
}): Promise<MockChatAgentTurn>;
|
|
252
|
+
/**
|
|
253
|
+
* Dispatch a `handover-skip` signal — the agent exits cleanly without
|
|
254
|
+
* firing turn hooks. Only meaningful when the harness was started
|
|
255
|
+
* with `mode: "handover-prepare"`. Awaits the run finishing.
|
|
256
|
+
*/
|
|
257
|
+
sendHandoverSkip(): Promise<void>;
|
|
258
|
+
/**
|
|
259
|
+
* Pre-seed the snapshot read for the next boot. The runtime's snapshot
|
|
260
|
+
* read returns this snapshot (skipping S3). Pass `undefined` to clear —
|
|
261
|
+
* the boot then sees no snapshot and falls through to replay-only.
|
|
262
|
+
*
|
|
263
|
+
* Effective on the next run boot only. Calling mid-turn is a no-op
|
|
264
|
+
* because the snapshot read happens once at run boot.
|
|
265
|
+
*/
|
|
266
|
+
seedSnapshot(snapshot: ChatSnapshotV1 | TranscriptSnapshotV2 | undefined): void;
|
|
267
|
+
/**
|
|
268
|
+
* Pre-seed `session.out` chunks for the next boot's replay. The runtime's
|
|
269
|
+
* `replaySessionOutTail` returns whatever the synthetic chunks reduce
|
|
270
|
+
* to. Pass `[]` to clear (boot replay returns no messages).
|
|
271
|
+
*
|
|
272
|
+
* Requires `__setReplaySessionOutTailImplForTests` exported from
|
|
273
|
+
* `ai.ts`. The harness throws a clear error at call time if that hook
|
|
274
|
+
* isn't available.
|
|
275
|
+
*/
|
|
276
|
+
seedSessionOutTail(chunks?: UIMessageChunk[]): void;
|
|
277
|
+
/**
|
|
278
|
+
* Pre-seed a trailing partial assistant message for the next boot's
|
|
279
|
+
* replay. The runtime's `replaySessionOutTail` returns this as the
|
|
280
|
+
* `partial` field (alongside whatever `seedSessionOutTail` reduces
|
|
281
|
+
* to). Use to simulate cancel-mid-stream: an assistant message whose
|
|
282
|
+
* `finish` chunk never arrived. Pass `undefined` to clear.
|
|
283
|
+
*
|
|
284
|
+
* Effective on the next run boot only.
|
|
285
|
+
*/
|
|
286
|
+
seedSessionOutPartial(partial: UIMessage | undefined): void;
|
|
287
|
+
/**
|
|
288
|
+
* Pre-seed user messages on the `session.in` tail for the next boot's
|
|
289
|
+
* replay. Each message is paired with a synthetic seq_num (`i + 1`).
|
|
290
|
+
* Used to simulate in-flight users the dead predecessor was supposed
|
|
291
|
+
* to process. Pass `[]` to clear.
|
|
292
|
+
*
|
|
293
|
+
* Effective on the next run boot only.
|
|
294
|
+
*/
|
|
295
|
+
seedSessionInTail(entries: Array<UIMessage | SeededChannelDelivery>): void;
|
|
296
|
+
/**
|
|
297
|
+
* Append a `trigger: "close"` record to `session.in` — what the server does
|
|
298
|
+
* when a session is closed from outside (dashboard, `sessions.close()`, MCP).
|
|
299
|
+
* Resolves once the run has exited, so a test can assert the agent left its
|
|
300
|
+
* loop instead of waiting out the idle timeout.
|
|
301
|
+
*/
|
|
302
|
+
sendClose(): Promise<void>;
|
|
303
|
+
/** Wait for the agent's run to exit (bounded, so a stuck loop fails the test). */
|
|
304
|
+
waitForExit(timeoutMs?: number): Promise<void>;
|
|
305
|
+
/**
|
|
306
|
+
* Every `sessions.close()` the agent made during this run, in order. A
|
|
307
|
+
* `chat.close()` produces exactly one entry.
|
|
308
|
+
*/
|
|
309
|
+
getCloseCalls(): Array<{
|
|
310
|
+
sessionId: string;
|
|
311
|
+
reason?: string;
|
|
312
|
+
}>;
|
|
313
|
+
/**
|
|
314
|
+
* Make the next `count` `sessions.close()` calls throw, to exercise the
|
|
315
|
+
* retry path. The calls are still recorded by {@link getCloseCalls}.
|
|
316
|
+
*/
|
|
317
|
+
failNextCloseCalls(count: number): void;
|
|
318
|
+
/**
|
|
319
|
+
* Deliver a user message on the live `session.in` tail at an explicit
|
|
320
|
+
* seq_num, without waiting for a turn.
|
|
321
|
+
*
|
|
322
|
+
* `seedSessionInTail` only feeds the boot replay, so the two ways a record
|
|
323
|
+
* reaches a run — the boot's own read and the tail re-reading the same
|
|
324
|
+
* sequence — never coexist. Pairing them is what reproduces a record being
|
|
325
|
+
* answered twice, so a seq_num already handed to `seedSessionInTail`
|
|
326
|
+
* (`i + 1`) is the interesting argument.
|
|
327
|
+
*/
|
|
328
|
+
deliverSessionInAtSeq(message: UIMessage, seqNum: number): Promise<void>;
|
|
329
|
+
/**
|
|
330
|
+
* The most recently written snapshot, or `undefined` if no snapshot
|
|
331
|
+
* has been written yet. Updated each time `writeChatSnapshot` is
|
|
332
|
+
* invoked from the run loop's snapshot-write site (plan section B.6).
|
|
333
|
+
*/
|
|
334
|
+
getSnapshot(): TranscriptSnapshotV2 | undefined;
|
|
335
|
+
/**
|
|
336
|
+
* Close the chat session cleanly. Sends `trigger: "close"` and awaits the
|
|
337
|
+
* task's `run()` function returning. Call this at the end of every test
|
|
338
|
+
* (or use `await using`) so the background task isn't left dangling.
|
|
339
|
+
*/
|
|
340
|
+
close(): Promise<void>;
|
|
341
|
+
/** All UIMessageChunks emitted since the harness was created. */
|
|
342
|
+
readonly allChunks: UIMessageChunk[];
|
|
343
|
+
/** Every raw chunk (including control chunks) emitted since the harness was created. */
|
|
344
|
+
readonly allRawChunks: unknown[];
|
|
345
|
+
};
|
|
346
|
+
/**
|
|
347
|
+
* Default `connectorId` used by {@link MockChatAgentHarness.sendChannelEvent}
|
|
348
|
+
* when the caller omits it. Matches the default `id` of
|
|
349
|
+
* {@link recordingChannelConnector}, so a single-connector agent needs no
|
|
350
|
+
* explicit id on either side.
|
|
351
|
+
*/
|
|
352
|
+
export declare const DEFAULT_TEST_CONNECTOR_ID = "test-channel";
|
|
353
|
+
/**
|
|
354
|
+
* Create an offline test harness for a `chat.agent` task.
|
|
355
|
+
*
|
|
356
|
+
* The harness starts the agent's `run()` function in a mocked task context,
|
|
357
|
+
* waits in preload for the first message, then exposes driver methods for
|
|
358
|
+
* sending messages / actions / stop signals and awaiting turn completion.
|
|
359
|
+
*
|
|
360
|
+
* Users are responsible for mocking the language model themselves — use
|
|
361
|
+
* `MockLanguageModelV3` and `simulateReadableStream` from `ai/test` inside
|
|
362
|
+
* their agent's `run()` function (typically via DI through `clientData`).
|
|
363
|
+
*
|
|
364
|
+
* @example
|
|
365
|
+
* ```ts
|
|
366
|
+
* import { mockChatAgent } from "@trigger.dev/sdk/ai/test";
|
|
367
|
+
* import { MockLanguageModelV3, simulateReadableStream } from "ai/test";
|
|
368
|
+
* import { myAgent } from "./my-agent";
|
|
369
|
+
*
|
|
370
|
+
* test("says hello", async () => {
|
|
371
|
+
* const harness = mockChatAgent(myAgent, { chatId: "test-1" });
|
|
372
|
+
* try {
|
|
373
|
+
* const turn = await harness.sendMessage({
|
|
374
|
+
* id: "m1",
|
|
375
|
+
* role: "user",
|
|
376
|
+
* parts: [{ type: "text", text: "hi" }],
|
|
377
|
+
* });
|
|
378
|
+
* expect(turn.chunks).toContainEqual(
|
|
379
|
+
* expect.objectContaining({ type: "text-delta", delta: "hello" })
|
|
380
|
+
* );
|
|
381
|
+
* } finally {
|
|
382
|
+
* await harness.close();
|
|
383
|
+
* }
|
|
384
|
+
* });
|
|
385
|
+
* ```
|
|
386
|
+
*/
|
|
387
|
+
export declare function mockChatAgent(agent: ChatAgentHandle, options?: MockChatAgentOptions): MockChatAgentHarness;
|
|
388
|
+
export {};
|