@mastra/client-js 0.0.0-cloud-transporter-20250513033346 → 0.0.0-cloud-deployer-for-core-0.19.1-20251001164939

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