@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.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkPGAHGFKF_cjs = require('./chunk-PGAHGFKF.cjs');
|
|
4
4
|
var agent = require('@mastra/core/agent');
|
|
5
5
|
var error = require('@mastra/core/error');
|
|
6
6
|
var observability = require('@mastra/core/observability');
|
|
@@ -19,7 +19,7 @@ function prepareServeOptions({ mastra, inngest, functions: userFunctions = [], r
|
|
|
19
19
|
return {
|
|
20
20
|
...registerOptions,
|
|
21
21
|
client: inngest,
|
|
22
|
-
functions:
|
|
22
|
+
functions: chunkPGAHGFKF_cjs.collectInngestFunctions({ mastra, functions: userFunctions })
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
function createServe(adapter) {
|
|
@@ -109,7 +109,16 @@ function createInngestDurableAgenticWorkflow(options) {
|
|
|
109
109
|
return llmOutput.toolCalls ?? [];
|
|
110
110
|
},
|
|
111
111
|
{ id: "extract-tool-calls" }
|
|
112
|
-
).foreach(toolCallStep
|
|
112
|
+
).foreach(toolCallStep, {
|
|
113
|
+
concurrency: ({ inputData, getInitData }) => {
|
|
114
|
+
const state = getInitData();
|
|
115
|
+
return durable.resolveDurableToolCallConcurrency({
|
|
116
|
+
options: state?.options,
|
|
117
|
+
toolsMetadata: state?.toolsMetadata,
|
|
118
|
+
toolCalls: inputData
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}).map(
|
|
113
122
|
async ({ inputData, getStepResult, getInitData, mastra }) => {
|
|
114
123
|
const toolResults = inputData;
|
|
115
124
|
const llmOutput = getStepResult(llmExecutionStep.id);
|
|
@@ -317,7 +326,7 @@ function createInngestAgent(options) {
|
|
|
317
326
|
let proxyRef;
|
|
318
327
|
const workflow = createInngestDurableAgenticWorkflow({ inngest });
|
|
319
328
|
let _customCache = cache$1;
|
|
320
|
-
let innerPubsub = customPubsub ?? new
|
|
329
|
+
let innerPubsub = customPubsub ?? new chunkPGAHGFKF_cjs.InngestPubSub(inngest, InngestDurableStepIds.AGENTIC_LOOP);
|
|
321
330
|
let _cachingPubsub = null;
|
|
322
331
|
function resolveCache() {
|
|
323
332
|
const resolved = _customCache ?? mastra?.serverCache ?? new cache.InMemoryServerCache();
|
|
@@ -566,7 +575,10 @@ function createInngestAgent(options) {
|
|
|
566
575
|
existingEntry = {
|
|
567
576
|
// Minimal placeholder fields. The durable LLM step recreates tools
|
|
568
577
|
// and model from the workflow input; this slot exists primarily to
|
|
569
|
-
// carry the abort controller across the resumed segment.
|
|
578
|
+
// carry the abort controller across the resumed segment. The
|
|
579
|
+
// explicit flag tells resolveRuntimeDependencies to rebuild runtime
|
|
580
|
+
// state from the Mastra instance instead of trusting this entry.
|
|
581
|
+
isPlaceholder: true,
|
|
570
582
|
tools: {},
|
|
571
583
|
model: void 0
|
|
572
584
|
};
|
|
@@ -819,7 +831,7 @@ function isInngestAgent(obj) {
|
|
|
819
831
|
|
|
820
832
|
// src/index.ts
|
|
821
833
|
function isInngestWorkflow(input) {
|
|
822
|
-
return input instanceof
|
|
834
|
+
return input instanceof chunkPGAHGFKF_cjs.InngestWorkflow;
|
|
823
835
|
}
|
|
824
836
|
function isAgentCompatible(input) {
|
|
825
837
|
return typeof input === "object" && input !== null && "generate" in input && typeof input.generate === "function" && "stream" in input && typeof input.stream === "function" && "getDescription" in input && typeof input.getDescription === "function" && "getModel" in input && typeof input.getModel === "function";
|
|
@@ -828,10 +840,10 @@ function isToolStep(input) {
|
|
|
828
840
|
return input instanceof tools.Tool;
|
|
829
841
|
}
|
|
830
842
|
function isStepParams(input) {
|
|
831
|
-
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof agent.Agent) && !(input instanceof tools.Tool) && !(input instanceof
|
|
843
|
+
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof agent.Agent) && !(input instanceof tools.Tool) && !(input instanceof chunkPGAHGFKF_cjs.InngestWorkflow);
|
|
832
844
|
}
|
|
833
845
|
function isProcessor(obj) {
|
|
834
|
-
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof agent.Agent) && !(obj instanceof tools.Tool) && !(obj instanceof
|
|
846
|
+
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof agent.Agent) && !(obj instanceof tools.Tool) && !(obj instanceof chunkPGAHGFKF_cjs.InngestWorkflow) && (typeof obj.processInput === "function" || typeof obj.processInputStep === "function" || typeof obj.processOutputStream === "function" || typeof obj.processOutputResult === "function" || typeof obj.processOutputStep === "function");
|
|
835
847
|
}
|
|
836
848
|
function createStep(params, agentOrToolOptions) {
|
|
837
849
|
if (isInngestWorkflow(params)) {
|
|
@@ -1506,7 +1518,7 @@ function init(inngest) {
|
|
|
1506
1518
|
return {
|
|
1507
1519
|
createTool: tools.createTool,
|
|
1508
1520
|
createWorkflow(params) {
|
|
1509
|
-
return new
|
|
1521
|
+
return new chunkPGAHGFKF_cjs.InngestWorkflow(
|
|
1510
1522
|
params,
|
|
1511
1523
|
inngest
|
|
1512
1524
|
);
|
|
@@ -1546,23 +1558,23 @@ function init(inngest) {
|
|
|
1546
1558
|
|
|
1547
1559
|
Object.defineProperty(exports, "InngestExecutionEngine", {
|
|
1548
1560
|
enumerable: true,
|
|
1549
|
-
get: function () { return
|
|
1561
|
+
get: function () { return chunkPGAHGFKF_cjs.InngestExecutionEngine; }
|
|
1550
1562
|
});
|
|
1551
1563
|
Object.defineProperty(exports, "InngestPubSub", {
|
|
1552
1564
|
enumerable: true,
|
|
1553
|
-
get: function () { return
|
|
1565
|
+
get: function () { return chunkPGAHGFKF_cjs.InngestPubSub; }
|
|
1554
1566
|
});
|
|
1555
1567
|
Object.defineProperty(exports, "InngestRun", {
|
|
1556
1568
|
enumerable: true,
|
|
1557
|
-
get: function () { return
|
|
1569
|
+
get: function () { return chunkPGAHGFKF_cjs.InngestRun; }
|
|
1558
1570
|
});
|
|
1559
1571
|
Object.defineProperty(exports, "InngestWorkflow", {
|
|
1560
1572
|
enumerable: true,
|
|
1561
|
-
get: function () { return
|
|
1573
|
+
get: function () { return chunkPGAHGFKF_cjs.InngestWorkflow; }
|
|
1562
1574
|
});
|
|
1563
1575
|
Object.defineProperty(exports, "connect", {
|
|
1564
1576
|
enumerable: true,
|
|
1565
|
-
get: function () { return
|
|
1577
|
+
get: function () { return chunkPGAHGFKF_cjs.connect; }
|
|
1566
1578
|
});
|
|
1567
1579
|
exports._compatibilityCheck = _compatibilityCheck;
|
|
1568
1580
|
exports.createInngestAgent = createInngestAgent;
|