@trigger.dev/core 3.0.0-beta.45 → 3.0.0-beta.47

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 (67) hide show
  1. package/dist/{catalog-mlNxCacM.d.ts → catalog-N-X0Te3W.d.mts} +5 -23
  2. package/dist/{catalog-QcLmPVsr.d.mts → catalog-NxVZnWZh.d.ts} +5 -23
  3. package/dist/{common-55Mqj8JP.d.mts → common-fIyU5pmz.d.mts} +13 -0
  4. package/dist/{common-55Mqj8JP.d.ts → common-fIyU5pmz.d.ts} +13 -0
  5. package/dist/{manager-6NRInm7C.d.ts → manager-2ZQ3_twq.d.ts} +1 -1
  6. package/dist/{manager-2AqSY67c.d.mts → manager-X_HrWQ7_.d.mts} +1 -1
  7. package/dist/{messages-EJX0bMsF.d.mts → messages-Sggr4tid.d.mts} +233 -70
  8. package/dist/{messages-EJX0bMsF.d.ts → messages-Sggr4tid.d.ts} +233 -70
  9. package/dist/{schemas-Sb0sJcEt.d.mts → schemas-Zy7mGFgD.d.mts} +22 -0
  10. package/dist/{schemas-Sb0sJcEt.d.ts → schemas-Zy7mGFgD.d.ts} +22 -0
  11. package/dist/tracer-N0p2Fuuv.d.mts +23 -0
  12. package/dist/tracer-N0p2Fuuv.d.ts +23 -0
  13. package/dist/v3/dev/index.d.mts +2 -2
  14. package/dist/v3/dev/index.d.ts +2 -2
  15. package/dist/v3/dev/index.js.map +1 -1
  16. package/dist/v3/dev/index.mjs.map +1 -1
  17. package/dist/v3/index.d.mts +50 -38
  18. package/dist/v3/index.d.ts +50 -38
  19. package/dist/v3/index.js +503 -343
  20. package/dist/v3/index.js.map +1 -1
  21. package/dist/v3/index.mjs +499 -344
  22. package/dist/v3/index.mjs.map +1 -1
  23. package/dist/v3/otel/index.js +15 -5
  24. package/dist/v3/otel/index.js.map +1 -1
  25. package/dist/v3/otel/index.mjs +15 -5
  26. package/dist/v3/otel/index.mjs.map +1 -1
  27. package/dist/v3/prod/index.d.mts +4 -4
  28. package/dist/v3/prod/index.d.ts +4 -4
  29. package/dist/v3/prod/index.js +7 -131
  30. package/dist/v3/prod/index.js.map +1 -1
  31. package/dist/v3/prod/index.mjs +7 -131
  32. package/dist/v3/prod/index.mjs.map +1 -1
  33. package/dist/v3/schemas/index.d.mts +16 -4
  34. package/dist/v3/schemas/index.d.ts +16 -4
  35. package/dist/v3/schemas/index.js +35 -40
  36. package/dist/v3/schemas/index.js.map +1 -1
  37. package/dist/v3/schemas/index.mjs +35 -41
  38. package/dist/v3/schemas/index.mjs.map +1 -1
  39. package/dist/v3/utils/timers.d.mts +6 -0
  40. package/dist/v3/utils/timers.d.ts +6 -0
  41. package/dist/v3/utils/timers.js +31 -0
  42. package/dist/v3/utils/timers.js.map +1 -0
  43. package/dist/v3/utils/timers.mjs +28 -0
  44. package/dist/v3/utils/timers.mjs.map +1 -0
  45. package/dist/v3/workers/index.d.mts +7 -6
  46. package/dist/v3/workers/index.d.ts +7 -6
  47. package/dist/v3/workers/index.js +251 -96
  48. package/dist/v3/workers/index.js.map +1 -1
  49. package/dist/v3/workers/index.mjs +251 -96
  50. package/dist/v3/workers/index.mjs.map +1 -1
  51. package/dist/v3/zodNamespace.js +41 -18
  52. package/dist/v3/zodNamespace.js.map +1 -1
  53. package/dist/v3/zodNamespace.mjs +42 -19
  54. package/dist/v3/zodNamespace.mjs.map +1 -1
  55. package/dist/v3/zodSocket.d.mts +8 -3
  56. package/dist/v3/zodSocket.d.ts +8 -3
  57. package/dist/v3/zodSocket.js +56 -25
  58. package/dist/v3/zodSocket.js.map +1 -1
  59. package/dist/v3/zodSocket.mjs +57 -26
  60. package/dist/v3/zodSocket.mjs.map +1 -1
  61. package/dist/v3/zodfetch.d.mts +15 -2
  62. package/dist/v3/zodfetch.d.ts +15 -2
  63. package/dist/v3/zodfetch.js +248 -28
  64. package/dist/v3/zodfetch.js.map +1 -1
  65. package/dist/v3/zodfetch.mjs +246 -29
  66. package/dist/v3/zodfetch.mjs.map +1 -1
  67. package/package.json +10 -2
@@ -1,28 +1,10 @@
1
- import { Context as Context$1, Span, SpanOptions, Tracer } from '@opentelemetry/api';
1
+ import { Span, SpanOptions } from '@opentelemetry/api';
2
2
  import { Logger } from '@opentelemetry/api-logs';
3
- import { M as MachinePresetName, a as TaskRunContext } from './common-55Mqj8JP.js';
4
- import { R as RetryOptions, P as Prettify, b as TaskMetadata, T as TaskFileMetadata, a as TaskMetadataWithFilePath } from './schemas-Sb0sJcEt.js';
3
+ import { T as TriggerTracer } from './tracer-N0p2Fuuv.mjs';
4
+ import { M as MachinePresetName, a as TaskRunContext } from './common-fIyU5pmz.mjs';
5
+ import { R as RetryOptions, P as Prettify, b as TaskMetadata, T as TaskFileMetadata, a as TaskMetadataWithFilePath } from './schemas-Zy7mGFgD.mjs';
5
6
  import { InstrumentationOption } from '@opentelemetry/instrumentation';
6
7
 
7
- type TriggerTracerConfig = {
8
- name: string;
9
- version: string;
10
- } | {
11
- tracer: Tracer;
12
- logger: Logger;
13
- };
14
- declare class TriggerTracer {
15
- private readonly _config;
16
- constructor(_config: TriggerTracerConfig);
17
- private _tracer;
18
- private get tracer();
19
- private _logger;
20
- private get logger();
21
- extractContext(traceContext?: Record<string, unknown>): Context$1;
22
- startActiveSpan<T>(name: string, fn: (span: Span) => Promise<T>, options?: SpanOptions, ctx?: Context$1): Promise<T>;
23
- startSpan(name: string, options?: SpanOptions, ctx?: Context$1): Span;
24
- }
25
-
26
8
  type LogLevel = "none" | "error" | "warn" | "info" | "debug" | "log";
27
9
  declare const logLevels: Array<LogLevel>;
28
10
  type TaskLoggerConfig = {
@@ -239,4 +221,4 @@ interface TaskCatalog {
239
221
  taskExists(id: string): boolean;
240
222
  }
241
223
 
242
- export { type Clock as C, type FailureFnParams as F, type HandleErrorFunction as H, type InitOutput as I, type LogLevel as L, type MiddlewareFnParams as M, OtelTaskLogger as O, type ProjectConfig as P, type RunFnParams as R, type StartFnParams as S, TriggerTracer as T, type UsageMeasurement as U, type TaskMetadataWithFunctions as a, type ClockTime as b, type TaskCatalog as c, type UsageManager as d, type UsageSample as e, type TaskLogger as f, type InitFnParams as g, type Context as h, type SuccessFnParams as i, type HandleErrorFnParams as j, type HandleErrorModificationOptions as k, logLevels as l, type HandleErrorResult as m, type HandleErrorArgs as n, type ResolveEnvironmentVariablesResult as o, type ResolveEnvironmentVariablesParams as p, type ResolveEnvironmentVariablesFunction as q, usage as u };
224
+ export { type Clock as C, type FailureFnParams as F, type HandleErrorFunction as H, type InitOutput as I, type LogLevel as L, type MiddlewareFnParams as M, OtelTaskLogger as O, type ProjectConfig as P, type RunFnParams as R, type StartFnParams as S, type TaskMetadataWithFunctions as T, type UsageMeasurement as U, type ClockTime as a, type TaskCatalog as b, type UsageManager as c, type UsageSample as d, type TaskLogger as e, type InitFnParams as f, type Context as g, type SuccessFnParams as h, type HandleErrorFnParams as i, type HandleErrorModificationOptions as j, type HandleErrorResult as k, logLevels as l, type HandleErrorArgs as m, type ResolveEnvironmentVariablesResult as n, type ResolveEnvironmentVariablesParams as o, type ResolveEnvironmentVariablesFunction as p, usage as u };
@@ -1,28 +1,10 @@
1
- import { Context as Context$1, Span, SpanOptions, Tracer } from '@opentelemetry/api';
1
+ import { Span, SpanOptions } from '@opentelemetry/api';
2
2
  import { Logger } from '@opentelemetry/api-logs';
3
- import { M as MachinePresetName, a as TaskRunContext } from './common-55Mqj8JP.mjs';
4
- import { R as RetryOptions, P as Prettify, b as TaskMetadata, T as TaskFileMetadata, a as TaskMetadataWithFilePath } from './schemas-Sb0sJcEt.mjs';
3
+ import { T as TriggerTracer } from './tracer-N0p2Fuuv.js';
4
+ import { M as MachinePresetName, a as TaskRunContext } from './common-fIyU5pmz.js';
5
+ import { R as RetryOptions, P as Prettify, b as TaskMetadata, T as TaskFileMetadata, a as TaskMetadataWithFilePath } from './schemas-Zy7mGFgD.js';
5
6
  import { InstrumentationOption } from '@opentelemetry/instrumentation';
6
7
 
7
- type TriggerTracerConfig = {
8
- name: string;
9
- version: string;
10
- } | {
11
- tracer: Tracer;
12
- logger: Logger;
13
- };
14
- declare class TriggerTracer {
15
- private readonly _config;
16
- constructor(_config: TriggerTracerConfig);
17
- private _tracer;
18
- private get tracer();
19
- private _logger;
20
- private get logger();
21
- extractContext(traceContext?: Record<string, unknown>): Context$1;
22
- startActiveSpan<T>(name: string, fn: (span: Span) => Promise<T>, options?: SpanOptions, ctx?: Context$1): Promise<T>;
23
- startSpan(name: string, options?: SpanOptions, ctx?: Context$1): Span;
24
- }
25
-
26
8
  type LogLevel = "none" | "error" | "warn" | "info" | "debug" | "log";
27
9
  declare const logLevels: Array<LogLevel>;
28
10
  type TaskLoggerConfig = {
@@ -239,4 +221,4 @@ interface TaskCatalog {
239
221
  taskExists(id: string): boolean;
240
222
  }
241
223
 
242
- export { type Clock as C, type FailureFnParams as F, type HandleErrorFunction as H, type InitOutput as I, type LogLevel as L, type MiddlewareFnParams as M, OtelTaskLogger as O, type ProjectConfig as P, type RunFnParams as R, type StartFnParams as S, TriggerTracer as T, type UsageMeasurement as U, type TaskMetadataWithFunctions as a, type ClockTime as b, type TaskCatalog as c, type UsageManager as d, type UsageSample as e, type TaskLogger as f, type InitFnParams as g, type Context as h, type SuccessFnParams as i, type HandleErrorFnParams as j, type HandleErrorModificationOptions as k, logLevels as l, type HandleErrorResult as m, type HandleErrorArgs as n, type ResolveEnvironmentVariablesResult as o, type ResolveEnvironmentVariablesParams as p, type ResolveEnvironmentVariablesFunction as q, usage as u };
224
+ export { type Clock as C, type FailureFnParams as F, type HandleErrorFunction as H, type InitOutput as I, type LogLevel as L, type MiddlewareFnParams as M, OtelTaskLogger as O, type ProjectConfig as P, type RunFnParams as R, type StartFnParams as S, type TaskMetadataWithFunctions as T, type UsageMeasurement as U, type ClockTime as a, type TaskCatalog as b, type UsageManager as c, type UsageSample as d, type TaskLogger as e, type InitFnParams as f, type Context as g, type SuccessFnParams as h, type HandleErrorFnParams as i, type HandleErrorModificationOptions as j, type HandleErrorResult as k, logLevels as l, type HandleErrorArgs as m, type ResolveEnvironmentVariablesResult as n, type ResolveEnvironmentVariablesParams as o, type ResolveEnvironmentVariablesFunction as p, usage as u };
@@ -167,6 +167,7 @@ declare const TaskRun: z.ZodObject<{
167
167
  createdAt: z.ZodDate;
168
168
  startedAt: z.ZodDefault<z.ZodDate>;
169
169
  idempotencyKey: z.ZodOptional<z.ZodString>;
170
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
170
171
  durationMs: z.ZodDefault<z.ZodNumber>;
171
172
  costInCents: z.ZodDefault<z.ZodNumber>;
172
173
  baseCostInCents: z.ZodDefault<z.ZodNumber>;
@@ -183,6 +184,7 @@ declare const TaskRun: z.ZodObject<{
183
184
  baseCostInCents: number;
184
185
  context?: any;
185
186
  idempotencyKey?: string | undefined;
187
+ maxAttempts?: number | undefined;
186
188
  }, {
187
189
  id: string;
188
190
  payload: string;
@@ -193,6 +195,7 @@ declare const TaskRun: z.ZodObject<{
193
195
  isTest?: boolean | undefined;
194
196
  startedAt?: Date | undefined;
195
197
  idempotencyKey?: string | undefined;
198
+ maxAttempts?: number | undefined;
196
199
  durationMs?: number | undefined;
197
200
  costInCents?: number | undefined;
198
201
  baseCostInCents?: number | undefined;
@@ -344,6 +347,7 @@ declare const TaskRunExecution: z.ZodObject<{
344
347
  createdAt: z.ZodDate;
345
348
  startedAt: z.ZodDefault<z.ZodDate>;
346
349
  idempotencyKey: z.ZodOptional<z.ZodString>;
350
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
347
351
  durationMs: z.ZodDefault<z.ZodNumber>;
348
352
  costInCents: z.ZodDefault<z.ZodNumber>;
349
353
  baseCostInCents: z.ZodDefault<z.ZodNumber>;
@@ -360,6 +364,7 @@ declare const TaskRunExecution: z.ZodObject<{
360
364
  baseCostInCents: number;
361
365
  context?: any;
362
366
  idempotencyKey?: string | undefined;
367
+ maxAttempts?: number | undefined;
363
368
  }, {
364
369
  id: string;
365
370
  payload: string;
@@ -370,6 +375,7 @@ declare const TaskRunExecution: z.ZodObject<{
370
375
  isTest?: boolean | undefined;
371
376
  startedAt?: Date | undefined;
372
377
  idempotencyKey?: string | undefined;
378
+ maxAttempts?: number | undefined;
373
379
  durationMs?: number | undefined;
374
380
  costInCents?: number | undefined;
375
381
  baseCostInCents?: number | undefined;
@@ -476,6 +482,7 @@ declare const TaskRunExecution: z.ZodObject<{
476
482
  baseCostInCents: number;
477
483
  context?: any;
478
484
  idempotencyKey?: string | undefined;
485
+ maxAttempts?: number | undefined;
479
486
  };
480
487
  queue: {
481
488
  id: string;
@@ -530,6 +537,7 @@ declare const TaskRunExecution: z.ZodObject<{
530
537
  isTest?: boolean | undefined;
531
538
  startedAt?: Date | undefined;
532
539
  idempotencyKey?: string | undefined;
540
+ maxAttempts?: number | undefined;
533
541
  durationMs?: number | undefined;
534
542
  costInCents?: number | undefined;
535
543
  baseCostInCents?: number | undefined;
@@ -607,6 +615,7 @@ declare const TaskRunContext: z.ZodObject<{
607
615
  createdAt: z.ZodDate;
608
616
  startedAt: z.ZodDefault<z.ZodDate>;
609
617
  idempotencyKey: z.ZodOptional<z.ZodString>;
618
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
610
619
  durationMs: z.ZodDefault<z.ZodNumber>;
611
620
  costInCents: z.ZodDefault<z.ZodNumber>;
612
621
  baseCostInCents: z.ZodDefault<z.ZodNumber>;
@@ -621,6 +630,7 @@ declare const TaskRunContext: z.ZodObject<{
621
630
  baseCostInCents: number;
622
631
  context?: any;
623
632
  idempotencyKey?: string | undefined;
633
+ maxAttempts?: number | undefined;
624
634
  }, {
625
635
  id: string;
626
636
  tags: string[];
@@ -629,6 +639,7 @@ declare const TaskRunContext: z.ZodObject<{
629
639
  context?: any;
630
640
  isTest?: boolean | undefined;
631
641
  idempotencyKey?: string | undefined;
642
+ maxAttempts?: number | undefined;
632
643
  durationMs?: number | undefined;
633
644
  costInCents?: number | undefined;
634
645
  baseCostInCents?: number | undefined;
@@ -731,6 +742,7 @@ declare const TaskRunContext: z.ZodObject<{
731
742
  baseCostInCents: number;
732
743
  context?: any;
733
744
  idempotencyKey?: string | undefined;
745
+ maxAttempts?: number | undefined;
734
746
  };
735
747
  queue: {
736
748
  id: string;
@@ -781,6 +793,7 @@ declare const TaskRunContext: z.ZodObject<{
781
793
  context?: any;
782
794
  isTest?: boolean | undefined;
783
795
  idempotencyKey?: string | undefined;
796
+ maxAttempts?: number | undefined;
784
797
  durationMs?: number | undefined;
785
798
  costInCents?: number | undefined;
786
799
  baseCostInCents?: number | undefined;
@@ -167,6 +167,7 @@ declare const TaskRun: z.ZodObject<{
167
167
  createdAt: z.ZodDate;
168
168
  startedAt: z.ZodDefault<z.ZodDate>;
169
169
  idempotencyKey: z.ZodOptional<z.ZodString>;
170
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
170
171
  durationMs: z.ZodDefault<z.ZodNumber>;
171
172
  costInCents: z.ZodDefault<z.ZodNumber>;
172
173
  baseCostInCents: z.ZodDefault<z.ZodNumber>;
@@ -183,6 +184,7 @@ declare const TaskRun: z.ZodObject<{
183
184
  baseCostInCents: number;
184
185
  context?: any;
185
186
  idempotencyKey?: string | undefined;
187
+ maxAttempts?: number | undefined;
186
188
  }, {
187
189
  id: string;
188
190
  payload: string;
@@ -193,6 +195,7 @@ declare const TaskRun: z.ZodObject<{
193
195
  isTest?: boolean | undefined;
194
196
  startedAt?: Date | undefined;
195
197
  idempotencyKey?: string | undefined;
198
+ maxAttempts?: number | undefined;
196
199
  durationMs?: number | undefined;
197
200
  costInCents?: number | undefined;
198
201
  baseCostInCents?: number | undefined;
@@ -344,6 +347,7 @@ declare const TaskRunExecution: z.ZodObject<{
344
347
  createdAt: z.ZodDate;
345
348
  startedAt: z.ZodDefault<z.ZodDate>;
346
349
  idempotencyKey: z.ZodOptional<z.ZodString>;
350
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
347
351
  durationMs: z.ZodDefault<z.ZodNumber>;
348
352
  costInCents: z.ZodDefault<z.ZodNumber>;
349
353
  baseCostInCents: z.ZodDefault<z.ZodNumber>;
@@ -360,6 +364,7 @@ declare const TaskRunExecution: z.ZodObject<{
360
364
  baseCostInCents: number;
361
365
  context?: any;
362
366
  idempotencyKey?: string | undefined;
367
+ maxAttempts?: number | undefined;
363
368
  }, {
364
369
  id: string;
365
370
  payload: string;
@@ -370,6 +375,7 @@ declare const TaskRunExecution: z.ZodObject<{
370
375
  isTest?: boolean | undefined;
371
376
  startedAt?: Date | undefined;
372
377
  idempotencyKey?: string | undefined;
378
+ maxAttempts?: number | undefined;
373
379
  durationMs?: number | undefined;
374
380
  costInCents?: number | undefined;
375
381
  baseCostInCents?: number | undefined;
@@ -476,6 +482,7 @@ declare const TaskRunExecution: z.ZodObject<{
476
482
  baseCostInCents: number;
477
483
  context?: any;
478
484
  idempotencyKey?: string | undefined;
485
+ maxAttempts?: number | undefined;
479
486
  };
480
487
  queue: {
481
488
  id: string;
@@ -530,6 +537,7 @@ declare const TaskRunExecution: z.ZodObject<{
530
537
  isTest?: boolean | undefined;
531
538
  startedAt?: Date | undefined;
532
539
  idempotencyKey?: string | undefined;
540
+ maxAttempts?: number | undefined;
533
541
  durationMs?: number | undefined;
534
542
  costInCents?: number | undefined;
535
543
  baseCostInCents?: number | undefined;
@@ -607,6 +615,7 @@ declare const TaskRunContext: z.ZodObject<{
607
615
  createdAt: z.ZodDate;
608
616
  startedAt: z.ZodDefault<z.ZodDate>;
609
617
  idempotencyKey: z.ZodOptional<z.ZodString>;
618
+ maxAttempts: z.ZodOptional<z.ZodNumber>;
610
619
  durationMs: z.ZodDefault<z.ZodNumber>;
611
620
  costInCents: z.ZodDefault<z.ZodNumber>;
612
621
  baseCostInCents: z.ZodDefault<z.ZodNumber>;
@@ -621,6 +630,7 @@ declare const TaskRunContext: z.ZodObject<{
621
630
  baseCostInCents: number;
622
631
  context?: any;
623
632
  idempotencyKey?: string | undefined;
633
+ maxAttempts?: number | undefined;
624
634
  }, {
625
635
  id: string;
626
636
  tags: string[];
@@ -629,6 +639,7 @@ declare const TaskRunContext: z.ZodObject<{
629
639
  context?: any;
630
640
  isTest?: boolean | undefined;
631
641
  idempotencyKey?: string | undefined;
642
+ maxAttempts?: number | undefined;
632
643
  durationMs?: number | undefined;
633
644
  costInCents?: number | undefined;
634
645
  baseCostInCents?: number | undefined;
@@ -731,6 +742,7 @@ declare const TaskRunContext: z.ZodObject<{
731
742
  baseCostInCents: number;
732
743
  context?: any;
733
744
  idempotencyKey?: string | undefined;
745
+ maxAttempts?: number | undefined;
734
746
  };
735
747
  queue: {
736
748
  id: string;
@@ -781,6 +793,7 @@ declare const TaskRunContext: z.ZodObject<{
781
793
  context?: any;
782
794
  isTest?: boolean | undefined;
783
795
  idempotencyKey?: string | undefined;
796
+ maxAttempts?: number | undefined;
784
797
  durationMs?: number | undefined;
785
798
  costInCents?: number | undefined;
786
799
  baseCostInCents?: number | undefined;
@@ -1,4 +1,4 @@
1
- import { a as TaskRunContext, T as TaskRunExecutionResult, B as BatchTaskRunExecutionResult } from './common-55Mqj8JP.js';
1
+ import { a as TaskRunContext, T as TaskRunExecutionResult, B as BatchTaskRunExecutionResult } from './common-fIyU5pmz.js';
2
2
 
3
3
  interface RuntimeManager {
4
4
  disable(): void;
@@ -1,4 +1,4 @@
1
- import { a as TaskRunContext, T as TaskRunExecutionResult, B as BatchTaskRunExecutionResult } from './common-55Mqj8JP.mjs';
1
+ import { a as TaskRunContext, T as TaskRunExecutionResult, B as BatchTaskRunExecutionResult } from './common-fIyU5pmz.mjs';
2
2
 
3
3
  interface RuntimeManager {
4
4
  disable(): void;