@mastra/inngest 1.10.4-alpha.0 → 1.10.4-alpha.1

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 CHANGED
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_src = require("./src-eRQ6u6Yi.cjs");
2
+ const require_src = require("./src-CGrVAs0_.cjs");
3
3
  exports.connect = require_src.connect;
package/dist/connect.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as connect } from "./src-BadexCXD.js";
1
+ import { i as connect } from "./src-CoboLrh1.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":"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"}
1
+ {"version":3,"file":"create-inngest-agentic-workflow.d.ts","sourceRoot":"","sources":["../../src/durable-agent/create-inngest-agentic-workflow.ts"],"names":[],"mappings":"AA+BA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAkXhG"}
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_src = require("./src-eRQ6u6Yi.cjs");
2
+ const require_src = require("./src-CGrVAs0_.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-BadexCXD.js";
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-CoboLrh1.js";
2
2
  export { InngestExecutionEngine, InngestPubSub, InngestRun, InngestWorkflow, _compatibilityCheck, connect, createInngestAgent, createInngestDurableAgenticWorkflow, createServe, createStep, init, isInngestAgent, serve };
@@ -1949,30 +1949,34 @@ var InngestWorkflow = class extends _mastra_core_workflows.Workflow {
1949
1949
  workflowName: this.id,
1950
1950
  runId
1951
1951
  }) ?? void 0;
1952
+ const finalSnapshot = {
1953
+ runId,
1954
+ status: result.status,
1955
+ value: result.state ?? initialState ?? {},
1956
+ context: toSnapshotContext(result.steps),
1957
+ activePaths: [],
1958
+ activeStepsPath: {},
1959
+ serializedStepGraph: this.serializedStepGraph,
1960
+ suspendedPaths: existingSnapshot?.suspendedPaths ?? {},
1961
+ waitingPaths: {},
1962
+ resumeLabels: existingSnapshot?.resumeLabels ?? result.resumeLabels ?? {},
1963
+ result: result.status === "success" ? toSnapshotResult(result.result) : void 0,
1964
+ error: result.status === "failed" ? result.error : void 0,
1965
+ requestContext: requestContext.toJSON(),
1966
+ tracingContext: workflowSpanData ? {
1967
+ traceId: workflowSpanData.traceId,
1968
+ spanId: workflowSpanData.id
1969
+ } : void 0,
1970
+ timestamp: Date.now()
1971
+ };
1952
1972
  await workflowsStore.persistWorkflowSnapshot({
1953
1973
  workflowName: this.id,
1954
1974
  runId,
1955
1975
  resourceId,
1956
- snapshot: {
1957
- runId,
1958
- status: result.status,
1959
- value: result.state ?? initialState ?? {},
1960
- context: toSnapshotContext(result.steps),
1961
- activePaths: [],
1962
- activeStepsPath: {},
1963
- serializedStepGraph: this.serializedStepGraph,
1964
- suspendedPaths: existingSnapshot?.suspendedPaths ?? {},
1965
- waitingPaths: {},
1966
- resumeLabels: existingSnapshot?.resumeLabels ?? result.resumeLabels ?? {},
1967
- result: result.status === "success" ? toSnapshotResult(result.result) : void 0,
1968
- error: result.status === "failed" ? result.error : void 0,
1969
- requestContext: requestContext.toJSON(),
1970
- tracingContext: workflowSpanData ? {
1971
- traceId: workflowSpanData.traceId,
1972
- spanId: workflowSpanData.id
1973
- } : void 0,
1974
- timestamp: Date.now()
1975
- }
1976
+ snapshot: this.options.pruneSnapshot ? this.options.pruneSnapshot({
1977
+ snapshot: finalSnapshot,
1978
+ workflowStatus: result.status
1979
+ }) : finalSnapshot
1976
1980
  });
1977
1981
  }
1978
1982
  }
@@ -2126,6 +2130,7 @@ function createInngestDurableAgenticWorkflow(options) {
2126
2130
  options: {
2127
2131
  tracingPolicy: { internal: _mastra_core_observability.InternalSpans.WORKFLOW },
2128
2132
  shouldPersistSnapshot: ({ workflowStatus }) => PERSISTED_SNAPSHOT_STATUSES.has(workflowStatus),
2133
+ pruneSnapshot: _mastra_core_agent_durable.pruneAgentLoopSnapshot,
2129
2134
  evaluatePersistencePredicateBeforeDurableOperation: true,
2130
2135
  validateInputs: false,
2131
2136
  emitStepEvents: false
@@ -2195,6 +2200,7 @@ function createInngestDurableAgenticWorkflow(options) {
2195
2200
  options: {
2196
2201
  tracingPolicy: { internal: _mastra_core_observability.InternalSpans.WORKFLOW },
2197
2202
  shouldPersistSnapshot: ({ workflowStatus }) => PERSISTED_SNAPSHOT_STATUSES.has(workflowStatus),
2203
+ pruneSnapshot: _mastra_core_agent_durable.pruneAgentLoopSnapshot,
2198
2204
  evaluatePersistencePredicateBeforeDurableOperation: true,
2199
2205
  validateInputs: false,
2200
2206
  emitStepEvents: false
@@ -3905,4 +3911,4 @@ Object.defineProperty(exports, "serve", {
3905
3911
  }
3906
3912
  });
3907
3913
 
3908
- //# sourceMappingURL=src-eRQ6u6Yi.cjs.map
3914
+ //# sourceMappingURL=src-CGrVAs0_.cjs.map