@mastra/inngest 1.11.3-alpha.1 → 1.11.4-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/connect.cjs +1 -1
- package/dist/connect.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/observability-compat.d.ts +6 -1
- package/dist/observability-compat.d.ts.map +1 -1
- package/dist/{src-5A0aFcD7.cjs → src-BrTLEx4Z.cjs} +25 -11
- package/dist/src-BrTLEx4Z.cjs.map +1 -0
- package/dist/{src-CFtk0_CD.js → src-hK_U-MJ5.js} +26 -12
- package/dist/src-hK_U-MJ5.js.map +1 -0
- package/dist/workflow.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/src-5A0aFcD7.cjs.map +0 -1
- package/dist/src-CFtk0_CD.js.map +0 -1
package/dist/connect.cjs
CHANGED
package/dist/connect.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { i as connect } from "./src-
|
|
1
|
+
export { i as connect } from "./src-hK_U-MJ5.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_src = require("./src-
|
|
2
|
+
const require_src = require("./src-BrTLEx4Z.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 +1 @@
|
|
|
1
|
-
export { m as InngestExecutionEngine, f as InngestPubSub, d as InngestRun, u as InngestWorkflow, p as OVERSIZED_EVENT_CHUNK_TYPE, r as _compatibilityCheck, i as connect, s as createInngestAgent, l as createInngestDurableAgenticWorkflow, a as createServe, t as createStep, n as init, c as isInngestAgent, o as serve } from "./src-
|
|
1
|
+
export { m as InngestExecutionEngine, f as InngestPubSub, d as InngestRun, u as InngestWorkflow, p as OVERSIZED_EVENT_CHUNK_TYPE, r as _compatibilityCheck, i as connect, s as createInngestAgent, l as createInngestDurableAgenticWorkflow, a as createServe, t as createStep, n as init, c as isInngestAgent, o as serve } from "./src-hK_U-MJ5.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as coreDurable from '@mastra/core/agent/durable';
|
|
2
2
|
import * as coreObservability from '@mastra/core/observability';
|
|
3
|
-
import type { SpanOutcomeFields } from '@mastra/core/observability';
|
|
3
|
+
import type { ResumeTracingContext, SpanOutcomeFields } from '@mastra/core/observability';
|
|
4
4
|
import type { LanguageModelUsage } from '@mastra/core/stream';
|
|
5
5
|
import * as coreWorkflows from '@mastra/core/workflows';
|
|
6
6
|
/** Older core keeps its existing tracing behavior without requiring new named exports. */
|
|
@@ -16,4 +16,9 @@ export declare function generationUsage(usage: LanguageModelUsage, steps: Array<
|
|
|
16
16
|
usageIncomplete: boolean;
|
|
17
17
|
usage: LanguageModelUsage;
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* The context a suspending workflow run saves for its resume. A core without the helper saves the
|
|
21
|
+
* lineage alone, and its resume samples again.
|
|
22
|
+
*/
|
|
23
|
+
export declare function workflowResumeTracingContext(span: Parameters<typeof coreObservability.getWorkflowResumeTracingContext>[0]): ResumeTracingContext | undefined;
|
|
19
24
|
//# sourceMappingURL=observability-compat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observability-compat.d.ts","sourceRoot":"","sources":["../src/observability-compat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,4BAA4B,CAAC;AAE1D,OAAO,KAAK,iBAAiB,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"observability-compat.d.ts","sourceRoot":"","sources":["../src/observability-compat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,4BAA4B,CAAC;AAE1D,OAAO,KAAK,iBAAiB,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,aAAa,MAAM,wBAAwB,CAAC;AAExD,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,mBAAmB,CAAC,GAAG,iBAAiB,CAEpH;AAED,wBAAgB,oBAAoB,CAClC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,oBAAoB,CAAC,GACjE,iBAAiB,CAEnB;AAED,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAEvG;AAED,wBAAgB,2BAA2B,CACzC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,2BAA2B,CAAC,GACxE,iBAAiB,CAEnB;AAED,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,CAAC;IAAE,KAAK,CAAC,EAAE,kBAAkB,CAAA;CAAE,CAAC;;;EAMtG;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,GAC5E,oBAAoB,GAAG,SAAS,CAGlC"}
|
|
@@ -175,6 +175,14 @@ function generationUsage(usage, steps) {
|
|
|
175
175
|
usage: usageIncomplete ? _mastra_core_observability.calculateObservedUsage?.(steps) ?? usage : usage
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* The context a suspending workflow run saves for its resume. A core without the helper saves the
|
|
180
|
+
* lineage alone, and its resume samples again.
|
|
181
|
+
*/
|
|
182
|
+
function workflowResumeTracingContext(span) {
|
|
183
|
+
if (_mastra_core_features.coreFeatures.has("workflow-resume-sampling")) return _mastra_core_observability.getWorkflowResumeTracingContext?.(span);
|
|
184
|
+
return _mastra_core_observability.getResumeTracingContext(span);
|
|
185
|
+
}
|
|
178
186
|
// src/execution-engine.ts
|
|
179
187
|
function isNonRetryableStepFailure(error) {
|
|
180
188
|
if (error instanceof _mastra_core_error.MastraNonRetryableError || error instanceof inngest.NonRetriableError) return true;
|
|
@@ -2185,23 +2193,32 @@ var InngestWorkflow = class extends _mastra_core_workflows.Workflow {
|
|
|
2185
2193
|
const mastra = this.#mastra;
|
|
2186
2194
|
const tracingPolicy = this.options.tracingPolicy;
|
|
2187
2195
|
const workflowSpanData = await step.run(`workflow.${this.id}.span.start`, async () => {
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2196
|
+
if (!mastra?.observability?.getSelectedInstance({ requestContext })) return void 0;
|
|
2197
|
+
const suspendedTracingContext = resume ? (await (await mastra.getStorage()?.getStore("workflows"))?.loadWorkflowSnapshot({
|
|
2198
|
+
workflowName: this.id,
|
|
2199
|
+
runId
|
|
2200
|
+
}))?.tracingContext : void 0;
|
|
2201
|
+
const span = (0, _mastra_core_observability.getOrCreateSpan)({
|
|
2191
2202
|
type: _mastra_core_observability.SpanType.WORKFLOW_RUN,
|
|
2192
2203
|
outcome: null,
|
|
2193
|
-
name: `workflow run: '${this.id}'`,
|
|
2204
|
+
name: resume ? `workflow run: '${this.id}' (resumed)` : `workflow run: '${this.id}'`,
|
|
2194
2205
|
entityType: _mastra_core_observability.EntityType.WORKFLOW_RUN,
|
|
2195
2206
|
entityId: this.id,
|
|
2196
2207
|
entityName: this.id,
|
|
2197
2208
|
input: inputData,
|
|
2198
2209
|
metadata: {
|
|
2199
2210
|
resourceId,
|
|
2200
|
-
runId
|
|
2211
|
+
runId,
|
|
2212
|
+
...resume ? {
|
|
2213
|
+
resumed: true,
|
|
2214
|
+
resumedFromSpanId: suspendedTracingContext?.spanId
|
|
2215
|
+
} : {}
|
|
2201
2216
|
},
|
|
2202
2217
|
tracingPolicy,
|
|
2203
2218
|
tracingOptions,
|
|
2204
|
-
requestContext
|
|
2219
|
+
requestContext,
|
|
2220
|
+
resumeFrom: suspendedTracingContext,
|
|
2221
|
+
mastra
|
|
2205
2222
|
});
|
|
2206
2223
|
return span?.snapshot?.() ?? span?.exportSpan();
|
|
2207
2224
|
});
|
|
@@ -2335,10 +2352,7 @@ var InngestWorkflow = class extends _mastra_core_workflows.Workflow {
|
|
|
2335
2352
|
result: result.status === "success" ? toSnapshotResult(result.result) : void 0,
|
|
2336
2353
|
error: result.status === "failed" ? result.error : void 0,
|
|
2337
2354
|
requestContext: requestContext.toJSON(),
|
|
2338
|
-
tracingContext: workflowSpanData
|
|
2339
|
-
traceId: workflowSpanData.traceId,
|
|
2340
|
-
spanId: workflowSpanData.id
|
|
2341
|
-
} : void 0,
|
|
2355
|
+
tracingContext: workflowResumeTracingContext(workflowSpanData),
|
|
2342
2356
|
timestamp: Date.now()
|
|
2343
2357
|
};
|
|
2344
2358
|
await workflowsStore.persistWorkflowSnapshot({
|
|
@@ -5290,4 +5304,4 @@ Object.defineProperty(exports, "serve", {
|
|
|
5290
5304
|
}
|
|
5291
5305
|
});
|
|
5292
5306
|
|
|
5293
|
-
//# sourceMappingURL=src-
|
|
5307
|
+
//# sourceMappingURL=src-BrTLEx4Z.cjs.map
|