@mastra/inngest 1.8.1 → 1.8.2-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 +9 -0
- package/dist/{chunk-YACLO5I5.cjs → chunk-O67FVVSO.cjs} +8 -3
- package/dist/chunk-O67FVVSO.cjs.map +1 -0
- package/dist/{chunk-6AX2K2MQ.js → chunk-YGGGKCAH.js} +8 -3
- package/dist/chunk-YGGGKCAH.js.map +1 -0
- package/dist/connect.cjs +2 -2
- package/dist/connect.js +1 -1
- package/dist/durable-agent/create-inngest-agent.d.ts +14 -8
- package/dist/durable-agent/create-inngest-agent.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 +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/chunk-6AX2K2MQ.js.map +0 -1
- package/dist/chunk-YACLO5I5.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkO67FVVSO_cjs = require('./chunk-O67FVVSO.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: chunkO67FVVSO_cjs.collectInngestFunctions({ mastra, functions: userFunctions })
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
function createServe(adapter) {
|
|
@@ -317,7 +317,7 @@ function createInngestAgent(options) {
|
|
|
317
317
|
let proxyRef;
|
|
318
318
|
const workflow = createInngestDurableAgenticWorkflow({ inngest });
|
|
319
319
|
let _customCache = cache$1;
|
|
320
|
-
let innerPubsub = customPubsub ?? new
|
|
320
|
+
let innerPubsub = customPubsub ?? new chunkO67FVVSO_cjs.InngestPubSub(inngest, InngestDurableStepIds.AGENTIC_LOOP);
|
|
321
321
|
let _cachingPubsub = null;
|
|
322
322
|
function resolveCache() {
|
|
323
323
|
const resolved = _customCache ?? mastra?.serverCache ?? new cache.InMemoryServerCache();
|
|
@@ -352,7 +352,7 @@ function createInngestAgent(options) {
|
|
|
352
352
|
inputData: workflowInput,
|
|
353
353
|
runId,
|
|
354
354
|
resourceId: workflowInput.state?.resourceId,
|
|
355
|
-
requestContext: {},
|
|
355
|
+
requestContext: workflowInput.requestContextEntries ?? {},
|
|
356
356
|
tracingOptions
|
|
357
357
|
}
|
|
358
358
|
});
|
|
@@ -479,9 +479,9 @@ function createInngestAgent(options) {
|
|
|
479
479
|
finalizeGlobalRegistry();
|
|
480
480
|
}
|
|
481
481
|
},
|
|
482
|
-
onError: async (
|
|
482
|
+
onError: async (errorArg) => {
|
|
483
483
|
try {
|
|
484
|
-
await streamOptions?.onError?.(
|
|
484
|
+
await streamOptions?.onError?.(errorArg);
|
|
485
485
|
} finally {
|
|
486
486
|
finalizeGlobalRegistry();
|
|
487
487
|
}
|
|
@@ -604,9 +604,9 @@ function createInngestAgent(options) {
|
|
|
604
604
|
finalizeResumeRegistry();
|
|
605
605
|
}
|
|
606
606
|
},
|
|
607
|
-
onError: async (
|
|
607
|
+
onError: async (errorArg) => {
|
|
608
608
|
try {
|
|
609
|
-
await resumeOptions?.onError?.(
|
|
609
|
+
await resumeOptions?.onError?.(errorArg);
|
|
610
610
|
} finally {
|
|
611
611
|
finalizeResumeRegistry();
|
|
612
612
|
}
|
|
@@ -637,7 +637,7 @@ function createInngestAgent(options) {
|
|
|
637
637
|
initialState: snapshot?.value ?? {},
|
|
638
638
|
runId,
|
|
639
639
|
resourceId: resumeOptions?.resourceId,
|
|
640
|
-
requestContext: {},
|
|
640
|
+
requestContext: snapshot?.requestContext ?? {},
|
|
641
641
|
stepResults: snapshot?.context,
|
|
642
642
|
resume: {
|
|
643
643
|
steps,
|
|
@@ -819,7 +819,7 @@ function isInngestAgent(obj) {
|
|
|
819
819
|
|
|
820
820
|
// src/index.ts
|
|
821
821
|
function isInngestWorkflow(input) {
|
|
822
|
-
return input instanceof
|
|
822
|
+
return input instanceof chunkO67FVVSO_cjs.InngestWorkflow;
|
|
823
823
|
}
|
|
824
824
|
function isAgentCompatible(input) {
|
|
825
825
|
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 +828,10 @@ function isToolStep(input) {
|
|
|
828
828
|
return input instanceof tools.Tool;
|
|
829
829
|
}
|
|
830
830
|
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
|
|
831
|
+
return input !== null && typeof input === "object" && "id" in input && "execute" in input && !(input instanceof agent.Agent) && !(input instanceof tools.Tool) && !(input instanceof chunkO67FVVSO_cjs.InngestWorkflow);
|
|
832
832
|
}
|
|
833
833
|
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
|
|
834
|
+
return obj !== null && typeof obj === "object" && "id" in obj && typeof obj.id === "string" && !(obj instanceof agent.Agent) && !(obj instanceof tools.Tool) && !(obj instanceof chunkO67FVVSO_cjs.InngestWorkflow) && (typeof obj.processInput === "function" || typeof obj.processInputStep === "function" || typeof obj.processOutputStream === "function" || typeof obj.processOutputResult === "function" || typeof obj.processOutputStep === "function");
|
|
835
835
|
}
|
|
836
836
|
function createStep(params, agentOrToolOptions) {
|
|
837
837
|
if (isInngestWorkflow(params)) {
|
|
@@ -1506,7 +1506,7 @@ function init(inngest) {
|
|
|
1506
1506
|
return {
|
|
1507
1507
|
createTool: tools.createTool,
|
|
1508
1508
|
createWorkflow(params) {
|
|
1509
|
-
return new
|
|
1509
|
+
return new chunkO67FVVSO_cjs.InngestWorkflow(
|
|
1510
1510
|
params,
|
|
1511
1511
|
inngest
|
|
1512
1512
|
);
|
|
@@ -1546,23 +1546,23 @@ function init(inngest) {
|
|
|
1546
1546
|
|
|
1547
1547
|
Object.defineProperty(exports, "InngestExecutionEngine", {
|
|
1548
1548
|
enumerable: true,
|
|
1549
|
-
get: function () { return
|
|
1549
|
+
get: function () { return chunkO67FVVSO_cjs.InngestExecutionEngine; }
|
|
1550
1550
|
});
|
|
1551
1551
|
Object.defineProperty(exports, "InngestPubSub", {
|
|
1552
1552
|
enumerable: true,
|
|
1553
|
-
get: function () { return
|
|
1553
|
+
get: function () { return chunkO67FVVSO_cjs.InngestPubSub; }
|
|
1554
1554
|
});
|
|
1555
1555
|
Object.defineProperty(exports, "InngestRun", {
|
|
1556
1556
|
enumerable: true,
|
|
1557
|
-
get: function () { return
|
|
1557
|
+
get: function () { return chunkO67FVVSO_cjs.InngestRun; }
|
|
1558
1558
|
});
|
|
1559
1559
|
Object.defineProperty(exports, "InngestWorkflow", {
|
|
1560
1560
|
enumerable: true,
|
|
1561
|
-
get: function () { return
|
|
1561
|
+
get: function () { return chunkO67FVVSO_cjs.InngestWorkflow; }
|
|
1562
1562
|
});
|
|
1563
1563
|
Object.defineProperty(exports, "connect", {
|
|
1564
1564
|
enumerable: true,
|
|
1565
|
-
get: function () { return
|
|
1565
|
+
get: function () { return chunkO67FVVSO_cjs.connect; }
|
|
1566
1566
|
});
|
|
1567
1567
|
exports._compatibilityCheck = _compatibilityCheck;
|
|
1568
1568
|
exports.createInngestAgent = createInngestAgent;
|