@mastra/client-js 0.0.0-storage-20250225005900 → 0.0.0-trigger-playground-ui-package-20250506151043

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.
@@ -1,16 +0,0 @@
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/dist/index.d.mts DELETED
@@ -1,405 +0,0 @@
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 };