@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/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkYACLO5I5_cjs = require('./chunk-YACLO5I5.cjs');
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: chunkYACLO5I5_cjs.collectInngestFunctions({ mastra, functions: userFunctions })
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 chunkYACLO5I5_cjs.InngestPubSub(inngest, InngestDurableStepIds.AGENTIC_LOOP);
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 (error) => {
482
+ onError: async (errorArg) => {
483
483
  try {
484
- await streamOptions?.onError?.(error);
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 (error) => {
607
+ onError: async (errorArg) => {
608
608
  try {
609
- await resumeOptions?.onError?.(error);
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 chunkYACLO5I5_cjs.InngestWorkflow;
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 chunkYACLO5I5_cjs.InngestWorkflow);
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 chunkYACLO5I5_cjs.InngestWorkflow) && (typeof obj.processInput === "function" || typeof obj.processInputStep === "function" || typeof obj.processOutputStream === "function" || typeof obj.processOutputResult === "function" || typeof obj.processOutputStep === "function");
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 chunkYACLO5I5_cjs.InngestWorkflow(
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 chunkYACLO5I5_cjs.InngestExecutionEngine; }
1549
+ get: function () { return chunkO67FVVSO_cjs.InngestExecutionEngine; }
1550
1550
  });
1551
1551
  Object.defineProperty(exports, "InngestPubSub", {
1552
1552
  enumerable: true,
1553
- get: function () { return chunkYACLO5I5_cjs.InngestPubSub; }
1553
+ get: function () { return chunkO67FVVSO_cjs.InngestPubSub; }
1554
1554
  });
1555
1555
  Object.defineProperty(exports, "InngestRun", {
1556
1556
  enumerable: true,
1557
- get: function () { return chunkYACLO5I5_cjs.InngestRun; }
1557
+ get: function () { return chunkO67FVVSO_cjs.InngestRun; }
1558
1558
  });
1559
1559
  Object.defineProperty(exports, "InngestWorkflow", {
1560
1560
  enumerable: true,
1561
- get: function () { return chunkYACLO5I5_cjs.InngestWorkflow; }
1561
+ get: function () { return chunkO67FVVSO_cjs.InngestWorkflow; }
1562
1562
  });
1563
1563
  Object.defineProperty(exports, "connect", {
1564
1564
  enumerable: true,
1565
- get: function () { return chunkYACLO5I5_cjs.connect; }
1565
+ get: function () { return chunkO67FVVSO_cjs.connect; }
1566
1566
  });
1567
1567
  exports._compatibilityCheck = _compatibilityCheck;
1568
1568
  exports.createInngestAgent = createInngestAgent;