@mastra/inngest 1.10.4-alpha.3 → 1.10.4-alpha.5

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-BLRnWF2r.cjs");
2
+ const require_src = require("./src-CQHBfx-I.cjs");
3
3
  exports.connect = require_src.connect;
package/dist/connect.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as connect } from "./src-Cr0fhIAN.js";
1
+ import { i as connect } from "./src-DnmHlGpc.js";
2
2
  export { connect };
@@ -30,6 +30,18 @@ export declare function createInngestDurableAgenticWorkflow(options: InngestDura
30
30
  settings?: Record<string, any> | undefined;
31
31
  providerOptions?: Record<string, any> | undefined;
32
32
  };
33
+ modelList?: {
34
+ id: string;
35
+ config: {
36
+ provider: string;
37
+ modelId: string;
38
+ specificationVersion?: string | undefined;
39
+ originalConfig?: string | Record<string, any> | undefined;
40
+ providerOptions?: Record<string, any> | undefined;
41
+ };
42
+ maxRetries: number;
43
+ enabled: boolean;
44
+ }[] | undefined;
33
45
  options: any;
34
46
  state: any;
35
47
  messageId: 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":"AAiCA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA6YhG"}
1
+ {"version":3,"file":"create-inngest-agentic-workflow.d.ts","sourceRoot":"","sources":["../../src/durable-agent/create-inngest-agentic-workflow.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAe,OAAO,EAAE,MAAM,SAAS,CAAC;AAIpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AA0CzD;;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;AAyCD,oCAAoC;AACpC,eAAO,MAAM,qBAAqB;aAChC,iBAAiB;aACjB,YAAY;CACJ,CAAC;AAEX,wBAAgB,mCAAmC,CAAC,OAAO,EAAE,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoZhG"}
package/dist/index.cjs CHANGED
@@ -1,9 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_src = require("./src-BLRnWF2r.cjs");
2
+ const require_src = require("./src-CQHBfx-I.cjs");
3
3
  exports.InngestExecutionEngine = require_src.InngestExecutionEngine;
4
4
  exports.InngestPubSub = require_src.InngestPubSub;
5
5
  exports.InngestRun = require_src.InngestRun;
6
6
  exports.InngestWorkflow = require_src.InngestWorkflow;
7
+ exports.OVERSIZED_EVENT_CHUNK_TYPE = require_src.OVERSIZED_EVENT_CHUNK_TYPE;
7
8
  exports._compatibilityCheck = require_src._compatibilityCheck;
8
9
  exports.connect = require_src.connect;
9
10
  exports.createInngestAgent = require_src.createInngestAgent;
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-Cr0fhIAN.js";
2
- export { InngestExecutionEngine, InngestPubSub, InngestRun, InngestWorkflow, _compatibilityCheck, connect, createInngestAgent, createInngestDurableAgenticWorkflow, createServe, createStep, init, isInngestAgent, serve };
1
+ import { a as createServe, c as isInngestAgent, d as InngestRun, f as InngestPubSub, i as connect, l as createInngestDurableAgenticWorkflow, m as InngestExecutionEngine, n as init, o as serve, p as OVERSIZED_EVENT_CHUNK_TYPE, r as _compatibilityCheck, s as createInngestAgent, t as createStep, u as InngestWorkflow } from "./src-DnmHlGpc.js";
2
+ export { InngestExecutionEngine, InngestPubSub, InngestRun, InngestWorkflow, OVERSIZED_EVENT_CHUNK_TYPE, _compatibilityCheck, connect, createInngestAgent, createInngestDurableAgenticWorkflow, createServe, createStep, init, isInngestAgent, serve };
package/dist/pubsub.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import { PubSub } from '@mastra/core/events';
2
2
  import type { Event } from '@mastra/core/events';
3
+ import type { IMastraLogger } from '@mastra/core/logger';
3
4
  import type { Inngest } from 'inngest';
5
+ /** Chunk type streamed in place of an agent event that exceeded the Realtime cap. */
6
+ export declare const OVERSIZED_EVENT_CHUNK_TYPE = "data-oversized-event";
4
7
  /**
5
8
  * PubSub implementation for Inngest workflows.
6
9
  *
@@ -21,8 +24,9 @@ import type { Inngest } from 'inngest';
21
24
  export declare class InngestPubSub extends PubSub {
22
25
  private inngest;
23
26
  private workflowId;
27
+ private logger?;
24
28
  private subscriptions;
25
- constructor(inngest: Inngest, workflowId: string);
29
+ constructor(inngest: Inngest, workflowId: string, logger?: IMastraLogger);
26
30
  publishWorkflowWatchTo(workflowId: string, runId: string, data: unknown): Promise<void>;
27
31
  /**
28
32
  * Publish an event to Inngest's realtime system.
@@ -1 +1 @@
1
- {"version":3,"file":"pubsub.d.ts","sourceRoot":"","sources":["../src/pubsub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AA0DvC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,MAAM;IACvC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAMP;IAEd,YAAY,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAI/C;IAEK,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5F;IAED;;;;;;;;;;;OAWG;IACG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAoClF;IAED;;;;;;;;;;;OAWG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAwEnG;IAED;;;OAGG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAarG;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAK3B;CACF"}
1
+ {"version":3,"file":"pubsub.d.ts","sourceRoot":"","sources":["../src/pubsub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAgFvC,qFAAqF;AACrF,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AAkGjE;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,aAAc,SAAQ,MAAM;IACvC,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,MAAM,CAAC,CAAgB;IAC/B,OAAO,CAAC,aAAa,CAMP;IAEd,YAAY,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,aAAa,EAKvE;IAEK,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5F;IAED;;;;;;;;;;;OAWG;IACG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA6ClF;IAED;;;;;;;;;;;OAWG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA2EnG;IAED;;;OAGG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAarG;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAK3B;CACF"}
@@ -722,6 +722,140 @@ function warnUnrecognizedTopic(topic) {
722
722
  console.warn(`InngestPubSub: ignoring unrecognized topic format "${topic}"`);
723
723
  }
724
724
  /**
725
+ * Inngest Realtime delivers messages over ~512 KB truncated, as an unparseable
726
+ * string (#20671). Stay safely under that cap.
727
+ */
728
+ const REALTIME_MAX_BYTES = 480 * 1024;
729
+ const TERMINAL_AGENT_EVENTS = /* @__PURE__ */ new Set([
730
+ "finish",
731
+ "error",
732
+ "abort"
733
+ ]);
734
+ const OVERSIZED_ERROR_MESSAGE = "Agent error event exceeded the Inngest Realtime size limit";
735
+ /** Stream consumers read `data.error.name` and `data.error.message`; keep those, shortened to fit. */
736
+ function fitErrorEvent(event) {
737
+ const error = event.data?.error;
738
+ const name = typeof error?.name === "string" ? error.name.slice(0, 200) : "Error";
739
+ const message = typeof error?.message === "string" ? error.message : OVERSIZED_ERROR_MESSAGE;
740
+ const reduced = {
741
+ type: event.type,
742
+ runId: event.runId,
743
+ data: { error: {
744
+ name,
745
+ message
746
+ } }
747
+ };
748
+ const excess = byteSize(reduced) - REALTIME_MAX_BYTES;
749
+ if (excess > 0) reduced.data.error.message = message.slice(0, Math.max(0, message.length - excess - 64)) + "… [truncated]";
750
+ return byteSize(reduced) <= REALTIME_MAX_BYTES ? reduced : {
751
+ ...reduced,
752
+ data: { error: {
753
+ name,
754
+ message: OVERSIZED_ERROR_MESSAGE
755
+ } }
756
+ };
757
+ }
758
+ /** Chunk type streamed in place of an agent event that exceeded the Realtime cap. */
759
+ const OVERSIZED_EVENT_CHUNK_TYPE = "data-oversized-event";
760
+ function oversizedPlaceholder(runId, eventType, chunkType, bytes) {
761
+ return {
762
+ type: "chunk",
763
+ runId,
764
+ data: {
765
+ type: OVERSIZED_EVENT_CHUNK_TYPE,
766
+ transient: true,
767
+ data: {
768
+ eventType,
769
+ chunkType,
770
+ bytes,
771
+ limit: REALTIME_MAX_BYTES
772
+ }
773
+ }
774
+ };
775
+ }
776
+ function byteSize(value) {
777
+ try {
778
+ return Buffer.byteLength(JSON.stringify(value) ?? "", "utf8");
779
+ } catch {
780
+ return 0;
781
+ }
782
+ }
783
+ /**
784
+ * Reduce an agent event that would exceed the Realtime cap. `finish` keeps the
785
+ * fields stream consumers read (text, usage, stepResult) and drops the
786
+ * per-step record; other oversized events are replaced by a small
787
+ * `data-oversized-event` chunk rather than delivered truncated.
788
+ */
789
+ function fitAgentEvent(event) {
790
+ const bytes = byteSize(event);
791
+ if (bytes <= REALTIME_MAX_BYTES) return event;
792
+ if (event.type !== "finish") {
793
+ if (event.type === "error") return fitErrorEvent(event);
794
+ if (TERMINAL_AGENT_EVENTS.has(event.type)) return {
795
+ type: event.type,
796
+ runId: event.runId,
797
+ data: {}
798
+ };
799
+ return oversizedPlaceholder(event.runId, event.type, event.data?.type, bytes);
800
+ }
801
+ const data = event.data ?? {};
802
+ const output = data.output ?? {};
803
+ const reduced = {
804
+ ...event,
805
+ data: {
806
+ stepResult: data.stepResult,
807
+ output: {
808
+ text: output.text,
809
+ usage: output.usage,
810
+ steps: []
811
+ }
812
+ }
813
+ };
814
+ if (byteSize(reduced) <= REALTIME_MAX_BYTES) return reduced;
815
+ const reason = data.stepResult?.reason;
816
+ const fallback = {
817
+ ...event,
818
+ data: {
819
+ stepResult: typeof reason === "string" ? { reason } : void 0,
820
+ output: { steps: [] }
821
+ }
822
+ };
823
+ for (const key of ["text", "usage"]) {
824
+ if (output[key] === void 0) continue;
825
+ fallback.data.output[key] = output[key];
826
+ if (byteSize(fallback) > REALTIME_MAX_BYTES) delete fallback.data.output[key];
827
+ }
828
+ return fallback;
829
+ }
830
+ /**
831
+ * Recover an agent event Realtime truncated into a raw string. Terminal events are
832
+ * salvaged into a minimal envelope so attached streams close; anything else becomes
833
+ * a `data-oversized-event` placeholder chunk.
834
+ */
835
+ function salvageTruncatedAgentEvent(raw, runId) {
836
+ try {
837
+ const parsed = JSON.parse(raw);
838
+ if (parsed?.type && parsed?.runId) return parsed;
839
+ } catch {}
840
+ const type = raw.slice(0, 256).match(/"type"\s*:\s*"([^"]+)"/)?.[1];
841
+ if (!type || !TERMINAL_AGENT_EVENTS.has(type)) {
842
+ const chunkType = raw.match(/"data"\s*:\s*\{\s*"type"\s*:\s*"([^"]+)"/)?.[1];
843
+ return oversizedPlaceholder(runId, type ?? "unknown", chunkType, void 0);
844
+ }
845
+ const reason = raw.match(/"stepResult"\s*:\s*\{[^{}]*"reason"\s*:\s*"([^"]+)"/)?.[1];
846
+ return {
847
+ type,
848
+ runId,
849
+ data: type === "finish" ? {
850
+ output: { steps: [] },
851
+ stepResult: reason ? { reason } : void 0
852
+ } : type === "error" ? { error: {
853
+ name: "Error",
854
+ message: OVERSIZED_ERROR_MESSAGE
855
+ } } : {}
856
+ };
857
+ }
858
+ /**
725
859
  * PubSub implementation for Inngest workflows.
726
860
  *
727
861
  * This bridges the PubSub abstract class interface with Inngest's realtime system:
@@ -741,11 +875,13 @@ function warnUnrecognizedTopic(topic) {
741
875
  var InngestPubSub = class extends _mastra_core_events.PubSub {
742
876
  inngest;
743
877
  workflowId;
878
+ logger;
744
879
  subscriptions = /* @__PURE__ */ new Map();
745
- constructor(inngest, workflowId) {
880
+ constructor(inngest, workflowId, logger) {
746
881
  super();
747
882
  this.inngest = inngest;
748
883
  this.workflowId = workflowId;
884
+ this.logger = logger;
749
885
  }
750
886
  async publishWorkflowWatchTo(workflowId, runId, data) {
751
887
  await this.inngest.realtime.publish(buildTopicRef(`workflow:${workflowId}:${runId}`, "watch"), data);
@@ -773,7 +909,16 @@ var InngestPubSub = class extends _mastra_core_events.PubSub {
773
909
  const inngestTopic = isAgentTopic ? topicType : "watch";
774
910
  const channel = isAgentTopic ? `agent:${runId}` : `workflow:${this.workflowId}:${runId}`;
775
911
  try {
776
- const dataToSend = isAgentTopic ? event : event.data;
912
+ let dataToSend = event.data;
913
+ if (isAgentTopic) {
914
+ const fitted = fitAgentEvent(event);
915
+ if (fitted !== event) {
916
+ const message = `InngestPubSub: "${event.type}" event for run ${runId} exceeds the Inngest Realtime size limit (${REALTIME_MAX_BYTES} bytes); sending a reduced event instead`;
917
+ if (this.logger) this.logger.warn(message);
918
+ else console.warn(message);
919
+ }
920
+ dataToSend = fitted;
921
+ }
777
922
  await this.inngest.realtime.publish(buildTopicRef(channel, inngestTopic), dataToSend);
778
923
  } catch (err) {
779
924
  if (topicType === "agent-control" || topicType === "agent-stream" && (event.type === "finish" || event.type === "error")) throw err;
@@ -812,7 +957,14 @@ var InngestPubSub = class extends _mastra_core_events.PubSub {
812
957
  app: this.inngest,
813
958
  onMessage: (message) => {
814
959
  let event;
815
- if (isAgentTopic && message.data?.type && message.data?.runId) event = {
960
+ if (isAgentTopic && typeof message.data === "string") {
961
+ const salvaged = salvageTruncatedAgentEvent(message.data, runId);
962
+ event = {
963
+ id: crypto.randomUUID(),
964
+ createdAt: /* @__PURE__ */ new Date(),
965
+ ...salvaged
966
+ };
967
+ } else if (isAgentTopic && message.data?.type && message.data?.runId) event = {
816
968
  id: crypto.randomUUID(),
817
969
  createdAt: /* @__PURE__ */ new Date(),
818
970
  ...message.data
@@ -1819,7 +1971,7 @@ var InngestWorkflow = class extends _mastra_core_workflows.Workflow {
1819
1971
  stepResults: snapshot.context
1820
1972
  };
1821
1973
  }
1822
- const defaultPubsub = new InngestPubSub(this.inngest, this.id);
1974
+ const defaultPubsub = new InngestPubSub(this.inngest, this.id, this.logger);
1823
1975
  const pubsub = new WorkflowEventPolicyPubSub(this.#pubsubFactory?.(defaultPubsub) ?? defaultPubsub, this.#emitWorkflowEvents);
1824
1976
  const requestContext = new _mastra_core_di.RequestContext(Object.entries(event.data.requestContext ?? {}));
1825
1977
  const mastra = this.#mastra;
@@ -2122,6 +2274,7 @@ const durableAgenticInputSchema = zod.z.object({
2122
2274
  initialUntaggedSystemMessages: zod.z.array(zod.z.any()).optional(),
2123
2275
  toolsMetadata: zod.z.array(zod.z.any()),
2124
2276
  modelConfig: _mastra_core_agent_durable.modelConfigSchema,
2277
+ modelList: zod.z.array(_mastra_core_agent_durable.modelListEntrySchema).optional(),
2125
2278
  options: zod.z.any(),
2126
2279
  state: zod.z.any(),
2127
2280
  messageId: zod.z.string(),
@@ -2134,6 +2287,7 @@ const durableAgenticInputSchema = zod.z.object({
2134
2287
  * Iteration state schema - extends base with observability fields.
2135
2288
  */
2136
2289
  const iterationStateSchema = _mastra_core_agent_durable.baseIterationStateSchema.extend({
2290
+ modelList: zod.z.array(_mastra_core_agent_durable.modelListEntrySchema).optional(),
2137
2291
  agentSpanData: zod.z.any().optional(),
2138
2292
  modelSpanData: zod.z.any().optional(),
2139
2293
  stepIndex: zod.z.number()
@@ -2193,6 +2347,7 @@ function createInngestDurableAgenticWorkflow(options) {
2193
2347
  initialUntaggedSystemMessages: state.initialUntaggedSystemMessages,
2194
2348
  toolsMetadata: state.toolsMetadata,
2195
2349
  modelConfig: state.modelConfig,
2350
+ modelList: state.modelList,
2196
2351
  options: state.options,
2197
2352
  state: state.state,
2198
2353
  messageId: state.messageId,
@@ -2235,6 +2390,7 @@ function createInngestDurableAgenticWorkflow(options) {
2235
2390
  currentState: initData,
2236
2391
  executionOutput
2237
2392
  }),
2393
+ modelList: initData.modelList,
2238
2394
  agentSpanData: initData.agentSpanData,
2239
2395
  modelSpanData: initData.modelSpanData,
2240
2396
  stepIndex: initData.stepIndex + 1
@@ -2345,6 +2501,10 @@ function createInngestDurableAgenticWorkflow(options) {
2345
2501
  from: _mastra_core_stream.ChunkFrom.AGENT,
2346
2502
  payload: tripwire
2347
2503
  });
2504
+ if (pubsub && !tripwire) for (const chunk of finishResult.structuredOutputChunks ?? []) await (0, _mastra_core_agent_durable.emitChunkEvent)(pubsub, state.runId, {
2505
+ ...chunk,
2506
+ runId: state.runId
2507
+ });
2348
2508
  const finalOutput = {
2349
2509
  messageListState: finishResult.messageListState,
2350
2510
  messageId: state.messageId,
@@ -3955,6 +4115,12 @@ Object.defineProperty(exports, "InngestWorkflow", {
3955
4115
  return InngestWorkflow;
3956
4116
  }
3957
4117
  });
4118
+ Object.defineProperty(exports, "OVERSIZED_EVENT_CHUNK_TYPE", {
4119
+ enumerable: true,
4120
+ get: function() {
4121
+ return OVERSIZED_EVENT_CHUNK_TYPE;
4122
+ }
4123
+ });
3958
4124
  Object.defineProperty(exports, "_compatibilityCheck", {
3959
4125
  enumerable: true,
3960
4126
  get: function() {
@@ -4010,4 +4176,4 @@ Object.defineProperty(exports, "serve", {
4010
4176
  }
4011
4177
  });
4012
4178
 
4013
- //# sourceMappingURL=src-BLRnWF2r.cjs.map
4179
+ //# sourceMappingURL=src-CQHBfx-I.cjs.map