@mastra/core 0.9.1 → 0.9.2-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/agent/index.cjs +2 -2
- package/dist/agent/index.d.cts +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/{base-QJ_GwQxQ.d.cts → base-DI6ChaUK.d.cts} +35 -1
- package/dist/{base-BS0LLAna.d.ts → base-bWFiU8RL.d.ts} +35 -1
- package/dist/{chunk-7PRLYMXV.cjs → chunk-3BKYXIDL.cjs} +3 -0
- package/dist/{chunk-FA7FWCKH.js → chunk-GKTDO6XW.js} +1 -1
- package/dist/{chunk-ZWALP7T2.cjs → chunk-UPEXV5RA.cjs} +2 -2
- package/dist/{chunk-H2UWWO4L.js → chunk-UQ2VDYKC.js} +3 -0
- package/dist/eval/index.d.cts +1 -1
- package/dist/eval/index.d.ts +1 -1
- package/dist/index.cjs +27 -27
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/integration/index.d.cts +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/llm/index.d.cts +1 -1
- package/dist/llm/index.d.ts +1 -1
- package/dist/mastra/index.d.cts +1 -1
- package/dist/mastra/index.d.ts +1 -1
- package/dist/memory/index.d.cts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/network/index.cjs +2 -2
- package/dist/network/index.d.cts +1 -1
- package/dist/network/index.d.ts +1 -1
- package/dist/network/index.js +1 -1
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.d.cts +1 -1
- package/dist/relevance/index.d.ts +1 -1
- package/dist/relevance/index.js +1 -1
- package/dist/server/index.d.cts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/storage/index.d.cts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/libsql/index.d.cts +1 -1
- package/dist/storage/libsql/index.d.ts +1 -1
- package/dist/telemetry/index.d.cts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/tools/index.d.cts +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/voice/index.d.cts +1 -1
- package/dist/voice/index.d.ts +1 -1
- package/dist/workflows/index.cjs +22 -22
- package/dist/workflows/index.d.cts +2 -2
- package/dist/workflows/index.d.ts +2 -2
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/vNext/index.cjs +82 -2
- package/dist/workflows/vNext/index.d.cts +2 -2
- package/dist/workflows/vNext/index.d.ts +2 -2
- package/dist/workflows/vNext/index.js +81 -1
- package/package.json +1 -1
package/dist/relevance/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-
|
|
1
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-GKTDO6XW.js';
|
package/dist/server/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Handler, MiddlewareHandler } from 'hono';
|
|
2
2
|
import { DescribeRouteOptions } from 'hono-openapi';
|
|
3
|
-
import { M as Methods, a as Mastra, A as ApiRoute } from '../base-
|
|
3
|
+
import { M as Methods, a as Mastra, A as ApiRoute } from '../base-DI6ChaUK.cjs';
|
|
4
4
|
import 'ai';
|
|
5
5
|
import '../base-BihKcqDY.cjs';
|
|
6
6
|
import '@opentelemetry/api';
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Handler, MiddlewareHandler } from 'hono';
|
|
2
2
|
import { DescribeRouteOptions } from 'hono-openapi';
|
|
3
|
-
import { M as Methods, a as Mastra, A as ApiRoute } from '../base-
|
|
3
|
+
import { M as Methods, a as Mastra, A as ApiRoute } from '../base-bWFiU8RL.js';
|
|
4
4
|
import 'ai';
|
|
5
5
|
import '../base-DT2poiVK.js';
|
|
6
6
|
import '@opentelemetry/api';
|
package/dist/storage/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { E as EvalRow, b as MastraStorage, S as StorageColumn, e as StorageGetMessagesArg,
|
|
1
|
+
export { E as EvalRow, b as MastraStorage, S as StorageColumn, e as StorageGetMessagesArg, bg as TABLE_EVALS, bh as TABLE_MESSAGES, T as TABLE_NAMES, bk as TABLE_SCHEMAS, bi as TABLE_THREADS, bj as TABLE_TRACES, bf as TABLE_WORKFLOW_SNAPSHOT, f as WorkflowRun, W as WorkflowRuns } from '../base-DI6ChaUK.cjs';
|
|
2
2
|
import 'ai';
|
|
3
3
|
import '../base-BihKcqDY.cjs';
|
|
4
4
|
import '@opentelemetry/api';
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { E as EvalRow, b as MastraStorage, S as StorageColumn, e as StorageGetMessagesArg,
|
|
1
|
+
export { E as EvalRow, b as MastraStorage, S as StorageColumn, e as StorageGetMessagesArg, bg as TABLE_EVALS, bh as TABLE_MESSAGES, T as TABLE_NAMES, bk as TABLE_SCHEMAS, bi as TABLE_THREADS, bj as TABLE_TRACES, bf as TABLE_WORKFLOW_SNAPSHOT, f as WorkflowRun, W as WorkflowRuns } from '../base-bWFiU8RL.js';
|
|
2
2
|
import 'ai';
|
|
3
3
|
import '../base-DT2poiVK.js';
|
|
4
4
|
import '@opentelemetry/api';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from '@libsql/client';
|
|
2
|
-
import { b as MastraStorage, T as TABLE_NAMES, S as StorageColumn, c as StorageThreadType, d as MessageType, e as StorageGetMessagesArg, E as EvalRow, W as WorkflowRuns, f as WorkflowRun } from '../../base-
|
|
2
|
+
import { b as MastraStorage, T as TABLE_NAMES, S as StorageColumn, c as StorageThreadType, d as MessageType, e as StorageGetMessagesArg, E as EvalRow, W as WorkflowRuns, f as WorkflowRun } from '../../base-DI6ChaUK.cjs';
|
|
3
3
|
import 'ai';
|
|
4
4
|
import '../../base-BihKcqDY.cjs';
|
|
5
5
|
import '@opentelemetry/api';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Config } from '@libsql/client';
|
|
2
|
-
import { b as MastraStorage, T as TABLE_NAMES, S as StorageColumn, c as StorageThreadType, d as MessageType, e as StorageGetMessagesArg, E as EvalRow, W as WorkflowRuns, f as WorkflowRun } from '../../base-
|
|
2
|
+
import { b as MastraStorage, T as TABLE_NAMES, S as StorageColumn, c as StorageThreadType, d as MessageType, e as StorageGetMessagesArg, E as EvalRow, W as WorkflowRuns, f as WorkflowRun } from '../../base-bWFiU8RL.js';
|
|
3
3
|
import 'ai';
|
|
4
4
|
import '../../base-DT2poiVK.js';
|
|
5
5
|
import '@opentelemetry/api';
|
|
@@ -3,7 +3,7 @@ import { SpanKind } from '@opentelemetry/api';
|
|
|
3
3
|
import { ExportResult } from '@opentelemetry/core';
|
|
4
4
|
import { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
5
5
|
import { L as Logger } from '../index-CquI0inB.cjs';
|
|
6
|
-
import { b as MastraStorage } from '../base-
|
|
6
|
+
import { b as MastraStorage } from '../base-DI6ChaUK.cjs';
|
|
7
7
|
import 'stream';
|
|
8
8
|
import 'pino';
|
|
9
9
|
import 'ai';
|
|
@@ -3,7 +3,7 @@ import { SpanKind } from '@opentelemetry/api';
|
|
|
3
3
|
import { ExportResult } from '@opentelemetry/core';
|
|
4
4
|
import { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
5
5
|
import { L as Logger } from '../index-CquI0inB.js';
|
|
6
|
-
import { b as MastraStorage } from '../base-
|
|
6
|
+
import { b as MastraStorage } from '../base-bWFiU8RL.js';
|
|
7
7
|
import 'stream';
|
|
8
8
|
import 'pino';
|
|
9
9
|
import 'ai';
|
package/dist/tools/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ar as CoreTool, I as Tool, C as ToolAction, H as ToolExecutionContext, aq as VercelTool, ap as createTool } from '../base-DI6ChaUK.cjs';
|
|
2
2
|
export { isVercelTool } from '../utils.cjs';
|
|
3
3
|
import 'ai';
|
|
4
4
|
import '../base-BihKcqDY.cjs';
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ar as CoreTool, I as Tool, C as ToolAction, H as ToolExecutionContext, aq as VercelTool, ap as createTool } from '../base-bWFiU8RL.js';
|
|
2
2
|
export { isVercelTool } from '../utils.js';
|
|
3
3
|
import 'ai';
|
|
4
4
|
import '../base-DT2poiVK.js';
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aq as VercelTool, C as ToolAction, b1 as ToolsInput, a as Mastra, b2 as MastraPrimitives, G as MastraMemory, ar as CoreTool, D as Agent, K as Workflow, J as Step, as as StepExecutionContext, aI as WorkflowContext, t as NewWorkflow, N as NewStep, b3 as AgentNetwork } from './base-DI6ChaUK.cjs';
|
|
2
2
|
import { CoreMessage, Message } from 'ai';
|
|
3
3
|
import { MastraTTS } from './tts/index.cjs';
|
|
4
4
|
import { MastraVector } from './vector/index.cjs';
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aq as VercelTool, C as ToolAction, b1 as ToolsInput, a as Mastra, b2 as MastraPrimitives, G as MastraMemory, ar as CoreTool, D as Agent, K as Workflow, J as Step, as as StepExecutionContext, aI as WorkflowContext, t as NewWorkflow, N as NewStep, b3 as AgentNetwork } from './base-bWFiU8RL.js';
|
|
2
2
|
import { CoreMessage, Message } from 'ai';
|
|
3
3
|
import { MastraTTS } from './tts/index.js';
|
|
4
4
|
import { MastraVector } from './vector/index.js';
|
package/dist/voice/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { b9 as CompositeVoice, ba as DefaultVoice, b8 as MastraVoice, b7 as VoiceConfig, b6 as VoiceEventMap, b5 as VoiceEventType } from '../base-DI6ChaUK.cjs';
|
|
2
2
|
import 'ai';
|
|
3
3
|
import '../base-BihKcqDY.cjs';
|
|
4
4
|
import '@opentelemetry/api';
|
package/dist/voice/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { b9 as CompositeVoice, ba as DefaultVoice, b8 as MastraVoice, b7 as VoiceConfig, b6 as VoiceEventMap, b5 as VoiceEventType } from '../base-bWFiU8RL.js';
|
|
2
2
|
import 'ai';
|
|
3
3
|
import '../base-DT2poiVK.js';
|
|
4
4
|
import '@opentelemetry/api';
|
package/dist/workflows/index.cjs
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3BKYXIDL_cjs = require('../chunk-3BKYXIDL.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Step", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunk3BKYXIDL_cjs.Step; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "WhenConditionReturnValue", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunk3BKYXIDL_cjs.WhenConditionReturnValue; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "Workflow", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunk3BKYXIDL_cjs.Workflow; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "agentToStep", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunk3BKYXIDL_cjs.agentToStep; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "getActivePathsAndStatus", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunk3BKYXIDL_cjs.getActivePathsAndStatus; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "getResultActivePaths", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunk3BKYXIDL_cjs.getResultActivePaths; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "getStepResult", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunk3BKYXIDL_cjs.getStepResult; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "getSuspendedPaths", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunk3BKYXIDL_cjs.getSuspendedPaths; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "isAgent", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunk3BKYXIDL_cjs.isAgent; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "isConditionalKey", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunk3BKYXIDL_cjs.isConditionalKey; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "isErrorEvent", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunk3BKYXIDL_cjs.isErrorEvent; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "isFinalState", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunk3BKYXIDL_cjs.isFinalState; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "isLimboState", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunk3BKYXIDL_cjs.isLimboState; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "isTransitionEvent", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunk3BKYXIDL_cjs.isTransitionEvent; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "isVariableReference", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunk3BKYXIDL_cjs.isVariableReference; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "isWorkflow", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunk3BKYXIDL_cjs.isWorkflow; }
|
|
70
70
|
});
|
|
71
71
|
Object.defineProperty(exports, "mergeChildValue", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunk3BKYXIDL_cjs.mergeChildValue; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "recursivelyCheckForFinalState", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunk3BKYXIDL_cjs.recursivelyCheckForFinalState; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "resolveVariables", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunk3BKYXIDL_cjs.resolveVariables; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "updateStepInHierarchy", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunk3BKYXIDL_cjs.updateStepInHierarchy; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "workflowToStep", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunk3BKYXIDL_cjs.workflowToStep; }
|
|
90
90
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { ay as VariableReference, aF as StepResult, J as Step, K as Workflow, D as Agent, aI as WorkflowContext, b1 as ToolsInput, a as Mastra, at as StepAction, aH as WorkflowRunResult } from '../base-DI6ChaUK.cjs';
|
|
2
|
+
export { aA as ActionContext, az as BaseCondition, aO as DependencyCheckOutput, aV as ExtractSchemaFromStep, aY as ExtractSchemaType, aW as ExtractStepResult, aZ as PathsToStringProps, aL as ResolverFunctionInput, aM as ResolverFunctionOutput, ax as RetryConfig, aD as StepCondition, aE as StepConfig, aC as StepDef, as as StepExecutionContext, aw as StepGraph, aU as StepId, aX as StepInputType, av as StepNode, aP as StepResolverOutput, au as StepVariableType, aG as StepsRecord, aN as SubscriberFunctionOutput, aB as WhenConditionReturnValue, aR as WorkflowActionParams, aS as WorkflowActions, aQ as WorkflowActors, aK as WorkflowEvent, aJ as WorkflowLogMessage, L as WorkflowOptions, a$ as WorkflowResumeResult, a_ as WorkflowRunState, aT as WorkflowState } from '../base-DI6ChaUK.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { a as Metric } from '../types-BtMyV38I.cjs';
|
|
5
5
|
import { L as Logger } from '../index-CquI0inB.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { ay as VariableReference, aF as StepResult, J as Step, K as Workflow, D as Agent, aI as WorkflowContext, b1 as ToolsInput, a as Mastra, at as StepAction, aH as WorkflowRunResult } from '../base-bWFiU8RL.js';
|
|
2
|
+
export { aA as ActionContext, az as BaseCondition, aO as DependencyCheckOutput, aV as ExtractSchemaFromStep, aY as ExtractSchemaType, aW as ExtractStepResult, aZ as PathsToStringProps, aL as ResolverFunctionInput, aM as ResolverFunctionOutput, ax as RetryConfig, aD as StepCondition, aE as StepConfig, aC as StepDef, as as StepExecutionContext, aw as StepGraph, aU as StepId, aX as StepInputType, av as StepNode, aP as StepResolverOutput, au as StepVariableType, aG as StepsRecord, aN as SubscriberFunctionOutput, aB as WhenConditionReturnValue, aR as WorkflowActionParams, aS as WorkflowActions, aQ as WorkflowActors, aK as WorkflowEvent, aJ as WorkflowLogMessage, L as WorkflowOptions, a$ as WorkflowResumeResult, a_ as WorkflowRunState, aT as WorkflowState } from '../base-bWFiU8RL.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { a as Metric } from '../types-BtMyV38I.js';
|
|
5
5
|
import { L as Logger } from '../index-CquI0inB.js';
|
package/dist/workflows/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Step, WhenConditionReturnValue, Workflow, agentToStep, getActivePathsAndStatus, getResultActivePaths, getStepResult, getSuspendedPaths, isAgent, isConditionalKey, isErrorEvent, isFinalState, isLimboState, isTransitionEvent, isVariableReference, isWorkflow, mergeChildValue, recursivelyCheckForFinalState, resolveVariables, updateStepInHierarchy, workflowToStep } from '../chunk-
|
|
1
|
+
export { Step, WhenConditionReturnValue, Workflow, agentToStep, getActivePathsAndStatus, getResultActivePaths, getStepResult, getSuspendedPaths, isAgent, isConditionalKey, isErrorEvent, isFinalState, isLimboState, isTransitionEvent, isVariableReference, isWorkflow, mergeChildValue, recursivelyCheckForFinalState, resolveVariables, updateStepInHierarchy, workflowToStep } from '../chunk-UQ2VDYKC.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3BKYXIDL_cjs = require('../../chunk-3BKYXIDL.cjs');
|
|
4
4
|
var chunk7JRVDC7F_cjs = require('../../chunk-7JRVDC7F.cjs');
|
|
5
5
|
var chunkD63P5O4Q_cjs = require('../../chunk-D63P5O4Q.cjs');
|
|
6
6
|
var chunkO7IW545H_cjs = require('../../chunk-O7IW545H.cjs');
|
|
@@ -586,7 +586,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
|
|
|
586
586
|
|
|
587
587
|
// src/workflows/vNext/workflow.ts
|
|
588
588
|
function createStep(params) {
|
|
589
|
-
if (params instanceof
|
|
589
|
+
if (params instanceof chunk3BKYXIDL_cjs.Agent) {
|
|
590
590
|
return {
|
|
591
591
|
id: params.name,
|
|
592
592
|
// @ts-ignore
|
|
@@ -670,6 +670,7 @@ var NewWorkflow = class extends chunkD63P5O4Q_cjs.MastraBase {
|
|
|
670
670
|
steps;
|
|
671
671
|
stepDefs;
|
|
672
672
|
stepFlow;
|
|
673
|
+
serializedStepFlow;
|
|
673
674
|
executionEngine;
|
|
674
675
|
executionGraph;
|
|
675
676
|
retryConfig;
|
|
@@ -693,6 +694,7 @@ var NewWorkflow = class extends chunkD63P5O4Q_cjs.MastraBase {
|
|
|
693
694
|
this.retryConfig = retryConfig ?? { attempts: 0, delay: 0 };
|
|
694
695
|
this.executionGraph = this.buildExecutionGraph();
|
|
695
696
|
this.stepFlow = [];
|
|
697
|
+
this.serializedStepFlow = [];
|
|
696
698
|
this.#mastra = mastra;
|
|
697
699
|
this.steps = {};
|
|
698
700
|
this.stepDefs = steps;
|
|
@@ -728,6 +730,15 @@ var NewWorkflow = class extends chunkD63P5O4Q_cjs.MastraBase {
|
|
|
728
730
|
*/
|
|
729
731
|
then(step) {
|
|
730
732
|
this.stepFlow.push({ type: "step", step });
|
|
733
|
+
this.serializedStepFlow.push({
|
|
734
|
+
type: "step",
|
|
735
|
+
step: {
|
|
736
|
+
id: step.id,
|
|
737
|
+
description: step.description,
|
|
738
|
+
component: step.component,
|
|
739
|
+
stepFlow: step.stepFlow
|
|
740
|
+
}
|
|
741
|
+
});
|
|
731
742
|
this.steps[step.id] = step;
|
|
732
743
|
return this;
|
|
733
744
|
}
|
|
@@ -768,11 +779,32 @@ var NewWorkflow = class extends chunkD63P5O4Q_cjs.MastraBase {
|
|
|
768
779
|
}
|
|
769
780
|
});
|
|
770
781
|
this.stepFlow.push({ type: "step", step: mappingStep });
|
|
782
|
+
this.serializedStepFlow.push({
|
|
783
|
+
type: "step",
|
|
784
|
+
step: {
|
|
785
|
+
id: mappingStep.id,
|
|
786
|
+
description: mappingStep.description,
|
|
787
|
+
component: mappingStep.component,
|
|
788
|
+
stepFlow: mappingStep.stepFlow
|
|
789
|
+
}
|
|
790
|
+
});
|
|
771
791
|
return this;
|
|
772
792
|
}
|
|
773
793
|
// TODO: make typing better here
|
|
774
794
|
parallel(steps) {
|
|
775
795
|
this.stepFlow.push({ type: "parallel", steps: steps.map((step) => ({ type: "step", step })) });
|
|
796
|
+
this.serializedStepFlow.push({
|
|
797
|
+
type: "parallel",
|
|
798
|
+
steps: steps.map((step) => ({
|
|
799
|
+
type: "step",
|
|
800
|
+
step: {
|
|
801
|
+
id: step.id,
|
|
802
|
+
description: step.description,
|
|
803
|
+
component: step.component,
|
|
804
|
+
stepFlow: step.stepFlow
|
|
805
|
+
}
|
|
806
|
+
}))
|
|
807
|
+
});
|
|
776
808
|
steps.forEach((step) => {
|
|
777
809
|
this.steps[step.id] = step;
|
|
778
810
|
});
|
|
@@ -786,6 +818,19 @@ var NewWorkflow = class extends chunkD63P5O4Q_cjs.MastraBase {
|
|
|
786
818
|
conditions: steps.map(([cond]) => cond),
|
|
787
819
|
serializedConditions: steps.map(([cond, _step]) => ({ id: `${_step.id}-condition`, fn: cond.toString() }))
|
|
788
820
|
});
|
|
821
|
+
this.serializedStepFlow.push({
|
|
822
|
+
type: "conditional",
|
|
823
|
+
steps: steps.map(([_cond, step]) => ({
|
|
824
|
+
type: "step",
|
|
825
|
+
step: {
|
|
826
|
+
id: step.id,
|
|
827
|
+
description: step.description,
|
|
828
|
+
component: step.component,
|
|
829
|
+
stepFlow: step.stepFlow
|
|
830
|
+
}
|
|
831
|
+
})),
|
|
832
|
+
serializedConditions: steps.map(([cond, _step]) => ({ id: `${_step.id}-condition`, fn: cond.toString() }))
|
|
833
|
+
});
|
|
789
834
|
steps.forEach(([_, step]) => {
|
|
790
835
|
this.steps[step.id] = step;
|
|
791
836
|
});
|
|
@@ -799,6 +844,17 @@ var NewWorkflow = class extends chunkD63P5O4Q_cjs.MastraBase {
|
|
|
799
844
|
loopType: "dowhile",
|
|
800
845
|
serializedCondition: { id: `${step.id}-condition`, fn: condition.toString() }
|
|
801
846
|
});
|
|
847
|
+
this.serializedStepFlow.push({
|
|
848
|
+
type: "loop",
|
|
849
|
+
step: {
|
|
850
|
+
id: step.id,
|
|
851
|
+
description: step.description,
|
|
852
|
+
component: step.component,
|
|
853
|
+
stepFlow: step.stepFlow
|
|
854
|
+
},
|
|
855
|
+
serializedCondition: { id: `${step.id}-condition`, fn: condition.toString() },
|
|
856
|
+
loopType: "dowhile"
|
|
857
|
+
});
|
|
802
858
|
this.steps[step.id] = step;
|
|
803
859
|
return this;
|
|
804
860
|
}
|
|
@@ -810,11 +866,32 @@ var NewWorkflow = class extends chunkD63P5O4Q_cjs.MastraBase {
|
|
|
810
866
|
loopType: "dountil",
|
|
811
867
|
serializedCondition: { id: `${step.id}-condition`, fn: condition.toString() }
|
|
812
868
|
});
|
|
869
|
+
this.serializedStepFlow.push({
|
|
870
|
+
type: "loop",
|
|
871
|
+
step: {
|
|
872
|
+
id: step.id,
|
|
873
|
+
description: step.description,
|
|
874
|
+
component: step.component,
|
|
875
|
+
stepFlow: step.stepFlow
|
|
876
|
+
},
|
|
877
|
+
serializedCondition: { id: `${step.id}-condition`, fn: condition.toString() },
|
|
878
|
+
loopType: "dountil"
|
|
879
|
+
});
|
|
813
880
|
this.steps[step.id] = step;
|
|
814
881
|
return this;
|
|
815
882
|
}
|
|
816
883
|
foreach(step, opts) {
|
|
817
884
|
this.stepFlow.push({ type: "foreach", step, opts: opts ?? { concurrency: 1 } });
|
|
885
|
+
this.serializedStepFlow.push({
|
|
886
|
+
type: "foreach",
|
|
887
|
+
step: {
|
|
888
|
+
id: step.id,
|
|
889
|
+
description: step.description,
|
|
890
|
+
component: step.component,
|
|
891
|
+
stepFlow: step.stepFlow
|
|
892
|
+
},
|
|
893
|
+
opts: opts ?? { concurrency: 1 }
|
|
894
|
+
});
|
|
818
895
|
this.steps[step.id] = step;
|
|
819
896
|
return this;
|
|
820
897
|
}
|
|
@@ -840,6 +917,9 @@ var NewWorkflow = class extends chunkD63P5O4Q_cjs.MastraBase {
|
|
|
840
917
|
get stepGraph() {
|
|
841
918
|
return this.stepFlow;
|
|
842
919
|
}
|
|
920
|
+
get serializedStepGraph() {
|
|
921
|
+
return this.serializedStepFlow;
|
|
922
|
+
}
|
|
843
923
|
/**
|
|
844
924
|
* Creates a new workflow run instance
|
|
845
925
|
* @param options Optional configuration for the run
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as ExecutionEngine, h as ExecutionGraph, i as StepResult, j as StepFlowEntry, N as NewStep, k as ExecuteFunction } from '../../base-
|
|
2
|
-
export {
|
|
1
|
+
import { g as ExecutionEngine, h as ExecutionGraph, i as StepResult, j as StepFlowEntry, N as NewStep, k as ExecuteFunction } from '../../base-DI6ChaUK.cjs';
|
|
2
|
+
export { z as ExtractSchemaFromStep, y as ExtractSchemaType, t as NewWorkflow, s as NewWorkflowConfig, P as PathsToStringProps, R as Run, l as SerializedStep, m as SerializedStepFlowEntry, v as StepFailure, u as StepSuccess, w as StepSuspended, x as StepsRecord, V as VariableReference, B as WatchEvent, r as WorkflowResult, Z as ZodPathType, o as cloneStep, q as cloneWorkflow, n as createStep, p as createWorkflow } from '../../base-DI6ChaUK.cjs';
|
|
3
3
|
import EventEmitter from 'events';
|
|
4
4
|
import { RuntimeContext } from '../../runtime-context/index.cjs';
|
|
5
5
|
import 'ai';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as ExecutionEngine, h as ExecutionGraph, i as StepResult, j as StepFlowEntry, N as NewStep, k as ExecuteFunction } from '../../base-
|
|
2
|
-
export {
|
|
1
|
+
import { g as ExecutionEngine, h as ExecutionGraph, i as StepResult, j as StepFlowEntry, N as NewStep, k as ExecuteFunction } from '../../base-bWFiU8RL.js';
|
|
2
|
+
export { z as ExtractSchemaFromStep, y as ExtractSchemaType, t as NewWorkflow, s as NewWorkflowConfig, P as PathsToStringProps, R as Run, l as SerializedStep, m as SerializedStepFlowEntry, v as StepFailure, u as StepSuccess, w as StepSuspended, x as StepsRecord, V as VariableReference, B as WatchEvent, r as WorkflowResult, Z as ZodPathType, o as cloneStep, q as cloneWorkflow, n as createStep, p as createWorkflow } from '../../base-bWFiU8RL.js';
|
|
3
3
|
import EventEmitter from 'events';
|
|
4
4
|
import { RuntimeContext } from '../../runtime-context/index.js';
|
|
5
5
|
import 'ai';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Agent } from '../../chunk-
|
|
1
|
+
import { Agent } from '../../chunk-UQ2VDYKC.js';
|
|
2
2
|
import { Tool } from '../../chunk-JSUPD5IG.js';
|
|
3
3
|
import { MastraBase } from '../../chunk-CLJQYXNM.js';
|
|
4
4
|
import { RegisteredLogger } from '../../chunk-2BVZNKLX.js';
|
|
@@ -664,6 +664,7 @@ var NewWorkflow = class extends MastraBase {
|
|
|
664
664
|
steps;
|
|
665
665
|
stepDefs;
|
|
666
666
|
stepFlow;
|
|
667
|
+
serializedStepFlow;
|
|
667
668
|
executionEngine;
|
|
668
669
|
executionGraph;
|
|
669
670
|
retryConfig;
|
|
@@ -687,6 +688,7 @@ var NewWorkflow = class extends MastraBase {
|
|
|
687
688
|
this.retryConfig = retryConfig ?? { attempts: 0, delay: 0 };
|
|
688
689
|
this.executionGraph = this.buildExecutionGraph();
|
|
689
690
|
this.stepFlow = [];
|
|
691
|
+
this.serializedStepFlow = [];
|
|
690
692
|
this.#mastra = mastra;
|
|
691
693
|
this.steps = {};
|
|
692
694
|
this.stepDefs = steps;
|
|
@@ -722,6 +724,15 @@ var NewWorkflow = class extends MastraBase {
|
|
|
722
724
|
*/
|
|
723
725
|
then(step) {
|
|
724
726
|
this.stepFlow.push({ type: "step", step });
|
|
727
|
+
this.serializedStepFlow.push({
|
|
728
|
+
type: "step",
|
|
729
|
+
step: {
|
|
730
|
+
id: step.id,
|
|
731
|
+
description: step.description,
|
|
732
|
+
component: step.component,
|
|
733
|
+
stepFlow: step.stepFlow
|
|
734
|
+
}
|
|
735
|
+
});
|
|
725
736
|
this.steps[step.id] = step;
|
|
726
737
|
return this;
|
|
727
738
|
}
|
|
@@ -762,11 +773,32 @@ var NewWorkflow = class extends MastraBase {
|
|
|
762
773
|
}
|
|
763
774
|
});
|
|
764
775
|
this.stepFlow.push({ type: "step", step: mappingStep });
|
|
776
|
+
this.serializedStepFlow.push({
|
|
777
|
+
type: "step",
|
|
778
|
+
step: {
|
|
779
|
+
id: mappingStep.id,
|
|
780
|
+
description: mappingStep.description,
|
|
781
|
+
component: mappingStep.component,
|
|
782
|
+
stepFlow: mappingStep.stepFlow
|
|
783
|
+
}
|
|
784
|
+
});
|
|
765
785
|
return this;
|
|
766
786
|
}
|
|
767
787
|
// TODO: make typing better here
|
|
768
788
|
parallel(steps) {
|
|
769
789
|
this.stepFlow.push({ type: "parallel", steps: steps.map((step) => ({ type: "step", step })) });
|
|
790
|
+
this.serializedStepFlow.push({
|
|
791
|
+
type: "parallel",
|
|
792
|
+
steps: steps.map((step) => ({
|
|
793
|
+
type: "step",
|
|
794
|
+
step: {
|
|
795
|
+
id: step.id,
|
|
796
|
+
description: step.description,
|
|
797
|
+
component: step.component,
|
|
798
|
+
stepFlow: step.stepFlow
|
|
799
|
+
}
|
|
800
|
+
}))
|
|
801
|
+
});
|
|
770
802
|
steps.forEach((step) => {
|
|
771
803
|
this.steps[step.id] = step;
|
|
772
804
|
});
|
|
@@ -780,6 +812,19 @@ var NewWorkflow = class extends MastraBase {
|
|
|
780
812
|
conditions: steps.map(([cond]) => cond),
|
|
781
813
|
serializedConditions: steps.map(([cond, _step]) => ({ id: `${_step.id}-condition`, fn: cond.toString() }))
|
|
782
814
|
});
|
|
815
|
+
this.serializedStepFlow.push({
|
|
816
|
+
type: "conditional",
|
|
817
|
+
steps: steps.map(([_cond, step]) => ({
|
|
818
|
+
type: "step",
|
|
819
|
+
step: {
|
|
820
|
+
id: step.id,
|
|
821
|
+
description: step.description,
|
|
822
|
+
component: step.component,
|
|
823
|
+
stepFlow: step.stepFlow
|
|
824
|
+
}
|
|
825
|
+
})),
|
|
826
|
+
serializedConditions: steps.map(([cond, _step]) => ({ id: `${_step.id}-condition`, fn: cond.toString() }))
|
|
827
|
+
});
|
|
783
828
|
steps.forEach(([_, step]) => {
|
|
784
829
|
this.steps[step.id] = step;
|
|
785
830
|
});
|
|
@@ -793,6 +838,17 @@ var NewWorkflow = class extends MastraBase {
|
|
|
793
838
|
loopType: "dowhile",
|
|
794
839
|
serializedCondition: { id: `${step.id}-condition`, fn: condition.toString() }
|
|
795
840
|
});
|
|
841
|
+
this.serializedStepFlow.push({
|
|
842
|
+
type: "loop",
|
|
843
|
+
step: {
|
|
844
|
+
id: step.id,
|
|
845
|
+
description: step.description,
|
|
846
|
+
component: step.component,
|
|
847
|
+
stepFlow: step.stepFlow
|
|
848
|
+
},
|
|
849
|
+
serializedCondition: { id: `${step.id}-condition`, fn: condition.toString() },
|
|
850
|
+
loopType: "dowhile"
|
|
851
|
+
});
|
|
796
852
|
this.steps[step.id] = step;
|
|
797
853
|
return this;
|
|
798
854
|
}
|
|
@@ -804,11 +860,32 @@ var NewWorkflow = class extends MastraBase {
|
|
|
804
860
|
loopType: "dountil",
|
|
805
861
|
serializedCondition: { id: `${step.id}-condition`, fn: condition.toString() }
|
|
806
862
|
});
|
|
863
|
+
this.serializedStepFlow.push({
|
|
864
|
+
type: "loop",
|
|
865
|
+
step: {
|
|
866
|
+
id: step.id,
|
|
867
|
+
description: step.description,
|
|
868
|
+
component: step.component,
|
|
869
|
+
stepFlow: step.stepFlow
|
|
870
|
+
},
|
|
871
|
+
serializedCondition: { id: `${step.id}-condition`, fn: condition.toString() },
|
|
872
|
+
loopType: "dountil"
|
|
873
|
+
});
|
|
807
874
|
this.steps[step.id] = step;
|
|
808
875
|
return this;
|
|
809
876
|
}
|
|
810
877
|
foreach(step, opts) {
|
|
811
878
|
this.stepFlow.push({ type: "foreach", step, opts: opts ?? { concurrency: 1 } });
|
|
879
|
+
this.serializedStepFlow.push({
|
|
880
|
+
type: "foreach",
|
|
881
|
+
step: {
|
|
882
|
+
id: step.id,
|
|
883
|
+
description: step.description,
|
|
884
|
+
component: step.component,
|
|
885
|
+
stepFlow: step.stepFlow
|
|
886
|
+
},
|
|
887
|
+
opts: opts ?? { concurrency: 1 }
|
|
888
|
+
});
|
|
812
889
|
this.steps[step.id] = step;
|
|
813
890
|
return this;
|
|
814
891
|
}
|
|
@@ -834,6 +911,9 @@ var NewWorkflow = class extends MastraBase {
|
|
|
834
911
|
get stepGraph() {
|
|
835
912
|
return this.stepFlow;
|
|
836
913
|
}
|
|
914
|
+
get serializedStepGraph() {
|
|
915
|
+
return this.serializedStepFlow;
|
|
916
|
+
}
|
|
837
917
|
/**
|
|
838
918
|
* Creates a new workflow run instance
|
|
839
919
|
* @param options Optional configuration for the run
|