@trigger.dev/sdk 4.5.0-rc.7 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/v3/ai-shared.js +1 -4
- package/dist/commonjs/v3/ai-shared.js.map +1 -1
- package/dist/commonjs/v3/ai.d.ts +13 -10
- package/dist/commonjs/v3/ai.js +121 -66
- package/dist/commonjs/v3/ai.js.map +1 -1
- package/dist/commonjs/v3/auth.d.ts +1 -1
- package/dist/commonjs/v3/auth.js +3 -4
- package/dist/commonjs/v3/auth.js.map +1 -1
- package/dist/commonjs/v3/batch.d.ts +1 -1
- package/dist/commonjs/v3/batch.js.map +1 -1
- package/dist/commonjs/v3/chat-client.js +18 -14
- package/dist/commonjs/v3/chat-client.js.map +1 -1
- package/dist/commonjs/v3/chat-react.js +2 -4
- package/dist/commonjs/v3/chat-react.js.map +1 -1
- package/dist/commonjs/v3/chat-server.d.ts +69 -1
- package/dist/commonjs/v3/chat-server.js +162 -14
- package/dist/commonjs/v3/chat-server.js.map +1 -1
- package/dist/commonjs/v3/chat-server.test.js +156 -12
- package/dist/commonjs/v3/chat-server.test.js.map +1 -1
- package/dist/commonjs/v3/chat.js +4 -3
- package/dist/commonjs/v3/chat.js.map +1 -1
- package/dist/commonjs/v3/chat.test.js +9 -48
- package/dist/commonjs/v3/chat.test.js.map +1 -1
- package/dist/commonjs/v3/deployments.d.ts +2 -3
- package/dist/commonjs/v3/deployments.js.map +1 -1
- package/dist/commonjs/v3/envvars.js.map +1 -1
- package/dist/commonjs/v3/idempotencyKeys.js.map +1 -1
- package/dist/commonjs/v3/metadata.d.ts +2 -2
- package/dist/commonjs/v3/prompt.js +2 -6
- package/dist/commonjs/v3/prompt.js.map +1 -1
- package/dist/commonjs/v3/promptManagement.js.map +1 -1
- package/dist/commonjs/v3/query.js.map +1 -1
- package/dist/commonjs/v3/queues.d.ts +1 -1
- package/dist/commonjs/v3/queues.js.map +1 -1
- package/dist/commonjs/v3/retry.d.ts +1 -1
- package/dist/commonjs/v3/retry.js +1 -1
- package/dist/commonjs/v3/retry.js.map +1 -1
- package/dist/commonjs/v3/runs.d.ts +3 -4
- package/dist/commonjs/v3/runs.js.map +1 -1
- package/dist/commonjs/v3/schedules/index.d.ts +3 -3
- package/dist/commonjs/v3/schedules/index.js.map +1 -1
- package/dist/commonjs/v3/sessions.d.ts +3 -4
- package/dist/commonjs/v3/sessions.js +2 -1
- package/dist/commonjs/v3/sessions.js.map +1 -1
- package/dist/commonjs/v3/shared.d.ts +3 -4
- package/dist/commonjs/v3/shared.js +0 -12
- package/dist/commonjs/v3/shared.js.map +1 -1
- package/dist/commonjs/v3/skill.js.map +1 -1
- package/dist/commonjs/v3/streams.d.ts +1 -1
- package/dist/commonjs/v3/streams.js +4 -5
- package/dist/commonjs/v3/streams.js.map +1 -1
- package/dist/commonjs/v3/streams.test.js +3 -3
- package/dist/commonjs/v3/streams.test.js.map +1 -1
- package/dist/commonjs/v3/test/mock-chat-agent.js +1 -4
- package/dist/commonjs/v3/test/mock-chat-agent.js.map +1 -1
- package/dist/commonjs/v3/test/test-session-handle.d.ts +2 -1
- package/dist/commonjs/v3/test/test-session-handle.js.map +1 -1
- package/dist/commonjs/v3/triggerClient.test.js +1 -1
- package/dist/commonjs/v3/triggerClient.test.js.map +1 -1
- package/dist/commonjs/v3/triggerClient.types.test.js +11 -11
- package/dist/commonjs/v3/triggerClient.types.test.js.map +1 -1
- package/dist/commonjs/v3/wait.d.ts +2 -1
- package/dist/commonjs/v3/wait.js.map +1 -1
- package/dist/commonjs/v3/webhooks.js +1 -1
- package/dist/commonjs/v3/webhooks.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/ai-shared.js +1 -4
- package/dist/esm/v3/ai-shared.js.map +1 -1
- package/dist/esm/v3/ai.d.ts +13 -10
- package/dist/esm/v3/ai.js +119 -54
- package/dist/esm/v3/ai.js.map +1 -1
- package/dist/esm/v3/auth.d.ts +1 -1
- package/dist/esm/v3/auth.js +1 -2
- package/dist/esm/v3/auth.js.map +1 -1
- package/dist/esm/v3/batch.d.ts +1 -1
- package/dist/esm/v3/batch.js +1 -1
- package/dist/esm/v3/batch.js.map +1 -1
- package/dist/esm/v3/chat-client.js +18 -14
- package/dist/esm/v3/chat-client.js.map +1 -1
- package/dist/esm/v3/chat-react.js +2 -4
- package/dist/esm/v3/chat-react.js.map +1 -1
- package/dist/esm/v3/chat-server.d.ts +69 -1
- package/dist/esm/v3/chat-server.js +162 -14
- package/dist/esm/v3/chat-server.js.map +1 -1
- package/dist/esm/v3/chat-server.test.js +156 -12
- package/dist/esm/v3/chat-server.test.js.map +1 -1
- package/dist/esm/v3/chat.js +4 -3
- package/dist/esm/v3/chat.js.map +1 -1
- package/dist/esm/v3/chat.test.js +9 -48
- package/dist/esm/v3/chat.test.js.map +1 -1
- package/dist/esm/v3/deployments.d.ts +2 -3
- package/dist/esm/v3/deployments.js +1 -1
- package/dist/esm/v3/deployments.js.map +1 -1
- package/dist/esm/v3/envvars.js.map +1 -1
- package/dist/esm/v3/idempotencyKeys.js +1 -1
- package/dist/esm/v3/idempotencyKeys.js.map +1 -1
- package/dist/esm/v3/metadata.d.ts +2 -2
- package/dist/esm/v3/prompt.js +2 -6
- package/dist/esm/v3/prompt.js.map +1 -1
- package/dist/esm/v3/promptManagement.js.map +1 -1
- package/dist/esm/v3/query.js.map +1 -1
- package/dist/esm/v3/queues.d.ts +1 -1
- package/dist/esm/v3/queues.js.map +1 -1
- package/dist/esm/v3/retry.d.ts +1 -1
- package/dist/esm/v3/retry.js +1 -1
- package/dist/esm/v3/retry.js.map +1 -1
- package/dist/esm/v3/runs.d.ts +2 -3
- package/dist/esm/v3/runs.js.map +1 -1
- package/dist/esm/v3/schedules/index.d.ts +3 -3
- package/dist/esm/v3/schedules/index.js.map +1 -1
- package/dist/esm/v3/sessions.d.ts +3 -4
- package/dist/esm/v3/sessions.js +2 -1
- package/dist/esm/v3/sessions.js.map +1 -1
- package/dist/esm/v3/shared.d.ts +3 -4
- package/dist/esm/v3/shared.js +1 -13
- package/dist/esm/v3/shared.js.map +1 -1
- package/dist/esm/v3/skill.js.map +1 -1
- package/dist/esm/v3/streams.d.ts +1 -1
- package/dist/esm/v3/streams.js +4 -5
- package/dist/esm/v3/streams.js.map +1 -1
- package/dist/esm/v3/streams.test.js +4 -4
- package/dist/esm/v3/streams.test.js.map +1 -1
- package/dist/esm/v3/test/mock-chat-agent.js +4 -7
- package/dist/esm/v3/test/mock-chat-agent.js.map +1 -1
- package/dist/esm/v3/test/test-session-handle.d.ts +2 -1
- package/dist/esm/v3/test/test-session-handle.js +1 -1
- package/dist/esm/v3/test/test-session-handle.js.map +1 -1
- package/dist/esm/v3/triggerClient.test.js +1 -1
- package/dist/esm/v3/triggerClient.test.js.map +1 -1
- package/dist/esm/v3/triggerClient.types.test.js +11 -11
- package/dist/esm/v3/triggerClient.types.test.js.map +1 -1
- package/dist/esm/v3/wait.d.ts +2 -1
- package/dist/esm/v3/wait.js.map +1 -1
- package/dist/esm/v3/webhooks.js +1 -1
- package/dist/esm/v3/webhooks.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai/prompts.mdx +0 -4
- package/docs/ai-chat/actions.mdx +0 -4
- package/docs/ai-chat/anatomy.mdx +0 -4
- package/docs/ai-chat/backend.mdx +0 -4
- package/docs/ai-chat/background-injection.mdx +0 -4
- package/docs/ai-chat/changelog.mdx +109 -1
- package/docs/ai-chat/chat-local.mdx +0 -4
- package/docs/ai-chat/client-protocol.mdx +0 -4
- package/docs/ai-chat/compaction.mdx +0 -4
- package/docs/ai-chat/custom-agents.mdx +32 -4
- package/docs/ai-chat/error-handling.mdx +0 -4
- package/docs/ai-chat/fast-starts.mdx +86 -4
- package/docs/ai-chat/frontend.mdx +0 -4
- package/docs/ai-chat/how-it-works.mdx +0 -4
- package/docs/ai-chat/lifecycle-hooks.mdx +0 -4
- package/docs/ai-chat/mcp.mdx +0 -4
- package/docs/ai-chat/overview.mdx +0 -4
- package/docs/ai-chat/patterns/branching-conversations.mdx +0 -4
- package/docs/ai-chat/patterns/code-sandbox.mdx +0 -4
- package/docs/ai-chat/patterns/database-persistence.mdx +0 -4
- package/docs/ai-chat/patterns/human-in-the-loop.mdx +9 -5
- package/docs/ai-chat/patterns/large-payloads.mdx +0 -4
- package/docs/ai-chat/patterns/oom-resilience.mdx +0 -4
- package/docs/ai-chat/patterns/persistence-and-replay.mdx +0 -4
- package/docs/ai-chat/patterns/recovery-boot.mdx +0 -4
- package/docs/ai-chat/patterns/skills.mdx +0 -4
- package/docs/ai-chat/patterns/sub-agents.mdx +0 -4
- package/docs/ai-chat/patterns/tool-result-auditing.mdx +0 -4
- package/docs/ai-chat/patterns/trusted-edge-signals.mdx +0 -4
- package/docs/ai-chat/patterns/version-upgrades.mdx +0 -4
- package/docs/ai-chat/pending-messages.mdx +0 -4
- package/docs/ai-chat/prompt-caching.mdx +4 -4
- package/docs/ai-chat/quick-start.mdx +0 -4
- package/docs/ai-chat/reference.mdx +1 -5
- package/docs/ai-chat/server-chat.mdx +0 -4
- package/docs/ai-chat/sessions.mdx +0 -4
- package/docs/ai-chat/testing.mdx +0 -4
- package/docs/ai-chat/tools.mdx +0 -4
- package/docs/ai-chat/types.mdx +0 -4
- package/docs/ai-chat/upgrade-guide.mdx +0 -4
- package/docs/building-with-ai.mdx +1 -1
- package/docs/deploy-environment-variables.mdx +1 -1
- package/docs/deployment/dev-branches.mdx +92 -0
- package/docs/deployment/overview.mdx +1 -1
- package/docs/help-slack.mdx +1 -0
- package/docs/how-to-reduce-your-spend.mdx +14 -7
- package/docs/introduction.mdx +13 -13
- package/docs/mcp-agent-rules.mdx +1 -1
- package/docs/open-source-self-hosting.mdx +1 -1
- package/docs/self-hosting/kubernetes.mdx +8 -8
- package/docs/self-hosting/overview.mdx +2 -1
- package/docs/tasks/scheduled.mdx +2 -2
- package/docs/troubleshooting-debugging-in-vscode.mdx +1 -0
- package/docs/troubleshooting-github-issues.mdx +1 -1
- package/docs/troubleshooting-uptime-status.mdx +1 -0
- package/docs/video-walkthrough.mdx +1 -1
- package/docs/wait-for.mdx +1 -1
- package/package.json +2 -2
- package/docs/cli-dev.mdx +0 -8
|
@@ -4,10 +4,6 @@ sidebarTitle: "Prompt caching"
|
|
|
4
4
|
description: "Cache the stable prefix of your agent's prompt with Anthropic prompt caching to cut token cost and latency on every turn."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import RcBanner from "/snippets/ai-chat-rc-banner.mdx";
|
|
8
|
-
|
|
9
|
-
<RcBanner />
|
|
10
|
-
|
|
11
7
|
**Prompt caching lets a provider reuse the unchanged prefix of your prompt across requests, billing it at a fraction of the input price and skipping re-processing.** With Anthropic, cache reads cost ~10% of base input tokens, so a long, stable system prompt or a growing conversation history pays full price once and reads cheaply on every turn after.
|
|
12
8
|
|
|
13
9
|
Caching is a **byte-exact prefix match**: any change in the prefix invalidates everything after it. A multi-turn agent is the ideal case — the system prompt, tools, and earlier turns are identical turn over turn, so the cacheable prefix only grows. `chat.agent` is built to keep that prefix stable across turns, suspends, and resumes; this page shows how to place the cache breakpoints and verify they're hitting.
|
|
@@ -135,6 +131,10 @@ The system breakpoint and the conversation breakpoint compose: the system block
|
|
|
135
131
|
Anthropic allows **at most 4** cache breakpoints per request, and a prefix must be at least ~1024 tokens (model-dependent) to cache at all — shorter prefixes silently don't cache. One system breakpoint plus one rolling message breakpoint is the typical setup and leaves headroom.
|
|
136
132
|
</Note>
|
|
137
133
|
|
|
134
|
+
<Note>
|
|
135
|
+
This rolling-breakpoint pattern composes with [Head Start](/ai-chat/fast-starts#head-start). On a head-start handover, the first turn's pending tool call is handed to the agent as a tool-approval round whose trailing `tool` message must reach `streamText` untouched for that call to execute. `chat.agent` preserves that tail across `prepareMessages` automatically, so rewriting the last message here is safe: on a resume turn the breakpoint just lands on the next user or assistant message instead of the transient approval row.
|
|
136
|
+
</Note>
|
|
137
|
+
|
|
138
138
|
## Caching and compaction
|
|
139
139
|
|
|
140
140
|
Compaction rewrites the conversation prefix — it replaces earlier turns with a summary — so it necessarily invalidates the cached message prefix at that point. That's a one-time reset, not a regression: because `prepareMessages` also runs on the compaction rebuild and result paths, the new (shorter) prefix gets a fresh breakpoint and re-warms on the next turn. Your system-prompt cache is unaffected — compaction never touches the system block. See [Compaction](/ai-chat/compaction) for how the summary is produced.
|
|
@@ -4,10 +4,6 @@ sidebarTitle: "Quick Start"
|
|
|
4
4
|
description: "Get a working AI agent in 3 steps — define an agent, generate a token, and wire up the frontend."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import RcBanner from "/snippets/ai-chat-rc-banner.mdx";
|
|
8
|
-
|
|
9
|
-
<RcBanner />
|
|
10
|
-
|
|
11
7
|
These steps assume you already have a Trigger.dev project with the SDK installed and the CLI authenticated — if you don't, follow [Manual setup](/manual-setup) (or `npx trigger.dev@latest init` in an existing project) first. You should be able to run `pnpm exec trigger dev` from your project root before continuing.
|
|
12
8
|
|
|
13
9
|
The chat surface works with Vercel AI SDK **v5, v6, or v7**; install whichever major you want. On **v7**, also install `@ai-sdk/otel` so your model calls are traced (the SDK registers it for you). See [compatibility](/ai-chat/reference#compatibility) for the full matrix.
|
|
@@ -4,15 +4,11 @@ sidebarTitle: "API Reference"
|
|
|
4
4
|
description: "Complete API reference for the AI Agents SDK — backend options, events, frontend transport, and hooks."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import RcBanner from "/snippets/ai-chat-rc-banner.mdx";
|
|
8
|
-
|
|
9
|
-
<RcBanner />
|
|
10
|
-
|
|
11
7
|
## Compatibility
|
|
12
8
|
|
|
13
9
|
| Dependency | Supported | Notes |
|
|
14
10
|
|---|---|---|
|
|
15
|
-
| `@trigger.dev/sdk` | `>=4.5.0
|
|
11
|
+
| `@trigger.dev/sdk` | `>=4.5.0` | The chat agent surface lives in this SDK release. Install with `@trigger.dev/sdk@latest`. |
|
|
16
12
|
| `ai` (Vercel AI SDK) | `^5.0.0 \|\| ^6.0.0 \|\| >=7.0.0-canary <8` | Declared as a peer. v6 is what we develop against day to day; v5 and v7 work too (v7 is in canary/beta upstream). Your installed `ai` major drives the chat surface's types. |
|
|
17
13
|
| `@ai-sdk/otel` | `1.x` (v7 only) | Optional. AI SDK 7 moved model-call span emission out of `ai` core into this adapter. Install it alongside `ai@7` and the SDK auto-registers it, so your model calls show up as spans in the run trace. Not needed on v5/v6, where `ai` core emits spans. See [AI SDK 7 telemetry](#ai-sdk-7-telemetry) below. |
|
|
18
14
|
| `@ai-sdk/react` | matches your `ai` major | Pulled in by `useChat`. The transport works with whichever React hook ships in the same major as your `ai` version. |
|
|
@@ -4,10 +4,6 @@ sidebarTitle: "Server-Side Chat"
|
|
|
4
4
|
description: "Use AgentChat to interact with chat agents from server-side code — tasks, webhooks, scripts, or other agents."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import RcBanner from "/snippets/ai-chat-rc-banner.mdx";
|
|
8
|
-
|
|
9
|
-
<RcBanner />
|
|
10
|
-
|
|
11
7
|
`AgentChat` lets you chat with agents from server-side code. It works inside tasks (agent-to-agent), request handlers, webhook processors, and scripts.
|
|
12
8
|
|
|
13
9
|
```ts
|
|
@@ -4,10 +4,6 @@ sidebarTitle: "Sessions"
|
|
|
4
4
|
description: "A Session is a stateful execution of an agent, with two-way streaming and durable compute. A single Session can have multiple runs associated with it."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import RcBanner from "/snippets/ai-chat-rc-banner.mdx";
|
|
8
|
-
|
|
9
|
-
<RcBanner />
|
|
10
|
-
|
|
11
7
|
**A Session is a stateful execution of an agent.** It includes two-way streaming and durable compute, and a single Session can have multiple runs associated with it.
|
|
12
8
|
|
|
13
9
|
The **two-way streaming** is a pair of durable streams. The input stream (`.in`) carries incoming user messages to your task. The output stream (`.out`) carries everything the agent produces back to your clients: AI generation parts (text, reasoning, tool calls) and any custom data parts you write.
|
package/docs/ai-chat/testing.mdx
CHANGED
|
@@ -4,10 +4,6 @@ sidebarTitle: "Testing"
|
|
|
4
4
|
description: "Drive a chat.agent through real turns in unit tests — no network, no task runtime, no mocking the SDK."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import RcBanner from "/snippets/ai-chat-rc-banner.mdx";
|
|
8
|
-
|
|
9
|
-
<RcBanner />
|
|
10
|
-
|
|
11
7
|
## Overview
|
|
12
8
|
|
|
13
9
|
`@trigger.dev/sdk/ai/test` exports `mockChatAgent`, an offline harness that runs your `chat.agent` definition's `run()` function inside an in-memory task runtime. You send messages, actions, and stop signals through driver methods and assert against the chunks the agent emits.
|
package/docs/ai-chat/tools.mdx
CHANGED
|
@@ -4,10 +4,6 @@ sidebarTitle: "Tools"
|
|
|
4
4
|
description: "Declare tools on chat.agent so toModelOutput survives across turns, get them back typed in run(), and type your messages from them."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import RcBanner from "/snippets/ai-chat-rc-banner.mdx";
|
|
8
|
-
|
|
9
|
-
<RcBanner />
|
|
10
|
-
|
|
11
7
|
`chat.agent` doesn't call the model for you. Your tools still go to [`streamText`](https://sdk.vercel.ai/docs/ai-sdk-core/tools-and-tool-calling) inside `run()`. But you should **also declare them on the agent config**:
|
|
12
8
|
|
|
13
9
|
```ts
|
package/docs/ai-chat/types.mdx
CHANGED
|
@@ -4,10 +4,6 @@ sidebarTitle: "Types"
|
|
|
4
4
|
description: "TypeScript types for AI Agents, UI messages, and the frontend transport."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import RcBanner from "/snippets/ai-chat-rc-banner.mdx";
|
|
8
|
-
|
|
9
|
-
<RcBanner />
|
|
10
|
-
|
|
11
7
|
TypeScript patterns for [AI Chat](/ai-chat/overview). This page covers how to pin a custom AI SDK [`UIMessage`](https://sdk.vercel.ai/docs/reference/ai-sdk-core/ui-message) subtype with `chat.withUIMessage`, fix a typed `clientData` schema with `chat.withClientData`, chain builder-level hooks, and align types on the client.
|
|
12
8
|
|
|
13
9
|
## Custom `UIMessage` with `chat.withUIMessage`
|
|
@@ -4,10 +4,6 @@ sidebarTitle: "Sessions Upgrade Guide"
|
|
|
4
4
|
description: "Migrating chat.agent code from the prerelease API to the Sessions-as-run-manager release."
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import RcBanner from "/snippets/ai-chat-rc-banner.mdx";
|
|
8
|
-
|
|
9
|
-
<RcBanner />
|
|
10
|
-
|
|
11
7
|
This guide is for customers who tried `chat.agent` during the prerelease period.
|
|
12
8
|
The public surface of `chat.agent({...})`, `useTriggerChatTransport`,
|
|
13
9
|
`AgentChat`, `chat.defer`, and `chat.history` is largely
|
|
@@ -230,7 +230,7 @@ To sync environment variables from your Vercel projects to Trigger.dev, you can
|
|
|
230
230
|
|
|
231
231
|
#### Deploy
|
|
232
232
|
|
|
233
|
-
When you run the [CLI deploy command](/cli-deploy) directly or using [GitHub Actions](/github-actions) it will sync the environment variables from [Infisical](https://infisical.com) to Trigger.dev. This means they'll appear on the Environment Variables page so you can confirm that it's worked.
|
|
233
|
+
When you run the [CLI deploy command](/cli-deploy-commands) directly or using [GitHub Actions](/github-actions) it will sync the environment variables from [Infisical](https://infisical.com) to Trigger.dev. This means they'll appear on the Environment Variables page so you can confirm that it's worked.
|
|
234
234
|
|
|
235
235
|
This means that you need to redeploy your Trigger.dev tasks if you change the environment variables in [Infisical](https://infisical.com).
|
|
236
236
|
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Development branches"
|
|
3
|
+
sidebarTitle: "Dev branches"
|
|
4
|
+
description: "Run multiple local dev sessions in isolation by giving each one its own development branch. Use branches to keep parallel work (in separate worktrees, directories, or agents) from clashing."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Every project starts with a single development environment called `default`. A **dev branch** is an isolated environment that lives under development, with its own runs, schedules, and concurrency.
|
|
8
|
+
|
|
9
|
+
Branches are useful when you run more than one local dev session at a time. Give each session its own branch so their runs don't collide:
|
|
10
|
+
|
|
11
|
+
- Run several [git worktrees](https://git-scm.com/docs/git-worktree) or copies of your project in parallel, one branch each.
|
|
12
|
+
- Let multiple coding agents each work in their own branch without stepping on one another.
|
|
13
|
+
|
|
14
|
+
When you're done with a branch, you can archive it to free up a slot or just re-use it.
|
|
15
|
+
|
|
16
|
+
## Run a dev session on a branch
|
|
17
|
+
|
|
18
|
+
Log in with the CLI first:
|
|
19
|
+
|
|
20
|
+
<CodeGroup>
|
|
21
|
+
|
|
22
|
+
```bash npm
|
|
23
|
+
npx trigger.dev@latest login
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```bash pnpm
|
|
27
|
+
pnpm dlx trigger.dev@latest login
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```bash bun
|
|
31
|
+
bunx trigger.dev@latest login
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
</CodeGroup>
|
|
35
|
+
|
|
36
|
+
Then start a dev session on a branch with the `--branch` flag. If the branch doesn't exist yet, it's created:
|
|
37
|
+
|
|
38
|
+
<CodeGroup>
|
|
39
|
+
|
|
40
|
+
```bash npm
|
|
41
|
+
npx trigger.dev@latest dev --branch my-feature
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```bash pnpm
|
|
45
|
+
pnpm dlx trigger.dev@latest dev --branch my-feature
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```bash bun
|
|
49
|
+
bunx trigger.dev@latest dev --branch my-feature
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
</CodeGroup>
|
|
53
|
+
|
|
54
|
+
Without `--branch`, the session runs on the `default` branch.
|
|
55
|
+
|
|
56
|
+
<Tip>
|
|
57
|
+
You can also set the branch with the `TRIGGER_DEV_BRANCH` environment variable instead of the flag.
|
|
58
|
+
</Tip>
|
|
59
|
+
|
|
60
|
+
## Archive a branch
|
|
61
|
+
|
|
62
|
+
Archive a branch from the CLI when you no longer need it. The CLI detects your local git branch, or you can name one with `--branch`:
|
|
63
|
+
|
|
64
|
+
<CodeGroup>
|
|
65
|
+
|
|
66
|
+
```bash npm
|
|
67
|
+
npx trigger.dev@latest dev archive --branch my-feature
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```bash pnpm
|
|
71
|
+
pnpm dlx trigger.dev@latest dev archive --branch my-feature
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```bash bun
|
|
75
|
+
bunx trigger.dev@latest dev archive --branch my-feature
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
</CodeGroup>
|
|
79
|
+
|
|
80
|
+
You can also create and archive branches from the **Dev branches** page in the dashboard.
|
|
81
|
+
|
|
82
|
+
## Limits on active branches
|
|
83
|
+
|
|
84
|
+
Each branch has its own concurrency, so we limit how many can be active per project. Archive a branch at any time to unlock another slot.
|
|
85
|
+
|
|
86
|
+
| Plan | Active dev branches |
|
|
87
|
+
| ----- | ------------------- |
|
|
88
|
+
| Free | 25 |
|
|
89
|
+
| Hobby | 25 |
|
|
90
|
+
| Pro | 25 |
|
|
91
|
+
|
|
92
|
+
Need more? [Get in touch](https://trigger.dev/contact) and we'll raise the limit.
|
|
@@ -6,7 +6,7 @@ description: "Learn how to deploy your tasks to Trigger.dev."
|
|
|
6
6
|
|
|
7
7
|
import CorepackError from "/snippets/corepack-error.mdx";
|
|
8
8
|
|
|
9
|
-
Before you can run production workloads on Trigger.dev, you need to deploy your tasks. The only way to do this at the moment is through the [deploy CLI command](/cli-deploy):
|
|
9
|
+
Before you can run production workloads on Trigger.dev, you need to deploy your tasks. The only way to do this at the moment is through the [deploy CLI command](/cli-deploy-commands):
|
|
10
10
|
|
|
11
11
|
<CodeGroup>
|
|
12
12
|
|
package/docs/help-slack.mdx
CHANGED
|
@@ -16,21 +16,28 @@ Monitor your usage dashboard to understand your spending patterns. You can see:
|
|
|
16
16
|
|
|
17
17
|
You can view your usage page by clicking the "Organization" menu in the top left of the dashboard and then clicking "Usage".
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Set billing limits and alerts
|
|
20
20
|
|
|
21
|
-
Configure billing alerts in your dashboard to get notified when you approach spending thresholds. This helps you:
|
|
21
|
+
Configure billing limits and alerts in your dashboard to protect against unexpected usage and get notified when you approach spending thresholds. This helps you:
|
|
22
22
|
|
|
23
|
+
- Set a monthly compute spend limit for your organization
|
|
23
24
|
- Catch unexpected cost increases early
|
|
24
25
|
- Identify runaway tasks before they become expensive
|
|
25
26
|
|
|
26
|
-
The
|
|
27
|
+
The **Billing limits** settings page has two sections:
|
|
27
28
|
|
|
28
|
-
- **
|
|
29
|
-
- **
|
|
29
|
+
- **Billing limit**: Choose your plan limit, a custom amount, or no limit. When a limit is reached, billable environments (`production`, `staging`, and `preview`) enter a **grace period** — queues pause and new runs queue without starting. After grace expires, new triggers are rejected until you increase or remove the limit.
|
|
30
|
+
- **Billing alerts**: Add email alerts at specific spend thresholds (% of your limit when a limit is set, or dollar amounts when no limit is configured). Alerts notify you only; they do **not** pause environments or reject triggers.
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
**Limits vs alerts:** A billing limit enforces spend (grace → reject). Billing alerts are optional notifications at thresholds you choose.
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
**Soft limits:** Billing limits are not instantaneous hard caps. Usage is evaluated on a short delay, so spend can briefly exceed your limit before enforcement applies. Queued runs during grace incur no compute cost until they start. See our [terms](https://trigger.dev/terms) for refund policy details.
|
|
35
|
+
|
|
36
|
+
On the **Usage** page, when you have a custom billing limit (or a plan limit that differs from included usage), a **Billing limit** marker appears on the usage bar alongside your current spend and plan included usage.
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
You can open the page from the **Organization** menu in the top left of the dashboard, then **Settings** → **Billing limits**.
|
|
34
41
|
|
|
35
42
|
## Reduce your machine sizes
|
|
36
43
|
|
package/docs/introduction.mdx
CHANGED
|
@@ -91,19 +91,19 @@ We provide everything you need to build and manage background tasks: a CLI and S
|
|
|
91
91
|
|
|
92
92
|
| Extension | What it does | Docs |
|
|
93
93
|
| :-------------------- | :----------------------------------------------------------- | :----------------------------------------------------- |
|
|
94
|
-
| prismaExtension | Use Prisma with Trigger.dev | [
|
|
95
|
-
| pythonExtension | Execute Python scripts in Trigger.dev | [
|
|
96
|
-
| playwright | Use Playwright with Trigger.dev | [
|
|
97
|
-
| puppeteer | Use Puppeteer with Trigger.dev | [
|
|
98
|
-
| lightpanda | Use Lightpanda with Trigger.dev | [
|
|
99
|
-
| ffmpeg | Use FFmpeg with Trigger.dev | [
|
|
100
|
-
| aptGet | Install system packages with aptGet | [
|
|
101
|
-
| additionalFiles | Copy additional files to the build directory | [
|
|
102
|
-
| additionalPackages | Include additional packages in the build | [
|
|
103
|
-
| syncEnvVars | Automatically sync environment variables to Trigger.dev | [
|
|
104
|
-
| esbuildPlugin | Add existing or custom esbuild plugins to your build process | [
|
|
105
|
-
| emitDecoratorMetadata | Support for the emitDecoratorMetadata TypeScript compiler | [
|
|
106
|
-
| audioWaveform | Support for Audio Waveform in your project | [
|
|
94
|
+
| prismaExtension | Use Prisma with Trigger.dev | [prismaExtension docs](/config/extensions/prismaExtension) |
|
|
95
|
+
| pythonExtension | Execute Python scripts in Trigger.dev | [pythonExtension docs](/config/extensions/pythonExtension) |
|
|
96
|
+
| playwright | Use Playwright with Trigger.dev | [playwright extension docs](/config/extensions/playwright) |
|
|
97
|
+
| puppeteer | Use Puppeteer with Trigger.dev | [puppeteer extension docs](/config/extensions/puppeteer) |
|
|
98
|
+
| lightpanda | Use Lightpanda with Trigger.dev | [lightpanda extension docs](/config/extensions/lightpanda) |
|
|
99
|
+
| ffmpeg | Use FFmpeg with Trigger.dev | [ffmpeg extension docs](/config/extensions/ffmpeg) |
|
|
100
|
+
| aptGet | Install system packages with aptGet | [aptGet extension docs](/config/extensions/aptGet) |
|
|
101
|
+
| additionalFiles | Copy additional files to the build directory | [additionalFiles docs](/config/extensions/additionalFiles) |
|
|
102
|
+
| additionalPackages | Include additional packages in the build | [additionalPackages docs](/config/extensions/additionalPackages) |
|
|
103
|
+
| syncEnvVars | Automatically sync environment variables to Trigger.dev | [syncEnvVars docs](/config/extensions/syncEnvVars) |
|
|
104
|
+
| esbuildPlugin | Add existing or custom esbuild plugins to your build process | [esbuildPlugin docs](/config/extensions/esbuildPlugin) |
|
|
105
|
+
| emitDecoratorMetadata | Support for the emitDecoratorMetadata TypeScript compiler | [emitDecoratorMetadata docs](/config/extensions/emitDecoratorMetadata) |
|
|
106
|
+
| audioWaveform | Support for Audio Waveform in your project | [audioWaveform docs](/config/extensions/audioWaveform) |
|
|
107
107
|
|
|
108
108
|
## Explore by example
|
|
109
109
|
|
package/docs/mcp-agent-rules.mdx
CHANGED
|
@@ -19,7 +19,7 @@ The install command is the same, and now installs skills:
|
|
|
19
19
|
npx trigger.dev@latest skills
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
`npx trigger.dev@latest install-rules` still works as an alias
|
|
22
|
+
`npx trigger.dev@latest install-rules` still works as an alias for `skills`, and `trigger dev` offers to install the skills on first run.
|
|
23
23
|
|
|
24
24
|
The old task and realtime guidance now lives in the `trigger-authoring-tasks` and `trigger-realtime-and-frontend` skills, alongside two new skills for building `chat.agent` AI agents. See [Skills](/skills) for the full list and supported assistants.
|
|
25
25
|
|
|
@@ -156,7 +156,7 @@ TRIGGER_DOMAIN=1234-42-42-42-42.ngrok-free.app
|
|
|
156
156
|
|
|
157
157
|
### Registry setup
|
|
158
158
|
|
|
159
|
-
If you want to deploy v3 projects, you will need access to a Docker registry. The [CLI deploy](/cli-deploy) command will push the images, and then the worker machine can pull them when needed. We will use Docker Hub as an example.
|
|
159
|
+
If you want to deploy v3 projects, you will need access to a Docker registry. The [CLI deploy](/cli-deploy-commands) command will push the images, and then the worker machine can pull them when needed. We will use Docker Hub as an example.
|
|
160
160
|
|
|
161
161
|
1. Sign up for a free account at [Docker Hub](https://hub.docker.com/)
|
|
162
162
|
|
|
@@ -61,7 +61,7 @@ webapp:
|
|
|
61
61
|
```bash
|
|
62
62
|
helm upgrade -n trigger --install trigger \
|
|
63
63
|
oci://ghcr.io/triggerdotdev/charts/trigger \
|
|
64
|
-
--version "
|
|
64
|
+
--version "^4.5.0" \
|
|
65
65
|
--create-namespace
|
|
66
66
|
```
|
|
67
67
|
|
|
@@ -107,11 +107,11 @@ The following commands will display the default values:
|
|
|
107
107
|
```bash
|
|
108
108
|
# Specific version
|
|
109
109
|
helm show values oci://ghcr.io/triggerdotdev/charts/trigger \
|
|
110
|
-
--version "4.0
|
|
110
|
+
--version "4.5.0"
|
|
111
111
|
|
|
112
112
|
# Latest v4
|
|
113
113
|
helm show values oci://ghcr.io/triggerdotdev/charts/trigger \
|
|
114
|
-
--version "
|
|
114
|
+
--version "^4.5.0"
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
### Custom values
|
|
@@ -171,7 +171,7 @@ Deploy with your custom values:
|
|
|
171
171
|
```bash
|
|
172
172
|
helm upgrade -n trigger --install trigger \
|
|
173
173
|
oci://ghcr.io/triggerdotdev/charts/trigger \
|
|
174
|
-
--version "
|
|
174
|
+
--version "^4.5.0" \
|
|
175
175
|
--create-namespace \
|
|
176
176
|
-f values-custom.yaml
|
|
177
177
|
```
|
|
@@ -510,14 +510,14 @@ You can lock versions in two ways:
|
|
|
510
510
|
# Pin to a specific version for production
|
|
511
511
|
helm upgrade -n trigger --install trigger \
|
|
512
512
|
oci://ghcr.io/triggerdotdev/charts/trigger \
|
|
513
|
-
--version "4.0
|
|
513
|
+
--version "4.5.0"
|
|
514
514
|
|
|
515
515
|
# The app version will be different from the chart version
|
|
516
516
|
# This is the version of the Trigger.dev webapp and supervisor
|
|
517
517
|
# ..and should always match your Trigger.dev CLI version
|
|
518
518
|
helm show chart \
|
|
519
519
|
oci://ghcr.io/triggerdotdev/charts/trigger \
|
|
520
|
-
--version "4.0
|
|
520
|
+
--version "4.5.0" | grep appVersion
|
|
521
521
|
```
|
|
522
522
|
|
|
523
523
|
**Specific image tags:**
|
|
@@ -525,11 +525,11 @@ helm show chart \
|
|
|
525
525
|
```yaml
|
|
526
526
|
webapp:
|
|
527
527
|
image:
|
|
528
|
-
tag: "v4.
|
|
528
|
+
tag: "v4.5.0"
|
|
529
529
|
|
|
530
530
|
supervisor:
|
|
531
531
|
image:
|
|
532
|
-
tag: "v4.
|
|
532
|
+
tag: "v4.5.0"
|
|
533
533
|
```
|
|
534
534
|
|
|
535
535
|
The chart version's `appVersion` field determines the default image tags. Newer image tags may be incompatible with older chart versions and vice versa.
|
package/docs/tasks/scheduled.mdx
CHANGED
|
@@ -95,7 +95,7 @@ There are two ways of doing this:
|
|
|
95
95
|
|
|
96
96
|
### Declarative schedules
|
|
97
97
|
|
|
98
|
-
These sync when you run the [dev](/cli-dev) or [deploy](/cli-deploy) commands.
|
|
98
|
+
These sync when you run the [dev](/cli-dev-commands) or [deploy](/cli-deploy-commands) commands.
|
|
99
99
|
|
|
100
100
|
To create them you add the `cron` property to your `schedules.task()`. This property is optional and is only used if you want to add a declarative schedule to your task:
|
|
101
101
|
|
|
@@ -127,7 +127,7 @@ export const secondScheduledTask = schedules.task({
|
|
|
127
127
|
});
|
|
128
128
|
```
|
|
129
129
|
|
|
130
|
-
When you run the [dev](/cli-dev) or [deploy](/cli-deploy) commands, declarative schedules will be synced. If you add, delete or edit the `cron` property it will be updated when you run these commands. You can view your schedules on the Schedules page in the dashboard.
|
|
130
|
+
When you run the [dev](/cli-dev-commands) or [deploy](/cli-deploy-commands) commands, declarative schedules will be synced. If you add, delete or edit the `cron` property it will be updated when you run these commands. You can view your schedules on the Schedules page in the dashboard.
|
|
131
131
|
|
|
132
132
|
### Imperative schedules
|
|
133
133
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Debugging in VS Code"
|
|
3
3
|
sidebarTitle: "Debugging in VS Code"
|
|
4
|
+
description: "Attach the VS Code debugger to your Trigger.dev tasks to set breakpoints and step through your code."
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
import DebuggingInVSCode from '/snippets/debugging_in_vscode.mdx';
|
|
@@ -3,4 +3,4 @@ title: "GitHub Issues"
|
|
|
3
3
|
url: "https://github.com/triggerdotdev/trigger.dev/issues"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Please [join our community on Discord](https://
|
|
6
|
+
Please [join our community on Discord](https://trigger.dev/discord) to report bugs, request features, or get help from the team and other developers.
|
|
@@ -20,4 +20,4 @@ description: "Go from zero to a working task in your Next.js app in 10 minutes."
|
|
|
20
20
|
- [1:44](https://youtu.be/YH_4c0K7fGM?si=J8svVzotZtyTXDap&t=104) – [Run and test](/run-tests) the "Hello, world!" example project
|
|
21
21
|
- [2:09](https://youtu.be/YH_4c0K7fGM?si=FMTP8ep_cDBCU0_x&t=128) – Create and run an AI image generation task that uses [Fal.ai](https://fal.ai) – ([View the code](/guides/examples/fal-ai-image-to-cartoon))
|
|
22
22
|
- [6:25](https://youtu.be/YH_4c0K7fGM?si=pPc8iLI2Y9FGD3yo&t=385) – Create and run a [Realtime](/realtime/overview) example using [React hooks](/realtime/react-hooks) – ([View the code](/guides/examples/fal-ai-realtime))
|
|
23
|
-
- [11:10](https://youtu.be/YH_4c0K7fGM?si=Mjd0EvvNsNlVouvY&t=670) – [Deploy your task](/cli-deploy) to the Trigger.dev Cloud
|
|
23
|
+
- [11:10](https://youtu.be/YH_4c0K7fGM?si=Mjd0EvvNsNlVouvY&t=670) – [Deploy your task](/cli-deploy-commands) to the Trigger.dev Cloud
|
package/docs/wait-for.mdx
CHANGED
|
@@ -38,5 +38,5 @@ You can pass an idempotency key to any wait function, allowing you to skip waits
|
|
|
38
38
|
|
|
39
39
|
```ts
|
|
40
40
|
// Specify the idempotency key and TTL when waiting for a duration:
|
|
41
|
-
await wait.for({ seconds: 10
|
|
41
|
+
await wait.for({ seconds: 10, idempotencyKey: "my-idempotency-key", idempotencyKeyTTL: "1h" });
|
|
42
42
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trigger.dev/sdk",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1",
|
|
4
4
|
"description": "trigger.dev Node.JS SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@opentelemetry/api": "1.9.1",
|
|
68
68
|
"@opentelemetry/semantic-conventions": "1.41.1",
|
|
69
|
-
"@trigger.dev/core": "4.5.
|
|
69
|
+
"@trigger.dev/core": "4.5.1",
|
|
70
70
|
"chalk": "^5.2.0",
|
|
71
71
|
"cronstrue": "^2.21.0",
|
|
72
72
|
"debug": "^4.3.4",
|