@trigger.dev/sdk 4.5.8 → 4.5.9

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.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "4.5.8";
4
+ exports.VERSION = "4.5.9";
5
5
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export const VERSION = "4.5.8";
1
+ export const VERSION = "4.5.9";
2
2
  //# sourceMappingURL=version.js.map
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Changelog"
2
+ title: "AI Agents SDK changelog"
3
3
  sidebarTitle: "Changelog"
4
4
  description: "Changelog for the AI Agents SDK."
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "How it works"
2
+ title: "How the AI Agents SDK works"
3
3
  sidebarTitle: "How it works"
4
4
  description: "End-to-end mechanics of a chat.agent turn: the two durable channels per session, the long-lived task that reads and writes them, and how a chat survives refreshes, deploys, and idle gaps."
5
5
  ---
@@ -1,5 +1,6 @@
1
1
  ---
2
- title: "Bulk actions"
2
+ title: "Bulk actions in the dashboard"
3
+ sidebarTitle: "Bulk actions"
3
4
  description: "Replay or cancel multiple runs from the dashboard using filters or selected run IDs."
4
5
  ---
5
6
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Lightpanda"
2
+ title: "Lightpanda build extension"
3
3
  sidebarTitle: "lightpanda"
4
4
  description: "Use the lightpanda build extension to add Lightpanda browser to your project"
5
5
  tag: "v4"
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Puppeteer"
2
+ title: "Puppeteer build extension"
3
3
  sidebarTitle: "puppeteer"
4
4
  description: "Use the puppeteer build extension to enable support for Puppeteer in your project"
5
5
  ---
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "How it works"
2
+ title: "How Trigger.dev works"
3
3
  sidebarTitle: "How it works"
4
4
  description: "Understand how Trigger.dev works and how it can help you."
5
5
  ---
@@ -148,7 +148,7 @@ Here's how the Checkpoint-Resume System works:
148
148
 
149
149
  2. **Subtask Handling**: If a task needs to trigger a subtask, it can do so and wait for its completion using `triggerAndWait`
150
150
 
151
- 3. **State Checkpointing**: While waiting for a subtask or during a programmed pause (e.g., `wait.for({ seconds: 30 })`), the system uses CRIU (Checkpoint/Restore In Userspace) to create a checkpoint of the task's entire state, including memory, CPU registers, and open file descriptors.
151
+ 3. **State Checkpointing**: While waiting for a subtask or during a long programmed pause (e.g., `wait.for({ minutes: 5 })`), the system uses CRIU (Checkpoint/Restore In Userspace) to create a checkpoint of the task's entire state, including memory, CPU registers, and open file descriptors. A `wait.for()` or `wait.until()` shorter than 60 seconds doesn't checkpoint — see [Wait](/wait).
152
152
 
153
153
  4. **Resource Release**: After checkpointing, the parent task's resources are released, freeing up the execution environment.
154
154
 
@@ -178,9 +178,9 @@ export const parentTask = task({
178
178
  console.log("Child task result:", result);
179
179
 
180
180
  // This will also cause the task to be checkpointed and suspended
181
- await wait.for({ seconds: 30 });
181
+ await wait.for({ minutes: 5 });
182
182
 
183
- console.log("Resumed after 30 seconds");
183
+ console.log("Resumed after 5 minutes");
184
184
 
185
185
  return "Parent task completed";
186
186
  },
@@ -170,7 +170,7 @@ export const boundedTask = task({
170
170
 
171
171
  ## Use waitpoints instead of polling
172
172
 
173
- Waits longer than 5 seconds automatically checkpoint your task, meaning you don't pay for compute while waiting. Use `wait.for()`, `wait.until()`, or `triggerAndWait()` instead of polling loops.
173
+ You don't pay for compute during any wait longer than 5 seconds. Use `wait.for()`, `wait.until()`, or `triggerAndWait()` instead of polling loops.
174
174
 
175
175
  ```ts
176
176
  import { task, wait } from "@trigger.dev/sdk";
@@ -178,17 +178,17 @@ import { task, wait } from "@trigger.dev/sdk";
178
178
  export const waitpointTask = task({
179
179
  id: "waitpoint-task",
180
180
  run: async (payload) => {
181
- // This wait is free - your task is checkpointed
181
+ // You aren't charged for compute during this wait
182
182
  await wait.for({ minutes: 5 });
183
183
 
184
- // Parent is also checkpointed while waiting for child tasks
184
+ // The parent isn't charged either while it waits for a child task
185
185
  const result = await childTask.triggerAndWait({ data: payload });
186
186
  return result;
187
187
  },
188
188
  });
189
189
  ```
190
190
 
191
- [Read more about waitpoints](/wait-for).
191
+ Waiting saves you compute, but it doesn't always free up concurrency — see [Wait](/wait).
192
192
 
193
193
  ## Use debounce to consolidate multiple triggers
194
194
 
@@ -199,6 +199,10 @@ For example, if you have a queue with a `concurrencyLimit` of 1:
199
199
  - When the executing run reaches a waitpoint and checkpoints, it releases its slot
200
200
  - The next queued run can then begin execution
201
201
 
202
+ ### Short time-based waits keep their slot
203
+
204
+ Checkpointing takes time, so a run doesn't checkpoint the moment it reaches a waitpoint. For [`wait.for()`](/wait-for) and [`wait.until()`](/wait-until) it happens 60 seconds into the wait, so anything shorter stays `EXECUTING` and holds its slot for the whole wait. If you're polling in a loop, use an interval comfortably above 60 seconds so the slot is actually released between polls.
205
+
202
206
  ### Waiting for a subtask on a different queue
203
207
 
204
208
  When a parent task triggers and waits for a subtask on a different queue, the parent task will checkpoint and release its concurrency slot once it reaches the wait point. This prevents environment deadlocks where all concurrency slots would be occupied by waiting tasks.
@@ -1,5 +1,6 @@
1
1
  ---
2
- title: "Bulk actions"
2
+ title: "Bulk actions with the SDK"
3
+ sidebarTitle: "Bulk actions"
3
4
  description: "Cancel or replay many runs from the SDK using run IDs or SDK run-list filters."
4
5
  ---
5
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trigger.dev/sdk",
3
- "version": "4.5.8",
3
+ "version": "4.5.9",
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.8",
69
+ "@trigger.dev/core": "4.5.9",
70
70
  "chalk": "^5.2.0",
71
71
  "cronstrue": "^2.21.0",
72
72
  "debug": "^4.3.4",