@mastra/inngest 1.10.4-alpha.0 → 1.10.4-alpha.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/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-CRuqO4qq.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-MsxnBjG8.js";
2
2
  export { connect };
@@ -21,6 +21,7 @@ export declare function createInngestDurableAgenticWorkflow(options: InngestDura
21
21
  agentId: string;
22
22
  agentName?: string | undefined;
23
23
  messageListState: any;
24
+ initialUntaggedSystemMessages?: any[] | undefined;
24
25
  toolsMetadata: any[];
25
26
  modelConfig: {
26
27
  provider: string;
@@ -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":"AAgCA,OAAO,KAAK,EAAe,OAAO,EAAE,MAAM,SAAS,CAAC;AAIpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAyCzD;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAqXhG"}
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-CRuqO4qq.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-MsxnBjG8.js";
2
2
  export { InngestExecutionEngine, InngestPubSub, InngestRun, InngestWorkflow, _compatibilityCheck, connect, createInngestAgent, createInngestDurableAgenticWorkflow, createServe, createStep, init, isInngestAgent, serve };
@@ -17,6 +17,7 @@ let _mastra_core_request_context = require("@mastra/core/request-context");
17
17
  let inngest_hono = require("inngest/hono");
18
18
  let _mastra_core_cache = require("@mastra/core/cache");
19
19
  let _mastra_core_utils = require("@mastra/core/utils");
20
+ let _mastra_core_agent_message_list = require("@mastra/core/agent/message-list");
20
21
  let _mastra_core_workflows__constants = require("@mastra/core/workflows/_constants");
21
22
  let zod = require("zod");
22
23
  //#region src/nested-workflow-output.ts
@@ -1949,30 +1950,34 @@ var InngestWorkflow = class extends _mastra_core_workflows.Workflow {
1949
1950
  workflowName: this.id,
1950
1951
  runId
1951
1952
  }) ?? void 0;
1953
+ const finalSnapshot = {
1954
+ runId,
1955
+ status: result.status,
1956
+ value: result.state ?? initialState ?? {},
1957
+ context: toSnapshotContext(result.steps),
1958
+ activePaths: [],
1959
+ activeStepsPath: {},
1960
+ serializedStepGraph: this.serializedStepGraph,
1961
+ suspendedPaths: existingSnapshot?.suspendedPaths ?? {},
1962
+ waitingPaths: {},
1963
+ resumeLabels: existingSnapshot?.resumeLabels ?? result.resumeLabels ?? {},
1964
+ result: result.status === "success" ? toSnapshotResult(result.result) : void 0,
1965
+ error: result.status === "failed" ? result.error : void 0,
1966
+ requestContext: requestContext.toJSON(),
1967
+ tracingContext: workflowSpanData ? {
1968
+ traceId: workflowSpanData.traceId,
1969
+ spanId: workflowSpanData.id
1970
+ } : void 0,
1971
+ timestamp: Date.now()
1972
+ };
1952
1973
  await workflowsStore.persistWorkflowSnapshot({
1953
1974
  workflowName: this.id,
1954
1975
  runId,
1955
1976
  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
- }
1977
+ snapshot: this.options.pruneSnapshot ? this.options.pruneSnapshot({
1978
+ snapshot: finalSnapshot,
1979
+ workflowStatus: result.status
1980
+ }) : finalSnapshot
1976
1981
  });
1977
1982
  }
1978
1983
  }
@@ -2069,6 +2074,7 @@ const durableAgenticInputSchema = zod.z.object({
2069
2074
  agentId: zod.z.string(),
2070
2075
  agentName: zod.z.string().optional(),
2071
2076
  messageListState: zod.z.any(),
2077
+ initialUntaggedSystemMessages: zod.z.array(zod.z.any()).optional(),
2072
2078
  toolsMetadata: zod.z.array(zod.z.any()),
2073
2079
  modelConfig: _mastra_core_agent_durable.modelConfigSchema,
2074
2080
  options: zod.z.any(),
@@ -2126,6 +2132,7 @@ function createInngestDurableAgenticWorkflow(options) {
2126
2132
  options: {
2127
2133
  tracingPolicy: { internal: _mastra_core_observability.InternalSpans.WORKFLOW },
2128
2134
  shouldPersistSnapshot: ({ workflowStatus }) => PERSISTED_SNAPSHOT_STATUSES.has(workflowStatus),
2135
+ pruneSnapshot: _mastra_core_agent_durable.pruneAgentLoopSnapshot,
2129
2136
  evaluatePersistencePredicateBeforeDurableOperation: true,
2130
2137
  validateInputs: false,
2131
2138
  emitStepEvents: false
@@ -2138,6 +2145,7 @@ function createInngestDurableAgenticWorkflow(options) {
2138
2145
  agentId: state.agentId,
2139
2146
  agentName: state.agentName,
2140
2147
  messageListState: state.messageListState,
2148
+ initialUntaggedSystemMessages: state.initialUntaggedSystemMessages,
2141
2149
  toolsMetadata: state.toolsMetadata,
2142
2150
  modelConfig: state.modelConfig,
2143
2151
  options: state.options,
@@ -2195,6 +2203,7 @@ function createInngestDurableAgenticWorkflow(options) {
2195
2203
  options: {
2196
2204
  tracingPolicy: { internal: _mastra_core_observability.InternalSpans.WORKFLOW },
2197
2205
  shouldPersistSnapshot: ({ workflowStatus }) => PERSISTED_SNAPSHOT_STATUSES.has(workflowStatus),
2206
+ pruneSnapshot: _mastra_core_agent_durable.pruneAgentLoopSnapshot,
2198
2207
  evaluatePersistencePredicateBeforeDurableOperation: true,
2199
2208
  validateInputs: false,
2200
2209
  emitStepEvents: false
@@ -2202,10 +2211,12 @@ function createInngestDurableAgenticWorkflow(options) {
2202
2211
  steps: []
2203
2212
  }).map(async ({ inputData }) => {
2204
2213
  const input = inputData;
2214
+ const initialMessageList = new _mastra_core_agent_message_list.MessageList().deserialize(input.messageListState);
2205
2215
  const agentSpanData = input.agentSpanData;
2206
2216
  const modelSpanData = input.modelSpanData;
2207
2217
  return {
2208
2218
  ...input,
2219
+ initialUntaggedSystemMessages: initialMessageList.getSystemMessages(),
2209
2220
  iterationCount: 0,
2210
2221
  accumulatedSteps: [],
2211
2222
  accumulatedUsage: {
@@ -3905,4 +3916,4 @@ Object.defineProperty(exports, "serve", {
3905
3916
  }
3906
3917
  });
3907
3918
 
3908
- //# sourceMappingURL=src-eRQ6u6Yi.cjs.map
3919
+ //# sourceMappingURL=src-CRuqO4qq.cjs.map