@mastra/server 0.0.0-switch-to-core-20250424015131 → 0.0.0-tool-call-parts-20250630193309
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 +541 -51
- package/dist/_tsup-dts-rollup.d.ts +541 -51
- package/dist/chunk-2BCWG3EZ.js +270 -0
- package/dist/{chunk-4JINXASC.js → chunk-55DOQLP6.js} +5 -4
- package/dist/{chunk-QN4KF3BH.cjs → chunk-57CJTIPW.cjs} +2 -2
- package/dist/{chunk-ZLBRQFDD.cjs → chunk-64U3UDTH.cjs} +2 -2
- package/dist/chunk-72LOJGUV.js +421 -0
- package/dist/chunk-75ZPJI57.cjs +9 -0
- package/dist/{chunk-7IWQE76Z.cjs → chunk-B4MQFJ7G.cjs} +16 -10
- package/dist/{chunk-WTHDCRMY.js → chunk-BFOA2QQY.js} +12 -6
- package/dist/{chunk-M56ECCHK.cjs → chunk-BNEY4P4P.cjs} +20 -19
- package/dist/{chunk-RE6YL32K.js → chunk-C7564HUT.js} +52 -30
- package/dist/{chunk-LFOBHRFO.js → chunk-E2LP4J6K.js} +69 -54
- package/dist/chunk-EP3XVEVC.cjs +278 -0
- package/dist/{chunk-5JNVY6DU.js → chunk-EWLR2PNT.js} +7 -5
- package/dist/chunk-GHC4YV6R.js +504 -0
- package/dist/{chunk-L7XE5QTW.js → chunk-H5PTF3Y4.js} +1 -1
- package/dist/chunk-IMBY5XUG.cjs +86 -0
- package/dist/chunk-L3VURYKY.cjs +435 -0
- package/dist/chunk-LI436ITD.cjs +2042 -0
- package/dist/{chunk-3AHQ5RGN.js → chunk-M5ABIP7D.js} +1 -1
- package/dist/chunk-MEGCYGBU.js +2039 -0
- package/dist/chunk-MLKGABMK.js +7 -0
- package/dist/chunk-NGHSYB5B.cjs +332 -0
- package/dist/{chunk-TRDNDNGQ.js → chunk-NYN7KFXL.js} +1 -7
- package/dist/{chunk-FV45V6WC.cjs → chunk-OCWPVYNI.cjs} +0 -7
- package/dist/chunk-QLG2PFHE.js +81 -0
- package/dist/{chunk-Q6SHQECN.js → chunk-R5VGYBV6.js} +34 -10
- package/dist/{chunk-2FJURXCL.cjs → chunk-RQ2Z56EC.cjs} +93 -55
- package/dist/chunk-SDPGVWQJ.cjs +512 -0
- package/dist/{chunk-FPIWDH5Y.cjs → chunk-VPNDC2DI.cjs} +62 -40
- package/dist/chunk-WJY57THV.cjs +118 -0
- package/dist/{chunk-RBQASTUP.js → chunk-XUIJ7WRT.js} +63 -25
- package/dist/{chunk-D3G23FP3.cjs → chunk-Z3PTO2AK.cjs} +24 -22
- 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 +21 -13
- package/dist/server/handlers/workflows.d.cts +4 -2
- package/dist/server/handlers/workflows.d.ts +4 -2
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +33 -23
- package/dist/server/handlers.d.cts +2 -0
- package/dist/server/handlers.d.ts +2 -0
- package/dist/server/handlers.js +11 -9
- package/package.json +13 -12
- package/dist/chunk-3EJZQ6TQ.js +0 -49
- package/dist/chunk-55HTWX4C.cjs +0 -93
- package/dist/chunk-5SWCVTNL.cjs +0 -5579
- package/dist/chunk-HCOPJZ4A.cjs +0 -164
- package/dist/chunk-OMN3UI6X.js +0 -5576
- package/dist/chunk-R4J7XQYU.js +0 -156
- package/dist/chunk-SKBVVI24.cjs +0 -54
- package/dist/chunk-TZK63M5N.cjs +0 -317
|
@@ -1,27 +1,73 @@
|
|
|
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';
|
|
9
21
|
import type { MastraMemory } from '@mastra/core/memory';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
22
|
+
import { MastraMessageV1 } from '@mastra/core/memory';
|
|
23
|
+
import type { Message } from '@mastra/core/a2a';
|
|
12
24
|
import type { QueryResult } from '@mastra/core/vector';
|
|
13
25
|
import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
14
|
-
import
|
|
26
|
+
import { ReadableStream as ReadableStream_3 } from 'stream/web';
|
|
27
|
+
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
28
|
+
import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
|
|
29
|
+
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
15
30
|
import { Step } from '@mastra/core/workflows';
|
|
16
|
-
import { StepExecutionContext } from '@mastra/core/workflows';
|
|
17
|
-
import { StepGraph } from '@mastra/core/workflows';
|
|
31
|
+
import { StepExecutionContext } from '@mastra/core/workflows/legacy';
|
|
32
|
+
import { StepGraph } from '@mastra/core/workflows/legacy';
|
|
33
|
+
import { StepResult } from '@mastra/core/workflows';
|
|
18
34
|
import { StorageThreadType } from '@mastra/core/memory';
|
|
35
|
+
import { StreamEvent } from '@mastra/core/workflows';
|
|
36
|
+
import { Task } from '@mastra/core/a2a';
|
|
37
|
+
import { TaskAndHistory } from '@mastra/core/a2a';
|
|
38
|
+
import type { TaskContext } from '@mastra/core/a2a';
|
|
39
|
+
import type { TaskIdParams } from '@mastra/core/a2a';
|
|
40
|
+
import type { TaskQueryParams } from '@mastra/core/a2a';
|
|
41
|
+
import type { TaskSendParams } from '@mastra/core/a2a';
|
|
42
|
+
import type { TaskStatus } from '@mastra/core/a2a';
|
|
19
43
|
import type { ToolAction } from '@mastra/core/tools';
|
|
44
|
+
import { UIMessage } from 'ai';
|
|
20
45
|
import type { VercelTool } from '@mastra/core/tools';
|
|
46
|
+
import type { WatchEvent } from '@mastra/core/workflows';
|
|
21
47
|
import type { Workflow } from '@mastra/core/workflows';
|
|
22
|
-
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
|
|
23
|
-
import {
|
|
48
|
+
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
|
|
49
|
+
import { WorkflowResult } from '@mastra/core/workflows';
|
|
24
50
|
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
51
|
+
import { ZodBoolean } from 'zod';
|
|
52
|
+
import { ZodEnum } from 'zod';
|
|
53
|
+
import { ZodNumber } from 'zod';
|
|
54
|
+
import { ZodObject } from 'zod';
|
|
55
|
+
import { ZodOptional } from 'zod';
|
|
56
|
+
import { ZodString } from 'zod';
|
|
57
|
+
import { ZodType } from 'zod';
|
|
58
|
+
import { ZodTypeAny } from 'zod';
|
|
59
|
+
import { ZodTypeDef } from 'zod';
|
|
60
|
+
|
|
61
|
+
export declare namespace a2a {
|
|
62
|
+
export {
|
|
63
|
+
getAgentCardByIdHandler,
|
|
64
|
+
handleTaskSend,
|
|
65
|
+
handleTaskGet,
|
|
66
|
+
handleTaskSendSubscribe,
|
|
67
|
+
handleTaskCancel,
|
|
68
|
+
getAgentExecutionHandler
|
|
69
|
+
}
|
|
70
|
+
}
|
|
25
71
|
|
|
26
72
|
export declare namespace agents {
|
|
27
73
|
export {
|
|
@@ -39,12 +85,18 @@ export declare interface ApiError extends Error {
|
|
|
39
85
|
status?: number;
|
|
40
86
|
}
|
|
41
87
|
|
|
88
|
+
export declare function applyUpdateToTaskAndHistory(current: TaskAndHistory, update: Omit<TaskStatus, 'timestamp'> | Artifact): TaskAndHistory;
|
|
89
|
+
|
|
42
90
|
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;
|
|
43
91
|
|
|
44
92
|
export declare interface Context {
|
|
45
93
|
mastra: Mastra;
|
|
46
94
|
}
|
|
47
95
|
|
|
96
|
+
export declare function convertToCoreMessage(message: Message): CoreMessage_2;
|
|
97
|
+
|
|
98
|
+
export declare function createErrorResponse(id: number | string | null, error: JSONRPCError<unknown>): JSONRPCResponse<null, unknown>;
|
|
99
|
+
|
|
48
100
|
export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
49
101
|
index: CreateIndexRequest;
|
|
50
102
|
}): Promise<{
|
|
@@ -57,23 +109,36 @@ declare interface CreateIndexRequest {
|
|
|
57
109
|
metric?: 'cosine' | 'euclidean' | 'dotproduct';
|
|
58
110
|
}
|
|
59
111
|
|
|
60
|
-
export declare function
|
|
112
|
+
export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
61
113
|
runId: string;
|
|
62
114
|
}>;
|
|
63
115
|
|
|
64
|
-
export declare function
|
|
116
|
+
export declare function createSuccessResponse<T>(id: number | string | null, result: T): JSONRPCResponse<T>;
|
|
117
|
+
|
|
118
|
+
export declare function createTaskContext({ task, userMessage, history, activeCancellations, }: {
|
|
119
|
+
task: Task;
|
|
120
|
+
userMessage: Message;
|
|
121
|
+
history: Message[];
|
|
122
|
+
activeCancellations: Set<string>;
|
|
123
|
+
}): TaskContext;
|
|
124
|
+
|
|
125
|
+
export declare function createThreadHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
|
|
65
126
|
body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
|
|
66
127
|
resourceId?: string;
|
|
67
128
|
};
|
|
68
129
|
}): Promise<StorageThreadType>;
|
|
69
130
|
|
|
131
|
+
export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
132
|
+
runId: string;
|
|
133
|
+
}>;
|
|
134
|
+
|
|
70
135
|
export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
71
136
|
indexName?: string;
|
|
72
137
|
}): Promise<{
|
|
73
138
|
success: boolean;
|
|
74
139
|
}>;
|
|
75
140
|
|
|
76
|
-
export declare function deleteThreadHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
|
|
141
|
+
export declare function deleteThreadHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
77
142
|
result: string;
|
|
78
143
|
}>;
|
|
79
144
|
|
|
@@ -90,21 +155,23 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
|
|
|
90
155
|
export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
|
|
91
156
|
agentId?: string;
|
|
92
157
|
data: any;
|
|
93
|
-
runtimeContext:
|
|
158
|
+
runtimeContext: RuntimeContext_2;
|
|
94
159
|
}): Promise<any>;
|
|
95
160
|
|
|
96
161
|
export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
|
|
97
162
|
data?: unknown;
|
|
98
|
-
runtimeContext:
|
|
163
|
+
runtimeContext: RuntimeContext_2;
|
|
99
164
|
}) => Promise<any>;
|
|
100
165
|
|
|
101
|
-
export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
166
|
+
export declare function generateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
102
167
|
runtimeContext: RuntimeContext;
|
|
103
168
|
agentId: string;
|
|
104
169
|
body: GetBody<'generate'> & {
|
|
105
170
|
resourceid?: string;
|
|
171
|
+
runtimeContext?: Record<string, unknown>;
|
|
106
172
|
};
|
|
107
|
-
|
|
173
|
+
abortSignal?: AbortSignal;
|
|
174
|
+
}): Promise<GenerateTextResult<any, unknown>>;
|
|
108
175
|
|
|
109
176
|
export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
|
|
110
177
|
runtimeContext: RuntimeContext;
|
|
@@ -123,17 +190,69 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
|
|
|
123
190
|
};
|
|
124
191
|
}): Promise<NodeJS.ReadableStream>;
|
|
125
192
|
|
|
126
|
-
export declare function
|
|
193
|
+
export declare function generateVNextNetworkHandler({ mastra, runtimeContext, networkId, body, }: NetworkContext_2 & {
|
|
194
|
+
runtimeContext: RuntimeContext;
|
|
195
|
+
body: {
|
|
196
|
+
message: string;
|
|
197
|
+
threadId?: string;
|
|
198
|
+
resourceId?: string;
|
|
199
|
+
};
|
|
200
|
+
}): Promise<{
|
|
201
|
+
task: string;
|
|
202
|
+
result: string;
|
|
203
|
+
resourceId: string;
|
|
204
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
205
|
+
}>;
|
|
206
|
+
|
|
207
|
+
export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, isPlayground, }: Context & {
|
|
208
|
+
isPlayground?: boolean;
|
|
209
|
+
runtimeContext: RuntimeContext;
|
|
127
210
|
agentId: string;
|
|
128
211
|
}): Promise<{
|
|
129
212
|
name: any;
|
|
130
213
|
instructions: string;
|
|
131
214
|
tools: any;
|
|
215
|
+
workflows: {};
|
|
132
216
|
provider: string;
|
|
133
217
|
modelId: string;
|
|
218
|
+
defaultGenerateOptions: any;
|
|
219
|
+
defaultStreamOptions: any;
|
|
134
220
|
}>;
|
|
135
221
|
|
|
136
|
-
export declare function
|
|
222
|
+
export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
|
|
223
|
+
runtimeContext: RuntimeContext;
|
|
224
|
+
agentId: keyof ReturnType<typeof mastra.getAgents>;
|
|
225
|
+
executionUrl?: string;
|
|
226
|
+
version?: string;
|
|
227
|
+
provider?: {
|
|
228
|
+
organization: string;
|
|
229
|
+
url: string;
|
|
230
|
+
};
|
|
231
|
+
}): Promise<AgentCard>;
|
|
232
|
+
|
|
233
|
+
export declare function getAgentExecutionHandler({ requestId, mastra, agentId, runtimeContext, method, params, taskStore, logger, }: Context & {
|
|
234
|
+
requestId: string;
|
|
235
|
+
runtimeContext: RuntimeContext;
|
|
236
|
+
agentId: string;
|
|
237
|
+
method: 'tasks/send' | 'tasks/sendSubscribe' | 'tasks/get' | 'tasks/cancel';
|
|
238
|
+
params: TaskSendParams | TaskQueryParams | TaskIdParams;
|
|
239
|
+
taskStore?: InMemoryTaskStore;
|
|
240
|
+
logger?: IMastraLogger;
|
|
241
|
+
}): Promise<any>;
|
|
242
|
+
|
|
243
|
+
export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
|
|
244
|
+
runtimeContext: RuntimeContext;
|
|
245
|
+
}): Promise<Record<string, Omit<{
|
|
246
|
+
id: string;
|
|
247
|
+
name: any;
|
|
248
|
+
instructions: string;
|
|
249
|
+
tools: any;
|
|
250
|
+
workflows: {};
|
|
251
|
+
provider: string;
|
|
252
|
+
modelId: string;
|
|
253
|
+
defaultGenerateOptions: any;
|
|
254
|
+
defaultStreamOptions: any;
|
|
255
|
+
}, "id">>>;
|
|
137
256
|
|
|
138
257
|
declare type GetBody<T extends keyof Agent & {
|
|
139
258
|
[K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
|
|
@@ -141,7 +260,8 @@ declare type GetBody<T extends keyof Agent & {
|
|
|
141
260
|
messages: Parameters<Agent[T]>[0];
|
|
142
261
|
} & Parameters<Agent[T]>[1];
|
|
143
262
|
|
|
144
|
-
export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context & {
|
|
263
|
+
export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
|
|
264
|
+
runtimeContext: RuntimeContext;
|
|
145
265
|
agentId: string;
|
|
146
266
|
}): Promise<{
|
|
147
267
|
id: string;
|
|
@@ -150,7 +270,37 @@ export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context &
|
|
|
150
270
|
evals: EvalRow[];
|
|
151
271
|
}>;
|
|
152
272
|
|
|
153
|
-
export declare function
|
|
273
|
+
export declare function getLegacyWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
|
|
274
|
+
stepGraph: StepGraph;
|
|
275
|
+
stepSubscriberGraph: Record<string, StepGraph>;
|
|
276
|
+
serializedStepGraph: StepGraph;
|
|
277
|
+
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
278
|
+
name: string;
|
|
279
|
+
triggerSchema: string | undefined;
|
|
280
|
+
steps: any;
|
|
281
|
+
}>;
|
|
282
|
+
|
|
283
|
+
export declare function getLegacyWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<LegacyWorkflow['getRun']>>;
|
|
284
|
+
|
|
285
|
+
export declare function getLegacyWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
|
|
286
|
+
fromDate?: Date;
|
|
287
|
+
toDate?: Date;
|
|
288
|
+
limit?: number;
|
|
289
|
+
offset?: number;
|
|
290
|
+
resourceId?: string;
|
|
291
|
+
}): Promise<LegacyWorkflowRuns>;
|
|
292
|
+
|
|
293
|
+
export declare function getLegacyWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Get available listeners for an agent
|
|
297
|
+
*/
|
|
298
|
+
export declare function getListenerHandler({ mastra, agentId }: VoiceContext): Promise<{
|
|
299
|
+
enabled: boolean;
|
|
300
|
+
}>;
|
|
301
|
+
|
|
302
|
+
export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
|
|
303
|
+
runtimeContext: RuntimeContext;
|
|
154
304
|
agentId: string;
|
|
155
305
|
}): Promise<{
|
|
156
306
|
id: string;
|
|
@@ -159,24 +309,38 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Contex
|
|
|
159
309
|
evals: EvalRow[];
|
|
160
310
|
}>;
|
|
161
311
|
|
|
162
|
-
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<
|
|
312
|
+
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, params, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId' | 'params'>): Promise<{
|
|
313
|
+
logs: BaseLogMessage[];
|
|
314
|
+
total: number;
|
|
315
|
+
page: number;
|
|
316
|
+
perPage: number;
|
|
317
|
+
hasMore: boolean;
|
|
318
|
+
}>;
|
|
163
319
|
|
|
164
|
-
export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<
|
|
320
|
+
export declare function getLogsHandler({ mastra, transportId, params, }: Pick<LogsContext, 'mastra' | 'transportId' | 'params'>): Promise<{
|
|
321
|
+
logs: BaseLogMessage[];
|
|
322
|
+
total: number;
|
|
323
|
+
page: number;
|
|
324
|
+
perPage: number;
|
|
325
|
+
hasMore: boolean;
|
|
326
|
+
}>;
|
|
165
327
|
|
|
166
328
|
export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
|
|
167
329
|
transports: string[];
|
|
168
330
|
}>;
|
|
169
331
|
|
|
170
|
-
export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
|
|
332
|
+
export declare function getMemoryStatusHandler({ mastra, agentId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
171
333
|
result: boolean;
|
|
172
334
|
}>;
|
|
173
335
|
|
|
174
|
-
export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>
|
|
336
|
+
export declare function getMessagesHandler({ mastra, agentId, threadId, limit, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
|
|
337
|
+
limit?: number;
|
|
338
|
+
}): Promise<{
|
|
175
339
|
messages: CoreMessage[];
|
|
176
|
-
uiMessages:
|
|
340
|
+
uiMessages: UIMessage[];
|
|
177
341
|
}>;
|
|
178
342
|
|
|
179
|
-
export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<NetworkContext, 'mastra' | 'networkId'>): Promise<{
|
|
343
|
+
export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
180
344
|
id: string;
|
|
181
345
|
name: string;
|
|
182
346
|
instructions: string;
|
|
@@ -191,7 +355,7 @@ export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<Networ
|
|
|
191
355
|
};
|
|
192
356
|
}>;
|
|
193
357
|
|
|
194
|
-
export declare function getNetworksHandler({ mastra }: Pick<NetworkContext, 'mastra'>): Promise<{
|
|
358
|
+
export declare function getNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'runtimeContext'>): Promise<{
|
|
195
359
|
id: string;
|
|
196
360
|
name: string;
|
|
197
361
|
instructions: string;
|
|
@@ -215,32 +379,133 @@ export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): P
|
|
|
215
379
|
|
|
216
380
|
export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
|
|
217
381
|
|
|
218
|
-
export declare function getThreadByIdHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<StorageThreadType>;
|
|
382
|
+
export declare function getThreadByIdHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType>;
|
|
219
383
|
|
|
220
|
-
export declare function getThreadsHandler({ mastra, agentId, resourceId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId'>): Promise<StorageThreadType[]>;
|
|
384
|
+
export declare function getThreadsHandler({ mastra, agentId, resourceId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType[]>;
|
|
221
385
|
|
|
222
386
|
export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
|
|
223
387
|
|
|
224
388
|
export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
|
|
225
389
|
|
|
226
|
-
export declare function
|
|
227
|
-
|
|
228
|
-
stepSubscriberGraph: Record<string, StepGraph>;
|
|
229
|
-
serializedStepGraph: StepGraph;
|
|
230
|
-
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
390
|
+
export declare function getVNextNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
391
|
+
id: string;
|
|
231
392
|
name: string;
|
|
232
|
-
|
|
233
|
-
|
|
393
|
+
instructions: string;
|
|
394
|
+
agents: {
|
|
395
|
+
name: string;
|
|
396
|
+
provider: string;
|
|
397
|
+
modelId: string;
|
|
398
|
+
}[];
|
|
399
|
+
workflows: {
|
|
400
|
+
name: string | undefined;
|
|
401
|
+
description: string | undefined;
|
|
402
|
+
inputSchema: string | undefined;
|
|
403
|
+
outputSchema: string | undefined;
|
|
404
|
+
}[];
|
|
405
|
+
tools: {
|
|
406
|
+
id: string;
|
|
407
|
+
description: string;
|
|
408
|
+
}[];
|
|
409
|
+
routingModel: {
|
|
410
|
+
provider: string;
|
|
411
|
+
modelId: string;
|
|
412
|
+
};
|
|
234
413
|
}>;
|
|
235
414
|
|
|
236
|
-
export declare function
|
|
415
|
+
export declare function getVNextNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'runtimeContext'>): Promise<{
|
|
416
|
+
id: string;
|
|
417
|
+
name: string;
|
|
418
|
+
instructions: string;
|
|
419
|
+
tools: {
|
|
420
|
+
id: string;
|
|
421
|
+
description: string;
|
|
422
|
+
}[];
|
|
423
|
+
agents: {
|
|
424
|
+
name: string;
|
|
425
|
+
provider: string;
|
|
426
|
+
modelId: string;
|
|
427
|
+
}[];
|
|
428
|
+
workflows: {
|
|
429
|
+
name: string | undefined;
|
|
430
|
+
description: string | undefined;
|
|
431
|
+
inputSchema: string | undefined;
|
|
432
|
+
outputSchema: string | undefined;
|
|
433
|
+
}[];
|
|
434
|
+
routingModel: {
|
|
435
|
+
provider: string;
|
|
436
|
+
modelId: string;
|
|
437
|
+
};
|
|
438
|
+
}[]>;
|
|
439
|
+
|
|
440
|
+
export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext_3): Promise<{
|
|
441
|
+
steps: SerializedStep[];
|
|
442
|
+
name: string | undefined;
|
|
443
|
+
description: string | undefined;
|
|
444
|
+
stepGraph: SerializedStepFlowEntry[];
|
|
445
|
+
inputSchema: string | undefined;
|
|
446
|
+
outputSchema: string | undefined;
|
|
447
|
+
}>;
|
|
448
|
+
|
|
449
|
+
export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
|
|
450
|
+
|
|
451
|
+
export declare function getWorkflowRunExecutionResultHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<WatchEvent['payload']['workflowState']>;
|
|
237
452
|
|
|
238
|
-
export declare function getWorkflowRunsHandler({ mastra, workflowId }:
|
|
453
|
+
export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
|
|
454
|
+
fromDate?: Date;
|
|
455
|
+
toDate?: Date;
|
|
456
|
+
limit?: number;
|
|
457
|
+
offset?: number;
|
|
458
|
+
resourceId?: string;
|
|
459
|
+
}): Promise<WorkflowRuns>;
|
|
239
460
|
|
|
240
|
-
export declare function getWorkflowsHandler({ mastra }:
|
|
461
|
+
export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
|
|
241
462
|
|
|
242
463
|
export declare function handleError(error: unknown, defaultMessage: string): never;
|
|
243
464
|
|
|
465
|
+
export declare function handleTaskCancel({ requestId, taskStore, agentId, taskId, logger, }: {
|
|
466
|
+
requestId: string;
|
|
467
|
+
taskStore: InMemoryTaskStore;
|
|
468
|
+
agentId: string;
|
|
469
|
+
taskId: string;
|
|
470
|
+
logger?: IMastraLogger;
|
|
471
|
+
}): Promise<JSONRPCResponse<Task, unknown>>;
|
|
472
|
+
|
|
473
|
+
export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }: {
|
|
474
|
+
requestId: string;
|
|
475
|
+
taskStore: InMemoryTaskStore;
|
|
476
|
+
agentId: string;
|
|
477
|
+
taskId: string;
|
|
478
|
+
}): Promise<JSONRPCResponse<TaskAndHistory, unknown>>;
|
|
479
|
+
|
|
480
|
+
export declare function handleTaskSend({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
|
|
481
|
+
requestId: string;
|
|
482
|
+
params: TaskSendParams;
|
|
483
|
+
taskStore: InMemoryTaskStore;
|
|
484
|
+
agent: Agent;
|
|
485
|
+
agentId: string;
|
|
486
|
+
logger?: IMastraLogger;
|
|
487
|
+
runtimeContext: RuntimeContext;
|
|
488
|
+
}): Promise<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown>>;
|
|
489
|
+
|
|
490
|
+
export declare function handleTaskSendSubscribe({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
|
|
491
|
+
requestId: string;
|
|
492
|
+
params: TaskSendParams;
|
|
493
|
+
taskStore: InMemoryTaskStore;
|
|
494
|
+
agent: Agent;
|
|
495
|
+
agentId: string;
|
|
496
|
+
logger?: IMastraLogger;
|
|
497
|
+
runtimeContext: RuntimeContext;
|
|
498
|
+
}): AsyncGenerator<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown> | JSONRPCResponse< {
|
|
499
|
+
state: string;
|
|
500
|
+
message: {
|
|
501
|
+
role: string;
|
|
502
|
+
parts: {
|
|
503
|
+
type: string;
|
|
504
|
+
text: string;
|
|
505
|
+
}[];
|
|
506
|
+
};
|
|
507
|
+
}, unknown>, void, unknown>;
|
|
508
|
+
|
|
244
509
|
/**
|
|
245
510
|
* `HTTPException` must be used when a fatal error such as authentication failure occurs.
|
|
246
511
|
*
|
|
@@ -302,8 +567,46 @@ declare type HTTPExceptionOptions = {
|
|
|
302
567
|
*/
|
|
303
568
|
declare type InfoStatusCode = 100 | 101 | 102 | 103;
|
|
304
569
|
|
|
570
|
+
export declare class InMemoryTaskStore {
|
|
571
|
+
private store;
|
|
572
|
+
activeCancellations: Set<string>;
|
|
573
|
+
load({ agentId, taskId }: {
|
|
574
|
+
agentId: string;
|
|
575
|
+
taskId: string;
|
|
576
|
+
}): Promise<TaskAndHistory | null>;
|
|
577
|
+
save({ agentId, data }: {
|
|
578
|
+
agentId: string;
|
|
579
|
+
data: TaskAndHistory;
|
|
580
|
+
}): Promise<void>;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
export declare namespace legacyWorkflows {
|
|
584
|
+
export {
|
|
585
|
+
getLegacyWorkflowsHandler,
|
|
586
|
+
getLegacyWorkflowByIdHandler,
|
|
587
|
+
startAsyncLegacyWorkflowHandler,
|
|
588
|
+
getLegacyWorkflowRunHandler,
|
|
589
|
+
createLegacyWorkflowRunHandler,
|
|
590
|
+
startLegacyWorkflowRunHandler,
|
|
591
|
+
watchLegacyWorkflowHandler,
|
|
592
|
+
resumeAsyncLegacyWorkflowHandler,
|
|
593
|
+
resumeLegacyWorkflowHandler,
|
|
594
|
+
getLegacyWorkflowRunsHandler
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
|
|
305
598
|
export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
|
|
306
599
|
|
|
600
|
+
export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore, message, sessionId, metadata, logger, }: {
|
|
601
|
+
agentId: string;
|
|
602
|
+
taskId: string;
|
|
603
|
+
taskStore: InMemoryTaskStore;
|
|
604
|
+
message: Message;
|
|
605
|
+
sessionId?: string | null;
|
|
606
|
+
metadata?: Record<string, unknown> | null;
|
|
607
|
+
logger?: IMastraLogger;
|
|
608
|
+
}): Promise<TaskAndHistory>;
|
|
609
|
+
|
|
307
610
|
export declare namespace logs {
|
|
308
611
|
export {
|
|
309
612
|
getLogsHandler,
|
|
@@ -316,8 +619,72 @@ declare type LogsContext = {
|
|
|
316
619
|
mastra: Mastra;
|
|
317
620
|
transportId?: string;
|
|
318
621
|
runId?: string;
|
|
622
|
+
params?: {
|
|
623
|
+
fromDate?: Date;
|
|
624
|
+
toDate?: Date;
|
|
625
|
+
logLevel?: LogLevel;
|
|
626
|
+
filters?: string | string[];
|
|
627
|
+
page?: number;
|
|
628
|
+
perPage?: number;
|
|
629
|
+
};
|
|
319
630
|
};
|
|
320
631
|
|
|
632
|
+
export declare function loopStreamVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
633
|
+
runtimeContext: RuntimeContext;
|
|
634
|
+
body: {
|
|
635
|
+
message: string;
|
|
636
|
+
threadId?: string;
|
|
637
|
+
resourceId?: string;
|
|
638
|
+
maxIterations?: number;
|
|
639
|
+
};
|
|
640
|
+
}): Promise<{
|
|
641
|
+
stream: ReadableStream_3<StreamEvent>;
|
|
642
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
|
|
643
|
+
task: ZodString;
|
|
644
|
+
resourceId: ZodString;
|
|
645
|
+
resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
|
|
646
|
+
prompt: ZodString;
|
|
647
|
+
result: ZodString;
|
|
648
|
+
isComplete: ZodOptional<ZodBoolean>;
|
|
649
|
+
completionReason: ZodOptional<ZodString>;
|
|
650
|
+
iteration: ZodNumber;
|
|
651
|
+
}, "strip", ZodTypeAny, {
|
|
652
|
+
prompt: string;
|
|
653
|
+
resourceId: string;
|
|
654
|
+
result: string;
|
|
655
|
+
task: string;
|
|
656
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
657
|
+
iteration: number;
|
|
658
|
+
isComplete?: boolean | undefined;
|
|
659
|
+
completionReason?: string | undefined;
|
|
660
|
+
}, {
|
|
661
|
+
prompt: string;
|
|
662
|
+
resourceId: string;
|
|
663
|
+
result: string;
|
|
664
|
+
task: string;
|
|
665
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
666
|
+
iteration: number;
|
|
667
|
+
isComplete?: boolean | undefined;
|
|
668
|
+
completionReason?: string | undefined;
|
|
669
|
+
}>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
|
|
670
|
+
}>;
|
|
671
|
+
|
|
672
|
+
export declare function loopVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
673
|
+
runtimeContext: RuntimeContext;
|
|
674
|
+
body: {
|
|
675
|
+
message: string;
|
|
676
|
+
};
|
|
677
|
+
}): Promise<{
|
|
678
|
+
status: "success";
|
|
679
|
+
result: {
|
|
680
|
+
text: string;
|
|
681
|
+
iteration: number;
|
|
682
|
+
};
|
|
683
|
+
steps: {
|
|
684
|
+
[x: string]: StepResult<any, any, any, any> | StepResult<unknown, unknown, unknown, unknown>;
|
|
685
|
+
};
|
|
686
|
+
}>;
|
|
687
|
+
|
|
321
688
|
export declare namespace memory {
|
|
322
689
|
export {
|
|
323
690
|
getMemoryStatusHandler,
|
|
@@ -335,6 +702,8 @@ declare interface MemoryContext extends Context {
|
|
|
335
702
|
agentId?: string;
|
|
336
703
|
resourceId?: string;
|
|
337
704
|
threadId?: string;
|
|
705
|
+
networkId?: string;
|
|
706
|
+
runtimeContext?: RuntimeContext_2;
|
|
338
707
|
}
|
|
339
708
|
|
|
340
709
|
export declare namespace network {
|
|
@@ -348,8 +717,16 @@ export declare namespace network {
|
|
|
348
717
|
|
|
349
718
|
declare interface NetworkContext extends Context {
|
|
350
719
|
networkId?: string;
|
|
720
|
+
runtimeContext: RuntimeContext;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
declare interface NetworkContext_2 extends Context {
|
|
724
|
+
networkId?: string;
|
|
725
|
+
runtimeContext: RuntimeContext;
|
|
351
726
|
}
|
|
352
727
|
|
|
728
|
+
export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: IMastraLogger): JSONRPCResponse<null, unknown>;
|
|
729
|
+
|
|
353
730
|
declare interface QueryRequest {
|
|
354
731
|
indexName: string;
|
|
355
732
|
queryVector: number[];
|
|
@@ -364,15 +741,23 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
|
|
|
364
741
|
|
|
365
742
|
declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
366
743
|
|
|
367
|
-
export declare function
|
|
744
|
+
export declare function resumeAsyncLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
368
745
|
body: {
|
|
369
746
|
stepId: string;
|
|
370
747
|
context: any;
|
|
371
748
|
};
|
|
372
749
|
runtimeContext: RuntimeContext;
|
|
373
|
-
}): Promise<Omit<
|
|
750
|
+
}): Promise<Omit<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
|
|
374
751
|
|
|
375
|
-
export declare function
|
|
752
|
+
export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
753
|
+
body: {
|
|
754
|
+
step: string | string[];
|
|
755
|
+
resumeData?: unknown;
|
|
756
|
+
};
|
|
757
|
+
runtimeContext?: RuntimeContext_2;
|
|
758
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
759
|
+
|
|
760
|
+
export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
376
761
|
body: {
|
|
377
762
|
stepId: string;
|
|
378
763
|
context: any;
|
|
@@ -382,26 +767,57 @@ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body,
|
|
|
382
767
|
message: string;
|
|
383
768
|
}>;
|
|
384
769
|
|
|
385
|
-
export declare function
|
|
770
|
+
export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
771
|
+
body: {
|
|
772
|
+
step: string | string[];
|
|
773
|
+
resumeData?: unknown;
|
|
774
|
+
};
|
|
775
|
+
runtimeContext?: RuntimeContext_2;
|
|
776
|
+
}): Promise<{
|
|
777
|
+
message: string;
|
|
778
|
+
}>;
|
|
779
|
+
|
|
780
|
+
export declare function saveMessagesHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
|
|
386
781
|
body: {
|
|
387
782
|
messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
|
|
388
783
|
};
|
|
389
|
-
}): Promise<
|
|
784
|
+
}): Promise<MastraMessageV1[]>;
|
|
785
|
+
|
|
786
|
+
declare type SerializedStep = {
|
|
787
|
+
id: string;
|
|
788
|
+
description: string;
|
|
789
|
+
inputSchema: string | undefined;
|
|
790
|
+
outputSchema: string | undefined;
|
|
791
|
+
resumeSchema: string | undefined;
|
|
792
|
+
suspendSchema: string | undefined;
|
|
793
|
+
};
|
|
390
794
|
|
|
391
795
|
declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
392
796
|
|
|
393
|
-
export declare function
|
|
797
|
+
export declare function startAsyncLegacyWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
394
798
|
triggerData?: unknown;
|
|
395
799
|
runtimeContext: RuntimeContext;
|
|
396
|
-
}): Promise<
|
|
800
|
+
}): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
|
|
801
|
+
|
|
802
|
+
export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
803
|
+
inputData?: unknown;
|
|
804
|
+
runtimeContext?: RuntimeContext_2;
|
|
805
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
397
806
|
|
|
398
|
-
export declare function
|
|
807
|
+
export declare function startLegacyWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
399
808
|
triggerData?: unknown;
|
|
400
809
|
runtimeContext: RuntimeContext;
|
|
401
810
|
}): Promise<{
|
|
402
811
|
message: string;
|
|
403
812
|
}>;
|
|
404
813
|
|
|
814
|
+
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
815
|
+
inputData?: unknown;
|
|
816
|
+
runtimeContext?: RuntimeContext_2;
|
|
817
|
+
}): Promise<{
|
|
818
|
+
message: string;
|
|
819
|
+
}>;
|
|
820
|
+
|
|
405
821
|
/**
|
|
406
822
|
* If you want to use an unofficial status, use `UnofficialStatusCode`.
|
|
407
823
|
*/
|
|
@@ -415,18 +831,24 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
|
|
|
415
831
|
status: string;
|
|
416
832
|
message: string;
|
|
417
833
|
error: any;
|
|
834
|
+
} | {
|
|
835
|
+
status: string;
|
|
836
|
+
message: string;
|
|
837
|
+
traceCount?: undefined;
|
|
418
838
|
} | {
|
|
419
839
|
status: string;
|
|
420
840
|
message: string;
|
|
421
841
|
traceCount: number;
|
|
422
842
|
}>;
|
|
423
843
|
|
|
424
|
-
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
844
|
+
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
425
845
|
runtimeContext: RuntimeContext;
|
|
426
846
|
agentId: string;
|
|
427
847
|
body: GetBody<'stream'> & {
|
|
428
848
|
resourceid?: string;
|
|
849
|
+
runtimeContext?: string;
|
|
429
850
|
};
|
|
851
|
+
abortSignal?: AbortSignal;
|
|
430
852
|
}): Promise<Response | undefined>;
|
|
431
853
|
|
|
432
854
|
export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
|
|
@@ -436,6 +858,62 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
|
|
|
436
858
|
} & Parameters<AgentNetwork['stream']>[1];
|
|
437
859
|
}): Promise<Response>;
|
|
438
860
|
|
|
861
|
+
export declare function streamGenerateVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
862
|
+
runtimeContext: RuntimeContext;
|
|
863
|
+
body: {
|
|
864
|
+
message: string;
|
|
865
|
+
threadId?: string;
|
|
866
|
+
resourceId?: string;
|
|
867
|
+
};
|
|
868
|
+
}): Promise<{
|
|
869
|
+
stream: ReadableStream_3<StreamEvent>;
|
|
870
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
|
|
871
|
+
task: ZodString;
|
|
872
|
+
resourceId: ZodString;
|
|
873
|
+
resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
|
|
874
|
+
prompt: ZodString;
|
|
875
|
+
result: ZodString;
|
|
876
|
+
isComplete: ZodOptional<ZodBoolean>;
|
|
877
|
+
completionReason: ZodOptional<ZodString>;
|
|
878
|
+
iteration: ZodNumber;
|
|
879
|
+
threadId: ZodOptional<ZodString>;
|
|
880
|
+
threadResourceId: ZodOptional<ZodString>;
|
|
881
|
+
isOneOff: ZodBoolean;
|
|
882
|
+
}, "strip", ZodTypeAny, {
|
|
883
|
+
prompt: string;
|
|
884
|
+
resourceId: string;
|
|
885
|
+
result: string;
|
|
886
|
+
task: string;
|
|
887
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
888
|
+
iteration: number;
|
|
889
|
+
isOneOff: boolean;
|
|
890
|
+
threadId?: string | undefined;
|
|
891
|
+
threadResourceId?: string | undefined;
|
|
892
|
+
isComplete?: boolean | undefined;
|
|
893
|
+
completionReason?: string | undefined;
|
|
894
|
+
}, {
|
|
895
|
+
prompt: string;
|
|
896
|
+
resourceId: string;
|
|
897
|
+
result: string;
|
|
898
|
+
task: string;
|
|
899
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
900
|
+
iteration: number;
|
|
901
|
+
isOneOff: boolean;
|
|
902
|
+
threadId?: string | undefined;
|
|
903
|
+
threadResourceId?: string | undefined;
|
|
904
|
+
isComplete?: boolean | undefined;
|
|
905
|
+
completionReason?: string | undefined;
|
|
906
|
+
}>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
|
|
907
|
+
}>;
|
|
908
|
+
|
|
909
|
+
export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
910
|
+
inputData?: unknown;
|
|
911
|
+
runtimeContext?: RuntimeContext_2;
|
|
912
|
+
}): Promise<{
|
|
913
|
+
stream: ReadableStream_2<StreamEvent>;
|
|
914
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
915
|
+
}>;
|
|
916
|
+
|
|
439
917
|
declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
440
918
|
|
|
441
919
|
export declare namespace telemetry {
|
|
@@ -452,6 +930,8 @@ declare interface TelemetryContext extends Context {
|
|
|
452
930
|
page?: number;
|
|
453
931
|
perPage?: number;
|
|
454
932
|
attribute?: string | string[];
|
|
933
|
+
fromDate?: Date;
|
|
934
|
+
toDate?: Date;
|
|
455
935
|
};
|
|
456
936
|
}
|
|
457
937
|
|
|
@@ -500,7 +980,7 @@ export declare type UnOfficalStatusCode = UnofficialStatusCode;
|
|
|
500
980
|
*/
|
|
501
981
|
export declare type UnofficialStatusCode = -1;
|
|
502
982
|
|
|
503
|
-
export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
|
|
983
|
+
export declare function updateThreadHandler({ mastra, agentId, threadId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
|
|
504
984
|
body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
|
|
505
985
|
}): Promise<StorageThreadType>;
|
|
506
986
|
|
|
@@ -538,7 +1018,8 @@ export declare namespace voice {
|
|
|
538
1018
|
export {
|
|
539
1019
|
getSpeakersHandler,
|
|
540
1020
|
generateSpeechHandler,
|
|
541
|
-
transcribeSpeechHandler
|
|
1021
|
+
transcribeSpeechHandler,
|
|
1022
|
+
getListenerHandler
|
|
542
1023
|
}
|
|
543
1024
|
}
|
|
544
1025
|
|
|
@@ -546,22 +1027,31 @@ declare interface VoiceContext extends Context {
|
|
|
546
1027
|
agentId?: string;
|
|
547
1028
|
}
|
|
548
1029
|
|
|
549
|
-
export declare function
|
|
1030
|
+
export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
1031
|
+
|
|
1032
|
+
export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
550
1033
|
|
|
551
1034
|
declare interface WorkflowContext extends Context {
|
|
552
1035
|
workflowId?: string;
|
|
553
1036
|
runId?: string;
|
|
554
1037
|
}
|
|
555
1038
|
|
|
1039
|
+
declare interface WorkflowContext_3 extends Context {
|
|
1040
|
+
workflowId?: string;
|
|
1041
|
+
runId?: string;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
556
1044
|
export declare namespace workflows {
|
|
557
1045
|
export {
|
|
558
1046
|
getWorkflowsHandler,
|
|
559
1047
|
getWorkflowByIdHandler,
|
|
1048
|
+
getWorkflowRunByIdHandler,
|
|
1049
|
+
getWorkflowRunExecutionResultHandler,
|
|
1050
|
+
createWorkflowRunHandler,
|
|
560
1051
|
startAsyncWorkflowHandler,
|
|
561
|
-
getWorkflowRunHandler,
|
|
562
|
-
createRunHandler,
|
|
563
1052
|
startWorkflowRunHandler,
|
|
564
1053
|
watchWorkflowHandler,
|
|
1054
|
+
streamWorkflowHandler,
|
|
565
1055
|
resumeAsyncWorkflowHandler,
|
|
566
1056
|
resumeWorkflowHandler,
|
|
567
1057
|
getWorkflowRunsHandler
|