@trigger.dev/core 3.0.0-beta.26 → 3.0.0-beta.28

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.
@@ -30,7 +30,7 @@ declare class TriggerTracer {
30
30
  startSpan(name: string, options?: SpanOptions, ctx?: Context$1): Span;
31
31
  }
32
32
 
33
- type LogLevel = "none" | "log" | "error" | "warn" | "info" | "debug";
33
+ type LogLevel = "none" | "error" | "warn" | "info" | "debug" | "log";
34
34
  declare const logLevels: Array<LogLevel>;
35
35
  type TaskLoggerConfig = {
36
36
  logger: Logger;
@@ -88,11 +88,11 @@ interface ProjectConfig {
88
88
  */
89
89
  instrumentations?: InstrumentationOption[];
90
90
  /**
91
- * Set the log level for the logger. Defaults to "log", so you will see "log", "warn", and "error" messages, but not "info", or "debug" messages.
91
+ * Set the log level for the logger. Defaults to "info", so you will see "log", "info", "warn", and "error" messages, but not "debug" messages.
92
92
  *
93
93
  * We automatically set the logLevel to "debug" during test runs
94
94
  *
95
- * @default "log"
95
+ * @default "info"
96
96
  */
97
97
  logLevel?: LogLevel;
98
98
  /**
@@ -30,7 +30,7 @@ declare class TriggerTracer {
30
30
  startSpan(name: string, options?: SpanOptions, ctx?: Context$1): Span;
31
31
  }
32
32
 
33
- type LogLevel = "none" | "log" | "error" | "warn" | "info" | "debug";
33
+ type LogLevel = "none" | "error" | "warn" | "info" | "debug" | "log";
34
34
  declare const logLevels: Array<LogLevel>;
35
35
  type TaskLoggerConfig = {
36
36
  logger: Logger;
@@ -88,11 +88,11 @@ interface ProjectConfig {
88
88
  */
89
89
  instrumentations?: InstrumentationOption[];
90
90
  /**
91
- * Set the log level for the logger. Defaults to "log", so you will see "log", "warn", and "error" messages, but not "info", or "debug" messages.
91
+ * Set the log level for the logger. Defaults to "info", so you will see "log", "info", "warn", and "error" messages, but not "debug" messages.
92
92
  *
93
93
  * We automatically set the logLevel to "debug" during test runs
94
94
  *
95
- * @default "log"
95
+ * @default "info"
96
96
  */
97
97
  logLevel?: LogLevel;
98
98
  /**
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { T as TaskRunExecutionResult, B as BatchTaskRunExecutionResult, a as TaskRunError, b as TaskRunContext, R as RuntimeManager } from '../manager-WNMVbgHf.mjs';
3
3
  export { h as TaskRun, c as TaskRunBuiltInError, d as TaskRunCustomErrorObject, f as TaskRunErrorCodes, p as TaskRunExecution, j as TaskRunExecutionAttempt, o as TaskRunExecutionBatch, k as TaskRunExecutionEnvironment, l as TaskRunExecutionOrganization, m as TaskRunExecutionProject, n as TaskRunExecutionQueue, q as TaskRunExecutionRetry, i as TaskRunExecutionTask, r as TaskRunFailedExecutionResult, g as TaskRunInternalError, e as TaskRunStringError, s as TaskRunSuccessfulExecutionResult } from '../manager-WNMVbgHf.mjs';
4
- import { P as Prettify, C as Clock, a as ClockTime, T as TaskLogger, b as TaskCatalog, c as TaskMetadataWithFunctions, d as TaskFileMetadata, e as TaskMetadataWithFilePath, R as RetryOptions, f as TriggerTracer } from '../catalog-g2Qc0Ukb.mjs';
5
- export { p as Config, v as Context, E as EnvironmentType, x as FailureFnParams, F as FixedWindowRateLimit, A as HandleErrorArgs, H as HandleErrorFnParams, B as HandleErrorFunction, y as HandleErrorModificationOptions, z as HandleErrorResult, t as InitFnParams, I as InitOutput, L as LogLevel, h as Machine, M as MachineCpu, g as MachineMemory, s as MiddlewareFnParams, n as PostStartCauses, o as PreStopCauses, j as ProdTaskRunExecution, k as ProdTaskRunExecutionPayload, G as ProjectConfig, Q as QueueOptions, l as RateLimitOptions, D as RequireKeys, q as ResolvedConfig, r as RunFnParams, S as SlidingWindowRateLimit, u as StartFnParams, w as SuccessFnParams, m as TaskMetadata, i as TaskRunExecutionPayload, W as WaitReason } from '../catalog-g2Qc0Ukb.mjs';
4
+ import { P as Prettify, C as Clock, a as ClockTime, T as TaskLogger, b as TaskCatalog, c as TaskMetadataWithFunctions, d as TaskFileMetadata, e as TaskMetadataWithFilePath, R as RetryOptions, f as TriggerTracer } from '../catalog-ck7x04PV.mjs';
5
+ export { p as Config, v as Context, E as EnvironmentType, x as FailureFnParams, F as FixedWindowRateLimit, A as HandleErrorArgs, H as HandleErrorFnParams, B as HandleErrorFunction, y as HandleErrorModificationOptions, z as HandleErrorResult, t as InitFnParams, I as InitOutput, L as LogLevel, h as Machine, M as MachineCpu, g as MachineMemory, s as MiddlewareFnParams, n as PostStartCauses, o as PreStopCauses, j as ProdTaskRunExecution, k as ProdTaskRunExecutionPayload, G as ProjectConfig, Q as QueueOptions, l as RateLimitOptions, D as RequireKeys, q as ResolvedConfig, r as RunFnParams, S as SlidingWindowRateLimit, u as StartFnParams, w as SuccessFnParams, m as TaskMetadata, i as TaskRunExecutionPayload, W as WaitReason } from '../catalog-ck7x04PV.mjs';
6
6
  import { Attributes, Span } from '@opentelemetry/api';
7
7
  import { B as BackgroundWorkerProperties } from '../messages-vq7Bk4Ap.mjs';
8
8
  export { b as BackgroundWorkerClientMessages, a as BackgroundWorkerServerMessages, i as ClientToSharedQueueMessages, C as CoordinatorToPlatformMessages, k as CoordinatorToProdWorkerMessages, h as PlatformToCoordinatorMessages, g as PlatformToProviderMessages, P as ProdChildToWorkerMessages, l as ProdWorkerSocketData, e as ProdWorkerToChildMessages, j as ProdWorkerToCoordinatorMessages, f as ProviderToPlatformMessages, S as SharedQueueToClientMessages, T as TaskMetadataFailedToParseData, U as UncaughtExceptionMessage, d as childToWorkerMessages, c as clientWebsocketMessages, s as serverWebsocketMessages, w as workerToChildMessages } from '../messages-vq7Bk4Ap.mjs';
@@ -2276,6 +2276,74 @@ declare const ListScheduleOptions: z.ZodObject<{
2276
2276
  perPage?: number | undefined;
2277
2277
  }>;
2278
2278
  type ListScheduleOptions = z.infer<typeof ListScheduleOptions>;
2279
+ declare const RunStatus: z.ZodEnum<["PENDING", "EXECUTING", "PAUSED", "COMPLETED", "FAILED", "CANCELED"]>;
2280
+ type RunStatus = z.infer<typeof RunStatus>;
2281
+ declare const AttemptStatus: z.ZodEnum<["PENDING", "EXECUTING", "PAUSED", "COMPLETED", "FAILED", "CANCELED"]>;
2282
+ type AttemptStatus = z.infer<typeof AttemptStatus>;
2283
+ declare const RetrieveRunResponse: z.ZodObject<{
2284
+ id: z.ZodString;
2285
+ status: z.ZodEnum<["PENDING", "EXECUTING", "PAUSED", "COMPLETED", "FAILED", "CANCELED"]>;
2286
+ taskIdentifier: z.ZodString;
2287
+ idempotencyKey: z.ZodOptional<z.ZodString>;
2288
+ version: z.ZodOptional<z.ZodString>;
2289
+ createdAt: z.ZodDate;
2290
+ updatedAt: z.ZodDate;
2291
+ attempts: z.ZodArray<z.ZodOptional<z.ZodObject<{
2292
+ id: z.ZodString;
2293
+ status: z.ZodEnum<["PENDING", "EXECUTING", "PAUSED", "COMPLETED", "FAILED", "CANCELED"]>;
2294
+ createdAt: z.ZodDate;
2295
+ updatedAt: z.ZodDate;
2296
+ startedAt: z.ZodOptional<z.ZodDate>;
2297
+ completedAt: z.ZodOptional<z.ZodDate>;
2298
+ }, "strip", z.ZodTypeAny, {
2299
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2300
+ id: string;
2301
+ createdAt: Date;
2302
+ updatedAt: Date;
2303
+ startedAt?: Date | undefined;
2304
+ completedAt?: Date | undefined;
2305
+ }, {
2306
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2307
+ id: string;
2308
+ createdAt: Date;
2309
+ updatedAt: Date;
2310
+ startedAt?: Date | undefined;
2311
+ completedAt?: Date | undefined;
2312
+ }>>, "many">;
2313
+ }, "strip", z.ZodTypeAny, {
2314
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2315
+ id: string;
2316
+ createdAt: Date;
2317
+ taskIdentifier: string;
2318
+ updatedAt: Date;
2319
+ attempts: ({
2320
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2321
+ id: string;
2322
+ createdAt: Date;
2323
+ updatedAt: Date;
2324
+ startedAt?: Date | undefined;
2325
+ completedAt?: Date | undefined;
2326
+ } | undefined)[];
2327
+ idempotencyKey?: string | undefined;
2328
+ version?: string | undefined;
2329
+ }, {
2330
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2331
+ id: string;
2332
+ createdAt: Date;
2333
+ taskIdentifier: string;
2334
+ updatedAt: Date;
2335
+ attempts: ({
2336
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2337
+ id: string;
2338
+ createdAt: Date;
2339
+ updatedAt: Date;
2340
+ startedAt?: Date | undefined;
2341
+ completedAt?: Date | undefined;
2342
+ } | undefined)[];
2343
+ idempotencyKey?: string | undefined;
2344
+ version?: string | undefined;
2345
+ }>;
2346
+ type RetrieveRunResponse = z.infer<typeof RetrieveRunResponse>;
2279
2347
 
2280
2348
  declare const TaskResource: z.ZodObject<{
2281
2349
  id: z.ZodString;
@@ -3976,6 +4044,23 @@ declare class ApiClient {
3976
4044
  getPayloadUrl(filename: string): Promise<{
3977
4045
  presignedUrl: string;
3978
4046
  }>;
4047
+ retrieveRun(runId: string): Promise<{
4048
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
4049
+ id: string;
4050
+ createdAt: Date;
4051
+ taskIdentifier: string;
4052
+ updatedAt: Date;
4053
+ attempts: ({
4054
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
4055
+ id: string;
4056
+ createdAt: Date;
4057
+ updatedAt: Date;
4058
+ startedAt?: Date | undefined;
4059
+ completedAt?: Date | undefined;
4060
+ } | undefined)[];
4061
+ idempotencyKey?: string | undefined;
4062
+ version?: string | undefined;
4063
+ }>;
3979
4064
  replayRun(runId: string): Promise<{
3980
4065
  id: string;
3981
4066
  }>;
@@ -4101,19 +4186,6 @@ declare class ApiClient {
4101
4186
  id: string;
4102
4187
  }>;
4103
4188
  }
4104
- type ApiClientContext = {
4105
- baseURL: string;
4106
- accessToken: string;
4107
- };
4108
- declare class ApiClientManager {
4109
- #private;
4110
- private _storage;
4111
- get baseURL(): string | undefined;
4112
- get accessToken(): string | undefined;
4113
- get client(): ApiClient | undefined;
4114
- runWith<R extends (...args: any[]) => Promise<any>>(context: ApiClientContext, fn: R): Promise<ReturnType<R>>;
4115
- }
4116
- declare const apiClientManager: ApiClientManager;
4117
4189
 
4118
4190
  type APIHeaders = Record<string, string | null | undefined>;
4119
4191
  declare class APIError extends Error {
@@ -4261,6 +4333,26 @@ declare class TaskContextAPI {
4261
4333
  /** Entrypoint for logger API */
4262
4334
  declare const taskContext: TaskContextAPI;
4263
4335
 
4336
+ type ApiClientConfiguration = {
4337
+ baseURL?: string;
4338
+ secretKey?: string;
4339
+ };
4340
+
4341
+ declare class APIClientManagerAPI {
4342
+ #private;
4343
+ private static _instance?;
4344
+ private constructor();
4345
+ static getInstance(): APIClientManagerAPI;
4346
+ disable(): void;
4347
+ setGlobalAPIClientConfiguration(config: ApiClientConfiguration): boolean;
4348
+ get baseURL(): string | undefined;
4349
+ get accessToken(): string | undefined;
4350
+ get client(): ApiClient | undefined;
4351
+ }
4352
+
4353
+ /** Entrypoint for logger API */
4354
+ declare const apiClientManager: APIClientManagerAPI;
4355
+
4264
4356
  declare const SemanticInternalAttributes: {
4265
4357
  ENVIRONMENT_ID: string;
4266
4358
  ENVIRONMENT_TYPE: string;
@@ -4407,4 +4499,4 @@ declare function createPacketAttributes(packet: IOPacket, dataKey: string, dataT
4407
4499
  declare function createPacketAttributesAsJson(data: any, dataType: string): Promise<Attributes>;
4408
4500
  declare function prettyPrintPacket(rawData: any, dataType?: string): Promise<string>;
4409
4501
 
4410
- export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, ApiClientManager, AuthenticationError, BackgroundWorkerMetadata, BackgroundWorkerProperties, BadRequestError, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, ConflictError, type CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateScheduleOptions, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, type GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, type GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, type IOPacket, ImageDetailsMetadata, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, InternalServerError, ListScheduleOptions, ListSchedulesResult, NULL_SENTINEL, NotFoundError, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OtherSpanEvent, PRIMARY_VARIANT, PermissionDeniedError, Prettify, RateLimitError, ReplayRunResponse, RetryOptions, ScheduleObject, ScheduledTaskPayload, SemanticInternalAttributes, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskResource, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, UnprocessableEntityError, UpdateScheduleOptions, Variant, type WhoAmIResponse, WhoAmIResponseSchema, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, formatDuration, formatDurationInDays, formatDurationMilliseconds, formatDurationNanoseconds, groupTaskMetadataIssuesByTask, imposeAttributeLimits, isCancellationSpanEvent, isExceptionSpanEvent, logger, millisecondsToNanoseconds, nanosecondsToMilliseconds, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, stringPatternMatchers, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
4502
+ export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, type ApiClientConfiguration, AttemptStatus, AuthenticationError, BackgroundWorkerMetadata, BackgroundWorkerProperties, BadRequestError, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, ConflictError, type CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateScheduleOptions, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, type GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, type GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, type IOPacket, ImageDetailsMetadata, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, InternalServerError, ListScheduleOptions, ListSchedulesResult, NULL_SENTINEL, NotFoundError, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OtherSpanEvent, PRIMARY_VARIANT, PermissionDeniedError, Prettify, RateLimitError, ReplayRunResponse, RetrieveRunResponse, RetryOptions, RunStatus, ScheduleObject, ScheduledTaskPayload, SemanticInternalAttributes, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskResource, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, UnprocessableEntityError, UpdateScheduleOptions, Variant, type WhoAmIResponse, WhoAmIResponseSchema, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, formatDuration, formatDurationInDays, formatDurationMilliseconds, formatDurationNanoseconds, groupTaskMetadataIssuesByTask, imposeAttributeLimits, isCancellationSpanEvent, isExceptionSpanEvent, logger, millisecondsToNanoseconds, nanosecondsToMilliseconds, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, stringPatternMatchers, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { T as TaskRunExecutionResult, B as BatchTaskRunExecutionResult, a as TaskRunError, b as TaskRunContext, R as RuntimeManager } from '../manager-WNMVbgHf.js';
3
3
  export { h as TaskRun, c as TaskRunBuiltInError, d as TaskRunCustomErrorObject, f as TaskRunErrorCodes, p as TaskRunExecution, j as TaskRunExecutionAttempt, o as TaskRunExecutionBatch, k as TaskRunExecutionEnvironment, l as TaskRunExecutionOrganization, m as TaskRunExecutionProject, n as TaskRunExecutionQueue, q as TaskRunExecutionRetry, i as TaskRunExecutionTask, r as TaskRunFailedExecutionResult, g as TaskRunInternalError, e as TaskRunStringError, s as TaskRunSuccessfulExecutionResult } from '../manager-WNMVbgHf.js';
4
- import { P as Prettify, C as Clock, a as ClockTime, T as TaskLogger, b as TaskCatalog, c as TaskMetadataWithFunctions, d as TaskFileMetadata, e as TaskMetadataWithFilePath, R as RetryOptions, f as TriggerTracer } from '../catalog-XNyNDUOF.js';
5
- export { p as Config, v as Context, E as EnvironmentType, x as FailureFnParams, F as FixedWindowRateLimit, A as HandleErrorArgs, H as HandleErrorFnParams, B as HandleErrorFunction, y as HandleErrorModificationOptions, z as HandleErrorResult, t as InitFnParams, I as InitOutput, L as LogLevel, h as Machine, M as MachineCpu, g as MachineMemory, s as MiddlewareFnParams, n as PostStartCauses, o as PreStopCauses, j as ProdTaskRunExecution, k as ProdTaskRunExecutionPayload, G as ProjectConfig, Q as QueueOptions, l as RateLimitOptions, D as RequireKeys, q as ResolvedConfig, r as RunFnParams, S as SlidingWindowRateLimit, u as StartFnParams, w as SuccessFnParams, m as TaskMetadata, i as TaskRunExecutionPayload, W as WaitReason } from '../catalog-XNyNDUOF.js';
4
+ import { P as Prettify, C as Clock, a as ClockTime, T as TaskLogger, b as TaskCatalog, c as TaskMetadataWithFunctions, d as TaskFileMetadata, e as TaskMetadataWithFilePath, R as RetryOptions, f as TriggerTracer } from '../catalog-KbyTBoap.js';
5
+ export { p as Config, v as Context, E as EnvironmentType, x as FailureFnParams, F as FixedWindowRateLimit, A as HandleErrorArgs, H as HandleErrorFnParams, B as HandleErrorFunction, y as HandleErrorModificationOptions, z as HandleErrorResult, t as InitFnParams, I as InitOutput, L as LogLevel, h as Machine, M as MachineCpu, g as MachineMemory, s as MiddlewareFnParams, n as PostStartCauses, o as PreStopCauses, j as ProdTaskRunExecution, k as ProdTaskRunExecutionPayload, G as ProjectConfig, Q as QueueOptions, l as RateLimitOptions, D as RequireKeys, q as ResolvedConfig, r as RunFnParams, S as SlidingWindowRateLimit, u as StartFnParams, w as SuccessFnParams, m as TaskMetadata, i as TaskRunExecutionPayload, W as WaitReason } from '../catalog-KbyTBoap.js';
6
6
  import { Attributes, Span } from '@opentelemetry/api';
7
7
  import { B as BackgroundWorkerProperties } from '../messages-vq7Bk4Ap.js';
8
8
  export { b as BackgroundWorkerClientMessages, a as BackgroundWorkerServerMessages, i as ClientToSharedQueueMessages, C as CoordinatorToPlatformMessages, k as CoordinatorToProdWorkerMessages, h as PlatformToCoordinatorMessages, g as PlatformToProviderMessages, P as ProdChildToWorkerMessages, l as ProdWorkerSocketData, e as ProdWorkerToChildMessages, j as ProdWorkerToCoordinatorMessages, f as ProviderToPlatformMessages, S as SharedQueueToClientMessages, T as TaskMetadataFailedToParseData, U as UncaughtExceptionMessage, d as childToWorkerMessages, c as clientWebsocketMessages, s as serverWebsocketMessages, w as workerToChildMessages } from '../messages-vq7Bk4Ap.js';
@@ -2276,6 +2276,74 @@ declare const ListScheduleOptions: z.ZodObject<{
2276
2276
  perPage?: number | undefined;
2277
2277
  }>;
2278
2278
  type ListScheduleOptions = z.infer<typeof ListScheduleOptions>;
2279
+ declare const RunStatus: z.ZodEnum<["PENDING", "EXECUTING", "PAUSED", "COMPLETED", "FAILED", "CANCELED"]>;
2280
+ type RunStatus = z.infer<typeof RunStatus>;
2281
+ declare const AttemptStatus: z.ZodEnum<["PENDING", "EXECUTING", "PAUSED", "COMPLETED", "FAILED", "CANCELED"]>;
2282
+ type AttemptStatus = z.infer<typeof AttemptStatus>;
2283
+ declare const RetrieveRunResponse: z.ZodObject<{
2284
+ id: z.ZodString;
2285
+ status: z.ZodEnum<["PENDING", "EXECUTING", "PAUSED", "COMPLETED", "FAILED", "CANCELED"]>;
2286
+ taskIdentifier: z.ZodString;
2287
+ idempotencyKey: z.ZodOptional<z.ZodString>;
2288
+ version: z.ZodOptional<z.ZodString>;
2289
+ createdAt: z.ZodDate;
2290
+ updatedAt: z.ZodDate;
2291
+ attempts: z.ZodArray<z.ZodOptional<z.ZodObject<{
2292
+ id: z.ZodString;
2293
+ status: z.ZodEnum<["PENDING", "EXECUTING", "PAUSED", "COMPLETED", "FAILED", "CANCELED"]>;
2294
+ createdAt: z.ZodDate;
2295
+ updatedAt: z.ZodDate;
2296
+ startedAt: z.ZodOptional<z.ZodDate>;
2297
+ completedAt: z.ZodOptional<z.ZodDate>;
2298
+ }, "strip", z.ZodTypeAny, {
2299
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2300
+ id: string;
2301
+ createdAt: Date;
2302
+ updatedAt: Date;
2303
+ startedAt?: Date | undefined;
2304
+ completedAt?: Date | undefined;
2305
+ }, {
2306
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2307
+ id: string;
2308
+ createdAt: Date;
2309
+ updatedAt: Date;
2310
+ startedAt?: Date | undefined;
2311
+ completedAt?: Date | undefined;
2312
+ }>>, "many">;
2313
+ }, "strip", z.ZodTypeAny, {
2314
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2315
+ id: string;
2316
+ createdAt: Date;
2317
+ taskIdentifier: string;
2318
+ updatedAt: Date;
2319
+ attempts: ({
2320
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2321
+ id: string;
2322
+ createdAt: Date;
2323
+ updatedAt: Date;
2324
+ startedAt?: Date | undefined;
2325
+ completedAt?: Date | undefined;
2326
+ } | undefined)[];
2327
+ idempotencyKey?: string | undefined;
2328
+ version?: string | undefined;
2329
+ }, {
2330
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2331
+ id: string;
2332
+ createdAt: Date;
2333
+ taskIdentifier: string;
2334
+ updatedAt: Date;
2335
+ attempts: ({
2336
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
2337
+ id: string;
2338
+ createdAt: Date;
2339
+ updatedAt: Date;
2340
+ startedAt?: Date | undefined;
2341
+ completedAt?: Date | undefined;
2342
+ } | undefined)[];
2343
+ idempotencyKey?: string | undefined;
2344
+ version?: string | undefined;
2345
+ }>;
2346
+ type RetrieveRunResponse = z.infer<typeof RetrieveRunResponse>;
2279
2347
 
2280
2348
  declare const TaskResource: z.ZodObject<{
2281
2349
  id: z.ZodString;
@@ -3976,6 +4044,23 @@ declare class ApiClient {
3976
4044
  getPayloadUrl(filename: string): Promise<{
3977
4045
  presignedUrl: string;
3978
4046
  }>;
4047
+ retrieveRun(runId: string): Promise<{
4048
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
4049
+ id: string;
4050
+ createdAt: Date;
4051
+ taskIdentifier: string;
4052
+ updatedAt: Date;
4053
+ attempts: ({
4054
+ status: "PENDING" | "CANCELED" | "COMPLETED" | "FAILED" | "EXECUTING" | "PAUSED";
4055
+ id: string;
4056
+ createdAt: Date;
4057
+ updatedAt: Date;
4058
+ startedAt?: Date | undefined;
4059
+ completedAt?: Date | undefined;
4060
+ } | undefined)[];
4061
+ idempotencyKey?: string | undefined;
4062
+ version?: string | undefined;
4063
+ }>;
3979
4064
  replayRun(runId: string): Promise<{
3980
4065
  id: string;
3981
4066
  }>;
@@ -4101,19 +4186,6 @@ declare class ApiClient {
4101
4186
  id: string;
4102
4187
  }>;
4103
4188
  }
4104
- type ApiClientContext = {
4105
- baseURL: string;
4106
- accessToken: string;
4107
- };
4108
- declare class ApiClientManager {
4109
- #private;
4110
- private _storage;
4111
- get baseURL(): string | undefined;
4112
- get accessToken(): string | undefined;
4113
- get client(): ApiClient | undefined;
4114
- runWith<R extends (...args: any[]) => Promise<any>>(context: ApiClientContext, fn: R): Promise<ReturnType<R>>;
4115
- }
4116
- declare const apiClientManager: ApiClientManager;
4117
4189
 
4118
4190
  type APIHeaders = Record<string, string | null | undefined>;
4119
4191
  declare class APIError extends Error {
@@ -4261,6 +4333,26 @@ declare class TaskContextAPI {
4261
4333
  /** Entrypoint for logger API */
4262
4334
  declare const taskContext: TaskContextAPI;
4263
4335
 
4336
+ type ApiClientConfiguration = {
4337
+ baseURL?: string;
4338
+ secretKey?: string;
4339
+ };
4340
+
4341
+ declare class APIClientManagerAPI {
4342
+ #private;
4343
+ private static _instance?;
4344
+ private constructor();
4345
+ static getInstance(): APIClientManagerAPI;
4346
+ disable(): void;
4347
+ setGlobalAPIClientConfiguration(config: ApiClientConfiguration): boolean;
4348
+ get baseURL(): string | undefined;
4349
+ get accessToken(): string | undefined;
4350
+ get client(): ApiClient | undefined;
4351
+ }
4352
+
4353
+ /** Entrypoint for logger API */
4354
+ declare const apiClientManager: APIClientManagerAPI;
4355
+
4264
4356
  declare const SemanticInternalAttributes: {
4265
4357
  ENVIRONMENT_ID: string;
4266
4358
  ENVIRONMENT_TYPE: string;
@@ -4407,4 +4499,4 @@ declare function createPacketAttributes(packet: IOPacket, dataKey: string, dataT
4407
4499
  declare function createPacketAttributesAsJson(data: any, dataType: string): Promise<Attributes>;
4408
4500
  declare function prettyPrintPacket(rawData: any, dataType?: string): Promise<string>;
4409
4501
 
4410
- export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, ApiClientManager, AuthenticationError, BackgroundWorkerMetadata, BackgroundWorkerProperties, BadRequestError, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, ConflictError, type CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateScheduleOptions, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, type GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, type GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, type IOPacket, ImageDetailsMetadata, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, InternalServerError, ListScheduleOptions, ListSchedulesResult, NULL_SENTINEL, NotFoundError, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OtherSpanEvent, PRIMARY_VARIANT, PermissionDeniedError, Prettify, RateLimitError, ReplayRunResponse, RetryOptions, ScheduleObject, ScheduledTaskPayload, SemanticInternalAttributes, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskResource, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, UnprocessableEntityError, UpdateScheduleOptions, Variant, type WhoAmIResponse, WhoAmIResponseSchema, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, formatDuration, formatDurationInDays, formatDurationMilliseconds, formatDurationNanoseconds, groupTaskMetadataIssuesByTask, imposeAttributeLimits, isCancellationSpanEvent, isExceptionSpanEvent, logger, millisecondsToNanoseconds, nanosecondsToMilliseconds, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, stringPatternMatchers, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
4502
+ export { APIConnectionError, APIError, type APIHeaders, Accessory, ApiClient, type ApiClientConfiguration, AttemptStatus, AuthenticationError, BackgroundWorkerMetadata, BackgroundWorkerProperties, BadRequestError, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, ConflictError, type CreateAuthorizationCodeResponse, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateScheduleOptions, CreateUploadPayloadUrlResponseBody, DeletedScheduleObject, DeploymentErrorData, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, type GetPersonalAccessTokenRequest, GetPersonalAccessTokenRequestSchema, type GetPersonalAccessTokenResponse, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, type IOPacket, ImageDetailsMetadata, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, InternalServerError, ListScheduleOptions, ListSchedulesResult, NULL_SENTINEL, NotFoundError, OFFLOAD_IO_PACKET_LENGTH_LIMIT, OTEL_ATTRIBUTE_PER_EVENT_COUNT_LIMIT, OTEL_ATTRIBUTE_PER_LINK_COUNT_LIMIT, OTEL_LINK_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_COUNT_LIMIT, OTEL_LOG_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, OTEL_SPAN_EVENT_COUNT_LIMIT, OtherSpanEvent, PRIMARY_VARIANT, PermissionDeniedError, Prettify, RateLimitError, ReplayRunResponse, RetrieveRunResponse, RetryOptions, RunStatus, ScheduleObject, ScheduledTaskPayload, SemanticInternalAttributes, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskFileMetadata, TaskMetadataWithFilePath, TaskMetadataWithFunctions, TaskResource, TaskRunContext, TaskRunError, TaskRunExecutionResult, type TriggerOptions, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, UnprocessableEntityError, UpdateScheduleOptions, Variant, type WhoAmIResponse, WhoAmIResponseSchema, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, flattenAttributes, formatDuration, formatDurationInDays, formatDurationMilliseconds, formatDurationNanoseconds, groupTaskMetadataIssuesByTask, imposeAttributeLimits, isCancellationSpanEvent, isExceptionSpanEvent, logger, millisecondsToNanoseconds, nanosecondsToMilliseconds, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, stringPatternMatchers, stringifyIO, taskCatalog, taskContext, unflattenAttributes };
package/dist/v3/index.js CHANGED
@@ -3,7 +3,6 @@
3
3
  var api = require('@opentelemetry/api');
4
4
  var zodValidationError = require('zod-validation-error');
5
5
  var zod = require('zod');
6
- var async_hooks = require('async_hooks');
7
6
  var preciseDate = require('@google-cloud/precise-date');
8
7
  var apiLogs = require('@opentelemetry/api-logs');
9
8
  var humanizeDuration = require('humanize-duration');
@@ -1011,6 +1010,39 @@ var ListScheduleOptions = zod.z.object({
1011
1010
  page: zod.z.number().optional(),
1012
1011
  perPage: zod.z.number().optional()
1013
1012
  });
1013
+ var RunStatus = zod.z.enum([
1014
+ "PENDING",
1015
+ "EXECUTING",
1016
+ "PAUSED",
1017
+ "COMPLETED",
1018
+ "FAILED",
1019
+ "CANCELED"
1020
+ ]);
1021
+ var AttemptStatus = zod.z.enum([
1022
+ "PENDING",
1023
+ "EXECUTING",
1024
+ "PAUSED",
1025
+ "COMPLETED",
1026
+ "FAILED",
1027
+ "CANCELED"
1028
+ ]);
1029
+ var RetrieveRunResponse = zod.z.object({
1030
+ id: zod.z.string(),
1031
+ status: RunStatus,
1032
+ taskIdentifier: zod.z.string(),
1033
+ idempotencyKey: zod.z.string().optional(),
1034
+ version: zod.z.string().optional(),
1035
+ createdAt: zod.z.coerce.date(),
1036
+ updatedAt: zod.z.coerce.date(),
1037
+ attempts: zod.z.array(zod.z.object({
1038
+ id: zod.z.string(),
1039
+ status: AttemptStatus,
1040
+ createdAt: zod.z.coerce.date(),
1041
+ updatedAt: zod.z.coerce.date(),
1042
+ startedAt: zod.z.coerce.date().optional(),
1043
+ completedAt: zod.z.coerce.date().optional()
1044
+ }).optional())
1045
+ });
1014
1046
  var BackgroundWorkerServerMessages = zod.z.discriminatedUnion("type", [
1015
1047
  zod.z.object({
1016
1048
  type: zod.z.literal("EXECUTE_RUNS"),
@@ -2073,27 +2105,6 @@ var TaskContextAPI = _TaskContextAPI;
2073
2105
  // src/v3/task-context-api.ts
2074
2106
  var taskContext = TaskContextAPI.getInstance();
2075
2107
 
2076
- // src/v3/utils/getEnv.ts
2077
- function getEnvVar(name) {
2078
- if (typeof process !== "undefined" && typeof process.env === "object" && process.env !== null) {
2079
- return process.env[name];
2080
- }
2081
- }
2082
- __name(getEnvVar, "getEnvVar");
2083
- var _SafeAsyncLocalStorage = class _SafeAsyncLocalStorage {
2084
- constructor() {
2085
- this.storage = new async_hooks.AsyncLocalStorage();
2086
- }
2087
- runWith(context3, fn) {
2088
- return this.storage.run(context3, fn);
2089
- }
2090
- getStore() {
2091
- return this.storage.getStore();
2092
- }
2093
- };
2094
- __name(_SafeAsyncLocalStorage, "SafeAsyncLocalStorage");
2095
- var SafeAsyncLocalStorage = _SafeAsyncLocalStorage;
2096
-
2097
2108
  // src/v3/apiClient/index.ts
2098
2109
  var zodFetchOptions = {
2099
2110
  retry: {
@@ -2158,6 +2169,12 @@ var _ApiClient = class _ApiClient {
2158
2169
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2159
2170
  }, zodFetchOptions);
2160
2171
  }
2172
+ retrieveRun(runId) {
2173
+ return zodfetch(RetrieveRunResponse, `${this.baseUrl}/api/v3/runs/${runId}`, {
2174
+ method: "GET",
2175
+ headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2176
+ }, zodFetchOptions);
2177
+ }
2161
2178
  replayRun(runId) {
2162
2179
  return zodfetch(ReplayRunResponse, `${this.baseUrl}/api/v1/runs/${runId}/replay`, {
2163
2180
  method: "POST",
@@ -2238,37 +2255,6 @@ getHeaders_fn = /* @__PURE__ */ __name(function(spanParentAsLink) {
2238
2255
  }, "#getHeaders");
2239
2256
  __name(_ApiClient, "ApiClient");
2240
2257
  var ApiClient = _ApiClient;
2241
- var _getStore, getStore_fn;
2242
- var _ApiClientManager = class _ApiClientManager {
2243
- constructor() {
2244
- __privateAdd(this, _getStore);
2245
- __publicField(this, "_storage", new SafeAsyncLocalStorage());
2246
- }
2247
- get baseURL() {
2248
- const store = __privateMethod(this, _getStore, getStore_fn).call(this);
2249
- return store?.baseURL ?? getEnvVar("TRIGGER_API_URL") ?? "https://api.trigger.dev";
2250
- }
2251
- get accessToken() {
2252
- const store = __privateMethod(this, _getStore, getStore_fn).call(this);
2253
- return store?.accessToken ?? getEnvVar("TRIGGER_SECRET_KEY");
2254
- }
2255
- get client() {
2256
- if (!this.baseURL || !this.accessToken) {
2257
- return void 0;
2258
- }
2259
- return new ApiClient(this.baseURL, this.accessToken);
2260
- }
2261
- runWith(context3, fn) {
2262
- return this._storage.runWith(context3, fn);
2263
- }
2264
- };
2265
- _getStore = new WeakSet();
2266
- getStore_fn = /* @__PURE__ */ __name(function() {
2267
- return this._storage.getStore();
2268
- }, "#getStore");
2269
- __name(_ApiClientManager, "ApiClientManager");
2270
- var ApiClientManager = _ApiClientManager;
2271
- var apiClientManager = new ApiClientManager();
2272
2258
  var _SimpleClock = class _SimpleClock {
2273
2259
  preciseNow() {
2274
2260
  const now = new preciseDate.PreciseDate();
@@ -2736,6 +2722,58 @@ var RuntimeAPI = _RuntimeAPI;
2736
2722
  // src/v3/runtime-api.ts
2737
2723
  var runtime = RuntimeAPI.getInstance();
2738
2724
 
2725
+ // src/v3/utils/getEnv.ts
2726
+ function getEnvVar(name) {
2727
+ if (typeof process !== "undefined" && typeof process.env === "object" && process.env !== null) {
2728
+ return process.env[name];
2729
+ }
2730
+ }
2731
+ __name(getEnvVar, "getEnvVar");
2732
+
2733
+ // src/v3/apiClientManager/index.ts
2734
+ var API_NAME5 = "api-client";
2735
+ var _getConfig, getConfig_fn;
2736
+ var _APIClientManagerAPI = class _APIClientManagerAPI {
2737
+ constructor() {
2738
+ __privateAdd(this, _getConfig);
2739
+ }
2740
+ static getInstance() {
2741
+ if (!this._instance) {
2742
+ this._instance = new _APIClientManagerAPI();
2743
+ }
2744
+ return this._instance;
2745
+ }
2746
+ disable() {
2747
+ unregisterGlobal(API_NAME5);
2748
+ }
2749
+ setGlobalAPIClientConfiguration(config) {
2750
+ return registerGlobal(API_NAME5, config);
2751
+ }
2752
+ get baseURL() {
2753
+ const store = __privateMethod(this, _getConfig, getConfig_fn).call(this);
2754
+ return store?.baseURL ?? getEnvVar("TRIGGER_API_URL") ?? "https://api.trigger.dev";
2755
+ }
2756
+ get accessToken() {
2757
+ const store = __privateMethod(this, _getConfig, getConfig_fn).call(this);
2758
+ return store?.secretKey ?? getEnvVar("TRIGGER_SECRET_KEY");
2759
+ }
2760
+ get client() {
2761
+ if (!this.baseURL || !this.accessToken) {
2762
+ return void 0;
2763
+ }
2764
+ return new ApiClient(this.baseURL, this.accessToken);
2765
+ }
2766
+ };
2767
+ _getConfig = new WeakSet();
2768
+ getConfig_fn = /* @__PURE__ */ __name(function() {
2769
+ return getGlobal(API_NAME5);
2770
+ }, "#getConfig");
2771
+ __name(_APIClientManagerAPI, "APIClientManagerAPI");
2772
+ var APIClientManagerAPI = _APIClientManagerAPI;
2773
+
2774
+ // src/v3/apiClientManager-api.ts
2775
+ var apiClientManager = APIClientManagerAPI.getInstance();
2776
+
2739
2777
  // src/v3/task-catalog/noopTaskCatalog.ts
2740
2778
  var _NoopTaskCatalog = class _NoopTaskCatalog {
2741
2779
  registerTaskMetadata(task) {
@@ -2763,7 +2801,7 @@ __name(_NoopTaskCatalog, "NoopTaskCatalog");
2763
2801
  var NoopTaskCatalog = _NoopTaskCatalog;
2764
2802
 
2765
2803
  // src/v3/task-catalog/index.ts
2766
- var API_NAME5 = "task-catalog";
2804
+ var API_NAME6 = "task-catalog";
2767
2805
  var NOOP_TASK_CATALOG = new NoopTaskCatalog();
2768
2806
  var _getCatalog, getCatalog_fn;
2769
2807
  var _TaskCatalogAPI = class _TaskCatalogAPI {
@@ -2777,10 +2815,10 @@ var _TaskCatalogAPI = class _TaskCatalogAPI {
2777
2815
  return this._instance;
2778
2816
  }
2779
2817
  setGlobalTaskCatalog(taskCatalog2) {
2780
- return registerGlobal(API_NAME5, taskCatalog2);
2818
+ return registerGlobal(API_NAME6, taskCatalog2);
2781
2819
  }
2782
2820
  disable() {
2783
- unregisterGlobal(API_NAME5);
2821
+ unregisterGlobal(API_NAME6);
2784
2822
  }
2785
2823
  registerTaskMetadata(task) {
2786
2824
  __privateMethod(this, _getCatalog, getCatalog_fn).call(this).registerTaskMetadata(task);
@@ -2806,7 +2844,7 @@ var _TaskCatalogAPI = class _TaskCatalogAPI {
2806
2844
  };
2807
2845
  _getCatalog = new WeakSet();
2808
2846
  getCatalog_fn = /* @__PURE__ */ __name(function() {
2809
- return getGlobal(API_NAME5) ?? NOOP_TASK_CATALOG;
2847
+ return getGlobal(API_NAME6) ?? NOOP_TASK_CATALOG;
2810
2848
  }, "#getCatalog");
2811
2849
  __name(_TaskCatalogAPI, "TaskCatalogAPI");
2812
2850
  var TaskCatalogAPI = _TaskCatalogAPI;
@@ -3435,7 +3473,7 @@ __name(safeJsonParse2, "safeJsonParse");
3435
3473
  exports.APIConnectionError = APIConnectionError;
3436
3474
  exports.APIError = APIError;
3437
3475
  exports.ApiClient = ApiClient;
3438
- exports.ApiClientManager = ApiClientManager;
3476
+ exports.AttemptStatus = AttemptStatus;
3439
3477
  exports.AuthenticationError = AuthenticationError;
3440
3478
  exports.BackgroundWorkerClientMessages = BackgroundWorkerClientMessages;
3441
3479
  exports.BackgroundWorkerMetadata = BackgroundWorkerMetadata;
@@ -3517,7 +3555,9 @@ exports.QueueOptions = QueueOptions;
3517
3555
  exports.RateLimitError = RateLimitError;
3518
3556
  exports.RateLimitOptions = RateLimitOptions;
3519
3557
  exports.ReplayRunResponse = ReplayRunResponse;
3558
+ exports.RetrieveRunResponse = RetrieveRunResponse;
3520
3559
  exports.RetryOptions = RetryOptions;
3560
+ exports.RunStatus = RunStatus;
3521
3561
  exports.ScheduleObject = ScheduleObject;
3522
3562
  exports.ScheduledTaskPayload = ScheduledTaskPayload;
3523
3563
  exports.SemanticInternalAttributes = SemanticInternalAttributes;