@mastra/client-js 0.1.0-alpha.1 → 0.1.0-alpha.10

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 (294) hide show
  1. package/.eslintrc.js +10 -0
  2. package/.prettierignore +3 -0
  3. package/.prettierrc.json +26 -0
  4. package/LICENSE +44 -201
  5. package/README.md +90 -271
  6. package/dist/index.d.mts +359 -0
  7. package/dist/index.mjs +410 -0
  8. package/package.json +32 -95
  9. package/src/client.ts +135 -0
  10. package/src/example.ts +47 -0
  11. package/src/index.test.ts +585 -0
  12. package/src/index.ts +2 -194
  13. package/src/resources/agent.ts +115 -0
  14. package/src/resources/base.ts +68 -0
  15. package/src/resources/index.ts +6 -9
  16. package/src/resources/memory-thread.ts +57 -0
  17. package/src/resources/tool.ts +31 -0
  18. package/src/resources/vector.ts +82 -0
  19. package/src/resources/workflow.ts +31 -0
  20. package/src/types.ts +142 -0
  21. package/tsconfig.json +29 -0
  22. package/vitest.config.js +8 -0
  23. package/CHANGELOG.md +0 -21
  24. package/_shims/MultipartBody.d.ts +0 -9
  25. package/_shims/MultipartBody.d.ts.map +0 -1
  26. package/_shims/MultipartBody.js +0 -16
  27. package/_shims/MultipartBody.js.map +0 -1
  28. package/_shims/MultipartBody.mjs +0 -12
  29. package/_shims/MultipartBody.mjs.map +0 -1
  30. package/_shims/README.md +0 -46
  31. package/_shims/auto/runtime-bun.d.ts +0 -5
  32. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  33. package/_shims/auto/runtime-bun.js +0 -21
  34. package/_shims/auto/runtime-bun.js.map +0 -1
  35. package/_shims/auto/runtime-bun.mjs +0 -2
  36. package/_shims/auto/runtime-bun.mjs.map +0 -1
  37. package/_shims/auto/runtime-node.d.ts +0 -5
  38. package/_shims/auto/runtime-node.d.ts.map +0 -1
  39. package/_shims/auto/runtime-node.js +0 -21
  40. package/_shims/auto/runtime-node.js.map +0 -1
  41. package/_shims/auto/runtime-node.mjs +0 -2
  42. package/_shims/auto/runtime-node.mjs.map +0 -1
  43. package/_shims/auto/runtime.d.ts +0 -5
  44. package/_shims/auto/runtime.d.ts.map +0 -1
  45. package/_shims/auto/runtime.js +0 -21
  46. package/_shims/auto/runtime.js.map +0 -1
  47. package/_shims/auto/runtime.mjs +0 -2
  48. package/_shims/auto/runtime.mjs.map +0 -1
  49. package/_shims/auto/types-node.d.ts +0 -5
  50. package/_shims/auto/types-node.d.ts.map +0 -1
  51. package/_shims/auto/types-node.js +0 -21
  52. package/_shims/auto/types-node.js.map +0 -1
  53. package/_shims/auto/types-node.mjs +0 -2
  54. package/_shims/auto/types-node.mjs.map +0 -1
  55. package/_shims/auto/types.d.ts +0 -101
  56. package/_shims/auto/types.js +0 -3
  57. package/_shims/auto/types.mjs +0 -3
  58. package/_shims/bun-runtime.d.ts +0 -6
  59. package/_shims/bun-runtime.d.ts.map +0 -1
  60. package/_shims/bun-runtime.js +0 -14
  61. package/_shims/bun-runtime.js.map +0 -1
  62. package/_shims/bun-runtime.mjs +0 -10
  63. package/_shims/bun-runtime.mjs.map +0 -1
  64. package/_shims/index.d.ts +0 -81
  65. package/_shims/index.js +0 -13
  66. package/_shims/index.mjs +0 -7
  67. package/_shims/manual-types.d.ts +0 -12
  68. package/_shims/manual-types.js +0 -3
  69. package/_shims/manual-types.mjs +0 -3
  70. package/_shims/node-runtime.d.ts +0 -3
  71. package/_shims/node-runtime.d.ts.map +0 -1
  72. package/_shims/node-runtime.js +0 -89
  73. package/_shims/node-runtime.js.map +0 -1
  74. package/_shims/node-runtime.mjs +0 -56
  75. package/_shims/node-runtime.mjs.map +0 -1
  76. package/_shims/node-types.d.ts +0 -42
  77. package/_shims/node-types.js +0 -3
  78. package/_shims/node-types.mjs +0 -3
  79. package/_shims/registry.d.ts +0 -37
  80. package/_shims/registry.d.ts.map +0 -1
  81. package/_shims/registry.js +0 -41
  82. package/_shims/registry.js.map +0 -1
  83. package/_shims/registry.mjs +0 -37
  84. package/_shims/registry.mjs.map +0 -1
  85. package/_shims/web-runtime.d.ts +0 -5
  86. package/_shims/web-runtime.d.ts.map +0 -1
  87. package/_shims/web-runtime.js +0 -78
  88. package/_shims/web-runtime.js.map +0 -1
  89. package/_shims/web-runtime.mjs +0 -71
  90. package/_shims/web-runtime.mjs.map +0 -1
  91. package/_shims/web-types.d.ts +0 -83
  92. package/_shims/web-types.js +0 -3
  93. package/_shims/web-types.mjs +0 -3
  94. package/core.d.ts +0 -241
  95. package/core.d.ts.map +0 -1
  96. package/core.js +0 -908
  97. package/core.js.map +0 -1
  98. package/core.mjs +0 -876
  99. package/core.mjs.map +0 -1
  100. package/error.d.ts +0 -47
  101. package/error.d.ts.map +0 -1
  102. package/error.js +0 -113
  103. package/error.js.map +0 -1
  104. package/error.mjs +0 -97
  105. package/error.mjs.map +0 -1
  106. package/index.d.mts +0 -121
  107. package/index.d.ts +0 -121
  108. package/index.d.ts.map +0 -1
  109. package/index.js +0 -131
  110. package/index.js.map +0 -1
  111. package/index.mjs +0 -88
  112. package/index.mjs.map +0 -1
  113. package/resource.d.ts +0 -6
  114. package/resource.d.ts.map +0 -1
  115. package/resource.js +0 -11
  116. package/resource.js.map +0 -1
  117. package/resource.mjs +0 -7
  118. package/resource.mjs.map +0 -1
  119. package/resources/agents/agents.d.ts +0 -40
  120. package/resources/agents/agents.d.ts.map +0 -1
  121. package/resources/agents/agents.js +0 -74
  122. package/resources/agents/agents.js.map +0 -1
  123. package/resources/agents/agents.mjs +0 -47
  124. package/resources/agents/agents.mjs.map +0 -1
  125. package/resources/agents/index.d.ts +0 -3
  126. package/resources/agents/index.d.ts.map +0 -1
  127. package/resources/agents/index.js +0 -9
  128. package/resources/agents/index.js.map +0 -1
  129. package/resources/agents/index.mjs +0 -4
  130. package/resources/agents/index.mjs.map +0 -1
  131. package/resources/agents/tools.d.ts +0 -17
  132. package/resources/agents/tools.d.ts.map +0 -1
  133. package/resources/agents/tools.js +0 -19
  134. package/resources/agents/tools.js.map +0 -1
  135. package/resources/agents/tools.mjs +0 -15
  136. package/resources/agents/tools.mjs.map +0 -1
  137. package/resources/index.d.ts +0 -8
  138. package/resources/index.d.ts.map +0 -1
  139. package/resources/index.js +0 -19
  140. package/resources/index.js.map +0 -1
  141. package/resources/index.mjs +0 -9
  142. package/resources/index.mjs.map +0 -1
  143. package/resources/logs.d.ts +0 -13
  144. package/resources/logs.d.ts.map +0 -1
  145. package/resources/logs.js +0 -24
  146. package/resources/logs.js.map +0 -1
  147. package/resources/logs.mjs +0 -20
  148. package/resources/logs.mjs.map +0 -1
  149. package/resources/memory/index.d.ts +0 -4
  150. package/resources/memory/index.d.ts.map +0 -1
  151. package/resources/memory/index.js +0 -11
  152. package/resources/memory/index.js.map +0 -1
  153. package/resources/memory/index.mjs +0 -5
  154. package/resources/memory/index.mjs.map +0 -1
  155. package/resources/memory/memory.d.ts +0 -23
  156. package/resources/memory/memory.d.ts.map +0 -1
  157. package/resources/memory/memory.js +0 -53
  158. package/resources/memory/memory.js.map +0 -1
  159. package/resources/memory/memory.mjs +0 -26
  160. package/resources/memory/memory.mjs.map +0 -1
  161. package/resources/memory/status.d.ts +0 -9
  162. package/resources/memory/status.d.ts.map +0 -1
  163. package/resources/memory/status.js +0 -18
  164. package/resources/memory/status.js.map +0 -1
  165. package/resources/memory/status.mjs +0 -14
  166. package/resources/memory/status.mjs.map +0 -1
  167. package/resources/memory/threads/index.d.ts +0 -3
  168. package/resources/memory/threads/index.d.ts.map +0 -1
  169. package/resources/memory/threads/index.js +0 -9
  170. package/resources/memory/threads/index.js.map +0 -1
  171. package/resources/memory/threads/index.mjs +0 -4
  172. package/resources/memory/threads/index.mjs.map +0 -1
  173. package/resources/memory/threads/messages.d.ts +0 -9
  174. package/resources/memory/threads/messages.d.ts.map +0 -1
  175. package/resources/memory/threads/messages.js +0 -18
  176. package/resources/memory/threads/messages.js.map +0 -1
  177. package/resources/memory/threads/messages.mjs +0 -14
  178. package/resources/memory/threads/messages.mjs.map +0 -1
  179. package/resources/memory/threads/threads.d.ts +0 -45
  180. package/resources/memory/threads/threads.d.ts.map +0 -1
  181. package/resources/memory/threads/threads.js +0 -104
  182. package/resources/memory/threads/threads.js.map +0 -1
  183. package/resources/memory/threads/threads.mjs +0 -77
  184. package/resources/memory/threads/threads.mjs.map +0 -1
  185. package/resources/syncs.d.ts +0 -15
  186. package/resources/syncs.d.ts.map +0 -1
  187. package/resources/syncs.js +0 -19
  188. package/resources/syncs.js.map +0 -1
  189. package/resources/syncs.mjs +0 -15
  190. package/resources/syncs.mjs.map +0 -1
  191. package/resources/system.d.ts +0 -9
  192. package/resources/system.d.ts.map +0 -1
  193. package/resources/system.js +0 -15
  194. package/resources/system.js.map +0 -1
  195. package/resources/system.mjs +0 -11
  196. package/resources/system.mjs.map +0 -1
  197. package/resources/tools/index.d.ts +0 -3
  198. package/resources/tools/index.d.ts.map +0 -1
  199. package/resources/tools/index.js +0 -9
  200. package/resources/tools/index.js.map +0 -1
  201. package/resources/tools/index.mjs +0 -4
  202. package/resources/tools/index.mjs.map +0 -1
  203. package/resources/tools/result.d.ts +0 -9
  204. package/resources/tools/result.d.ts.map +0 -1
  205. package/resources/tools/result.js +0 -18
  206. package/resources/tools/result.js.map +0 -1
  207. package/resources/tools/result.mjs +0 -14
  208. package/resources/tools/result.mjs.map +0 -1
  209. package/resources/tools/tools.d.ts +0 -29
  210. package/resources/tools/tools.d.ts.map +0 -1
  211. package/resources/tools/tools.js +0 -64
  212. package/resources/tools/tools.js.map +0 -1
  213. package/resources/tools/tools.mjs +0 -37
  214. package/resources/tools/tools.mjs.map +0 -1
  215. package/resources/workflows.d.ts +0 -23
  216. package/resources/workflows.d.ts.map +0 -1
  217. package/resources/workflows.js +0 -37
  218. package/resources/workflows.js.map +0 -1
  219. package/resources/workflows.mjs +0 -33
  220. package/resources/workflows.mjs.map +0 -1
  221. package/shims/node.d.ts +0 -30
  222. package/shims/node.d.ts.map +0 -1
  223. package/shims/node.js +0 -31
  224. package/shims/node.js.map +0 -1
  225. package/shims/node.mjs +0 -5
  226. package/shims/node.mjs.map +0 -1
  227. package/shims/web.d.ts +0 -26
  228. package/shims/web.d.ts.map +0 -1
  229. package/shims/web.js +0 -31
  230. package/shims/web.js.map +0 -1
  231. package/shims/web.mjs +0 -5
  232. package/shims/web.mjs.map +0 -1
  233. package/src/_shims/MultipartBody.ts +0 -9
  234. package/src/_shims/README.md +0 -46
  235. package/src/_shims/auto/runtime-bun.ts +0 -4
  236. package/src/_shims/auto/runtime-node.ts +0 -4
  237. package/src/_shims/auto/runtime.ts +0 -4
  238. package/src/_shims/auto/types-node.ts +0 -4
  239. package/src/_shims/auto/types.d.ts +0 -101
  240. package/src/_shims/auto/types.js +0 -3
  241. package/src/_shims/auto/types.mjs +0 -3
  242. package/src/_shims/bun-runtime.ts +0 -14
  243. package/src/_shims/index.d.ts +0 -81
  244. package/src/_shims/index.js +0 -13
  245. package/src/_shims/index.mjs +0 -7
  246. package/src/_shims/manual-types.d.ts +0 -12
  247. package/src/_shims/manual-types.js +0 -3
  248. package/src/_shims/manual-types.mjs +0 -3
  249. package/src/_shims/node-runtime.ts +0 -81
  250. package/src/_shims/node-types.d.ts +0 -42
  251. package/src/_shims/node-types.js +0 -3
  252. package/src/_shims/node-types.mjs +0 -3
  253. package/src/_shims/registry.ts +0 -67
  254. package/src/_shims/web-runtime.ts +0 -103
  255. package/src/_shims/web-types.d.ts +0 -83
  256. package/src/_shims/web-types.js +0 -3
  257. package/src/_shims/web-types.mjs +0 -3
  258. package/src/core.ts +0 -1201
  259. package/src/error.ts +0 -130
  260. package/src/lib/.keep +0 -4
  261. package/src/resource.ts +0 -11
  262. package/src/resources/agents/agents.ts +0 -77
  263. package/src/resources/agents/index.ts +0 -4
  264. package/src/resources/agents/tools.ts +0 -34
  265. package/src/resources/logs.ts +0 -23
  266. package/src/resources/memory/index.ts +0 -5
  267. package/src/resources/memory/memory.ts +0 -43
  268. package/src/resources/memory/status.ts +0 -16
  269. package/src/resources/memory/threads/index.ts +0 -4
  270. package/src/resources/memory/threads/messages.ts +0 -16
  271. package/src/resources/memory/threads/threads.ts +0 -105
  272. package/src/resources/syncs.ts +0 -25
  273. package/src/resources/system.ts +0 -13
  274. package/src/resources/tools/index.ts +0 -4
  275. package/src/resources/tools/result.ts +0 -16
  276. package/src/resources/tools/tools.ts +0 -54
  277. package/src/resources/workflows.ts +0 -49
  278. package/src/shims/node.ts +0 -50
  279. package/src/shims/web.ts +0 -50
  280. package/src/tsconfig.json +0 -11
  281. package/src/uploads.ts +0 -255
  282. package/src/version.ts +0 -1
  283. package/uploads.d.ts +0 -75
  284. package/uploads.d.ts.map +0 -1
  285. package/uploads.js +0 -171
  286. package/uploads.js.map +0 -1
  287. package/uploads.mjs +0 -158
  288. package/uploads.mjs.map +0 -1
  289. package/version.d.ts +0 -2
  290. package/version.d.ts.map +0 -1
  291. package/version.js +0 -5
  292. package/version.js.map +0 -1
  293. package/version.mjs +0 -2
  294. package/version.mjs.map +0 -1
@@ -0,0 +1,359 @@
1
+ import { MessageType, OutputType, StorageThreadType, CoreMessage, AiMessageType, 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: MessageType[];
31
+ threadId?: string;
32
+ resourceid?: string;
33
+ output?: OutputType | T;
34
+ }
35
+ interface StreamParams<T extends JSONSchema7 | ZodSchema | undefined = undefined> {
36
+ messages: MessageType[];
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
+ }
86
+ type SaveMessageToMemoryResponse = MessageType[];
87
+ interface CreateMemoryThreadParams {
88
+ title: string;
89
+ metadata: Record<string, any>;
90
+ resourceid: string;
91
+ threadId: string;
92
+ }
93
+ type CreateMemoryThreadResponse = StorageThreadType;
94
+ interface GetMemoryThreadParams {
95
+ resourceId: string;
96
+ }
97
+ type GetMemoryThreadResponse = StorageThreadType[];
98
+ interface UpdateMemoryThreadParams {
99
+ title: string;
100
+ metadata: Record<string, any>;
101
+ resourceid: string;
102
+ }
103
+ interface GetMemoryThreadMessagesResponse {
104
+ messages: CoreMessage[];
105
+ uiMessages: AiMessageType[];
106
+ }
107
+ interface GetLogsParams {
108
+ transportId: string;
109
+ }
110
+ interface GetLogParams {
111
+ runId: string;
112
+ transportId: string;
113
+ }
114
+ type GetLogsResponse = BaseLogMessage[];
115
+ type RequestFunction = (path: string, options?: RequestOptions) => Promise<any>;
116
+
117
+ declare class BaseResource {
118
+ readonly options: ClientOptions;
119
+ constructor(options: ClientOptions);
120
+ /**
121
+ * Makes an HTTP request to the API with retries and exponential backoff
122
+ * @param path - The API endpoint path
123
+ * @param options - Optional request configuration
124
+ * @returns Promise containing the response data
125
+ */
126
+ request<T>(path: string, options?: RequestOptions): Promise<T>;
127
+ }
128
+
129
+ declare class Agent extends BaseResource {
130
+ private agentId;
131
+ constructor(options: ClientOptions, agentId: string);
132
+ /**
133
+ * Retrieves details about the agent
134
+ * @returns Promise containing agent details including model and instructions
135
+ */
136
+ details(): Promise<GetAgentResponse>;
137
+ /**
138
+ * Generates a response from the agent
139
+ * @param params - Generation parameters including prompt
140
+ * @returns Promise containing the generated response
141
+ */
142
+ generate<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: GenerateParams<T>): Promise<GenerateReturn<T>>;
143
+ /**
144
+ * Streams a response from the agent
145
+ * @param params - Stream parameters including prompt
146
+ * @returns Promise containing the streamed response
147
+ */
148
+ stream<T extends JSONSchema7 | ZodSchema | undefined = undefined>(params: StreamParams<T>): Promise<Response>;
149
+ /**
150
+ * Gets details about a specific tool available to the agent
151
+ * @param toolId - ID of the tool to retrieve
152
+ * @returns Promise containing tool details
153
+ */
154
+ getTool(toolId: string): Promise<GetToolResponse>;
155
+ /**
156
+ * Retrieves evaluation results for the agent
157
+ * @returns Promise containing agent evaluations
158
+ */
159
+ evals(): Promise<GetEvalsByAgentIdResponse>;
160
+ /**
161
+ * Retrieves live evaluation results for the agent
162
+ * @returns Promise containing live agent evaluations
163
+ */
164
+ liveEvals(): Promise<GetEvalsByAgentIdResponse>;
165
+ }
166
+
167
+ declare class MemoryThread extends BaseResource {
168
+ private threadId;
169
+ constructor(options: ClientOptions, threadId: string);
170
+ /**
171
+ * Retrieves the memory thread details
172
+ * @returns Promise containing thread details including title and metadata
173
+ */
174
+ get(): Promise<StorageThreadType>;
175
+ /**
176
+ * Updates the memory thread properties
177
+ * @param params - Update parameters including title and metadata
178
+ * @returns Promise containing updated thread details
179
+ */
180
+ update(params: UpdateMemoryThreadParams): Promise<StorageThreadType>;
181
+ /**
182
+ * Deletes the memory thread
183
+ * @returns Promise containing deletion result
184
+ */
185
+ delete(): Promise<{
186
+ result: string;
187
+ }>;
188
+ /**
189
+ * Retrieves messages associated with the thread
190
+ * @returns Promise containing thread messages and UI messages
191
+ */
192
+ getMessages(): Promise<GetMemoryThreadMessagesResponse>;
193
+ }
194
+
195
+ declare class Vector extends BaseResource {
196
+ private vectorName;
197
+ constructor(options: ClientOptions, vectorName: string);
198
+ /**
199
+ * Retrieves details about a specific vector index
200
+ * @param indexName - Name of the index to get details for
201
+ * @returns Promise containing vector index details
202
+ */
203
+ details(indexName: string): Promise<GetVectorIndexResponse>;
204
+ /**
205
+ * Deletes a vector index
206
+ * @param indexName - Name of the index to delete
207
+ * @returns Promise indicating deletion success
208
+ */
209
+ delete(indexName: string): Promise<{
210
+ success: boolean;
211
+ }>;
212
+ /**
213
+ * Retrieves a list of all available indexes
214
+ * @returns Promise containing array of index names
215
+ */
216
+ getIndexes(): Promise<{
217
+ indexes: string[];
218
+ }>;
219
+ /**
220
+ * Creates a new vector index
221
+ * @param params - Parameters for index creation including dimension and metric
222
+ * @returns Promise indicating creation success
223
+ */
224
+ createIndex(params: CreateIndexParams): Promise<{
225
+ success: boolean;
226
+ }>;
227
+ /**
228
+ * Upserts vectors into an index
229
+ * @param params - Parameters containing vectors, metadata, and optional IDs
230
+ * @returns Promise containing array of vector IDs
231
+ */
232
+ upsert(params: UpsertVectorParams): Promise<string[]>;
233
+ /**
234
+ * Queries vectors in an index
235
+ * @param params - Query parameters including query vector and search options
236
+ * @returns Promise containing query results
237
+ */
238
+ query(params: QueryVectorParams): Promise<QueryVectorResponse>;
239
+ }
240
+
241
+ declare class Workflow extends BaseResource {
242
+ private workflowId;
243
+ constructor(options: ClientOptions, workflowId: string);
244
+ /**
245
+ * Retrieves details about the workflow
246
+ * @returns Promise containing workflow details including steps and graphs
247
+ */
248
+ details(): Promise<GetWorkflowResponse>;
249
+ /**
250
+ * Executes the workflow with the provided parameters
251
+ * @param params - Parameters required for workflow execution
252
+ * @returns Promise containing the workflow execution results
253
+ */
254
+ execute(params: Record<string, any>): Promise<Record<string, any>>;
255
+ }
256
+
257
+ declare class Tool extends BaseResource {
258
+ private toolId;
259
+ constructor(options: ClientOptions, toolId: string);
260
+ /**
261
+ * Retrieves details about the tool
262
+ * @returns Promise containing tool details including description and schemas
263
+ */
264
+ details(): Promise<GetToolResponse>;
265
+ /**
266
+ * Executes the tool with the provided parameters
267
+ * @param params - Parameters required for tool execution
268
+ * @returns Promise containing the tool execution results
269
+ */
270
+ execute(params: Record<string, any>): Promise<Record<string, any>>;
271
+ }
272
+
273
+ declare class MastraClient extends BaseResource {
274
+ constructor(options: ClientOptions);
275
+ /**
276
+ * Retrieves all available agents
277
+ * @returns Promise containing map of agent IDs to agent details
278
+ */
279
+ getAgents(): Promise<Record<string, GetAgentResponse>>;
280
+ /**
281
+ * Gets an agent instance by ID
282
+ * @param agentId - ID of the agent to retrieve
283
+ * @returns Agent instance
284
+ */
285
+ getAgent(agentId: string): Agent;
286
+ /**
287
+ * Retrieves memory threads for a resource
288
+ * @param params - Parameters containing the resource ID
289
+ * @returns Promise containing array of memory threads
290
+ */
291
+ getMemoryThreads(params: GetMemoryThreadParams): Promise<GetMemoryThreadResponse>;
292
+ /**
293
+ * Creates a new memory thread
294
+ * @param params - Parameters for creating the memory thread
295
+ * @returns Promise containing the created memory thread
296
+ */
297
+ createMemoryThread(params: CreateMemoryThreadParams): Promise<CreateMemoryThreadResponse>;
298
+ /**
299
+ * Gets a memory thread instance by ID
300
+ * @param threadId - ID of the memory thread to retrieve
301
+ * @returns MemoryThread instance
302
+ */
303
+ getMemoryThread(threadId: string): MemoryThread;
304
+ /**
305
+ * Saves messages to memory
306
+ * @param params - Parameters containing messages to save
307
+ * @returns Promise containing the saved messages
308
+ */
309
+ saveMessageToMemory(params: SaveMessageToMemoryParams): Promise<SaveMessageToMemoryResponse>;
310
+ /**
311
+ * Gets the status of the memory system
312
+ * @returns Promise containing memory system status
313
+ */
314
+ getMemoryStatus(): Promise<{
315
+ result: boolean;
316
+ }>;
317
+ /**
318
+ * Retrieves all available tools
319
+ * @returns Promise containing map of tool IDs to tool details
320
+ */
321
+ getTools(): Promise<Record<string, GetToolResponse>>;
322
+ /**
323
+ * Gets a tool instance by ID
324
+ * @param toolId - ID of the tool to retrieve
325
+ * @returns Tool instance
326
+ */
327
+ getTool(toolId: string): Tool;
328
+ /**
329
+ * Retrieves all available workflows
330
+ * @returns Promise containing map of workflow IDs to workflow details
331
+ */
332
+ getWorkflows(): Promise<Record<string, GetWorkflowResponse>>;
333
+ /**
334
+ * Gets a workflow instance by ID
335
+ * @param workflowId - ID of the workflow to retrieve
336
+ * @returns Workflow instance
337
+ */
338
+ getWorkflow(workflowId: string): Workflow;
339
+ /**
340
+ * Gets a vector instance by name
341
+ * @param vectorName - Name of the vector to retrieve
342
+ * @returns Vector instance
343
+ */
344
+ getVector(vectorName: string): Vector;
345
+ /**
346
+ * Retrieves logs
347
+ * @param params - Parameters for filtering logs
348
+ * @returns Promise containing array of log messages
349
+ */
350
+ getLogs(params: GetLogsParams): Promise<GetLogsResponse>;
351
+ /**
352
+ * Gets logs for a specific run
353
+ * @param params - Parameters containing run ID to retrieve
354
+ * @returns Promise containing array of log messages
355
+ */
356
+ getLogForRun(params: GetLogParams): Promise<GetLogsResponse>;
357
+ }
358
+
359
+ 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 GetToolResponse, type GetVectorIndexResponse, type GetWorkflowResponse, MastraClient, type QueryVectorParams, type QueryVectorResponse, type RequestFunction, type RequestOptions, type SaveMessageToMemoryParams, type SaveMessageToMemoryResponse, type StreamParams, type UpdateMemoryThreadParams, type UpsertVectorParams };