@mastra/inngest 1.8.2-alpha.0 → 1.8.2

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.js CHANGED
@@ -1,5 +1,5 @@
1
- import { InngestPubSub, InngestWorkflow, collectInngestFunctions } from './chunk-YGGGKCAH.js';
2
- export { InngestExecutionEngine, InngestPubSub, InngestRun, InngestWorkflow, connect } from './chunk-YGGGKCAH.js';
1
+ import { InngestPubSub, InngestWorkflow, collectInngestFunctions } from './chunk-ECZL7DF4.js';
2
+ export { InngestExecutionEngine, InngestPubSub, InngestRun, InngestWorkflow, connect } from './chunk-ECZL7DF4.js';
3
3
  import { MessageList, Agent, TripWire } from '@mastra/core/agent';
4
4
  import { MastraError, ErrorDomain, ErrorCategory } from '@mastra/core/error';
5
5
  import { InternalSpans, EntityType, SpanType } from '@mastra/core/observability';
@@ -10,7 +10,7 @@ import { Workflow } from '@mastra/core/workflows';
10
10
  import { PUBSUB_SYMBOL, STREAM_FORMAT_SYMBOL } from '@mastra/core/workflows/_constants';
11
11
  import { z } from 'zod';
12
12
  import { serve as serve$1 } from 'inngest/hono';
13
- import { modelConfigSchema, baseIterationStateSchema, createDurableLLMExecutionStep, createDurableToolCallStep, createDurableLLMMappingStep, createDurableBackgroundTaskCheckStep, DurableStepIds, createBaseIterationStateUpdate, durableAgenticOutputSchema, emitFinishEvent, globalRunRegistry, createDurableAgentStream, prepareForDurableExecution, runResumeDurableStreamUntilIdle, runDurableStreamUntilIdle, emitErrorEvent, DurableAgentDefaults } from '@mastra/core/agent/durable';
13
+ import { modelConfigSchema, baseIterationStateSchema, createDurableLLMExecutionStep, createDurableToolCallStep, createDurableLLMMappingStep, createDurableBackgroundTaskCheckStep, DurableStepIds, resolveDurableToolCallConcurrency, createBaseIterationStateUpdate, durableAgenticOutputSchema, emitFinishEvent, globalRunRegistry, createDurableAgentStream, prepareForDurableExecution, runResumeDurableStreamUntilIdle, runDurableStreamUntilIdle, emitErrorEvent, DurableAgentDefaults } from '@mastra/core/agent/durable';
14
14
  import { InMemoryServerCache } from '@mastra/core/cache';
15
15
  import { CachingPubSub } from '@mastra/core/events';
16
16
 
@@ -108,7 +108,16 @@ function createInngestDurableAgenticWorkflow(options) {
108
108
  return llmOutput.toolCalls ?? [];
109
109
  },
110
110
  { id: "extract-tool-calls" }
111
- ).foreach(toolCallStep).map(
111
+ ).foreach(toolCallStep, {
112
+ concurrency: ({ inputData, getInitData }) => {
113
+ const state = getInitData();
114
+ return resolveDurableToolCallConcurrency({
115
+ options: state?.options,
116
+ toolsMetadata: state?.toolsMetadata,
117
+ toolCalls: inputData
118
+ });
119
+ }
120
+ }).map(
112
121
  async ({ inputData, getStepResult, getInitData, mastra }) => {
113
122
  const toolResults = inputData;
114
123
  const llmOutput = getStepResult(llmExecutionStep.id);
@@ -565,7 +574,10 @@ function createInngestAgent(options) {
565
574
  existingEntry = {
566
575
  // Minimal placeholder fields. The durable LLM step recreates tools
567
576
  // and model from the workflow input; this slot exists primarily to
568
- // carry the abort controller across the resumed segment.
577
+ // carry the abort controller across the resumed segment. The
578
+ // explicit flag tells resolveRuntimeDependencies to rebuild runtime
579
+ // state from the Mastra instance instead of trusting this entry.
580
+ isPlaceholder: true,
569
581
  tools: {},
570
582
  model: void 0
571
583
  };