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