@mastra/inngest 0.13.2 → 0.13.3-alpha.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @mastra/inngest
2
2
 
3
+ ## 0.13.3-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Added the ability to hide internal ai tracing spans (enabled by default) ([#7764](https://github.com/mastra-ai/mastra/pull/7764))
8
+
9
+ - Updated dependencies [[`5802bf5`](https://github.com/mastra-ai/mastra/commit/5802bf57f6182e4b67c28d7d91abed349a8d14f3), [`5bda53a`](https://github.com/mastra-ai/mastra/commit/5bda53a9747bfa7d876d754fc92c83a06e503f62), [`f26a8fd`](https://github.com/mastra-ai/mastra/commit/f26a8fd99fcb0497a5d86c28324430d7f6a5fb83), [`1a1fbe6`](https://github.com/mastra-ai/mastra/commit/1a1fbe66efb7d94abc373ed0dd9676adb8122454), [`36f39c0`](https://github.com/mastra-ai/mastra/commit/36f39c00dc794952dc3c11aab91c2fa8bca74b11)]:
10
+ - @mastra/core@0.16.4-alpha.0
11
+
3
12
  ## 0.13.2
4
13
 
5
14
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -204,33 +204,9 @@ var InngestRun = class extends workflows.Run {
204
204
  }
205
205
  stream({ inputData, runtimeContext } = {}) {
206
206
  const { readable, writable } = new TransformStream();
207
- let currentToolData = void 0;
208
207
  const writer = writable.getWriter();
209
208
  const unwatch = this.watch(async (event) => {
210
- if (event.type === "workflow-agent-call-start") {
211
- currentToolData = {
212
- name: event.payload.name,
213
- args: event.payload.args
214
- };
215
- await writer.write({
216
- ...event.payload,
217
- type: "tool-call-streaming-start"
218
- });
219
- return;
220
- }
221
209
  try {
222
- if (event.type === "workflow-agent-call-finish") {
223
- return;
224
- } else if (!event.type.startsWith("workflow-")) {
225
- if (event.type === "text-delta") {
226
- await writer.write({
227
- type: "tool-call-delta",
228
- ...currentToolData ?? {},
229
- argsTextDelta: event.textDelta
230
- });
231
- }
232
- return;
233
- }
234
210
  const e = {
235
211
  ...event,
236
212
  type: event.type.replace("workflow-", "")
@@ -480,10 +456,6 @@ function createStep(params) {
480
456
  name: params.name,
481
457
  args: inputData
482
458
  };
483
- await emitter.emit("watch-v2", {
484
- type: "workflow-agent-call-start",
485
- payload: toolData
486
- });
487
459
  const { fullStream } = await params.stream(inputData.prompt, {
488
460
  // resourceId: inputData.resourceId,
489
461
  // threadId: inputData.threadId,
@@ -497,12 +469,22 @@ function createStep(params) {
497
469
  if (abortSignal.aborted) {
498
470
  return abort();
499
471
  }
472
+ await emitter.emit("watch-v2", {
473
+ type: "tool-call-streaming-start",
474
+ ...toolData ?? {}
475
+ });
500
476
  for await (const chunk of fullStream) {
501
- await emitter.emit("watch-v2", chunk);
477
+ if (chunk.type === "text-delta") {
478
+ await emitter.emit("watch-v2", {
479
+ type: "tool-call-delta",
480
+ ...toolData ?? {},
481
+ argsTextDelta: chunk.textDelta
482
+ });
483
+ }
502
484
  }
503
485
  await emitter.emit("watch-v2", {
504
- type: "workflow-agent-call-finish",
505
- payload: toolData
486
+ type: "tool-call-streaming-finish",
487
+ ...toolData ?? {}
506
488
  });
507
489
  return {
508
490
  text: await streamPromise.promise
@@ -669,7 +651,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
669
651
  attributes: {
670
652
  durationMs: duration,
671
653
  sleepType: fn ? "dynamic" : "fixed"
672
- }
654
+ },
655
+ isInternal: tracingContext?.isInternal
673
656
  });
674
657
  if (fn) {
675
658
  const stepCallId = crypto.randomUUID();
@@ -682,7 +665,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
682
665
  inputData: prevOutput,
683
666
  runCount: -1,
684
667
  tracingContext: {
685
- currentSpan: sleepSpan
668
+ currentSpan: sleepSpan,
669
+ isInternal: sleepSpan?.isInternal
686
670
  },
687
671
  getInitData: () => stepResults?.input,
688
672
  getStepResult: (step) => {
@@ -754,7 +738,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
754
738
  untilDate: date,
755
739
  durationMs: date ? Math.max(0, date.getTime() - Date.now()) : void 0,
756
740
  sleepType: fn ? "dynamic" : "fixed"
757
- }
741
+ },
742
+ isInternal: tracingContext?.isInternal
758
743
  });
759
744
  if (fn) {
760
745
  date = await this.inngestStep.run(`workflow.${workflowId}.sleepUntil.${entry.id}`, async () => {
@@ -767,7 +752,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
767
752
  inputData: prevOutput,
768
753
  runCount: -1,
769
754
  tracingContext: {
770
- currentSpan: sleepUntilSpan
755
+ currentSpan: sleepUntilSpan,
756
+ isInternal: sleepUntilSpan?.isInternal
771
757
  },
772
758
  getInitData: () => stepResults?.input,
773
759
  getStepResult: (step) => {
@@ -852,7 +838,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
852
838
  input: prevOutput,
853
839
  attributes: {
854
840
  stepId: step.id
855
- }
841
+ },
842
+ isInternal: tracingContext?.isInternal
856
843
  });
857
844
  const startedAt = await this.inngestStep.run(
858
845
  `workflow.${executionContext.workflowId}.run.${executionContext.runId}.step.${step.id}.running_ev`,
@@ -1075,7 +1062,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
1075
1062
  inputData: prevOutput,
1076
1063
  resumeData: resume?.steps[0] === step.id ? resume?.resumePayload : void 0,
1077
1064
  tracingContext: {
1078
- currentSpan: stepAISpan
1065
+ currentSpan: stepAISpan,
1066
+ isInternal: stepAISpan?.isInternal
1079
1067
  },
1080
1068
  getInitData: () => stepResults?.input,
1081
1069
  getStepResult: (step2) => {
@@ -1200,7 +1188,7 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
1200
1188
  stepId: step.id,
1201
1189
  runtimeContext,
1202
1190
  disableScorers,
1203
- tracingContext: { currentSpan: stepAISpan }
1191
+ tracingContext: { currentSpan: stepAISpan, isInternal: true }
1204
1192
  });
1205
1193
  }
1206
1194
  });
@@ -1266,7 +1254,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
1266
1254
  input: prevOutput,
1267
1255
  attributes: {
1268
1256
  conditionCount: entry.conditions.length
1269
- }
1257
+ },
1258
+ isInternal: tracingContext?.isInternal
1270
1259
  });
1271
1260
  let execResults;
1272
1261
  const truthyIndexes = (await Promise.all(
@@ -1278,7 +1267,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
1278
1267
  input: prevOutput,
1279
1268
  attributes: {
1280
1269
  conditionIndex: index
1281
- }
1270
+ },
1271
+ isInternal: tracingContext?.isInternal
1282
1272
  });
1283
1273
  try {
1284
1274
  const result = await cond({
@@ -1289,7 +1279,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
1289
1279
  runCount: -1,
1290
1280
  inputData: prevOutput,
1291
1281
  tracingContext: {
1292
- currentSpan: evalSpan
1282
+ currentSpan: evalSpan,
1283
+ isInternal: evalSpan?.isInternal
1293
1284
  },
1294
1285
  getInitData: () => stepResults?.input,
1295
1286
  getStepResult: (step) => {
@@ -1377,7 +1368,8 @@ var InngestExecutionEngine = class extends workflows.DefaultExecutionEngine {
1377
1368
  writableStream,
1378
1369
  disableScorers,
1379
1370
  tracingContext: {
1380
- currentSpan: conditionalSpan
1371
+ currentSpan: conditionalSpan,
1372
+ isInternal: conditionalSpan?.isInternal
1381
1373
  }
1382
1374
  })
1383
1375
  )