@trigger.dev/core 0.0.0-v3-prerelease-20240612090234 → 0.0.0-v3-prerelease-20240618084116

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 (37) hide show
  1. package/dist/{catalog-XTlJQaMn.d.mts → catalog-BY89ZnAT.d.ts} +43 -3
  2. package/dist/{catalog-dRKTgwQ7.d.ts → catalog-bucrsOn7.d.mts} +43 -3
  3. package/dist/{manager-JkbddlcO.d.mts → manager-7wgeUu45.d.mts} +244 -1
  4. package/dist/{manager-JkbddlcO.d.ts → manager-7wgeUu45.d.ts} +244 -1
  5. package/dist/{messages-9lty-Du5.d.mts → messages-TXYTx0wj.d.mts} +2370 -141
  6. package/dist/{messages-9lty-Du5.d.ts → messages-TXYTx0wj.d.ts} +2370 -141
  7. package/dist/{schemas-r4ZP9S-F.d.mts → schemas-r_DPYnY7.d.mts} +199 -33
  8. package/dist/{schemas-r4ZP9S-F.d.ts → schemas-r_DPYnY7.d.ts} +199 -33
  9. package/dist/v3/dev/index.d.mts +1 -1
  10. package/dist/v3/dev/index.d.ts +1 -1
  11. package/dist/v3/index.d.mts +117 -52
  12. package/dist/v3/index.d.ts +117 -52
  13. package/dist/v3/index.js +204 -58
  14. package/dist/v3/index.js.map +1 -1
  15. package/dist/v3/index.mjs +199 -58
  16. package/dist/v3/index.mjs.map +1 -1
  17. package/dist/v3/otel/index.js +13 -3
  18. package/dist/v3/otel/index.js.map +1 -1
  19. package/dist/v3/otel/index.mjs +13 -3
  20. package/dist/v3/otel/index.mjs.map +1 -1
  21. package/dist/v3/prod/index.d.mts +2 -2
  22. package/dist/v3/prod/index.d.ts +2 -2
  23. package/dist/v3/prod/index.js.map +1 -1
  24. package/dist/v3/prod/index.mjs.map +1 -1
  25. package/dist/v3/workers/index.d.mts +54 -8
  26. package/dist/v3/workers/index.d.ts +54 -8
  27. package/dist/v3/workers/index.js +402 -41
  28. package/dist/v3/workers/index.js.map +1 -1
  29. package/dist/v3/workers/index.mjs +400 -42
  30. package/dist/v3/workers/index.mjs.map +1 -1
  31. package/dist/v3/zodIpc.js.map +1 -1
  32. package/dist/v3/zodIpc.mjs.map +1 -1
  33. package/dist/v3/zodMessageHandler.d.mts +1 -1
  34. package/dist/v3/zodMessageHandler.d.ts +1 -1
  35. package/dist/v3/zodfetch.d.mts +1 -1
  36. package/dist/v3/zodfetch.d.ts +1 -1
  37. package/package.json +3 -3
@@ -1,8 +1,8 @@
1
1
  import { Context as Context$1, Span, SpanOptions, Tracer } from '@opentelemetry/api';
2
2
  import { Logger } from '@opentelemetry/api-logs';
3
- import { R as RetryOptions, P as Prettify, b as TaskMetadata, T as TaskFileMetadata, a as TaskMetadataWithFilePath } from './schemas-r4ZP9S-F.mjs';
3
+ import { M as MachinePresetName, a as TaskRunContext } from './manager-7wgeUu45.js';
4
+ import { R as RetryOptions, P as Prettify, b as TaskMetadata, T as TaskFileMetadata, a as TaskMetadataWithFilePath } from './schemas-r_DPYnY7.js';
4
5
  import { InstrumentationOption } from '@opentelemetry/instrumentation';
5
- import { a as TaskRunContext } from './manager-JkbddlcO.mjs';
6
6
 
7
7
  type TriggerTracerConfig = {
8
8
  name: string;
@@ -60,6 +60,11 @@ interface ProjectConfig {
60
60
  default?: RetryOptions;
61
61
  };
62
62
  additionalPackages?: string[];
63
+ /**
64
+ * The default machine preset to use for your deployed trigger.dev tasks. You can override this on a per-task basis.
65
+ * @default "small-1x"
66
+ */
67
+ machine?: MachinePresetName;
63
68
  /**
64
69
  * List of additional files to include in your trigger.dev bundle. e.g. ["./prisma/schema.prisma"]
65
70
  *
@@ -183,12 +188,47 @@ type TaskMetadataWithFunctions = TaskMetadata & {
183
188
  };
184
189
  };
185
190
 
191
+ /**
192
+ * Contains two parts: the first part is the seconds, the second part is the nanoseconds.
193
+ *
194
+ */
186
195
  type ClockTime = [number, number];
187
196
  interface Clock {
188
197
  preciseNow(): ClockTime;
189
198
  reset(): void;
190
199
  }
191
200
 
201
+ type UsageSample = {
202
+ cpuTime: number;
203
+ wallTime: number;
204
+ };
205
+ interface UsageMeasurement {
206
+ sample(): UsageSample;
207
+ }
208
+ interface UsageManager {
209
+ disable(): void;
210
+ start(): UsageMeasurement;
211
+ stop(measurement: UsageMeasurement): UsageSample;
212
+ sample(): UsageSample | undefined;
213
+ pauseAsync<T>(cb: () => Promise<T>): Promise<T>;
214
+ }
215
+
216
+ declare class UsageAPI implements UsageManager {
217
+ #private;
218
+ private static _instance?;
219
+ private constructor();
220
+ static getInstance(): UsageAPI;
221
+ setGlobalUsageManager(manager: UsageManager): boolean;
222
+ disable(): void;
223
+ start(): UsageMeasurement;
224
+ stop(measurement: UsageMeasurement): UsageSample;
225
+ pauseAsync<T>(cb: () => Promise<T>): Promise<T>;
226
+ sample(): UsageSample | undefined;
227
+ }
228
+
229
+ /** Entrypoint for usage API */
230
+ declare const usage: UsageAPI;
231
+
192
232
  interface TaskCatalog {
193
233
  registerTaskMetadata(task: TaskMetadataWithFunctions): void;
194
234
  updateTaskMetadata(id: string, task: Partial<TaskMetadataWithFunctions>): void;
@@ -199,4 +239,4 @@ interface TaskCatalog {
199
239
  taskExists(id: string): boolean;
200
240
  }
201
241
 
202
- 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 TaskMetadataWithFunctions as a, type ClockTime as b, type TaskCatalog as c, type TaskLogger as d, type InitFnParams as e, type Context as f, type SuccessFnParams as g, type HandleErrorFnParams as h, type HandleErrorModificationOptions as i, type HandleErrorResult as j, type HandleErrorArgs as k, logLevels as l, type ResolveEnvironmentVariablesResult as m, type ResolveEnvironmentVariablesParams as n, type ResolveEnvironmentVariablesFunction as o };
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 };
@@ -1,8 +1,8 @@
1
1
  import { Context as Context$1, Span, SpanOptions, Tracer } from '@opentelemetry/api';
2
2
  import { Logger } from '@opentelemetry/api-logs';
3
- import { R as RetryOptions, P as Prettify, b as TaskMetadata, T as TaskFileMetadata, a as TaskMetadataWithFilePath } from './schemas-r4ZP9S-F.js';
3
+ import { M as MachinePresetName, a as TaskRunContext } from './manager-7wgeUu45.mjs';
4
+ import { R as RetryOptions, P as Prettify, b as TaskMetadata, T as TaskFileMetadata, a as TaskMetadataWithFilePath } from './schemas-r_DPYnY7.mjs';
4
5
  import { InstrumentationOption } from '@opentelemetry/instrumentation';
5
- import { a as TaskRunContext } from './manager-JkbddlcO.js';
6
6
 
7
7
  type TriggerTracerConfig = {
8
8
  name: string;
@@ -60,6 +60,11 @@ interface ProjectConfig {
60
60
  default?: RetryOptions;
61
61
  };
62
62
  additionalPackages?: string[];
63
+ /**
64
+ * The default machine preset to use for your deployed trigger.dev tasks. You can override this on a per-task basis.
65
+ * @default "small-1x"
66
+ */
67
+ machine?: MachinePresetName;
63
68
  /**
64
69
  * List of additional files to include in your trigger.dev bundle. e.g. ["./prisma/schema.prisma"]
65
70
  *
@@ -183,12 +188,47 @@ type TaskMetadataWithFunctions = TaskMetadata & {
183
188
  };
184
189
  };
185
190
 
191
+ /**
192
+ * Contains two parts: the first part is the seconds, the second part is the nanoseconds.
193
+ *
194
+ */
186
195
  type ClockTime = [number, number];
187
196
  interface Clock {
188
197
  preciseNow(): ClockTime;
189
198
  reset(): void;
190
199
  }
191
200
 
201
+ type UsageSample = {
202
+ cpuTime: number;
203
+ wallTime: number;
204
+ };
205
+ interface UsageMeasurement {
206
+ sample(): UsageSample;
207
+ }
208
+ interface UsageManager {
209
+ disable(): void;
210
+ start(): UsageMeasurement;
211
+ stop(measurement: UsageMeasurement): UsageSample;
212
+ sample(): UsageSample | undefined;
213
+ pauseAsync<T>(cb: () => Promise<T>): Promise<T>;
214
+ }
215
+
216
+ declare class UsageAPI implements UsageManager {
217
+ #private;
218
+ private static _instance?;
219
+ private constructor();
220
+ static getInstance(): UsageAPI;
221
+ setGlobalUsageManager(manager: UsageManager): boolean;
222
+ disable(): void;
223
+ start(): UsageMeasurement;
224
+ stop(measurement: UsageMeasurement): UsageSample;
225
+ pauseAsync<T>(cb: () => Promise<T>): Promise<T>;
226
+ sample(): UsageSample | undefined;
227
+ }
228
+
229
+ /** Entrypoint for usage API */
230
+ declare const usage: UsageAPI;
231
+
192
232
  interface TaskCatalog {
193
233
  registerTaskMetadata(task: TaskMetadataWithFunctions): void;
194
234
  updateTaskMetadata(id: string, task: Partial<TaskMetadataWithFunctions>): void;
@@ -199,4 +239,4 @@ interface TaskCatalog {
199
239
  taskExists(id: string): boolean;
200
240
  }
201
241
 
202
- 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 TaskMetadataWithFunctions as a, type ClockTime as b, type TaskCatalog as c, type TaskLogger as d, type InitFnParams as e, type Context as f, type SuccessFnParams as g, type HandleErrorFnParams as h, type HandleErrorModificationOptions as i, type HandleErrorResult as j, type HandleErrorArgs as k, logLevels as l, type ResolveEnvironmentVariablesResult as m, type ResolveEnvironmentVariablesParams as n, type ResolveEnvironmentVariablesFunction as o };
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 };