@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
package/dist/v3/index.mjs CHANGED
@@ -27,7 +27,7 @@ var __privateMethod = (obj, member, method) => {
27
27
  };
28
28
 
29
29
  // package.json
30
- var version = "3.0.0-beta.45";
30
+ var version = "3.0.0-beta.47";
31
31
  var dependencies = {
32
32
  "@google-cloud/precise-date": "^4.0.0",
33
33
  "@opentelemetry/api": "^1.8.0",
@@ -42,7 +42,7 @@ var dependencies = {
42
42
  "@opentelemetry/sdk-trace-node": "^1.22.0",
43
43
  "@opentelemetry/semantic-conventions": "^1.22.0",
44
44
  "humanize-duration": "^3.27.3",
45
- "socket.io-client": "4.7.4",
45
+ "socket.io-client": "4.7.5",
46
46
  superjson: "^2.2.1",
47
47
  ulidx: "^2.2.1",
48
48
  zod: "3.22.3",
@@ -161,6 +161,7 @@ var TaskRun = z.object({
161
161
  createdAt: z.coerce.date(),
162
162
  startedAt: z.coerce.date().default(() => /* @__PURE__ */ new Date()),
163
163
  idempotencyKey: z.string().optional(),
164
+ maxAttempts: z.number().optional(),
164
165
  durationMs: z.number().default(0),
165
166
  costInCents: z.number().default(0),
166
167
  baseCostInCents: z.number().default(0)
@@ -452,6 +453,7 @@ var WaitReason = z.enum([
452
453
  ]);
453
454
  var TaskRunExecutionLazyAttemptPayload = z.object({
454
455
  runId: z.string(),
456
+ attemptCount: z.number().optional(),
455
457
  messageId: z.string(),
456
458
  isTest: z.boolean(),
457
459
  traceContext: z.record(z.unknown()),
@@ -478,6 +480,14 @@ var ImageDetailsMetadata = z.object({
478
480
  contentHash: z.string(),
479
481
  imageTag: z.string()
480
482
  });
483
+ var _AbortTaskRunError = class _AbortTaskRunError extends Error {
484
+ constructor(message) {
485
+ super(message);
486
+ this.name = "AbortTaskRunError";
487
+ }
488
+ };
489
+ __name(_AbortTaskRunError, "AbortTaskRunError");
490
+ var AbortTaskRunError = _AbortTaskRunError;
481
491
  function parseError(error) {
482
492
  if (error instanceof Error) {
483
493
  return {
@@ -558,6 +568,39 @@ function createJsonErrorObject(error) {
558
568
  }
559
569
  }
560
570
  __name(createJsonErrorObject, "createJsonErrorObject");
571
+ function sanitizeError(error) {
572
+ switch (error.type) {
573
+ case "BUILT_IN_ERROR": {
574
+ return {
575
+ type: "BUILT_IN_ERROR",
576
+ message: error.message?.replace(/\0/g, ""),
577
+ name: error.name?.replace(/\0/g, ""),
578
+ stackTrace: error.stackTrace?.replace(/\0/g, "")
579
+ };
580
+ }
581
+ case "STRING_ERROR": {
582
+ return {
583
+ type: "STRING_ERROR",
584
+ raw: error.raw.replace(/\0/g, "")
585
+ };
586
+ }
587
+ case "CUSTOM_ERROR": {
588
+ return {
589
+ type: "CUSTOM_ERROR",
590
+ raw: error.raw.replace(/\0/g, "")
591
+ };
592
+ }
593
+ case "INTERNAL_ERROR": {
594
+ return {
595
+ type: "INTERNAL_ERROR",
596
+ code: error.code,
597
+ message: error.message?.replace(/\0/g, ""),
598
+ stackTrace: error.stackTrace?.replace(/\0/g, "")
599
+ };
600
+ }
601
+ }
602
+ }
603
+ __name(sanitizeError, "sanitizeError");
561
604
  function correctErrorStackTrace(stackTrace, projectDir, options) {
562
605
  const [errorLine, ...traceLines] = stackTrace.split("\n");
563
606
  return [
@@ -673,7 +716,8 @@ var TriggerTaskRequestBody = z.object({
673
716
  test: z.boolean().optional(),
674
717
  payloadType: z.string().optional(),
675
718
  delay: z.string().or(z.coerce.date()).optional(),
676
- ttl: z.string().or(z.number().nonnegative().int()).optional()
719
+ ttl: z.string().or(z.number().nonnegative().int()).optional(),
720
+ maxAttempts: z.number().int().optional()
677
721
  }).optional()
678
722
  });
679
723
  var TriggerTaskResponse = z.object({
@@ -1186,47 +1230,15 @@ var ProdChildToWorkerMessages = {
1186
1230
  id: z.string()
1187
1231
  })
1188
1232
  },
1189
- TASK_RUN_HEARTBEAT: {
1190
- message: z.object({
1191
- version: z.literal("v1").default("v1"),
1192
- id: z.string()
1193
- })
1194
- },
1195
1233
  READY_TO_DISPOSE: {
1196
1234
  message: z.undefined()
1197
1235
  },
1198
- READY_FOR_CHECKPOINT: {
1199
- message: z.object({
1200
- version: z.literal("v1").default("v1")
1201
- })
1202
- },
1203
- CANCEL_CHECKPOINT: {
1204
- message: z.discriminatedUnion("version", [
1205
- z.object({
1206
- version: z.literal("v1")
1207
- }),
1208
- z.object({
1209
- version: z.literal("v2"),
1210
- reason: WaitReason.optional()
1211
- })
1212
- ]).default({
1213
- version: "v1"
1214
- }),
1215
- callback: z.object({
1216
- // TODO: Figure out how best to handle callback schema parsing in zod IPC
1217
- version: z.literal("v2"),
1218
- checkpointCanceled: z.boolean(),
1219
- reason: WaitReason.optional()
1220
- })
1221
- },
1222
1236
  WAIT_FOR_DURATION: {
1223
1237
  message: z.object({
1224
1238
  version: z.literal("v1").default("v1"),
1225
1239
  ms: z.number(),
1226
- now: z.number()
1227
- }),
1228
- callback: z.object({
1229
- willCheckpointAndRestore: z.boolean()
1240
+ now: z.number(),
1241
+ waitThresholdInMs: z.number()
1230
1242
  })
1231
1243
  },
1232
1244
  WAIT_FOR_TASK: {
@@ -1429,6 +1441,7 @@ var CoordinatorToPlatformMessages = {
1429
1441
  })
1430
1442
  ])
1431
1443
  },
1444
+ // Deprecated: Only workers without lazy attempt support will use this
1432
1445
  READY_FOR_EXECUTION: {
1433
1446
  message: z.object({
1434
1447
  version: z.literal("v1").default("v1"),
@@ -1592,6 +1605,12 @@ var PlatformToCoordinatorMessages = {
1592
1605
  version: z.literal("v1").default("v1"),
1593
1606
  runId: z.string()
1594
1607
  })
1608
+ },
1609
+ DYNAMIC_CONFIG: {
1610
+ message: z.object({
1611
+ version: z.literal("v1").default("v1"),
1612
+ checkpointThresholdInMs: z.number()
1613
+ })
1595
1614
  }
1596
1615
  };
1597
1616
  var ClientToSharedQueueMessages = {
@@ -1637,10 +1656,9 @@ var IndexTasksMessage = z.object({
1637
1656
  packageVersion: z.string()
1638
1657
  });
1639
1658
  var ProdWorkerToCoordinatorMessages = {
1640
- LOG: {
1659
+ TEST: {
1641
1660
  message: z.object({
1642
- version: z.literal("v1").default("v1"),
1643
- text: z.string()
1661
+ version: z.literal("v1").default("v1")
1644
1662
  }),
1645
1663
  callback: z.void()
1646
1664
  },
@@ -1663,6 +1681,7 @@ var ProdWorkerToCoordinatorMessages = {
1663
1681
  })
1664
1682
  ])
1665
1683
  },
1684
+ // Deprecated: Only workers without lazy attempt support will use this
1666
1685
  READY_FOR_EXECUTION: {
1667
1686
  message: z.object({
1668
1687
  version: z.literal("v1").default("v1"),
@@ -1749,7 +1768,10 @@ var ProdWorkerToCoordinatorMessages = {
1749
1768
  },
1750
1769
  WAIT_FOR_TASK: {
1751
1770
  message: z.object({
1752
- version: z.literal("v1").default("v1"),
1771
+ version: z.enum([
1772
+ "v1",
1773
+ "v2"
1774
+ ]).default("v1"),
1753
1775
  friendlyId: z.string(),
1754
1776
  // This is the attempt that is waiting
1755
1777
  attemptFriendlyId: z.string()
@@ -1760,7 +1782,10 @@ var ProdWorkerToCoordinatorMessages = {
1760
1782
  },
1761
1783
  WAIT_FOR_BATCH: {
1762
1784
  message: z.object({
1763
- version: z.literal("v1").default("v1"),
1785
+ version: z.enum([
1786
+ "v1",
1787
+ "v2"
1788
+ ]).default("v1"),
1764
1789
  batchFriendlyId: z.string(),
1765
1790
  runFriendlyIds: z.string().array(),
1766
1791
  // This is the attempt that is waiting
@@ -1807,6 +1832,12 @@ var ProdWorkerToCoordinatorMessages = {
1807
1832
  stack: z.string().optional()
1808
1833
  })
1809
1834
  })
1835
+ },
1836
+ SET_STATE: {
1837
+ message: z.object({
1838
+ version: z.literal("v1").default("v1"),
1839
+ attemptFriendlyId: z.string().optional()
1840
+ })
1810
1841
  }
1811
1842
  };
1812
1843
  var CoordinatorToProdWorkerMessages = {
@@ -1824,6 +1855,7 @@ var CoordinatorToProdWorkerMessages = {
1824
1855
  attemptId: z.string()
1825
1856
  })
1826
1857
  },
1858
+ // Deprecated: Only workers without lazy attempt support will use this
1827
1859
  EXECUTE_TASK_RUN: {
1828
1860
  message: z.object({
1829
1861
  version: z.literal("v1").default("v1"),
@@ -1870,6 +1902,9 @@ var ProdWorkerSocketData = z.object({
1870
1902
  deploymentId: z.string(),
1871
1903
  deploymentVersion: z.string()
1872
1904
  });
1905
+ var CoordinatorSocketData = z.object({
1906
+ supportsDynamicConfig: z.string().optional()
1907
+ });
1873
1908
  var PRIMARY_VARIANT = "primary";
1874
1909
  var Variant = z.enum([
1875
1910
  PRIMARY_VARIANT
@@ -2146,7 +2181,10 @@ var SemanticInternalAttributes = {
2146
2181
  LINK_TITLE: "$link.title",
2147
2182
  IDEMPOTENCY_KEY: "ctx.run.idempotencyKey",
2148
2183
  USAGE_DURATION_MS: "$usage.durationMs",
2149
- USAGE_COST_IN_CENTS: "$usage.costInCents"
2184
+ USAGE_COST_IN_CENTS: "$usage.costInCents",
2185
+ RATE_LIMIT_LIMIT: "response.rateLimit.limit",
2186
+ RATE_LIMIT_REMAINING: "response.rateLimit.remaining",
2187
+ RATE_LIMIT_RESET: "response.rateLimit.reset"
2150
2188
  };
2151
2189
 
2152
2190
  // src/v3/taskContext/index.ts
@@ -2236,10 +2274,118 @@ var TaskContextAPI = _TaskContextAPI;
2236
2274
  // src/v3/task-context-api.ts
2237
2275
  var taskContext = TaskContextAPI.getInstance();
2238
2276
 
2277
+ // src/retry.ts
2278
+ function calculateResetAt(resets, format, now = /* @__PURE__ */ new Date()) {
2279
+ if (!resets)
2280
+ return;
2281
+ switch (format) {
2282
+ case "iso_8601_duration_openai_variant": {
2283
+ return calculateISO8601DurationOpenAIVariantResetAt(resets, now);
2284
+ }
2285
+ case "iso_8601": {
2286
+ return calculateISO8601ResetAt(resets, now);
2287
+ }
2288
+ case "unix_timestamp": {
2289
+ return calculateUnixTimestampResetAt(resets, now);
2290
+ }
2291
+ case "unix_timestamp_in_ms": {
2292
+ return calculateUnixTimestampInMsResetAt(resets, now);
2293
+ }
2294
+ }
2295
+ }
2296
+ __name(calculateResetAt, "calculateResetAt");
2297
+ function calculateUnixTimestampResetAt(resets, now = /* @__PURE__ */ new Date()) {
2298
+ if (!resets)
2299
+ return void 0;
2300
+ const resetAt = parseInt(resets, 10);
2301
+ if (isNaN(resetAt))
2302
+ return void 0;
2303
+ return new Date(resetAt * 1e3);
2304
+ }
2305
+ __name(calculateUnixTimestampResetAt, "calculateUnixTimestampResetAt");
2306
+ function calculateUnixTimestampInMsResetAt(resets, now = /* @__PURE__ */ new Date()) {
2307
+ if (!resets)
2308
+ return void 0;
2309
+ const resetAt = parseInt(resets, 10);
2310
+ if (isNaN(resetAt))
2311
+ return void 0;
2312
+ return new Date(resetAt);
2313
+ }
2314
+ __name(calculateUnixTimestampInMsResetAt, "calculateUnixTimestampInMsResetAt");
2315
+ function calculateISO8601ResetAt(resets, now = /* @__PURE__ */ new Date()) {
2316
+ if (!resets)
2317
+ return void 0;
2318
+ const resetAt = new Date(resets);
2319
+ if (isNaN(resetAt.getTime()))
2320
+ return void 0;
2321
+ return resetAt;
2322
+ }
2323
+ __name(calculateISO8601ResetAt, "calculateISO8601ResetAt");
2324
+ function calculateISO8601DurationOpenAIVariantResetAt(resets, now = /* @__PURE__ */ new Date()) {
2325
+ if (!resets)
2326
+ return void 0;
2327
+ const pattern = /^(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+(?:\.\d+)?)s)?(?:(\d+)ms)?$/;
2328
+ const match = resets.match(pattern);
2329
+ if (!match)
2330
+ return void 0;
2331
+ const days = parseInt(match[1], 10) || 0;
2332
+ const hours = parseInt(match[2], 10) || 0;
2333
+ const minutes = parseInt(match[3], 10) || 0;
2334
+ const seconds = parseFloat(match[4]) || 0;
2335
+ const milliseconds = parseInt(match[5], 10) || 0;
2336
+ const resetAt = new Date(now);
2337
+ resetAt.setDate(resetAt.getDate() + days);
2338
+ resetAt.setHours(resetAt.getHours() + hours);
2339
+ resetAt.setMinutes(resetAt.getMinutes() + minutes);
2340
+ resetAt.setSeconds(resetAt.getSeconds() + Math.floor(seconds));
2341
+ resetAt.setMilliseconds(resetAt.getMilliseconds() + (seconds - Math.floor(seconds)) * 1e3 + milliseconds);
2342
+ return resetAt;
2343
+ }
2344
+ __name(calculateISO8601DurationOpenAIVariantResetAt, "calculateISO8601DurationOpenAIVariantResetAt");
2345
+
2346
+ // src/v3/utils/retries.ts
2347
+ var defaultRetryOptions = {
2348
+ maxAttempts: 3,
2349
+ factor: 2,
2350
+ minTimeoutInMs: 1e3,
2351
+ maxTimeoutInMs: 6e4,
2352
+ randomize: true
2353
+ };
2354
+ var defaultFetchRetryOptions = {
2355
+ byStatus: {
2356
+ "429,408,409,5xx": {
2357
+ strategy: "backoff",
2358
+ ...defaultRetryOptions
2359
+ }
2360
+ },
2361
+ connectionError: defaultRetryOptions,
2362
+ timeout: defaultRetryOptions
2363
+ };
2364
+ function calculateNextRetryDelay(options, attempt) {
2365
+ const opts = {
2366
+ ...defaultRetryOptions,
2367
+ ...options
2368
+ };
2369
+ if (attempt >= opts.maxAttempts) {
2370
+ return;
2371
+ }
2372
+ const { factor, minTimeoutInMs, maxTimeoutInMs, randomize } = opts;
2373
+ const random = randomize ? Math.random() + 1 : 1;
2374
+ const timeout = Math.min(maxTimeoutInMs, random * minTimeoutInMs * Math.pow(factor, attempt - 1));
2375
+ return Math.round(timeout);
2376
+ }
2377
+ __name(calculateNextRetryDelay, "calculateNextRetryDelay");
2378
+ function calculateResetAt2(resets, format, now = Date.now()) {
2379
+ const resetAt = calculateResetAt(resets, format, new Date(now));
2380
+ return resetAt?.getTime();
2381
+ }
2382
+ __name(calculateResetAt2, "calculateResetAt");
2383
+
2239
2384
  // src/v3/apiClient/errors.ts
2240
2385
  var _ApiError = class _ApiError extends Error {
2241
2386
  constructor(status, error, message, headers) {
2242
2387
  super(`${_ApiError.makeMessage(status, error, message)}`);
2388
+ this.name = "TriggerApiError";
2243
2389
  this.status = status;
2244
2390
  this.headers = headers;
2245
2391
  const data = error;
@@ -2360,6 +2506,16 @@ var _RateLimitError = class _RateLimitError extends ApiError {
2360
2506
  super(...arguments);
2361
2507
  __publicField(this, "status", 429);
2362
2508
  }
2509
+ get millisecondsUntilReset() {
2510
+ const resetAtUnixEpochMs = (this.headers ?? {})["x-ratelimit-reset"];
2511
+ if (typeof resetAtUnixEpochMs === "string") {
2512
+ const resetAtUnixEpoch = parseInt(resetAtUnixEpochMs, 10);
2513
+ if (isNaN(resetAtUnixEpoch)) {
2514
+ return;
2515
+ }
2516
+ return Math.max(resetAtUnixEpoch - Date.now() + Math.floor(Math.random() * 2e3), 0);
2517
+ }
2518
+ }
2363
2519
  };
2364
2520
  __name(_RateLimitError, "RateLimitError");
2365
2521
  var RateLimitError = _RateLimitError;
@@ -2374,112 +2530,131 @@ function castToError(err) {
2374
2530
  }
2375
2531
  __name(castToError, "castToError");
2376
2532
 
2377
- // src/retry.ts
2378
- function calculateResetAt(resets, format, now = /* @__PURE__ */ new Date()) {
2379
- if (!resets)
2380
- return;
2381
- switch (format) {
2382
- case "iso_8601_duration_openai_variant": {
2383
- return calculateISO8601DurationOpenAIVariantResetAt(resets, now);
2384
- }
2385
- case "iso_8601": {
2386
- return calculateISO8601ResetAt(resets, now);
2387
- }
2388
- case "unix_timestamp": {
2389
- return calculateUnixTimestampResetAt(resets, now);
2390
- }
2391
- case "unix_timestamp_in_ms": {
2392
- return calculateUnixTimestampInMsResetAt(resets, now);
2533
+ // src/v3/utils/flattenAttributes.ts
2534
+ var NULL_SENTINEL = "$@null((";
2535
+ function flattenAttributes(obj, prefix) {
2536
+ const result = {};
2537
+ if (obj === void 0) {
2538
+ return result;
2539
+ }
2540
+ if (obj === null) {
2541
+ result[prefix || ""] = NULL_SENTINEL;
2542
+ return result;
2543
+ }
2544
+ if (typeof obj === "string") {
2545
+ result[prefix || ""] = obj;
2546
+ return result;
2547
+ }
2548
+ if (typeof obj === "number") {
2549
+ result[prefix || ""] = obj;
2550
+ return result;
2551
+ }
2552
+ if (typeof obj === "boolean") {
2553
+ result[prefix || ""] = obj;
2554
+ return result;
2555
+ }
2556
+ for (const [key, value] of Object.entries(obj)) {
2557
+ const newPrefix = `${prefix ? `${prefix}.` : ""}${Array.isArray(obj) ? `[${key}]` : key}`;
2558
+ if (Array.isArray(value)) {
2559
+ for (let i = 0; i < value.length; i++) {
2560
+ if (typeof value[i] === "object" && value[i] !== null) {
2561
+ Object.assign(result, flattenAttributes(value[i], `${newPrefix}.[${i}]`));
2562
+ } else {
2563
+ if (value[i] === null) {
2564
+ result[`${newPrefix}.[${i}]`] = NULL_SENTINEL;
2565
+ } else {
2566
+ result[`${newPrefix}.[${i}]`] = value[i];
2567
+ }
2568
+ }
2569
+ }
2570
+ } else if (isRecord(value)) {
2571
+ Object.assign(result, flattenAttributes(value, newPrefix));
2572
+ } else {
2573
+ if (typeof value === "number" || typeof value === "string" || typeof value === "boolean") {
2574
+ result[newPrefix] = value;
2575
+ } else if (value === null) {
2576
+ result[newPrefix] = NULL_SENTINEL;
2577
+ }
2393
2578
  }
2394
2579
  }
2580
+ return result;
2395
2581
  }
2396
- __name(calculateResetAt, "calculateResetAt");
2397
- function calculateUnixTimestampResetAt(resets, now = /* @__PURE__ */ new Date()) {
2398
- if (!resets)
2399
- return void 0;
2400
- const resetAt = parseInt(resets, 10);
2401
- if (isNaN(resetAt))
2402
- return void 0;
2403
- return new Date(resetAt * 1e3);
2582
+ __name(flattenAttributes, "flattenAttributes");
2583
+ function isRecord(value) {
2584
+ return value !== null && typeof value === "object" && !Array.isArray(value);
2404
2585
  }
2405
- __name(calculateUnixTimestampResetAt, "calculateUnixTimestampResetAt");
2406
- function calculateUnixTimestampInMsResetAt(resets, now = /* @__PURE__ */ new Date()) {
2407
- if (!resets)
2408
- return void 0;
2409
- const resetAt = parseInt(resets, 10);
2410
- if (isNaN(resetAt))
2411
- return void 0;
2412
- return new Date(resetAt);
2413
- }
2414
- __name(calculateUnixTimestampInMsResetAt, "calculateUnixTimestampInMsResetAt");
2415
- function calculateISO8601ResetAt(resets, now = /* @__PURE__ */ new Date()) {
2416
- if (!resets)
2417
- return void 0;
2418
- const resetAt = new Date(resets);
2419
- if (isNaN(resetAt.getTime()))
2420
- return void 0;
2421
- return resetAt;
2586
+ __name(isRecord, "isRecord");
2587
+ function unflattenAttributes(obj) {
2588
+ if (typeof obj !== "object" || obj === null || Array.isArray(obj)) {
2589
+ return obj;
2590
+ }
2591
+ if (typeof obj === "object" && obj !== null && Object.keys(obj).length === 1 && Object.keys(obj)[0] === "") {
2592
+ return rehydrateNull(obj[""]);
2593
+ }
2594
+ if (Object.keys(obj).length === 0) {
2595
+ return;
2596
+ }
2597
+ const result = {};
2598
+ for (const [key, value] of Object.entries(obj)) {
2599
+ const parts = key.split(".").reduce((acc, part) => {
2600
+ if (part.includes("[")) {
2601
+ const subparts = part.split(/\[|\]/).filter((p) => p !== "");
2602
+ acc.push(...subparts);
2603
+ } else {
2604
+ acc.push(part);
2605
+ }
2606
+ return acc;
2607
+ }, []);
2608
+ let current = result;
2609
+ for (let i = 0; i < parts.length - 1; i++) {
2610
+ const part = parts[i];
2611
+ const nextPart = parts[i + 1];
2612
+ const isArray = /^\d+$/.test(nextPart);
2613
+ if (isArray && !Array.isArray(current[part])) {
2614
+ current[part] = [];
2615
+ } else if (!isArray && current[part] === void 0) {
2616
+ current[part] = {};
2617
+ }
2618
+ current = current[part];
2619
+ }
2620
+ const lastPart = parts[parts.length - 1];
2621
+ current[lastPart] = rehydrateNull(value);
2622
+ }
2623
+ if (Object.keys(result).every((k) => /^\d+$/.test(k))) {
2624
+ const maxIndex = Math.max(...Object.keys(result).map((k) => parseInt(k)));
2625
+ const arrayResult = Array(maxIndex + 1);
2626
+ for (const key in result) {
2627
+ arrayResult[parseInt(key)] = result[key];
2628
+ }
2629
+ return arrayResult;
2630
+ }
2631
+ return result;
2422
2632
  }
2423
- __name(calculateISO8601ResetAt, "calculateISO8601ResetAt");
2424
- function calculateISO8601DurationOpenAIVariantResetAt(resets, now = /* @__PURE__ */ new Date()) {
2425
- if (!resets)
2426
- return void 0;
2427
- const pattern = /^(?:(\d+)d)?(?:(\d+)h)?(?:(\d+)m)?(?:(\d+(?:\.\d+)?)s)?(?:(\d+)ms)?$/;
2428
- const match = resets.match(pattern);
2429
- if (!match)
2430
- return void 0;
2431
- const days = parseInt(match[1], 10) || 0;
2432
- const hours = parseInt(match[2], 10) || 0;
2433
- const minutes = parseInt(match[3], 10) || 0;
2434
- const seconds = parseFloat(match[4]) || 0;
2435
- const milliseconds = parseInt(match[5], 10) || 0;
2436
- const resetAt = new Date(now);
2437
- resetAt.setDate(resetAt.getDate() + days);
2438
- resetAt.setHours(resetAt.getHours() + hours);
2439
- resetAt.setMinutes(resetAt.getMinutes() + minutes);
2440
- resetAt.setSeconds(resetAt.getSeconds() + Math.floor(seconds));
2441
- resetAt.setMilliseconds(resetAt.getMilliseconds() + (seconds - Math.floor(seconds)) * 1e3 + milliseconds);
2442
- return resetAt;
2633
+ __name(unflattenAttributes, "unflattenAttributes");
2634
+ function primitiveValueOrflattenedAttributes(obj, prefix) {
2635
+ if (typeof obj === "string" || typeof obj === "number" || typeof obj === "boolean" || obj === null || obj === void 0) {
2636
+ return obj;
2637
+ }
2638
+ const attributes = flattenAttributes(obj, prefix);
2639
+ if (prefix !== void 0 && typeof attributes[prefix] !== "undefined" && attributes[prefix] !== null) {
2640
+ return attributes[prefix];
2641
+ }
2642
+ return attributes;
2443
2643
  }
2444
- __name(calculateISO8601DurationOpenAIVariantResetAt, "calculateISO8601DurationOpenAIVariantResetAt");
2445
-
2446
- // src/v3/utils/retries.ts
2447
- var defaultRetryOptions = {
2448
- maxAttempts: 3,
2449
- factor: 2,
2450
- minTimeoutInMs: 1e3,
2451
- maxTimeoutInMs: 6e4,
2452
- randomize: true
2453
- };
2454
- var defaultFetchRetryOptions = {
2455
- byStatus: {
2456
- "429,408,409,5xx": {
2457
- strategy: "backoff",
2458
- ...defaultRetryOptions
2459
- }
2460
- },
2461
- connectionError: defaultRetryOptions,
2462
- timeout: defaultRetryOptions
2463
- };
2464
- function calculateNextRetryDelay(options, attempt) {
2465
- const opts = {
2466
- ...defaultRetryOptions,
2467
- ...options
2468
- };
2469
- if (attempt >= opts.maxAttempts) {
2470
- return;
2644
+ __name(primitiveValueOrflattenedAttributes, "primitiveValueOrflattenedAttributes");
2645
+ function rehydrateNull(value) {
2646
+ if (value === NULL_SENTINEL) {
2647
+ return null;
2471
2648
  }
2472
- const { factor, minTimeoutInMs, maxTimeoutInMs, randomize } = opts;
2473
- const random = randomize ? Math.random() + 1 : 1;
2474
- const timeout = Math.min(maxTimeoutInMs, random * minTimeoutInMs * Math.pow(factor, attempt - 1));
2475
- return Math.round(timeout);
2649
+ return value;
2476
2650
  }
2477
- __name(calculateNextRetryDelay, "calculateNextRetryDelay");
2478
- function calculateResetAt2(resets, format, now = Date.now()) {
2479
- const resetAt = calculateResetAt(resets, format, new Date(now));
2480
- return resetAt?.getTime();
2651
+ __name(rehydrateNull, "rehydrateNull");
2652
+
2653
+ // src/v3/utils/styleAttributes.ts
2654
+ function accessoryAttributes(accessory) {
2655
+ return flattenAttributes(accessory, SemanticInternalAttributes.STYLE_ACCESSORY);
2481
2656
  }
2482
- __name(calculateResetAt2, "calculateResetAt");
2657
+ __name(accessoryAttributes, "accessoryAttributes");
2483
2658
 
2484
2659
  // src/v3/apiClient/pagination.ts
2485
2660
  var _CursorPage = class _CursorPage {
@@ -2589,6 +2764,12 @@ var defaultRetryOptions2 = {
2589
2764
  maxTimeoutInMs: 6e4,
2590
2765
  randomize: false
2591
2766
  };
2767
+ var requestOptionsKeys = {
2768
+ retry: true
2769
+ };
2770
+ var isRequestOptions = /* @__PURE__ */ __name((obj) => {
2771
+ return typeof obj === "object" && obj !== null && !isEmptyObj(obj) && Object.keys(obj).every((k) => hasOwn(requestOptionsKeys, k));
2772
+ }, "isRequestOptions");
2592
2773
  function zodfetch(schema, url, requestInit, options) {
2593
2774
  return new ApiPromise(_doZodFetch(schema, url, requestInit, options));
2594
2775
  }
@@ -2639,16 +2820,47 @@ function zodfetchOffsetLimitPage(schema, url, params, requestInit, options) {
2639
2820
  return new OffsetLimitPagePromise(fetchResult, schema, url, params, requestInit, options);
2640
2821
  }
2641
2822
  __name(zodfetchOffsetLimitPage, "zodfetchOffsetLimitPage");
2642
- async function _doZodFetch(schema, url, requestInit, options, attempt = 1) {
2823
+ async function traceZodFetch(params, callback) {
2824
+ if (!params.options?.tracer) {
2825
+ return callback();
2826
+ }
2827
+ const url = new URL(params.url);
2828
+ const method = params.requestInit?.method ?? "GET";
2829
+ const name = params.options.name ?? `${method} ${url.pathname}`;
2830
+ return await params.options.tracer.startActiveSpan(name, async (span) => {
2831
+ return await callback(span);
2832
+ }, {
2833
+ attributes: {
2834
+ [SemanticInternalAttributes.STYLE_ICON]: params.options?.icon ?? "api",
2835
+ ...params.options.attributes
2836
+ }
2837
+ });
2838
+ }
2839
+ __name(traceZodFetch, "traceZodFetch");
2840
+ async function _doZodFetch(schema, url, requestInit, options) {
2841
+ const $requestInit = await requestInit;
2842
+ return traceZodFetch({
2843
+ url,
2844
+ requestInit: $requestInit,
2845
+ options
2846
+ }, async (span) => {
2847
+ const result = await _doZodFetchWithRetries(schema, url, $requestInit, options);
2848
+ if (options?.onResponseBody && span) {
2849
+ options.onResponseBody(result.data, span);
2850
+ }
2851
+ return result;
2852
+ });
2853
+ }
2854
+ __name(_doZodFetch, "_doZodFetch");
2855
+ async function _doZodFetchWithRetries(schema, url, requestInit, options, attempt = 1) {
2643
2856
  try {
2644
- const $requestInit = await requestInit;
2645
- const response = await fetch(url, requestInitWithCache($requestInit));
2857
+ const response = await fetch(url, requestInitWithCache(requestInit));
2646
2858
  const responseHeaders = createResponseHeaders(response.headers);
2647
2859
  if (!response.ok) {
2648
2860
  const retryResult = shouldRetry(response, attempt, options?.retry);
2649
2861
  if (retryResult.retry) {
2650
- await new Promise((resolve) => setTimeout(resolve, retryResult.delay));
2651
- return await _doZodFetch(schema, url, requestInit, options, attempt + 1);
2862
+ await waitForRetry(url, attempt + 1, retryResult.delay, options, requestInit, response);
2863
+ return await _doZodFetchWithRetries(schema, url, requestInit, options, attempt + 1);
2652
2864
  } else {
2653
2865
  const errText = await response.text().catch((e) => castToError2(e).message);
2654
2866
  const errJSON = safeJsonParse(errText);
@@ -2676,8 +2888,8 @@ async function _doZodFetch(schema, url, requestInit, options, attempt = 1) {
2676
2888
  };
2677
2889
  const delay = calculateNextRetryDelay(retry, attempt);
2678
2890
  if (delay) {
2679
- await new Promise((resolve) => setTimeout(resolve, delay));
2680
- return await _doZodFetch(schema, url, requestInit, options, attempt + 1);
2891
+ await waitForRetry(url, attempt + 1, delay, options, requestInit);
2892
+ return await _doZodFetchWithRetries(schema, url, requestInit, options, attempt + 1);
2681
2893
  }
2682
2894
  }
2683
2895
  throw new ApiConnectionError({
@@ -2685,7 +2897,7 @@ async function _doZodFetch(schema, url, requestInit, options, attempt = 1) {
2685
2897
  });
2686
2898
  }
2687
2899
  }
2688
- __name(_doZodFetch, "_doZodFetch");
2900
+ __name(_doZodFetchWithRetries, "_doZodFetchWithRetries");
2689
2901
  function castToError2(err) {
2690
2902
  if (err instanceof Error)
2691
2903
  return err;
@@ -2722,8 +2934,25 @@ function shouldRetry(response, attempt, retryOptions) {
2722
2934
  return shouldRetryForOptions();
2723
2935
  if (response.status === 409)
2724
2936
  return shouldRetryForOptions();
2725
- if (response.status === 429)
2937
+ if (response.status === 429) {
2938
+ if (attempt >= (typeof retryOptions?.maxAttempts === "number" ? retryOptions?.maxAttempts : 3)) {
2939
+ return {
2940
+ retry: false
2941
+ };
2942
+ }
2943
+ const resetAtUnixEpochMs = response.headers.get("x-ratelimit-reset");
2944
+ if (resetAtUnixEpochMs) {
2945
+ const resetAtUnixEpoch = parseInt(resetAtUnixEpochMs, 10);
2946
+ const delay = resetAtUnixEpoch - Date.now() + Math.floor(Math.random() * 1e3);
2947
+ if (delay > 0) {
2948
+ return {
2949
+ retry: true,
2950
+ delay
2951
+ };
2952
+ }
2953
+ }
2726
2954
  return shouldRetryForOptions();
2955
+ }
2727
2956
  if (response.status >= 500)
2728
2957
  return shouldRetryForOptions();
2729
2958
  return {
@@ -2886,9 +3115,44 @@ fetchPage_fn2 = /* @__PURE__ */ __name(function(params1) {
2886
3115
  }, "#fetchPage");
2887
3116
  __name(_OffsetLimitPagePromise, "OffsetLimitPagePromise");
2888
3117
  var OffsetLimitPagePromise = _OffsetLimitPagePromise;
3118
+ async function waitForRetry(url, attempt, delay, options, requestInit, response) {
3119
+ if (options?.tracer) {
3120
+ const method = requestInit?.method ?? "GET";
3121
+ return options.tracer.startActiveSpan(response ? `wait after ${response.status}` : `wait after error`, async (span) => {
3122
+ await new Promise((resolve) => setTimeout(resolve, delay));
3123
+ }, {
3124
+ attributes: {
3125
+ [SemanticInternalAttributes.STYLE_ICON]: "wait",
3126
+ ...accessoryAttributes({
3127
+ items: [
3128
+ {
3129
+ text: `retrying ${options?.name ?? method.toUpperCase()} in ${delay}ms`,
3130
+ variant: "normal"
3131
+ }
3132
+ ],
3133
+ style: "codepath"
3134
+ })
3135
+ }
3136
+ });
3137
+ }
3138
+ await new Promise((resolve) => setTimeout(resolve, delay));
3139
+ }
3140
+ __name(waitForRetry, "waitForRetry");
3141
+ function isEmptyObj(obj) {
3142
+ if (!obj)
3143
+ return true;
3144
+ for (const _k in obj)
3145
+ return false;
3146
+ return true;
3147
+ }
3148
+ __name(isEmptyObj, "isEmptyObj");
3149
+ function hasOwn(obj, key) {
3150
+ return Object.prototype.hasOwnProperty.call(obj, key);
3151
+ }
3152
+ __name(hasOwn, "hasOwn");
2889
3153
 
2890
3154
  // src/v3/apiClient/index.ts
2891
- var zodFetchOptions = {
3155
+ var DEFAULT_ZOD_FETCH_OPTIONS = {
2892
3156
  retry: {
2893
3157
  maxAttempts: 3,
2894
3158
  minTimeoutInMs: 1e3,
@@ -2899,17 +3163,18 @@ var zodFetchOptions = {
2899
3163
  };
2900
3164
  var _getHeaders, getHeaders_fn;
2901
3165
  var _ApiClient = class _ApiClient {
2902
- constructor(baseUrl, accessToken) {
3166
+ constructor(baseUrl, accessToken, requestOptions = {}) {
2903
3167
  __privateAdd(this, _getHeaders);
2904
3168
  this.accessToken = accessToken;
2905
3169
  this.baseUrl = baseUrl.replace(/\/$/, "");
3170
+ this.defaultRequestOptions = mergeRequestOptions(DEFAULT_ZOD_FETCH_OPTIONS, requestOptions);
2906
3171
  }
2907
- async getRunResult(runId) {
3172
+ async getRunResult(runId, requestOptions) {
2908
3173
  try {
2909
3174
  return await zodfetch(TaskRunExecutionResult, `${this.baseUrl}/api/v1/runs/${runId}/result`, {
2910
3175
  method: "GET",
2911
3176
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2912
- }, zodFetchOptions);
3177
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2913
3178
  } catch (error) {
2914
3179
  if (error instanceof ApiError) {
2915
3180
  if (error.status === 404) {
@@ -2919,47 +3184,47 @@ var _ApiClient = class _ApiClient {
2919
3184
  throw error;
2920
3185
  }
2921
3186
  }
2922
- async getBatchResults(batchId) {
3187
+ async getBatchResults(batchId, requestOptions) {
2923
3188
  return await zodfetch(BatchTaskRunExecutionResult, `${this.baseUrl}/api/v1/batches/${batchId}/results`, {
2924
3189
  method: "GET",
2925
3190
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2926
- }, zodFetchOptions);
3191
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2927
3192
  }
2928
- triggerTask(taskId, body, options) {
3193
+ triggerTask(taskId, body, options, requestOptions) {
2929
3194
  const encodedTaskId = encodeURIComponent(taskId);
2930
3195
  return zodfetch(TriggerTaskResponse, `${this.baseUrl}/api/v1/tasks/${encodedTaskId}/trigger`, {
2931
3196
  method: "POST",
2932
3197
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, options?.spanParentAsLink ?? false),
2933
3198
  body: JSON.stringify(body)
2934
- }, zodFetchOptions);
3199
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2935
3200
  }
2936
- batchTriggerTask(taskId, body, options) {
3201
+ batchTriggerTask(taskId, body, options, requestOptions) {
2937
3202
  const encodedTaskId = encodeURIComponent(taskId);
2938
3203
  return zodfetch(BatchTriggerTaskResponse, `${this.baseUrl}/api/v1/tasks/${encodedTaskId}/batch`, {
2939
3204
  method: "POST",
2940
3205
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, options?.spanParentAsLink ?? false),
2941
3206
  body: JSON.stringify(body)
2942
- }, zodFetchOptions);
3207
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2943
3208
  }
2944
- createUploadPayloadUrl(filename) {
3209
+ createUploadPayloadUrl(filename, requestOptions) {
2945
3210
  return zodfetch(CreateUploadPayloadUrlResponseBody, `${this.baseUrl}/api/v1/packets/${filename}`, {
2946
3211
  method: "PUT",
2947
3212
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2948
- }, zodFetchOptions);
3213
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2949
3214
  }
2950
- getPayloadUrl(filename) {
3215
+ getPayloadUrl(filename, requestOptions) {
2951
3216
  return zodfetch(CreateUploadPayloadUrlResponseBody, `${this.baseUrl}/api/v1/packets/${filename}`, {
2952
3217
  method: "GET",
2953
3218
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2954
- }, zodFetchOptions);
3219
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2955
3220
  }
2956
- retrieveRun(runId) {
3221
+ retrieveRun(runId, requestOptions) {
2957
3222
  return zodfetch(RetrieveRunResponse, `${this.baseUrl}/api/v3/runs/${runId}`, {
2958
3223
  method: "GET",
2959
3224
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2960
- }, zodFetchOptions);
3225
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2961
3226
  }
2962
- listRuns(query) {
3227
+ listRuns(query, requestOptions) {
2963
3228
  const searchParams = createSearchQueryForListRuns(query);
2964
3229
  return zodfetchCursorPage(ListRunResponseItem, `${this.baseUrl}/api/v1/runs`, {
2965
3230
  query: searchParams,
@@ -2969,9 +3234,9 @@ var _ApiClient = class _ApiClient {
2969
3234
  }, {
2970
3235
  method: "GET",
2971
3236
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2972
- }, zodFetchOptions);
3237
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2973
3238
  }
2974
- listProjectRuns(projectRef, query) {
3239
+ listProjectRuns(projectRef, query, requestOptions) {
2975
3240
  const searchParams = createSearchQueryForListRuns(query);
2976
3241
  if (query?.env) {
2977
3242
  searchParams.append("filter[env]", Array.isArray(query.env) ? query.env.join(",") : query.env);
@@ -2984,35 +3249,35 @@ var _ApiClient = class _ApiClient {
2984
3249
  }, {
2985
3250
  method: "GET",
2986
3251
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2987
- }, zodFetchOptions);
3252
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2988
3253
  }
2989
- replayRun(runId) {
3254
+ replayRun(runId, requestOptions) {
2990
3255
  return zodfetch(ReplayRunResponse, `${this.baseUrl}/api/v1/runs/${runId}/replay`, {
2991
3256
  method: "POST",
2992
3257
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2993
- }, zodFetchOptions);
3258
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
2994
3259
  }
2995
- cancelRun(runId) {
3260
+ cancelRun(runId, requestOptions) {
2996
3261
  return zodfetch(CanceledRunResponse, `${this.baseUrl}/api/v2/runs/${runId}/cancel`, {
2997
3262
  method: "POST",
2998
3263
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
2999
- }, zodFetchOptions);
3264
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3000
3265
  }
3001
- rescheduleRun(runId, body) {
3266
+ rescheduleRun(runId, body, requestOptions) {
3002
3267
  return zodfetch(RetrieveRunResponse, `${this.baseUrl}/api/v1/runs/${runId}/reschedule`, {
3003
3268
  method: "POST",
3004
3269
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
3005
3270
  body: JSON.stringify(body)
3006
- }, zodFetchOptions);
3271
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3007
3272
  }
3008
- createSchedule(options) {
3273
+ createSchedule(options, requestOptions) {
3009
3274
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules`, {
3010
3275
  method: "POST",
3011
3276
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
3012
3277
  body: JSON.stringify(options)
3013
- });
3278
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3014
3279
  }
3015
- listSchedules(options) {
3280
+ listSchedules(options, requestOptions) {
3016
3281
  const searchParams = new URLSearchParams();
3017
3282
  if (options?.page) {
3018
3283
  searchParams.append("page", options.page.toString());
@@ -3026,77 +3291,77 @@ var _ApiClient = class _ApiClient {
3026
3291
  }, {
3027
3292
  method: "GET",
3028
3293
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
3029
- });
3294
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3030
3295
  }
3031
- retrieveSchedule(scheduleId) {
3296
+ retrieveSchedule(scheduleId, requestOptions) {
3032
3297
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules/${scheduleId}`, {
3033
3298
  method: "GET",
3034
3299
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
3035
- });
3300
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3036
3301
  }
3037
- updateSchedule(scheduleId, options) {
3302
+ updateSchedule(scheduleId, options, requestOptions) {
3038
3303
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules/${scheduleId}`, {
3039
3304
  method: "PUT",
3040
3305
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
3041
3306
  body: JSON.stringify(options)
3042
- });
3307
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3043
3308
  }
3044
- deactivateSchedule(scheduleId) {
3309
+ deactivateSchedule(scheduleId, requestOptions) {
3045
3310
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules/${scheduleId}/deactivate`, {
3046
3311
  method: "POST",
3047
3312
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
3048
- });
3313
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3049
3314
  }
3050
- activateSchedule(scheduleId) {
3315
+ activateSchedule(scheduleId, requestOptions) {
3051
3316
  return zodfetch(ScheduleObject, `${this.baseUrl}/api/v1/schedules/${scheduleId}/activate`, {
3052
3317
  method: "POST",
3053
3318
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
3054
- });
3319
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3055
3320
  }
3056
- deleteSchedule(scheduleId) {
3321
+ deleteSchedule(scheduleId, requestOptions) {
3057
3322
  return zodfetch(DeletedScheduleObject, `${this.baseUrl}/api/v1/schedules/${scheduleId}`, {
3058
3323
  method: "DELETE",
3059
3324
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
3060
- });
3325
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3061
3326
  }
3062
- listEnvVars(projectRef, slug) {
3327
+ listEnvVars(projectRef, slug, requestOptions) {
3063
3328
  return zodfetch(EnvironmentVariables, `${this.baseUrl}/api/v1/projects/${projectRef}/envvars/${slug}`, {
3064
3329
  method: "GET",
3065
3330
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
3066
- });
3331
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3067
3332
  }
3068
- importEnvVars(projectRef, slug, body) {
3333
+ importEnvVars(projectRef, slug, body, requestOptions) {
3069
3334
  return zodfetch(EnvironmentVariableResponseBody, `${this.baseUrl}/api/v1/projects/${projectRef}/envvars/${slug}/import`, {
3070
3335
  method: "POST",
3071
3336
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
3072
3337
  body: JSON.stringify(body)
3073
- });
3338
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3074
3339
  }
3075
- retrieveEnvVar(projectRef, slug, key) {
3340
+ retrieveEnvVar(projectRef, slug, key, requestOptions) {
3076
3341
  return zodfetch(EnvironmentVariableValue, `${this.baseUrl}/api/v1/projects/${projectRef}/envvars/${slug}/${key}`, {
3077
3342
  method: "GET",
3078
3343
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
3079
- });
3344
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3080
3345
  }
3081
- createEnvVar(projectRef, slug, body) {
3346
+ createEnvVar(projectRef, slug, body, requestOptions) {
3082
3347
  return zodfetch(EnvironmentVariableResponseBody, `${this.baseUrl}/api/v1/projects/${projectRef}/envvars/${slug}`, {
3083
3348
  method: "POST",
3084
3349
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
3085
3350
  body: JSON.stringify(body)
3086
- });
3351
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3087
3352
  }
3088
- updateEnvVar(projectRef, slug, key, body) {
3353
+ updateEnvVar(projectRef, slug, key, body, requestOptions) {
3089
3354
  return zodfetch(EnvironmentVariableResponseBody, `${this.baseUrl}/api/v1/projects/${projectRef}/envvars/${slug}/${key}`, {
3090
3355
  method: "PUT",
3091
3356
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false),
3092
3357
  body: JSON.stringify(body)
3093
- });
3358
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3094
3359
  }
3095
- deleteEnvVar(projectRef, slug, key) {
3360
+ deleteEnvVar(projectRef, slug, key, requestOptions) {
3096
3361
  return zodfetch(EnvironmentVariableResponseBody, `${this.baseUrl}/api/v1/projects/${projectRef}/envvars/${slug}/${key}`, {
3097
3362
  method: "DELETE",
3098
3363
  headers: __privateMethod(this, _getHeaders, getHeaders_fn).call(this, false)
3099
- });
3364
+ }, mergeRequestOptions(this.defaultRequestOptions, requestOptions));
3100
3365
  }
3101
3366
  };
3102
3367
  _getHeaders = new WeakSet();
@@ -3151,6 +3416,20 @@ function createSearchQueryForListRuns(query) {
3151
3416
  return searchParams;
3152
3417
  }
3153
3418
  __name(createSearchQueryForListRuns, "createSearchQueryForListRuns");
3419
+ function mergeRequestOptions(defaultOptions, options) {
3420
+ if (!options) {
3421
+ return defaultOptions;
3422
+ }
3423
+ return {
3424
+ ...defaultOptions,
3425
+ ...options,
3426
+ retry: {
3427
+ ...defaultOptions.retry,
3428
+ ...options.retry
3429
+ }
3430
+ };
3431
+ }
3432
+ __name(mergeRequestOptions, "mergeRequestOptions");
3154
3433
  var _SimpleClock = class _SimpleClock {
3155
3434
  preciseNow() {
3156
3435
  const now = new PreciseDate();
@@ -3243,128 +3522,6 @@ function calculateAttributeValueLength(value) {
3243
3522
  return 0;
3244
3523
  }
3245
3524
  __name(calculateAttributeValueLength, "calculateAttributeValueLength");
3246
-
3247
- // src/v3/utils/flattenAttributes.ts
3248
- var NULL_SENTINEL = "$@null((";
3249
- function flattenAttributes(obj, prefix) {
3250
- const result = {};
3251
- if (obj === void 0) {
3252
- return result;
3253
- }
3254
- if (obj === null) {
3255
- result[prefix || ""] = NULL_SENTINEL;
3256
- return result;
3257
- }
3258
- if (typeof obj === "string") {
3259
- result[prefix || ""] = obj;
3260
- return result;
3261
- }
3262
- if (typeof obj === "number") {
3263
- result[prefix || ""] = obj;
3264
- return result;
3265
- }
3266
- if (typeof obj === "boolean") {
3267
- result[prefix || ""] = obj;
3268
- return result;
3269
- }
3270
- for (const [key, value] of Object.entries(obj)) {
3271
- const newPrefix = `${prefix ? `${prefix}.` : ""}${Array.isArray(obj) ? `[${key}]` : key}`;
3272
- if (Array.isArray(value)) {
3273
- for (let i = 0; i < value.length; i++) {
3274
- if (typeof value[i] === "object" && value[i] !== null) {
3275
- Object.assign(result, flattenAttributes(value[i], `${newPrefix}.[${i}]`));
3276
- } else {
3277
- if (value[i] === null) {
3278
- result[`${newPrefix}.[${i}]`] = NULL_SENTINEL;
3279
- } else {
3280
- result[`${newPrefix}.[${i}]`] = value[i];
3281
- }
3282
- }
3283
- }
3284
- } else if (isRecord(value)) {
3285
- Object.assign(result, flattenAttributes(value, newPrefix));
3286
- } else {
3287
- if (typeof value === "number" || typeof value === "string" || typeof value === "boolean") {
3288
- result[newPrefix] = value;
3289
- } else if (value === null) {
3290
- result[newPrefix] = NULL_SENTINEL;
3291
- }
3292
- }
3293
- }
3294
- return result;
3295
- }
3296
- __name(flattenAttributes, "flattenAttributes");
3297
- function isRecord(value) {
3298
- return value !== null && typeof value === "object" && !Array.isArray(value);
3299
- }
3300
- __name(isRecord, "isRecord");
3301
- function unflattenAttributes(obj) {
3302
- if (typeof obj !== "object" || obj === null || Array.isArray(obj)) {
3303
- return obj;
3304
- }
3305
- if (typeof obj === "object" && obj !== null && Object.keys(obj).length === 1 && Object.keys(obj)[0] === "") {
3306
- return rehydrateNull(obj[""]);
3307
- }
3308
- if (Object.keys(obj).length === 0) {
3309
- return;
3310
- }
3311
- const result = {};
3312
- for (const [key, value] of Object.entries(obj)) {
3313
- const parts = key.split(".").reduce((acc, part) => {
3314
- if (part.includes("[")) {
3315
- const subparts = part.split(/\[|\]/).filter((p) => p !== "");
3316
- acc.push(...subparts);
3317
- } else {
3318
- acc.push(part);
3319
- }
3320
- return acc;
3321
- }, []);
3322
- let current = result;
3323
- for (let i = 0; i < parts.length - 1; i++) {
3324
- const part = parts[i];
3325
- const nextPart = parts[i + 1];
3326
- const isArray = /^\d+$/.test(nextPart);
3327
- if (isArray && !Array.isArray(current[part])) {
3328
- current[part] = [];
3329
- } else if (!isArray && current[part] === void 0) {
3330
- current[part] = {};
3331
- }
3332
- current = current[part];
3333
- }
3334
- const lastPart = parts[parts.length - 1];
3335
- current[lastPart] = rehydrateNull(value);
3336
- }
3337
- if (Object.keys(result).every((k) => /^\d+$/.test(k))) {
3338
- const maxIndex = Math.max(...Object.keys(result).map((k) => parseInt(k)));
3339
- const arrayResult = Array(maxIndex + 1);
3340
- for (const key in result) {
3341
- arrayResult[parseInt(key)] = result[key];
3342
- }
3343
- return arrayResult;
3344
- }
3345
- return result;
3346
- }
3347
- __name(unflattenAttributes, "unflattenAttributes");
3348
- function primitiveValueOrflattenedAttributes(obj, prefix) {
3349
- if (typeof obj === "string" || typeof obj === "number" || typeof obj === "boolean" || obj === null || obj === void 0) {
3350
- return obj;
3351
- }
3352
- const attributes = flattenAttributes(obj, prefix);
3353
- if (prefix !== void 0 && typeof attributes[prefix] !== "undefined" && attributes[prefix] !== null) {
3354
- return attributes[prefix];
3355
- }
3356
- return attributes;
3357
- }
3358
- __name(primitiveValueOrflattenedAttributes, "primitiveValueOrflattenedAttributes");
3359
- function rehydrateNull(value) {
3360
- if (value === NULL_SENTINEL) {
3361
- return null;
3362
- }
3363
- return value;
3364
- }
3365
- __name(rehydrateNull, "rehydrateNull");
3366
-
3367
- // src/v3/logger/taskLogger.ts
3368
3525
  var _NoopTaskLogger = class _NoopTaskLogger {
3369
3526
  debug() {
3370
3527
  }
@@ -3809,14 +3966,16 @@ var _TriggerTracer = class _TriggerTracer {
3809
3966
  attributes,
3810
3967
  startTime: clock.preciseNow()
3811
3968
  }, parentContext, async (span) => {
3812
- this.tracer.startSpan(name, {
3813
- ...options,
3814
- attributes: {
3815
- ...attributes,
3816
- [SemanticInternalAttributes.SPAN_PARTIAL]: true,
3817
- [SemanticInternalAttributes.SPAN_ID]: span.spanContext().spanId
3818
- }
3819
- }, parentContext).end();
3969
+ if (taskContext.ctx) {
3970
+ this.tracer.startSpan(name, {
3971
+ ...options,
3972
+ attributes: {
3973
+ ...attributes,
3974
+ [SemanticInternalAttributes.SPAN_PARTIAL]: true,
3975
+ [SemanticInternalAttributes.SPAN_ID]: span.spanContext().spanId
3976
+ }
3977
+ }, parentContext).end();
3978
+ }
3820
3979
  const usageMeasurement = usage.start();
3821
3980
  try {
3822
3981
  return await fn(span);
@@ -3829,12 +3988,14 @@ var _TriggerTracer = class _TriggerTracer {
3829
3988
  });
3830
3989
  throw e;
3831
3990
  } finally {
3832
- const usageSample = usage.stop(usageMeasurement);
3833
- const machine = taskContext.ctx?.machine;
3834
- span.setAttributes({
3835
- [SemanticInternalAttributes.USAGE_DURATION_MS]: usageSample.cpuTime,
3836
- [SemanticInternalAttributes.USAGE_COST_IN_CENTS]: machine?.centsPerMs ? usageSample.cpuTime * machine.centsPerMs : 0
3837
- });
3991
+ if (taskContext.ctx) {
3992
+ const usageSample = usage.stop(usageMeasurement);
3993
+ const machine = taskContext.ctx.machine;
3994
+ span.setAttributes({
3995
+ [SemanticInternalAttributes.USAGE_DURATION_MS]: usageSample.cpuTime,
3996
+ [SemanticInternalAttributes.USAGE_COST_IN_CENTS]: machine?.centsPerMs ? usageSample.cpuTime * machine.centsPerMs : 0
3997
+ });
3998
+ }
3838
3999
  span.end(clock.preciseNow());
3839
4000
  }
3840
4001
  });
@@ -4026,12 +4187,6 @@ function omit(obj, ...keys) {
4026
4187
  }
4027
4188
  __name(omit, "omit");
4028
4189
 
4029
- // src/v3/utils/styleAttributes.ts
4030
- function accessoryAttributes(accessory) {
4031
- return flattenAttributes(accessory, SemanticInternalAttributes.STYLE_ACCESSORY);
4032
- }
4033
- __name(accessoryAttributes, "accessoryAttributes");
4034
-
4035
4190
  // src/v3/utils/detectDependencyVersion.ts
4036
4191
  function detectDependencyVersion(dependency) {
4037
4192
  return dependencies[dependency];
@@ -4307,6 +4462,6 @@ function safeJsonParse2(value) {
4307
4462
  }
4308
4463
  __name(safeJsonParse2, "safeJsonParse");
4309
4464
 
4310
- export { ApiClient, ApiConnectionError, ApiError, AttemptStatus, AuthenticationError, BackgroundWorkerClientMessages, BackgroundWorkerMetadata, BackgroundWorkerProperties, BackgroundWorkerServerMessages, BadRequestError, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, ClientToSharedQueueMessages, Config, ConflictError, CoordinatorToPlatformMessages, CoordinatorToProdWorkerMessages, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateEnvironmentVariableRequestBody, CreateScheduleOptions, CreateUploadPayloadUrlResponseBody, CursorPage, DeletedScheduleObject, DeploymentErrorData, EnvironmentType, EnvironmentVariable, EnvironmentVariableResponseBody, EnvironmentVariableValue, EnvironmentVariables, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, FixedWindowRateLimit, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, GetPersonalAccessTokenRequestSchema, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, ImageDetailsMetadata, ImportEnvironmentVariablesRequestBody, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, InternalServerError, ListRunResponse, ListRunResponseItem, ListScheduleOptions, ListSchedulesResult, MachineConfig, MachineCpu, MachineMemory, MachinePreset, MachinePresetName, 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, OffsetLimitPage, OtherSpanEvent, PRIMARY_VARIANT, PermissionDeniedError, PlatformToCoordinatorMessages, PlatformToProviderMessages, PostStartCauses, PreStopCauses, ProdChildToWorkerMessages, ProdTaskRunExecution, ProdTaskRunExecutionPayload, ProdWorkerSocketData, ProdWorkerToChildMessages, ProdWorkerToCoordinatorMessages, ProviderToPlatformMessages, QueueOptions, RateLimitError, RateLimitOptions, ReplayRunResponse, RescheduleRunRequestBody, RetrieveRunResponse, RetryOptions, RunEnvironmentDetails, RunScheduleDetails, RunStatus, ScheduleGenerator, ScheduleObject, ScheduledTaskPayload, SemanticInternalAttributes, SerializedError, SharedQueueToClientMessages, SlidingWindowRateLimit, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskFileMetadata, TaskMetadata, TaskMetadataFailedToParseData, TaskMetadataWithFilePath, TaskResource, TaskRun, TaskRunBuiltInError, TaskRunContext, TaskRunCustomErrorObject, TaskRunError, TaskRunErrorCodes, TaskRunExecution, TaskRunExecutionAttempt, TaskRunExecutionBatch, TaskRunExecutionEnvironment, TaskRunExecutionLazyAttemptPayload, TaskRunExecutionOrganization, TaskRunExecutionPayload, TaskRunExecutionProject, TaskRunExecutionQueue, TaskRunExecutionResult, TaskRunExecutionRetry, TaskRunExecutionTask, TaskRunExecutionUsage, TaskRunFailedExecutionResult, TaskRunInternalError, TaskRunStringError, TaskRunSuccessfulExecutionResult, TimezonesResult, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, UncaughtExceptionMessage, UnprocessableEntityError, UpdateEnvironmentVariableRequestBody, UpdateScheduleOptions, WaitReason, WhoAmIResponseSchema, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt2 as calculateResetAt, childToWorkerMessages, clientWebsocketMessages, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createJsonErrorObject, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, eventFilterMatches, flattenAttributes, formatDuration, formatDurationInDays, formatDurationMilliseconds, formatDurationNanoseconds, groupTaskMetadataIssuesByTask, imposeAttributeLimits, isCancellationSpanEvent, isExceptionSpanEvent, logger, millisecondsToNanoseconds, nanosecondsToMilliseconds, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, serverWebsocketMessages, stringPatternMatchers, stringifyIO, taskCatalog, taskContext, unflattenAttributes, usage, workerToChildMessages };
4465
+ export { AbortTaskRunError, ApiClient, ApiConnectionError, ApiError, AttemptStatus, AuthenticationError, BackgroundWorkerClientMessages, BackgroundWorkerMetadata, BackgroundWorkerProperties, BackgroundWorkerServerMessages, BadRequestError, BatchTaskRunExecutionResult, BatchTriggerTaskRequestBody, BatchTriggerTaskResponse, CanceledRunResponse, CancellationSpanEvent, ClientToSharedQueueMessages, Config, ConflictError, CoordinatorSocketData, CoordinatorToPlatformMessages, CoordinatorToProdWorkerMessages, CreateAuthorizationCodeResponseSchema, CreateBackgroundWorkerRequestBody, CreateBackgroundWorkerResponse, CreateEnvironmentVariableRequestBody, CreateScheduleOptions, CreateUploadPayloadUrlResponseBody, CursorPage, DeletedScheduleObject, DeploymentErrorData, EnvironmentType, EnvironmentVariable, EnvironmentVariableResponseBody, EnvironmentVariableValue, EnvironmentVariables, EventFilter, ExceptionEventProperties, ExceptionSpanEvent, ExternalBuildData, FetchRetryBackoffStrategy, FetchRetryByStatusOptions, FetchRetryHeadersStrategy, FetchRetryOptions, FetchRetryStrategy, FetchTimeoutOptions, FixedWindowRateLimit, GetBatchResponseBody, GetDeploymentResponseBody, GetEnvironmentVariablesResponseBody, GetPersonalAccessTokenRequestSchema, GetPersonalAccessTokenResponseSchema, GetProjectEnvResponse, GetProjectResponseBody, GetProjectsResponseBody, ImageDetailsMetadata, ImportEnvironmentVariablesRequestBody, InitializeDeploymentRequestBody, InitializeDeploymentResponseBody, InternalServerError, ListRunResponse, ListRunResponseItem, ListScheduleOptions, ListSchedulesResult, MachineConfig, MachineCpu, MachineMemory, MachinePreset, MachinePresetName, 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, OffsetLimitPage, OtherSpanEvent, PRIMARY_VARIANT, PermissionDeniedError, PlatformToCoordinatorMessages, PlatformToProviderMessages, PostStartCauses, PreStopCauses, ProdChildToWorkerMessages, ProdTaskRunExecution, ProdTaskRunExecutionPayload, ProdWorkerSocketData, ProdWorkerToChildMessages, ProdWorkerToCoordinatorMessages, ProviderToPlatformMessages, QueueOptions, RateLimitError, RateLimitOptions, ReplayRunResponse, RescheduleRunRequestBody, RetrieveRunResponse, RetryOptions, RunEnvironmentDetails, RunScheduleDetails, RunStatus, ScheduleGenerator, ScheduleObject, ScheduledTaskPayload, SemanticInternalAttributes, SerializedError, SharedQueueToClientMessages, SlidingWindowRateLimit, SpanEvent, SpanEvents, SpanMessagingEvent, StartDeploymentIndexingRequestBody, StartDeploymentIndexingResponseBody, TaskEventStyle, TaskFileMetadata, TaskMetadata, TaskMetadataFailedToParseData, TaskMetadataWithFilePath, TaskResource, TaskRun, TaskRunBuiltInError, TaskRunContext, TaskRunCustomErrorObject, TaskRunError, TaskRunErrorCodes, TaskRunExecution, TaskRunExecutionAttempt, TaskRunExecutionBatch, TaskRunExecutionEnvironment, TaskRunExecutionLazyAttemptPayload, TaskRunExecutionOrganization, TaskRunExecutionPayload, TaskRunExecutionProject, TaskRunExecutionQueue, TaskRunExecutionResult, TaskRunExecutionRetry, TaskRunExecutionTask, TaskRunExecutionUsage, TaskRunFailedExecutionResult, TaskRunInternalError, TaskRunStringError, TaskRunSuccessfulExecutionResult, TimezonesResult, TriggerTaskRequestBody, TriggerTaskResponse, TriggerTracer, UncaughtExceptionMessage, UnprocessableEntityError, UpdateEnvironmentVariableRequestBody, UpdateScheduleOptions, WaitReason, WhoAmIResponseSchema, accessoryAttributes, apiClientManager, calculateNextRetryDelay, calculateResetAt2 as calculateResetAt, childToWorkerMessages, clientWebsocketMessages, clock, conditionallyExportPacket, conditionallyImportPacket, correctErrorStackTrace, createErrorTaskError, createJsonErrorObject, createPacketAttributes, createPacketAttributesAsJson, defaultFetchRetryOptions, defaultRetryOptions, detectDependencyVersion, eventFilterMatches, flattenAttributes, formatDuration, formatDurationInDays, formatDurationMilliseconds, formatDurationNanoseconds, groupTaskMetadataIssuesByTask, imposeAttributeLimits, isCancellationSpanEvent, isExceptionSpanEvent, isRequestOptions, logger, mergeRequestOptions, millisecondsToNanoseconds, nanosecondsToMilliseconds, omit, packetRequiresOffloading, parseError, parsePacket, prettyPrintPacket, primitiveValueOrflattenedAttributes, runtime, sanitizeError, serverWebsocketMessages, stringPatternMatchers, stringifyIO, taskCatalog, taskContext, unflattenAttributes, usage, workerToChildMessages };
4311
4466
  //# sourceMappingURL=out.js.map
4312
4467
  //# sourceMappingURL=index.mjs.map