@mastra/server 0.0.0-fix-message-embedding-20250506021742 → 0.0.0-fix-fetch-workflow-runs-20250624231457
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 +444 -108
- package/dist/_tsup-dts-rollup.d.ts +444 -108
- package/dist/chunk-4DTDPTQC.cjs +332 -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-75ZPJI57.cjs +9 -0
- package/dist/{chunk-AMVOS7YB.cjs → chunk-B4MQFJ7G.cjs} +12 -8
- package/dist/{chunk-BPL2CBLV.js → chunk-BFOA2QQY.js} +8 -4
- package/dist/{chunk-M56ECCHK.cjs → chunk-BNEY4P4P.cjs} +20 -19
- package/dist/{chunk-QJ3AHN64.js → chunk-C7564HUT.js} +4 -3
- package/dist/{chunk-D3G23FP3.cjs → chunk-CPPYMJX5.cjs} +24 -22
- package/dist/chunk-GHC4YV6R.js +504 -0
- package/dist/chunk-GKM45O24.cjs +278 -0
- package/dist/{chunk-L7XE5QTW.js → chunk-H5PTF3Y4.js} +1 -1
- package/dist/chunk-IMBY5XUG.cjs +86 -0
- package/dist/{chunk-3AHQ5RGN.js → chunk-M5ABIP7D.js} +1 -1
- package/dist/chunk-MLKGABMK.js +7 -0
- package/dist/chunk-MN6F4D5A.cjs +2004 -0
- package/dist/{chunk-3XTEV33Q.js → chunk-N2YBMSO2.js} +54 -51
- package/dist/{chunk-TRDNDNGQ.js → chunk-NYN7KFXL.js} +1 -7
- package/dist/{chunk-FV45V6WC.cjs → chunk-OCWPVYNI.cjs} +0 -7
- package/dist/chunk-OSZM4EAY.js +2001 -0
- package/dist/{chunk-Y3SV5XK4.js → chunk-PMUATKV2.js} +104 -15
- 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-IQTNZSFP.js → chunk-SOBBILUG.js} +160 -51
- package/dist/chunk-TO5U6HW3.cjs +435 -0
- package/dist/{chunk-5YGDYMRB.cjs → chunk-VPNDC2DI.cjs} +14 -13
- package/dist/chunk-WJY57THV.cjs +118 -0
- package/dist/{chunk-5JNVY6DU.js → chunk-XR7VJOOP.js} +7 -5
- package/dist/{chunk-RBQASTUP.js → chunk-XUIJ7WRT.js} +63 -25
- 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 +175 -0
- package/dist/server/handlers/vNextNetwork.d.cts +5 -0
- package/dist/server/handlers/vNextNetwork.d.ts +5 -0
- package/dist/server/handlers/vNextNetwork.js +169 -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 +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 +13 -12
- 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-FOXHTOQZ.cjs +0 -324
- package/dist/chunk-OMN3UI6X.js +0 -5576
- package/dist/chunk-SKBVVI24.cjs +0 -54
- 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,74 @@
|
|
|
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 {
|
|
12
|
-
import { NewStep } from '@mastra/core/workflows/vNext';
|
|
13
|
-
import type { NewWorkflow } from '@mastra/core/workflows/vNext';
|
|
22
|
+
import { MastraMessageV1 } from '@mastra/core/memory';
|
|
23
|
+
import type { Message } from '@mastra/core/a2a';
|
|
14
24
|
import type { QueryResult } from '@mastra/core/vector';
|
|
15
25
|
import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
16
|
-
import
|
|
26
|
+
import { ReadableStream as ReadableStream_3 } from 'stream/web';
|
|
27
|
+
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
17
28
|
import type { RuntimeContext as RuntimeContext_2 } from '@mastra/core/di';
|
|
18
|
-
import { SerializedStepFlowEntry } from '@mastra/core/workflows
|
|
29
|
+
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
19
30
|
import { Step } from '@mastra/core/workflows';
|
|
20
|
-
import { StepExecutionContext } from '@mastra/core/workflows';
|
|
21
|
-
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';
|
|
22
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';
|
|
23
43
|
import type { ToolAction } from '@mastra/core/tools';
|
|
44
|
+
import { UIMessage } from 'ai';
|
|
24
45
|
import type { VercelTool } from '@mastra/core/tools';
|
|
46
|
+
import type { WatchEvent } from '@mastra/core/workflows';
|
|
25
47
|
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';
|
|
48
|
+
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
|
|
49
|
+
import { WorkflowResult } from '@mastra/core/workflows';
|
|
29
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';
|
|
30
57
|
import { ZodType } from 'zod';
|
|
58
|
+
import { ZodTypeAny } from 'zod';
|
|
31
59
|
import { ZodTypeDef } from 'zod';
|
|
32
60
|
|
|
61
|
+
export declare namespace a2a {
|
|
62
|
+
export {
|
|
63
|
+
getAgentCardByIdHandler,
|
|
64
|
+
handleTaskSend,
|
|
65
|
+
handleTaskGet,
|
|
66
|
+
handleTaskSendSubscribe,
|
|
67
|
+
handleTaskCancel,
|
|
68
|
+
getAgentExecutionHandler
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
33
72
|
export declare namespace agents {
|
|
34
73
|
export {
|
|
35
74
|
getAgentsHandler,
|
|
@@ -46,12 +85,18 @@ export declare interface ApiError extends Error {
|
|
|
46
85
|
status?: number;
|
|
47
86
|
}
|
|
48
87
|
|
|
88
|
+
export declare function applyUpdateToTaskAndHistory(current: TaskAndHistory, update: Omit<TaskStatus, 'timestamp'> | Artifact): TaskAndHistory;
|
|
89
|
+
|
|
49
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;
|
|
50
91
|
|
|
51
92
|
export declare interface Context {
|
|
52
93
|
mastra: Mastra;
|
|
53
94
|
}
|
|
54
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
|
+
|
|
55
100
|
export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
56
101
|
index: CreateIndexRequest;
|
|
57
102
|
}): Promise<{
|
|
@@ -64,17 +109,26 @@ declare interface CreateIndexRequest {
|
|
|
64
109
|
metric?: 'cosine' | 'euclidean' | 'dotproduct';
|
|
65
110
|
}
|
|
66
111
|
|
|
67
|
-
export declare function
|
|
112
|
+
export declare function createLegacyWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
68
113
|
runId: string;
|
|
69
114
|
}>;
|
|
70
115
|
|
|
71
|
-
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'> & {
|
|
72
126
|
body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
|
|
73
127
|
resourceId?: string;
|
|
74
128
|
};
|
|
75
129
|
}): Promise<StorageThreadType>;
|
|
76
130
|
|
|
77
|
-
export declare function
|
|
131
|
+
export declare function createWorkflowRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
78
132
|
runId: string;
|
|
79
133
|
}>;
|
|
80
134
|
|
|
@@ -84,7 +138,7 @@ export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<Vec
|
|
|
84
138
|
success: boolean;
|
|
85
139
|
}>;
|
|
86
140
|
|
|
87
|
-
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<{
|
|
88
142
|
result: string;
|
|
89
143
|
}>;
|
|
90
144
|
|
|
@@ -101,21 +155,23 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
|
|
|
101
155
|
export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, runtimeContext, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
|
|
102
156
|
agentId?: string;
|
|
103
157
|
data: any;
|
|
104
|
-
runtimeContext:
|
|
158
|
+
runtimeContext: RuntimeContext_2;
|
|
105
159
|
}): Promise<any>;
|
|
106
160
|
|
|
107
161
|
export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, runtimeContext, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
|
|
108
162
|
data?: unknown;
|
|
109
|
-
runtimeContext:
|
|
163
|
+
runtimeContext: RuntimeContext_2;
|
|
110
164
|
}) => Promise<any>;
|
|
111
165
|
|
|
112
|
-
export declare function generateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
166
|
+
export declare function generateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
113
167
|
runtimeContext: RuntimeContext;
|
|
114
168
|
agentId: string;
|
|
115
169
|
body: GetBody<'generate'> & {
|
|
116
170
|
resourceid?: string;
|
|
171
|
+
runtimeContext?: Record<string, unknown>;
|
|
117
172
|
};
|
|
118
|
-
|
|
173
|
+
abortSignal?: AbortSignal;
|
|
174
|
+
}): Promise<GenerateTextResult<any, unknown>>;
|
|
119
175
|
|
|
120
176
|
export declare function generateHandler_alias_1({ mastra, runtimeContext, networkId, body, }: NetworkContext & {
|
|
121
177
|
runtimeContext: RuntimeContext;
|
|
@@ -134,21 +190,70 @@ export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceC
|
|
|
134
190
|
};
|
|
135
191
|
}): Promise<NodeJS.ReadableStream>;
|
|
136
192
|
|
|
137
|
-
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;
|
|
138
209
|
runtimeContext: RuntimeContext;
|
|
139
210
|
agentId: string;
|
|
140
211
|
}): Promise<{
|
|
141
212
|
name: any;
|
|
142
213
|
instructions: string;
|
|
143
214
|
tools: any;
|
|
215
|
+
workflows: {};
|
|
144
216
|
provider: string;
|
|
145
217
|
modelId: string;
|
|
218
|
+
defaultGenerateOptions: any;
|
|
219
|
+
defaultStreamOptions: any;
|
|
146
220
|
}>;
|
|
147
221
|
|
|
148
|
-
export declare function
|
|
222
|
+
export declare function getAgentCardByIdHandler({ mastra, agentId, executionUrl, provider, version, runtimeContext, }: Context & {
|
|
149
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;
|
|
150
241
|
}): Promise<any>;
|
|
151
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">>>;
|
|
256
|
+
|
|
152
257
|
declare type GetBody<T extends keyof Agent & {
|
|
153
258
|
[K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
|
|
154
259
|
}[keyof Agent]> = {
|
|
@@ -165,6 +270,35 @@ export declare function getEvalsByAgentIdHandler({ mastra, runtimeContext, agent
|
|
|
165
270
|
evals: EvalRow[];
|
|
166
271
|
}>;
|
|
167
272
|
|
|
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
|
+
|
|
168
302
|
export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, agentId, }: Context & {
|
|
169
303
|
runtimeContext: RuntimeContext;
|
|
170
304
|
agentId: string;
|
|
@@ -175,21 +309,35 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, runtimeContext, a
|
|
|
175
309
|
evals: EvalRow[];
|
|
176
310
|
}>;
|
|
177
311
|
|
|
178
|
-
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
|
+
}>;
|
|
179
319
|
|
|
180
|
-
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
|
+
}>;
|
|
181
327
|
|
|
182
328
|
export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
|
|
183
329
|
transports: string[];
|
|
184
330
|
}>;
|
|
185
331
|
|
|
186
|
-
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<{
|
|
187
333
|
result: boolean;
|
|
188
334
|
}>;
|
|
189
335
|
|
|
190
|
-
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<{
|
|
191
339
|
messages: CoreMessage[];
|
|
192
|
-
uiMessages:
|
|
340
|
+
uiMessages: UIMessage[];
|
|
193
341
|
}>;
|
|
194
342
|
|
|
195
343
|
export declare function getNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
@@ -231,25 +379,70 @@ export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): P
|
|
|
231
379
|
|
|
232
380
|
export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
|
|
233
381
|
|
|
234
|
-
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>;
|
|
235
383
|
|
|
236
|
-
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[]>;
|
|
237
385
|
|
|
238
386
|
export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
|
|
239
387
|
|
|
240
388
|
export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
|
|
241
389
|
|
|
242
|
-
export declare function
|
|
243
|
-
|
|
390
|
+
export declare function getVNextNetworkByIdHandler({ mastra, networkId, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'networkId' | 'runtimeContext'>): Promise<{
|
|
391
|
+
id: string;
|
|
392
|
+
name: string;
|
|
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
|
+
routingModel: {
|
|
406
|
+
provider: string;
|
|
407
|
+
modelId: string;
|
|
408
|
+
};
|
|
409
|
+
}>;
|
|
410
|
+
|
|
411
|
+
export declare function getVNextNetworksHandler({ mastra, runtimeContext, }: Pick<NetworkContext_2, 'mastra' | 'runtimeContext'>): Promise<{
|
|
412
|
+
id: string;
|
|
413
|
+
name: string;
|
|
414
|
+
instructions: string;
|
|
415
|
+
agents: {
|
|
416
|
+
name: string;
|
|
417
|
+
provider: string;
|
|
418
|
+
modelId: string;
|
|
419
|
+
}[];
|
|
420
|
+
workflows: {
|
|
421
|
+
name: string | undefined;
|
|
422
|
+
description: string | undefined;
|
|
423
|
+
inputSchema: string | undefined;
|
|
424
|
+
outputSchema: string | undefined;
|
|
425
|
+
}[];
|
|
426
|
+
routingModel: {
|
|
427
|
+
provider: string;
|
|
428
|
+
modelId: string;
|
|
429
|
+
};
|
|
430
|
+
}[]>;
|
|
431
|
+
|
|
432
|
+
export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext_3): Promise<{
|
|
433
|
+
steps: SerializedStep[];
|
|
244
434
|
name: string | undefined;
|
|
435
|
+
description: string | undefined;
|
|
245
436
|
stepGraph: SerializedStepFlowEntry[];
|
|
246
437
|
inputSchema: string | undefined;
|
|
247
438
|
outputSchema: string | undefined;
|
|
248
439
|
}>;
|
|
249
440
|
|
|
250
|
-
export declare function
|
|
441
|
+
export declare function getWorkflowRunByIdHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getWorkflowRunById']>>;
|
|
442
|
+
|
|
443
|
+
export declare function getWorkflowRunExecutionResultHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<WatchEvent['payload']['workflowState']>;
|
|
251
444
|
|
|
252
|
-
export declare function
|
|
445
|
+
export declare function getWorkflowRunsHandler({ mastra, workflowId, fromDate, toDate, limit, offset, resourceId, }: WorkflowContext_3 & {
|
|
253
446
|
fromDate?: Date;
|
|
254
447
|
toDate?: Date;
|
|
255
448
|
limit?: number;
|
|
@@ -257,31 +450,53 @@ export declare function getVNextWorkflowRunsHandler({ mastra, workflowId, fromDa
|
|
|
257
450
|
resourceId?: string;
|
|
258
451
|
}): Promise<WorkflowRuns>;
|
|
259
452
|
|
|
260
|
-
export declare function
|
|
453
|
+
export declare function getWorkflowsHandler({ mastra }: WorkflowContext_3): Promise<any>;
|
|
261
454
|
|
|
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']>>;
|
|
455
|
+
export declare function handleError(error: unknown, defaultMessage: string): never;
|
|
273
456
|
|
|
274
|
-
export declare function
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}): Promise<
|
|
457
|
+
export declare function handleTaskCancel({ requestId, taskStore, agentId, taskId, logger, }: {
|
|
458
|
+
requestId: string;
|
|
459
|
+
taskStore: InMemoryTaskStore;
|
|
460
|
+
agentId: string;
|
|
461
|
+
taskId: string;
|
|
462
|
+
logger?: IMastraLogger;
|
|
463
|
+
}): Promise<JSONRPCResponse<Task, unknown>>;
|
|
281
464
|
|
|
282
|
-
export declare function
|
|
465
|
+
export declare function handleTaskGet({ requestId, taskStore, agentId, taskId, }: {
|
|
466
|
+
requestId: string;
|
|
467
|
+
taskStore: InMemoryTaskStore;
|
|
468
|
+
agentId: string;
|
|
469
|
+
taskId: string;
|
|
470
|
+
}): Promise<JSONRPCResponse<TaskAndHistory, unknown>>;
|
|
471
|
+
|
|
472
|
+
export declare function handleTaskSend({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
|
|
473
|
+
requestId: string;
|
|
474
|
+
params: TaskSendParams;
|
|
475
|
+
taskStore: InMemoryTaskStore;
|
|
476
|
+
agent: Agent;
|
|
477
|
+
agentId: string;
|
|
478
|
+
logger?: IMastraLogger;
|
|
479
|
+
runtimeContext: RuntimeContext;
|
|
480
|
+
}): Promise<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown>>;
|
|
283
481
|
|
|
284
|
-
export declare function
|
|
482
|
+
export declare function handleTaskSendSubscribe({ requestId, params, taskStore, agent, agentId, logger, runtimeContext, }: {
|
|
483
|
+
requestId: string;
|
|
484
|
+
params: TaskSendParams;
|
|
485
|
+
taskStore: InMemoryTaskStore;
|
|
486
|
+
agent: Agent;
|
|
487
|
+
agentId: string;
|
|
488
|
+
logger?: IMastraLogger;
|
|
489
|
+
runtimeContext: RuntimeContext;
|
|
490
|
+
}): AsyncGenerator<JSONRPCResponse<null, unknown> | JSONRPCResponse<Task, unknown> | JSONRPCResponse< {
|
|
491
|
+
state: string;
|
|
492
|
+
message: {
|
|
493
|
+
role: string;
|
|
494
|
+
parts: {
|
|
495
|
+
type: string;
|
|
496
|
+
text: string;
|
|
497
|
+
}[];
|
|
498
|
+
};
|
|
499
|
+
}, unknown>, void, unknown>;
|
|
285
500
|
|
|
286
501
|
/**
|
|
287
502
|
* `HTTPException` must be used when a fatal error such as authentication failure occurs.
|
|
@@ -344,8 +559,46 @@ declare type HTTPExceptionOptions = {
|
|
|
344
559
|
*/
|
|
345
560
|
declare type InfoStatusCode = 100 | 101 | 102 | 103;
|
|
346
561
|
|
|
562
|
+
export declare class InMemoryTaskStore {
|
|
563
|
+
private store;
|
|
564
|
+
activeCancellations: Set<string>;
|
|
565
|
+
load({ agentId, taskId }: {
|
|
566
|
+
agentId: string;
|
|
567
|
+
taskId: string;
|
|
568
|
+
}): Promise<TaskAndHistory | null>;
|
|
569
|
+
save({ agentId, data }: {
|
|
570
|
+
agentId: string;
|
|
571
|
+
data: TaskAndHistory;
|
|
572
|
+
}): Promise<void>;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
export declare namespace legacyWorkflows {
|
|
576
|
+
export {
|
|
577
|
+
getLegacyWorkflowsHandler,
|
|
578
|
+
getLegacyWorkflowByIdHandler,
|
|
579
|
+
startAsyncLegacyWorkflowHandler,
|
|
580
|
+
getLegacyWorkflowRunHandler,
|
|
581
|
+
createLegacyWorkflowRunHandler,
|
|
582
|
+
startLegacyWorkflowRunHandler,
|
|
583
|
+
watchLegacyWorkflowHandler,
|
|
584
|
+
resumeAsyncLegacyWorkflowHandler,
|
|
585
|
+
resumeLegacyWorkflowHandler,
|
|
586
|
+
getLegacyWorkflowRunsHandler
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
347
590
|
export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
|
|
348
591
|
|
|
592
|
+
export declare function loadOrCreateTaskAndHistory({ agentId, taskId, taskStore, message, sessionId, metadata, logger, }: {
|
|
593
|
+
agentId: string;
|
|
594
|
+
taskId: string;
|
|
595
|
+
taskStore: InMemoryTaskStore;
|
|
596
|
+
message: Message;
|
|
597
|
+
sessionId?: string | null;
|
|
598
|
+
metadata?: Record<string, unknown> | null;
|
|
599
|
+
logger?: IMastraLogger;
|
|
600
|
+
}): Promise<TaskAndHistory>;
|
|
601
|
+
|
|
349
602
|
export declare namespace logs {
|
|
350
603
|
export {
|
|
351
604
|
getLogsHandler,
|
|
@@ -358,8 +611,32 @@ declare type LogsContext = {
|
|
|
358
611
|
mastra: Mastra;
|
|
359
612
|
transportId?: string;
|
|
360
613
|
runId?: string;
|
|
614
|
+
params?: {
|
|
615
|
+
fromDate?: Date;
|
|
616
|
+
toDate?: Date;
|
|
617
|
+
logLevel?: LogLevel;
|
|
618
|
+
filters?: string | string[];
|
|
619
|
+
page?: number;
|
|
620
|
+
perPage?: number;
|
|
621
|
+
};
|
|
361
622
|
};
|
|
362
623
|
|
|
624
|
+
export declare function loopVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
625
|
+
runtimeContext: RuntimeContext;
|
|
626
|
+
body: {
|
|
627
|
+
message: string;
|
|
628
|
+
};
|
|
629
|
+
}): Promise<{
|
|
630
|
+
status: "success";
|
|
631
|
+
result: {
|
|
632
|
+
text: string;
|
|
633
|
+
iteration: number;
|
|
634
|
+
};
|
|
635
|
+
steps: {
|
|
636
|
+
[x: string]: StepResult<any, any, any, any> | StepResult<unknown, unknown, unknown, unknown>;
|
|
637
|
+
};
|
|
638
|
+
}>;
|
|
639
|
+
|
|
363
640
|
export declare namespace memory {
|
|
364
641
|
export {
|
|
365
642
|
getMemoryStatusHandler,
|
|
@@ -377,6 +654,8 @@ declare interface MemoryContext extends Context {
|
|
|
377
654
|
agentId?: string;
|
|
378
655
|
resourceId?: string;
|
|
379
656
|
threadId?: string;
|
|
657
|
+
networkId?: string;
|
|
658
|
+
runtimeContext?: RuntimeContext_2;
|
|
380
659
|
}
|
|
381
660
|
|
|
382
661
|
export declare namespace network {
|
|
@@ -393,6 +672,13 @@ declare interface NetworkContext extends Context {
|
|
|
393
672
|
runtimeContext: RuntimeContext;
|
|
394
673
|
}
|
|
395
674
|
|
|
675
|
+
declare interface NetworkContext_2 extends Context {
|
|
676
|
+
networkId?: string;
|
|
677
|
+
runtimeContext: RuntimeContext;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
export declare function normalizeError(error: any, reqId: number | string | null, taskId?: string, logger?: IMastraLogger): JSONRPCResponse<null, unknown>;
|
|
681
|
+
|
|
396
682
|
declare interface QueryRequest {
|
|
397
683
|
indexName: string;
|
|
398
684
|
queryVector: number[];
|
|
@@ -407,33 +693,23 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
|
|
|
407
693
|
|
|
408
694
|
declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
409
695
|
|
|
410
|
-
export declare function
|
|
411
|
-
body: {
|
|
412
|
-
step: string | string[];
|
|
413
|
-
resumeData?: unknown;
|
|
414
|
-
};
|
|
415
|
-
runtimeContext?: RuntimeContext_2;
|
|
416
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
|
|
417
|
-
|
|
418
|
-
export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
696
|
+
export declare function resumeAsyncLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
419
697
|
body: {
|
|
420
698
|
stepId: string;
|
|
421
699
|
context: any;
|
|
422
700
|
};
|
|
423
701
|
runtimeContext: RuntimeContext;
|
|
424
|
-
}): Promise<Omit<
|
|
702
|
+
}): Promise<Omit<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
|
|
425
703
|
|
|
426
|
-
export declare function
|
|
704
|
+
export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
427
705
|
body: {
|
|
428
706
|
step: string | string[];
|
|
429
707
|
resumeData?: unknown;
|
|
430
708
|
};
|
|
431
709
|
runtimeContext?: RuntimeContext_2;
|
|
432
|
-
}): Promise<
|
|
433
|
-
message: string;
|
|
434
|
-
}>;
|
|
710
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
435
711
|
|
|
436
|
-
export declare function
|
|
712
|
+
export declare function resumeLegacyWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext & {
|
|
437
713
|
body: {
|
|
438
714
|
stepId: string;
|
|
439
715
|
context: any;
|
|
@@ -443,34 +719,53 @@ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body,
|
|
|
443
719
|
message: string;
|
|
444
720
|
}>;
|
|
445
721
|
|
|
446
|
-
export declare function
|
|
722
|
+
export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, runtimeContext, }: WorkflowContext_3 & {
|
|
723
|
+
body: {
|
|
724
|
+
step: string | string[];
|
|
725
|
+
resumeData?: unknown;
|
|
726
|
+
};
|
|
727
|
+
runtimeContext?: RuntimeContext_2;
|
|
728
|
+
}): Promise<{
|
|
729
|
+
message: string;
|
|
730
|
+
}>;
|
|
731
|
+
|
|
732
|
+
export declare function saveMessagesHandler({ mastra, agentId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'networkId' | 'runtimeContext'> & {
|
|
447
733
|
body: {
|
|
448
734
|
messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
|
|
449
735
|
};
|
|
450
|
-
}): Promise<
|
|
736
|
+
}): Promise<MastraMessageV1[]>;
|
|
451
737
|
|
|
452
|
-
declare type
|
|
738
|
+
declare type SerializedStep = {
|
|
739
|
+
id: string;
|
|
740
|
+
description: string;
|
|
741
|
+
inputSchema: string | undefined;
|
|
742
|
+
outputSchema: string | undefined;
|
|
743
|
+
resumeSchema: string | undefined;
|
|
744
|
+
suspendSchema: string | undefined;
|
|
745
|
+
};
|
|
453
746
|
|
|
454
|
-
|
|
455
|
-
inputData?: unknown;
|
|
456
|
-
runtimeContext?: RuntimeContext_2;
|
|
457
|
-
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, NewStep<string, any, any, any, any>[]>>;
|
|
747
|
+
declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
458
748
|
|
|
459
|
-
export declare function
|
|
749
|
+
export declare function startAsyncLegacyWorkflowHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
460
750
|
triggerData?: unknown;
|
|
461
751
|
runtimeContext: RuntimeContext;
|
|
462
|
-
}): Promise<
|
|
752
|
+
}): Promise<LegacyWorkflowRunResult<any, LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], any>>;
|
|
463
753
|
|
|
464
|
-
export declare function
|
|
754
|
+
export declare function startAsyncWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
465
755
|
inputData?: unknown;
|
|
466
756
|
runtimeContext?: RuntimeContext_2;
|
|
757
|
+
}): Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
758
|
+
|
|
759
|
+
export declare function startLegacyWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
760
|
+
triggerData?: unknown;
|
|
761
|
+
runtimeContext: RuntimeContext;
|
|
467
762
|
}): Promise<{
|
|
468
763
|
message: string;
|
|
469
764
|
}>;
|
|
470
765
|
|
|
471
|
-
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId,
|
|
472
|
-
|
|
473
|
-
runtimeContext
|
|
766
|
+
export declare function startWorkflowRunHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
767
|
+
inputData?: unknown;
|
|
768
|
+
runtimeContext?: RuntimeContext_2;
|
|
474
769
|
}): Promise<{
|
|
475
770
|
message: string;
|
|
476
771
|
}>;
|
|
@@ -488,18 +783,24 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
|
|
|
488
783
|
status: string;
|
|
489
784
|
message: string;
|
|
490
785
|
error: any;
|
|
786
|
+
} | {
|
|
787
|
+
status: string;
|
|
788
|
+
message: string;
|
|
789
|
+
traceCount?: undefined;
|
|
491
790
|
} | {
|
|
492
791
|
status: string;
|
|
493
792
|
message: string;
|
|
494
793
|
traceCount: number;
|
|
495
794
|
}>;
|
|
496
795
|
|
|
497
|
-
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, }: Context & {
|
|
796
|
+
export declare function streamGenerateHandler({ mastra, runtimeContext, agentId, body, abortSignal, }: Context & {
|
|
498
797
|
runtimeContext: RuntimeContext;
|
|
499
798
|
agentId: string;
|
|
500
799
|
body: GetBody<'stream'> & {
|
|
501
800
|
resourceid?: string;
|
|
801
|
+
runtimeContext?: string;
|
|
502
802
|
};
|
|
803
|
+
abortSignal?: AbortSignal;
|
|
503
804
|
}): Promise<Response | undefined>;
|
|
504
805
|
|
|
505
806
|
export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, runtimeContext, }: NetworkContext & {
|
|
@@ -509,6 +810,53 @@ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body,
|
|
|
509
810
|
} & Parameters<AgentNetwork['stream']>[1];
|
|
510
811
|
}): Promise<Response>;
|
|
511
812
|
|
|
813
|
+
export declare function streamGenerateVNextNetworkHandler({ mastra, networkId, body, runtimeContext, }: NetworkContext_2 & {
|
|
814
|
+
runtimeContext: RuntimeContext;
|
|
815
|
+
body: {
|
|
816
|
+
message: string;
|
|
817
|
+
threadId?: string;
|
|
818
|
+
resourceId?: string;
|
|
819
|
+
};
|
|
820
|
+
}): Promise<{
|
|
821
|
+
stream: ReadableStream_3<StreamEvent>;
|
|
822
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
|
|
823
|
+
task: ZodString;
|
|
824
|
+
resourceId: ZodString;
|
|
825
|
+
resourceType: ZodEnum<["agent", "workflow", "none", "tool", "none"]>;
|
|
826
|
+
prompt: ZodString;
|
|
827
|
+
result: ZodString;
|
|
828
|
+
isComplete: ZodOptional<ZodBoolean>;
|
|
829
|
+
completionReason: ZodOptional<ZodString>;
|
|
830
|
+
iteration: ZodNumber;
|
|
831
|
+
}, "strip", ZodTypeAny, {
|
|
832
|
+
prompt: string;
|
|
833
|
+
resourceId: string;
|
|
834
|
+
result: string;
|
|
835
|
+
task: string;
|
|
836
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
837
|
+
iteration: number;
|
|
838
|
+
isComplete?: boolean | undefined;
|
|
839
|
+
completionReason?: string | undefined;
|
|
840
|
+
}, {
|
|
841
|
+
prompt: string;
|
|
842
|
+
resourceId: string;
|
|
843
|
+
result: string;
|
|
844
|
+
task: string;
|
|
845
|
+
resourceType: "none" | "tool" | "workflow" | "agent";
|
|
846
|
+
iteration: number;
|
|
847
|
+
isComplete?: boolean | undefined;
|
|
848
|
+
completionReason?: string | undefined;
|
|
849
|
+
}>, Step<string, any, any, any, any, DefaultEngineType>[]>>;
|
|
850
|
+
}>;
|
|
851
|
+
|
|
852
|
+
export declare function streamWorkflowHandler({ mastra, runtimeContext, workflowId, runId, inputData, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'> & {
|
|
853
|
+
inputData?: unknown;
|
|
854
|
+
runtimeContext?: RuntimeContext_2;
|
|
855
|
+
}): Promise<{
|
|
856
|
+
stream: ReadableStream_2<StreamEvent>;
|
|
857
|
+
getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any, any>[]>>;
|
|
858
|
+
}>;
|
|
859
|
+
|
|
512
860
|
declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
513
861
|
|
|
514
862
|
export declare namespace telemetry {
|
|
@@ -575,7 +923,7 @@ export declare type UnOfficalStatusCode = UnofficialStatusCode;
|
|
|
575
923
|
*/
|
|
576
924
|
export declare type UnofficialStatusCode = -1;
|
|
577
925
|
|
|
578
|
-
export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
|
|
926
|
+
export declare function updateThreadHandler({ mastra, agentId, threadId, body, networkId, runtimeContext, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId' | 'networkId' | 'runtimeContext'> & {
|
|
579
927
|
body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
|
|
580
928
|
}): Promise<StorageThreadType>;
|
|
581
929
|
|
|
@@ -609,31 +957,12 @@ declare interface VectorContext extends Context {
|
|
|
609
957
|
vectorName?: string;
|
|
610
958
|
}
|
|
611
959
|
|
|
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
|
-
getVNextWorkflowRunHandler,
|
|
622
|
-
createVNextWorkflowRunHandler,
|
|
623
|
-
startAsyncVNextWorkflowHandler,
|
|
624
|
-
startVNextWorkflowRunHandler,
|
|
625
|
-
watchVNextWorkflowHandler,
|
|
626
|
-
resumeAsyncVNextWorkflowHandler,
|
|
627
|
-
resumeVNextWorkflowHandler,
|
|
628
|
-
getVNextWorkflowRunsHandler
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
|
|
632
960
|
export declare namespace voice {
|
|
633
961
|
export {
|
|
634
962
|
getSpeakersHandler,
|
|
635
963
|
generateSpeechHandler,
|
|
636
|
-
transcribeSpeechHandler
|
|
964
|
+
transcribeSpeechHandler,
|
|
965
|
+
getListenerHandler
|
|
637
966
|
}
|
|
638
967
|
}
|
|
639
968
|
|
|
@@ -641,24 +970,31 @@ declare interface VoiceContext extends Context {
|
|
|
641
970
|
agentId?: string;
|
|
642
971
|
}
|
|
643
972
|
|
|
644
|
-
export declare function
|
|
973
|
+
export declare function watchLegacyWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
645
974
|
|
|
646
|
-
export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<
|
|
975
|
+
export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext_3, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
647
976
|
|
|
648
977
|
declare interface WorkflowContext extends Context {
|
|
649
978
|
workflowId?: string;
|
|
650
979
|
runId?: string;
|
|
651
980
|
}
|
|
652
981
|
|
|
982
|
+
declare interface WorkflowContext_3 extends Context {
|
|
983
|
+
workflowId?: string;
|
|
984
|
+
runId?: string;
|
|
985
|
+
}
|
|
986
|
+
|
|
653
987
|
export declare namespace workflows {
|
|
654
988
|
export {
|
|
655
989
|
getWorkflowsHandler,
|
|
656
990
|
getWorkflowByIdHandler,
|
|
991
|
+
getWorkflowRunByIdHandler,
|
|
992
|
+
getWorkflowRunExecutionResultHandler,
|
|
993
|
+
createWorkflowRunHandler,
|
|
657
994
|
startAsyncWorkflowHandler,
|
|
658
|
-
getWorkflowRunHandler,
|
|
659
|
-
createRunHandler,
|
|
660
995
|
startWorkflowRunHandler,
|
|
661
996
|
watchWorkflowHandler,
|
|
997
|
+
streamWorkflowHandler,
|
|
662
998
|
resumeAsyncWorkflowHandler,
|
|
663
999
|
resumeWorkflowHandler,
|
|
664
1000
|
getWorkflowRunsHandler
|