@mastra/client-js 0.0.0-expose-more-playground-ui-20250502141824 → 0.0.0-extract-tool-ui-inp-playground-ui-20251023135343

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 (68) hide show
  1. package/CHANGELOG.md +2266 -2
  2. package/LICENSE.md +11 -42
  3. package/README.md +7 -8
  4. package/dist/client.d.ts +278 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/example.d.ts +2 -0
  7. package/dist/example.d.ts.map +1 -0
  8. package/dist/index.cjs +2699 -278
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.ts +5 -715
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +2698 -283
  13. package/dist/index.js.map +1 -0
  14. package/dist/resources/a2a.d.ts +41 -0
  15. package/dist/resources/a2a.d.ts.map +1 -0
  16. package/dist/resources/agent-builder.d.ts +160 -0
  17. package/dist/resources/agent-builder.d.ts.map +1 -0
  18. package/dist/resources/agent.d.ts +200 -0
  19. package/dist/resources/agent.d.ts.map +1 -0
  20. package/dist/resources/base.d.ts +13 -0
  21. package/dist/resources/base.d.ts.map +1 -0
  22. package/dist/resources/index.d.ts +11 -0
  23. package/dist/resources/index.d.ts.map +1 -0
  24. package/dist/resources/mcp-tool.d.ts +28 -0
  25. package/dist/resources/mcp-tool.d.ts.map +1 -0
  26. package/dist/resources/memory-thread.d.ts +53 -0
  27. package/dist/resources/memory-thread.d.ts.map +1 -0
  28. package/dist/resources/network-memory-thread.d.ts +47 -0
  29. package/dist/resources/network-memory-thread.d.ts.map +1 -0
  30. package/dist/resources/observability.d.ts +35 -0
  31. package/dist/resources/observability.d.ts.map +1 -0
  32. package/dist/resources/tool.d.ts +24 -0
  33. package/dist/resources/tool.d.ts.map +1 -0
  34. package/dist/resources/vector.d.ts +51 -0
  35. package/dist/resources/vector.d.ts.map +1 -0
  36. package/dist/resources/workflow.d.ts +269 -0
  37. package/dist/resources/workflow.d.ts.map +1 -0
  38. package/dist/tools.d.ts +22 -0
  39. package/dist/tools.d.ts.map +1 -0
  40. package/dist/types.d.ts +479 -0
  41. package/dist/types.d.ts.map +1 -0
  42. package/dist/utils/index.d.ts +5 -0
  43. package/dist/utils/index.d.ts.map +1 -0
  44. package/dist/utils/process-client-tools.d.ts +3 -0
  45. package/dist/utils/process-client-tools.d.ts.map +1 -0
  46. package/dist/utils/process-mastra-stream.d.ts +11 -0
  47. package/dist/utils/process-mastra-stream.d.ts.map +1 -0
  48. package/dist/utils/zod-to-json-schema.d.ts +3 -0
  49. package/dist/utils/zod-to-json-schema.d.ts.map +1 -0
  50. package/package.json +38 -19
  51. package/dist/index.d.cts +0 -715
  52. package/eslint.config.js +0 -6
  53. package/src/client.ts +0 -232
  54. package/src/example.ts +0 -65
  55. package/src/index.test.ts +0 -710
  56. package/src/index.ts +0 -2
  57. package/src/resources/agent.ts +0 -204
  58. package/src/resources/base.ts +0 -70
  59. package/src/resources/index.ts +0 -8
  60. package/src/resources/memory-thread.ts +0 -53
  61. package/src/resources/network.ts +0 -92
  62. package/src/resources/tool.ts +0 -38
  63. package/src/resources/vector.ts +0 -83
  64. package/src/resources/vnext-workflow.ts +0 -234
  65. package/src/resources/workflow.ts +0 -223
  66. package/src/types.ts +0 -252
  67. package/tsconfig.json +0 -5
  68. package/vitest.config.js +0 -8
package/dist/index.d.cts DELETED
@@ -1,715 +0,0 @@
1
- import { processDataStream } from '@ai-sdk/ui-utils';
2
- import { CoreMessage, AiMessageType, StorageThreadType, MessageType, StepAction, StepGraph, WorkflowRuns, WorkflowRunResult as WorkflowRunResult$1, QueryResult, BaseLogMessage, GenerateReturn } from '@mastra/core';
3
- import { JSONSchema7 } from 'json-schema';
4
- import { ZodSchema } from 'zod';
5
- import { AgentGenerateOptions, AgentStreamOptions } from '@mastra/core/agent';
6
- import { NewWorkflow, WorkflowResult, WatchEvent } from '@mastra/core/workflows/vNext';
7
- import { RuntimeContext } from '@mastra/core/runtime-context';
8
-
9
- interface ClientOptions {
10
- /** Base URL for API requests */
11
- baseUrl: string;
12
- /** Number of retry attempts for failed requests */
13
- retries?: number;
14
- /** Initial backoff time in milliseconds between retries */
15
- backoffMs?: number;
16
- /** Maximum backoff time in milliseconds between retries */
17
- maxBackoffMs?: number;
18
- /** Custom headers to include with requests */
19
- headers?: Record<string, string>;
20
- }
21
- interface RequestOptions {
22
- method?: string;
23
- headers?: Record<string, string>;
24
- body?: any;
25
- stream?: boolean;
26
- signal?: AbortSignal;
27
- }
28
- interface GetAgentResponse {
29
- name: string;
30
- instructions: string;
31
- tools: Record<string, GetToolResponse>;
32
- provider: string;
33
- modelId: string;
34
- }
35
- type GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
36
- messages: string | string[] | CoreMessage[] | AiMessageType[];
37
- } & Partial<AgentGenerateOptions<T>>;
38
- type StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> = {
39
- messages: string | string[] | CoreMessage[] | AiMessageType[];
40
- } & Omit<AgentStreamOptions<T>, 'onFinish' | 'onStepFinish' | 'telemetry'>;
41
- interface GetEvalsByAgentIdResponse extends GetAgentResponse {
42
- evals: any[];
43
- instructions: string;
44
- name: string;
45
- id: string;
46
- }
47
- interface GetToolResponse {
48
- id: string;
49
- description: string;
50
- inputSchema: string;
51
- outputSchema: string;
52
- }
53
- interface GetWorkflowResponse {
54
- name: string;
55
- triggerSchema: string;
56
- steps: Record<string, StepAction<any, any, any, any>>;
57
- stepGraph: StepGraph;
58
- stepSubscriberGraph: Record<string, StepGraph>;
59
- workflowId?: string;
60
- }
61
- type GetWorkflowRunsResponse = WorkflowRuns;
62
- type WorkflowRunResult = {
63
- activePaths: Record<string, {
64
- status: string;
65
- suspendPayload?: any;
66
- stepPath: string[];
67
- }>;
68
- results: WorkflowRunResult$1<any, any, any>['results'];
69
- timestamp: number;
70
- runId: string;
71
- };
72
- interface GetVNextWorkflowResponse {
73
- name: string;
74
- steps: {
75
- [key: string]: {
76
- id: string;
77
- description: string;
78
- inputSchema: string;
79
- outputSchema: string;
80
- resumeSchema: string;
81
- suspendSchema: string;
82
- };
83
- };
84
- stepGraph: NewWorkflow['serializedStepGraph'];
85
- inputSchema: string;
86
- outputSchema: string;
87
- }
88
- type VNextWorkflowWatchResult = WatchEvent & {
89
- runId: string;
90
- };
91
- type VNextWorkflowRunResult = WorkflowResult<any, any>;
92
- interface UpsertVectorParams {
93
- indexName: string;
94
- vectors: number[][];
95
- metadata?: Record<string, any>[];
96
- ids?: string[];
97
- }
98
- interface CreateIndexParams {
99
- indexName: string;
100
- dimension: number;
101
- metric?: 'cosine' | 'euclidean' | 'dotproduct';
102
- }
103
- interface QueryVectorParams {
104
- indexName: string;
105
- queryVector: number[];
106
- topK?: number;
107
- filter?: Record<string, any>;
108
- includeVector?: boolean;
109
- }
110
- interface QueryVectorResponse {
111
- results: QueryResult[];
112
- }
113
- interface GetVectorIndexResponse {
114
- dimension: number;
115
- metric: 'cosine' | 'euclidean' | 'dotproduct';
116
- count: number;
117
- }
118
- interface SaveMessageToMemoryParams {
119
- messages: MessageType[];
120
- agentId: string;
121
- }
122
- type SaveMessageToMemoryResponse = MessageType[];
123
- interface CreateMemoryThreadParams {
124
- title: string;
125
- metadata: Record<string, any>;
126
- resourceId: string;
127
- threadId: string;
128
- agentId: string;
129
- }
130
- type CreateMemoryThreadResponse = StorageThreadType;
131
- interface GetMemoryThreadParams {
132
- resourceId: string;
133
- agentId: string;
134
- }
135
- type GetMemoryThreadResponse = StorageThreadType[];
136
- interface UpdateMemoryThreadParams {
137
- title: string;
138
- metadata: Record<string, any>;
139
- resourceId: string;
140
- }
141
- interface GetMemoryThreadMessagesResponse {
142
- messages: CoreMessage[];
143
- uiMessages: AiMessageType[];
144
- }
145
- interface GetLogsParams {
146
- transportId: string;
147
- }
148
- interface GetLogParams {
149
- runId: string;
150
- transportId: string;
151
- }
152
- type GetLogsResponse = BaseLogMessage[];
153
- type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
154
- type SpanStatus = {
155
- code: number;
156
- };
157
- type SpanOther = {
158
- droppedAttributesCount: number;
159
- droppedEventsCount: number;
160
- droppedLinksCount: number;
161
- };
162
- type SpanEventAttributes = {
163
- key: string;
164
- value: {
165
- [key: string]: string | number | boolean | null;
166
- };
167
- };
168
- type SpanEvent = {
169
- attributes: SpanEventAttributes[];
170
- name: string;
171
- timeUnixNano: string;
172
- droppedAttributesCount: number;
173
- };
174
- type Span = {
175
- id: string;
176
- parentSpanId: string | null;
177
- traceId: string;
178
- name: string;
179
- scope: string;
180
- kind: number;
181
- status: SpanStatus;
182
- events: SpanEvent[];
183
- links: any[];
184
- attributes: Record<string, string | number | boolean | null>;
185
- startTime: number;
186
- endTime: number;
187
- duration: number;
188
- other: SpanOther;
189
- createdAt: string;
190
- };
191
- interface GetTelemetryResponse {
192
- traces: Span[];
193
- }
194
- interface GetTelemetryParams {
195
- name?: string;
196
- scope?: string;
197
- page?: number;
198
- perPage?: number;
199
- attribute?: Record<string, string>;
200
- }
201
- interface GetNetworkResponse {
202
- name: string;
203
- instructions: string;
204
- agents: Array<{
205
- name: string;
206
- provider: string;
207
- modelId: string;
208
- }>;
209
- routingModel: {
210
- provider: string;
211
- modelId: string;
212
- };
213
- state?: Record<string, any>;
214
- }
215
-
216
- declare class BaseResource {
217
- readonly options: ClientOptions;
218
- constructor(options: ClientOptions);
219
- /**
220
- * Makes an HTTP request to the API with retries and exponential backoff
221
- * @param path - The API endpoint path
222
- * @param options - Optional request configuration
223
- * @returns Promise containing the response data
224
- */
225
- request<T>(path: string, options?: RequestOptions): Promise<T>;
226
- }
227
-
228
- declare class AgentVoice extends BaseResource {
229
- private agentId;
230
- constructor(options: ClientOptions, agentId: string);
231
- /**
232
- * Convert text to speech using the agent's voice provider
233
- * @param text - Text to convert to speech
234
- * @param options - Optional provider-specific options for speech generation
235
- * @returns Promise containing the audio data
236
- */
237
- speak(text: string, options?: {
238
- speaker?: string;
239
- [key: string]: any;
240
- }): Promise<Response>;
241
- /**
242
- * Convert speech to text using the agent's voice provider
243
- * @param audio - Audio data to transcribe
244
- * @param options - Optional provider-specific options
245
- * @returns Promise containing the transcribed text
246
- */
247
- listen(audio: Blob, options?: Record<string, any>): Promise<Response>;
248
- /**
249
- * Get available speakers for the agent's voice provider
250
- * @returns Promise containing list of available speakers
251
- */
252
- getSpeakers(): Promise<Array<{
253
- voiceId: string;
254
- [key: string]: any;
255
- }>>;
256
- }
257
- declare class Agent extends BaseResource {
258
- private agentId;
259
- readonly voice: AgentVoice;
260
- constructor(options: ClientOptions, agentId: string);
261
- /**
262
- * Retrieves details about the agent
263
- * @returns Promise containing agent details including model and instructions
264
- */
265
- details(): Promise<GetAgentResponse>;
266
- /**
267
- * Generates a response from the agent
268
- * @param params - Generation parameters including prompt
269
- * @returns Promise containing the generated response
270
- */
271
- generate<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: GenerateParams<T>): Promise<GenerateReturn<T>>;
272
- /**
273
- * Streams a response from the agent
274
- * @param params - Stream parameters including prompt
275
- * @returns Promise containing the enhanced Response object with processDataStream method
276
- */
277
- stream<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: StreamParams<T>): Promise<Response & {
278
- processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
279
- }>;
280
- /**
281
- * Gets details about a specific tool available to the agent
282
- * @param toolId - ID of the tool to retrieve
283
- * @returns Promise containing tool details
284
- */
285
- getTool(toolId: string): Promise<GetToolResponse>;
286
- /**
287
- * Retrieves evaluation results for the agent
288
- * @returns Promise containing agent evaluations
289
- */
290
- evals(): Promise<GetEvalsByAgentIdResponse>;
291
- /**
292
- * Retrieves live evaluation results for the agent
293
- * @returns Promise containing live agent evaluations
294
- */
295
- liveEvals(): Promise<GetEvalsByAgentIdResponse>;
296
- }
297
-
298
- declare class Network extends BaseResource {
299
- private networkId;
300
- constructor(options: ClientOptions, networkId: string);
301
- /**
302
- * Retrieves details about the network
303
- * @returns Promise containing network details
304
- */
305
- details(): Promise<GetNetworkResponse>;
306
- /**
307
- * Generates a response from the agent
308
- * @param params - Generation parameters including prompt
309
- * @returns Promise containing the generated response
310
- */
311
- generate<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: GenerateParams<T>): Promise<GenerateReturn<T>>;
312
- /**
313
- * Streams a response from the agent
314
- * @param params - Stream parameters including prompt
315
- * @returns Promise containing the enhanced Response object with processDataStream method
316
- */
317
- stream<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: StreamParams<T>): Promise<Response & {
318
- processDataStream: (options?: Omit<Parameters<typeof processDataStream>[0], 'stream'>) => Promise<void>;
319
- }>;
320
- }
321
-
322
- declare class MemoryThread extends BaseResource {
323
- private threadId;
324
- private agentId;
325
- constructor(options: ClientOptions, threadId: string, agentId: string);
326
- /**
327
- * Retrieves the memory thread details
328
- * @returns Promise containing thread details including title and metadata
329
- */
330
- get(): Promise<StorageThreadType>;
331
- /**
332
- * Updates the memory thread properties
333
- * @param params - Update parameters including title and metadata
334
- * @returns Promise containing updated thread details
335
- */
336
- update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
337
- /**
338
- * Deletes the memory thread
339
- * @returns Promise containing deletion result
340
- */
341
- delete(): Promise<{
342
- result: string;
343
- }>;
344
- /**
345
- * Retrieves messages associated with the thread
346
- * @returns Promise containing thread messages and UI messages
347
- */
348
- getMessages(): Promise<GetMemoryThreadMessagesResponse>;
349
- }
350
-
351
- declare class Vector extends BaseResource {
352
- private vectorName;
353
- constructor(options: ClientOptions, vectorName: string);
354
- /**
355
- * Retrieves details about a specific vector index
356
- * @param indexName - Name of the index to get details for
357
- * @returns Promise containing vector index details
358
- */
359
- details(indexName: string): Promise<GetVectorIndexResponse>;
360
- /**
361
- * Deletes a vector index
362
- * @param indexName - Name of the index to delete
363
- * @returns Promise indicating deletion success
364
- */
365
- delete(indexName: string): Promise<{
366
- success: boolean;
367
- }>;
368
- /**
369
- * Retrieves a list of all available indexes
370
- * @returns Promise containing array of index names
371
- */
372
- getIndexes(): Promise<{
373
- indexes: string[];
374
- }>;
375
- /**
376
- * Creates a new vector index
377
- * @param params - Parameters for index creation including dimension and metric
378
- * @returns Promise indicating creation success
379
- */
380
- createIndex(params: CreateIndexParams): Promise<{
381
- success: boolean;
382
- }>;
383
- /**
384
- * Upserts vectors into an index
385
- * @param params - Parameters containing vectors, metadata, and optional IDs
386
- * @returns Promise containing array of vector IDs
387
- */
388
- upsert(params: UpsertVectorParams): Promise<string[]>;
389
- /**
390
- * Queries vectors in an index
391
- * @param params - Query parameters including query vector and search options
392
- * @returns Promise containing query results
393
- */
394
- query(params: QueryVectorParams): Promise<QueryVectorResponse>;
395
- }
396
-
397
- declare class Workflow extends BaseResource {
398
- private workflowId;
399
- constructor(options: ClientOptions, workflowId: string);
400
- /**
401
- * Retrieves details about the workflow
402
- * @returns Promise containing workflow details including steps and graphs
403
- */
404
- details(): Promise<GetWorkflowResponse>;
405
- /**
406
- * Retrieves all runs for a workflow
407
- * @returns Promise containing workflow runs array
408
- */
409
- runs(): Promise<GetWorkflowRunsResponse>;
410
- /**
411
- * @deprecated Use `startAsync` instead
412
- * Executes the workflow with the provided parameters
413
- * @param params - Parameters required for workflow execution
414
- * @returns Promise containing the workflow execution results
415
- */
416
- execute(params: Record<string, any>): Promise<WorkflowRunResult>;
417
- /**
418
- * Creates a new workflow run
419
- * @returns Promise containing the generated run ID
420
- */
421
- createRun(params?: {
422
- runId?: string;
423
- }): Promise<{
424
- runId: string;
425
- }>;
426
- /**
427
- * Starts a workflow run synchronously without waiting for the workflow to complete
428
- * @param params - Object containing the runId and triggerData
429
- * @returns Promise containing success message
430
- */
431
- start(params: {
432
- runId: string;
433
- triggerData: Record<string, any>;
434
- }): Promise<{
435
- message: string;
436
- }>;
437
- /**
438
- * Resumes a suspended workflow step synchronously without waiting for the workflow to complete
439
- * @param stepId - ID of the step to resume
440
- * @param runId - ID of the workflow run
441
- * @param context - Context to resume the workflow with
442
- * @returns Promise containing the workflow resume results
443
- */
444
- resume({ stepId, runId, context, }: {
445
- stepId: string;
446
- runId: string;
447
- context: Record<string, any>;
448
- }): Promise<{
449
- message: string;
450
- }>;
451
- /**
452
- * Starts a workflow run asynchronously and returns a promise that resolves when the workflow is complete
453
- * @param params - Object containing the optional runId and triggerData
454
- * @returns Promise containing the workflow execution results
455
- */
456
- startAsync(params: {
457
- runId?: string;
458
- triggerData: Record<string, any>;
459
- }): Promise<WorkflowRunResult>;
460
- /**
461
- * Resumes a suspended workflow step asynchronously and returns a promise that resolves when the workflow is complete
462
- * @param params - Object containing the runId, stepId, and context
463
- * @returns Promise containing the workflow resume results
464
- */
465
- resumeAsync(params: {
466
- runId: string;
467
- stepId: string;
468
- context: Record<string, any>;
469
- }): Promise<WorkflowRunResult>;
470
- /**
471
- * Creates an async generator that processes a readable stream and yields records
472
- * separated by the Record Separator character (\x1E)
473
- *
474
- * @param stream - The readable stream to process
475
- * @returns An async generator that yields parsed records
476
- */
477
- private streamProcessor;
478
- /**
479
- * Watches workflow transitions in real-time
480
- * @param runId - Optional run ID to filter the watch stream
481
- * @returns AsyncGenerator that yields parsed records from the workflow watch stream
482
- */
483
- watch({ runId }: {
484
- runId?: string;
485
- }, onRecord: (record: WorkflowRunResult) => void): Promise<void>;
486
- }
487
-
488
- declare class Tool extends BaseResource {
489
- private toolId;
490
- constructor(options: ClientOptions, toolId: string);
491
- /**
492
- * Retrieves details about the tool
493
- * @returns Promise containing tool details including description and schemas
494
- */
495
- details(): Promise<GetToolResponse>;
496
- /**
497
- * Executes the tool with the provided parameters
498
- * @param params - Parameters required for tool execution
499
- * @returns Promise containing the tool execution results
500
- */
501
- execute(params: {
502
- data: any;
503
- runId?: string;
504
- }): Promise<any>;
505
- }
506
-
507
- declare class VNextWorkflow extends BaseResource {
508
- private workflowId;
509
- constructor(options: ClientOptions, workflowId: string);
510
- /**
511
- * Creates an async generator that processes a readable stream and yields vNext workflow records
512
- * separated by the Record Separator character (\x1E)
513
- *
514
- * @param stream - The readable stream to process
515
- * @returns An async generator that yields parsed records
516
- */
517
- private streamProcessor;
518
- /**
519
- * Retrieves details about the vNext workflow
520
- * @returns Promise containing vNext workflow details including steps and graphs
521
- */
522
- details(): Promise<GetVNextWorkflowResponse>;
523
- /**
524
- * Retrieves all runs for a vNext workflow
525
- * @returns Promise containing vNext workflow runs array
526
- */
527
- runs(): Promise<GetWorkflowRunsResponse>;
528
- /**
529
- * Creates a new vNext workflow run
530
- * @param params - Optional object containing the optional runId
531
- * @returns Promise containing the runId of the created run
532
- */
533
- createRun(params?: {
534
- runId?: string;
535
- }): Promise<{
536
- runId: string;
537
- }>;
538
- /**
539
- * Starts a vNext workflow run synchronously without waiting for the workflow to complete
540
- * @param params - Object containing the runId, inputData and runtimeContext
541
- * @returns Promise containing success message
542
- */
543
- start(params: {
544
- runId: string;
545
- inputData: Record<string, any>;
546
- runtimeContext?: RuntimeContext;
547
- }): Promise<{
548
- message: string;
549
- }>;
550
- /**
551
- * Resumes a suspended vNext workflow step synchronously without waiting for the vNext workflow to complete
552
- * @param params - Object containing the runId, step, resumeData and runtimeContext
553
- * @returns Promise containing success message
554
- */
555
- resume({ step, runId, resumeData, runtimeContext, }: {
556
- step: string | string[];
557
- runId: string;
558
- resumeData?: Record<string, any>;
559
- runtimeContext?: RuntimeContext;
560
- }): Promise<{
561
- message: string;
562
- }>;
563
- /**
564
- * Starts a vNext workflow run asynchronously and returns a promise that resolves when the vNext workflow is complete
565
- * @param params - Object containing the optional runId, inputData and runtimeContext
566
- * @returns Promise containing the vNext workflow execution results
567
- */
568
- startAsync(params: {
569
- runId?: string;
570
- inputData: Record<string, any>;
571
- runtimeContext?: RuntimeContext;
572
- }): Promise<VNextWorkflowRunResult>;
573
- /**
574
- * Resumes a suspended vNext workflow step asynchronously and returns a promise that resolves when the vNext workflow is complete
575
- * @param params - Object containing the runId, step, resumeData and runtimeContext
576
- * @returns Promise containing the vNext workflow resume results
577
- */
578
- resumeAsync(params: {
579
- runId: string;
580
- step: string | string[];
581
- resumeData?: Record<string, any>;
582
- runtimeContext?: RuntimeContext;
583
- }): Promise<VNextWorkflowRunResult>;
584
- /**
585
- * Watches vNext workflow transitions in real-time
586
- * @param runId - Optional run ID to filter the watch stream
587
- * @returns AsyncGenerator that yields parsed records from the vNext workflow watch stream
588
- */
589
- watch({ runId }: {
590
- runId?: string;
591
- }, onRecord: (record: VNextWorkflowWatchResult) => void): Promise<void>;
592
- }
593
-
594
- declare class MastraClient extends BaseResource {
595
- constructor(options: ClientOptions);
596
- /**
597
- * Retrieves all available agents
598
- * @returns Promise containing map of agent IDs to agent details
599
- */
600
- getAgents(): Promise<Record<string, GetAgentResponse>>;
601
- /**
602
- * Gets an agent instance by ID
603
- * @param agentId - ID of the agent to retrieve
604
- * @returns Agent instance
605
- */
606
- getAgent(agentId: string): Agent;
607
- /**
608
- * Retrieves memory threads for a resource
609
- * @param params - Parameters containing the resource ID
610
- * @returns Promise containing array of memory threads
611
- */
612
- getMemoryThreads(params: GetMemoryThreadParams): Promise<GetMemoryThreadResponse>;
613
- /**
614
- * Creates a new memory thread
615
- * @param params - Parameters for creating the memory thread
616
- * @returns Promise containing the created memory thread
617
- */
618
- createMemoryThread(params: CreateMemoryThreadParams): Promise<CreateMemoryThreadResponse>;
619
- /**
620
- * Gets a memory thread instance by ID
621
- * @param threadId - ID of the memory thread to retrieve
622
- * @returns MemoryThread instance
623
- */
624
- getMemoryThread(threadId: string, agentId: string): MemoryThread;
625
- /**
626
- * Saves messages to memory
627
- * @param params - Parameters containing messages to save
628
- * @returns Promise containing the saved messages
629
- */
630
- saveMessageToMemory(params: SaveMessageToMemoryParams): Promise<SaveMessageToMemoryResponse>;
631
- /**
632
- * Gets the status of the memory system
633
- * @returns Promise containing memory system status
634
- */
635
- getMemoryStatus(agentId: string): Promise<{
636
- result: boolean;
637
- }>;
638
- /**
639
- * Retrieves all available tools
640
- * @returns Promise containing map of tool IDs to tool details
641
- */
642
- getTools(): Promise<Record<string, GetToolResponse>>;
643
- /**
644
- * Gets a tool instance by ID
645
- * @param toolId - ID of the tool to retrieve
646
- * @returns Tool instance
647
- */
648
- getTool(toolId: string): Tool;
649
- /**
650
- * Retrieves all available workflows
651
- * @returns Promise containing map of workflow IDs to workflow details
652
- */
653
- getWorkflows(): Promise<Record<string, GetWorkflowResponse>>;
654
- /**
655
- * Gets a workflow instance by ID
656
- * @param workflowId - ID of the workflow to retrieve
657
- * @returns Workflow instance
658
- */
659
- getWorkflow(workflowId: string): Workflow;
660
- /**
661
- * Retrieves all available vNext workflows
662
- * @returns Promise containing map of vNext workflow IDs to vNext workflow details
663
- */
664
- getVNextWorkflows(): Promise<Record<string, GetVNextWorkflowResponse>>;
665
- /**
666
- * Gets a vNext workflow instance by ID
667
- * @param workflowId - ID of the vNext workflow to retrieve
668
- * @returns vNext Workflow instance
669
- */
670
- getVNextWorkflow(workflowId: string): VNextWorkflow;
671
- /**
672
- * Gets a vector instance by name
673
- * @param vectorName - Name of the vector to retrieve
674
- * @returns Vector instance
675
- */
676
- getVector(vectorName: string): Vector;
677
- /**
678
- * Retrieves logs
679
- * @param params - Parameters for filtering logs
680
- * @returns Promise containing array of log messages
681
- */
682
- getLogs(params: GetLogsParams): Promise<GetLogsResponse>;
683
- /**
684
- * Gets logs for a specific run
685
- * @param params - Parameters containing run ID to retrieve
686
- * @returns Promise containing array of log messages
687
- */
688
- getLogForRun(params: GetLogParams): Promise<GetLogsResponse>;
689
- /**
690
- * List of all log transports
691
- * @returns Promise containing list of log transports
692
- */
693
- getLogTransports(): Promise<{
694
- transports: string[];
695
- }>;
696
- /**
697
- * List of all traces (paged)
698
- * @param params - Parameters for filtering traces
699
- * @returns Promise containing telemetry data
700
- */
701
- getTelemetry(params?: GetTelemetryParams): Promise<GetTelemetryResponse>;
702
- /**
703
- * Retrieves all available networks
704
- * @returns Promise containing map of network IDs to network details
705
- */
706
- getNetworks(): Promise<Record<string, GetNetworkResponse>>;
707
- /**
708
- * Gets a network instance by ID
709
- * @param networkId - ID of the network to retrieve
710
- * @returns Network instance
711
- */
712
- getNetwork(networkId: string): Network;
713
- }
714
-
715
- export { type ClientOptions, type CreateIndexParams, type CreateMemoryThreadParams, type CreateMemoryThreadResponse, type GenerateParams, type GetAgentResponse, type GetEvalsByAgentIdResponse, type GetLogParams, type GetLogsParams, type GetLogsResponse, type GetMemoryThreadMessagesResponse, type GetMemoryThreadParams, type GetMemoryThreadResponse, type GetNetworkResponse, type GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVNextWorkflowResponse, type GetVectorIndexResponse, type GetWorkflowResponse, type GetWorkflowRunsResponse, MastraClient, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams, type VNextWorkflowRunResult, type VNextWorkflowWatchResult, type WorkflowRunResult };