@trigger.dev/sdk 4.5.9 → 4.5.10
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/package.json +2 -1
- package/dist/commonjs/v3/agentSkillsRuntime.js.map +1 -1
- package/dist/commonjs/v3/ai-shared.js.map +1 -1
- package/dist/commonjs/v3/ai.js +15 -1
- package/dist/commonjs/v3/ai.js.map +1 -1
- package/dist/commonjs/v3/aiAutoTelemetry.js.map +1 -1
- package/dist/commonjs/v3/auth.js.map +1 -1
- package/dist/commonjs/v3/batchDebounce.test.d.ts +1 -0
- package/dist/commonjs/v3/batchDebounce.test.js +189 -0
- package/dist/commonjs/v3/batchDebounce.test.js.map +1 -0
- package/dist/commonjs/v3/cache.js.map +1 -1
- package/dist/commonjs/v3/chat-client.d.ts +14 -1
- package/dist/commonjs/v3/chat-client.js +19 -2
- package/dist/commonjs/v3/chat-client.js.map +1 -1
- package/dist/commonjs/v3/chat-react.js +1 -1
- package/dist/commonjs/v3/chat-react.js.map +1 -1
- package/dist/commonjs/v3/chat-tab-coordinator.js.map +1 -1
- package/dist/commonjs/v3/chat-tab-coordinator.test.js.map +1 -1
- package/dist/commonjs/v3/chat.js +2 -2
- package/dist/commonjs/v3/chat.js.map +1 -1
- package/dist/commonjs/v3/chat.test.js.map +1 -1
- package/dist/commonjs/v3/config.js.map +1 -1
- package/dist/commonjs/v3/envvars.js.map +1 -1
- package/dist/commonjs/v3/hooks.js.map +1 -1
- package/dist/commonjs/v3/index.js.map +1 -1
- package/dist/commonjs/v3/locals.js.map +1 -1
- package/dist/commonjs/v3/metadata.js.map +1 -1
- package/dist/commonjs/v3/prompt.js.map +1 -1
- package/dist/commonjs/v3/promptManagement.js.map +1 -1
- package/dist/commonjs/v3/queues.js.map +1 -1
- package/dist/commonjs/v3/retry.js.map +1 -1
- package/dist/commonjs/v3/runs.d.ts +81 -81
- package/dist/commonjs/v3/runs.js.map +1 -1
- package/dist/commonjs/v3/schedules/index.js.map +1 -1
- package/dist/commonjs/v3/sessions.js.map +1 -1
- package/dist/commonjs/v3/shared.d.ts +2 -1
- package/dist/commonjs/v3/shared.js +7 -0
- package/dist/commonjs/v3/shared.js.map +1 -1
- package/dist/commonjs/v3/shared.test.js +9 -0
- package/dist/commonjs/v3/shared.test.js.map +1 -1
- package/dist/commonjs/v3/skill.js.map +1 -1
- package/dist/commonjs/v3/streams.js.map +1 -1
- package/dist/commonjs/v3/tasks.js.map +1 -1
- package/dist/commonjs/v3/test/mock-chat-agent.js.map +1 -1
- package/dist/commonjs/v3/test/test-session-handle.js.map +1 -1
- package/dist/commonjs/v3/triggerClient.js.map +1 -1
- package/dist/commonjs/v3/triggerClient.types.test.js.map +1 -1
- package/dist/commonjs/v3/wait.d.ts +6 -1
- package/dist/commonjs/v3/waitUntil.js.map +1 -1
- package/dist/commonjs/v3/webhooks.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/package.json +2 -1
- package/dist/esm/v3/ai.js +15 -1
- package/dist/esm/v3/ai.js.map +1 -1
- package/dist/esm/v3/auth.js.map +1 -1
- package/dist/esm/v3/batchDebounce.test.d.ts +1 -0
- package/dist/esm/v3/batchDebounce.test.js +187 -0
- package/dist/esm/v3/batchDebounce.test.js.map +1 -0
- package/dist/esm/v3/chat-client.d.ts +14 -1
- package/dist/esm/v3/chat-client.js +19 -2
- package/dist/esm/v3/chat-client.js.map +1 -1
- package/dist/esm/v3/chat-tab-coordinator.js.map +1 -1
- package/dist/esm/v3/chat-tab-coordinator.test.js.map +1 -1
- package/dist/esm/v3/chat.js +2 -2
- package/dist/esm/v3/chat.js.map +1 -1
- package/dist/esm/v3/chat.test.js.map +1 -1
- package/dist/esm/v3/metadata.js.map +1 -1
- package/dist/esm/v3/retry.js.map +1 -1
- package/dist/esm/v3/runs.d.ts +80 -80
- package/dist/esm/v3/sessions.js.map +1 -1
- package/dist/esm/v3/shared.d.ts +2 -1
- package/dist/esm/v3/shared.js +6 -0
- package/dist/esm/v3/shared.js.map +1 -1
- package/dist/esm/v3/shared.test.js +10 -1
- package/dist/esm/v3/shared.test.js.map +1 -1
- package/dist/esm/v3/test/mock-chat-agent.js.map +1 -1
- package/dist/esm/v3/test/test-session-handle.js.map +1 -1
- package/dist/esm/v3/triggerClient.js.map +1 -1
- package/dist/esm/v3/wait.d.ts +6 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai-chat/client-protocol.mdx +4 -2
- package/docs/ai-chat/fast-starts.mdx +4 -1
- package/docs/ai-chat/migrating-from-a-route-handler.mdx +592 -0
- package/docs/config/extensions/emitDecoratorMetadata.mdx +27 -4
- package/docs/mcp-tools.mdx +1 -1
- package/docs/self-hosting/docker.mdx +9 -0
- package/docs/self-hosting/env/supervisor.mdx +2 -1
- package/docs/self-hosting/env/webapp.mdx +5 -1
- package/docs/self-hosting/kubernetes.mdx +281 -221
- package/docs/triggering.mdx +16 -4
- package/package.json +4 -3
package/docs/triggering.mdx
CHANGED
|
@@ -873,7 +873,7 @@ The `debounce` option accepts:
|
|
|
873
873
|
- `key` - A unique string to identify the debounce group (scoped to the task)
|
|
874
874
|
- `delay` - Duration string specifying how long to delay. Supported units: `s` (seconds), `m` (minutes), `h`/`hr` (hours), `d` (days), `w` (weeks). Minimum is 1 second. Examples: `"5s"`, `"1m"`, `"2h30m"`
|
|
875
875
|
- `mode` - Optional. Controls which trigger's data is used: `"leading"` (default) or `"trailing"`
|
|
876
|
-
- `maxDelay` - Optional. Maximum total time from the first trigger before the run must execute. Uses the same duration format as `delay
|
|
876
|
+
- `maxDelay` - Optional. Maximum total time from the first trigger before the run must execute. Uses the same duration format as `delay`. Not set by default
|
|
877
877
|
|
|
878
878
|
**How it works:**
|
|
879
879
|
|
|
@@ -882,9 +882,18 @@ The `debounce` option accepts:
|
|
|
882
882
|
3. Once no new triggers occur within the delay duration, the run executes
|
|
883
883
|
4. After the run starts executing, a new trigger with the same key will create a new run
|
|
884
884
|
|
|
885
|
+
<Warning>
|
|
886
|
+
There is no time limit on step 2. While triggers keep arriving on the same key, the run keeps
|
|
887
|
+
being pushed back and never executes. A key triggered every 10 seconds with a `delay` of `"30s"`
|
|
888
|
+
runs 30 seconds after the triggers stop, however long that takes. Set `maxDelay` whenever the
|
|
889
|
+
work needs to happen eventually. This matters most with `triggerAndWait`: every parent waiting
|
|
890
|
+
on a debounced run stays blocked, and holds its concurrency, for as long as the run keeps being
|
|
891
|
+
pushed back.
|
|
892
|
+
</Warning>
|
|
893
|
+
|
|
885
894
|
**Limiting total delay with `maxDelay`:**
|
|
886
895
|
|
|
887
|
-
|
|
896
|
+
The `maxDelay` option sets an upper bound on the total delay from the first trigger, ensuring the run eventually executes even with constant activity.
|
|
888
897
|
|
|
889
898
|
```ts
|
|
890
899
|
await summarizeChat.trigger(
|
|
@@ -921,11 +930,14 @@ Consider `delay: "5s"` and `maxDelay: "30s"` with triggers arriving every 2 seco
|
|
|
921
930
|
|
|
922
931
|
Without `maxDelay`, continuous triggers would prevent the run from ever executing. With `maxDelay: "30s"`, execution is guaranteed within 30 seconds of the first trigger.
|
|
923
932
|
|
|
933
|
+
Keep `delay` well below `maxDelay`. A run is only pushed back while its new execution time stays inside `maxDelay`, so the room you have to push is `maxDelay` minus `delay`. Setting them equal, or setting `delay` higher, leaves no room at all, and the trigger is rejected rather than accepted as a debounce that could never collapse anything.
|
|
934
|
+
|
|
924
935
|
<Note>
|
|
925
936
|
The `maxDelay` value is evaluated from each trigger call, not stored with the original run. This
|
|
926
937
|
means if you pass different `maxDelay` values for the same debounce key, each trigger uses its own
|
|
927
|
-
`maxDelay` to check against the original run's creation time.
|
|
928
|
-
|
|
938
|
+
`maxDelay` to check against the original run's creation time. A trigger that omits `maxDelay`
|
|
939
|
+
has no bound at all, so a single call without it can push the run past the limit the other calls
|
|
940
|
+
set. Use the same `maxDelay` value for every trigger with the same debounce key.
|
|
929
941
|
</Note>
|
|
930
942
|
|
|
931
943
|
**Leading vs Trailing mode:**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trigger.dev/sdk",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.10",
|
|
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.10",
|
|
70
70
|
"chalk": "^5.2.0",
|
|
71
71
|
"cronstrue": "^2.21.0",
|
|
72
72
|
"debug": "^4.3.4",
|
|
@@ -87,9 +87,10 @@
|
|
|
87
87
|
"ai-v7": "npm:ai@7.0.0-canary.159",
|
|
88
88
|
"encoding": "^0.1.13",
|
|
89
89
|
"rimraf": "^6.0.1",
|
|
90
|
-
"tshy": "^
|
|
90
|
+
"tshy": "^4.1.3",
|
|
91
91
|
"tsx": "4.17.0",
|
|
92
92
|
"typed-emitter": "^2.1.0",
|
|
93
|
+
"typescript": "7.0.2",
|
|
93
94
|
"zod": "3.25.76"
|
|
94
95
|
},
|
|
95
96
|
"peerDependencies": {
|