@mastra/inngest 1.10.3 → 1.10.4-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/dist/connect.cjs +1 -1
- package/dist/connect.js +1 -1
- package/dist/durable-agent/create-inngest-agentic-workflow.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-B3okURIT.js → src-BadexCXD.js} +23 -5
- package/dist/src-BadexCXD.js.map +1 -0
- package/dist/{src-C_m1Tz7d.cjs → src-eRQ6u6Yi.cjs} +22 -4
- package/dist/{src-C_m1Tz7d.cjs.map → src-eRQ6u6Yi.cjs.map} +1 -1
- package/package.json +4 -4
- package/dist/src-B3okURIT.js.map +0 -1
package/dist/connect.cjs
CHANGED
package/dist/connect.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as connect } from "./src-
|
|
1
|
+
import { i as connect } from "./src-BadexCXD.js";
|
|
2
2
|
export { connect };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-inngest-agentic-workflow.d.ts","sourceRoot":"","sources":["../../src/durable-agent/create-inngest-agentic-workflow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-inngest-agentic-workflow.d.ts","sourceRoot":"","sources":["../../src/durable-agent/create-inngest-agentic-workflow.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAe,OAAO,EAAE,MAAM,SAAS,CAAC;AAIpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAwCzD;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACnD,8BAA8B;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kGAAkG;IAClG,OAAO,CAAC,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;CAC/C;AAuCD,oCAAoC;AACpC,eAAO,MAAM,qBAAqB;aAChC,iBAAiB;aACjB,YAAY;CACJ,CAAC;AAEX,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAgXhG"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_src = require("./src-
|
|
2
|
+
const require_src = require("./src-eRQ6u6Yi.cjs");
|
|
3
3
|
exports.InngestExecutionEngine = require_src.InngestExecutionEngine;
|
|
4
4
|
exports.InngestPubSub = require_src.InngestPubSub;
|
|
5
5
|
exports.InngestRun = require_src.InngestRun;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createServe, c as isInngestAgent, d as InngestRun, f as InngestPubSub, i as connect, l as createInngestDurableAgenticWorkflow, n as init, o as serve, p as InngestExecutionEngine, r as _compatibilityCheck, s as createInngestAgent, t as createStep, u as InngestWorkflow } from "./src-
|
|
1
|
+
import { a as createServe, c as isInngestAgent, d as InngestRun, f as InngestPubSub, i as connect, l as createInngestDurableAgenticWorkflow, n as init, o as serve, p as InngestExecutionEngine, r as _compatibilityCheck, s as createInngestAgent, t as createStep, u as InngestWorkflow } from "./src-BadexCXD.js";
|
|
2
2
|
export { InngestExecutionEngine, InngestPubSub, InngestRun, InngestWorkflow, _compatibilityCheck, connect, createInngestAgent, createInngestDurableAgenticWorkflow, createServe, createStep, init, isInngestAgent, serve };
|
|
@@ -5,7 +5,7 @@ import { ProcessorRunner, ProcessorState, ProcessorStepOutputSchema, ProcessorSt
|
|
|
5
5
|
import { toStandardSchema } from "@mastra/core/schema";
|
|
6
6
|
import { Tool, createTool } from "@mastra/core/tools";
|
|
7
7
|
import { DefaultExecutionEngine, Run, Workflow, createStepFromAgent, createStepFromTool, createTimeTravelExecutionParams, getEntryWorkflow, hydrateSerializedStepErrors, isSingleStepEntry } from "@mastra/core/workflows";
|
|
8
|
-
import { AGENT_STREAM_TOPIC, DurableAgentDefaults, DurableStepIds, agentThreadStreamRuntime, baseIterationStateSchema, createBaseIterationStateUpdate, createDurableAgentStream, createDurableBackgroundTaskCheckStep, createDurableLLMExecutionStep, createDurableLLMMappingStep, createDurableToolCallStep, durableAgenticOutputSchema, emitErrorEvent, emitFinishEvent, executeDurableAgentScorers, globalRunRegistry, modelConfigSchema, prepareForDurableExecution, publishAbortRequest, resolveDurableToolCallConcurrency, runDurableFinishSideEffects, runDurableStreamUntilIdle, runResumeDurableStreamUntilIdle } from "@mastra/core/agent/durable";
|
|
8
|
+
import { AGENT_STREAM_TOPIC, DurableAgentDefaults, DurableStepIds, agentThreadStreamRuntime, baseIterationStateSchema, createBaseIterationStateUpdate, createDurableAgentStream, createDurableBackgroundTaskCheckStep, createDurableLLMExecutionStep, createDurableLLMMappingStep, createDurableToolCallStep, durableAgenticOutputSchema, emitChunkEvent, emitErrorEvent, emitFinishEvent, executeDurableAgentScorers, globalRunRegistry, modelConfigSchema, prepareForDurableExecution, publishAbortRequest, resolveDurableToolCallConcurrency, runDurableFinishSideEffects, runDurableStreamUntilIdle, runResumeDurableStreamUntilIdle } from "@mastra/core/agent/durable";
|
|
9
9
|
import { RequestContext } from "@mastra/core/di";
|
|
10
10
|
import { CachingPubSub, PubSub } from "@mastra/core/events";
|
|
11
11
|
import { NonRetriableError } from "inngest";
|
|
@@ -2218,13 +2218,20 @@ function createInngestDurableAgenticWorkflow(options) {
|
|
|
2218
2218
|
modelSpanData,
|
|
2219
2219
|
stepIndex: input.stepIndex ?? 0
|
|
2220
2220
|
};
|
|
2221
|
-
}, { id: "init-iteration-state" }).dowhile(singleIterationWorkflow, async ({ inputData }) => {
|
|
2221
|
+
}, { id: "init-iteration-state" }).dowhile(singleIterationWorkflow, async ({ inputData, engine }) => {
|
|
2222
2222
|
const state = inputData;
|
|
2223
2223
|
if (state.delegationBailed) return false;
|
|
2224
2224
|
const shouldContinue = state.lastStepResult?.isContinued === true;
|
|
2225
2225
|
const effectiveMaxSteps = state.options?.maxSteps ?? maxSteps;
|
|
2226
2226
|
const underMaxSteps = state.iterationCount < effectiveMaxSteps;
|
|
2227
|
-
|
|
2227
|
+
if (!shouldContinue || !underMaxSteps) return false;
|
|
2228
|
+
const { step } = engine;
|
|
2229
|
+
return !await step.run(`stop-when-${state.runId}-${state.iterationCount}`, async () => {
|
|
2230
|
+
const stopWhen = globalRunRegistry.get(state.runId)?.stopWhen;
|
|
2231
|
+
if (!stopWhen || state.accumulatedSteps.length === 0) return false;
|
|
2232
|
+
const steps = state.accumulatedSteps;
|
|
2233
|
+
return (await Promise.all((Array.isArray(stopWhen) ? stopWhen : [stopWhen]).map((condition) => condition({ steps })))).some(Boolean);
|
|
2234
|
+
});
|
|
2228
2235
|
}).map(async (params) => {
|
|
2229
2236
|
const { inputData, mastra, requestContext, tracingContext } = params;
|
|
2230
2237
|
const state = inputData;
|
|
@@ -2251,10 +2258,21 @@ function createInngestDurableAgenticWorkflow(options) {
|
|
|
2251
2258
|
lastStep.text = finishResult.outputText;
|
|
2252
2259
|
finalText = finishResult.outputText;
|
|
2253
2260
|
}
|
|
2261
|
+
const tripwire = finishResult.tripwire;
|
|
2262
|
+
if (tripwire && pubsub) await emitChunkEvent(pubsub, state.runId, {
|
|
2263
|
+
type: "tripwire",
|
|
2264
|
+
runId: state.runId,
|
|
2265
|
+
from: ChunkFrom.AGENT,
|
|
2266
|
+
payload: tripwire
|
|
2267
|
+
});
|
|
2254
2268
|
const finalOutput = {
|
|
2255
2269
|
messageListState: finishResult.messageListState,
|
|
2256
2270
|
messageId: state.messageId,
|
|
2257
|
-
stepResult:
|
|
2271
|
+
stepResult: tripwire ? {
|
|
2272
|
+
...state.lastStepResult ?? { warnings: [] },
|
|
2273
|
+
reason: "tripwire",
|
|
2274
|
+
isContinued: false
|
|
2275
|
+
} : state.lastStepResult || {
|
|
2258
2276
|
reason: "stop",
|
|
2259
2277
|
warnings: [],
|
|
2260
2278
|
isContinued: false
|
|
@@ -3810,4 +3828,4 @@ function init(inngest) {
|
|
|
3810
3828
|
//#endregion
|
|
3811
3829
|
export { createServe as a, isInngestAgent as c, InngestRun as d, InngestPubSub as f, connect as i, createInngestDurableAgenticWorkflow as l, init as n, serve$1 as o, InngestExecutionEngine as p, _compatibilityCheck as r, createInngestAgent as s, createStep as t, InngestWorkflow as u };
|
|
3812
3830
|
|
|
3813
|
-
//# sourceMappingURL=src-
|
|
3831
|
+
//# sourceMappingURL=src-BadexCXD.js.map
|