@trigger.dev/sdk 2.3.10 → 2.3.12

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.
package/dist/index.mjs CHANGED
@@ -258,7 +258,7 @@ __name(_Job, "Job");
258
258
  var Job = _Job;
259
259
 
260
260
  // package.json
261
- var version = "2.3.10";
261
+ var version = "2.3.12";
262
262
 
263
263
  // src/errors.ts
264
264
  var _ResumeWithTaskError = class _ResumeWithTaskError {
@@ -635,6 +635,13 @@ var _IO = class _IO {
635
635
  get logger() {
636
636
  return new IOLogger(async (level, message, data) => {
637
637
  let logLevel = "info";
638
+ if (data instanceof Error) {
639
+ data = {
640
+ name: data.name,
641
+ message: data.message,
642
+ stack: data.stack
643
+ };
644
+ }
638
645
  if (Logger.satisfiesLogLevel(logLevel, this._jobLogLevel)) {
639
646
  await this.runTask([
640
647
  message,
@@ -1379,7 +1386,6 @@ var _IO = class _IO {
1379
1386
  * @returns A Promise that resolves with the returned value of the callback.
1380
1387
  */
1381
1388
  async runTask(cacheKey, callback, options, onError) {
1382
- __privateMethod(this, _detectAutoYield, detectAutoYield_fn).call(this, "start_task", 500);
1383
1389
  const parentId = this._taskStorage.getStore()?.taskId;
1384
1390
  if (parentId) {
1385
1391
  this._logger.debug("Using parent task", {
@@ -1388,6 +1394,10 @@ var _IO = class _IO {
1388
1394
  options
1389
1395
  });
1390
1396
  }
1397
+ const isSubtaskNoop = options?.noop === true && parentId !== void 0;
1398
+ if (!isSubtaskNoop) {
1399
+ __privateMethod(this, _detectAutoYield, detectAutoYield_fn).call(this, "start_task", 500);
1400
+ }
1391
1401
  const idempotencyKey = await generateIdempotencyKey([
1392
1402
  this._id,
1393
1403
  parentId ?? "",
@@ -2721,6 +2731,7 @@ function eventTrigger(options) {
2721
2731
  return new EventTrigger({
2722
2732
  name: options.name,
2723
2733
  filter: options.filter,
2734
+ source: options.source,
2724
2735
  event: {
2725
2736
  name: options.name,
2726
2737
  title: "Event",