@trigger.dev/sdk 4.7.3 → 4.7.4

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.
Files changed (85) hide show
  1. package/dist/commonjs/v3/concurrencyLimits.d.ts +37 -7
  2. package/dist/commonjs/v3/concurrencyLimits.js +38 -70
  3. package/dist/commonjs/v3/concurrencyLimits.js.map +1 -1
  4. package/dist/commonjs/v3/index.d.ts +1 -1
  5. package/dist/commonjs/v3/index.js.map +1 -1
  6. package/dist/commonjs/v3/runs.d.ts +22 -1
  7. package/dist/commonjs/v3/runs.js +6 -3
  8. package/dist/commonjs/v3/runs.js.map +1 -1
  9. package/dist/commonjs/version.js +1 -1
  10. package/dist/esm/v3/concurrencyLimits.d.ts +37 -7
  11. package/dist/esm/v3/concurrencyLimits.js +38 -70
  12. package/dist/esm/v3/concurrencyLimits.js.map +1 -1
  13. package/dist/esm/v3/index.d.ts +1 -1
  14. package/dist/esm/v3/index.js.map +1 -1
  15. package/dist/esm/v3/runs.d.ts +22 -1
  16. package/dist/esm/v3/runs.js +6 -3
  17. package/dist/esm/v3/runs.js.map +1 -1
  18. package/dist/esm/version.js +1 -1
  19. package/docs/ai-chat/patterns/sub-agents.mdx +33 -0
  20. package/docs/apikeys.mdx +3 -3
  21. package/docs/billing-limits.mdx +1 -1
  22. package/docs/cli-env-commands.mdx +5 -4
  23. package/docs/cli-init-commands.mdx +27 -1
  24. package/docs/cli-login-commands.mdx +20 -0
  25. package/docs/cli-projects-commands.mdx +13 -1
  26. package/docs/cli-runs-commands.mdx +3 -2
  27. package/docs/cli-update-commands.mdx +9 -3
  28. package/docs/cli-whoami-commands.mdx +12 -0
  29. package/docs/concurrency.mdx +32 -0
  30. package/docs/config/extensions/audioWaveform.mdx +4 -1
  31. package/docs/config/extensions/overview.mdx +2 -0
  32. package/docs/config/extensions/prismaExtension.mdx +2 -3
  33. package/docs/config/extensions/puppeteer.mdx +3 -5
  34. package/docs/config/extensions/pythonExtension.mdx +9 -1
  35. package/docs/config/extensions/syncEnvVars.mdx +6 -0
  36. package/docs/deploy-environment-variables.mdx +1 -1
  37. package/docs/deployment/atomic-deployment.mdx +2 -0
  38. package/docs/deployment/dev-branches.mdx +5 -5
  39. package/docs/deployment/overview.mdx +8 -7
  40. package/docs/deployment/preview-branches.mdx +6 -3
  41. package/docs/errors-retrying.mdx +4 -4
  42. package/docs/how-it-works.mdx +5 -5
  43. package/docs/introduction.mdx +6 -0
  44. package/docs/limits.mdx +26 -8
  45. package/docs/logging.mdx +1 -1
  46. package/docs/machines.mdx +1 -1
  47. package/docs/mcp-introduction.mdx +8 -7
  48. package/docs/mcp-tools.mdx +15 -1
  49. package/docs/migrating-from-v3.mdx +1 -1
  50. package/docs/observability/dashboards.mdx +2 -0
  51. package/docs/observability/query.mdx +6 -2
  52. package/docs/private-networking/aws-console-setup.mdx +1 -1
  53. package/docs/private-networking/overview.mdx +1 -1
  54. package/docs/quick-start.mdx +3 -40
  55. package/docs/realtime/auth.mdx +1 -1
  56. package/docs/realtime/backend/input-streams.mdx +159 -0
  57. package/docs/realtime/backend/streams.mdx +25 -10
  58. package/docs/realtime/how-it-works.mdx +1 -1
  59. package/docs/realtime/react-hooks/overview.mdx +1 -1
  60. package/docs/realtime/react-hooks/streams.mdx +2 -2
  61. package/docs/realtime/react-hooks/subscribe.mdx +19 -3
  62. package/docs/realtime/react-hooks/triggering.mdx +2 -2
  63. package/docs/realtime/react-hooks/use-wait-token.mdx +1 -1
  64. package/docs/realtime/run-object.mdx +47 -24
  65. package/docs/replaying.mdx +26 -1
  66. package/docs/reports.mdx +4 -2
  67. package/docs/run-tests.mdx +2 -2
  68. package/docs/run-usage.mdx +3 -3
  69. package/docs/runs/heartbeats.mdx +2 -2
  70. package/docs/runs/list-best-practices.mdx +234 -0
  71. package/docs/runs/metadata.mdx +7 -10
  72. package/docs/runs.mdx +18 -8
  73. package/docs/self-hosting/env/supervisor.mdx +2 -0
  74. package/docs/self-hosting/env/webapp.mdx +5 -0
  75. package/docs/self-hosting/overview.mdx +26 -0
  76. package/docs/tags.mdx +6 -0
  77. package/docs/tasks/scheduled.mdx +11 -5
  78. package/docs/triggering.mdx +8 -0
  79. package/docs/troubleshooting-alerts.mdx +102 -3
  80. package/docs/troubleshooting.mdx +1 -1
  81. package/docs/upgrading-packages.mdx +3 -3
  82. package/docs/vercel-integration.mdx +13 -3
  83. package/docs/versioning.mdx +1 -1
  84. package/docs/wait-for-token.mdx +3 -3
  85. package/package.json +2 -2
@@ -243,13 +243,17 @@ This webhook is sent when a run fails. The payload is available on the `object`
243
243
  </ParamField>
244
244
 
245
245
  <ParamField path="object.environment.type" type="string">
246
- Environment type (STAGING or PRODUCTION)
246
+ Environment type (`PRODUCTION`, `STAGING`, or `PREVIEW`)
247
247
  </ParamField>
248
248
 
249
249
  <ParamField path="object.environment.slug" type="string">
250
250
  Environment slug
251
251
  </ParamField>
252
252
 
253
+ <ParamField path="object.environment.branchName" type="string">
254
+ Environment branch name (optional)
255
+ </ParamField>
256
+
253
257
  <ParamField path="object.organization.id" type="string">
254
258
  Organization ID
255
259
  </ParamField>
@@ -311,7 +315,7 @@ This webhook is sent when a deployment succeeds. The payload is available on the
311
315
  </ParamField>
312
316
 
313
317
  <ParamField path="object.environment.type" type="string">
314
- Environment type (STAGING or PRODUCTION)
318
+ Environment type (`PRODUCTION`, `STAGING`, or `PREVIEW`)
315
319
  </ParamField>
316
320
 
317
321
  <ParamField path="object.environment.slug" type="string">
@@ -346,6 +350,54 @@ This webhook is sent when a deployment succeeds. The payload is available on the
346
350
  Project name
347
351
  </ParamField>
348
352
 
353
+ <ParamField path="object.git" type="object">
354
+ Git metadata for the deployment (optional). When present, `branch`, `commitSha`, `commitMessage`, `commitUrl` and `branchUrl` are always set.
355
+ </ParamField>
356
+
357
+ <ParamField path="object.git.branch" type="string">
358
+ Git branch
359
+ </ParamField>
360
+
361
+ <ParamField path="object.git.commitSha" type="string">
362
+ Short commit SHA (first 7 characters)
363
+ </ParamField>
364
+
365
+ <ParamField path="object.git.commitMessage" type="string">
366
+ Commit message (empty string if unavailable)
367
+ </ParamField>
368
+
369
+ <ParamField path="object.git.commitUrl" type="string">
370
+ URL of the commit
371
+ </ParamField>
372
+
373
+ <ParamField path="object.git.branchUrl" type="string">
374
+ URL of the branch
375
+ </ParamField>
376
+
377
+ <ParamField path="object.git.pullRequestNumber" type="number">
378
+ Pull request number (optional)
379
+ </ParamField>
380
+
381
+ <ParamField path="object.git.pullRequestTitle" type="string">
382
+ Pull request title (optional)
383
+ </ParamField>
384
+
385
+ <ParamField path="object.git.pullRequestUrl" type="string">
386
+ Pull request URL (optional)
387
+ </ParamField>
388
+
389
+ <ParamField path="object.git.provider" type="string">
390
+ Git provider (optional)
391
+ </ParamField>
392
+
393
+ <ParamField path="object.vercel" type="object">
394
+ Vercel metadata for the deployment (optional)
395
+ </ParamField>
396
+
397
+ <ParamField path="object.vercel.deploymentUrl" type="string">
398
+ URL of the deployment in the Vercel dashboard
399
+ </ParamField>
400
+
349
401
  ### Deployment Failed Alert
350
402
 
351
403
  This webhook is sent when a deployment fails. The payload is available on the `object` property:
@@ -391,7 +443,7 @@ This webhook is sent when a deployment fails. The payload is available on the `o
391
443
  </ParamField>
392
444
 
393
445
  <ParamField path="object.environment.type" type="string">
394
- Environment type (STAGING or PRODUCTION)
446
+ Environment type (`PRODUCTION`, `STAGING`, or `PREVIEW`)
395
447
  </ParamField>
396
448
 
397
449
  <ParamField path="object.environment.slug" type="string">
@@ -426,6 +478,53 @@ This webhook is sent when a deployment fails. The payload is available on the `o
426
478
  Project name
427
479
  </ParamField>
428
480
 
481
+ <ParamField path="object.git" type="object">
482
+ Git metadata for the deployment (optional). When present, `branch`, `commitSha`, `commitMessage`, `commitUrl` and `branchUrl` are always set.
483
+ </ParamField>
484
+
485
+ <ParamField path="object.git.branch" type="string">
486
+ Git branch
487
+ </ParamField>
488
+
489
+ <ParamField path="object.git.commitSha" type="string">
490
+ Short commit SHA (first 7 characters)
491
+ </ParamField>
492
+
493
+ <ParamField path="object.git.commitMessage" type="string">
494
+ Commit message (empty string if unavailable)
495
+ </ParamField>
496
+
497
+ <ParamField path="object.git.commitUrl" type="string">
498
+ URL of the commit
499
+ </ParamField>
500
+
501
+ <ParamField path="object.git.branchUrl" type="string">
502
+ URL of the branch
503
+ </ParamField>
504
+
505
+ <ParamField path="object.git.pullRequestNumber" type="number">
506
+ Pull request number (optional)
507
+ </ParamField>
508
+
509
+ <ParamField path="object.git.pullRequestTitle" type="string">
510
+ Pull request title (optional)
511
+ </ParamField>
512
+
513
+ <ParamField path="object.git.pullRequestUrl" type="string">
514
+ Pull request URL (optional)
515
+ </ParamField>
516
+
517
+ <ParamField path="object.git.provider" type="string">
518
+ Git provider (optional)
519
+ </ParamField>
520
+
521
+ <ParamField path="object.vercel" type="object">
522
+ Vercel metadata for the deployment (optional)
523
+ </ParamField>
524
+
525
+ <ParamField path="object.vercel.deploymentUrl" type="string">
526
+ URL of the deployment in the Vercel dashboard
527
+ </ParamField>
429
528
 
430
529
  ### Error Group Alert
431
530
 
@@ -251,7 +251,7 @@ If runs are staying in the `QUEUED` state for extended periods, check your concu
251
251
  **Solutions:**
252
252
 
253
253
  - **Increase concurrency limits** - If you're on a paid plan, increase your environment concurrency limit via the dashboard
254
- - **Review queue concurrency limits** - Check if individual queues have restrictive `concurrencyLimit` settings
254
+ - **Review concurrency settings** - Check if your tasks have restrictive `concurrency` settings, or your queues a restrictive legacy `concurrencyLimit`. See [Concurrency](/concurrency)
255
255
  - **Check for stuck runs** - See if stalled runs are blocking new executions
256
256
 
257
257
  ### Runs queued because a billing limit was reached
@@ -39,12 +39,12 @@ You can deploy using [GitHub Actions](/github-actions). We recommend that you lo
39
39
 
40
40
  <Steps>
41
41
  <Step title="Find your workflow file">
42
- In your `.githubs/workflows` folder you can find your workflow yml files. You may have a prod
42
+ In your `.github/workflows` folder you can find your workflow yml files. You may have a prod
43
43
  and staging one.
44
44
  </Step>
45
45
  <Step title="Update the version for the run command">
46
46
  In the steps you'll see a `run` command. It will run the trigger.dev deploy CLI command. Make
47
- sure to update this version to the latest version (e.g. `npx trigger.dev@3.0.0 deploy`).
47
+ sure to update this version to the latest version (e.g. `npx trigger.dev@4.7.3 deploy`).
48
48
  </Step>
49
49
  </Steps>
50
50
 
@@ -57,7 +57,7 @@ For example:
57
57
  ```json
58
58
  {
59
59
  "devDependencies": {
60
- "trigger.dev": "3.0.0"
60
+ "trigger.dev": "4.7.3"
61
61
  }
62
62
  }
63
63
  ```
@@ -129,7 +129,17 @@ The integration sets this up for you:
129
129
  - It passes your commit SHA as the deployment's external id.
130
130
  - `VERCEL_GIT_COMMIT_SHA` is available at runtime on Vercel, so the SDK finds the matching id with no work from you.
131
131
 
132
- There is nothing to enable, and it works in production, staging and preview alike. Nothing is gated: your Vercel deployment is never held back.
132
+ There is nothing to enable, and it works in production, staging and preview alike.
133
+
134
+ ### Production waits for your tasks
135
+
136
+ A production deployment from a push to the branch Trigger.dev builds for production gets a blocking **Trigger.dev Build** check. Vercel holds the deployment until the task build for the same commit finishes, then assigns your production domains as usual. If the task build fails or is canceled, the check fails and the Vercel deployment doesn't go live, so your app never ships against tasks that didn't build.
137
+
138
+ If no task build for the commit has started within 10 minutes, the check fails too.
139
+
140
+ To retry after a failed build, re-run the **Trigger.dev deployment** check on the commit in GitHub. Once that build succeeds, redeploy from Vercel or push a new commit.
141
+
142
+ A production deployment with no task build to wait for is never held: its check is marked skipped. That covers deployments from the Vercel CLI, from a branch that isn't your production branch in Trigger.dev, and from projects without a connected GitHub repository. Preview and staging deployments aren't held either: their check passes straight away, and version skew protection makes their runs wait for the matching task build instead.
133
143
 
134
144
  <Note>
135
145
  Version skew protection requires the `@trigger.dev/sdk` release that introduces external
@@ -146,8 +156,8 @@ To opt out, set `TRIGGER_AUTOMATIC_SKEW_VERSION_PROTECTION` to `0` on your Verce
146
156
  <Warning>
147
157
  **Automatic atomic deployments are deprecated.** Use [version skew
148
158
  protection](/deployment/atomic-deployment) instead — it needs no second Vercel deployment,
149
- never gates your app's deploy, doesn't touch `Auto-assign Custom Production Domains`, and covers
150
- staging and preview as well as production.
159
+ doesn't touch `Auto-assign Custom Production Domains`, and covers staging and preview as well as
160
+ production. Production deployments still wait for your task build through the blocking check.
151
161
 
152
162
  Nothing is being switched off. The setting stays in your project's Vercel settings, keeps working,
153
163
  and remains the way to hold your Vercel deployment back until your tasks have built. New
@@ -51,7 +51,7 @@ Because your application and your tasks deploy separately, a release of your app
51
51
 
52
52
  ## Retries and reattempts
53
53
 
54
- When a task has an uncaught error it will [retry](/errors-retrying), assuming you have not set `maxAttempts` to 0. Retries are locked to the original version of the run.
54
+ When a task has an uncaught error it will [retry](/errors-retrying), if the task has retries configured (the `retry` option or `retries.default` in your config). Retries are locked to the original version of the run.
55
55
 
56
56
  ## Replays
57
57
 
@@ -135,7 +135,7 @@ Create a waitpoint token.
135
135
  The `createToken` function accepts an object with the following properties:
136
136
 
137
137
  <ParamField query="timeout" type="string" optional>
138
- The maximum amount of time to wait for the token to be completed. Defaults to "10m".
138
+ The maximum amount of time to wait for the token to be completed. If omitted, the token has no timeout. Accepts a duration string like `"30s"` or `"4w"`, or a `Date`.
139
139
  </ParamField>
140
140
 
141
141
  <ParamField query="idempotencyKey" type="string" optional>
@@ -144,7 +144,7 @@ The `createToken` function accepts an object with the following properties:
144
144
  </ParamField>
145
145
 
146
146
  <ParamField query="idempotencyKeyTTL" type="string" optional>
147
- The time to live for the idempotency key. Defaults to "1h".
147
+ The time to live for the idempotency key. If omitted, the key does not expire.
148
148
  </ParamField>
149
149
 
150
150
  <ParamField query="tags" type="string[]" optional>
@@ -380,7 +380,7 @@ The `listTokens` function accepts an object with the following properties:
380
380
  </ParamField>
381
381
 
382
382
  <ParamField query="period" type="string" optional>
383
- The period to filter by. Can be one of: `1h`, `1d`, `7d`, `30d`.
383
+ The period to filter by, as a duration string such as `1h`, `1d`, `7d` or `30d`.
384
384
  </ParamField>
385
385
 
386
386
  <ParamField query="from" type="Date | number" optional>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trigger.dev/sdk",
3
- "version": "4.7.3",
3
+ "version": "4.7.4",
4
4
  "description": "trigger.dev Node.JS SDK",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -69,7 +69,7 @@
69
69
  "dependencies": {
70
70
  "@opentelemetry/api": "1.9.1",
71
71
  "@opentelemetry/semantic-conventions": "1.41.1",
72
- "@trigger.dev/core": "4.7.3",
72
+ "@trigger.dev/core": "4.7.4",
73
73
  "uncrypto": "^0.1.3"
74
74
  },
75
75
  "devDependencies": {