@mastra/server 0.0.0-a2a-20250421213654
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/LICENSE.md +46 -0
- package/README.md +159 -0
- package/dist/_tsup-dts-rollup.d.cts +897 -0
- package/dist/_tsup-dts-rollup.d.ts +897 -0
- package/dist/chunk-3KWAWPRU.cjs +127 -0
- package/dist/chunk-4VNS5WPM.js +37 -0
- package/dist/chunk-57CJTIPW.cjs +18 -0
- package/dist/chunk-5SWCVTNL.cjs +5579 -0
- package/dist/chunk-64U3UDTH.cjs +13 -0
- package/dist/chunk-6QEBCWQG.js +136 -0
- package/dist/chunk-75KYFUMD.cjs +165 -0
- package/dist/chunk-B2TWGIVC.cjs +101 -0
- package/dist/chunk-CVPOREIE.cjs +42 -0
- package/dist/chunk-CZOSYERC.js +312 -0
- package/dist/chunk-FFRES7WX.js +157 -0
- package/dist/chunk-H5PTF3Y4.js +16 -0
- package/dist/chunk-IDPBXKRV.js +121 -0
- package/dist/chunk-J2MCTUD4.js +121 -0
- package/dist/chunk-JQCFFVSK.cjs +127 -0
- package/dist/chunk-LGJ46RCS.js +96 -0
- package/dist/chunk-LTP7PHVE.cjs +321 -0
- package/dist/chunk-M5ABIP7D.js +11 -0
- package/dist/chunk-NJF275KR.js +49 -0
- package/dist/chunk-NYN7KFXL.js +34 -0
- package/dist/chunk-O7X557PN.cjs +140 -0
- package/dist/chunk-OCWPVYNI.cjs +36 -0
- package/dist/chunk-OMN3UI6X.js +5576 -0
- package/dist/chunk-P7UZNROR.js +306 -0
- package/dist/chunk-PJHJORJL.js +204 -0
- package/dist/chunk-RXH2S65Z.cjs +54 -0
- package/dist/chunk-UVVUDJBW.cjs +214 -0
- package/dist/chunk-Y7WN2UYV.cjs +318 -0
- package/dist/chunk-YB2FGKQ5.js +121 -0
- package/dist/chunk-ZCRMOXNW.cjs +129 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/magic-string.es-5UDOWOAZ.js +1294 -0
- package/dist/magic-string.es-IL2775P6.cjs +1300 -0
- package/dist/server/handlers/a2a.cjs +34 -0
- package/dist/server/handlers/a2a.d.cts +7 -0
- package/dist/server/handlers/a2a.d.ts +7 -0
- package/dist/server/handlers/a2a.js +1 -0
- package/dist/server/handlers/agents.cjs +30 -0
- package/dist/server/handlers/agents.d.cts +6 -0
- package/dist/server/handlers/agents.d.ts +6 -0
- package/dist/server/handlers/agents.js +1 -0
- package/dist/server/handlers/error.cjs +10 -0
- package/dist/server/handlers/error.d.cts +1 -0
- package/dist/server/handlers/error.d.ts +1 -0
- package/dist/server/handlers/error.js +1 -0
- package/dist/server/handlers/logs.cjs +18 -0
- package/dist/server/handlers/logs.d.cts +3 -0
- package/dist/server/handlers/logs.d.ts +3 -0
- package/dist/server/handlers/logs.js +1 -0
- package/dist/server/handlers/memory.cjs +38 -0
- package/dist/server/handlers/memory.d.cts +8 -0
- package/dist/server/handlers/memory.d.ts +8 -0
- package/dist/server/handlers/memory.js +1 -0
- package/dist/server/handlers/network.cjs +22 -0
- package/dist/server/handlers/network.d.cts +4 -0
- package/dist/server/handlers/network.d.ts +4 -0
- package/dist/server/handlers/network.js +1 -0
- package/dist/server/handlers/telemetry.cjs +14 -0
- package/dist/server/handlers/telemetry.d.cts +2 -0
- package/dist/server/handlers/telemetry.d.ts +2 -0
- package/dist/server/handlers/telemetry.js +1 -0
- package/dist/server/handlers/test-utils.cjs +16209 -0
- package/dist/server/handlers/test-utils.d.cts +1 -0
- package/dist/server/handlers/test-utils.d.ts +1 -0
- package/dist/server/handlers/test-utils.js +16207 -0
- package/dist/server/handlers/tools.cjs +22 -0
- package/dist/server/handlers/tools.d.cts +4 -0
- package/dist/server/handlers/tools.d.ts +4 -0
- package/dist/server/handlers/tools.js +1 -0
- package/dist/server/handlers/utils.cjs +10 -0
- package/dist/server/handlers/utils.d.cts +1 -0
- package/dist/server/handlers/utils.d.ts +1 -0
- package/dist/server/handlers/utils.js +1 -0
- package/dist/server/handlers/vector.cjs +30 -0
- package/dist/server/handlers/vector.d.cts +6 -0
- package/dist/server/handlers/vector.d.ts +6 -0
- package/dist/server/handlers/vector.js +1 -0
- package/dist/server/handlers/voice.cjs +18 -0
- package/dist/server/handlers/voice.d.cts +3 -0
- package/dist/server/handlers/voice.d.ts +3 -0
- package/dist/server/handlers/voice.js +1 -0
- package/dist/server/handlers/workflows.cjs +46 -0
- package/dist/server/handlers/workflows.d.cts +10 -0
- package/dist/server/handlers/workflows.d.ts +10 -0
- package/dist/server/handlers/workflows.js +1 -0
- package/dist/server/handlers.cjs +55 -0
- package/dist/server/handlers.d.cts +10 -0
- package/dist/server/handlers.d.ts +10 -0
- package/dist/server/handlers.js +10 -0
- package/package.json +71 -0
|
@@ -0,0 +1,897 @@
|
|
|
1
|
+
import { Agent } from '@mastra/core/agent';
|
|
2
|
+
import type { AgentConfig } from '@mastra/core/agent';
|
|
3
|
+
import type { AgentNetwork } from '@mastra/core/network';
|
|
4
|
+
import type { BaseLogMessage } from '@mastra/core/logger';
|
|
5
|
+
import type { Container } from '@mastra/core/di';
|
|
6
|
+
import { CoreMessage } from 'ai';
|
|
7
|
+
import { EvalRow } from '@mastra/core/storage';
|
|
8
|
+
import { GenerateObjectResult } from 'ai';
|
|
9
|
+
import { GenerateTextResult } from 'ai';
|
|
10
|
+
import type { Mastra } from '@mastra/core/mastra';
|
|
11
|
+
import type { MastraMemory } from '@mastra/core/memory';
|
|
12
|
+
import { Message as Message_2 } from 'ai';
|
|
13
|
+
import { MessageType } from '@mastra/core/memory';
|
|
14
|
+
import type { QueryResult } from '@mastra/core/vector';
|
|
15
|
+
import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
16
|
+
import { Step } from '@mastra/core/workflows';
|
|
17
|
+
import { StepExecutionContext } from '@mastra/core/workflows';
|
|
18
|
+
import { StepGraph } from '@mastra/core/workflows';
|
|
19
|
+
import { StorageThreadType } from '@mastra/core/memory';
|
|
20
|
+
import type { ToolAction } from '@mastra/core/tools';
|
|
21
|
+
import type { VercelTool } from '@mastra/core/tools';
|
|
22
|
+
import type { Workflow } from '@mastra/core/workflows';
|
|
23
|
+
import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
|
|
24
|
+
import { WorkflowRunResult } from '@mastra/core/workflows';
|
|
25
|
+
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
26
|
+
|
|
27
|
+
export declare namespace a2a {
|
|
28
|
+
export {
|
|
29
|
+
handleSendTask,
|
|
30
|
+
handleGetTask,
|
|
31
|
+
handleCancelTask,
|
|
32
|
+
handlePushNotification,
|
|
33
|
+
handleA2ARequest,
|
|
34
|
+
generateAgentCard,
|
|
35
|
+
handleAgentCardRequest
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare type A2ARequest = SendTaskRequest | GetTaskRequest | CancelTaskRequest | SetTaskPushNotificationRequest | GetTaskPushNotificationRequest | TaskResubscriptionRequest;
|
|
40
|
+
|
|
41
|
+
export declare type AgentAuthentication = {
|
|
42
|
+
schemes: string[];
|
|
43
|
+
credentials?: string | null;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export declare type AgentCapabilities = {
|
|
47
|
+
streaming?: boolean;
|
|
48
|
+
pushNotifications?: boolean;
|
|
49
|
+
stateTransitionHistory?: boolean;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export declare type AgentCard = {
|
|
53
|
+
name: string;
|
|
54
|
+
description?: string | null;
|
|
55
|
+
url: string;
|
|
56
|
+
provider?: AgentProvider | null;
|
|
57
|
+
version: string;
|
|
58
|
+
documentationUrl?: string | null;
|
|
59
|
+
capabilities: AgentCapabilities;
|
|
60
|
+
authentication?: AgentAuthentication | null;
|
|
61
|
+
defaultInputModes?: string[];
|
|
62
|
+
defaultOutputModes?: string[];
|
|
63
|
+
skills: AgentSkill[];
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export declare type AgentProvider = {
|
|
67
|
+
organization: string;
|
|
68
|
+
url?: string | null;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export declare namespace agents {
|
|
72
|
+
export {
|
|
73
|
+
getAgentsHandler,
|
|
74
|
+
getAgentByIdHandler,
|
|
75
|
+
getEvalsByAgentIdHandler,
|
|
76
|
+
getLiveEvalsByAgentIdHandler,
|
|
77
|
+
generateHandler,
|
|
78
|
+
streamGenerateHandler
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare type AgentSkill = {
|
|
83
|
+
id: string;
|
|
84
|
+
name: string;
|
|
85
|
+
description?: string | null;
|
|
86
|
+
tags?: string[] | null;
|
|
87
|
+
examples?: string[] | null;
|
|
88
|
+
inputModes?: string[] | null;
|
|
89
|
+
outputModes?: string[] | null;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export declare interface ApiError extends Error {
|
|
93
|
+
message: string;
|
|
94
|
+
status?: number;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export declare type Artifact = {
|
|
98
|
+
name?: string | null;
|
|
99
|
+
description?: string | null;
|
|
100
|
+
parts: Part[];
|
|
101
|
+
index?: number;
|
|
102
|
+
append?: boolean | null;
|
|
103
|
+
lastChunk?: boolean | null;
|
|
104
|
+
metadata?: Record<string, any> | null;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export declare type AuthenticationInfo = {
|
|
108
|
+
schemes: string[];
|
|
109
|
+
credentials?: string | null;
|
|
110
|
+
} & Record<string, any>;
|
|
111
|
+
|
|
112
|
+
export declare type CancelTaskRequest = JSONRPCRequest & {
|
|
113
|
+
method: 'tasks/cancel';
|
|
114
|
+
params: TaskIdParams;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export declare type CancelTaskResponse = JSONRPCResponse & {
|
|
118
|
+
result?: Task | null;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
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;
|
|
122
|
+
|
|
123
|
+
export declare interface Context {
|
|
124
|
+
mastra: Mastra;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export declare function createIndex({ mastra, vectorName, index, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
128
|
+
index: CreateIndexRequest;
|
|
129
|
+
}): Promise<{
|
|
130
|
+
success: boolean;
|
|
131
|
+
}>;
|
|
132
|
+
|
|
133
|
+
declare interface CreateIndexRequest {
|
|
134
|
+
indexName: string;
|
|
135
|
+
dimension: number;
|
|
136
|
+
metric?: 'cosine' | 'euclidean' | 'dotproduct';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export declare function createRunHandler({ mastra, workflowId, runId: prevRunId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<{
|
|
140
|
+
runId: string;
|
|
141
|
+
}>;
|
|
142
|
+
|
|
143
|
+
export declare function createThreadHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
|
|
144
|
+
body?: Omit<Parameters<MastraMemory['createThread']>[0], 'resourceId'> & {
|
|
145
|
+
resourceId?: string;
|
|
146
|
+
};
|
|
147
|
+
}): Promise<StorageThreadType>;
|
|
148
|
+
|
|
149
|
+
export declare type DataPart = {
|
|
150
|
+
type: 'data';
|
|
151
|
+
data: Record<string, any>;
|
|
152
|
+
metadata?: Record<string, any> | null;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export declare function deleteIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
156
|
+
indexName?: string;
|
|
157
|
+
}): Promise<{
|
|
158
|
+
success: boolean;
|
|
159
|
+
}>;
|
|
160
|
+
|
|
161
|
+
export declare function deleteThreadHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
|
|
162
|
+
result: string;
|
|
163
|
+
}>;
|
|
164
|
+
|
|
165
|
+
declare type DeprecatedStatusCode = 305 | 306;
|
|
166
|
+
|
|
167
|
+
export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
168
|
+
indexName?: string;
|
|
169
|
+
}): Promise<{
|
|
170
|
+
dimension: number;
|
|
171
|
+
count: number;
|
|
172
|
+
metric: string | undefined;
|
|
173
|
+
}>;
|
|
174
|
+
|
|
175
|
+
export declare enum ErrorCode {
|
|
176
|
+
PARSE_ERROR = -32700,
|
|
177
|
+
INVALID_REQUEST = -32600,
|
|
178
|
+
METHOD_NOT_FOUND = -32601,
|
|
179
|
+
INVALID_PARAMS = -32602,
|
|
180
|
+
INTERNAL_ERROR = -32603,
|
|
181
|
+
TASK_NOT_FOUND = -32001,
|
|
182
|
+
TASK_NOT_CANCELABLE = -32002,
|
|
183
|
+
PUSH_NOTIFICATION_NOT_SUPPORTED = -32003,
|
|
184
|
+
UNSUPPORTED_OPERATION = -32004
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, container, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
|
|
188
|
+
agentId?: string;
|
|
189
|
+
data: any;
|
|
190
|
+
container: Container;
|
|
191
|
+
}): Promise<any>;
|
|
192
|
+
|
|
193
|
+
export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, container, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
|
|
194
|
+
data?: unknown;
|
|
195
|
+
container: Container;
|
|
196
|
+
}) => Promise<any>;
|
|
197
|
+
|
|
198
|
+
export declare type FileContent = {
|
|
199
|
+
name?: string | null;
|
|
200
|
+
mimeType?: string | null;
|
|
201
|
+
bytes?: string | null;
|
|
202
|
+
uri?: string | null;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export declare type FilePart = {
|
|
206
|
+
type: 'file';
|
|
207
|
+
file: FileContent;
|
|
208
|
+
metadata?: Record<string, any> | null;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Generate an agent card for the A2A protocol
|
|
213
|
+
*/
|
|
214
|
+
export declare function generateAgentCard({ agent, baseUrl }: {
|
|
215
|
+
agent: Agent;
|
|
216
|
+
baseUrl: string;
|
|
217
|
+
}): AgentCard;
|
|
218
|
+
|
|
219
|
+
export declare function generateHandler({ mastra, container, agentId, body, }: Context & {
|
|
220
|
+
container: Container;
|
|
221
|
+
agentId: string;
|
|
222
|
+
body: GetBody<'generate'> & {
|
|
223
|
+
resourceid?: string;
|
|
224
|
+
};
|
|
225
|
+
}): Promise<GenerateTextResult<any, any>>;
|
|
226
|
+
|
|
227
|
+
export declare function generateHandler_alias_1({ mastra, container, networkId, body, }: NetworkContext & {
|
|
228
|
+
container: Container;
|
|
229
|
+
body: {
|
|
230
|
+
messages?: Parameters<AgentNetwork['generate']>[0];
|
|
231
|
+
} & Parameters<AgentNetwork['generate']>[1];
|
|
232
|
+
}): Promise<GenerateObjectResult<any>>;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Generate speech from text
|
|
236
|
+
*/
|
|
237
|
+
export declare function generateSpeechHandler({ mastra, agentId, body, }: VoiceContext & {
|
|
238
|
+
body?: {
|
|
239
|
+
text?: string;
|
|
240
|
+
speakerId?: string;
|
|
241
|
+
};
|
|
242
|
+
}): Promise<{
|
|
243
|
+
audioData: Buffer<ArrayBuffer>;
|
|
244
|
+
}>;
|
|
245
|
+
|
|
246
|
+
export declare function getAgentByIdHandler({ mastra, agentId }: Context & {
|
|
247
|
+
agentId: string;
|
|
248
|
+
}): Promise<{
|
|
249
|
+
name: any;
|
|
250
|
+
instructions: string;
|
|
251
|
+
tools: any;
|
|
252
|
+
provider: string;
|
|
253
|
+
modelId: string;
|
|
254
|
+
}>;
|
|
255
|
+
|
|
256
|
+
export declare function getAgentsHandler({ mastra }: Context): Promise<any>;
|
|
257
|
+
|
|
258
|
+
declare type GetBody<T extends keyof Agent & {
|
|
259
|
+
[K in keyof Agent]: Agent[K] extends (...args: any) => any ? K : never;
|
|
260
|
+
}[keyof Agent]> = {
|
|
261
|
+
messages: Parameters<Agent[T]>[0];
|
|
262
|
+
} & Parameters<Agent[T]>[1];
|
|
263
|
+
|
|
264
|
+
export declare function getEvalsByAgentIdHandler({ mastra, agentId }: Context & {
|
|
265
|
+
agentId: string;
|
|
266
|
+
}): Promise<{
|
|
267
|
+
id: string;
|
|
268
|
+
name: any;
|
|
269
|
+
instructions: string;
|
|
270
|
+
evals: EvalRow[];
|
|
271
|
+
}>;
|
|
272
|
+
|
|
273
|
+
export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Context & {
|
|
274
|
+
agentId: string;
|
|
275
|
+
}): Promise<{
|
|
276
|
+
id: string;
|
|
277
|
+
name: any;
|
|
278
|
+
instructions: string;
|
|
279
|
+
evals: EvalRow[];
|
|
280
|
+
}>;
|
|
281
|
+
|
|
282
|
+
export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
|
|
283
|
+
|
|
284
|
+
export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
|
|
285
|
+
|
|
286
|
+
export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
|
|
287
|
+
transports: string[];
|
|
288
|
+
}>;
|
|
289
|
+
|
|
290
|
+
export declare function getMemoryStatusHandler({ mastra, agentId }: Pick<MemoryContext, 'mastra' | 'agentId'>): Promise<{
|
|
291
|
+
result: boolean;
|
|
292
|
+
}>;
|
|
293
|
+
|
|
294
|
+
export declare function getMessagesHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<{
|
|
295
|
+
messages: CoreMessage[];
|
|
296
|
+
uiMessages: Message_2[];
|
|
297
|
+
}>;
|
|
298
|
+
|
|
299
|
+
export declare function getNetworkByIdHandler({ mastra, networkId }: Pick<NetworkContext, 'mastra' | 'networkId'>): Promise<{
|
|
300
|
+
id: string;
|
|
301
|
+
name: string;
|
|
302
|
+
instructions: string;
|
|
303
|
+
agents: {
|
|
304
|
+
name: string;
|
|
305
|
+
provider: string;
|
|
306
|
+
modelId: string;
|
|
307
|
+
}[];
|
|
308
|
+
routingModel: {
|
|
309
|
+
provider: string;
|
|
310
|
+
modelId: string;
|
|
311
|
+
};
|
|
312
|
+
}>;
|
|
313
|
+
|
|
314
|
+
export declare function getNetworksHandler({ mastra }: Pick<NetworkContext, 'mastra'>): Promise<{
|
|
315
|
+
id: string;
|
|
316
|
+
name: string;
|
|
317
|
+
instructions: string;
|
|
318
|
+
agents: {
|
|
319
|
+
name: string;
|
|
320
|
+
provider: string;
|
|
321
|
+
modelId: string;
|
|
322
|
+
}[];
|
|
323
|
+
routingModel: {
|
|
324
|
+
provider: string;
|
|
325
|
+
modelId: string;
|
|
326
|
+
};
|
|
327
|
+
}[]>;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Get available speakers for an agent
|
|
331
|
+
*/
|
|
332
|
+
export declare function getSpeakersHandler({ mastra, agentId }: VoiceContext): Promise<{
|
|
333
|
+
voiceId: string;
|
|
334
|
+
}[]>;
|
|
335
|
+
|
|
336
|
+
export declare type GetTaskPushNotificationRequest = JSONRPCRequest & {
|
|
337
|
+
method: 'tasks/pushNotification/get';
|
|
338
|
+
params: TaskIdParams;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
export declare type GetTaskPushNotificationResponse = JSONRPCResponse & {
|
|
342
|
+
result?: TaskPushNotificationConfig | null;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
export declare type GetTaskRequest = JSONRPCRequest & {
|
|
346
|
+
method: 'tasks/get';
|
|
347
|
+
params: TaskQueryParams;
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
export declare type GetTaskResponse = JSONRPCResponse & {
|
|
351
|
+
result?: Task | null;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
export declare function getTelemetryHandler({ mastra, body }: TelemetryContext): Promise<any[]>;
|
|
355
|
+
|
|
356
|
+
export declare function getThreadByIdHandler({ mastra, agentId, threadId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'>): Promise<StorageThreadType>;
|
|
357
|
+
|
|
358
|
+
export declare function getThreadsHandler({ mastra, agentId, resourceId, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'resourceId'>): Promise<StorageThreadType[]>;
|
|
359
|
+
|
|
360
|
+
export declare function getToolByIdHandler({ tools, toolId }: Pick<ToolsContext, 'tools' | 'toolId'>): Promise<any>;
|
|
361
|
+
|
|
362
|
+
export declare function getToolsHandler({ tools }: Pick<ToolsContext, 'tools'>): Promise<Record<string, any>>;
|
|
363
|
+
|
|
364
|
+
export declare function getWorkflowByIdHandler({ mastra, workflowId }: WorkflowContext): Promise<{
|
|
365
|
+
stepGraph: StepGraph;
|
|
366
|
+
stepSubscriberGraph: Record<string, StepGraph>;
|
|
367
|
+
serializedStepGraph: StepGraph;
|
|
368
|
+
serializedStepSubscriberGraph: Record<string, StepGraph>;
|
|
369
|
+
name: string;
|
|
370
|
+
triggerSchema: string | undefined;
|
|
371
|
+
steps: any;
|
|
372
|
+
}>;
|
|
373
|
+
|
|
374
|
+
export declare function getWorkflowRunHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReturnType<Workflow['getRun']>>;
|
|
375
|
+
|
|
376
|
+
export declare function getWorkflowRunsHandler({ mastra, workflowId }: WorkflowContext): Promise<WorkflowRuns>;
|
|
377
|
+
|
|
378
|
+
export declare function getWorkflowsHandler({ mastra }: WorkflowContext): Promise<any>;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Handle a JSON-RPC request for the A2A protocol
|
|
382
|
+
*/
|
|
383
|
+
export declare function handleA2ARequest({ request, agent, }: {
|
|
384
|
+
request: A2ARequest;
|
|
385
|
+
agent: Agent;
|
|
386
|
+
}): Promise<JSONRPCResponse>;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Handle a request for the agent card
|
|
390
|
+
*/
|
|
391
|
+
export declare function handleAgentCardRequest({ agent, baseUrl }: {
|
|
392
|
+
agent: Agent;
|
|
393
|
+
baseUrl: string;
|
|
394
|
+
}): AgentCard;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Handle a tasks/cancel request
|
|
398
|
+
*/
|
|
399
|
+
export declare function handleCancelTask({ request }: {
|
|
400
|
+
request: CancelTaskRequest;
|
|
401
|
+
}): Promise<JSONRPCResponse>;
|
|
402
|
+
|
|
403
|
+
export declare function handleError(error: unknown, defaultMessage: string): never;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Handle a tasks/get request
|
|
407
|
+
*/
|
|
408
|
+
export declare function handleGetTask({ request }: {
|
|
409
|
+
request: GetTaskRequest;
|
|
410
|
+
}): Promise<JSONRPCResponse>;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Handle push notification requests
|
|
414
|
+
*/
|
|
415
|
+
export declare function handlePushNotification(): JSONRPCResponse;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Handle a tasks/send request
|
|
419
|
+
*/
|
|
420
|
+
export declare function handleSendTask({ request, agent, }: {
|
|
421
|
+
request: SendTaskRequest;
|
|
422
|
+
agent: Agent;
|
|
423
|
+
}): Promise<JSONRPCResponse>;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* `HTTPException` must be used when a fatal error such as authentication failure occurs.
|
|
427
|
+
*
|
|
428
|
+
* @see {@link https://hono.dev/docs/api/exception}
|
|
429
|
+
*
|
|
430
|
+
* @param {StatusCode} status - status code of HTTPException
|
|
431
|
+
* @param {HTTPExceptionOptions} options - options of HTTPException
|
|
432
|
+
* @param {HTTPExceptionOptions["res"]} options.res - response of options of HTTPException
|
|
433
|
+
* @param {HTTPExceptionOptions["message"]} options.message - message of options of HTTPException
|
|
434
|
+
* @param {HTTPExceptionOptions["cause"]} options.cause - cause of options of HTTPException
|
|
435
|
+
*
|
|
436
|
+
* @example
|
|
437
|
+
* ```ts
|
|
438
|
+
* import { HTTPException } from 'hono/http-exception'
|
|
439
|
+
*
|
|
440
|
+
* // ...
|
|
441
|
+
*
|
|
442
|
+
* app.post('/auth', async (c, next) => {
|
|
443
|
+
* // authentication
|
|
444
|
+
* if (authorized === false) {
|
|
445
|
+
* throw new HTTPException(401, { message: 'Custom error message' })
|
|
446
|
+
* }
|
|
447
|
+
* await next()
|
|
448
|
+
* })
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
451
|
+
export declare class HTTPException extends Error {
|
|
452
|
+
readonly res?: Response;
|
|
453
|
+
readonly status: StatusCode;
|
|
454
|
+
/**
|
|
455
|
+
* Creates an instance of `HTTPException`.
|
|
456
|
+
* @param status - HTTP status code for the exception. Defaults to 500.
|
|
457
|
+
* @param options - Additional options for the exception.
|
|
458
|
+
*/
|
|
459
|
+
constructor(status?: StatusCode, options?: HTTPExceptionOptions);
|
|
460
|
+
/**
|
|
461
|
+
* Returns the response object associated with the exception.
|
|
462
|
+
* If a response object is not provided, a new response is created with the error message and status code.
|
|
463
|
+
* @returns The response object.
|
|
464
|
+
*/
|
|
465
|
+
getResponse(): Response;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Options for creating an `HTTPException`.
|
|
470
|
+
* @property res - Optional response object to use.
|
|
471
|
+
* @property message - Optional custom error message.
|
|
472
|
+
* @property cause - Optional cause of the error.
|
|
473
|
+
*/
|
|
474
|
+
declare type HTTPExceptionOptions = {
|
|
475
|
+
res?: Response;
|
|
476
|
+
message?: string;
|
|
477
|
+
cause?: unknown;
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* @module
|
|
482
|
+
* This module provides the `HTTPException` class.
|
|
483
|
+
*/
|
|
484
|
+
declare type InfoStatusCode = 100 | 101 | 102 | 103;
|
|
485
|
+
|
|
486
|
+
export declare type JSONRPCError = {
|
|
487
|
+
code: number;
|
|
488
|
+
message: string;
|
|
489
|
+
data?: Record<string, any> | null;
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* A2A Protocol Types
|
|
494
|
+
* Based on the A2A Protocol Schema
|
|
495
|
+
*/
|
|
496
|
+
export declare type JSONRPCMessage = {
|
|
497
|
+
jsonrpc: '2.0';
|
|
498
|
+
id?: string | number | null;
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
export declare type JSONRPCRequest = JSONRPCMessage & {
|
|
502
|
+
method: string;
|
|
503
|
+
params?: Record<string, any> | null;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
export declare type JSONRPCResponse = JSONRPCMessage & {
|
|
507
|
+
result?: any | null;
|
|
508
|
+
error?: JSONRPCError | null;
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
export declare function listIndexes({ mastra, vectorName }: Pick<VectorContext, 'mastra' | 'vectorName'>): Promise<string[]>;
|
|
512
|
+
|
|
513
|
+
export declare namespace logs {
|
|
514
|
+
export {
|
|
515
|
+
getLogsHandler,
|
|
516
|
+
getLogsByRunIdHandler,
|
|
517
|
+
getLogTransports
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
declare type LogsContext = {
|
|
522
|
+
mastra: Mastra;
|
|
523
|
+
transportId?: string;
|
|
524
|
+
runId?: string;
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
export declare namespace memory {
|
|
528
|
+
export {
|
|
529
|
+
getMemoryStatusHandler,
|
|
530
|
+
getThreadsHandler,
|
|
531
|
+
getThreadByIdHandler,
|
|
532
|
+
saveMessagesHandler,
|
|
533
|
+
createThreadHandler,
|
|
534
|
+
updateThreadHandler,
|
|
535
|
+
deleteThreadHandler,
|
|
536
|
+
getMessagesHandler
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
declare interface MemoryContext extends Context {
|
|
541
|
+
agentId?: string;
|
|
542
|
+
resourceId?: string;
|
|
543
|
+
threadId?: string;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
export declare type Message = {
|
|
547
|
+
role: 'user' | 'agent';
|
|
548
|
+
parts: Part[];
|
|
549
|
+
metadata?: Record<string, any> | null;
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
export declare class MockAgent extends Agent {
|
|
553
|
+
constructor(config: AgentConfig);
|
|
554
|
+
run(_args: any): Promise<string>;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export declare namespace network {
|
|
558
|
+
export {
|
|
559
|
+
getNetworksHandler,
|
|
560
|
+
getNetworkByIdHandler,
|
|
561
|
+
generateHandler_alias_1 as generateHandler,
|
|
562
|
+
streamGenerateHandler_alias_1 as streamGenerateHandler
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
declare interface NetworkContext extends Context {
|
|
567
|
+
networkId?: string;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export declare type Part = TextPart | FilePart | DataPart;
|
|
571
|
+
|
|
572
|
+
export declare type PushNotificationConfig = {
|
|
573
|
+
url: string;
|
|
574
|
+
token?: string | null;
|
|
575
|
+
authentication?: AuthenticationInfo | null;
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
declare interface QueryRequest {
|
|
579
|
+
indexName: string;
|
|
580
|
+
queryVector: number[];
|
|
581
|
+
topK?: number;
|
|
582
|
+
filter?: Record<string, any>;
|
|
583
|
+
includeVector?: boolean;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export declare function queryVectors({ mastra, vectorName, query, }: Pick<VectorContext, 'mastra' | 'vectorName'> & {
|
|
587
|
+
query: QueryRequest;
|
|
588
|
+
}): Promise<QueryResult[]>;
|
|
589
|
+
|
|
590
|
+
declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
|
|
591
|
+
|
|
592
|
+
export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
|
|
593
|
+
body: {
|
|
594
|
+
stepId: string;
|
|
595
|
+
context: any;
|
|
596
|
+
};
|
|
597
|
+
container: Container;
|
|
598
|
+
}): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
|
|
599
|
+
|
|
600
|
+
export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
|
|
601
|
+
body: {
|
|
602
|
+
stepId: string;
|
|
603
|
+
context: any;
|
|
604
|
+
};
|
|
605
|
+
container: Container;
|
|
606
|
+
}): Promise<{
|
|
607
|
+
message: string;
|
|
608
|
+
}>;
|
|
609
|
+
|
|
610
|
+
export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<MemoryContext, 'mastra' | 'agentId'> & {
|
|
611
|
+
body: {
|
|
612
|
+
messages: Parameters<MastraMemory['saveMessages']>[0]['messages'];
|
|
613
|
+
};
|
|
614
|
+
}): Promise<MessageType[]>;
|
|
615
|
+
|
|
616
|
+
export declare type SendTaskRequest = JSONRPCRequest & {
|
|
617
|
+
method: 'tasks/send';
|
|
618
|
+
params: TaskSendParams;
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
export declare type SendTaskResponse = JSONRPCResponse & {
|
|
622
|
+
result?: Task | null;
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
export declare type SendTaskStreamingRequest = JSONRPCRequest & {
|
|
626
|
+
method: 'tasks/sendSubscribe';
|
|
627
|
+
params: TaskSendParams;
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
export declare type SendTaskStreamingResponse = JSONRPCResponse & {
|
|
631
|
+
result?: TaskStatusUpdateEvent | TaskArtifactUpdateEvent | null;
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
635
|
+
|
|
636
|
+
export declare type SetTaskPushNotificationRequest = JSONRPCRequest & {
|
|
637
|
+
method: 'tasks/pushNotification/set';
|
|
638
|
+
params: TaskPushNotificationConfig;
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
export declare type SetTaskPushNotificationResponse = JSONRPCResponse & {
|
|
642
|
+
result?: TaskPushNotificationConfig | null;
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
export declare function startAsyncWorkflowHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
646
|
+
triggerData?: unknown;
|
|
647
|
+
container: Container;
|
|
648
|
+
}): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
|
|
649
|
+
|
|
650
|
+
export declare function startWorkflowRunHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
|
|
651
|
+
triggerData?: unknown;
|
|
652
|
+
container: Container;
|
|
653
|
+
}): Promise<{
|
|
654
|
+
message: string;
|
|
655
|
+
}>;
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* If you want to use an unofficial status, use `UnofficialStatusCode`.
|
|
659
|
+
*/
|
|
660
|
+
export declare type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode;
|
|
661
|
+
|
|
662
|
+
export declare function storeTelemetryHandler({ mastra, body }: Context & {
|
|
663
|
+
body: {
|
|
664
|
+
resourceSpans: any[];
|
|
665
|
+
};
|
|
666
|
+
}): Promise<{
|
|
667
|
+
status: string;
|
|
668
|
+
message: string;
|
|
669
|
+
error: any;
|
|
670
|
+
} | {
|
|
671
|
+
status: string;
|
|
672
|
+
message: string;
|
|
673
|
+
traceCount: number;
|
|
674
|
+
}>;
|
|
675
|
+
|
|
676
|
+
export declare function streamGenerateHandler({ mastra, container, agentId, body, }: Context & {
|
|
677
|
+
container: Container;
|
|
678
|
+
agentId: string;
|
|
679
|
+
body: GetBody<'stream'> & {
|
|
680
|
+
resourceid?: string;
|
|
681
|
+
};
|
|
682
|
+
}): Promise<Response | undefined>;
|
|
683
|
+
|
|
684
|
+
export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, container, }: NetworkContext & {
|
|
685
|
+
container: Container;
|
|
686
|
+
body: {
|
|
687
|
+
messages?: Parameters<AgentNetwork['stream']>[0];
|
|
688
|
+
} & Parameters<AgentNetwork['stream']>[1];
|
|
689
|
+
}): Promise<Response>;
|
|
690
|
+
|
|
691
|
+
declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226;
|
|
692
|
+
|
|
693
|
+
export declare type Task = {
|
|
694
|
+
id: string;
|
|
695
|
+
sessionId?: string | null;
|
|
696
|
+
status: TaskStatus;
|
|
697
|
+
artifacts?: Artifact[] | null;
|
|
698
|
+
history?: Message[] | null;
|
|
699
|
+
metadata?: Record<string, any> | null;
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
export declare type TaskArtifactUpdateEvent = {
|
|
703
|
+
id: string;
|
|
704
|
+
artifact: Artifact;
|
|
705
|
+
metadata?: Record<string, any> | null;
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
export declare type TaskIdParams = {
|
|
709
|
+
id: string;
|
|
710
|
+
metadata?: Record<string, any> | null;
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
export declare type TaskPushNotificationConfig = {
|
|
714
|
+
id: string;
|
|
715
|
+
pushNotificationConfig: PushNotificationConfig;
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
export declare type TaskQueryParams = {
|
|
719
|
+
id: string;
|
|
720
|
+
historyLength?: number | null;
|
|
721
|
+
metadata?: Record<string, any> | null;
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
export declare type TaskResubscriptionRequest = JSONRPCRequest & {
|
|
725
|
+
method: 'tasks/resubscribe';
|
|
726
|
+
params: TaskQueryParams;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
export declare type TaskSendParams = {
|
|
730
|
+
id: string;
|
|
731
|
+
sessionId?: string;
|
|
732
|
+
message: Message;
|
|
733
|
+
pushNotification?: PushNotificationConfig | null;
|
|
734
|
+
historyLength?: number | null;
|
|
735
|
+
metadata?: Record<string, any> | null;
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
export declare enum TaskState {
|
|
739
|
+
SUBMITTED = "submitted",
|
|
740
|
+
WORKING = "working",
|
|
741
|
+
INPUT_REQUIRED = "input-required",
|
|
742
|
+
COMPLETED = "completed",
|
|
743
|
+
CANCELED = "canceled",
|
|
744
|
+
FAILED = "failed",
|
|
745
|
+
UNKNOWN = "unknown"
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
export declare type TaskStatus = {
|
|
749
|
+
state: TaskState;
|
|
750
|
+
message?: Message | null;
|
|
751
|
+
timestamp?: string;
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
export declare type TaskStatusUpdateEvent = {
|
|
755
|
+
id: string;
|
|
756
|
+
status: TaskStatus;
|
|
757
|
+
final?: boolean;
|
|
758
|
+
metadata?: Record<string, any> | null;
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
export declare namespace telemetry {
|
|
762
|
+
export {
|
|
763
|
+
getTelemetryHandler,
|
|
764
|
+
storeTelemetryHandler
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
declare interface TelemetryContext extends Context {
|
|
769
|
+
body?: {
|
|
770
|
+
name?: string;
|
|
771
|
+
scope?: string;
|
|
772
|
+
page?: number;
|
|
773
|
+
perPage?: number;
|
|
774
|
+
attribute?: string | string[];
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
export declare type TextPart = {
|
|
779
|
+
type: 'text';
|
|
780
|
+
text: string;
|
|
781
|
+
metadata?: Record<string, any> | null;
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
export declare namespace tools {
|
|
785
|
+
export {
|
|
786
|
+
getToolsHandler,
|
|
787
|
+
getToolByIdHandler,
|
|
788
|
+
executeToolHandler,
|
|
789
|
+
executeAgentToolHandler
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
declare interface ToolsContext extends Context {
|
|
794
|
+
tools?: Record<string, ToolAction | VercelTool>;
|
|
795
|
+
toolId?: string;
|
|
796
|
+
runId?: string;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Transcribe speech to text
|
|
801
|
+
*/
|
|
802
|
+
export declare function transcribeSpeechHandler({ mastra, agentId, body, }: VoiceContext & {
|
|
803
|
+
body?: {
|
|
804
|
+
audioData?: Buffer;
|
|
805
|
+
options?: Parameters<NonNullable<Agent['voice']>['listen']>[1];
|
|
806
|
+
};
|
|
807
|
+
}): Promise<{
|
|
808
|
+
text: string | void | NodeJS.ReadableStream;
|
|
809
|
+
}>;
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* @deprecated
|
|
813
|
+
* Use `UnofficialStatusCode` instead.
|
|
814
|
+
*/
|
|
815
|
+
export declare type UnOfficalStatusCode = UnofficialStatusCode;
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* `UnofficialStatusCode` can be used to specify an unofficial status code.
|
|
819
|
+
* @example
|
|
820
|
+
*
|
|
821
|
+
* ```ts
|
|
822
|
+
* app.get('/unknown', (c) => {
|
|
823
|
+
* return c.text("Unknown Error", 520 as UnofficialStatusCode)
|
|
824
|
+
* })
|
|
825
|
+
* ```
|
|
826
|
+
*/
|
|
827
|
+
export declare type UnofficialStatusCode = -1;
|
|
828
|
+
|
|
829
|
+
export declare function updateThreadHandler({ mastra, agentId, threadId, body, }: Pick<MemoryContext, 'mastra' | 'agentId' | 'threadId'> & {
|
|
830
|
+
body?: Parameters<MastraMemory['saveThread']>[0]['thread'];
|
|
831
|
+
}): Promise<StorageThreadType>;
|
|
832
|
+
|
|
833
|
+
declare interface UpsertRequest {
|
|
834
|
+
indexName: string;
|
|
835
|
+
vectors: number[][];
|
|
836
|
+
metadata?: Record<string, any>[];
|
|
837
|
+
ids?: string[];
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
export declare function upsertVectors({ mastra, vectorName, index }: VectorContext & {
|
|
841
|
+
index: UpsertRequest;
|
|
842
|
+
}): Promise<{
|
|
843
|
+
ids: string[];
|
|
844
|
+
}>;
|
|
845
|
+
|
|
846
|
+
export declare function validateBody(body: Record<string, unknown>): void;
|
|
847
|
+
|
|
848
|
+
export declare namespace vector {
|
|
849
|
+
export {
|
|
850
|
+
upsertVectors,
|
|
851
|
+
createIndex,
|
|
852
|
+
queryVectors,
|
|
853
|
+
listIndexes,
|
|
854
|
+
describeIndex,
|
|
855
|
+
deleteIndex
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
declare interface VectorContext extends Context {
|
|
860
|
+
vectorName?: string;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
export declare namespace voice {
|
|
864
|
+
export {
|
|
865
|
+
getSpeakersHandler,
|
|
866
|
+
generateSpeechHandler,
|
|
867
|
+
transcribeSpeechHandler
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
declare interface VoiceContext extends Context {
|
|
872
|
+
agentId?: string;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
|
|
876
|
+
|
|
877
|
+
declare interface WorkflowContext extends Context {
|
|
878
|
+
workflowId?: string;
|
|
879
|
+
runId?: string;
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
export declare namespace workflows {
|
|
883
|
+
export {
|
|
884
|
+
getWorkflowsHandler,
|
|
885
|
+
getWorkflowByIdHandler,
|
|
886
|
+
startAsyncWorkflowHandler,
|
|
887
|
+
getWorkflowRunHandler,
|
|
888
|
+
createRunHandler,
|
|
889
|
+
startWorkflowRunHandler,
|
|
890
|
+
watchWorkflowHandler,
|
|
891
|
+
resumeAsyncWorkflowHandler,
|
|
892
|
+
resumeWorkflowHandler,
|
|
893
|
+
getWorkflowRunsHandler
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
export { }
|