@mastra/client-js 0.0.0-a2a-20250421213654 → 0.0.0-add-libsql-changeset-20250910154739

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