@mastra/server 0.0.0-mcp-schema-serializer-20250430202337 → 0.0.0-mcp-changeset-20250707162621
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/README.md +48 -135
- package/dist/_tsup-dts-rollup.d.cts +524 -100
- package/dist/_tsup-dts-rollup.d.ts +524 -100
- package/dist/{chunk-FV45V6WC.cjs → chunk-2KZFMI6P.cjs} +1 -7
- package/dist/{chunk-5YGDYMRB.cjs → chunk-2SLFAFTR.cjs} +14 -13
- package/dist/chunk-4D66QEKC.js +81 -0
- package/dist/{chunk-M3YJLWTU.js → chunk-5PQQ42EZ.js} +68 -57
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/{chunk-M56ECCHK.cjs → chunk-7TP2LX5L.cjs} +20 -19
- package/dist/chunk-B2PAS2IB.cjs +514 -0
- package/dist/{chunk-Y3SV5XK4.js → chunk-BK4XT6EG.js} +105 -16
- package/dist/{chunk-QN4KF3BH.cjs → chunk-CCGRCYWJ.cjs} +2 -2
- package/dist/{chunk-QJ3AHN64.js → chunk-CRCR3ZUK.js} +4 -3
- package/dist/{chunk-2FJURXCL.cjs → chunk-DN7K6FJK.cjs} +93 -55
- package/dist/{chunk-D3G23FP3.cjs → chunk-FRVBFMO2.cjs} +24 -22
- package/dist/{chunk-7IWQE76Z.cjs → chunk-G7KH752Y.cjs} +16 -10
- package/dist/chunk-GHC4YV6R.js +504 -0
- package/dist/chunk-H7DMHBKY.js +498 -0
- package/dist/chunk-JMLYCXMK.cjs +332 -0
- package/dist/{chunk-Q6SHQECN.js → chunk-KHZKYUNR.js} +34 -10
- package/dist/{chunk-TRDNDNGQ.js → chunk-LCM566I4.js} +2 -7
- package/dist/chunk-LF7P5PLR.js +14 -0
- package/dist/chunk-LI436ITD.cjs +2042 -0
- package/dist/{chunk-5JNVY6DU.js → chunk-LRCAAFUA.js} +7 -5
- package/dist/chunk-LZ3VJXSO.cjs +278 -0
- package/dist/chunk-MEGCYGBU.js +2039 -0
- package/dist/{chunk-RBQASTUP.js → chunk-MKLYEKEF.js} +63 -25
- package/dist/chunk-MLKGABMK.js +7 -0
- package/dist/chunk-PZQDCRPV.cjs +16 -0
- package/dist/chunk-QGX47B5D.cjs +86 -0
- package/dist/{chunk-WTHDCRMY.js → chunk-RG473F6Y.js} +12 -6
- package/dist/chunk-RHSWAXKB.cjs +118 -0
- package/dist/{chunk-L7XE5QTW.js → chunk-RSEO4XPX.js} +1 -1
- package/dist/chunk-SDPGVWQJ.cjs +512 -0
- package/dist/{chunk-4JINXASC.js → chunk-WNVFNNWN.js} +5 -4
- package/dist/server/handlers/a2a.cjs +30 -0
- package/dist/server/handlers/a2a.d.cts +6 -0
- package/dist/server/handlers/a2a.d.ts +6 -0
- package/dist/server/handlers/a2a.js +1 -0
- package/dist/server/handlers/agents.cjs +7 -7
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/error.cjs +2 -2
- package/dist/server/handlers/error.js +1 -1
- package/dist/server/handlers/legacyWorkflows.cjs +46 -0
- package/dist/server/handlers/legacyWorkflows.d.cts +10 -0
- package/dist/server/handlers/legacyWorkflows.d.ts +10 -0
- package/dist/server/handlers/legacyWorkflows.js +1 -0
- package/dist/server/handlers/logs.cjs +4 -4
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/memory.cjs +9 -9
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/network.cjs +5 -5
- package/dist/server/handlers/network.js +1 -1
- package/dist/server/handlers/telemetry.cjs +3 -3
- package/dist/server/handlers/telemetry.js +1 -1
- package/dist/server/handlers/tools.cjs +5 -5
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/utils.cjs +2 -2
- package/dist/server/handlers/utils.js +1 -1
- package/dist/server/handlers/vNextNetwork.cjs +218 -0
- package/dist/server/handlers/vNextNetwork.d.cts +6 -0
- package/dist/server/handlers/vNextNetwork.d.ts +6 -0
- package/dist/server/handlers/vNextNetwork.js +211 -0
- package/dist/server/handlers/vector.cjs +7 -7
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -4
- package/dist/server/handlers/voice.d.cts +1 -0
- package/dist/server/handlers/voice.d.ts +1 -0
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +29 -13
- package/dist/server/handlers/workflows.d.cts +6 -2
- package/dist/server/handlers/workflows.d.ts +6 -2
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +32 -27
- package/dist/server/handlers.d.cts +2 -1
- package/dist/server/handlers.d.ts +2 -1
- package/dist/server/handlers.js +11 -10
- package/package.json +14 -13
- package/dist/chunk-3AHQ5RGN.js +0 -11
- package/dist/chunk-3EJZQ6TQ.js +0 -49
- package/dist/chunk-4BIX6GMY.cjs +0 -189
- package/dist/chunk-55HTWX4C.cjs +0 -93
- package/dist/chunk-5SWCVTNL.cjs +0 -5579
- package/dist/chunk-AELYAUEE.cjs +0 -316
- package/dist/chunk-EVCC233P.cjs +0 -321
- package/dist/chunk-JPB6RPGB.js +0 -304
- package/dist/chunk-OMN3UI6X.js +0 -5576
- package/dist/chunk-SKBVVI24.cjs +0 -54
- package/dist/chunk-ZLBRQFDD.cjs +0 -13
- package/dist/server/handlers/vNextWorkflows.cjs +0 -46
- package/dist/server/handlers/vNextWorkflows.d.cts +0 -10
- package/dist/server/handlers/vNextWorkflows.d.ts +0 -10
- package/dist/server/handlers/vNextWorkflows.js +0 -1
|
@@ -1,35 +1,75 @@
|
|
|
1
1
|
import type { Agent } from '@mastra/core/agent';
|
|
2
|
+
import type { AgentCard } from '@mastra/core/a2a';
|
|
2
3
|
import type { AgentNetwork } from '@mastra/core/network';
|
|
4
|
+
import type { Artifact } from '@mastra/core/a2a';
|
|
3
5
|
import type { BaseLogMessage } from '@mastra/core/logger';
|
|
4
6
|
import { CoreMessage } from 'ai';
|
|
7
|
+
import type { CoreMessage as CoreMessage_2 } from '@mastra/core/llm';
|
|
8
|
+
import { DefaultEngineType } from '@mastra/core/workflows';
|
|
5
9
|
import { EvalRow } from '@mastra/core/storage';
|
|
6
10
|
import { GenerateObjectResult } from 'ai';
|
|
7
11
|
import { GenerateTextResult } from 'ai';
|
|
12
|
+
import type { IMastraLogger } from '@mastra/core/logger';
|
|
13
|
+
import type { JSONRPCError } from '@mastra/core/a2a';
|
|
14
|
+
import { JSONRPCResponse } from '@mastra/core/a2a';
|
|
15
|
+
import { LegacyStep } from '@mastra/core/workflows/legacy';
|
|
16
|
+
import type { LegacyWorkflow } from '@mastra/core/workflows/legacy';
|
|
17
|
+
import { LegacyWorkflowRunResult } from '@mastra/core/workflows/legacy';
|
|
18
|
+
import type { LegacyWorkflowRuns } from '@mastra/core/storage';
|
|
19
|
+
import type { LogLevel } from '@mastra/core/logger';
|
|
8
20
|
import type { Mastra } from '@mastra/core/mastra';
|
|
21
|
+
import type { MastraError } from '@mastra/core/error';
|
|
9
22
|
import type { MastraMemory } from '@mastra/core/memory';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { NewStep } from '@mastra/core/workflows/vNext';
|
|
13
|
-
import type { NewWorkflow } from '@mastra/core/workflows/vNext';
|
|
23
|
+
import { MastraMessageV1 } from '@mastra/core/memory';
|
|
24
|
+
import type { Message } from '@mastra/core/a2a';
|
|
14
25
|
import type { QueryResult } from '@mastra/core/vector';
|
|
15
26
|
import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
16
|
-
import
|
|
27
|
+
import { ReadableStream as ReadableStream_3 } from 'stream/web';
|
|
28
|
+
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
17
29
|
import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
|
|
18
|
-
import { SerializedStepFlowEntry } from '@mastra/core/workflows
|
|
30
|
+
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
19
31
|
import { Step } from '@mastra/core/workflows';
|
|
20
|
-
import { StepExecutionContext } from '@mastra/core/workflows';
|
|
21
|
-
import { StepGraph } from '@mastra/core/workflows';
|
|
32
|
+
import { StepExecutionContext } from '@mastra/core/workflows/legacy';
|
|
33
|
+
import { StepGraph } from '@mastra/core/workflows/legacy';
|
|
34
|
+
import { StepResult } from '@mastra/core/workflows';
|
|
22
35
|
import { StorageThreadType } from '@mastra/core/memory';
|
|
36
|
+
import { StreamEvent } from '@mastra/core/workflows';
|
|
37
|
+
import { Task } from '@mastra/core/a2a';
|
|
38
|
+
import { TaskAndHistory } from '@mastra/core/a2a';
|
|
39
|
+
import type { TaskContext } from '@mastra/core/a2a';
|
|
40
|
+
import type { TaskIdParams } from '@mastra/core/a2a';
|
|
41
|
+
import type { TaskQueryParams } from '@mastra/core/a2a';
|
|
42
|
+
import type { TaskSendParams } from '@mastra/core/a2a';
|
|
43
|
+
import type { TaskStatus } from '@mastra/core/a2a';
|
|
23
44
|
import type { ToolAction } from '@mastra/core/tools';
|
|
45
|
+
import { UIMessage } from 'ai';
|
|
24
46
|
import type { VercelTool } from '@mastra/core/tools';
|
|
47
|
+
import type { WatchEvent } from '@mastra/core/workflows';
|
|
25
48
|
import type { Workflow } from '@mastra/core/workflows';
|
|
26
|
-
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
|
|
27
|
-
import { WorkflowResult } from '@mastra/core/workflows
|
|
28
|
-
import { WorkflowRunResult } from '@mastra/core/workflows';
|
|
49
|
+
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
|
|
50
|
+
import { WorkflowResult } from '@mastra/core/workflows';
|
|
29
51
|
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
52
|
+
import { ZodBoolean } from 'zod';
|
|
53
|
+
import { ZodEnum } from 'zod';
|
|
54
|
+
import { ZodNumber } from 'zod';
|
|
55
|
+
import { ZodObject } from 'zod';
|
|
56
|
+
import { ZodOptional } from 'zod';
|
|
57
|
+
import { ZodString } from 'zod';
|
|
30
58
|
import { ZodType } from 'zod';
|
|
59
|
+
import { ZodTypeAny } from 'zod';
|
|
31
60
|
import { ZodTypeDef } from 'zod';
|
|
32
61
|
|
|
62
|
+
export declare namespace a2a {
|
|
63
|
+
export {
|
|
64
|
+
getAgentCardByIdHandler,
|
|
65
|
+
handleTaskSend,
|
|
66
|
+
handleTaskGet,
|
|
67
|
+
handleTaskSendSubscribe,
|
|
68
|
+
handleTaskCancel,
|
|
69
|
+
getAgentExecutionHandler
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
33
73
|
export declare namespace agents {
|
|
34
74
|
export {
|
|
35
75
|
getAgentsHandler,
|
|
@@ -41,17 +81,27 @@ export declare namespace agents {
|
|
|
41
81
|
}
|
|
42
82
|
}
|
|
43
83
|
|
|
44
|
-
export declare interface ApiError extends
|
|
84
|
+
export declare interface ApiError extends MastraError {
|
|
45
85
|
message: string;
|
|
46
86
|
status?: number;
|
|
47
87
|
}
|
|
48
88
|
|
|
89
|
+
export declare function applyUpdateToTaskAndHistory(current: TaskAndHistory, update: Omit<TaskStatus, 'timestamp'> | Artifact): TaskAndHistory;
|
|
90
|
+
|
|
91
|
+
export declare function cancelWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
92
|
+
message: string;
|
|
93
|
+
}>;
|
|
94
|
+
|
|
49
95
|
declare type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
|
|
50
96
|
|
|
51
97
|
export declare interface Context {
|
|
52
98
|
mastra: Mastra;
|
|
53
99
|
}
|
|
54
100
|
|
|
101
|
+
export declare function convertToCoreMessage(message: Message): CoreMessage_2;
|
|
102
|
+
|
|
103
|
+
export declare function createErrorResponse(id: number | string | null, error: JSONRPCError<unknown>): JSONRPCResponse<null, unknown>;
|
|
104
|
+
|
|
55
105
|
export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
56
106
|
index: CreateIndexRequest;
|
|
57
107
|
}): Promise<{
|
|
@@ -64,17 +114,26 @@ declare interface CreateIndexRequest {
|
|
|
64
114
|
metric?: 'cosine' | 'euclidean' | 'dotproduct';
|
|
65
115
|
}
|
|
66
116
|
|
|
67
|
-
export declare function
|
|
117
|
+
export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
68
118
|
runId: string;
|
|
69
119
|
}>;
|
|
70
120
|
|
|
71
|
-
export declare function
|
|
121
|
+
export declare function createSuccessResponse<T>(id: number | string | null, result: T): JSONRPCResponse<T>;
|
|
122
|
+
|
|
123
|
+
export declare function createTaskContext({ task, userMessage, history, activeCancellations, }: {
|
|
124
|
+
task: Task;
|
|
125
|
+
userMessage: Message;
|
|
126
|
+
history: Message[];
|
|
127
|
+
activeCancellations: Set<string>;
|
|
128
|
+
}): TaskContext;
|
|
129
|
+
|
|
130
|
+
export declare function createThreadHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
|
|
72
131
|
body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
|
|
73
132
|
resourceId?: string;
|
|
74
133
|
};
|
|
75
134
|
}): Promise<StorageThreadType>;
|
|
76
135
|
|
|
77
|
-
export declare function
|
|
136
|
+
export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
78
137
|
runId: string;
|
|
79
138
|
}>;
|
|
80
139
|
|
|
@@ -84,7 +143,7 @@ export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<Vec
|
|
|
84
143
|
success: boolean;
|
|
85
144
|
}>;
|
|
86
145
|
|
|
87
|
-
export declare function deleteThreadHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
|
|
146
|
+
export declare function deleteThreadHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
88
147
|
result: string;
|
|
89
148
|
}>;
|
|
90
149
|
|
|
@@ -101,21 +160,23 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
|
|
|
101
160
|
export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
|
|
102
161
|
agentId?: string;
|
|
103
162
|
data: any;
|
|
104
|
-
runtimeContext:
|
|
163
|
+
runtimeContext: RuntimeContext_2;
|
|
105
164
|
}): Promise<any>;
|
|
106
165
|
|
|
107
166
|
export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
|
|
108
167
|
data?: unknown;
|
|
109
|
-
runtimeContext:
|
|
168
|
+
runtimeContext: RuntimeContext_2;
|
|
110
169
|
}) => Promise<any>;
|
|
111
170
|
|
|
112
|
-
export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
171
|
+
export declare function generateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
113
172
|
runtimeContext: RuntimeContext;
|
|
114
173
|
agentId: string;
|
|
115
174
|
body: GetBody<'generate'> & {
|
|
116
175
|
resourceid?: string;
|
|
176
|
+
runtimeContext?: Record<string, unknown>;
|
|
117
177
|
};
|
|
118
|
-
|
|
178
|
+
abortSignal?: AbortSignal;
|
|
179
|
+
}): Promise<GenerateTextResult<any, unknown>>;
|
|
119
180
|
|
|
120
181
|
export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
|
|
121
182
|
runtimeContext: RuntimeContext;
|
|
@@ -134,21 +195,70 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
|
|
|
134
195
|
};
|
|
135
196
|
}): Promise<NodeJS.ReadableStream>;
|
|
136
197
|
|
|
137
|
-
export declare function
|
|
198
|
+
export declare function generateVNextNetworkHandler({ mastra, runtimeContext, networkId, body, }: NetworkContext_2 & {
|
|
199
|
+
runtimeContext: RuntimeContext;
|
|
200
|
+
body: {
|
|
201
|
+
message: string;
|
|
202
|
+
threadId?: string;
|
|
203
|
+
resourceId?: string;
|
|
204
|
+
};
|
|
205
|
+
}): Promise<{
|
|
206
|
+
task: string;
|
|
207
|
+
result: string;
|
|
208
|
+
resourceId: string;
|
|
209
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
210
|
+
}>;
|
|
211
|
+
|
|
212
|
+
export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, isPlayground, }: Context & {
|
|
213
|
+
isPlayground?: boolean;
|
|
138
214
|
runtimeContext: RuntimeContext;
|
|
139
215
|
agentId: string;
|
|
140
216
|
}): Promise<{
|
|
141
217
|
name: any;
|
|
142
218
|
instructions: string;
|
|
143
219
|
tools: any;
|
|
220
|
+
workflows: {};
|
|
144
221
|
provider: string;
|
|
145
222
|
modelId: string;
|
|
223
|
+
defaultGenerateOptions: any;
|
|
224
|
+
defaultStreamOptions: any;
|
|
146
225
|
}>;
|
|
147
226
|
|
|
148
|
-
export declare function
|
|
227
|
+
export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
|
|
228
|
+
runtimeContext: RuntimeContext;
|
|
229
|
+
agentId: keyof ReturnType<typeof mastra.getAgents>;
|
|
230
|
+
executionUrl?: string;
|
|
231
|
+
version?: string;
|
|
232
|
+
provider?: {
|
|
233
|
+
organization: string;
|
|
234
|
+
url: string;
|
|
235
|
+
};
|
|
236
|
+
}): Promise<AgentCard>;
|
|
237
|
+
|
|
238
|
+
export declare function getAgentExecutionHandler({ requestId, mastra, agentId, runtimeContext, method, params, taskStore, logger, }: Context & {
|
|
239
|
+
requestId: string;
|
|
149
240
|
runtimeContext: RuntimeContext;
|
|
241
|
+
agentId: string;
|
|
242
|
+
method: 'tasks/send' | 'tasks/sendSubscribe' | 'tasks/get' | 'tasks/cancel';
|
|
243
|
+
params: TaskSendParams | TaskQueryParams | TaskIdParams;
|
|
244
|
+
taskStore?: InMemoryTaskStore;
|
|
245
|
+
logger?: IMastraLogger;
|
|
150
246
|
}): Promise<any>;
|
|
151
247
|
|
|
248
|
+
export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
|
|
249
|
+
runtimeContext: RuntimeContext;
|
|
250
|
+
}): Promise<Record<string, Omit<{
|
|
251
|
+
id: string;
|
|
252
|
+
name: any;
|
|
253
|
+
instructions: string;
|
|
254
|
+
tools: any;
|
|
255
|
+
workflows: {};
|
|
256
|
+
provider: string;
|
|
257
|
+
modelId: string;
|
|
258
|
+
defaultGenerateOptions: any;
|
|
259
|
+
defaultStreamOptions: any;
|
|
260
|
+
}, "id">>>;
|
|
261
|
+
|
|
152
262
|
declare type GetBody<T extends keyof Agent & {
|
|
153
263
|
[K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
|
|
154
264
|
}[keyof Agent]> = {
|
|
@@ -165,6 +275,35 @@ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agent
|
|
|
165
275
|
evals: EvalRow[];
|
|
166
276
|
}>;
|
|
167
277
|
|
|
278
|
+
export declare function getLegacyWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
|
|
279
|
+
stepGraph: StepGraph;
|
|
280
|
+
stepSubscriberGraph: Record<string, StepGraph>;
|
|
281
|
+
serializedStepGraph: StepGraph;
|
|
282
|
+
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
283
|
+
name: string;
|
|
284
|
+
triggerSchema: string | undefined;
|
|
285
|
+
steps: any;
|
|
286
|
+
}>;
|
|
287
|
+
|
|
288
|
+
export declare function getLegacyWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<LegacyWorkflow['getRun']>>;
|
|
289
|
+
|
|
290
|
+
export declare function getLegacyWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
|
|
291
|
+
fromDate?: Date;
|
|
292
|
+
toDate?: Date;
|
|
293
|
+
limit?: number;
|
|
294
|
+
offset?: number;
|
|
295
|
+
resourceId?: string;
|
|
296
|
+
}): Promise<LegacyWorkflowRuns>;
|
|
297
|
+
|
|
298
|
+
export declare function getLegacyWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Get available listeners for an agent
|
|
302
|
+
*/
|
|
303
|
+
export declare function getListenerHandler({ mastra, agentId }: VoiceContext): Promise<{
|
|
304
|
+
enabled: boolean;
|
|
305
|
+
}>;
|
|
306
|
+
|
|
168
307
|
export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
|
|
169
308
|
runtimeContext: RuntimeContext;
|
|
170
309
|
agentId: string;
|
|
@@ -175,21 +314,35 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, a
|
|
|
175
314
|
evals: EvalRow[];
|
|
176
315
|
}>;
|
|
177
316
|
|
|
178
|
-
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<
|
|
317
|
+
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, params, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId' | 'params'>): Promise<{
|
|
318
|
+
logs: BaseLogMessage[];
|
|
319
|
+
total: number;
|
|
320
|
+
page: number;
|
|
321
|
+
perPage: number;
|
|
322
|
+
hasMore: boolean;
|
|
323
|
+
}>;
|
|
179
324
|
|
|
180
|
-
export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<
|
|
325
|
+
export declare function getLogsHandler({ mastra, transportId, params, }: Pick<LogsContext, 'mastra' | 'transportId' | 'params'>): Promise<{
|
|
326
|
+
logs: BaseLogMessage[];
|
|
327
|
+
total: number;
|
|
328
|
+
page: number;
|
|
329
|
+
perPage: number;
|
|
330
|
+
hasMore: boolean;
|
|
331
|
+
}>;
|
|
181
332
|
|
|
182
333
|
export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
|
|
183
334
|
transports: string[];
|
|
184
335
|
}>;
|
|
185
336
|
|
|
186
|
-
export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
|
|
337
|
+
export declare function getMemoryStatusHandler({ mastra, agentId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
187
338
|
result: boolean;
|
|
188
339
|
}>;
|
|
189
340
|
|
|
190
|
-
export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>
|
|
341
|
+
export declare function getMessagesHandler({ mastra, agentId, threadId, limit, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
|
|
342
|
+
limit?: number;
|
|
343
|
+
}): Promise<{
|
|
191
344
|
messages: CoreMessage[];
|
|
192
|
-
uiMessages:
|
|
345
|
+
uiMessages: UIMessage[];
|
|
193
346
|
}>;
|
|
194
347
|
|
|
195
348
|
export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
@@ -231,45 +384,133 @@ export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): P
|
|
|
231
384
|
|
|
232
385
|
export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
|
|
233
386
|
|
|
234
|
-
export declare function getThreadByIdHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<StorageThreadType>;
|
|
387
|
+
export declare function getThreadByIdHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType>;
|
|
235
388
|
|
|
236
|
-
export declare function getThreadsHandler({ mastra, agentId, resourceId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId'>): Promise<StorageThreadType[]>;
|
|
389
|
+
export declare function getThreadsHandler({ mastra, agentId, resourceId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType[]>;
|
|
237
390
|
|
|
238
391
|
export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
|
|
239
392
|
|
|
240
393
|
export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
|
|
241
394
|
|
|
242
|
-
export declare function
|
|
243
|
-
|
|
395
|
+
export declare function getVNextNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
396
|
+
id: string;
|
|
397
|
+
name: string;
|
|
398
|
+
instructions: string;
|
|
399
|
+
agents: {
|
|
400
|
+
name: string;
|
|
401
|
+
provider: string;
|
|
402
|
+
modelId: string;
|
|
403
|
+
}[];
|
|
404
|
+
workflows: {
|
|
405
|
+
name: string | undefined;
|
|
406
|
+
description: string | undefined;
|
|
407
|
+
inputSchema: string | undefined;
|
|
408
|
+
outputSchema: string | undefined;
|
|
409
|
+
}[];
|
|
410
|
+
tools: {
|
|
411
|
+
id: string;
|
|
412
|
+
description: string;
|
|
413
|
+
}[];
|
|
414
|
+
routingModel: {
|
|
415
|
+
provider: string;
|
|
416
|
+
modelId: string;
|
|
417
|
+
};
|
|
418
|
+
}>;
|
|
419
|
+
|
|
420
|
+
export declare function getVNextNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'runtimeContext'>): Promise<{
|
|
421
|
+
id: string;
|
|
422
|
+
name: string;
|
|
423
|
+
instructions: string;
|
|
424
|
+
tools: {
|
|
425
|
+
id: string;
|
|
426
|
+
description: string;
|
|
427
|
+
}[];
|
|
428
|
+
agents: {
|
|
429
|
+
name: string;
|
|
430
|
+
provider: string;
|
|
431
|
+
modelId: string;
|
|
432
|
+
}[];
|
|
433
|
+
workflows: {
|
|
434
|
+
name: string | undefined;
|
|
435
|
+
description: string | undefined;
|
|
436
|
+
inputSchema: string | undefined;
|
|
437
|
+
outputSchema: string | undefined;
|
|
438
|
+
}[];
|
|
439
|
+
routingModel: {
|
|
440
|
+
provider: string;
|
|
441
|
+
modelId: string;
|
|
442
|
+
};
|
|
443
|
+
}[]>;
|
|
444
|
+
|
|
445
|
+
export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext_3): Promise<{
|
|
446
|
+
steps: Record<string, SerializedStep>;
|
|
447
|
+
allSteps: Record<string, SerializedStep>;
|
|
244
448
|
name: string | undefined;
|
|
449
|
+
description: string | undefined;
|
|
245
450
|
stepGraph: SerializedStepFlowEntry[];
|
|
246
451
|
inputSchema: string | undefined;
|
|
247
452
|
outputSchema: string | undefined;
|
|
248
453
|
}>;
|
|
249
454
|
|
|
250
|
-
export declare function
|
|
455
|
+
export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
|
|
251
456
|
|
|
252
|
-
export declare function
|
|
457
|
+
export declare function getWorkflowRunExecutionResultHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<WatchEvent['payload']['workflowState']>;
|
|
253
458
|
|
|
254
|
-
export declare function
|
|
459
|
+
export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
|
|
460
|
+
fromDate?: Date;
|
|
461
|
+
toDate?: Date;
|
|
462
|
+
limit?: number;
|
|
463
|
+
offset?: number;
|
|
464
|
+
resourceId?: string;
|
|
465
|
+
}): Promise<WorkflowRuns>;
|
|
255
466
|
|
|
256
|
-
export declare function
|
|
257
|
-
stepGraph: StepGraph;
|
|
258
|
-
stepSubscriberGraph: Record<string, StepGraph>;
|
|
259
|
-
serializedStepGraph: StepGraph;
|
|
260
|
-
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
261
|
-
name: string;
|
|
262
|
-
triggerSchema: string | undefined;
|
|
263
|
-
steps: any;
|
|
264
|
-
}>;
|
|
467
|
+
export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
|
|
265
468
|
|
|
266
|
-
export declare function
|
|
469
|
+
export declare function handleError(error: unknown, defaultMessage: string): never;
|
|
267
470
|
|
|
268
|
-
export declare function
|
|
471
|
+
export declare function handleTaskCancel({ requestId, taskStore, agentId, taskId, logger, }: {
|
|
472
|
+
requestId: string;
|
|
473
|
+
taskStore: InMemoryTaskStore;
|
|
474
|
+
agentId: string;
|
|
475
|
+
taskId: string;
|
|
476
|
+
logger?: IMastraLogger;
|
|
477
|
+
}): Promise<JSONRPCResponse<Task, unknown>>;
|
|
269
478
|
|
|
270
|
-
export declare function
|
|
479
|
+
export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }: {
|
|
480
|
+
requestId: string;
|
|
481
|
+
taskStore: InMemoryTaskStore;
|
|
482
|
+
agentId: string;
|
|
483
|
+
taskId: string;
|
|
484
|
+
}): Promise<JSONRPCResponse<TaskAndHistory, unknown>>;
|
|
485
|
+
|
|
486
|
+
export declare function handleTaskSend({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
|
|
487
|
+
requestId: string;
|
|
488
|
+
params: TaskSendParams;
|
|
489
|
+
taskStore: InMemoryTaskStore;
|
|
490
|
+
agent: Agent;
|
|
491
|
+
agentId: string;
|
|
492
|
+
logger?: IMastraLogger;
|
|
493
|
+
runtimeContext: RuntimeContext;
|
|
494
|
+
}): Promise<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown>>;
|
|
271
495
|
|
|
272
|
-
export declare function
|
|
496
|
+
export declare function handleTaskSendSubscribe({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
|
|
497
|
+
requestId: string;
|
|
498
|
+
params: TaskSendParams;
|
|
499
|
+
taskStore: InMemoryTaskStore;
|
|
500
|
+
agent: Agent;
|
|
501
|
+
agentId: string;
|
|
502
|
+
logger?: IMastraLogger;
|
|
503
|
+
runtimeContext: RuntimeContext;
|
|
504
|
+
}): AsyncGenerator<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown> | JSONRPCResponse< {
|
|
505
|
+
state: string;
|
|
506
|
+
message: {
|
|
507
|
+
role: string;
|
|
508
|
+
parts: {
|
|
509
|
+
type: string;
|
|
510
|
+
text: string;
|
|
511
|
+
}[];
|
|
512
|
+
};
|
|
513
|
+
}, unknown>, void, unknown>;
|
|
273
514
|
|
|
274
515
|
/**
|
|
275
516
|
* `HTTPException` must be used when a fatal error such as authentication failure occurs.
|
|
@@ -319,11 +560,13 @@ export declare class HTTPException extends Error {
|
|
|
319
560
|
* @property res - Optional response object to use.
|
|
320
561
|
* @property message - Optional custom error message.
|
|
321
562
|
* @property cause - Optional cause of the error.
|
|
563
|
+
* @property stack - Optional stack trace for the error.
|
|
322
564
|
*/
|
|
323
565
|
declare type HTTPExceptionOptions = {
|
|
324
566
|
res?: Response;
|
|
325
567
|
message?: string;
|
|
326
568
|
cause?: unknown;
|
|
569
|
+
stack?: string;
|
|
327
570
|
};
|
|
328
571
|
|
|
329
572
|
/**
|
|
@@ -332,8 +575,46 @@ declare type HTTPExceptionOptions = {
|
|
|
332
575
|
*/
|
|
333
576
|
declare type InfoStatusCode = 100 | 101 | 102 | 103;
|
|
334
577
|
|
|
578
|
+
export declare class InMemoryTaskStore {
|
|
579
|
+
private store;
|
|
580
|
+
activeCancellations: Set<string>;
|
|
581
|
+
load({ agentId, taskId }: {
|
|
582
|
+
agentId: string;
|
|
583
|
+
taskId: string;
|
|
584
|
+
}): Promise<TaskAndHistory | null>;
|
|
585
|
+
save({ agentId, data }: {
|
|
586
|
+
agentId: string;
|
|
587
|
+
data: TaskAndHistory;
|
|
588
|
+
}): Promise<void>;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
export declare namespace legacyWorkflows {
|
|
592
|
+
export {
|
|
593
|
+
getLegacyWorkflowsHandler,
|
|
594
|
+
getLegacyWorkflowByIdHandler,
|
|
595
|
+
startAsyncLegacyWorkflowHandler,
|
|
596
|
+
getLegacyWorkflowRunHandler,
|
|
597
|
+
createLegacyWorkflowRunHandler,
|
|
598
|
+
startLegacyWorkflowRunHandler,
|
|
599
|
+
watchLegacyWorkflowHandler,
|
|
600
|
+
resumeAsyncLegacyWorkflowHandler,
|
|
601
|
+
resumeLegacyWorkflowHandler,
|
|
602
|
+
getLegacyWorkflowRunsHandler
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
335
606
|
export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
|
|
336
607
|
|
|
608
|
+
export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore, message, sessionId, metadata, logger, }: {
|
|
609
|
+
agentId: string;
|
|
610
|
+
taskId: string;
|
|
611
|
+
taskStore: InMemoryTaskStore;
|
|
612
|
+
message: Message;
|
|
613
|
+
sessionId?: string | null;
|
|
614
|
+
metadata?: Record<string, unknown> | null;
|
|
615
|
+
logger?: IMastraLogger;
|
|
616
|
+
}): Promise<TaskAndHistory>;
|
|
617
|
+
|
|
337
618
|
export declare namespace logs {
|
|
338
619
|
export {
|
|
339
620
|
getLogsHandler,
|
|
@@ -346,8 +627,72 @@ declare type LogsContext = {
|
|
|
346
627
|
mastra: Mastra;
|
|
347
628
|
transportId?: string;
|
|
348
629
|
runId?: string;
|
|
630
|
+
params?: {
|
|
631
|
+
fromDate?: Date;
|
|
632
|
+
toDate?: Date;
|
|
633
|
+
logLevel?: LogLevel;
|
|
634
|
+
filters?: string | string[];
|
|
635
|
+
page?: number;
|
|
636
|
+
perPage?: number;
|
|
637
|
+
};
|
|
349
638
|
};
|
|
350
639
|
|
|
640
|
+
export declare function loopStreamVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
641
|
+
runtimeContext: RuntimeContext;
|
|
642
|
+
body: {
|
|
643
|
+
message: string;
|
|
644
|
+
threadId?: string;
|
|
645
|
+
resourceId?: string;
|
|
646
|
+
maxIterations?: number;
|
|
647
|
+
};
|
|
648
|
+
}): Promise<{
|
|
649
|
+
stream: ReadableStream_3<StreamEvent>;
|
|
650
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
|
|
651
|
+
task: ZodString;
|
|
652
|
+
resourceId: ZodString;
|
|
653
|
+
resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
|
|
654
|
+
prompt: ZodString;
|
|
655
|
+
result: ZodString;
|
|
656
|
+
isComplete: ZodOptional<ZodBoolean>;
|
|
657
|
+
completionReason: ZodOptional<ZodString>;
|
|
658
|
+
iteration: ZodNumber;
|
|
659
|
+
}, "strip", ZodTypeAny, {
|
|
660
|
+
prompt: string;
|
|
661
|
+
resourceId: string;
|
|
662
|
+
result: string;
|
|
663
|
+
task: string;
|
|
664
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
665
|
+
iteration: number;
|
|
666
|
+
isComplete?: boolean | undefined;
|
|
667
|
+
completionReason?: string | undefined;
|
|
668
|
+
}, {
|
|
669
|
+
prompt: string;
|
|
670
|
+
resourceId: string;
|
|
671
|
+
result: string;
|
|
672
|
+
task: string;
|
|
673
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
674
|
+
iteration: number;
|
|
675
|
+
isComplete?: boolean | undefined;
|
|
676
|
+
completionReason?: string | undefined;
|
|
677
|
+
}>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
|
|
678
|
+
}>;
|
|
679
|
+
|
|
680
|
+
export declare function loopVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
681
|
+
runtimeContext: RuntimeContext;
|
|
682
|
+
body: {
|
|
683
|
+
message: string;
|
|
684
|
+
};
|
|
685
|
+
}): Promise<{
|
|
686
|
+
status: "success";
|
|
687
|
+
result: {
|
|
688
|
+
text: string;
|
|
689
|
+
iteration: number;
|
|
690
|
+
};
|
|
691
|
+
steps: {
|
|
692
|
+
[x: string]: StepResult<any, any, any, any> | StepResult<unknown, unknown, unknown, unknown>;
|
|
693
|
+
};
|
|
694
|
+
}>;
|
|
695
|
+
|
|
351
696
|
export declare namespace memory {
|
|
352
697
|
export {
|
|
353
698
|
getMemoryStatusHandler,
|
|
@@ -365,6 +710,8 @@ declare interface MemoryContext extends Context {
|
|
|
365
710
|
agentId?: string;
|
|
366
711
|
resourceId?: string;
|
|
367
712
|
threadId?: string;
|
|
713
|
+
networkId?: string;
|
|
714
|
+
runtimeContext?: RuntimeContext_2;
|
|
368
715
|
}
|
|
369
716
|
|
|
370
717
|
export declare namespace network {
|
|
@@ -381,6 +728,13 @@ declare interface NetworkContext extends Context {
|
|
|
381
728
|
runtimeContext: RuntimeContext;
|
|
382
729
|
}
|
|
383
730
|
|
|
731
|
+
declare interface NetworkContext_2 extends Context {
|
|
732
|
+
networkId?: string;
|
|
733
|
+
runtimeContext: RuntimeContext;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: IMastraLogger): JSONRPCResponse<null, unknown>;
|
|
737
|
+
|
|
384
738
|
declare interface QueryRequest {
|
|
385
739
|
indexName: string;
|
|
386
740
|
queryVector: number[];
|
|
@@ -395,23 +749,33 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
|
|
|
395
749
|
|
|
396
750
|
declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
397
751
|
|
|
398
|
-
export declare function
|
|
752
|
+
export declare function resumeAsyncLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
753
|
+
body: {
|
|
754
|
+
stepId: string;
|
|
755
|
+
context: any;
|
|
756
|
+
};
|
|
757
|
+
runtimeContext: RuntimeContext;
|
|
758
|
+
}): Promise<Omit<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
|
|
759
|
+
|
|
760
|
+
export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
399
761
|
body: {
|
|
400
762
|
step: string | string[];
|
|
401
763
|
resumeData?: unknown;
|
|
402
764
|
};
|
|
403
765
|
runtimeContext?: RuntimeContext_2;
|
|
404
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>,
|
|
766
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
405
767
|
|
|
406
|
-
export declare function
|
|
768
|
+
export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
407
769
|
body: {
|
|
408
770
|
stepId: string;
|
|
409
771
|
context: any;
|
|
410
772
|
};
|
|
411
773
|
runtimeContext: RuntimeContext;
|
|
412
|
-
}): Promise<
|
|
774
|
+
}): Promise<{
|
|
775
|
+
message: string;
|
|
776
|
+
}>;
|
|
413
777
|
|
|
414
|
-
export declare function
|
|
778
|
+
export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
415
779
|
body: {
|
|
416
780
|
step: string | string[];
|
|
417
781
|
resumeData?: unknown;
|
|
@@ -421,44 +785,50 @@ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId,
|
|
|
421
785
|
message: string;
|
|
422
786
|
}>;
|
|
423
787
|
|
|
424
|
-
export declare function
|
|
788
|
+
export declare function saveMessagesHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
|
|
425
789
|
body: {
|
|
426
|
-
|
|
427
|
-
context: any;
|
|
790
|
+
messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
|
|
428
791
|
};
|
|
429
|
-
|
|
792
|
+
}): Promise<MastraMessageV1[]>;
|
|
793
|
+
|
|
794
|
+
export declare function sendWorkflowRunEventHandler({ mastra, workflowId, runId, event, data, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
795
|
+
event: string;
|
|
796
|
+
data: unknown;
|
|
430
797
|
}): Promise<{
|
|
431
798
|
message: string;
|
|
432
799
|
}>;
|
|
433
800
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
801
|
+
declare type SerializedStep = {
|
|
802
|
+
id: string;
|
|
803
|
+
description: string;
|
|
804
|
+
inputSchema: string | undefined;
|
|
805
|
+
outputSchema: string | undefined;
|
|
806
|
+
resumeSchema: string | undefined;
|
|
807
|
+
suspendSchema: string | undefined;
|
|
808
|
+
};
|
|
439
809
|
|
|
440
810
|
declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
441
811
|
|
|
442
|
-
export declare function
|
|
443
|
-
inputData?: unknown;
|
|
444
|
-
runtimeContext?: RuntimeContext_2;
|
|
445
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
|
|
446
|
-
|
|
447
|
-
export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
812
|
+
export declare function startAsyncLegacyWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
448
813
|
triggerData?: unknown;
|
|
449
814
|
runtimeContext: RuntimeContext;
|
|
450
|
-
}): Promise<
|
|
815
|
+
}): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
|
|
451
816
|
|
|
452
|
-
export declare function
|
|
817
|
+
export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
453
818
|
inputData?: unknown;
|
|
454
819
|
runtimeContext?: RuntimeContext_2;
|
|
820
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
821
|
+
|
|
822
|
+
export declare function startLegacyWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
823
|
+
triggerData?: unknown;
|
|
824
|
+
runtimeContext: RuntimeContext;
|
|
455
825
|
}): Promise<{
|
|
456
826
|
message: string;
|
|
457
827
|
}>;
|
|
458
828
|
|
|
459
|
-
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId,
|
|
460
|
-
|
|
461
|
-
runtimeContext
|
|
829
|
+
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
830
|
+
inputData?: unknown;
|
|
831
|
+
runtimeContext?: RuntimeContext_2;
|
|
462
832
|
}): Promise<{
|
|
463
833
|
message: string;
|
|
464
834
|
}>;
|
|
@@ -476,18 +846,24 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
|
|
|
476
846
|
status: string;
|
|
477
847
|
message: string;
|
|
478
848
|
error: any;
|
|
849
|
+
} | {
|
|
850
|
+
status: string;
|
|
851
|
+
message: string;
|
|
852
|
+
traceCount?: undefined;
|
|
479
853
|
} | {
|
|
480
854
|
status: string;
|
|
481
855
|
message: string;
|
|
482
856
|
traceCount: number;
|
|
483
857
|
}>;
|
|
484
858
|
|
|
485
|
-
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
859
|
+
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
486
860
|
runtimeContext: RuntimeContext;
|
|
487
861
|
agentId: string;
|
|
488
862
|
body: GetBody<'stream'> & {
|
|
489
863
|
resourceid?: string;
|
|
864
|
+
runtimeContext?: string;
|
|
490
865
|
};
|
|
866
|
+
abortSignal?: AbortSignal;
|
|
491
867
|
}): Promise<Response | undefined>;
|
|
492
868
|
|
|
493
869
|
export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
|
|
@@ -497,6 +873,62 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
|
|
|
497
873
|
} & Parameters<AgentNetwork['stream']>[1];
|
|
498
874
|
}): Promise<Response>;
|
|
499
875
|
|
|
876
|
+
export declare function streamGenerateVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
877
|
+
runtimeContext: RuntimeContext;
|
|
878
|
+
body: {
|
|
879
|
+
message: string;
|
|
880
|
+
threadId?: string;
|
|
881
|
+
resourceId?: string;
|
|
882
|
+
};
|
|
883
|
+
}): Promise<{
|
|
884
|
+
stream: ReadableStream_3<StreamEvent>;
|
|
885
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
|
|
886
|
+
task: ZodString;
|
|
887
|
+
resourceId: ZodString;
|
|
888
|
+
resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
|
|
889
|
+
prompt: ZodString;
|
|
890
|
+
result: ZodString;
|
|
891
|
+
isComplete: ZodOptional<ZodBoolean>;
|
|
892
|
+
completionReason: ZodOptional<ZodString>;
|
|
893
|
+
iteration: ZodNumber;
|
|
894
|
+
threadId: ZodOptional<ZodString>;
|
|
895
|
+
threadResourceId: ZodOptional<ZodString>;
|
|
896
|
+
isOneOff: ZodBoolean;
|
|
897
|
+
}, "strip", ZodTypeAny, {
|
|
898
|
+
prompt: string;
|
|
899
|
+
resourceId: string;
|
|
900
|
+
result: string;
|
|
901
|
+
task: string;
|
|
902
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
903
|
+
iteration: number;
|
|
904
|
+
isOneOff: boolean;
|
|
905
|
+
threadId?: string | undefined;
|
|
906
|
+
threadResourceId?: string | undefined;
|
|
907
|
+
isComplete?: boolean | undefined;
|
|
908
|
+
completionReason?: string | undefined;
|
|
909
|
+
}, {
|
|
910
|
+
prompt: string;
|
|
911
|
+
resourceId: string;
|
|
912
|
+
result: string;
|
|
913
|
+
task: string;
|
|
914
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
915
|
+
iteration: number;
|
|
916
|
+
isOneOff: boolean;
|
|
917
|
+
threadId?: string | undefined;
|
|
918
|
+
threadResourceId?: string | undefined;
|
|
919
|
+
isComplete?: boolean | undefined;
|
|
920
|
+
completionReason?: string | undefined;
|
|
921
|
+
}>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
|
|
922
|
+
}>;
|
|
923
|
+
|
|
924
|
+
export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
925
|
+
inputData?: unknown;
|
|
926
|
+
runtimeContext?: RuntimeContext_2;
|
|
927
|
+
}): Promise<{
|
|
928
|
+
stream: ReadableStream_2<StreamEvent>;
|
|
929
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
930
|
+
}>;
|
|
931
|
+
|
|
500
932
|
declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
501
933
|
|
|
502
934
|
export declare namespace telemetry {
|
|
@@ -513,6 +945,8 @@ declare interface TelemetryContext extends Context {
|
|
|
513
945
|
page?: number;
|
|
514
946
|
perPage?: number;
|
|
515
947
|
attribute?: string | string[];
|
|
948
|
+
fromDate?: Date;
|
|
949
|
+
toDate?: Date;
|
|
516
950
|
};
|
|
517
951
|
}
|
|
518
952
|
|
|
@@ -561,7 +995,7 @@ export declare type UnOfficalStatusCode = UnofficialStatusCode;
|
|
|
561
995
|
*/
|
|
562
996
|
export declare type UnofficialStatusCode = -1;
|
|
563
997
|
|
|
564
|
-
export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
|
|
998
|
+
export declare function updateThreadHandler({ mastra, agentId, threadId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
|
|
565
999
|
body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
|
|
566
1000
|
}): Promise<StorageThreadType>;
|
|
567
1001
|
|
|
@@ -595,31 +1029,12 @@ declare interface VectorContext extends Context {
|
|
|
595
1029
|
vectorName?: string;
|
|
596
1030
|
}
|
|
597
1031
|
|
|
598
|
-
declare interface VNextWorkflowContext extends Context {
|
|
599
|
-
workflowId?: string;
|
|
600
|
-
runId?: string;
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
export declare namespace vNextWorkflows {
|
|
604
|
-
export {
|
|
605
|
-
getVNextWorkflowsHandler,
|
|
606
|
-
getVNextWorkflowByIdHandler,
|
|
607
|
-
getVNextWorkflowRunHandler,
|
|
608
|
-
createVNextWorkflowRunHandler,
|
|
609
|
-
startAsyncVNextWorkflowHandler,
|
|
610
|
-
startVNextWorkflowRunHandler,
|
|
611
|
-
watchVNextWorkflowHandler,
|
|
612
|
-
resumeAsyncVNextWorkflowHandler,
|
|
613
|
-
resumeVNextWorkflowHandler,
|
|
614
|
-
getVNextWorkflowRunsHandler
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
|
|
618
1032
|
export declare namespace voice {
|
|
619
1033
|
export {
|
|
620
1034
|
getSpeakersHandler,
|
|
621
1035
|
generateSpeechHandler,
|
|
622
|
-
transcribeSpeechHandler
|
|
1036
|
+
transcribeSpeechHandler,
|
|
1037
|
+
getListenerHandler
|
|
623
1038
|
}
|
|
624
1039
|
}
|
|
625
1040
|
|
|
@@ -627,27 +1042,36 @@ declare interface VoiceContext extends Context {
|
|
|
627
1042
|
agentId?: string;
|
|
628
1043
|
}
|
|
629
1044
|
|
|
630
|
-
export declare function
|
|
1045
|
+
export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
631
1046
|
|
|
632
|
-
export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<
|
|
1047
|
+
export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
633
1048
|
|
|
634
1049
|
declare interface WorkflowContext extends Context {
|
|
635
1050
|
workflowId?: string;
|
|
636
1051
|
runId?: string;
|
|
637
1052
|
}
|
|
638
1053
|
|
|
1054
|
+
declare interface WorkflowContext_3 extends Context {
|
|
1055
|
+
workflowId?: string;
|
|
1056
|
+
runId?: string;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
639
1059
|
export declare namespace workflows {
|
|
640
1060
|
export {
|
|
641
1061
|
getWorkflowsHandler,
|
|
642
1062
|
getWorkflowByIdHandler,
|
|
1063
|
+
getWorkflowRunByIdHandler,
|
|
1064
|
+
getWorkflowRunExecutionResultHandler,
|
|
1065
|
+
createWorkflowRunHandler,
|
|
643
1066
|
startAsyncWorkflowHandler,
|
|
644
|
-
getWorkflowRunHandler,
|
|
645
|
-
createRunHandler,
|
|
646
1067
|
startWorkflowRunHandler,
|
|
647
1068
|
watchWorkflowHandler,
|
|
1069
|
+
streamWorkflowHandler,
|
|
648
1070
|
resumeAsyncWorkflowHandler,
|
|
649
1071
|
resumeWorkflowHandler,
|
|
650
|
-
getWorkflowRunsHandler
|
|
1072
|
+
getWorkflowRunsHandler,
|
|
1073
|
+
cancelWorkflowRunHandler,
|
|
1074
|
+
sendWorkflowRunEventHandler
|
|
651
1075
|
}
|
|
652
1076
|
}
|
|
653
1077
|
|