@mastra/client-js 0.0.0-transpile-packages-20250730132657 → 0.0.0-transpile-packages-20250731152758

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