@mastra/client-js 0.0.0-ai-v5-20250729181825 → 0.0.0-ai-v5-20250813235735

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.
Files changed (66) hide show
  1. package/.turbo/turbo-build.log +18 -0
  2. package/CHANGELOG.md +215 -20
  3. package/dist/adapters/agui.d.ts +22 -0
  4. package/dist/adapters/agui.d.ts.map +1 -0
  5. package/dist/client.d.ts +270 -0
  6. package/dist/client.d.ts.map +1 -0
  7. package/dist/example.d.ts +2 -0
  8. package/dist/example.d.ts.map +1 -0
  9. package/dist/index.cjs +85 -41
  10. package/dist/index.cjs.map +1 -0
  11. package/dist/index.d.ts +3 -1331
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +82 -38
  14. package/dist/index.js.map +1 -0
  15. package/dist/resources/a2a.d.ts +41 -0
  16. package/dist/resources/a2a.d.ts.map +1 -0
  17. package/dist/resources/agent.d.ts +123 -0
  18. package/dist/resources/agent.d.ts.map +1 -0
  19. package/dist/resources/base.d.ts +13 -0
  20. package/dist/resources/base.d.ts.map +1 -0
  21. package/dist/resources/index.d.ts +11 -0
  22. package/dist/resources/index.d.ts.map +1 -0
  23. package/dist/resources/legacy-workflow.d.ts +87 -0
  24. package/dist/resources/legacy-workflow.d.ts.map +1 -0
  25. package/dist/resources/mcp-tool.d.ts +27 -0
  26. package/dist/resources/mcp-tool.d.ts.map +1 -0
  27. package/dist/resources/memory-thread.d.ts +53 -0
  28. package/dist/resources/memory-thread.d.ts.map +1 -0
  29. package/dist/resources/network-memory-thread.d.ts +47 -0
  30. package/dist/resources/network-memory-thread.d.ts.map +1 -0
  31. package/dist/resources/network.d.ts +30 -0
  32. package/dist/resources/network.d.ts.map +1 -0
  33. package/dist/resources/tool.d.ts +23 -0
  34. package/dist/resources/tool.d.ts.map +1 -0
  35. package/dist/resources/vNextNetwork.d.ts +42 -0
  36. package/dist/resources/vNextNetwork.d.ts.map +1 -0
  37. package/dist/resources/vector.d.ts +48 -0
  38. package/dist/resources/vector.d.ts.map +1 -0
  39. package/dist/resources/workflow.d.ts +154 -0
  40. package/dist/resources/workflow.d.ts.map +1 -0
  41. package/dist/types.d.ts +427 -0
  42. package/dist/types.d.ts.map +1 -0
  43. package/dist/utils/index.d.ts +3 -0
  44. package/dist/utils/index.d.ts.map +1 -0
  45. package/dist/utils/process-client-tools.d.ts +3 -0
  46. package/dist/utils/process-client-tools.d.ts.map +1 -0
  47. package/dist/utils/zod-to-json-schema.d.ts +105 -0
  48. package/dist/utils/zod-to-json-schema.d.ts.map +1 -0
  49. package/integration-tests/agui-adapter.test.ts +122 -0
  50. package/integration-tests/package.json +17 -0
  51. package/integration-tests/src/mastra/index.ts +38 -0
  52. package/integration-tests/vitest.config.ts +9 -0
  53. package/package.json +12 -8
  54. package/src/adapters/agui.test.ts +145 -3
  55. package/src/adapters/agui.ts +41 -17
  56. package/src/client.ts +8 -0
  57. package/src/resources/a2a.ts +35 -25
  58. package/src/resources/agent.ts +26 -18
  59. package/src/resources/base.ts +1 -0
  60. package/src/resources/network.ts +1 -1
  61. package/src/types.ts +1 -1
  62. package/src/utils/process-client-tools.ts +1 -1
  63. package/tsconfig.build.json +9 -0
  64. package/tsconfig.json +1 -1
  65. package/tsup.config.ts +17 -0
  66. package/dist/index.d.cts +0 -1331
package/dist/index.d.ts CHANGED
@@ -1,1331 +1,3 @@
1
- import { AbstractAgent } from '@ag-ui/client';
2
- import { ServerInfo, MCPToolType, ServerDetailInfo } from '@mastra/core/mcp';
3
- import { UIMessage, processDataStream } from '@ai-sdk/ui-utils';
4
- import { GenerateReturn } from '@mastra/core/llm';
5
- import { JSONSchema7 } from 'json-schema';
6
- import { ZodSchema } from 'zod';
7
- import { CoreMessage, StorageThreadType, StorageGetMessagesArg, PaginationInfo, MastraMessageV1, MastraMessageV2, LegacyWorkflowRuns, WorkflowRuns, WorkflowRun, QueryResult, GenerateReturn as GenerateReturn$1 } from '@mastra/core';
8
- import { AgentGenerateOptions, AgentStreamOptions, ToolsInput } from '@mastra/core/agent';
9
- import { LogLevel, BaseLogMessage } from '@mastra/core/logger';
10
- import { RuntimeContext } from '@mastra/core/runtime-context';
11
- import { MastraScorerEntry, ScoreRowData } from '@mastra/core/scores';
12
- import { Workflow as Workflow$1, WatchEvent, WorkflowResult } from '@mastra/core/workflows';
13
- import { StepAction, StepGraph, LegacyWorkflowRunResult as LegacyWorkflowRunResult$1 } from '@mastra/core/workflows/legacy';
14
- import * as stream_web from 'stream/web';
15
- import { AgentCard, TaskSendParams, Task, TaskQueryParams, TaskIdParams } from '@mastra/core/a2a';
16
-
17
- interface ClientOptions {
18
- /** Base URL for API requests */
19
- baseUrl: string;
20
- /** Number of retry attempts for failed requests */
21
- retries?: number;
22
- /** Initial backoff time in milliseconds between retries */
23
- backoffMs?: number;
24
- /** Maximum backoff time in milliseconds between retries */
25
- maxBackoffMs?: number;
26
- /** Custom headers to include with requests */
27
- headers?: Record<string, string>;
28
- /** Abort signal for request */
29
- abortSignal?: AbortSignal;
30
- }
31
- interface RequestOptions {
32
- method?: string;
33
- headers?: Record<string, string>;
34
- body?: any;
35
- stream?: boolean;
36
- }
37
- type WithoutMethods<T> = {
38
- [K in keyof T as T[K] extends (...args: any[]) => any ? never : T[K] extends {
39
- (): any;
40
- } ? never : T[K] extends undefined | ((...args: any[]) => any) ? never : K]: T[K];
41
- };
42
- interface GetAgentResponse {
43
- name: string;
44
- instructions: string;
45
- tools: Record<string, GetToolResponse>;
46
- workflows: Record<string, GetWorkflowResponse>;
47
- provider: string;
48
- modelId: string;
49
- defaultGenerateOptions: WithoutMethods<AgentGenerateOptions>;
50
- defaultStreamOptions: WithoutMethods<AgentStreamOptions>;
51
- }
52
- type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
53
- messages: string | string[] | CoreMessage[] | UIMessage[];
54
- output?: T;
55
- experimental_output?: T;
56
- runtimeContext?: RuntimeContext | Record<string, any>;
57
- clientTools?: ToolsInput;
58
- } & WithoutMethods<Omit<AgentGenerateOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>>;
59
- type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
60
- messages: string | string[] | CoreMessage[] | UIMessage[];
61
- output?: T;
62
- experimental_output?: T;
63
- runtimeContext?: RuntimeContext | Record<string, any>;
64
- clientTools?: ToolsInput;
65
- } & WithoutMethods<Omit<AgentStreamOptions<T>, 'output' | 'experimental_output' | 'runtimeContext' | 'clientTools' | 'abortSignal'>>;
66
- interface GetEvalsByAgentIdResponse extends GetAgentResponse {
67
- evals: any[];
68
- instructions: string;
69
- name: string;
70
- id: string;
71
- }
72
- interface GetToolResponse {
73
- id: string;
74
- description: string;
75
- inputSchema: string;
76
- outputSchema: string;
77
- }
78
- interface GetLegacyWorkflowResponse {
79
- name: string;
80
- triggerSchema: string;
81
- steps: Record<string, StepAction<any, any, any, any>>;
82
- stepGraph: StepGraph;
83
- stepSubscriberGraph: Record<string, StepGraph>;
84
- workflowId?: string;
85
- }
86
- interface GetWorkflowRunsParams {
87
- fromDate?: Date;
88
- toDate?: Date;
89
- limit?: number;
90
- offset?: number;
91
- resourceId?: string;
92
- }
93
- type GetLegacyWorkflowRunsResponse = LegacyWorkflowRuns;
94
- type GetWorkflowRunsResponse = WorkflowRuns;
95
- type GetWorkflowRunByIdResponse = WorkflowRun;
96
- type GetWorkflowRunExecutionResultResponse = WatchEvent['payload']['workflowState'];
97
- type LegacyWorkflowRunResult = {
98
- activePaths: Record<string, {
99
- status: string;
100
- suspendPayload?: any;
101
- stepPath: string[];
102
- }>;
103
- results: LegacyWorkflowRunResult$1<any, any, any>['results'];
104
- timestamp: number;
105
- runId: string;
106
- };
107
- interface GetWorkflowResponse {
108
- name: string;
109
- description?: string;
110
- steps: {
111
- [key: string]: {
112
- id: string;
113
- description: string;
114
- inputSchema: string;
115
- outputSchema: string;
116
- resumeSchema: string;
117
- suspendSchema: string;
118
- };
119
- };
120
- allSteps: {
121
- [key: string]: {
122
- id: string;
123
- description: string;
124
- inputSchema: string;
125
- outputSchema: string;
126
- resumeSchema: string;
127
- suspendSchema: string;
128
- isWorkflow: boolean;
129
- };
130
- };
131
- stepGraph: Workflow$1['serializedStepGraph'];
132
- inputSchema: string;
133
- outputSchema: string;
134
- }
135
- type WorkflowWatchResult = WatchEvent & {
136
- runId: string;
137
- };
138
- type WorkflowRunResult = WorkflowResult<any, any>;
139
- interface UpsertVectorParams {
140
- indexName: string;
141
- vectors: number[][];
142
- metadata?: Record<string, any>[];
143
- ids?: string[];
144
- }
145
- interface CreateIndexParams {
146
- indexName: string;
147
- dimension: number;
148
- metric?: 'cosine' | 'euclidean' | 'dotproduct';
149
- }
150
- interface QueryVectorParams {
151
- indexName: string;
152
- queryVector: number[];
153
- topK?: number;
154
- filter?: Record<string, any>;
155
- includeVector?: boolean;
156
- }
157
- interface QueryVectorResponse {
158
- results: QueryResult[];
159
- }
160
- interface GetVectorIndexResponse {
161
- dimension: number;
162
- metric: 'cosine' | 'euclidean' | 'dotproduct';
163
- count: number;
164
- }
165
- interface SaveMessageToMemoryParams {
166
- messages: (MastraMessageV1 | MastraMessageV2)[];
167
- agentId: string;
168
- }
169
- interface SaveNetworkMessageToMemoryParams {
170
- messages: (MastraMessageV1 | MastraMessageV2)[];
171
- networkId: string;
172
- }
173
- type SaveMessageToMemoryResponse = (MastraMessageV1 | MastraMessageV2)[];
174
- interface CreateMemoryThreadParams {
175
- title?: string;
176
- metadata?: Record<string, any>;
177
- resourceId: string;
178
- threadId?: string;
179
- agentId: string;
180
- }
181
- interface CreateNetworkMemoryThreadParams {
182
- title?: string;
183
- metadata?: Record<string, any>;
184
- resourceId: string;
185
- threadId?: string;
186
- networkId: string;
187
- }
188
- type CreateMemoryThreadResponse = StorageThreadType;
189
- interface GetMemoryThreadParams {
190
- resourceId: string;
191
- agentId: string;
192
- }
193
- interface GetNetworkMemoryThreadParams {
194
- resourceId: string;
195
- networkId: string;
196
- }
197
- type GetMemoryThreadResponse = StorageThreadType[];
198
- interface UpdateMemoryThreadParams {
199
- title: string;
200
- metadata: Record<string, any>;
201
- resourceId: string;
202
- }
203
- interface GetMemoryThreadMessagesParams {
204
- /**
205
- * Limit the number of messages to retrieve (default: 40)
206
- */
207
- limit?: number;
208
- /**
209
- * Format of UI messages to return (default: aiv5)
210
- */
211
- format?: 'aiv4' | 'aiv5';
212
- }
213
- type GetMemoryThreadMessagesPaginatedParams = Omit<StorageGetMessagesArg, 'threadConfig' | 'threadId'>;
214
- interface GetMemoryThreadMessagesResponse {
215
- messages: CoreMessage[];
216
- uiMessages: UIMessage[];
217
- }
218
- type GetMemoryThreadMessagesPaginatedResponse = PaginationInfo & {
219
- messages: MastraMessageV1[] | MastraMessageV2[];
220
- };
221
- interface GetLogsParams {
222
- transportId: string;
223
- fromDate?: Date;
224
- toDate?: Date;
225
- logLevel?: LogLevel;
226
- filters?: Record<string, string>;
227
- page?: number;
228
- perPage?: number;
229
- }
230
- interface GetLogParams {
231
- runId: string;
232
- transportId: string;
233
- fromDate?: Date;
234
- toDate?: Date;
235
- logLevel?: LogLevel;
236
- filters?: Record<string, string>;
237
- page?: number;
238
- perPage?: number;
239
- }
240
- type GetLogsResponse = {
241
- logs: BaseLogMessage[];
242
- total: number;
243
- page: number;
244
- perPage: number;
245
- hasMore: boolean;
246
- };
247
- type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
248
- type SpanStatus = {
249
- code: number;
250
- };
251
- type SpanOther = {
252
- droppedAttributesCount: number;
253
- droppedEventsCount: number;
254
- droppedLinksCount: number;
255
- };
256
- type SpanEventAttributes = {
257
- key: string;
258
- value: {
259
- [key: string]: string | number | boolean | null;
260
- };
261
- };
262
- type SpanEvent = {
263
- attributes: SpanEventAttributes[];
264
- name: string;
265
- timeUnixNano: string;
266
- droppedAttributesCount: number;
267
- };
268
- type Span = {
269
- id: string;
270
- parentSpanId: string | null;
271
- traceId: string;
272
- name: string;
273
- scope: string;
274
- kind: number;
275
- status: SpanStatus;
276
- events: SpanEvent[];
277
- links: any[];
278
- attributes: Record<string, string | number | boolean | null>;
279
- startTime: number;
280
- endTime: number;
281
- duration: number;
282
- other: SpanOther;
283
- createdAt: string;
284
- };
285
- interface GetTelemetryResponse {
286
- traces: Span[];
287
- }
288
- interface GetTelemetryParams {
289
- name?: string;
290
- scope?: string;
291
- page?: number;
292
- perPage?: number;
293
- attribute?: Record<string, string>;
294
- fromDate?: Date;
295
- toDate?: Date;
296
- }
297
- interface GetNetworkResponse {
298
- id: string;
299
- name: string;
300
- instructions: string;
301
- agents: Array<{
302
- name: string;
303
- provider: string;
304
- modelId: string;
305
- }>;
306
- routingModel: {
307
- provider: string;
308
- modelId: string;
309
- };
310
- state?: Record<string, any>;
311
- }
312
- interface GetVNextNetworkResponse {
313
- id: string;
314
- name: string;
315
- instructions: string;
316
- agents: Array<{
317
- name: string;
318
- provider: string;
319
- modelId: string;
320
- }>;
321
- routingModel: {
322
- provider: string;
323
- modelId: string;
324
- };
325
- workflows: Array<{
326
- name: string;
327
- description: string;
328
- inputSchema: string | undefined;
329
- outputSchema: string | undefined;
330
- }>;
331
- tools: Array<{
332
- id: string;
333
- description: string;
334
- }>;
335
- }
336
- interface GenerateVNextNetworkResponse {
337
- task: string;
338
- result: string;
339
- resourceId: string;
340
- resourceType: 'none' | 'tool' | 'agent' | 'workflow';
341
- }
342
- interface GenerateOrStreamVNextNetworkParams {
343
- message: string;
344
- threadId?: string;
345
- resourceId?: string;
346
- runtimeContext?: RuntimeContext | Record<string, any>;
347
- }
348
- interface LoopStreamVNextNetworkParams {
349
- message: string;
350
- threadId?: string;
351
- resourceId?: string;
352
- maxIterations?: number;
353
- runtimeContext?: RuntimeContext | Record<string, any>;
354
- }
355
- interface LoopVNextNetworkResponse {
356
- status: 'success';
357
- result: {
358
- task: string;
359
- resourceId: string;
360
- resourceType: 'agent' | 'workflow' | 'none' | 'tool';
361
- result: string;
362
- iteration: number;
363
- isOneOff: boolean;
364
- prompt: string;
365
- threadId?: string | undefined;
366
- threadResourceId?: string | undefined;
367
- isComplete?: boolean | undefined;
368
- completionReason?: string | undefined;
369
- };
370
- steps: WorkflowResult<any, any>['steps'];
371
- }
372
- interface McpServerListResponse {
373
- servers: ServerInfo[];
374
- next: string | null;
375
- total_count: number;
376
- }
377
- interface McpToolInfo {
378
- id: string;
379
- name: string;
380
- description?: string;
381
- inputSchema: string;
382
- toolType?: MCPToolType;
383
- }
384
- interface McpServerToolListResponse {
385
- tools: McpToolInfo[];
386
- }
387
- type ClientScoreRowData = Omit<ScoreRowData, 'createdAt' | 'updatedAt'> & {
388
- createdAt: string;
389
- updatedAt: string;
390
- };
391
- interface GetScoresByRunIdParams {
392
- runId: string;
393
- page?: number;
394
- perPage?: number;
395
- }
396
- interface GetScoresByScorerIdParams {
397
- scorerId: string;
398
- entityId?: string;
399
- entityType?: string;
400
- page?: number;
401
- perPage?: number;
402
- }
403
- interface GetScoresByEntityIdParams {
404
- entityId: string;
405
- entityType: string;
406
- page?: number;
407
- perPage?: number;
408
- }
409
- interface SaveScoreParams {
410
- score: Omit<ScoreRowData, 'id' | 'createdAt' | 'updatedAt'>;
411
- }
412
- interface GetScoresResponse {
413
- pagination: {
414
- total: number;
415
- page: number;
416
- perPage: number;
417
- hasMore: boolean;
418
- };
419
- scores: ClientScoreRowData[];
420
- }
421
- interface SaveScoreResponse {
422
- score: ClientScoreRowData;
423
- }
424
- type GetScorerResponse = MastraScorerEntry & {
425
- agentIds: string[];
426
- workflowIds: string[];
427
- };
428
- interface GetScorersResponse {
429
- scorers: Array<GetScorerResponse>;
430
- }
431
-
432
- declare class BaseResource {
433
- readonly options: ClientOptions;
434
- constructor(options: ClientOptions);
435
- /**
436
- * Makes an HTTP request to the API with retries and exponential backoff
437
- * @param path - The API endpoint path
438
- * @param options - Optional request configuration
439
- * @returns Promise containing the response data
440
- */
441
- request<T>(path: string, options?: RequestOptions): Promise<T>;
442
- }
443
-
444
- declare class AgentVoice extends BaseResource {
445
- private agentId;
446
- constructor(options: ClientOptions, agentId: string);
447
- /**
448
- * Convert text to speech using the agent's voice provider
449
- * @param text - Text to convert to speech
450
- * @param options - Optional provider-specific options for speech generation
451
- * @returns Promise containing the audio data
452
- */
453
- speak(text: string, options?: {
454
- speaker?: string;
455
- [key: string]: any;
456
- }): Promise<Response>;
457
- /**
458
- * Convert speech to text using the agent's voice provider
459
- * @param audio - Audio data to transcribe
460
- * @param options - Optional provider-specific options
461
- * @returns Promise containing the transcribed text
462
- */
463
- listen(audio: Blob, options?: Record<string, any>): Promise<{
464
- text: string;
465
- }>;
466
- /**
467
- * Get available speakers for the agent's voice provider
468
- * @returns Promise containing list of available speakers
469
- */
470
- getSpeakers(): Promise<Array<{
471
- voiceId: string;
472
- [key: string]: any;
473
- }>>;
474
- /**
475
- * Get the listener configuration for the agent's voice provider
476
- * @returns Promise containing a check if the agent has listening capabilities
477
- */
478
- getListener(): Promise<{
479
- enabled: boolean;
480
- }>;
481
- }
482
- declare class Agent extends BaseResource {
483
- private agentId;
484
- readonly voice: AgentVoice;
485
- constructor(options: ClientOptions, agentId: string);
486
- /**
487
- * Retrieves details about the agent
488
- * @returns Promise containing agent details including model and instructions
489
- */
490
- details(): Promise<GetAgentResponse>;
491
- /**
492
- * Generates a response from the agent
493
- * @param params - Generation parameters including prompt
494
- * @returns Promise containing the generated response
495
- */
496
- generate(params: GenerateParams<undefined> & {
497
- output?: never;
498
- experimental_output?: never;
499
- }): Promise<GenerateReturn<any, undefined, undefined>>;
500
- generate<Output extends JSONSchema7 | ZodSchema>(params: GenerateParams<Output> & {
501
- output: Output;
502
- experimental_output?: never;
503
- }): Promise<GenerateReturn<any, Output, undefined>>;
504
- generate<StructuredOutput extends JSONSchema7 | ZodSchema>(params: GenerateParams<StructuredOutput> & {
505
- output?: never;
506
- experimental_output: StructuredOutput;
507
- }): Promise<GenerateReturn<any, undefined, StructuredOutput>>;
508
- private processChatResponse;
509
- /**
510
- * Streams a response from the agent
511
- * @param params - Stream parameters including prompt
512
- * @returns Promise containing the enhanced Response object with processDataStream method
513
- */
514
- stream<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: StreamParams<T>): Promise<Response & {
515
- processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
516
- }>;
517
- /**
518
- * Processes the stream response and handles tool calls
519
- */
520
- private processStreamResponse;
521
- /**
522
- * Gets details about a specific tool available to the agent
523
- * @param toolId - ID of the tool to retrieve
524
- * @returns Promise containing tool details
525
- */
526
- getTool(toolId: string): Promise<GetToolResponse>;
527
- /**
528
- * Executes a tool for the agent
529
- * @param toolId - ID of the tool to execute
530
- * @param params - Parameters required for tool execution
531
- * @returns Promise containing the tool execution results
532
- */
533
- executeTool(toolId: string, params: {
534
- data: any;
535
- runtimeContext?: RuntimeContext;
536
- }): Promise<any>;
537
- /**
538
- * Retrieves evaluation results for the agent
539
- * @returns Promise containing agent evaluations
540
- */
541
- evals(): Promise<GetEvalsByAgentIdResponse>;
542
- /**
543
- * Retrieves live evaluation results for the agent
544
- * @returns Promise containing live agent evaluations
545
- */
546
- liveEvals(): Promise<GetEvalsByAgentIdResponse>;
547
- }
548
-
549
- declare class Network extends BaseResource {
550
- private networkId;
551
- constructor(options: ClientOptions, networkId: string);
552
- /**
553
- * Retrieves details about the network
554
- * @returns Promise containing network details
555
- */
556
- details(): Promise<GetNetworkResponse>;
557
- /**
558
- * Generates a response from the agent
559
- * @param params - Generation parameters including prompt
560
- * @returns Promise containing the generated response
561
- */
562
- generate<Output extends JSONSchema7 | ZodSchema | undefined = undefined, StructuredOutput extends JSONSchema7 | ZodSchema | undefined = undefined>(params: GenerateParams<Output>): Promise<GenerateReturn$1<any, Output, StructuredOutput>>;
563
- /**
564
- * Streams a response from the agent
565
- * @param params - Stream parameters including prompt
566
- * @returns Promise containing the enhanced Response object with processDataStream method
567
- */
568
- stream<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: StreamParams<T>): Promise<Response & {
569
- processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
570
- }>;
571
- }
572
-
573
- declare class MemoryThread extends BaseResource {
574
- private threadId;
575
- private agentId;
576
- constructor(options: ClientOptions, threadId: string, agentId: string);
577
- /**
578
- * Retrieves the memory thread details
579
- * @returns Promise containing thread details including title and metadata
580
- */
581
- get(): Promise<StorageThreadType>;
582
- /**
583
- * Updates the memory thread properties
584
- * @param params - Update parameters including title and metadata
585
- * @returns Promise containing updated thread details
586
- */
587
- update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
588
- /**
589
- * Deletes the memory thread
590
- * @returns Promise containing deletion result
591
- */
592
- delete(): Promise<{
593
- result: string;
594
- }>;
595
- /**
596
- * Retrieves messages associated with the thread
597
- * @param params - Optional parameters including limit for number of messages to retrieve
598
- * @returns Promise containing thread messages and UI messages
599
- */
600
- getMessages(params?: GetMemoryThreadMessagesParams): Promise<GetMemoryThreadMessagesResponse>;
601
- /**
602
- * Retrieves paginated messages associated with the thread with advanced filtering and selection options
603
- * @param params - Pagination parameters including selectBy criteria, page, perPage, date ranges, and message inclusion options
604
- * @returns Promise containing paginated thread messages with pagination metadata (total, page, perPage, hasMore)
605
- */
606
- getMessagesPaginated({ selectBy, ...rest }: GetMemoryThreadMessagesPaginatedParams): Promise<GetMemoryThreadMessagesPaginatedResponse>;
607
- /**
608
- * Deletes one or more messages from the thread
609
- * @param messageIds - Can be a single message ID (string), array of message IDs,
610
- * message object with id property, or array of message objects
611
- * @returns Promise containing deletion result
612
- */
613
- deleteMessages(messageIds: string | string[] | {
614
- id: string;
615
- } | {
616
- id: string;
617
- }[]): Promise<{
618
- success: boolean;
619
- message: string;
620
- }>;
621
- }
622
-
623
- declare class Vector extends BaseResource {
624
- private vectorName;
625
- constructor(options: ClientOptions, vectorName: string);
626
- /**
627
- * Retrieves details about a specific vector index
628
- * @param indexName - Name of the index to get details for
629
- * @returns Promise containing vector index details
630
- */
631
- details(indexName: string): Promise<GetVectorIndexResponse>;
632
- /**
633
- * Deletes a vector index
634
- * @param indexName - Name of the index to delete
635
- * @returns Promise indicating deletion success
636
- */
637
- delete(indexName: string): Promise<{
638
- success: boolean;
639
- }>;
640
- /**
641
- * Retrieves a list of all available indexes
642
- * @returns Promise containing array of index names
643
- */
644
- getIndexes(): Promise<{
645
- indexes: string[];
646
- }>;
647
- /**
648
- * Creates a new vector index
649
- * @param params - Parameters for index creation including dimension and metric
650
- * @returns Promise indicating creation success
651
- */
652
- createIndex(params: CreateIndexParams): Promise<{
653
- success: boolean;
654
- }>;
655
- /**
656
- * Upserts vectors into an index
657
- * @param params - Parameters containing vectors, metadata, and optional IDs
658
- * @returns Promise containing array of vector IDs
659
- */
660
- upsert(params: UpsertVectorParams): Promise<string[]>;
661
- /**
662
- * Queries vectors in an index
663
- * @param params - Query parameters including query vector and search options
664
- * @returns Promise containing query results
665
- */
666
- query(params: QueryVectorParams): Promise<QueryVectorResponse>;
667
- }
668
-
669
- declare class LegacyWorkflow extends BaseResource {
670
- private workflowId;
671
- constructor(options: ClientOptions, workflowId: string);
672
- /**
673
- * Retrieves details about the legacy workflow
674
- * @returns Promise containing legacy workflow details including steps and graphs
675
- */
676
- details(): Promise<GetLegacyWorkflowResponse>;
677
- /**
678
- * Retrieves all runs for a legacy workflow
679
- * @param params - Parameters for filtering runs
680
- * @returns Promise containing legacy workflow runs array
681
- */
682
- runs(params?: GetWorkflowRunsParams): Promise<GetLegacyWorkflowRunsResponse>;
683
- /**
684
- * Creates a new legacy workflow run
685
- * @returns Promise containing the generated run ID
686
- */
687
- createRun(params?: {
688
- runId?: string;
689
- }): Promise<{
690
- runId: string;
691
- }>;
692
- /**
693
- * Starts a legacy workflow run synchronously without waiting for the workflow to complete
694
- * @param params - Object containing the runId and triggerData
695
- * @returns Promise containing success message
696
- */
697
- start(params: {
698
- runId: string;
699
- triggerData: Record<string, any>;
700
- }): Promise<{
701
- message: string;
702
- }>;
703
- /**
704
- * Resumes a suspended legacy workflow step synchronously without waiting for the workflow to complete
705
- * @param stepId - ID of the step to resume
706
- * @param runId - ID of the legacy workflow run
707
- * @param context - Context to resume the legacy workflow with
708
- * @returns Promise containing the legacy workflow resume results
709
- */
710
- resume({ stepId, runId, context, }: {
711
- stepId: string;
712
- runId: string;
713
- context: Record<string, any>;
714
- }): Promise<{
715
- message: string;
716
- }>;
717
- /**
718
- * Starts a workflow run asynchronously and returns a promise that resolves when the workflow is complete
719
- * @param params - Object containing the optional runId and triggerData
720
- * @returns Promise containing the workflow execution results
721
- */
722
- startAsync(params: {
723
- runId?: string;
724
- triggerData: Record<string, any>;
725
- }): Promise<LegacyWorkflowRunResult>;
726
- /**
727
- * Resumes a suspended legacy workflow step asynchronously and returns a promise that resolves when the workflow is complete
728
- * @param params - Object containing the runId, stepId, and context
729
- * @returns Promise containing the workflow resume results
730
- */
731
- resumeAsync(params: {
732
- runId: string;
733
- stepId: string;
734
- context: Record<string, any>;
735
- }): Promise<LegacyWorkflowRunResult>;
736
- /**
737
- * Creates an async generator that processes a readable stream and yields records
738
- * separated by the Record Separator character (\x1E)
739
- *
740
- * @param stream - The readable stream to process
741
- * @returns An async generator that yields parsed records
742
- */
743
- private streamProcessor;
744
- /**
745
- * Watches legacy workflow transitions in real-time
746
- * @param runId - Optional run ID to filter the watch stream
747
- * @returns AsyncGenerator that yields parsed records from the legacy workflow watch stream
748
- */
749
- watch({ runId }: {
750
- runId?: string;
751
- }, onRecord: (record: LegacyWorkflowRunResult) => void): Promise<void>;
752
- }
753
-
754
- declare class Tool extends BaseResource {
755
- private toolId;
756
- constructor(options: ClientOptions, toolId: string);
757
- /**
758
- * Retrieves details about the tool
759
- * @returns Promise containing tool details including description and schemas
760
- */
761
- details(): Promise<GetToolResponse>;
762
- /**
763
- * Executes the tool with the provided parameters
764
- * @param params - Parameters required for tool execution
765
- * @returns Promise containing the tool execution results
766
- */
767
- execute(params: {
768
- data: any;
769
- runId?: string;
770
- runtimeContext?: RuntimeContext | Record<string, any>;
771
- }): Promise<any>;
772
- }
773
-
774
- declare class Workflow extends BaseResource {
775
- private workflowId;
776
- constructor(options: ClientOptions, workflowId: string);
777
- /**
778
- * Creates an async generator that processes a readable stream and yields workflow records
779
- * separated by the Record Separator character (\x1E)
780
- *
781
- * @param stream - The readable stream to process
782
- * @returns An async generator that yields parsed records
783
- */
784
- private streamProcessor;
785
- /**
786
- * Retrieves details about the workflow
787
- * @returns Promise containing workflow details including steps and graphs
788
- */
789
- details(): Promise<GetWorkflowResponse>;
790
- /**
791
- * Retrieves all runs for a workflow
792
- * @param params - Parameters for filtering runs
793
- * @returns Promise containing workflow runs array
794
- */
795
- runs(params?: GetWorkflowRunsParams): Promise<GetWorkflowRunsResponse>;
796
- /**
797
- * Retrieves a specific workflow run by its ID
798
- * @param runId - The ID of the workflow run to retrieve
799
- * @returns Promise containing the workflow run details
800
- */
801
- runById(runId: string): Promise<GetWorkflowRunByIdResponse>;
802
- /**
803
- * Retrieves the execution result for a specific workflow run by its ID
804
- * @param runId - The ID of the workflow run to retrieve the execution result for
805
- * @returns Promise containing the workflow run execution result
806
- */
807
- runExecutionResult(runId: string): Promise<GetWorkflowRunExecutionResultResponse>;
808
- /**
809
- * Cancels a specific workflow run by its ID
810
- * @param runId - The ID of the workflow run to cancel
811
- * @returns Promise containing a success message
812
- */
813
- cancelRun(runId: string): Promise<{
814
- message: string;
815
- }>;
816
- /**
817
- * Sends an event to a specific workflow run by its ID
818
- * @param params - Object containing the runId, event and data
819
- * @returns Promise containing a success message
820
- */
821
- sendRunEvent(params: {
822
- runId: string;
823
- event: string;
824
- data: unknown;
825
- }): Promise<{
826
- message: string;
827
- }>;
828
- /**
829
- * Creates a new workflow run
830
- * @param params - Optional object containing the optional runId
831
- * @returns Promise containing the runId of the created run
832
- */
833
- createRun(params?: {
834
- runId?: string;
835
- }): Promise<{
836
- runId: string;
837
- }>;
838
- /**
839
- * Creates a new workflow run (alias for createRun)
840
- * @param params - Optional object containing the optional runId
841
- * @returns Promise containing the runId of the created run
842
- */
843
- createRunAsync(params?: {
844
- runId?: string;
845
- }): Promise<{
846
- runId: string;
847
- }>;
848
- /**
849
- * Starts a workflow run synchronously without waiting for the workflow to complete
850
- * @param params - Object containing the runId, inputData and runtimeContext
851
- * @returns Promise containing success message
852
- */
853
- start(params: {
854
- runId: string;
855
- inputData: Record<string, any>;
856
- runtimeContext?: RuntimeContext | Record<string, any>;
857
- }): Promise<{
858
- message: string;
859
- }>;
860
- /**
861
- * Resumes a suspended workflow step synchronously without waiting for the workflow to complete
862
- * @param params - Object containing the runId, step, resumeData and runtimeContext
863
- * @returns Promise containing success message
864
- */
865
- resume({ step, runId, resumeData, ...rest }: {
866
- step: string | string[];
867
- runId: string;
868
- resumeData?: Record<string, any>;
869
- runtimeContext?: RuntimeContext | Record<string, any>;
870
- }): Promise<{
871
- message: string;
872
- }>;
873
- /**
874
- * Starts a workflow run asynchronously and returns a promise that resolves when the workflow is complete
875
- * @param params - Object containing the optional runId, inputData and runtimeContext
876
- * @returns Promise containing the workflow execution results
877
- */
878
- startAsync(params: {
879
- runId?: string;
880
- inputData: Record<string, any>;
881
- runtimeContext?: RuntimeContext | Record<string, any>;
882
- }): Promise<WorkflowRunResult>;
883
- /**
884
- * Starts a workflow run and returns a stream
885
- * @param params - Object containing the optional runId, inputData and runtimeContext
886
- * @returns Promise containing the workflow execution results
887
- */
888
- stream(params: {
889
- runId?: string;
890
- inputData: Record<string, any>;
891
- runtimeContext?: RuntimeContext;
892
- }): Promise<stream_web.ReadableStream<{
893
- type: string;
894
- payload: any;
895
- }>>;
896
- /**
897
- * Resumes a suspended workflow step asynchronously and returns a promise that resolves when the workflow is complete
898
- * @param params - Object containing the runId, step, resumeData and runtimeContext
899
- * @returns Promise containing the workflow resume results
900
- */
901
- resumeAsync(params: {
902
- runId: string;
903
- step: string | string[];
904
- resumeData?: Record<string, any>;
905
- runtimeContext?: RuntimeContext | Record<string, any>;
906
- }): Promise<WorkflowRunResult>;
907
- /**
908
- * Watches workflow transitions in real-time
909
- * @param runId - Optional run ID to filter the watch stream
910
- * @returns AsyncGenerator that yields parsed records from the workflow watch stream
911
- */
912
- watch({ runId }: {
913
- runId?: string;
914
- }, onRecord: (record: WorkflowWatchResult) => void): Promise<void>;
915
- /**
916
- * Creates a new ReadableStream from an iterable or async iterable of objects,
917
- * serializing each as JSON and separating them with the record separator (\x1E).
918
- *
919
- * @param records - An iterable or async iterable of objects to stream
920
- * @returns A ReadableStream emitting the records as JSON strings separated by the record separator
921
- */
922
- static createRecordStream(records: Iterable<any> | AsyncIterable<any>): ReadableStream;
923
- }
924
-
925
- /**
926
- * Class for interacting with an agent via the A2A protocol
927
- */
928
- declare class A2A extends BaseResource {
929
- private agentId;
930
- constructor(options: ClientOptions, agentId: string);
931
- /**
932
- * Get the agent card with metadata about the agent
933
- * @returns Promise containing the agent card information
934
- */
935
- getCard(): Promise<AgentCard>;
936
- /**
937
- * Send a message to the agent and get a response
938
- * @param params - Parameters for the task
939
- * @returns Promise containing the task response
940
- */
941
- sendMessage(params: TaskSendParams): Promise<{
942
- task: Task;
943
- }>;
944
- /**
945
- * Get the status and result of a task
946
- * @param params - Parameters for querying the task
947
- * @returns Promise containing the task response
948
- */
949
- getTask(params: TaskQueryParams): Promise<Task>;
950
- /**
951
- * Cancel a running task
952
- * @param params - Parameters identifying the task to cancel
953
- * @returns Promise containing the task response
954
- */
955
- cancelTask(params: TaskIdParams): Promise<{
956
- task: Task;
957
- }>;
958
- /**
959
- * Send a message and subscribe to streaming updates (not fully implemented)
960
- * @param params - Parameters for the task
961
- * @returns Promise containing the task response
962
- */
963
- sendAndSubscribe(params: TaskSendParams): Promise<Response>;
964
- }
965
-
966
- /**
967
- * Represents a specific tool available on a specific MCP server.
968
- * Provides methods to get details and execute the tool.
969
- */
970
- declare class MCPTool extends BaseResource {
971
- private serverId;
972
- private toolId;
973
- constructor(options: ClientOptions, serverId: string, toolId: string);
974
- /**
975
- * Retrieves details about this specific tool from the MCP server.
976
- * @returns Promise containing the tool's information (name, description, schema).
977
- */
978
- details(): Promise<McpToolInfo>;
979
- /**
980
- * Executes this specific tool on the MCP server.
981
- * @param params - Parameters for tool execution, including data/args and optional runtimeContext.
982
- * @returns Promise containing the result of the tool execution.
983
- */
984
- execute(params: {
985
- data?: any;
986
- runtimeContext?: RuntimeContext;
987
- }): Promise<any>;
988
- }
989
-
990
- declare class NetworkMemoryThread extends BaseResource {
991
- private threadId;
992
- private networkId;
993
- constructor(options: ClientOptions, threadId: string, networkId: string);
994
- /**
995
- * Retrieves the memory thread details
996
- * @returns Promise containing thread details including title and metadata
997
- */
998
- get(): Promise<StorageThreadType>;
999
- /**
1000
- * Updates the memory thread properties
1001
- * @param params - Update parameters including title and metadata
1002
- * @returns Promise containing updated thread details
1003
- */
1004
- update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
1005
- /**
1006
- * Deletes the memory thread
1007
- * @returns Promise containing deletion result
1008
- */
1009
- delete(): Promise<{
1010
- result: string;
1011
- }>;
1012
- /**
1013
- * Retrieves messages associated with the thread
1014
- * @param params - Optional parameters including limit for number of messages to retrieve
1015
- * @returns Promise containing thread messages and UI messages
1016
- */
1017
- getMessages(params?: GetMemoryThreadMessagesParams): Promise<GetMemoryThreadMessagesResponse>;
1018
- /**
1019
- * Deletes one or more messages from the thread
1020
- * @param messageIds - Can be a single message ID (string), array of message IDs,
1021
- * message object with id property, or array of message objects
1022
- * @returns Promise containing deletion result
1023
- */
1024
- deleteMessages(messageIds: string | string[] | {
1025
- id: string;
1026
- } | {
1027
- id: string;
1028
- }[]): Promise<{
1029
- success: boolean;
1030
- message: string;
1031
- }>;
1032
- }
1033
-
1034
- declare class VNextNetwork extends BaseResource {
1035
- private networkId;
1036
- constructor(options: ClientOptions, networkId: string);
1037
- /**
1038
- * Retrieves details about the network
1039
- * @returns Promise containing vNext network details
1040
- */
1041
- details(): Promise<GetVNextNetworkResponse>;
1042
- /**
1043
- * Generates a response from the v-next network
1044
- * @param params - Generation parameters including message
1045
- * @returns Promise containing the generated response
1046
- */
1047
- generate(params: GenerateOrStreamVNextNetworkParams): Promise<GenerateVNextNetworkResponse>;
1048
- /**
1049
- * Generates a response from the v-next network using multiple primitives
1050
- * @param params - Generation parameters including message
1051
- * @returns Promise containing the generated response
1052
- */
1053
- loop(params: {
1054
- message: string;
1055
- runtimeContext?: RuntimeContext | Record<string, any>;
1056
- }): Promise<LoopVNextNetworkResponse>;
1057
- private streamProcessor;
1058
- /**
1059
- * Streams a response from the v-next network
1060
- * @param params - Stream parameters including message
1061
- * @returns Promise containing the results
1062
- */
1063
- stream(params: GenerateOrStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void): Promise<void>;
1064
- /**
1065
- * Streams a response from the v-next network loop
1066
- * @param params - Stream parameters including message
1067
- * @returns Promise containing the results
1068
- */
1069
- loopStream(params: LoopStreamVNextNetworkParams, onRecord: (record: WatchEvent) => void): Promise<void>;
1070
- }
1071
-
1072
- declare class MastraClient extends BaseResource {
1073
- constructor(options: ClientOptions);
1074
- /**
1075
- * Retrieves all available agents
1076
- * @returns Promise containing map of agent IDs to agent details
1077
- */
1078
- getAgents(): Promise<Record<string, GetAgentResponse>>;
1079
- getAGUI({ resourceId }: {
1080
- resourceId: string;
1081
- }): Promise<Record<string, AbstractAgent>>;
1082
- /**
1083
- * Gets an agent instance by ID
1084
- * @param agentId - ID of the agent to retrieve
1085
- * @returns Agent instance
1086
- */
1087
- getAgent(agentId: string): Agent;
1088
- /**
1089
- * Retrieves memory threads for a resource
1090
- * @param params - Parameters containing the resource ID
1091
- * @returns Promise containing array of memory threads
1092
- */
1093
- getMemoryThreads(params: GetMemoryThreadParams): Promise<GetMemoryThreadResponse>;
1094
- /**
1095
- * Creates a new memory thread
1096
- * @param params - Parameters for creating the memory thread
1097
- * @returns Promise containing the created memory thread
1098
- */
1099
- createMemoryThread(params: CreateMemoryThreadParams): Promise<CreateMemoryThreadResponse>;
1100
- /**
1101
- * Gets a memory thread instance by ID
1102
- * @param threadId - ID of the memory thread to retrieve
1103
- * @returns MemoryThread instance
1104
- */
1105
- getMemoryThread(threadId: string, agentId: string): MemoryThread;
1106
- /**
1107
- * Saves messages to memory
1108
- * @param params - Parameters containing messages to save
1109
- * @returns Promise containing the saved messages
1110
- */
1111
- saveMessageToMemory(params: SaveMessageToMemoryParams): Promise<SaveMessageToMemoryResponse>;
1112
- /**
1113
- * Gets the status of the memory system
1114
- * @returns Promise containing memory system status
1115
- */
1116
- getMemoryStatus(agentId: string): Promise<{
1117
- result: boolean;
1118
- }>;
1119
- /**
1120
- * Retrieves memory threads for a resource
1121
- * @param params - Parameters containing the resource ID
1122
- * @returns Promise containing array of memory threads
1123
- */
1124
- getNetworkMemoryThreads(params: GetNetworkMemoryThreadParams): Promise<GetMemoryThreadResponse>;
1125
- /**
1126
- * Creates a new memory thread
1127
- * @param params - Parameters for creating the memory thread
1128
- * @returns Promise containing the created memory thread
1129
- */
1130
- createNetworkMemoryThread(params: CreateNetworkMemoryThreadParams): Promise<CreateMemoryThreadResponse>;
1131
- /**
1132
- * Gets a memory thread instance by ID
1133
- * @param threadId - ID of the memory thread to retrieve
1134
- * @returns MemoryThread instance
1135
- */
1136
- getNetworkMemoryThread(threadId: string, networkId: string): NetworkMemoryThread;
1137
- /**
1138
- * Saves messages to memory
1139
- * @param params - Parameters containing messages to save
1140
- * @returns Promise containing the saved messages
1141
- */
1142
- saveNetworkMessageToMemory(params: SaveNetworkMessageToMemoryParams): Promise<SaveMessageToMemoryResponse>;
1143
- /**
1144
- * Gets the status of the memory system
1145
- * @returns Promise containing memory system status
1146
- */
1147
- getNetworkMemoryStatus(networkId: string): Promise<{
1148
- result: boolean;
1149
- }>;
1150
- /**
1151
- * Retrieves all available tools
1152
- * @returns Promise containing map of tool IDs to tool details
1153
- */
1154
- getTools(): Promise<Record<string, GetToolResponse>>;
1155
- /**
1156
- * Gets a tool instance by ID
1157
- * @param toolId - ID of the tool to retrieve
1158
- * @returns Tool instance
1159
- */
1160
- getTool(toolId: string): Tool;
1161
- /**
1162
- * Retrieves all available legacy workflows
1163
- * @returns Promise containing map of legacy workflow IDs to legacy workflow details
1164
- */
1165
- getLegacyWorkflows(): Promise<Record<string, GetLegacyWorkflowResponse>>;
1166
- /**
1167
- * Gets a legacy workflow instance by ID
1168
- * @param workflowId - ID of the legacy workflow to retrieve
1169
- * @returns Legacy Workflow instance
1170
- */
1171
- getLegacyWorkflow(workflowId: string): LegacyWorkflow;
1172
- /**
1173
- * Retrieves all available workflows
1174
- * @returns Promise containing map of workflow IDs to workflow details
1175
- */
1176
- getWorkflows(): Promise<Record<string, GetWorkflowResponse>>;
1177
- /**
1178
- * Gets a workflow instance by ID
1179
- * @param workflowId - ID of the workflow to retrieve
1180
- * @returns Workflow instance
1181
- */
1182
- getWorkflow(workflowId: string): Workflow;
1183
- /**
1184
- * Gets a vector instance by name
1185
- * @param vectorName - Name of the vector to retrieve
1186
- * @returns Vector instance
1187
- */
1188
- getVector(vectorName: string): Vector;
1189
- /**
1190
- * Retrieves logs
1191
- * @param params - Parameters for filtering logs
1192
- * @returns Promise containing array of log messages
1193
- */
1194
- getLogs(params: GetLogsParams): Promise<GetLogsResponse>;
1195
- /**
1196
- * Gets logs for a specific run
1197
- * @param params - Parameters containing run ID to retrieve
1198
- * @returns Promise containing array of log messages
1199
- */
1200
- getLogForRun(params: GetLogParams): Promise<GetLogsResponse>;
1201
- /**
1202
- * List of all log transports
1203
- * @returns Promise containing list of log transports
1204
- */
1205
- getLogTransports(): Promise<{
1206
- transports: string[];
1207
- }>;
1208
- /**
1209
- * List of all traces (paged)
1210
- * @param params - Parameters for filtering traces
1211
- * @returns Promise containing telemetry data
1212
- */
1213
- getTelemetry(params?: GetTelemetryParams): Promise<GetTelemetryResponse>;
1214
- /**
1215
- * Retrieves all available networks
1216
- * @returns Promise containing map of network IDs to network details
1217
- */
1218
- getNetworks(): Promise<Array<GetNetworkResponse>>;
1219
- /**
1220
- * Retrieves all available vNext networks
1221
- * @returns Promise containing map of vNext network IDs to vNext network details
1222
- */
1223
- getVNextNetworks(): Promise<Array<GetVNextNetworkResponse>>;
1224
- /**
1225
- * Gets a network instance by ID
1226
- * @param networkId - ID of the network to retrieve
1227
- * @returns Network instance
1228
- */
1229
- getNetwork(networkId: string): Network;
1230
- /**
1231
- * Gets a vNext network instance by ID
1232
- * @param networkId - ID of the vNext network to retrieve
1233
- * @returns vNext Network instance
1234
- */
1235
- getVNextNetwork(networkId: string): VNextNetwork;
1236
- /**
1237
- * Retrieves a list of available MCP servers.
1238
- * @param params - Optional parameters for pagination (limit, offset).
1239
- * @returns Promise containing the list of MCP servers and pagination info.
1240
- */
1241
- getMcpServers(params?: {
1242
- limit?: number;
1243
- offset?: number;
1244
- }): Promise<McpServerListResponse>;
1245
- /**
1246
- * Retrieves detailed information for a specific MCP server.
1247
- * @param serverId - The ID of the MCP server to retrieve.
1248
- * @param params - Optional parameters, e.g., specific version.
1249
- * @returns Promise containing the detailed MCP server information.
1250
- */
1251
- getMcpServerDetails(serverId: string, params?: {
1252
- version?: string;
1253
- }): Promise<ServerDetailInfo>;
1254
- /**
1255
- * Retrieves a list of tools for a specific MCP server.
1256
- * @param serverId - The ID of the MCP server.
1257
- * @returns Promise containing the list of tools.
1258
- */
1259
- getMcpServerTools(serverId: string): Promise<McpServerToolListResponse>;
1260
- /**
1261
- * Gets an MCPTool resource instance for a specific tool on an MCP server.
1262
- * This instance can then be used to fetch details or execute the tool.
1263
- * @param serverId - The ID of the MCP server.
1264
- * @param toolId - The ID of the tool.
1265
- * @returns MCPTool instance.
1266
- */
1267
- getMcpServerTool(serverId: string, toolId: string): MCPTool;
1268
- /**
1269
- * Gets an A2A client for interacting with an agent via the A2A protocol
1270
- * @param agentId - ID of the agent to interact with
1271
- * @returns A2A client instance
1272
- */
1273
- getA2A(agentId: string): A2A;
1274
- /**
1275
- * Retrieves the working memory for a specific thread (optionally resource-scoped).
1276
- * @param agentId - ID of the agent.
1277
- * @param threadId - ID of the thread.
1278
- * @param resourceId - Optional ID of the resource.
1279
- * @returns Working memory for the specified thread or resource.
1280
- */
1281
- getWorkingMemory({ agentId, threadId, resourceId, }: {
1282
- agentId: string;
1283
- threadId: string;
1284
- resourceId?: string;
1285
- }): Promise<unknown>;
1286
- /**
1287
- * Updates the working memory for a specific thread (optionally resource-scoped).
1288
- * @param agentId - ID of the agent.
1289
- * @param threadId - ID of the thread.
1290
- * @param workingMemory - The new working memory content.
1291
- * @param resourceId - Optional ID of the resource.
1292
- */
1293
- updateWorkingMemory({ agentId, threadId, workingMemory, resourceId, }: {
1294
- agentId: string;
1295
- threadId: string;
1296
- workingMemory: string;
1297
- resourceId?: string;
1298
- }): Promise<unknown>;
1299
- /**
1300
- * Retrieves all available scorers
1301
- * @returns Promise containing list of available scorers
1302
- */
1303
- getScorers(): Promise<Record<string, GetScorerResponse>>;
1304
- /**
1305
- * Retrieves a scorer by ID
1306
- * @param scorerId - ID of the scorer to retrieve
1307
- * @returns Promise containing the scorer
1308
- */
1309
- getScorer(scorerId: string): Promise<GetScorerResponse>;
1310
- getScoresByScorerId(params: GetScoresByScorerIdParams): Promise<GetScoresResponse>;
1311
- /**
1312
- * Retrieves scores by run ID
1313
- * @param params - Parameters containing run ID and pagination options
1314
- * @returns Promise containing scores and pagination info
1315
- */
1316
- getScoresByRunId(params: GetScoresByRunIdParams): Promise<GetScoresResponse>;
1317
- /**
1318
- * Retrieves scores by entity ID and type
1319
- * @param params - Parameters containing entity ID, type, and pagination options
1320
- * @returns Promise containing scores and pagination info
1321
- */
1322
- getScoresByEntityId(params: GetScoresByEntityIdParams): Promise<GetScoresResponse>;
1323
- /**
1324
- * Saves a score
1325
- * @param params - Parameters containing the score data to save
1326
- * @returns Promise containing the saved score
1327
- */
1328
- saveScore(params: SaveScoreParams): Promise<SaveScoreResponse>;
1329
- }
1330
-
1331
- export { type ClientOptions, type ClientScoreRowData, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, type CreateNetworkMemoryThreadParams, type GenerateOrStreamVNextNetworkParams, type GenerateParams, type GenerateVNextNetworkResponse, type GetAgentResponse, type GetEvalsByAgentIdResponse, type GetLegacyWorkflowResponse, type GetLegacyWorkflowRunsResponse, type GetLogParams, type GetLogsParams, type GetLogsResponse, type GetMemoryThreadMessagesPaginatedParams, type GetMemoryThreadMessagesPaginatedResponse, type GetMemoryThreadMessagesParams, type GetMemoryThreadMessagesResponse, type GetMemoryThreadParams, type GetMemoryThreadResponse, type GetNetworkMemoryThreadParams, type GetNetworkResponse, type GetScorerResponse, type GetScorersResponse, type GetScoresByEntityIdParams, type GetScoresByRunIdParams, type GetScoresByScorerIdParams, type GetScoresResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVNextNetworkResponse, type GetVectorIndexResponse, type GetWorkflowResponse, type GetWorkflowRunByIdResponse, type GetWorkflowRunExecutionResultResponse, type GetWorkflowRunsParams, type GetWorkflowRunsResponse, type LegacyWorkflowRunResult, type LoopStreamVNextNetworkParams, type LoopVNextNetworkResponse, MastraClient, type McpServerListResponse, type McpServerToolListResponse, type McpToolInfo, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type SaveNetworkMessageToMemoryParams, type SaveScoreParams, type SaveScoreResponse, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type WorkflowRunResult, type WorkflowWatchResult };
1
+ export * from './client.js';
2
+ export * from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map