@mastra/client-js 0.0.0-storage-20250225005900

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.
@@ -0,0 +1,16 @@
1
+
2
+ 
3
+ > @mastra/client-js@0.1.4-alpha.0 build /Users/ward/projects/mastra/mastra/client-sdks/client-js
4
+ > tsup-node src/index.ts --format esm --dts --clean --treeshake
5
+
6
+ CLI Building entry: src/index.ts
7
+ CLI Using tsconfig: tsconfig.json
8
+ CLI tsup v8.3.6
9
+ CLI Target: es2022
10
+ CLI Cleaning output folder
11
+ ESM Build start
12
+ ESM dist/index.mjs 13.56 KB
13
+ ESM ⚡️ Build success in 119ms
14
+ DTS Build start
15
+ DTS ⚡️ Build success in 2785ms
16
+ DTS dist/index.d.mts 13.64 KB
package/CHANGELOG.md ADDED
@@ -0,0 +1,70 @@
1
+ # @mastra/client-js
2
+
3
+ ## 0.0.0-storage-20250225005900
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [7fceae1]
8
+ - Updated dependencies [f626fbb]
9
+ - Updated dependencies [8db2a28]
10
+ - @mastra/core@0.0.0-storage-20250225005900
11
+
12
+ ## 0.1.4-alpha.0
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [7fceae1]
17
+ - Updated dependencies [f626fbb]
18
+ - @mastra/core@0.4.2-alpha.0
19
+
20
+ ## 0.1.3
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [ce44b9b]
25
+ - Updated dependencies [967da43]
26
+ - Updated dependencies [b405f08]
27
+ - @mastra/core@0.4.1
28
+
29
+ ## 0.1.2
30
+
31
+ ### Patch Changes
32
+
33
+ - 5297264: Fix build errors by changing contracts
34
+ - Updated dependencies [2fc618f]
35
+ - Updated dependencies [fe0fd01]
36
+ - @mastra/core@0.4.0
37
+
38
+ ## 0.1.2-alpha.1
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [fe0fd01]
43
+ - @mastra/core@0.4.0-alpha.1
44
+
45
+ ## 0.1.2-alpha.0
46
+
47
+ ### Patch Changes
48
+
49
+ - 5297264: Fix build errors by changing contracts
50
+ - Updated dependencies [2fc618f]
51
+ - @mastra/core@0.4.0-alpha.0
52
+
53
+ ## 0.1.1
54
+
55
+ ### Patch Changes
56
+
57
+ - Updated dependencies [f205ede]
58
+ - @mastra/core@0.3.0
59
+
60
+ ## 0.1.0
61
+
62
+ ### Patch Changes
63
+
64
+ - b9ef5fd: Add workflow watch and resume to client sdk
65
+
66
+ ## 0.1.0-alpha.18
67
+
68
+ ### Patch Changes
69
+
70
+ - b9ef5fd: Add workflow watch and resume to client sdk
package/LICENSE ADDED
@@ -0,0 +1,44 @@
1
+ Elastic License 2.0 (ELv2)
2
+
3
+ **Acceptance**
4
+ By using the software, you agree to all of the terms and conditions below.
5
+
6
+ **Copyright License**
7
+ The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
8
+
9
+ **Limitations**
10
+ You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
11
+
12
+ You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
13
+
14
+ You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
15
+
16
+ **Patents**
17
+ The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
18
+
19
+ **Notices**
20
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
21
+
22
+ If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
23
+
24
+ **No Other Rights**
25
+ These terms do not imply any licenses other than those expressly granted in these terms.
26
+
27
+ **Termination**
28
+ If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
29
+
30
+ **No Liability**
31
+ As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
32
+
33
+ **Definitions**
34
+ The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
35
+
36
+ _you_ refers to the individual or entity agreeing to these terms.
37
+
38
+ _your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
39
+
40
+ _your licenses_ are all the licenses granted to you for the software under these terms.
41
+
42
+ _use_ means anything you do with the software requiring one of your licenses.
43
+
44
+ _trademark_ means trademarks, service marks, and similar rights.
package/README.md ADDED
@@ -0,0 +1,125 @@
1
+ # Mastra Client
2
+
3
+ JavaScript/TypeScript client library for the [Mastra AI](https://mastra.ai) framework. This client provides a simple interface to interact with Mastra AI's APIs for agents, vectors, memory, tools, and workflows.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/client-js
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```typescript
14
+ import { MastraClient } from '@mastra/client';
15
+
16
+ // Initialize the client
17
+ const client = new MastraClient({
18
+ baseUrl: 'http://localhost:4111', // Your Mastra API endpoint
19
+ });
20
+
21
+ // Example: Working with an Agent
22
+ async function main() {
23
+ // Get an agent instance
24
+ const agent = client.getAgent('your-agent-id');
25
+
26
+ // Generate a response
27
+ const response = await agent.generate({
28
+ messages: [{ role: 'user', content: "What's the weather like today?" }],
29
+ });
30
+
31
+ console.log(response);
32
+ }
33
+ ```
34
+
35
+ ## Client Configuration
36
+
37
+ The client can be configured with several options:
38
+
39
+ ```typescript
40
+ const client = new MastraClient({
41
+ baseUrl: string; // Base URL for the Mastra API
42
+ retries?: number; // Number of retry attempts (default: 3)
43
+ backoffMs?: number; // Initial backoff time in ms (default: 300)
44
+ maxBackoffMs?: number; // Maximum backoff time in ms (default: 5000)
45
+ headers?: Record<string, string>; // Custom headers
46
+ });
47
+ ```
48
+
49
+ ## Available Methods
50
+
51
+ ### Agents
52
+
53
+ - `getAgents()`: Get all available agents
54
+ - `getAgent(agentId)`: Get a specific agent instance
55
+ - `agent.details()`: Get agent details
56
+ - `agent.generate(params)`: Generate a response
57
+ - `agent.stream(params)`: Stream a response
58
+ - `agent.getTool(toolId)`: Get agent tool details
59
+ - `agent.evals()`: Get agent evaluations
60
+ - `agent.liveEvals()`: Get live evaluations
61
+
62
+ ### Memory
63
+
64
+ - `getMemoryThreads(params)`: Get memory threads
65
+ - `createMemoryThread(params)`: Create a new memory thread
66
+ - `getMemoryThread(threadId)`: Get a memory thread instance
67
+ - `saveMessageToMemory(params)`: Save messages to memory
68
+ - `getMemoryStatus()`: Get memory system status
69
+
70
+ ### Tools
71
+
72
+ - `getTools()`: Get all available tools
73
+ - `getTool(toolId)`: Get a tool instance
74
+ - `tool.details()`: Get tool details
75
+ - `tool.execute(params)`: Execute the tool
76
+
77
+ ### Workflows
78
+
79
+ - `getWorkflows()`: Get all workflows
80
+ - `getWorkflow(workflowId)`: Get a workflow instance
81
+ - `workflow.details()`: Get workflow details
82
+ - `workflow.execute(params)`: Execute the workflow
83
+ - `workflow.watch(params)`: Watch the workflow
84
+ - `workflow.resume(params)`: Resume the workflow
85
+
86
+ ### Vectors
87
+
88
+ - `getVector(vectorName)`: Get a vector instance
89
+ - `vector.details(indexName)`: Get vector index details
90
+ - `vector.delete(indexName)`: Delete a vector index
91
+ - `vector.getIndexes()`: Get all indexes
92
+ - `vector.createIndex(params)`: Create a new index
93
+ - `vector.upsert(params)`: Upsert vectors
94
+ - `vector.query(params)`: Query vectors
95
+
96
+ ### Logs
97
+
98
+ - `getLogs(params)`: Get system logs
99
+ - `getLog(params)`: Get specific log entry
100
+ - `getLogTransports()`: Get configured Log transports
101
+
102
+ ### Telemetry
103
+
104
+ - `getTelemetry(params)`: Get telemetry data
105
+
106
+ ## Error Handling
107
+
108
+ The client includes built-in retry logic for failed requests:
109
+
110
+ - Automatically retries failed requests with exponential backoff
111
+ - Configurable retry count and backoff timing
112
+ - Throws error after max retries reached
113
+
114
+ ## Internal Implementation
115
+
116
+ The client uses the native `fetch` API internally for making HTTP requests. All requests are automatically handled with:
117
+
118
+ - JSON serialization/deserialization
119
+ - Retry logic with exponential backoff
120
+ - Custom header management
121
+ - Error handling
122
+
123
+ ## License
124
+
125
+ MIT
@@ -0,0 +1,405 @@
1
+ import { CoreMessage, OutputType, StorageThreadType, AiMessageType, MessageType, StepAction, StepGraph, QueryResult, BaseLogMessage, GenerateReturn } from '@mastra/core';
2
+ import { JSONSchema7 } from 'json-schema';
3
+ import { ZodSchema } from 'zod';
4
+
5
+ interface ClientOptions {
6
+ /** Base URL for API requests */
7
+ baseUrl: string;
8
+ /** Number of retry attempts for failed requests */
9
+ retries?: number;
10
+ /** Initial backoff time in milliseconds between retries */
11
+ backoffMs?: number;
12
+ /** Maximum backoff time in milliseconds between retries */
13
+ maxBackoffMs?: number;
14
+ /** Custom headers to include with requests */
15
+ headers?: Record<string, string>;
16
+ }
17
+ interface RequestOptions {
18
+ method?: string;
19
+ headers?: Record<string, string>;
20
+ body?: any;
21
+ stream?: boolean;
22
+ }
23
+ interface GetAgentResponse {
24
+ name: string;
25
+ instructions: string;
26
+ tools: Record<string, GetToolResponse>;
27
+ provider: string;
28
+ }
29
+ interface GenerateParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> {
30
+ messages: string | string[] | CoreMessage[];
31
+ threadId?: string;
32
+ resourceid?: string;
33
+ output?: OutputType | T;
34
+ }
35
+ interface StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> {
36
+ messages: string | string[] | CoreMessage[];
37
+ threadId?: string;
38
+ resourceid?: string;
39
+ output?: OutputType | T;
40
+ }
41
+ interface GetEvalsByAgentIdResponse extends GetAgentResponse {
42
+ evals: any[];
43
+ }
44
+ interface GetToolResponse {
45
+ id: string;
46
+ description: string;
47
+ inputSchema: string;
48
+ outputSchema: string;
49
+ }
50
+ interface GetWorkflowResponse {
51
+ name: string;
52
+ triggerSchema: string;
53
+ steps: Record<string, StepAction<any, any, any, any>>;
54
+ stepGraph: StepGraph;
55
+ stepSubscriberGraph: Record<string, StepGraph>;
56
+ }
57
+ interface UpsertVectorParams {
58
+ indexName: string;
59
+ vectors: number[][];
60
+ metadata?: Record<string, any>[];
61
+ ids?: string[];
62
+ }
63
+ interface CreateIndexParams {
64
+ indexName: string;
65
+ dimension: number;
66
+ metric?: 'cosine' | 'euclidean' | 'dotproduct';
67
+ }
68
+ interface QueryVectorParams {
69
+ indexName: string;
70
+ queryVector: number[];
71
+ topK?: number;
72
+ filter?: Record<string, any>;
73
+ includeVector?: boolean;
74
+ }
75
+ interface QueryVectorResponse {
76
+ results: QueryResult[];
77
+ }
78
+ interface GetVectorIndexResponse {
79
+ dimension: number;
80
+ metric: 'cosine' | 'euclidean' | 'dotproduct';
81
+ count: number;
82
+ }
83
+ interface SaveMessageToMemoryParams {
84
+ messages: MessageType[];
85
+ agentId: string;
86
+ }
87
+ type SaveMessageToMemoryResponse = MessageType[];
88
+ interface CreateMemoryThreadParams {
89
+ title: string;
90
+ metadata: Record<string, any>;
91
+ resourceid: string;
92
+ threadId: string;
93
+ agentId: string;
94
+ }
95
+ type CreateMemoryThreadResponse = StorageThreadType;
96
+ interface GetMemoryThreadParams {
97
+ resourceId: string;
98
+ agentId: string;
99
+ }
100
+ type GetMemoryThreadResponse = StorageThreadType[];
101
+ interface UpdateMemoryThreadParams {
102
+ title: string;
103
+ metadata: Record<string, any>;
104
+ resourceid: string;
105
+ }
106
+ interface GetMemoryThreadMessagesResponse {
107
+ messages: CoreMessage[];
108
+ uiMessages: AiMessageType[];
109
+ }
110
+ interface GetLogsParams {
111
+ transportId: string;
112
+ }
113
+ interface GetLogParams {
114
+ runId: string;
115
+ transportId: string;
116
+ }
117
+ type GetLogsResponse = BaseLogMessage[];
118
+ type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
119
+ interface GetTelemetryResponse {
120
+ traces: any[];
121
+ }
122
+ interface GetTelemetryParams {
123
+ name?: string;
124
+ scope?: string;
125
+ page?: number;
126
+ perPage?: number;
127
+ attribute?: Record<string, string>;
128
+ }
129
+
130
+ declare class BaseResource {
131
+ readonly options: ClientOptions;
132
+ constructor(options: ClientOptions);
133
+ /**
134
+ * Makes an HTTP request to the API with retries and exponential backoff
135
+ * @param path - The API endpoint path
136
+ * @param options - Optional request configuration
137
+ * @returns Promise containing the response data
138
+ */
139
+ request<T>(path: string, options?: RequestOptions): Promise<T>;
140
+ }
141
+
142
+ declare class Agent extends BaseResource {
143
+ private agentId;
144
+ constructor(options: ClientOptions, agentId: string);
145
+ /**
146
+ * Retrieves details about the agent
147
+ * @returns Promise containing agent details including model and instructions
148
+ */
149
+ details(): Promise<GetAgentResponse>;
150
+ /**
151
+ * Generates a response from the agent
152
+ * @param params - Generation parameters including prompt
153
+ * @returns Promise containing the generated response
154
+ */
155
+ generate<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: GenerateParams<T>): Promise<GenerateReturn<T>>;
156
+ /**
157
+ * Streams a response from the agent
158
+ * @param params - Stream parameters including prompt
159
+ * @returns Promise containing the streamed response
160
+ */
161
+ stream<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: StreamParams<T>): Promise<Response>;
162
+ /**
163
+ * Gets details about a specific tool available to the agent
164
+ * @param toolId - ID of the tool to retrieve
165
+ * @returns Promise containing tool details
166
+ */
167
+ getTool(toolId: string): Promise<GetToolResponse>;
168
+ /**
169
+ * Retrieves evaluation results for the agent
170
+ * @returns Promise containing agent evaluations
171
+ */
172
+ evals(): Promise<GetEvalsByAgentIdResponse>;
173
+ /**
174
+ * Retrieves live evaluation results for the agent
175
+ * @returns Promise containing live agent evaluations
176
+ */
177
+ liveEvals(): Promise<GetEvalsByAgentIdResponse>;
178
+ }
179
+
180
+ declare class MemoryThread extends BaseResource {
181
+ private threadId;
182
+ private agentId;
183
+ constructor(options: ClientOptions, threadId: string, agentId: string);
184
+ /**
185
+ * Retrieves the memory thread details
186
+ * @returns Promise containing thread details including title and metadata
187
+ */
188
+ get(): Promise<StorageThreadType>;
189
+ /**
190
+ * Updates the memory thread properties
191
+ * @param params - Update parameters including title and metadata
192
+ * @returns Promise containing updated thread details
193
+ */
194
+ update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
195
+ /**
196
+ * Deletes the memory thread
197
+ * @returns Promise containing deletion result
198
+ */
199
+ delete(): Promise<{
200
+ result: string;
201
+ }>;
202
+ /**
203
+ * Retrieves messages associated with the thread
204
+ * @returns Promise containing thread messages and UI messages
205
+ */
206
+ getMessages(): Promise<GetMemoryThreadMessagesResponse>;
207
+ }
208
+
209
+ declare class Vector extends BaseResource {
210
+ private vectorName;
211
+ constructor(options: ClientOptions, vectorName: string);
212
+ /**
213
+ * Retrieves details about a specific vector index
214
+ * @param indexName - Name of the index to get details for
215
+ * @returns Promise containing vector index details
216
+ */
217
+ details(indexName: string): Promise<GetVectorIndexResponse>;
218
+ /**
219
+ * Deletes a vector index
220
+ * @param indexName - Name of the index to delete
221
+ * @returns Promise indicating deletion success
222
+ */
223
+ delete(indexName: string): Promise<{
224
+ success: boolean;
225
+ }>;
226
+ /**
227
+ * Retrieves a list of all available indexes
228
+ * @returns Promise containing array of index names
229
+ */
230
+ getIndexes(): Promise<{
231
+ indexes: string[];
232
+ }>;
233
+ /**
234
+ * Creates a new vector index
235
+ * @param params - Parameters for index creation including dimension and metric
236
+ * @returns Promise indicating creation success
237
+ */
238
+ createIndex(params: CreateIndexParams): Promise<{
239
+ success: boolean;
240
+ }>;
241
+ /**
242
+ * Upserts vectors into an index
243
+ * @param params - Parameters containing vectors, metadata, and optional IDs
244
+ * @returns Promise containing array of vector IDs
245
+ */
246
+ upsert(params: UpsertVectorParams): Promise<string[]>;
247
+ /**
248
+ * Queries vectors in an index
249
+ * @param params - Query parameters including query vector and search options
250
+ * @returns Promise containing query results
251
+ */
252
+ query(params: QueryVectorParams): Promise<QueryVectorResponse>;
253
+ }
254
+
255
+ declare class Workflow extends BaseResource {
256
+ private workflowId;
257
+ constructor(options: ClientOptions, workflowId: string);
258
+ /**
259
+ * Retrieves details about the workflow
260
+ * @returns Promise containing workflow details including steps and graphs
261
+ */
262
+ details(): Promise<GetWorkflowResponse>;
263
+ /**
264
+ * Executes the workflow with the provided parameters
265
+ * @param params - Parameters required for workflow execution
266
+ * @returns Promise containing the workflow execution results
267
+ */
268
+ execute(params: Record<string, any>): Promise<Record<string, any>>;
269
+ /**
270
+ * Resumes a suspended workflow step
271
+ * @param stepId - ID of the step to resume
272
+ * @param runId - ID of the workflow run
273
+ * @param context - Context to resume the workflow with
274
+ * @returns Promise containing the workflow resume results
275
+ */
276
+ resume({ stepId, runId, context, }: {
277
+ stepId: string;
278
+ runId: string;
279
+ context: Record<string, any>;
280
+ }): Promise<Record<string, any>>;
281
+ /**
282
+ * Watches workflow transitions in real-time
283
+ * @returns Promise containing the workflow watch stream
284
+ */
285
+ watch(): Promise<Response>;
286
+ }
287
+
288
+ declare class Tool extends BaseResource {
289
+ private toolId;
290
+ constructor(options: ClientOptions, toolId: string);
291
+ /**
292
+ * Retrieves details about the tool
293
+ * @returns Promise containing tool details including description and schemas
294
+ */
295
+ details(): Promise<GetToolResponse>;
296
+ /**
297
+ * Executes the tool with the provided parameters
298
+ * @param params - Parameters required for tool execution
299
+ * @returns Promise containing the tool execution results
300
+ */
301
+ execute(params: {
302
+ data: any;
303
+ }): Promise<any>;
304
+ }
305
+
306
+ declare class MastraClient extends BaseResource {
307
+ constructor(options: ClientOptions);
308
+ /**
309
+ * Retrieves all available agents
310
+ * @returns Promise containing map of agent IDs to agent details
311
+ */
312
+ getAgents(): Promise<Record<string, GetAgentResponse>>;
313
+ /**
314
+ * Gets an agent instance by ID
315
+ * @param agentId - ID of the agent to retrieve
316
+ * @returns Agent instance
317
+ */
318
+ getAgent(agentId: string): Agent;
319
+ /**
320
+ * Retrieves memory threads for a resource
321
+ * @param params - Parameters containing the resource ID
322
+ * @returns Promise containing array of memory threads
323
+ */
324
+ getMemoryThreads(params: GetMemoryThreadParams): Promise<GetMemoryThreadResponse>;
325
+ /**
326
+ * Creates a new memory thread
327
+ * @param params - Parameters for creating the memory thread
328
+ * @returns Promise containing the created memory thread
329
+ */
330
+ createMemoryThread(params: CreateMemoryThreadParams): Promise<CreateMemoryThreadResponse>;
331
+ /**
332
+ * Gets a memory thread instance by ID
333
+ * @param threadId - ID of the memory thread to retrieve
334
+ * @returns MemoryThread instance
335
+ */
336
+ getMemoryThread(threadId: string, agentId: string): MemoryThread;
337
+ /**
338
+ * Saves messages to memory
339
+ * @param params - Parameters containing messages to save
340
+ * @returns Promise containing the saved messages
341
+ */
342
+ saveMessageToMemory(params: SaveMessageToMemoryParams): Promise<SaveMessageToMemoryResponse>;
343
+ /**
344
+ * Gets the status of the memory system
345
+ * @returns Promise containing memory system status
346
+ */
347
+ getMemoryStatus(agentId: string): Promise<{
348
+ result: boolean;
349
+ }>;
350
+ /**
351
+ * Retrieves all available tools
352
+ * @returns Promise containing map of tool IDs to tool details
353
+ */
354
+ getTools(): Promise<Record<string, GetToolResponse>>;
355
+ /**
356
+ * Gets a tool instance by ID
357
+ * @param toolId - ID of the tool to retrieve
358
+ * @returns Tool instance
359
+ */
360
+ getTool(toolId: string): Tool;
361
+ /**
362
+ * Retrieves all available workflows
363
+ * @returns Promise containing map of workflow IDs to workflow details
364
+ */
365
+ getWorkflows(): Promise<Record<string, GetWorkflowResponse>>;
366
+ /**
367
+ * Gets a workflow instance by ID
368
+ * @param workflowId - ID of the workflow to retrieve
369
+ * @returns Workflow instance
370
+ */
371
+ getWorkflow(workflowId: string): Workflow;
372
+ /**
373
+ * Gets a vector instance by name
374
+ * @param vectorName - Name of the vector to retrieve
375
+ * @returns Vector instance
376
+ */
377
+ getVector(vectorName: string): Vector;
378
+ /**
379
+ * Retrieves logs
380
+ * @param params - Parameters for filtering logs
381
+ * @returns Promise containing array of log messages
382
+ */
383
+ getLogs(params: GetLogsParams): Promise<GetLogsResponse>;
384
+ /**
385
+ * Gets logs for a specific run
386
+ * @param params - Parameters containing run ID to retrieve
387
+ * @returns Promise containing array of log messages
388
+ */
389
+ getLogForRun(params: GetLogParams): Promise<GetLogsResponse>;
390
+ /**
391
+ * List of all log transports
392
+ * @returns Promise containing list of log transports
393
+ */
394
+ getLogTransports(): Promise<{
395
+ transports: string[];
396
+ }>;
397
+ /**
398
+ * List of all traces (paged)
399
+ * @param params - Parameters for filtering traces
400
+ * @returns Promise containing telemetry data
401
+ */
402
+ getTelemetry(params?: GetTelemetryParams): Promise<GetTelemetryResponse>;
403
+ }
404
+
405
+ 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 GetTelemetryParams, type GetTelemetryResponse, type GetToolResponse, type GetVectorIndexResponse, type GetWorkflowResponse, MastraClient, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams };