@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/CHANGELOG.md +56 -0
- package/dist/{chunk-YGGGKCAH.js → chunk-ECZL7DF4.js} +38 -7
- package/dist/chunk-ECZL7DF4.js.map +1 -0
- package/dist/{chunk-O67FVVSO.cjs → chunk-PGAHGFKF.cjs} +37 -6
- package/dist/chunk-PGAHGFKF.cjs.map +1 -0
- package/dist/connect.cjs +2 -2
- package/dist/connect.js +1 -1
- package/dist/durable-agent/create-inngest-agent.d.ts.map +1 -1
- package/dist/durable-agent/create-inngest-agentic-workflow.d.ts.map +1 -1
- package/dist/execution-engine.d.ts +1 -0
- package/dist/execution-engine.d.ts.map +1 -1
- package/dist/index.cjs +26 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/chunk-O67FVVSO.cjs.map +0 -1
- package/dist/chunk-YGGGKCAH.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InngestPubSub, InngestWorkflow, collectInngestFunctions } from './chunk-
|
|
2
|
-
export { InngestExecutionEngine, InngestPubSub, InngestRun, InngestWorkflow, connect } from './chunk-
|
|
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
|
|
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
|
};
|