@mastra/server 0.0.0-mcp-server-deploy-20250507160341 → 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 +523 -193
- package/dist/_tsup-dts-rollup.d.ts +523 -193
- 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-3XTEV33Q.js → chunk-5PQQ42EZ.js} +59 -56
- 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-AMVOS7YB.cjs → chunk-G7KH752Y.cjs} +12 -8
- 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-BPL2CBLV.js → chunk-RG473F6Y.js} +8 -4
- 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/index.cjs +0 -12
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -1
- 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 +31 -26
- 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-74DLDQTQ.cjs +0 -36
- package/dist/chunk-CHFORQ7J.cjs +0 -329
- package/dist/chunk-FOXHTOQZ.cjs +0 -324
- package/dist/chunk-HAA5T7JL.js +0 -33
- package/dist/chunk-IQTNZSFP.js +0 -312
- 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/mcp.cjs +0 -14
- package/dist/server/handlers/mcp.d.cts +0 -2
- package/dist/server/handlers/mcp.d.ts +0 -2
- package/dist/server/handlers/mcp.js +0 -1
- 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,36 +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';
|
|
5
|
-
import {
|
|
7
|
+
import type { CoreMessage as CoreMessage_2 } from '@mastra/core/llm';
|
|
8
|
+
import { DefaultEngineType } from '@mastra/core/workflows';
|
|
9
|
+
import { EvalRow } from '@mastra/core/storage';
|
|
6
10
|
import { GenerateObjectResult } from 'ai';
|
|
7
11
|
import { GenerateTextResult } from 'ai';
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
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';
|
|
20
|
+
import type { Mastra } from '@mastra/core/mastra';
|
|
21
|
+
import type { MastraError } from '@mastra/core/error';
|
|
10
22
|
import type { MastraMemory } from '@mastra/core/memory';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { NewStep } from '@mastra/core/workflows/vNext';
|
|
14
|
-
import type { NewWorkflow } from '@mastra/core/workflows/vNext';
|
|
23
|
+
import { MastraMessageV1 } from '@mastra/core/memory';
|
|
24
|
+
import type { Message } from '@mastra/core/a2a';
|
|
15
25
|
import type { QueryResult } from '@mastra/core/vector';
|
|
16
26
|
import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
17
|
-
import
|
|
27
|
+
import { ReadableStream as ReadableStream_3 } from 'stream/web';
|
|
28
|
+
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
18
29
|
import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
|
|
19
|
-
import { SerializedStepFlowEntry } from '@mastra/core/workflows
|
|
20
|
-
import { Step } from '@mastra/core';
|
|
21
|
-
import { StepExecutionContext } from '@mastra/core';
|
|
22
|
-
import { StepGraph } from '@mastra/core';
|
|
23
|
-
import {
|
|
30
|
+
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
31
|
+
import { Step } 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';
|
|
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';
|
|
24
44
|
import type { ToolAction } from '@mastra/core/tools';
|
|
45
|
+
import { UIMessage } from 'ai';
|
|
25
46
|
import type { VercelTool } from '@mastra/core/tools';
|
|
47
|
+
import type { WatchEvent } from '@mastra/core/workflows';
|
|
26
48
|
import type { Workflow } from '@mastra/core/workflows';
|
|
27
|
-
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
|
|
28
|
-
import { WorkflowResult } from '@mastra/core/workflows
|
|
29
|
-
import { WorkflowRunResult } from '@mastra/core';
|
|
49
|
+
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
|
|
50
|
+
import { WorkflowResult } from '@mastra/core/workflows';
|
|
30
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';
|
|
31
58
|
import { ZodType } from 'zod';
|
|
59
|
+
import { ZodTypeAny } from 'zod';
|
|
32
60
|
import { ZodTypeDef } from 'zod';
|
|
33
61
|
|
|
62
|
+
export declare namespace a2a {
|
|
63
|
+
export {
|
|
64
|
+
getAgentCardByIdHandler,
|
|
65
|
+
handleTaskSend,
|
|
66
|
+
handleTaskGet,
|
|
67
|
+
handleTaskSendSubscribe,
|
|
68
|
+
handleTaskCancel,
|
|
69
|
+
getAgentExecutionHandler
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
34
73
|
export declare namespace agents {
|
|
35
74
|
export {
|
|
36
75
|
getAgentsHandler,
|
|
@@ -42,17 +81,27 @@ export declare namespace agents {
|
|
|
42
81
|
}
|
|
43
82
|
}
|
|
44
83
|
|
|
45
|
-
export declare interface ApiError extends
|
|
84
|
+
export declare interface ApiError extends MastraError {
|
|
46
85
|
message: string;
|
|
47
86
|
status?: number;
|
|
48
87
|
}
|
|
49
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
|
+
|
|
50
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;
|
|
51
96
|
|
|
52
97
|
export declare interface Context {
|
|
53
|
-
mastra:
|
|
98
|
+
mastra: Mastra;
|
|
54
99
|
}
|
|
55
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
|
+
|
|
56
105
|
export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
57
106
|
index: CreateIndexRequest;
|
|
58
107
|
}): Promise<{
|
|
@@ -65,17 +114,26 @@ declare interface CreateIndexRequest {
|
|
|
65
114
|
metric?: 'cosine' | 'euclidean' | 'dotproduct';
|
|
66
115
|
}
|
|
67
116
|
|
|
68
|
-
export declare function
|
|
117
|
+
export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
69
118
|
runId: string;
|
|
70
119
|
}>;
|
|
71
120
|
|
|
72
|
-
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'> & {
|
|
73
131
|
body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
|
|
74
132
|
resourceId?: string;
|
|
75
133
|
};
|
|
76
134
|
}): Promise<StorageThreadType>;
|
|
77
135
|
|
|
78
|
-
export declare function
|
|
136
|
+
export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
79
137
|
runId: string;
|
|
80
138
|
}>;
|
|
81
139
|
|
|
@@ -85,7 +143,7 @@ export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<Vec
|
|
|
85
143
|
success: boolean;
|
|
86
144
|
}>;
|
|
87
145
|
|
|
88
|
-
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<{
|
|
89
147
|
result: string;
|
|
90
148
|
}>;
|
|
91
149
|
|
|
@@ -102,21 +160,23 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
|
|
|
102
160
|
export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
|
|
103
161
|
agentId?: string;
|
|
104
162
|
data: any;
|
|
105
|
-
runtimeContext:
|
|
163
|
+
runtimeContext: RuntimeContext_2;
|
|
106
164
|
}): Promise<any>;
|
|
107
165
|
|
|
108
166
|
export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
|
|
109
167
|
data?: unknown;
|
|
110
|
-
runtimeContext:
|
|
168
|
+
runtimeContext: RuntimeContext_2;
|
|
111
169
|
}) => Promise<any>;
|
|
112
170
|
|
|
113
|
-
export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
171
|
+
export declare function generateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
114
172
|
runtimeContext: RuntimeContext;
|
|
115
173
|
agentId: string;
|
|
116
174
|
body: GetBody<'generate'> & {
|
|
117
175
|
resourceid?: string;
|
|
176
|
+
runtimeContext?: Record<string, unknown>;
|
|
118
177
|
};
|
|
119
|
-
|
|
178
|
+
abortSignal?: AbortSignal;
|
|
179
|
+
}): Promise<GenerateTextResult<any, unknown>>;
|
|
120
180
|
|
|
121
181
|
export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
|
|
122
182
|
runtimeContext: RuntimeContext;
|
|
@@ -135,21 +195,70 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
|
|
|
135
195
|
};
|
|
136
196
|
}): Promise<NodeJS.ReadableStream>;
|
|
137
197
|
|
|
138
|
-
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;
|
|
139
214
|
runtimeContext: RuntimeContext;
|
|
140
215
|
agentId: string;
|
|
141
216
|
}): Promise<{
|
|
142
217
|
name: any;
|
|
143
218
|
instructions: string;
|
|
144
219
|
tools: any;
|
|
220
|
+
workflows: {};
|
|
145
221
|
provider: string;
|
|
146
222
|
modelId: string;
|
|
223
|
+
defaultGenerateOptions: any;
|
|
224
|
+
defaultStreamOptions: any;
|
|
147
225
|
}>;
|
|
148
226
|
|
|
149
|
-
export declare function
|
|
227
|
+
export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
|
|
150
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;
|
|
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;
|
|
151
246
|
}): Promise<any>;
|
|
152
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
|
+
|
|
153
262
|
declare type GetBody<T extends keyof Agent & {
|
|
154
263
|
[K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
|
|
155
264
|
}[keyof Agent]> = {
|
|
@@ -166,110 +275,74 @@ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agent
|
|
|
166
275
|
evals: EvalRow[];
|
|
167
276
|
}>;
|
|
168
277
|
|
|
169
|
-
export declare function
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
name:
|
|
175
|
-
|
|
176
|
-
|
|
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;
|
|
177
286
|
}>;
|
|
178
287
|
|
|
179
|
-
export declare function
|
|
288
|
+
export declare function getLegacyWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<LegacyWorkflow['getRun']>>;
|
|
180
289
|
|
|
181
|
-
export declare function
|
|
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>;
|
|
182
297
|
|
|
183
|
-
export declare function
|
|
184
|
-
transports: string[];
|
|
185
|
-
}>;
|
|
298
|
+
export declare function getLegacyWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
|
|
186
299
|
|
|
187
300
|
/**
|
|
188
|
-
*
|
|
189
|
-
* Returns details about a specific MCP server
|
|
301
|
+
* Get available listeners for an agent
|
|
190
302
|
*/
|
|
191
|
-
declare
|
|
192
|
-
|
|
193
|
-
serverId: string;
|
|
194
|
-
}) => Promise<{
|
|
195
|
-
id: string;
|
|
196
|
-
name: string;
|
|
197
|
-
version: string;
|
|
198
|
-
tools: {
|
|
199
|
-
name: string;
|
|
200
|
-
description: any;
|
|
201
|
-
parameters: any;
|
|
202
|
-
}[];
|
|
303
|
+
export declare function getListenerHandler({ mastra, agentId }: VoiceContext): Promise<{
|
|
304
|
+
enabled: boolean;
|
|
203
305
|
}>;
|
|
204
|
-
export { getMcpServerHandler }
|
|
205
|
-
export { getMcpServerHandler as getMcpServerHandler_alias_2 }
|
|
206
306
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
export declare const getMcpServerHandler_alias_1: ({ mastra, serverId }: {
|
|
212
|
-
mastra: Mastra;
|
|
213
|
-
serverId: string;
|
|
214
|
-
}) => Promise<{
|
|
215
|
-
error: string;
|
|
216
|
-
status: number;
|
|
217
|
-
id?: undefined;
|
|
218
|
-
name?: undefined;
|
|
219
|
-
version?: undefined;
|
|
220
|
-
tools?: undefined;
|
|
221
|
-
} | {
|
|
307
|
+
export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
|
|
308
|
+
runtimeContext: RuntimeContext;
|
|
309
|
+
agentId: string;
|
|
310
|
+
}): Promise<{
|
|
222
311
|
id: string;
|
|
223
|
-
name:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
name: string;
|
|
227
|
-
description: string | undefined;
|
|
228
|
-
inputSchema: string | undefined;
|
|
229
|
-
}[];
|
|
230
|
-
error?: undefined;
|
|
231
|
-
status?: undefined;
|
|
312
|
+
name: any;
|
|
313
|
+
instructions: string;
|
|
314
|
+
evals: EvalRow[];
|
|
232
315
|
}>;
|
|
233
316
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}) => Promise<{
|
|
241
|
-
servers: {
|
|
242
|
-
id: string;
|
|
243
|
-
name: string;
|
|
244
|
-
version: string;
|
|
245
|
-
tools: number;
|
|
246
|
-
}[];
|
|
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;
|
|
247
323
|
}>;
|
|
248
|
-
export { getMcpServersHandler }
|
|
249
|
-
export { getMcpServersHandler as getMcpServersHandler_alias_2 }
|
|
250
324
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
version: string;
|
|
262
|
-
tools: number;
|
|
263
|
-
}[];
|
|
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
|
+
}>;
|
|
332
|
+
|
|
333
|
+
export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
|
|
334
|
+
transports: string[];
|
|
264
335
|
}>;
|
|
265
336
|
|
|
266
|
-
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<{
|
|
267
338
|
result: boolean;
|
|
268
339
|
}>;
|
|
269
340
|
|
|
270
|
-
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<{
|
|
271
344
|
messages: CoreMessage[];
|
|
272
|
-
uiMessages:
|
|
345
|
+
uiMessages: UIMessage[];
|
|
273
346
|
}>;
|
|
274
347
|
|
|
275
348
|
export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
@@ -311,25 +384,79 @@ export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): P
|
|
|
311
384
|
|
|
312
385
|
export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
|
|
313
386
|
|
|
314
|
-
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>;
|
|
315
388
|
|
|
316
|
-
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[]>;
|
|
317
390
|
|
|
318
391
|
export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
|
|
319
392
|
|
|
320
393
|
export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
|
|
321
394
|
|
|
322
|
-
export declare function
|
|
323
|
-
|
|
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>;
|
|
324
448
|
name: string | undefined;
|
|
449
|
+
description: string | undefined;
|
|
325
450
|
stepGraph: SerializedStepFlowEntry[];
|
|
326
451
|
inputSchema: string | undefined;
|
|
327
452
|
outputSchema: string | undefined;
|
|
328
453
|
}>;
|
|
329
454
|
|
|
330
|
-
export declare function
|
|
455
|
+
export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
|
|
331
456
|
|
|
332
|
-
export declare function
|
|
457
|
+
export declare function getWorkflowRunExecutionResultHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<WatchEvent['payload']['workflowState']>;
|
|
458
|
+
|
|
459
|
+
export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
|
|
333
460
|
fromDate?: Date;
|
|
334
461
|
toDate?: Date;
|
|
335
462
|
limit?: number;
|
|
@@ -337,31 +464,53 @@ export declare function getVNextWorkflowRunsHandler({ mastra, workflowId, fromDa
|
|
|
337
464
|
resourceId?: string;
|
|
338
465
|
}): Promise<WorkflowRuns>;
|
|
339
466
|
|
|
340
|
-
export declare function
|
|
467
|
+
export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
|
|
341
468
|
|
|
342
|
-
export declare function
|
|
343
|
-
stepGraph: StepGraph;
|
|
344
|
-
stepSubscriberGraph: Record<string, StepGraph>;
|
|
345
|
-
serializedStepGraph: StepGraph;
|
|
346
|
-
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
347
|
-
name: string;
|
|
348
|
-
triggerSchema: string | undefined;
|
|
349
|
-
steps: any;
|
|
350
|
-
}>;
|
|
351
|
-
|
|
352
|
-
export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
|
|
469
|
+
export declare function handleError(error: unknown, defaultMessage: string): never;
|
|
353
470
|
|
|
354
|
-
export declare function
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}): Promise<
|
|
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>>;
|
|
361
478
|
|
|
362
|
-
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>>;
|
|
363
495
|
|
|
364
|
-
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>;
|
|
365
514
|
|
|
366
515
|
/**
|
|
367
516
|
* `HTTPException` must be used when a fatal error such as authentication failure occurs.
|
|
@@ -411,11 +560,13 @@ export declare class HTTPException extends Error {
|
|
|
411
560
|
* @property res - Optional response object to use.
|
|
412
561
|
* @property message - Optional custom error message.
|
|
413
562
|
* @property cause - Optional cause of the error.
|
|
563
|
+
* @property stack - Optional stack trace for the error.
|
|
414
564
|
*/
|
|
415
565
|
declare type HTTPExceptionOptions = {
|
|
416
566
|
res?: Response;
|
|
417
567
|
message?: string;
|
|
418
568
|
cause?: unknown;
|
|
569
|
+
stack?: string;
|
|
419
570
|
};
|
|
420
571
|
|
|
421
572
|
/**
|
|
@@ -424,8 +575,46 @@ declare type HTTPExceptionOptions = {
|
|
|
424
575
|
*/
|
|
425
576
|
declare type InfoStatusCode = 100 | 101 | 102 | 103;
|
|
426
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
|
+
|
|
427
606
|
export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
|
|
428
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
|
+
|
|
429
618
|
export declare namespace logs {
|
|
430
619
|
export {
|
|
431
620
|
getLogsHandler,
|
|
@@ -435,11 +624,75 @@ export declare namespace logs {
|
|
|
435
624
|
}
|
|
436
625
|
|
|
437
626
|
declare type LogsContext = {
|
|
438
|
-
mastra:
|
|
627
|
+
mastra: Mastra;
|
|
439
628
|
transportId?: string;
|
|
440
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
|
+
};
|
|
441
638
|
};
|
|
442
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
|
+
|
|
443
696
|
export declare namespace memory {
|
|
444
697
|
export {
|
|
445
698
|
getMemoryStatusHandler,
|
|
@@ -457,6 +710,8 @@ declare interface MemoryContext extends Context {
|
|
|
457
710
|
agentId?: string;
|
|
458
711
|
resourceId?: string;
|
|
459
712
|
threadId?: string;
|
|
713
|
+
networkId?: string;
|
|
714
|
+
runtimeContext?: RuntimeContext_2;
|
|
460
715
|
}
|
|
461
716
|
|
|
462
717
|
export declare namespace network {
|
|
@@ -473,6 +728,13 @@ declare interface NetworkContext extends Context {
|
|
|
473
728
|
runtimeContext: RuntimeContext;
|
|
474
729
|
}
|
|
475
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
|
+
|
|
476
738
|
declare interface QueryRequest {
|
|
477
739
|
indexName: string;
|
|
478
740
|
queryVector: number[];
|
|
@@ -487,23 +749,33 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
|
|
|
487
749
|
|
|
488
750
|
declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
489
751
|
|
|
490
|
-
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 & {
|
|
491
761
|
body: {
|
|
492
762
|
step: string | string[];
|
|
493
763
|
resumeData?: unknown;
|
|
494
764
|
};
|
|
495
765
|
runtimeContext?: RuntimeContext_2;
|
|
496
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>,
|
|
766
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
497
767
|
|
|
498
|
-
export declare function
|
|
768
|
+
export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
499
769
|
body: {
|
|
500
770
|
stepId: string;
|
|
501
771
|
context: any;
|
|
502
772
|
};
|
|
503
773
|
runtimeContext: RuntimeContext;
|
|
504
|
-
}): Promise<
|
|
774
|
+
}): Promise<{
|
|
775
|
+
message: string;
|
|
776
|
+
}>;
|
|
505
777
|
|
|
506
|
-
export declare function
|
|
778
|
+
export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
507
779
|
body: {
|
|
508
780
|
step: string | string[];
|
|
509
781
|
resumeData?: unknown;
|
|
@@ -513,44 +785,50 @@ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId,
|
|
|
513
785
|
message: string;
|
|
514
786
|
}>;
|
|
515
787
|
|
|
516
|
-
export declare function
|
|
788
|
+
export declare function saveMessagesHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
|
|
517
789
|
body: {
|
|
518
|
-
|
|
519
|
-
context: any;
|
|
790
|
+
messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
|
|
520
791
|
};
|
|
521
|
-
|
|
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;
|
|
522
797
|
}): Promise<{
|
|
523
798
|
message: string;
|
|
524
799
|
}>;
|
|
525
800
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
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
|
+
};
|
|
531
809
|
|
|
532
810
|
declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
533
811
|
|
|
534
|
-
export declare function
|
|
535
|
-
inputData?: unknown;
|
|
536
|
-
runtimeContext?: RuntimeContext_2;
|
|
537
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
|
|
538
|
-
|
|
539
|
-
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'> & {
|
|
540
813
|
triggerData?: unknown;
|
|
541
814
|
runtimeContext: RuntimeContext;
|
|
542
|
-
}): Promise<
|
|
815
|
+
}): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
|
|
543
816
|
|
|
544
|
-
export declare function
|
|
817
|
+
export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
545
818
|
inputData?: unknown;
|
|
546
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;
|
|
547
825
|
}): Promise<{
|
|
548
826
|
message: string;
|
|
549
827
|
}>;
|
|
550
828
|
|
|
551
|
-
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId,
|
|
552
|
-
|
|
553
|
-
runtimeContext
|
|
829
|
+
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
830
|
+
inputData?: unknown;
|
|
831
|
+
runtimeContext?: RuntimeContext_2;
|
|
554
832
|
}): Promise<{
|
|
555
833
|
message: string;
|
|
556
834
|
}>;
|
|
@@ -568,18 +846,24 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
|
|
|
568
846
|
status: string;
|
|
569
847
|
message: string;
|
|
570
848
|
error: any;
|
|
849
|
+
} | {
|
|
850
|
+
status: string;
|
|
851
|
+
message: string;
|
|
852
|
+
traceCount?: undefined;
|
|
571
853
|
} | {
|
|
572
854
|
status: string;
|
|
573
855
|
message: string;
|
|
574
856
|
traceCount: number;
|
|
575
857
|
}>;
|
|
576
858
|
|
|
577
|
-
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
859
|
+
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
578
860
|
runtimeContext: RuntimeContext;
|
|
579
861
|
agentId: string;
|
|
580
862
|
body: GetBody<'stream'> & {
|
|
581
863
|
resourceid?: string;
|
|
864
|
+
runtimeContext?: string;
|
|
582
865
|
};
|
|
866
|
+
abortSignal?: AbortSignal;
|
|
583
867
|
}): Promise<Response | undefined>;
|
|
584
868
|
|
|
585
869
|
export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
|
|
@@ -589,6 +873,62 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
|
|
|
589
873
|
} & Parameters<AgentNetwork['stream']>[1];
|
|
590
874
|
}): Promise<Response>;
|
|
591
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
|
+
|
|
592
932
|
declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
593
933
|
|
|
594
934
|
export declare namespace telemetry {
|
|
@@ -655,7 +995,7 @@ export declare type UnOfficalStatusCode = UnofficialStatusCode;
|
|
|
655
995
|
*/
|
|
656
996
|
export declare type UnofficialStatusCode = -1;
|
|
657
997
|
|
|
658
|
-
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'> & {
|
|
659
999
|
body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
|
|
660
1000
|
}): Promise<StorageThreadType>;
|
|
661
1001
|
|
|
@@ -689,31 +1029,12 @@ declare interface VectorContext extends Context {
|
|
|
689
1029
|
vectorName?: string;
|
|
690
1030
|
}
|
|
691
1031
|
|
|
692
|
-
declare interface VNextWorkflowContext extends Context {
|
|
693
|
-
workflowId?: string;
|
|
694
|
-
runId?: string;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
export declare namespace vNextWorkflows {
|
|
698
|
-
export {
|
|
699
|
-
getVNextWorkflowsHandler,
|
|
700
|
-
getVNextWorkflowByIdHandler,
|
|
701
|
-
getVNextWorkflowRunHandler,
|
|
702
|
-
createVNextWorkflowRunHandler,
|
|
703
|
-
startAsyncVNextWorkflowHandler,
|
|
704
|
-
startVNextWorkflowRunHandler,
|
|
705
|
-
watchVNextWorkflowHandler,
|
|
706
|
-
resumeAsyncVNextWorkflowHandler,
|
|
707
|
-
resumeVNextWorkflowHandler,
|
|
708
|
-
getVNextWorkflowRunsHandler
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
|
|
712
1032
|
export declare namespace voice {
|
|
713
1033
|
export {
|
|
714
1034
|
getSpeakersHandler,
|
|
715
1035
|
generateSpeechHandler,
|
|
716
|
-
transcribeSpeechHandler
|
|
1036
|
+
transcribeSpeechHandler,
|
|
1037
|
+
getListenerHandler
|
|
717
1038
|
}
|
|
718
1039
|
}
|
|
719
1040
|
|
|
@@ -721,27 +1042,36 @@ declare interface VoiceContext extends Context {
|
|
|
721
1042
|
agentId?: string;
|
|
722
1043
|
}
|
|
723
1044
|
|
|
724
|
-
export declare function
|
|
1045
|
+
export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
725
1046
|
|
|
726
|
-
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>>;
|
|
727
1048
|
|
|
728
1049
|
declare interface WorkflowContext extends Context {
|
|
729
1050
|
workflowId?: string;
|
|
730
1051
|
runId?: string;
|
|
731
1052
|
}
|
|
732
1053
|
|
|
1054
|
+
declare interface WorkflowContext_3 extends Context {
|
|
1055
|
+
workflowId?: string;
|
|
1056
|
+
runId?: string;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
733
1059
|
export declare namespace workflows {
|
|
734
1060
|
export {
|
|
735
1061
|
getWorkflowsHandler,
|
|
736
1062
|
getWorkflowByIdHandler,
|
|
1063
|
+
getWorkflowRunByIdHandler,
|
|
1064
|
+
getWorkflowRunExecutionResultHandler,
|
|
1065
|
+
createWorkflowRunHandler,
|
|
737
1066
|
startAsyncWorkflowHandler,
|
|
738
|
-
getWorkflowRunHandler,
|
|
739
|
-
createRunHandler,
|
|
740
1067
|
startWorkflowRunHandler,
|
|
741
1068
|
watchWorkflowHandler,
|
|
1069
|
+
streamWorkflowHandler,
|
|
742
1070
|
resumeAsyncWorkflowHandler,
|
|
743
1071
|
resumeWorkflowHandler,
|
|
744
|
-
getWorkflowRunsHandler
|
|
1072
|
+
getWorkflowRunsHandler,
|
|
1073
|
+
cancelWorkflowRunHandler,
|
|
1074
|
+
sendWorkflowRunEventHandler
|
|
745
1075
|
}
|
|
746
1076
|
}
|
|
747
1077
|
|