@mastra/server 0.0.0-trigger-playground-ui-package-20250506151043 → 0.0.0-tsconfig-compile-20250703214351
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 +517 -107
- package/dist/_tsup-dts-rollup.d.ts +517 -107
- 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/server/handlers/a2a.cjs +30 -0
- package/dist/server/handlers/a2a.d.cts +6 -0
- package/dist/server/handlers/a2a.d.ts +6 -0
- package/dist/server/handlers/a2a.js +1 -0
- package/dist/server/handlers/agents.cjs +7 -7
- package/dist/server/handlers/agents.js +1 -1
- package/dist/server/handlers/error.cjs +2 -2
- package/dist/server/handlers/error.js +1 -1
- package/dist/server/handlers/legacyWorkflows.cjs +46 -0
- package/dist/server/handlers/legacyWorkflows.d.cts +10 -0
- package/dist/server/handlers/legacyWorkflows.d.ts +10 -0
- package/dist/server/handlers/legacyWorkflows.js +1 -0
- package/dist/server/handlers/logs.cjs +4 -4
- package/dist/server/handlers/logs.js +1 -1
- package/dist/server/handlers/memory.cjs +9 -9
- package/dist/server/handlers/memory.js +1 -1
- package/dist/server/handlers/network.cjs +5 -5
- package/dist/server/handlers/network.js +1 -1
- package/dist/server/handlers/telemetry.cjs +3 -3
- package/dist/server/handlers/telemetry.js +1 -1
- package/dist/server/handlers/tools.cjs +5 -5
- package/dist/server/handlers/tools.js +1 -1
- package/dist/server/handlers/utils.cjs +2 -2
- package/dist/server/handlers/utils.js +1 -1
- package/dist/server/handlers/vNextNetwork.cjs +218 -0
- package/dist/server/handlers/vNextNetwork.d.cts +6 -0
- package/dist/server/handlers/vNextNetwork.d.ts +6 -0
- package/dist/server/handlers/vNextNetwork.js +211 -0
- package/dist/server/handlers/vector.cjs +7 -7
- package/dist/server/handlers/vector.js +1 -1
- package/dist/server/handlers/voice.cjs +8 -4
- package/dist/server/handlers/voice.d.cts +1 -0
- package/dist/server/handlers/voice.d.ts +1 -0
- package/dist/server/handlers/voice.js +1 -1
- package/dist/server/handlers/workflows.cjs +29 -13
- package/dist/server/handlers/workflows.d.cts +6 -2
- package/dist/server/handlers/workflows.d.ts +6 -2
- package/dist/server/handlers/workflows.js +1 -1
- package/dist/server/handlers.cjs +32 -27
- package/dist/server/handlers.d.cts +2 -1
- package/dist/server/handlers.d.ts +2 -1
- package/dist/server/handlers.js +11 -10
- package/package.json +14 -13
- package/dist/chunk-3AHQ5RGN.js +0 -11
- package/dist/chunk-3EJZQ6TQ.js +0 -49
- package/dist/chunk-4BIX6GMY.cjs +0 -189
- package/dist/chunk-55HTWX4C.cjs +0 -93
- package/dist/chunk-5SWCVTNL.cjs +0 -5579
- package/dist/chunk-CHFORQ7J.cjs +0 -329
- package/dist/chunk-M2RXDCPV.cjs +0 -324
- package/dist/chunk-OMN3UI6X.js +0 -5576
- package/dist/chunk-OWNA6I2H.js +0 -312
- package/dist/chunk-SKBVVI24.cjs +0 -54
- package/dist/chunk-ZLBRQFDD.cjs +0 -13
- package/dist/server/handlers/vNextWorkflows.cjs +0 -46
- package/dist/server/handlers/vNextWorkflows.d.cts +0 -10
- package/dist/server/handlers/vNextWorkflows.d.ts +0 -10
- package/dist/server/handlers/vNextWorkflows.js +0 -1
|
@@ -1,35 +1,75 @@
|
|
|
1
1
|
import type { Agent } from '@mastra/core/agent';
|
|
2
|
+
import type { AgentCard } from '@mastra/core/a2a';
|
|
2
3
|
import type { AgentNetwork } from '@mastra/core/network';
|
|
4
|
+
import type { Artifact } from '@mastra/core/a2a';
|
|
3
5
|
import type { BaseLogMessage } from '@mastra/core/logger';
|
|
4
6
|
import { CoreMessage } from 'ai';
|
|
7
|
+
import type { CoreMessage as CoreMessage_2 } from '@mastra/core/llm';
|
|
8
|
+
import { DefaultEngineType } from '@mastra/core/workflows';
|
|
5
9
|
import { EvalRow } from '@mastra/core/storage';
|
|
6
10
|
import { GenerateObjectResult } from 'ai';
|
|
7
11
|
import { GenerateTextResult } from 'ai';
|
|
12
|
+
import type { IMastraLogger } from '@mastra/core/logger';
|
|
13
|
+
import type { JSONRPCError } from '@mastra/core/a2a';
|
|
14
|
+
import { JSONRPCResponse } from '@mastra/core/a2a';
|
|
15
|
+
import { LegacyStep } from '@mastra/core/workflows/legacy';
|
|
16
|
+
import type { LegacyWorkflow } from '@mastra/core/workflows/legacy';
|
|
17
|
+
import { LegacyWorkflowRunResult } from '@mastra/core/workflows/legacy';
|
|
18
|
+
import type { LegacyWorkflowRuns } from '@mastra/core/storage';
|
|
19
|
+
import type { LogLevel } from '@mastra/core/logger';
|
|
8
20
|
import type { Mastra } from '@mastra/core/mastra';
|
|
21
|
+
import type { MastraError } from '@mastra/core/error';
|
|
9
22
|
import type { MastraMemory } from '@mastra/core/memory';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { NewStep } from '@mastra/core/workflows/vNext';
|
|
13
|
-
import type { NewWorkflow } from '@mastra/core/workflows/vNext';
|
|
23
|
+
import { MastraMessageV1 } from '@mastra/core/memory';
|
|
24
|
+
import type { Message } from '@mastra/core/a2a';
|
|
14
25
|
import type { QueryResult } from '@mastra/core/vector';
|
|
15
26
|
import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
16
|
-
import
|
|
27
|
+
import { ReadableStream as ReadableStream_3 } from 'stream/web';
|
|
28
|
+
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
17
29
|
import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
|
|
18
|
-
import { SerializedStepFlowEntry } from '@mastra/core/workflows
|
|
30
|
+
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
19
31
|
import { Step } from '@mastra/core/workflows';
|
|
20
|
-
import { StepExecutionContext } from '@mastra/core/workflows';
|
|
21
|
-
import { StepGraph } from '@mastra/core/workflows';
|
|
32
|
+
import { StepExecutionContext } from '@mastra/core/workflows/legacy';
|
|
33
|
+
import { StepGraph } from '@mastra/core/workflows/legacy';
|
|
34
|
+
import { StepResult } from '@mastra/core/workflows';
|
|
22
35
|
import { StorageThreadType } from '@mastra/core/memory';
|
|
36
|
+
import { StreamEvent } from '@mastra/core/workflows';
|
|
37
|
+
import { Task } from '@mastra/core/a2a';
|
|
38
|
+
import { TaskAndHistory } from '@mastra/core/a2a';
|
|
39
|
+
import type { TaskContext } from '@mastra/core/a2a';
|
|
40
|
+
import type { TaskIdParams } from '@mastra/core/a2a';
|
|
41
|
+
import type { TaskQueryParams } from '@mastra/core/a2a';
|
|
42
|
+
import type { TaskSendParams } from '@mastra/core/a2a';
|
|
43
|
+
import type { TaskStatus } from '@mastra/core/a2a';
|
|
23
44
|
import type { ToolAction } from '@mastra/core/tools';
|
|
45
|
+
import { UIMessage } from 'ai';
|
|
24
46
|
import type { VercelTool } from '@mastra/core/tools';
|
|
47
|
+
import type { WatchEvent } from '@mastra/core/workflows';
|
|
25
48
|
import type { Workflow } from '@mastra/core/workflows';
|
|
26
|
-
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
|
|
27
|
-
import { WorkflowResult } from '@mastra/core/workflows
|
|
28
|
-
import { WorkflowRunResult } from '@mastra/core/workflows';
|
|
49
|
+
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
|
|
50
|
+
import { WorkflowResult } from '@mastra/core/workflows';
|
|
29
51
|
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
52
|
+
import { ZodBoolean } from 'zod';
|
|
53
|
+
import { ZodEnum } from 'zod';
|
|
54
|
+
import { ZodNumber } from 'zod';
|
|
55
|
+
import { ZodObject } from 'zod';
|
|
56
|
+
import { ZodOptional } from 'zod';
|
|
57
|
+
import { ZodString } from 'zod';
|
|
30
58
|
import { ZodType } from 'zod';
|
|
59
|
+
import { ZodTypeAny } from 'zod';
|
|
31
60
|
import { ZodTypeDef } from 'zod';
|
|
32
61
|
|
|
62
|
+
export declare namespace a2a {
|
|
63
|
+
export {
|
|
64
|
+
getAgentCardByIdHandler,
|
|
65
|
+
handleTaskSend,
|
|
66
|
+
handleTaskGet,
|
|
67
|
+
handleTaskSendSubscribe,
|
|
68
|
+
handleTaskCancel,
|
|
69
|
+
getAgentExecutionHandler
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
33
73
|
export declare namespace agents {
|
|
34
74
|
export {
|
|
35
75
|
getAgentsHandler,
|
|
@@ -41,17 +81,27 @@ export declare namespace agents {
|
|
|
41
81
|
}
|
|
42
82
|
}
|
|
43
83
|
|
|
44
|
-
export declare interface ApiError extends
|
|
84
|
+
export declare interface ApiError extends MastraError {
|
|
45
85
|
message: string;
|
|
46
86
|
status?: number;
|
|
47
87
|
}
|
|
48
88
|
|
|
89
|
+
export declare function applyUpdateToTaskAndHistory(current: TaskAndHistory, update: Omit<TaskStatus, 'timestamp'> | Artifact): TaskAndHistory;
|
|
90
|
+
|
|
91
|
+
export declare function cancelWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
92
|
+
message: string;
|
|
93
|
+
}>;
|
|
94
|
+
|
|
49
95
|
declare type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
|
|
50
96
|
|
|
51
97
|
export declare interface Context {
|
|
52
98
|
mastra: Mastra;
|
|
53
99
|
}
|
|
54
100
|
|
|
101
|
+
export declare function convertToCoreMessage(message: Message): CoreMessage_2;
|
|
102
|
+
|
|
103
|
+
export declare function createErrorResponse(id: number | string | null, error: JSONRPCError<unknown>): JSONRPCResponse<null, unknown>;
|
|
104
|
+
|
|
55
105
|
export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
56
106
|
index: CreateIndexRequest;
|
|
57
107
|
}): Promise<{
|
|
@@ -64,17 +114,26 @@ declare interface CreateIndexRequest {
|
|
|
64
114
|
metric?: 'cosine' | 'euclidean' | 'dotproduct';
|
|
65
115
|
}
|
|
66
116
|
|
|
67
|
-
export declare function
|
|
117
|
+
export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
68
118
|
runId: string;
|
|
69
119
|
}>;
|
|
70
120
|
|
|
71
|
-
export declare function
|
|
121
|
+
export declare function createSuccessResponse<T>(id: number | string | null, result: T): JSONRPCResponse<T>;
|
|
122
|
+
|
|
123
|
+
export declare function createTaskContext({ task, userMessage, history, activeCancellations, }: {
|
|
124
|
+
task: Task;
|
|
125
|
+
userMessage: Message;
|
|
126
|
+
history: Message[];
|
|
127
|
+
activeCancellations: Set<string>;
|
|
128
|
+
}): TaskContext;
|
|
129
|
+
|
|
130
|
+
export declare function createThreadHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
|
|
72
131
|
body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
|
|
73
132
|
resourceId?: string;
|
|
74
133
|
};
|
|
75
134
|
}): Promise<StorageThreadType>;
|
|
76
135
|
|
|
77
|
-
export declare function
|
|
136
|
+
export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
78
137
|
runId: string;
|
|
79
138
|
}>;
|
|
80
139
|
|
|
@@ -84,7 +143,7 @@ export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<Vec
|
|
|
84
143
|
success: boolean;
|
|
85
144
|
}>;
|
|
86
145
|
|
|
87
|
-
export declare function deleteThreadHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
|
|
146
|
+
export declare function deleteThreadHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
88
147
|
result: string;
|
|
89
148
|
}>;
|
|
90
149
|
|
|
@@ -101,21 +160,23 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
|
|
|
101
160
|
export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
|
|
102
161
|
agentId?: string;
|
|
103
162
|
data: any;
|
|
104
|
-
runtimeContext:
|
|
163
|
+
runtimeContext: RuntimeContext_2;
|
|
105
164
|
}): Promise<any>;
|
|
106
165
|
|
|
107
166
|
export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
|
|
108
167
|
data?: unknown;
|
|
109
|
-
runtimeContext:
|
|
168
|
+
runtimeContext: RuntimeContext_2;
|
|
110
169
|
}) => Promise<any>;
|
|
111
170
|
|
|
112
|
-
export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
171
|
+
export declare function generateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
113
172
|
runtimeContext: RuntimeContext;
|
|
114
173
|
agentId: string;
|
|
115
174
|
body: GetBody<'generate'> & {
|
|
116
175
|
resourceid?: string;
|
|
176
|
+
runtimeContext?: Record<string, unknown>;
|
|
117
177
|
};
|
|
118
|
-
|
|
178
|
+
abortSignal?: AbortSignal;
|
|
179
|
+
}): Promise<GenerateTextResult<any, unknown>>;
|
|
119
180
|
|
|
120
181
|
export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
|
|
121
182
|
runtimeContext: RuntimeContext;
|
|
@@ -134,21 +195,70 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
|
|
|
134
195
|
};
|
|
135
196
|
}): Promise<NodeJS.ReadableStream>;
|
|
136
197
|
|
|
137
|
-
export declare function
|
|
198
|
+
export declare function generateVNextNetworkHandler({ mastra, runtimeContext, networkId, body, }: NetworkContext_2 & {
|
|
199
|
+
runtimeContext: RuntimeContext;
|
|
200
|
+
body: {
|
|
201
|
+
message: string;
|
|
202
|
+
threadId?: string;
|
|
203
|
+
resourceId?: string;
|
|
204
|
+
};
|
|
205
|
+
}): Promise<{
|
|
206
|
+
task: string;
|
|
207
|
+
result: string;
|
|
208
|
+
resourceId: string;
|
|
209
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
210
|
+
}>;
|
|
211
|
+
|
|
212
|
+
export declare function getAgentByIdHandler({ mastra, runtimeContext, agentId, isPlayground, }: Context & {
|
|
213
|
+
isPlayground?: boolean;
|
|
138
214
|
runtimeContext: RuntimeContext;
|
|
139
215
|
agentId: string;
|
|
140
216
|
}): Promise<{
|
|
141
217
|
name: any;
|
|
142
218
|
instructions: string;
|
|
143
219
|
tools: any;
|
|
220
|
+
workflows: {};
|
|
144
221
|
provider: string;
|
|
145
222
|
modelId: string;
|
|
223
|
+
defaultGenerateOptions: any;
|
|
224
|
+
defaultStreamOptions: any;
|
|
146
225
|
}>;
|
|
147
226
|
|
|
148
|
-
export declare function
|
|
227
|
+
export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
|
|
228
|
+
runtimeContext: RuntimeContext;
|
|
229
|
+
agentId: keyof ReturnType<typeof mastra.getAgents>;
|
|
230
|
+
executionUrl?: string;
|
|
231
|
+
version?: string;
|
|
232
|
+
provider?: {
|
|
233
|
+
organization: string;
|
|
234
|
+
url: string;
|
|
235
|
+
};
|
|
236
|
+
}): Promise<AgentCard>;
|
|
237
|
+
|
|
238
|
+
export declare function getAgentExecutionHandler({ requestId, mastra, agentId, runtimeContext, method, params, taskStore, logger, }: Context & {
|
|
239
|
+
requestId: string;
|
|
149
240
|
runtimeContext: RuntimeContext;
|
|
241
|
+
agentId: string;
|
|
242
|
+
method: 'tasks/send' | 'tasks/sendSubscribe' | 'tasks/get' | 'tasks/cancel';
|
|
243
|
+
params: TaskSendParams | TaskQueryParams | TaskIdParams;
|
|
244
|
+
taskStore?: InMemoryTaskStore;
|
|
245
|
+
logger?: IMastraLogger;
|
|
150
246
|
}): Promise<any>;
|
|
151
247
|
|
|
248
|
+
export declare function getAgentsHandler({ mastra, runtimeContext }: Context & {
|
|
249
|
+
runtimeContext: RuntimeContext;
|
|
250
|
+
}): Promise<Record<string, Omit<{
|
|
251
|
+
id: string;
|
|
252
|
+
name: any;
|
|
253
|
+
instructions: string;
|
|
254
|
+
tools: any;
|
|
255
|
+
workflows: {};
|
|
256
|
+
provider: string;
|
|
257
|
+
modelId: string;
|
|
258
|
+
defaultGenerateOptions: any;
|
|
259
|
+
defaultStreamOptions: any;
|
|
260
|
+
}, "id">>>;
|
|
261
|
+
|
|
152
262
|
declare type GetBody<T extends keyof Agent & {
|
|
153
263
|
[K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
|
|
154
264
|
}[keyof Agent]> = {
|
|
@@ -165,6 +275,35 @@ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agent
|
|
|
165
275
|
evals: EvalRow[];
|
|
166
276
|
}>;
|
|
167
277
|
|
|
278
|
+
export declare function getLegacyWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
|
|
279
|
+
stepGraph: StepGraph;
|
|
280
|
+
stepSubscriberGraph: Record<string, StepGraph>;
|
|
281
|
+
serializedStepGraph: StepGraph;
|
|
282
|
+
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
283
|
+
name: string;
|
|
284
|
+
triggerSchema: string | undefined;
|
|
285
|
+
steps: any;
|
|
286
|
+
}>;
|
|
287
|
+
|
|
288
|
+
export declare function getLegacyWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<LegacyWorkflow['getRun']>>;
|
|
289
|
+
|
|
290
|
+
export declare function getLegacyWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext & {
|
|
291
|
+
fromDate?: Date;
|
|
292
|
+
toDate?: Date;
|
|
293
|
+
limit?: number;
|
|
294
|
+
offset?: number;
|
|
295
|
+
resourceId?: string;
|
|
296
|
+
}): Promise<LegacyWorkflowRuns>;
|
|
297
|
+
|
|
298
|
+
export declare function getLegacyWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Get available listeners for an agent
|
|
302
|
+
*/
|
|
303
|
+
export declare function getListenerHandler({ mastra, agentId }: VoiceContext): Promise<{
|
|
304
|
+
enabled: boolean;
|
|
305
|
+
}>;
|
|
306
|
+
|
|
168
307
|
export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
|
|
169
308
|
runtimeContext: RuntimeContext;
|
|
170
309
|
agentId: string;
|
|
@@ -175,21 +314,35 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, a
|
|
|
175
314
|
evals: EvalRow[];
|
|
176
315
|
}>;
|
|
177
316
|
|
|
178
|
-
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<
|
|
317
|
+
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, params, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId' | 'params'>): Promise<{
|
|
318
|
+
logs: BaseLogMessage[];
|
|
319
|
+
total: number;
|
|
320
|
+
page: number;
|
|
321
|
+
perPage: number;
|
|
322
|
+
hasMore: boolean;
|
|
323
|
+
}>;
|
|
179
324
|
|
|
180
|
-
export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<
|
|
325
|
+
export declare function getLogsHandler({ mastra, transportId, params, }: Pick<LogsContext, 'mastra' | 'transportId' | 'params'>): Promise<{
|
|
326
|
+
logs: BaseLogMessage[];
|
|
327
|
+
total: number;
|
|
328
|
+
page: number;
|
|
329
|
+
perPage: number;
|
|
330
|
+
hasMore: boolean;
|
|
331
|
+
}>;
|
|
181
332
|
|
|
182
333
|
export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
|
|
183
334
|
transports: string[];
|
|
184
335
|
}>;
|
|
185
336
|
|
|
186
|
-
export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
|
|
337
|
+
export declare function getMemoryStatusHandler({ mastra, agentId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
187
338
|
result: boolean;
|
|
188
339
|
}>;
|
|
189
340
|
|
|
190
|
-
export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>
|
|
341
|
+
export declare function getMessagesHandler({ mastra, agentId, threadId, limit, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
|
|
342
|
+
limit?: number;
|
|
343
|
+
}): Promise<{
|
|
191
344
|
messages: CoreMessage[];
|
|
192
|
-
uiMessages:
|
|
345
|
+
uiMessages: UIMessage[];
|
|
193
346
|
}>;
|
|
194
347
|
|
|
195
348
|
export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
@@ -231,25 +384,79 @@ export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): P
|
|
|
231
384
|
|
|
232
385
|
export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
|
|
233
386
|
|
|
234
|
-
export declare function getThreadByIdHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<StorageThreadType>;
|
|
387
|
+
export declare function getThreadByIdHandler({ mastra, agentId, threadId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType>;
|
|
235
388
|
|
|
236
|
-
export declare function getThreadsHandler({ mastra, agentId, resourceId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId'>): Promise<StorageThreadType[]>;
|
|
389
|
+
export declare function getThreadsHandler({ mastra, agentId, resourceId, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId' | 'networkId' | 'runtimeContext'>): Promise<StorageThreadType[]>;
|
|
237
390
|
|
|
238
391
|
export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
|
|
239
392
|
|
|
240
393
|
export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
|
|
241
394
|
|
|
242
|
-
export declare function
|
|
243
|
-
|
|
395
|
+
export declare function getVNextNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
396
|
+
id: string;
|
|
397
|
+
name: string;
|
|
398
|
+
instructions: string;
|
|
399
|
+
agents: {
|
|
400
|
+
name: string;
|
|
401
|
+
provider: string;
|
|
402
|
+
modelId: string;
|
|
403
|
+
}[];
|
|
404
|
+
workflows: {
|
|
405
|
+
name: string | undefined;
|
|
406
|
+
description: string | undefined;
|
|
407
|
+
inputSchema: string | undefined;
|
|
408
|
+
outputSchema: string | undefined;
|
|
409
|
+
}[];
|
|
410
|
+
tools: {
|
|
411
|
+
id: string;
|
|
412
|
+
description: string;
|
|
413
|
+
}[];
|
|
414
|
+
routingModel: {
|
|
415
|
+
provider: string;
|
|
416
|
+
modelId: string;
|
|
417
|
+
};
|
|
418
|
+
}>;
|
|
419
|
+
|
|
420
|
+
export declare function getVNextNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'runtimeContext'>): Promise<{
|
|
421
|
+
id: string;
|
|
422
|
+
name: string;
|
|
423
|
+
instructions: string;
|
|
424
|
+
tools: {
|
|
425
|
+
id: string;
|
|
426
|
+
description: string;
|
|
427
|
+
}[];
|
|
428
|
+
agents: {
|
|
429
|
+
name: string;
|
|
430
|
+
provider: string;
|
|
431
|
+
modelId: string;
|
|
432
|
+
}[];
|
|
433
|
+
workflows: {
|
|
434
|
+
name: string | undefined;
|
|
435
|
+
description: string | undefined;
|
|
436
|
+
inputSchema: string | undefined;
|
|
437
|
+
outputSchema: string | undefined;
|
|
438
|
+
}[];
|
|
439
|
+
routingModel: {
|
|
440
|
+
provider: string;
|
|
441
|
+
modelId: string;
|
|
442
|
+
};
|
|
443
|
+
}[]>;
|
|
444
|
+
|
|
445
|
+
export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext_3): Promise<{
|
|
446
|
+
steps: Record<string, SerializedStep>;
|
|
447
|
+
allSteps: Record<string, SerializedStep>;
|
|
244
448
|
name: string | undefined;
|
|
449
|
+
description: string | undefined;
|
|
245
450
|
stepGraph: SerializedStepFlowEntry[];
|
|
246
451
|
inputSchema: string | undefined;
|
|
247
452
|
outputSchema: string | undefined;
|
|
248
453
|
}>;
|
|
249
454
|
|
|
250
|
-
export declare function
|
|
455
|
+
export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
|
|
456
|
+
|
|
457
|
+
export declare function getWorkflowRunExecutionResultHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<WatchEvent['payload']['workflowState']>;
|
|
251
458
|
|
|
252
|
-
export declare function
|
|
459
|
+
export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
|
|
253
460
|
fromDate?: Date;
|
|
254
461
|
toDate?: Date;
|
|
255
462
|
limit?: number;
|
|
@@ -257,31 +464,53 @@ export declare function getVNextWorkflowRunsHandler({ mastra, workflowId, fromDa
|
|
|
257
464
|
resourceId?: string;
|
|
258
465
|
}): Promise<WorkflowRuns>;
|
|
259
466
|
|
|
260
|
-
export declare function
|
|
467
|
+
export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
|
|
261
468
|
|
|
262
|
-
export declare function
|
|
263
|
-
stepGraph: StepGraph;
|
|
264
|
-
stepSubscriberGraph: Record<string, StepGraph>;
|
|
265
|
-
serializedStepGraph: StepGraph;
|
|
266
|
-
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
267
|
-
name: string;
|
|
268
|
-
triggerSchema: string | undefined;
|
|
269
|
-
steps: any;
|
|
270
|
-
}>;
|
|
271
|
-
|
|
272
|
-
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;
|
|
273
470
|
|
|
274
|
-
export declare function
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}): 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>>;
|
|
281
478
|
|
|
282
|
-
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>>;
|
|
283
495
|
|
|
284
|
-
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>;
|
|
285
514
|
|
|
286
515
|
/**
|
|
287
516
|
* `HTTPException` must be used when a fatal error such as authentication failure occurs.
|
|
@@ -331,11 +560,13 @@ export declare class HTTPException extends Error {
|
|
|
331
560
|
* @property res - Optional response object to use.
|
|
332
561
|
* @property message - Optional custom error message.
|
|
333
562
|
* @property cause - Optional cause of the error.
|
|
563
|
+
* @property stack - Optional stack trace for the error.
|
|
334
564
|
*/
|
|
335
565
|
declare type HTTPExceptionOptions = {
|
|
336
566
|
res?: Response;
|
|
337
567
|
message?: string;
|
|
338
568
|
cause?: unknown;
|
|
569
|
+
stack?: string;
|
|
339
570
|
};
|
|
340
571
|
|
|
341
572
|
/**
|
|
@@ -344,8 +575,46 @@ declare type HTTPExceptionOptions = {
|
|
|
344
575
|
*/
|
|
345
576
|
declare type InfoStatusCode = 100 | 101 | 102 | 103;
|
|
346
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
|
+
|
|
347
606
|
export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
|
|
348
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
|
+
|
|
349
618
|
export declare namespace logs {
|
|
350
619
|
export {
|
|
351
620
|
getLogsHandler,
|
|
@@ -358,8 +627,72 @@ declare type LogsContext = {
|
|
|
358
627
|
mastra: Mastra;
|
|
359
628
|
transportId?: string;
|
|
360
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
|
+
};
|
|
361
638
|
};
|
|
362
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
|
+
|
|
363
696
|
export declare namespace memory {
|
|
364
697
|
export {
|
|
365
698
|
getMemoryStatusHandler,
|
|
@@ -377,6 +710,8 @@ declare interface MemoryContext extends Context {
|
|
|
377
710
|
agentId?: string;
|
|
378
711
|
resourceId?: string;
|
|
379
712
|
threadId?: string;
|
|
713
|
+
networkId?: string;
|
|
714
|
+
runtimeContext?: RuntimeContext_2;
|
|
380
715
|
}
|
|
381
716
|
|
|
382
717
|
export declare namespace network {
|
|
@@ -393,6 +728,13 @@ declare interface NetworkContext extends Context {
|
|
|
393
728
|
runtimeContext: RuntimeContext;
|
|
394
729
|
}
|
|
395
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
|
+
|
|
396
738
|
declare interface QueryRequest {
|
|
397
739
|
indexName: string;
|
|
398
740
|
queryVector: number[];
|
|
@@ -407,23 +749,33 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
|
|
|
407
749
|
|
|
408
750
|
declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
409
751
|
|
|
410
|
-
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 & {
|
|
411
761
|
body: {
|
|
412
762
|
step: string | string[];
|
|
413
763
|
resumeData?: unknown;
|
|
414
764
|
};
|
|
415
765
|
runtimeContext?: RuntimeContext_2;
|
|
416
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>,
|
|
766
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
417
767
|
|
|
418
|
-
export declare function
|
|
768
|
+
export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
419
769
|
body: {
|
|
420
770
|
stepId: string;
|
|
421
771
|
context: any;
|
|
422
772
|
};
|
|
423
773
|
runtimeContext: RuntimeContext;
|
|
424
|
-
}): Promise<
|
|
774
|
+
}): Promise<{
|
|
775
|
+
message: string;
|
|
776
|
+
}>;
|
|
425
777
|
|
|
426
|
-
export declare function
|
|
778
|
+
export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
427
779
|
body: {
|
|
428
780
|
step: string | string[];
|
|
429
781
|
resumeData?: unknown;
|
|
@@ -433,44 +785,50 @@ export declare function resumeVNextWorkflowHandler({ mastra, workflowId, runId,
|
|
|
433
785
|
message: string;
|
|
434
786
|
}>;
|
|
435
787
|
|
|
436
|
-
export declare function
|
|
788
|
+
export declare function saveMessagesHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
|
|
437
789
|
body: {
|
|
438
|
-
|
|
439
|
-
context: any;
|
|
790
|
+
messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
|
|
440
791
|
};
|
|
441
|
-
|
|
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;
|
|
442
797
|
}): Promise<{
|
|
443
798
|
message: string;
|
|
444
799
|
}>;
|
|
445
800
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
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
|
+
};
|
|
451
809
|
|
|
452
810
|
declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
453
811
|
|
|
454
|
-
export declare function
|
|
455
|
-
inputData?: unknown;
|
|
456
|
-
runtimeContext?: RuntimeContext_2;
|
|
457
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
|
|
458
|
-
|
|
459
|
-
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'> & {
|
|
460
813
|
triggerData?: unknown;
|
|
461
814
|
runtimeContext: RuntimeContext;
|
|
462
|
-
}): Promise<
|
|
815
|
+
}): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
|
|
463
816
|
|
|
464
|
-
export declare function
|
|
817
|
+
export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
465
818
|
inputData?: unknown;
|
|
466
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;
|
|
467
825
|
}): Promise<{
|
|
468
826
|
message: string;
|
|
469
827
|
}>;
|
|
470
828
|
|
|
471
|
-
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId,
|
|
472
|
-
|
|
473
|
-
runtimeContext
|
|
829
|
+
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
830
|
+
inputData?: unknown;
|
|
831
|
+
runtimeContext?: RuntimeContext_2;
|
|
474
832
|
}): Promise<{
|
|
475
833
|
message: string;
|
|
476
834
|
}>;
|
|
@@ -488,18 +846,24 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
|
|
|
488
846
|
status: string;
|
|
489
847
|
message: string;
|
|
490
848
|
error: any;
|
|
849
|
+
} | {
|
|
850
|
+
status: string;
|
|
851
|
+
message: string;
|
|
852
|
+
traceCount?: undefined;
|
|
491
853
|
} | {
|
|
492
854
|
status: string;
|
|
493
855
|
message: string;
|
|
494
856
|
traceCount: number;
|
|
495
857
|
}>;
|
|
496
858
|
|
|
497
|
-
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
859
|
+
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
498
860
|
runtimeContext: RuntimeContext;
|
|
499
861
|
agentId: string;
|
|
500
862
|
body: GetBody<'stream'> & {
|
|
501
863
|
resourceid?: string;
|
|
864
|
+
runtimeContext?: string;
|
|
502
865
|
};
|
|
866
|
+
abortSignal?: AbortSignal;
|
|
503
867
|
}): Promise<Response | undefined>;
|
|
504
868
|
|
|
505
869
|
export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
|
|
@@ -509,6 +873,62 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
|
|
|
509
873
|
} & Parameters<AgentNetwork['stream']>[1];
|
|
510
874
|
}): Promise<Response>;
|
|
511
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
|
+
|
|
512
932
|
declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
513
933
|
|
|
514
934
|
export declare namespace telemetry {
|
|
@@ -575,7 +995,7 @@ export declare type UnOfficalStatusCode = UnofficialStatusCode;
|
|
|
575
995
|
*/
|
|
576
996
|
export declare type UnofficialStatusCode = -1;
|
|
577
997
|
|
|
578
|
-
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'> & {
|
|
579
999
|
body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
|
|
580
1000
|
}): Promise<StorageThreadType>;
|
|
581
1001
|
|
|
@@ -609,31 +1029,12 @@ declare interface VectorContext extends Context {
|
|
|
609
1029
|
vectorName?: string;
|
|
610
1030
|
}
|
|
611
1031
|
|
|
612
|
-
declare interface VNextWorkflowContext extends Context {
|
|
613
|
-
workflowId?: string;
|
|
614
|
-
runId?: string;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
export declare namespace vNextWorkflows {
|
|
618
|
-
export {
|
|
619
|
-
getVNextWorkflowsHandler,
|
|
620
|
-
getVNextWorkflowByIdHandler,
|
|
621
|
-
getVNextWorkflowRunByIdHandler,
|
|
622
|
-
createVNextWorkflowRunHandler,
|
|
623
|
-
startAsyncVNextWorkflowHandler,
|
|
624
|
-
startVNextWorkflowRunHandler,
|
|
625
|
-
watchVNextWorkflowHandler,
|
|
626
|
-
resumeAsyncVNextWorkflowHandler,
|
|
627
|
-
resumeVNextWorkflowHandler,
|
|
628
|
-
getVNextWorkflowRunsHandler
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
|
|
632
1032
|
export declare namespace voice {
|
|
633
1033
|
export {
|
|
634
1034
|
getSpeakersHandler,
|
|
635
1035
|
generateSpeechHandler,
|
|
636
|
-
transcribeSpeechHandler
|
|
1036
|
+
transcribeSpeechHandler,
|
|
1037
|
+
getListenerHandler
|
|
637
1038
|
}
|
|
638
1039
|
}
|
|
639
1040
|
|
|
@@ -641,27 +1042,36 @@ declare interface VoiceContext extends Context {
|
|
|
641
1042
|
agentId?: string;
|
|
642
1043
|
}
|
|
643
1044
|
|
|
644
|
-
export declare function
|
|
1045
|
+
export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
645
1046
|
|
|
646
|
-
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>>;
|
|
647
1048
|
|
|
648
1049
|
declare interface WorkflowContext extends Context {
|
|
649
1050
|
workflowId?: string;
|
|
650
1051
|
runId?: string;
|
|
651
1052
|
}
|
|
652
1053
|
|
|
1054
|
+
declare interface WorkflowContext_3 extends Context {
|
|
1055
|
+
workflowId?: string;
|
|
1056
|
+
runId?: string;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
653
1059
|
export declare namespace workflows {
|
|
654
1060
|
export {
|
|
655
1061
|
getWorkflowsHandler,
|
|
656
1062
|
getWorkflowByIdHandler,
|
|
1063
|
+
getWorkflowRunByIdHandler,
|
|
1064
|
+
getWorkflowRunExecutionResultHandler,
|
|
1065
|
+
createWorkflowRunHandler,
|
|
657
1066
|
startAsyncWorkflowHandler,
|
|
658
|
-
getWorkflowRunHandler,
|
|
659
|
-
createRunHandler,
|
|
660
1067
|
startWorkflowRunHandler,
|
|
661
1068
|
watchWorkflowHandler,
|
|
1069
|
+
streamWorkflowHandler,
|
|
662
1070
|
resumeAsyncWorkflowHandler,
|
|
663
1071
|
resumeWorkflowHandler,
|
|
664
|
-
getWorkflowRunsHandler
|
|
1072
|
+
getWorkflowRunsHandler,
|
|
1073
|
+
cancelWorkflowRunHandler,
|
|
1074
|
+
sendWorkflowRunEventHandler
|
|
665
1075
|
}
|
|
666
1076
|
}
|
|
667
1077
|
|