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

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 (292) 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 +346 -0
  7. package/dist/index.mjs +399 -0
  8. package/package.json +28 -95
  9. package/src/client.ts +201 -0
  10. package/src/index.test.ts +507 -0
  11. package/src/index.ts +2 -194
  12. package/src/resources/agent.ts +94 -0
  13. package/src/resources/index.ts +5 -9
  14. package/src/resources/memory-thread.ts +51 -0
  15. package/src/resources/tool.ts +28 -0
  16. package/src/resources/vector.ts +79 -0
  17. package/src/resources/workflow.ts +28 -0
  18. package/src/types.ts +121 -0
  19. package/tsconfig.json +29 -0
  20. package/vitest.config.js +8 -0
  21. package/CHANGELOG.md +0 -21
  22. package/_shims/MultipartBody.d.ts +0 -9
  23. package/_shims/MultipartBody.d.ts.map +0 -1
  24. package/_shims/MultipartBody.js +0 -16
  25. package/_shims/MultipartBody.js.map +0 -1
  26. package/_shims/MultipartBody.mjs +0 -12
  27. package/_shims/MultipartBody.mjs.map +0 -1
  28. package/_shims/README.md +0 -46
  29. package/_shims/auto/runtime-bun.d.ts +0 -5
  30. package/_shims/auto/runtime-bun.d.ts.map +0 -1
  31. package/_shims/auto/runtime-bun.js +0 -21
  32. package/_shims/auto/runtime-bun.js.map +0 -1
  33. package/_shims/auto/runtime-bun.mjs +0 -2
  34. package/_shims/auto/runtime-bun.mjs.map +0 -1
  35. package/_shims/auto/runtime-node.d.ts +0 -5
  36. package/_shims/auto/runtime-node.d.ts.map +0 -1
  37. package/_shims/auto/runtime-node.js +0 -21
  38. package/_shims/auto/runtime-node.js.map +0 -1
  39. package/_shims/auto/runtime-node.mjs +0 -2
  40. package/_shims/auto/runtime-node.mjs.map +0 -1
  41. package/_shims/auto/runtime.d.ts +0 -5
  42. package/_shims/auto/runtime.d.ts.map +0 -1
  43. package/_shims/auto/runtime.js +0 -21
  44. package/_shims/auto/runtime.js.map +0 -1
  45. package/_shims/auto/runtime.mjs +0 -2
  46. package/_shims/auto/runtime.mjs.map +0 -1
  47. package/_shims/auto/types-node.d.ts +0 -5
  48. package/_shims/auto/types-node.d.ts.map +0 -1
  49. package/_shims/auto/types-node.js +0 -21
  50. package/_shims/auto/types-node.js.map +0 -1
  51. package/_shims/auto/types-node.mjs +0 -2
  52. package/_shims/auto/types-node.mjs.map +0 -1
  53. package/_shims/auto/types.d.ts +0 -101
  54. package/_shims/auto/types.js +0 -3
  55. package/_shims/auto/types.mjs +0 -3
  56. package/_shims/bun-runtime.d.ts +0 -6
  57. package/_shims/bun-runtime.d.ts.map +0 -1
  58. package/_shims/bun-runtime.js +0 -14
  59. package/_shims/bun-runtime.js.map +0 -1
  60. package/_shims/bun-runtime.mjs +0 -10
  61. package/_shims/bun-runtime.mjs.map +0 -1
  62. package/_shims/index.d.ts +0 -81
  63. package/_shims/index.js +0 -13
  64. package/_shims/index.mjs +0 -7
  65. package/_shims/manual-types.d.ts +0 -12
  66. package/_shims/manual-types.js +0 -3
  67. package/_shims/manual-types.mjs +0 -3
  68. package/_shims/node-runtime.d.ts +0 -3
  69. package/_shims/node-runtime.d.ts.map +0 -1
  70. package/_shims/node-runtime.js +0 -89
  71. package/_shims/node-runtime.js.map +0 -1
  72. package/_shims/node-runtime.mjs +0 -56
  73. package/_shims/node-runtime.mjs.map +0 -1
  74. package/_shims/node-types.d.ts +0 -42
  75. package/_shims/node-types.js +0 -3
  76. package/_shims/node-types.mjs +0 -3
  77. package/_shims/registry.d.ts +0 -37
  78. package/_shims/registry.d.ts.map +0 -1
  79. package/_shims/registry.js +0 -41
  80. package/_shims/registry.js.map +0 -1
  81. package/_shims/registry.mjs +0 -37
  82. package/_shims/registry.mjs.map +0 -1
  83. package/_shims/web-runtime.d.ts +0 -5
  84. package/_shims/web-runtime.d.ts.map +0 -1
  85. package/_shims/web-runtime.js +0 -78
  86. package/_shims/web-runtime.js.map +0 -1
  87. package/_shims/web-runtime.mjs +0 -71
  88. package/_shims/web-runtime.mjs.map +0 -1
  89. package/_shims/web-types.d.ts +0 -83
  90. package/_shims/web-types.js +0 -3
  91. package/_shims/web-types.mjs +0 -3
  92. package/core.d.ts +0 -241
  93. package/core.d.ts.map +0 -1
  94. package/core.js +0 -908
  95. package/core.js.map +0 -1
  96. package/core.mjs +0 -876
  97. package/core.mjs.map +0 -1
  98. package/error.d.ts +0 -47
  99. package/error.d.ts.map +0 -1
  100. package/error.js +0 -113
  101. package/error.js.map +0 -1
  102. package/error.mjs +0 -97
  103. package/error.mjs.map +0 -1
  104. package/index.d.mts +0 -121
  105. package/index.d.ts +0 -121
  106. package/index.d.ts.map +0 -1
  107. package/index.js +0 -131
  108. package/index.js.map +0 -1
  109. package/index.mjs +0 -88
  110. package/index.mjs.map +0 -1
  111. package/resource.d.ts +0 -6
  112. package/resource.d.ts.map +0 -1
  113. package/resource.js +0 -11
  114. package/resource.js.map +0 -1
  115. package/resource.mjs +0 -7
  116. package/resource.mjs.map +0 -1
  117. package/resources/agents/agents.d.ts +0 -40
  118. package/resources/agents/agents.d.ts.map +0 -1
  119. package/resources/agents/agents.js +0 -74
  120. package/resources/agents/agents.js.map +0 -1
  121. package/resources/agents/agents.mjs +0 -47
  122. package/resources/agents/agents.mjs.map +0 -1
  123. package/resources/agents/index.d.ts +0 -3
  124. package/resources/agents/index.d.ts.map +0 -1
  125. package/resources/agents/index.js +0 -9
  126. package/resources/agents/index.js.map +0 -1
  127. package/resources/agents/index.mjs +0 -4
  128. package/resources/agents/index.mjs.map +0 -1
  129. package/resources/agents/tools.d.ts +0 -17
  130. package/resources/agents/tools.d.ts.map +0 -1
  131. package/resources/agents/tools.js +0 -19
  132. package/resources/agents/tools.js.map +0 -1
  133. package/resources/agents/tools.mjs +0 -15
  134. package/resources/agents/tools.mjs.map +0 -1
  135. package/resources/index.d.ts +0 -8
  136. package/resources/index.d.ts.map +0 -1
  137. package/resources/index.js +0 -19
  138. package/resources/index.js.map +0 -1
  139. package/resources/index.mjs +0 -9
  140. package/resources/index.mjs.map +0 -1
  141. package/resources/logs.d.ts +0 -13
  142. package/resources/logs.d.ts.map +0 -1
  143. package/resources/logs.js +0 -24
  144. package/resources/logs.js.map +0 -1
  145. package/resources/logs.mjs +0 -20
  146. package/resources/logs.mjs.map +0 -1
  147. package/resources/memory/index.d.ts +0 -4
  148. package/resources/memory/index.d.ts.map +0 -1
  149. package/resources/memory/index.js +0 -11
  150. package/resources/memory/index.js.map +0 -1
  151. package/resources/memory/index.mjs +0 -5
  152. package/resources/memory/index.mjs.map +0 -1
  153. package/resources/memory/memory.d.ts +0 -23
  154. package/resources/memory/memory.d.ts.map +0 -1
  155. package/resources/memory/memory.js +0 -53
  156. package/resources/memory/memory.js.map +0 -1
  157. package/resources/memory/memory.mjs +0 -26
  158. package/resources/memory/memory.mjs.map +0 -1
  159. package/resources/memory/status.d.ts +0 -9
  160. package/resources/memory/status.d.ts.map +0 -1
  161. package/resources/memory/status.js +0 -18
  162. package/resources/memory/status.js.map +0 -1
  163. package/resources/memory/status.mjs +0 -14
  164. package/resources/memory/status.mjs.map +0 -1
  165. package/resources/memory/threads/index.d.ts +0 -3
  166. package/resources/memory/threads/index.d.ts.map +0 -1
  167. package/resources/memory/threads/index.js +0 -9
  168. package/resources/memory/threads/index.js.map +0 -1
  169. package/resources/memory/threads/index.mjs +0 -4
  170. package/resources/memory/threads/index.mjs.map +0 -1
  171. package/resources/memory/threads/messages.d.ts +0 -9
  172. package/resources/memory/threads/messages.d.ts.map +0 -1
  173. package/resources/memory/threads/messages.js +0 -18
  174. package/resources/memory/threads/messages.js.map +0 -1
  175. package/resources/memory/threads/messages.mjs +0 -14
  176. package/resources/memory/threads/messages.mjs.map +0 -1
  177. package/resources/memory/threads/threads.d.ts +0 -45
  178. package/resources/memory/threads/threads.d.ts.map +0 -1
  179. package/resources/memory/threads/threads.js +0 -104
  180. package/resources/memory/threads/threads.js.map +0 -1
  181. package/resources/memory/threads/threads.mjs +0 -77
  182. package/resources/memory/threads/threads.mjs.map +0 -1
  183. package/resources/syncs.d.ts +0 -15
  184. package/resources/syncs.d.ts.map +0 -1
  185. package/resources/syncs.js +0 -19
  186. package/resources/syncs.js.map +0 -1
  187. package/resources/syncs.mjs +0 -15
  188. package/resources/syncs.mjs.map +0 -1
  189. package/resources/system.d.ts +0 -9
  190. package/resources/system.d.ts.map +0 -1
  191. package/resources/system.js +0 -15
  192. package/resources/system.js.map +0 -1
  193. package/resources/system.mjs +0 -11
  194. package/resources/system.mjs.map +0 -1
  195. package/resources/tools/index.d.ts +0 -3
  196. package/resources/tools/index.d.ts.map +0 -1
  197. package/resources/tools/index.js +0 -9
  198. package/resources/tools/index.js.map +0 -1
  199. package/resources/tools/index.mjs +0 -4
  200. package/resources/tools/index.mjs.map +0 -1
  201. package/resources/tools/result.d.ts +0 -9
  202. package/resources/tools/result.d.ts.map +0 -1
  203. package/resources/tools/result.js +0 -18
  204. package/resources/tools/result.js.map +0 -1
  205. package/resources/tools/result.mjs +0 -14
  206. package/resources/tools/result.mjs.map +0 -1
  207. package/resources/tools/tools.d.ts +0 -29
  208. package/resources/tools/tools.d.ts.map +0 -1
  209. package/resources/tools/tools.js +0 -64
  210. package/resources/tools/tools.js.map +0 -1
  211. package/resources/tools/tools.mjs +0 -37
  212. package/resources/tools/tools.mjs.map +0 -1
  213. package/resources/workflows.d.ts +0 -23
  214. package/resources/workflows.d.ts.map +0 -1
  215. package/resources/workflows.js +0 -37
  216. package/resources/workflows.js.map +0 -1
  217. package/resources/workflows.mjs +0 -33
  218. package/resources/workflows.mjs.map +0 -1
  219. package/shims/node.d.ts +0 -30
  220. package/shims/node.d.ts.map +0 -1
  221. package/shims/node.js +0 -31
  222. package/shims/node.js.map +0 -1
  223. package/shims/node.mjs +0 -5
  224. package/shims/node.mjs.map +0 -1
  225. package/shims/web.d.ts +0 -26
  226. package/shims/web.d.ts.map +0 -1
  227. package/shims/web.js +0 -31
  228. package/shims/web.js.map +0 -1
  229. package/shims/web.mjs +0 -5
  230. package/shims/web.mjs.map +0 -1
  231. package/src/_shims/MultipartBody.ts +0 -9
  232. package/src/_shims/README.md +0 -46
  233. package/src/_shims/auto/runtime-bun.ts +0 -4
  234. package/src/_shims/auto/runtime-node.ts +0 -4
  235. package/src/_shims/auto/runtime.ts +0 -4
  236. package/src/_shims/auto/types-node.ts +0 -4
  237. package/src/_shims/auto/types.d.ts +0 -101
  238. package/src/_shims/auto/types.js +0 -3
  239. package/src/_shims/auto/types.mjs +0 -3
  240. package/src/_shims/bun-runtime.ts +0 -14
  241. package/src/_shims/index.d.ts +0 -81
  242. package/src/_shims/index.js +0 -13
  243. package/src/_shims/index.mjs +0 -7
  244. package/src/_shims/manual-types.d.ts +0 -12
  245. package/src/_shims/manual-types.js +0 -3
  246. package/src/_shims/manual-types.mjs +0 -3
  247. package/src/_shims/node-runtime.ts +0 -81
  248. package/src/_shims/node-types.d.ts +0 -42
  249. package/src/_shims/node-types.js +0 -3
  250. package/src/_shims/node-types.mjs +0 -3
  251. package/src/_shims/registry.ts +0 -67
  252. package/src/_shims/web-runtime.ts +0 -103
  253. package/src/_shims/web-types.d.ts +0 -83
  254. package/src/_shims/web-types.js +0 -3
  255. package/src/_shims/web-types.mjs +0 -3
  256. package/src/core.ts +0 -1201
  257. package/src/error.ts +0 -130
  258. package/src/lib/.keep +0 -4
  259. package/src/resource.ts +0 -11
  260. package/src/resources/agents/agents.ts +0 -77
  261. package/src/resources/agents/index.ts +0 -4
  262. package/src/resources/agents/tools.ts +0 -34
  263. package/src/resources/logs.ts +0 -23
  264. package/src/resources/memory/index.ts +0 -5
  265. package/src/resources/memory/memory.ts +0 -43
  266. package/src/resources/memory/status.ts +0 -16
  267. package/src/resources/memory/threads/index.ts +0 -4
  268. package/src/resources/memory/threads/messages.ts +0 -16
  269. package/src/resources/memory/threads/threads.ts +0 -105
  270. package/src/resources/syncs.ts +0 -25
  271. package/src/resources/system.ts +0 -13
  272. package/src/resources/tools/index.ts +0 -4
  273. package/src/resources/tools/result.ts +0 -16
  274. package/src/resources/tools/tools.ts +0 -54
  275. package/src/resources/workflows.ts +0 -49
  276. package/src/shims/node.ts +0 -50
  277. package/src/shims/web.ts +0 -50
  278. package/src/tsconfig.json +0 -11
  279. package/src/uploads.ts +0 -255
  280. package/src/version.ts +0 -1
  281. package/uploads.d.ts +0 -75
  282. package/uploads.d.ts.map +0 -1
  283. package/uploads.js +0 -171
  284. package/uploads.js.map +0 -1
  285. package/uploads.mjs +0 -158
  286. package/uploads.mjs.map +0 -1
  287. package/version.d.ts +0 -2
  288. package/version.d.ts.map +0 -1
  289. package/version.js +0 -5
  290. package/version.js.map +0 -1
  291. package/version.mjs +0 -2
  292. package/version.mjs.map +0 -1
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MultipartBody = void 0;
4
- /**
5
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
6
- */
7
- class MultipartBody {
8
- constructor(body) {
9
- this.body = body;
10
- }
11
- get [Symbol.toStringTag]() {
12
- return 'MultipartBody';
13
- }
14
- }
15
- exports.MultipartBody = MultipartBody;
16
- //# sourceMappingURL=MultipartBody.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MultipartBody.js","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AALD,sCAKC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- export class MultipartBody {
5
- constructor(body) {
6
- this.body = body;
7
- }
8
- get [Symbol.toStringTag]() {
9
- return 'MultipartBody';
10
- }
11
- }
12
- //# sourceMappingURL=MultipartBody.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MultipartBody.mjs","sourceRoot":"","sources":["../src/_shims/MultipartBody.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,aAAa;IACxB,YAAmB,IAAS;QAAT,SAAI,GAAJ,IAAI,CAAK;IAAG,CAAC;IAChC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
package/_shims/README.md DELETED
@@ -1,46 +0,0 @@
1
- # 👋 Wondering what everything in here does?
2
-
3
- `@mastra/client-js` supports a wide variety of runtime environments like Node.js, Deno, Bun, browsers, and various
4
- edge runtimes, as well as both CommonJS (CJS) and EcmaScript Modules (ESM).
5
-
6
- To do this, `@mastra/client-js` provides shims for either using `node-fetch` when in Node (because `fetch` is still experimental there) or the global `fetch` API built into the environment when not in Node.
7
-
8
- It uses [conditional exports](https://nodejs.org/api/packages.html#conditional-exports) to
9
- automatically select the correct shims for each environment. However, conditional exports are a fairly new
10
- feature and not supported everywhere. For instance, the TypeScript `"moduleResolution": "node"`
11
-
12
- setting doesn't consult the `exports` map, compared to `"moduleResolution": "nodeNext"`, which does.
13
- Unfortunately that's still the default setting, and it can result in errors like
14
- getting the wrong raw `Response` type from `.asResponse()`, for example.
15
-
16
- The user can work around these issues by manually importing one of:
17
-
18
- - `import '@mastra/client-js/shims/node'`
19
- - `import '@mastra/client-js/shims/web'`
20
-
21
- All of the code here in `_shims` handles selecting the automatic default shims or manual overrides.
22
-
23
- ### How it works - Runtime
24
-
25
- Runtime shims get installed by calling `setShims` exported by `@mastra/client-js/_shims/registry`.
26
-
27
- Manually importing `@mastra/client-js/shims/node` or `@mastra/client-js/shims/web`, calls `setShims` with the respective runtime shims.
28
-
29
- All client code imports shims from `@mastra/client-js/_shims/index`, which:
30
-
31
- - checks if shims have been set manually
32
- - if not, calls `setShims` with the shims from `@mastra/client-js/_shims/auto/runtime`
33
- - re-exports the installed shims from `@mastra/client-js/_shims/registry`.
34
-
35
- `@mastra/client-js/_shims/auto/runtime` exports web runtime shims.
36
- If the `node` export condition is set, the export map replaces it with `@mastra/client-js/_shims/auto/runtime-node`.
37
-
38
- ### How it works - Type time
39
-
40
- All client code imports shim types from `@mastra/client-js/_shims/index`, which selects the manual types from `@mastra/client-js/_shims/manual-types` if they have been declared, otherwise it exports the auto types from `@mastra/client-js/_shims/auto/types`.
41
-
42
- `@mastra/client-js/_shims/manual-types` exports an empty namespace.
43
- Manually importing `@mastra/client-js/shims/node` or `@mastra/client-js/shims/web` merges declarations into this empty namespace, so they get picked up by `@mastra/client-js/_shims/index`.
44
-
45
- `@mastra/client-js/_shims/auto/types` exports web type definitions.
46
- If the `node` export condition is set, the export map replaces it with `@mastra/client-js/_shims/auto/types-node`, though TS only picks this up if `"moduleResolution": "nodenext"` or `"moduleResolution": "bundler"`.
@@ -1,5 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- export * from "../bun-runtime.js";
5
- //# sourceMappingURL=runtime-bun.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-bun.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- /**
18
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
- */
20
- __exportStar(require("../bun-runtime.js"), exports);
21
- //# sourceMappingURL=runtime-bun.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-bun.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
@@ -1,2 +0,0 @@
1
- export * from "../bun-runtime.mjs";
2
- //# sourceMappingURL=runtime-bun.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-bun.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-bun.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- export * from "../node-runtime.js";
5
- //# sourceMappingURL=runtime-node.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,iBAAiB,CAAC"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- /**
18
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
- */
20
- __exportStar(require("../node-runtime.js"), exports);
21
- //# sourceMappingURL=runtime-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-node.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,qDAAgC"}
@@ -1,2 +0,0 @@
1
- export * from "../node-runtime.mjs";
2
- //# sourceMappingURL=runtime-node.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime-node.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- export * from "../web-runtime.js";
5
- //# sourceMappingURL=runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gBAAgB,CAAC"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- /**
18
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
- */
20
- __exportStar(require("../web-runtime.js"), exports);
21
- //# sourceMappingURL=runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,oDAA+B"}
@@ -1,2 +0,0 @@
1
- export * from "../web-runtime.mjs";
2
- //# sourceMappingURL=runtime.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.mjs","sourceRoot":"","sources":["../../src/_shims/auto/runtime.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- export * from "../node-types.js";
5
- //# sourceMappingURL=types-node.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-node.d.ts","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,eAAe,CAAC"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- /**
18
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
19
- */
20
- __exportStar(require("../node-types.js"), exports);
21
- //# sourceMappingURL=types-node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-node.js","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,mDAA8B"}
@@ -1,2 +0,0 @@
1
- export * from "../node-types.mjs";
2
- //# sourceMappingURL=types-node.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types-node.mjs","sourceRoot":"","sources":["../../src/_shims/auto/types-node.ts"],"names":[],"mappings":""}
@@ -1,101 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- export type Agent = any;
5
-
6
- // @ts-ignore
7
- declare const _fetch: unknown extends typeof fetch ? never : typeof fetch;
8
- export { _fetch as fetch };
9
-
10
- // @ts-ignore
11
- type _Request = unknown extends Request ? never : Request;
12
- export { _Request as Request };
13
-
14
- // @ts-ignore
15
- type _RequestInfo = unknown extends RequestInfo ? never : RequestInfo;
16
- export { type _RequestInfo as RequestInfo };
17
-
18
- // @ts-ignore
19
- type _RequestInit = unknown extends RequestInit ? never : RequestInit;
20
- export { type _RequestInit as RequestInit };
21
-
22
- // @ts-ignore
23
- type _Response = unknown extends Response ? never : Response;
24
- export { _Response as Response };
25
-
26
- // @ts-ignore
27
- type _ResponseInit = unknown extends ResponseInit ? never : ResponseInit;
28
- export { type _ResponseInit as ResponseInit };
29
-
30
- // @ts-ignore
31
- type _ResponseType = unknown extends ResponseType ? never : ResponseType;
32
- export { type _ResponseType as ResponseType };
33
-
34
- // @ts-ignore
35
- type _BodyInit = unknown extends BodyInit ? never : BodyInit;
36
- export { type _BodyInit as BodyInit };
37
-
38
- // @ts-ignore
39
- type _Headers = unknown extends Headers ? never : Headers;
40
- export { _Headers as Headers };
41
-
42
- // @ts-ignore
43
- type _HeadersInit = unknown extends HeadersInit ? never : HeadersInit;
44
- export { type _HeadersInit as HeadersInit };
45
-
46
- type EndingType = 'native' | 'transparent';
47
-
48
- export interface BlobPropertyBag {
49
- endings?: EndingType;
50
- type?: string;
51
- }
52
-
53
- export interface FilePropertyBag extends BlobPropertyBag {
54
- lastModified?: number;
55
- }
56
-
57
- export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
58
-
59
- // @ts-ignore
60
- type _FormData = unknown extends FormData ? never : FormData;
61
- // @ts-ignore
62
- declare const _FormData: unknown extends typeof FormData ? never : typeof FormData;
63
- export { _FormData as FormData };
64
-
65
- // @ts-ignore
66
- type _File = unknown extends File ? never : File;
67
- // @ts-ignore
68
- declare const _File: unknown extends typeof File ? never : typeof File;
69
- export { _File as File };
70
-
71
- // @ts-ignore
72
- type _Blob = unknown extends Blob ? never : Blob;
73
- // @ts-ignore
74
- declare const _Blob: unknown extends typeof Blob ? never : typeof Blob;
75
- export { _Blob as Blob };
76
-
77
- export declare class Readable {
78
- readable: boolean;
79
- readonly readableEnded: boolean;
80
- readonly readableFlowing: boolean | null;
81
- readonly readableHighWaterMark: number;
82
- readonly readableLength: number;
83
- readonly readableObjectMode: boolean;
84
- destroyed: boolean;
85
- read(size?: number): any;
86
- pause(): this;
87
- resume(): this;
88
- isPaused(): boolean;
89
- destroy(error?: Error): this;
90
- [Symbol.asyncIterator](): AsyncIterableIterator<any>;
91
- }
92
-
93
- export declare class FsReadStream extends Readable {
94
- path: {}; // node type is string | Buffer
95
- }
96
-
97
- // @ts-ignore
98
- type _ReadableStream<R = any> = unknown extends ReadableStream<R> ? never : ReadableStream<R>;
99
- // @ts-ignore
100
- declare const _ReadableStream: unknown extends typeof ReadableStream ? never : typeof ReadableStream;
101
- export { _ReadableStream as ReadableStream };
@@ -1,3 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
@@ -1,3 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
@@ -1,6 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- import { type Shims } from "./registry.js";
5
- export declare function getRuntime(): Shims;
6
- //# sourceMappingURL=bun-runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bun-runtime.d.ts","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAIxC,wBAAgB,UAAU,IAAI,KAAK,CAMlC"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRuntime = void 0;
4
- const web_runtime_1 = require("./web-runtime.js");
5
- const node_fs_1 = require("node:fs");
6
- function getRuntime() {
7
- const runtime = (0, web_runtime_1.getRuntime)();
8
- function isFsReadStream(value) {
9
- return value instanceof node_fs_1.ReadStream;
10
- }
11
- return { ...runtime, isFsReadStream };
12
- }
13
- exports.getRuntime = getRuntime;
14
- //# sourceMappingURL=bun-runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bun-runtime.js","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":";;;AAIA,kDAA4D;AAC5D,qCAAqD;AAErD,SAAgB,UAAU;IACxB,MAAM,OAAO,GAAG,IAAA,wBAAa,GAAE,CAAC;IAChC,SAAS,cAAc,CAAC,KAAU;QAChC,OAAO,KAAK,YAAY,oBAAY,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAC;AACxC,CAAC;AAND,gCAMC"}
@@ -1,10 +0,0 @@
1
- import { getRuntime as getWebRuntime } from "./web-runtime.mjs";
2
- import { ReadStream as FsReadStream } from 'node:fs';
3
- export function getRuntime() {
4
- const runtime = getWebRuntime();
5
- function isFsReadStream(value) {
6
- return value instanceof FsReadStream;
7
- }
8
- return { ...runtime, isFsReadStream };
9
- }
10
- //# sourceMappingURL=bun-runtime.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bun-runtime.mjs","sourceRoot":"","sources":["../src/_shims/bun-runtime.ts"],"names":[],"mappings":"OAIO,EAAE,UAAU,IAAI,aAAa,EAAE;OAC/B,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,SAAS;AAEpD,MAAM,UAAU,UAAU;IACxB,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;IAChC,SAAS,cAAc,CAAC,KAAU;QAChC,OAAO,KAAK,YAAY,YAAY,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,GAAG,OAAO,EAAE,cAAc,EAAE,CAAC;AACxC,CAAC"}
package/_shims/index.d.ts DELETED
@@ -1,81 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- import { manual } from "./manual-types.js";
5
- import * as auto from '@mastra/client-js/_shims/auto/types';
6
- import { type RequestOptions } from "../core.js";
7
-
8
- type SelectType<Manual, Auto> = unknown extends Manual ? Auto : Manual;
9
-
10
- export const kind: string;
11
-
12
- // @ts-ignore
13
- export type Agent = SelectType<manual.Agent, auto.Agent>;
14
-
15
- // @ts-ignore
16
- export const fetch: SelectType<typeof manual.fetch, typeof auto.fetch>;
17
-
18
- // @ts-ignore
19
- export type Request = SelectType<manual.Request, auto.Request>;
20
- // @ts-ignore
21
- export type RequestInfo = SelectType<manual.RequestInfo, auto.RequestInfo>;
22
- // @ts-ignore
23
- export type RequestInit = SelectType<manual.RequestInit, auto.RequestInit>;
24
-
25
- // @ts-ignore
26
- export type Response = SelectType<manual.Response, auto.Response>;
27
- // @ts-ignore
28
- export type ResponseInit = SelectType<manual.ResponseInit, auto.ResponseInit>;
29
- // @ts-ignore
30
- export type ResponseType = SelectType<manual.ResponseType, auto.ResponseType>;
31
- // @ts-ignore
32
- export type BodyInit = SelectType<manual.BodyInit, auto.BodyInit>;
33
- // @ts-ignore
34
- export type Headers = SelectType<manual.Headers, auto.Headers>;
35
- // @ts-ignore
36
- export const Headers: SelectType<typeof manual.Headers, typeof auto.Headers>;
37
- // @ts-ignore
38
- export type HeadersInit = SelectType<manual.HeadersInit, auto.HeadersInit>;
39
-
40
- // @ts-ignore
41
- export type BlobPropertyBag = SelectType<manual.BlobPropertyBag, auto.BlobPropertyBag>;
42
- // @ts-ignore
43
- export type FilePropertyBag = SelectType<manual.FilePropertyBag, auto.FilePropertyBag>;
44
- // @ts-ignore
45
- export type FileFromPathOptions = SelectType<manual.FileFromPathOptions, auto.FileFromPathOptions>;
46
- // @ts-ignore
47
- export type FormData = SelectType<manual.FormData, auto.FormData>;
48
- // @ts-ignore
49
- export const FormData: SelectType<typeof manual.FormData, typeof auto.FormData>;
50
- // @ts-ignore
51
- export type File = SelectType<manual.File, auto.File>;
52
- // @ts-ignore
53
- export const File: SelectType<typeof manual.File, typeof auto.File>;
54
- // @ts-ignore
55
- export type Blob = SelectType<manual.Blob, auto.Blob>;
56
- // @ts-ignore
57
- export const Blob: SelectType<typeof manual.Blob, typeof auto.Blob>;
58
-
59
- // @ts-ignore
60
- export type Readable = SelectType<manual.Readable, auto.Readable>;
61
- // @ts-ignore
62
- export type FsReadStream = SelectType<manual.FsReadStream, auto.FsReadStream>;
63
- // @ts-ignore
64
- export type ReadableStream = SelectType<manual.ReadableStream, auto.ReadableStream>;
65
- // @ts-ignore
66
- export const ReadableStream: SelectType<typeof manual.ReadableStream, typeof auto.ReadableStream>;
67
-
68
- export function getMultipartRequestOptions<T = Record<string, unknown>>(
69
- form: FormData,
70
- opts: RequestOptions<T>,
71
- ): Promise<RequestOptions<T>>;
72
-
73
- export function getDefaultAgent(url: string): any;
74
-
75
- // @ts-ignore
76
- export type FileFromPathOptions = SelectType<manual.FileFromPathOptions, auto.FileFromPathOptions>;
77
-
78
- export function fileFromPath(path: string, options?: FileFromPathOptions): Promise<File>;
79
- export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise<File>;
80
-
81
- export function isFsReadStream(value: any): value is FsReadStream;
package/_shims/index.js DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- const shims = require('./registry');
5
- const auto = require('@mastra/client-js/_shims/auto/runtime');
6
- if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
7
- for (const property of Object.keys(shims)) {
8
- Object.defineProperty(exports, property, {
9
- get() {
10
- return shims[property];
11
- },
12
- });
13
- }
package/_shims/index.mjs DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- import * as shims from './registry.mjs';
5
- import * as auto from '@mastra/client-js/_shims/auto/runtime';
6
- if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true });
7
- export * from './registry.mjs';
@@ -1,12 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- /**
5
- * Types will get added to this namespace when you import one of the following:
6
- *
7
- * import '@mastra/client-js/shims/node'
8
- * import '@mastra/client-js/shims/web'
9
- *
10
- * Importing more than one will cause type and runtime errors.
11
- */
12
- export namespace manual {}
@@ -1,3 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
@@ -1,3 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
@@ -1,3 +0,0 @@
1
- import { type Shims } from "./registry.js";
2
- export declare function getRuntime(): Shims;
3
- //# sourceMappingURL=node-runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-runtime.d.ts","sourceRoot":"","sources":["../src/_shims/node-runtime.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AA6CxC,wBAAgB,UAAU,IAAI,KAAK,CAqBlC"}