@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,89 +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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.getRuntime = void 0;
30
- /**
31
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
32
- */
33
- const nf = __importStar(require("node-fetch"));
34
- const fd = __importStar(require("formdata-node"));
35
- const agentkeepalive_1 = __importDefault(require("agentkeepalive"));
36
- const abort_controller_1 = require("abort-controller");
37
- const node_fs_1 = require("node:fs");
38
- const form_data_encoder_1 = require("form-data-encoder");
39
- const node_stream_1 = require("node:stream");
40
- const MultipartBody_1 = require("./MultipartBody.js");
41
- const web_1 = require("node:stream/web");
42
- let fileFromPathWarned = false;
43
- async function fileFromPath(path, ...args) {
44
- // this import fails in environments that don't handle export maps correctly, like old versions of Jest
45
- const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => __importStar(require('formdata-node/file-from-path')));
46
- if (!fileFromPathWarned) {
47
- console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path)}) instead`);
48
- fileFromPathWarned = true;
49
- }
50
- // @ts-ignore
51
- return await _fileFromPath(path, ...args);
52
- }
53
- const defaultHttpAgent = new agentkeepalive_1.default({ keepAlive: true, timeout: 5 * 60 * 1000 });
54
- const defaultHttpsAgent = new agentkeepalive_1.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
55
- async function getMultipartRequestOptions(form, opts) {
56
- const encoder = new form_data_encoder_1.FormDataEncoder(form);
57
- const readable = node_stream_1.Readable.from(encoder);
58
- const body = new MultipartBody_1.MultipartBody(readable);
59
- const headers = {
60
- ...opts.headers,
61
- ...encoder.headers,
62
- 'Content-Length': encoder.contentLength,
63
- };
64
- return { ...opts, body: body, headers };
65
- }
66
- function getRuntime() {
67
- // Polyfill global object if needed.
68
- if (typeof AbortController === 'undefined') {
69
- // @ts-expect-error (the types are subtly different, but compatible in practice)
70
- globalThis.AbortController = abort_controller_1.AbortController;
71
- }
72
- return {
73
- kind: 'node',
74
- fetch: nf.default,
75
- Request: nf.Request,
76
- Response: nf.Response,
77
- Headers: nf.Headers,
78
- FormData: fd.FormData,
79
- Blob: fd.Blob,
80
- File: fd.File,
81
- ReadableStream: web_1.ReadableStream,
82
- getMultipartRequestOptions,
83
- getDefaultAgent: (url) => (url.startsWith('https') ? defaultHttpsAgent : defaultHttpAgent),
84
- fileFromPath,
85
- isFsReadStream: (value) => value instanceof node_fs_1.ReadStream,
86
- };
87
- }
88
- exports.getRuntime = getRuntime;
89
- //# sourceMappingURL=node-runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-runtime.js","sourceRoot":"","sources":["../src/_shims/node-runtime.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,+CAAiC;AACjC,kDAAoC;AAEpC,oEAA4C;AAC5C,uDAA8E;AAC9E,qCAAqD;AAErD,yDAAoD;AACpD,6CAAuC;AAEvC,sDAAgD;AAEhD,yCAAiD;AAIjD,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAS/B,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,GAAG,IAAW;IACtD,uGAAuG;IACvG,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,wDAAa,8BAA8B,GAAC,CAAC;IAErF,IAAI,CAAC,kBAAkB,EAAE;QACvB,OAAO,CAAC,IAAI,CAAC,uDAAuD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrG,kBAAkB,GAAG,IAAI,CAAC;KAC3B;IACD,aAAa;IACb,OAAO,MAAM,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,gBAAgB,GAAU,IAAI,wBAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAChG,MAAM,iBAAiB,GAAU,IAAI,wBAAc,CAAC,UAAU,CAAC,EAAE,SAAS,E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AK,YAAY,oBAAY;KACrF,CAAC;AACJ,CAAC;AArBD,gCAqBC"}
@@ -1,56 +0,0 @@
1
- import * as nf from 'node-fetch';
2
- import * as fd from 'formdata-node';
3
- import KeepAliveAgent from 'agentkeepalive';
4
- import { AbortController as AbortControllerPolyfill } from 'abort-controller';
5
- import { ReadStream as FsReadStream } from 'node:fs';
6
- import { FormDataEncoder } from 'form-data-encoder';
7
- import { Readable } from 'node:stream';
8
- import { MultipartBody } from "./MultipartBody.mjs";
9
- import { ReadableStream } from 'node:stream/web';
10
- let fileFromPathWarned = false;
11
- async function fileFromPath(path, ...args) {
12
- // this import fails in environments that don't handle export maps correctly, like old versions of Jest
13
- const { fileFromPath: _fileFromPath } = await import('formdata-node/file-from-path');
14
- if (!fileFromPathWarned) {
15
- console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path)}) instead`);
16
- fileFromPathWarned = true;
17
- }
18
- // @ts-ignore
19
- return await _fileFromPath(path, ...args);
20
- }
21
- const defaultHttpAgent = new KeepAliveAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
22
- const defaultHttpsAgent = new KeepAliveAgent.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1000 });
23
- async function getMultipartRequestOptions(form, opts) {
24
- const encoder = new FormDataEncoder(form);
25
- const readable = Readable.from(encoder);
26
- const body = new MultipartBody(readable);
27
- const headers = {
28
- ...opts.headers,
29
- ...encoder.headers,
30
- 'Content-Length': encoder.contentLength,
31
- };
32
- return { ...opts, body: body, headers };
33
- }
34
- export function getRuntime() {
35
- // Polyfill global object if needed.
36
- if (typeof AbortController === 'undefined') {
37
- // @ts-expect-error (the types are subtly different, but compatible in practice)
38
- globalThis.AbortController = AbortControllerPolyfill;
39
- }
40
- return {
41
- kind: 'node',
42
- fetch: nf.default,
43
- Request: nf.Request,
44
- Response: nf.Response,
45
- Headers: nf.Headers,
46
- FormData: fd.FormData,
47
- Blob: fd.Blob,
48
- File: fd.File,
49
- ReadableStream,
50
- getMultipartRequestOptions,
51
- getDefaultAgent: (url) => (url.startsWith('https') ? defaultHttpsAgent : defaultHttpAgent),
52
- fileFromPath,
53
- isFsReadStream: (value) => value instanceof FsReadStream,
54
- };
55
- }
56
- //# sourceMappingURL=node-runtime.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node-runtime.mjs","sourceRoot":"","sources":["../src/_shims/node-runtime.ts"],"names":[],"mappings":"OAGO,KAAK,EAAE,MAAM,YAAY;OACzB,KAAK,EAAE,MAAM,eAAe;OAE5B,cAAc,MAAM,gBAAgB;OACpC,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,kBAAkB;OACtE,EAAE,UAAU,IAAI,YAAY,EAAE,MAAM,SAAS;OAE7C,EAAE,eAAe,EAAE,MAAM,mBAAmB;OAC5C,EAAE,QAAQ,EAAE,MAAM,aAAa;OAE/B,EAAE,aAAa,EAAE;OAEjB,EAAE,cAAc,EAAE,MAAM,iBAAiB;AAIhD,IAAI,kBAAkB,GAAG,KAAK,CAAC;AAS/B,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,GAAG,IAAW;IACtD,uGAAuG;IACvG,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,MAAM,MAAM,CAAC,8BAA8B,CAAC,CAAC;IAErF,IAAI,CAAC,kBAAkB,EAAE;QACvB,OAAO,CAAC,IAAI,CAAC,uDAAuD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrG,kBAAkB,GAAG,IAAI,CAAC;KAC3B;IACD,aAAa;IACb,OAAO,MAAM,aAAa,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,gBAAgB,GAAU,IAAI,cAAc,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAChG,MAAM,iBAAiB,GAAU,IAAI,cAAc,CAAC,UAAU,CAAC,E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AK,YAAY,YAAY;KACrF,CAAC;AACJ,CAAC"}
@@ -1,42 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- import * as nf from 'node-fetch';
5
- import * as fd from 'formdata-node';
6
-
7
- export { type Agent } from 'node:http';
8
- export { type Readable } from 'node:stream';
9
- export { type ReadStream as FsReadStream } from 'node:fs';
10
- export { ReadableStream } from 'node:stream/web';
11
-
12
- export const fetch: typeof nf.default;
13
-
14
- export type Request = nf.Request;
15
- export type RequestInfo = nf.RequestInfo;
16
- export type RequestInit = nf.RequestInit;
17
-
18
- export type Response = nf.Response;
19
- export type ResponseInit = nf.ResponseInit;
20
- export type ResponseType = nf.ResponseType;
21
- export type BodyInit = nf.BodyInit;
22
- export type Headers = nf.Headers;
23
- export type HeadersInit = nf.HeadersInit;
24
-
25
- type EndingType = 'native' | 'transparent';
26
- export interface BlobPropertyBag {
27
- endings?: EndingType;
28
- type?: string;
29
- }
30
-
31
- export interface FilePropertyBag extends BlobPropertyBag {
32
- lastModified?: number;
33
- }
34
-
35
- export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
36
-
37
- export type FormData = fd.FormData;
38
- export const FormData: typeof fd.FormData;
39
- export type File = fd.File;
40
- export const File: typeof fd.File;
41
- export type Blob = fd.Blob;
42
- export const Blob: typeof fd.Blob;
@@ -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,37 +0,0 @@
1
- /**
2
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
- */
4
- import { type RequestOptions } from "../core.js";
5
- export interface Shims {
6
- kind: string;
7
- fetch: any;
8
- Request: any;
9
- Response: any;
10
- Headers: any;
11
- FormData: any;
12
- Blob: any;
13
- File: any;
14
- ReadableStream: any;
15
- getMultipartRequestOptions: <T = Record<string, unknown>>(form: Shims['FormData'], opts: RequestOptions<T>) => Promise<RequestOptions<T>>;
16
- getDefaultAgent: (url: string) => any;
17
- fileFromPath: ((path: string, filename?: string, options?: {}) => Promise<Shims['File']>) | ((path: string, options?: {}) => Promise<Shims['File']>);
18
- isFsReadStream: (value: any) => boolean;
19
- }
20
- export declare let auto: boolean;
21
- export declare let kind: Shims['kind'] | undefined;
22
- export declare let fetch: Shims['fetch'] | undefined;
23
- export declare let Request: Shims['Request'] | undefined;
24
- export declare let Response: Shims['Response'] | undefined;
25
- export declare let Headers: Shims['Headers'] | undefined;
26
- export declare let FormData: Shims['FormData'] | undefined;
27
- export declare let Blob: Shims['Blob'] | undefined;
28
- export declare let File: Shims['File'] | undefined;
29
- export declare let ReadableStream: Shims['ReadableStream'] | undefined;
30
- export declare let getMultipartRequestOptions: Shims['getMultipartRequestOptions'] | undefined;
31
- export declare let getDefaultAgent: Shims['getDefaultAgent'] | undefined;
32
- export declare let fileFromPath: Shims['fileFromPath'] | undefined;
33
- export declare let isFsReadStream: Shims['isFsReadStream'] | undefined;
34
- export declare function setShims(shims: Shims, options?: {
35
- auto: boolean;
36
- }): void;
37
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/_shims/registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,GAAG,CAAC;IACV,IAAI,EAAE,GAAG,CAAC;IACV,cAAc,EAAE,GAAG,CAAC;IACpB,0BAA0B,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC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Ac,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,SAAqB,CAAC;AAC3E,eAAO,IAAI,0BAA0B,EAAE,KAAK,CAAC,4BAA4B,CAAC,GAAG,SAAqB,CAAC;AACnG,eAAO,IAAI,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC,GAAG,SAAqB,CAAC;AAC7E,eAAO,IAAI,YAAY,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,SAAqB,CAAC;AACvE,eAAO,IAAI,cAAc,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,SAAqB,CAAC;AAE3E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,GAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAoB,QAyBlF"}
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setShims = exports.isFsReadStream = exports.fileFromPath = exports.getDefaultAgent = exports.getMultipartRequestOptions = exports.ReadableStream = exports.File = exports.Blob = exports.FormData = exports.Headers = exports.Response = exports.Request = exports.fetch = exports.kind = exports.auto = void 0;
4
- exports.auto = false;
5
- exports.kind = undefined;
6
- exports.fetch = undefined;
7
- exports.Request = undefined;
8
- exports.Response = undefined;
9
- exports.Headers = undefined;
10
- exports.FormData = undefined;
11
- exports.Blob = undefined;
12
- exports.File = undefined;
13
- exports.ReadableStream = undefined;
14
- exports.getMultipartRequestOptions = undefined;
15
- exports.getDefaultAgent = undefined;
16
- exports.fileFromPath = undefined;
17
- exports.isFsReadStream = undefined;
18
- function setShims(shims, options = { auto: false }) {
19
- if (exports.auto) {
20
- throw new Error(`you must \`import '@mastra/client-js/shims/${shims.kind}'\` before importing anything else from @mastra/client-js`);
21
- }
22
- if (exports.kind) {
23
- throw new Error(`can't \`import '@mastra/client-js/shims/${shims.kind}'\` after \`import '@mastra/client-js/shims/${exports.kind}'\``);
24
- }
25
- exports.auto = options.auto;
26
- exports.kind = shims.kind;
27
- exports.fetch = shims.fetch;
28
- exports.Request = shims.Request;
29
- exports.Response = shims.Response;
30
- exports.Headers = shims.Headers;
31
- exports.FormData = shims.FormData;
32
- exports.Blob = shims.Blob;
33
- exports.File = shims.File;
34
- exports.ReadableStream = shims.ReadableStream;
35
- exports.getMultipartRequestOptions = shims.getMultipartRequestOptions;
36
- exports.getDefaultAgent = shims.getDefaultAgent;
37
- exports.fileFromPath = shims.fileFromPath;
38
- exports.isFsReadStream = shims.isFsReadStream;
39
- }
40
- exports.setShims = setShims;
41
- //# sourceMappingURL=registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/_shims/registry.ts"],"names":[],"mappings":";;;AA0BW,QAAA,IAAI,GAAG,KAAK,CAAC;AACb,QAAA,IAAI,GAA8B,SAAS,CAAC;AAC5C,QAAA,KAAK,GAA+B,SAAS,CAAC;AAC9C,QAAA,OAAO,GAAiC,SAAS,CAAC;AAClD,QAAA,QAAQ,GAAkC,SAAS,CAAC;AACpD,QAAA,OAAO,GAAiC,SAAS,CAAC;AAClD,QAAA,QAAQ,GAAkC,SAAS,CAAC;AACpD,QAAA,IAAI,GAA8B,SAAS,CAAC;AAC5C,QAAA,IAAI,GAA8B,SAAS,CAAC;AAC5C,QAAA,cAAc,GAAwC,SAAS,CAAC;AAChE,QAAA,0BAA0B,GAAoD,SAAS,CAAC;AACxF,QAAA,eAAe,GAAyC,SAAS,CAAC;AAClE,QAAA,YAAY,GAAsC,SAAS,CAAC;AAC5D,QAAA,cAAc,GAAwC,SAAS,CAAC;AAE3E,SAAgB,QAAQ,CAAC,KAAY,EAAE,UAA6B,EAAE,IAAI,EAAE,KAAK,EAAE;IACjF,IAAI,YAAI,EAAE;QACR,MAAM,IAAI,KAAK,CACb,8CAA8C,KAAK,CAAC,IAAI,2DAA2D,CACpH,CAAC;KACH;IACD,IAAI,YAAI,EAAE;QACR,MAAM,IAAI,KAAK,CACb,2CAA2C,KAAK,CAAC,IAAI,+CAA+C,YAAI,KAAK,CAC9G,CAAC;KACH;IACD,YAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IACpB,YAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,aAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IACpB,eAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACxB,gBAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC1B,eAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACxB,gBAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC1B,YAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,YAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,sBAAc,GAAG,KAAK,CAAC,cAAc,CAAC;IACtC,kCAA0B,GAAG,KAAK,CAAC,0BAA0B,CAAC;IAC9D,uBAAe,GAAG,KAAK,CAAC,eAAe,CAAC;IACxC,oBAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAClC,sBAAc,GAAG,KAAK,CAAC,cAAc,CAAC;AACxC,CAAC;AAzBD,4BAyBC"}
@@ -1,37 +0,0 @@
1
- export let auto = false;
2
- export let kind = undefined;
3
- export let fetch = undefined;
4
- export let Request = undefined;
5
- export let Response = undefined;
6
- export let Headers = undefined;
7
- export let FormData = undefined;
8
- export let Blob = undefined;
9
- export let File = undefined;
10
- export let ReadableStream = undefined;
11
- export let getMultipartRequestOptions = undefined;
12
- export let getDefaultAgent = undefined;
13
- export let fileFromPath = undefined;
14
- export let isFsReadStream = undefined;
15
- export function setShims(shims, options = { auto: false }) {
16
- if (auto) {
17
- throw new Error(`you must \`import '@mastra/client-js/shims/${shims.kind}'\` before importing anything else from @mastra/client-js`);
18
- }
19
- if (kind) {
20
- throw new Error(`can't \`import '@mastra/client-js/shims/${shims.kind}'\` after \`import '@mastra/client-js/shims/${kind}'\``);
21
- }
22
- auto = options.auto;
23
- kind = shims.kind;
24
- fetch = shims.fetch;
25
- Request = shims.Request;
26
- Response = shims.Response;
27
- Headers = shims.Headers;
28
- FormData = shims.FormData;
29
- Blob = shims.Blob;
30
- File = shims.File;
31
- ReadableStream = shims.ReadableStream;
32
- getMultipartRequestOptions = shims.getMultipartRequestOptions;
33
- getDefaultAgent = shims.getDefaultAgent;
34
- fileFromPath = shims.fileFromPath;
35
- isFsReadStream = shims.isFsReadStream;
36
- }
37
- //# sourceMappingURL=registry.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.mjs","sourceRoot":"","sources":["../src/_shims/registry.ts"],"names":[],"mappings":"AA0BA,MAAM,CAAC,IAAI,IAAI,GAAG,KAAK,CAAC;AACxB,MAAM,CAAC,IAAI,IAAI,GAA8B,SAAS,CAAC;AACvD,MAAM,CAAC,IAAI,KAAK,GAA+B,SAAS,CAAC;AACzD,MAAM,CAAC,IAAI,OAAO,GAAiC,SAAS,CAAC;AAC7D,MAAM,CAAC,IAAI,QAAQ,GAAkC,SAAS,CAAC;AAC/D,MAAM,CAAC,IAAI,OAAO,GAAiC,SAAS,CAAC;AAC7D,MAAM,CAAC,IAAI,QAAQ,GAAkC,SAAS,CAAC;AAC/D,MAAM,CAAC,IAAI,IAAI,GAA8B,SAAS,CAAC;AACvD,MAAM,CAAC,IAAI,IAAI,GAA8B,SAAS,CAAC;AACvD,MAAM,CAAC,IAAI,cAAc,GAAwC,SAAS,CAAC;AAC3E,MAAM,CAAC,IAAI,0BAA0B,GAAoD,SAAS,CAAC;AACnG,MAAM,CAAC,IAAI,eAAe,GAAyC,SAAS,CAAC;AAC7E,MAAM,CAAC,IAAI,YAAY,GAAsC,SAAS,CAAC;AACvE,MAAM,CAAC,IAAI,cAAc,GAAwC,SAAS,CAAC;AAE3E,MAAM,UAAU,QAAQ,CAAC,KAAY,EAAE,UAA6B,EAAE,IAAI,EAAE,KAAK,EAAE;IACjF,IAAI,IAAI,EAAE;QACR,MAAM,IAAI,KAAK,CACb,8CAA8C,KAAK,CAAC,IAAI,2DAA2D,CACpH,CAAC;KACH;IACD,IAAI,IAAI,EAAE;QACR,MAAM,IAAI,KAAK,CACb,2CAA2C,KAAK,CAAC,IAAI,+CAA+C,IAAI,KAAK,CAC9G,CAAC;KACH;IACD,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IACpB,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IACpB,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACxB,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC1B,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACxB,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC1B,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAClB,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;IACtC,0BAA0B,GAAG,KAAK,CAAC,0BAA0B,CAAC;IAC9D,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;IACxC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAClC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;AACxC,CAAC"}
@@ -1,5 +0,0 @@
1
- import { type Shims } from "./registry.js";
2
- export declare function getRuntime({ manuallyImported }?: {
3
- manuallyImported?: boolean;
4
- }): Shims;
5
- //# sourceMappingURL=web-runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-runtime.d.ts","sourceRoot":"","sources":["../src/_shims/web-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,wBAAgB,UAAU,CAAC,EAAE,gBAAgB,EAAE,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,KAAK,CA+F3F"}
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRuntime = void 0;
4
- /**
5
- * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
6
- */
7
- const MultipartBody_1 = require("./MultipartBody.js");
8
- function getRuntime({ manuallyImported } = {}) {
9
- const recommendation = manuallyImported ?
10
- `You may need to use polyfills`
11
- : `Add one of these imports before your first \`import … from '@mastra/client-js'\`:
12
- - \`import '@mastra/client-js/shims/node'\` (if you're running on Node)
13
- - \`import '@mastra/client-js/shims/web'\` (otherwise)
14
- `;
15
- let _fetch, _Request, _Response, _Headers;
16
- try {
17
- // @ts-ignore
18
- _fetch = fetch;
19
- // @ts-ignore
20
- _Request = Request;
21
- // @ts-ignore
22
- _Response = Response;
23
- // @ts-ignore
24
- _Headers = Headers;
25
- }
26
- catch (error) {
27
- throw new Error(`this environment is missing the following Web Fetch API type: ${error.message}. ${recommendation}`);
28
- }
29
- return {
30
- kind: 'web',
31
- fetch: _fetch,
32
- Request: _Request,
33
- Response: _Response,
34
- Headers: _Headers,
35
- FormData:
36
- // @ts-ignore
37
- typeof FormData !== 'undefined' ? FormData : (class FormData {
38
- // @ts-ignore
39
- constructor() {
40
- throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${recommendation}`);
41
- }
42
- }),
43
- Blob: typeof Blob !== 'undefined' ? Blob : (class Blob {
44
- constructor() {
45
- throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${recommendation}`);
46
- }
47
- }),
48
- File:
49
- // @ts-ignore
50
- typeof File !== 'undefined' ? File : (class File {
51
- // @ts-ignore
52
- constructor() {
53
- throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${recommendation}`);
54
- }
55
- }),
56
- ReadableStream:
57
- // @ts-ignore
58
- typeof ReadableStream !== 'undefined' ? ReadableStream : (class ReadableStream {
59
- // @ts-ignore
60
- constructor() {
61
- throw new Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${recommendation}`);
62
- }
63
- }),
64
- getMultipartRequestOptions: async (
65
- // @ts-ignore
66
- form, opts) => ({
67
- ...opts,
68
- body: new MultipartBody_1.MultipartBody(form),
69
- }),
70
- getDefaultAgent: (url) => undefined,
71
- fileFromPath: () => {
72
- throw new Error('The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/mastra-ai/client-js#file-uploads');
73
- },
74
- isFsReadStream: (value) => false,
75
- };
76
- }
77
- exports.getRuntime = getRuntime;
78
- //# sourceMappingURL=web-runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-runtime.js","sourceRoot":"","sources":["../src/_shims/web-runtime.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,sDAAgD;AAIhD,SAAgB,UAAU,CAAC,EAAE,gBAAgB,KAAqC,EAAE;IAClF,MAAM,cAAc,GAClB,gBAAgB,CAAC,CAAC;QAChB,+BAA+B;QACjC,CAAC,CAAC;;;CAGL,CAAC;IAEA,IAAI,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC;IAC1C,IAAI;QACF,aAAa;QACb,MAAM,GAAG,KAAK,CAAC;QACf,aAAa;QACb,QAAQ,GAAG,OAAO,CAAC;QACnB,aAAa;QACb,SAAS,GAAG,QAAQ,CAAC;QACrB,aAAa;QACb,QAAQ,GAAG,OAAO,CAAC;KACpB;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,KAAK,CACb,iEACG,KAAa,CAAC,OACjB,KAAK,cAAc,EAAE,CACtB,CAAC;KACH;IAED,OAAO;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,QAAQ;QACjB,QAAQ;QACN,aAAa;QACb,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAC3C,MAAM,QAAQ;YACZ,aAAa;YACb;gBACE,MAAM,IAAI,KAAK,CACb,qFAAqF,cAAc,EAAE,CACtG,CAAC;YACJ,CAAC;SACF,CACF;QACH,IAAI,EACF,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACnC,MAAM,IAAI;YACR;gBACE,MAAM,IAAI,KAAK,CACb,iFAAiF,cAAc,EAAE,CAClG,CAAC;YACJ,CAAC;SACF,CACF;QACH,IAAI;QACF,aAAa;QACb,OAAO,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACnC,MAAM,IAAI;YACR,aAAa;YACb;gBACE,MAAM,IAAI,KAAK,CACb,iFAAiF,cAAc,EAAE,CAClG,CAAC;YACJ,CAAC;SACF,CACF;QACH,cAAc;QACZ,aAAa;QACb,OAAO,cAAc,KAAK,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CACvD,MAAM,cAAc;YAClB,aAAa;YACb;gBACE,MAAM,IAAI,KAAK,CACb,uFAAuF,cAAc,EAAE,CACxG,CAAC;YACJ,CAAC;SACF,CACF;QACH,0BAA0B,EAAE,KAAK;QAC/B,aAAa;QACb,IAAc,EACd,IAAuB,EACK,EAAE,CAAC,CAAC;YAChC,GAAG,IAAI;YACP,IAAI,EAAE,IAAI,6BAAa,CAAC,IAAI,CAAQ;SACrC,CAAC;QACF,eAAe,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,SAAS;QAC3C,YAAY,EAAE,GAAG,EAAE;YACjB,MAAM,IAAI,KAAK,CACb,iJAAiJ,CAClJ,CAAC;QACJ,CAAC;QACD,cAAc,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK;KACtC,CAAC;AACJ,CAAC;AA/FD,gCA+FC"}
@@ -1,71 +0,0 @@
1
- import { MultipartBody } from "./MultipartBody.mjs";
2
- export function getRuntime({ manuallyImported } = {}) {
3
- const recommendation = manuallyImported ?
4
- `You may need to use polyfills`
5
- : `Add one of these imports before your first \`import … from '@mastra/client-js'\`:
6
- - \`import '@mastra/client-js/shims/node'\` (if you're running on Node)
7
- - \`import '@mastra/client-js/shims/web'\` (otherwise)
8
- `;
9
- let _fetch, _Request, _Response, _Headers;
10
- try {
11
- // @ts-ignore
12
- _fetch = fetch;
13
- // @ts-ignore
14
- _Request = Request;
15
- // @ts-ignore
16
- _Response = Response;
17
- // @ts-ignore
18
- _Headers = Headers;
19
- }
20
- catch (error) {
21
- throw new Error(`this environment is missing the following Web Fetch API type: ${error.message}. ${recommendation}`);
22
- }
23
- return {
24
- kind: 'web',
25
- fetch: _fetch,
26
- Request: _Request,
27
- Response: _Response,
28
- Headers: _Headers,
29
- FormData:
30
- // @ts-ignore
31
- typeof FormData !== 'undefined' ? FormData : (class FormData {
32
- // @ts-ignore
33
- constructor() {
34
- throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${recommendation}`);
35
- }
36
- }),
37
- Blob: typeof Blob !== 'undefined' ? Blob : (class Blob {
38
- constructor() {
39
- throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${recommendation}`);
40
- }
41
- }),
42
- File:
43
- // @ts-ignore
44
- typeof File !== 'undefined' ? File : (class File {
45
- // @ts-ignore
46
- constructor() {
47
- throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${recommendation}`);
48
- }
49
- }),
50
- ReadableStream:
51
- // @ts-ignore
52
- typeof ReadableStream !== 'undefined' ? ReadableStream : (class ReadableStream {
53
- // @ts-ignore
54
- constructor() {
55
- throw new Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${recommendation}`);
56
- }
57
- }),
58
- getMultipartRequestOptions: async (
59
- // @ts-ignore
60
- form, opts) => ({
61
- ...opts,
62
- body: new MultipartBody(form),
63
- }),
64
- getDefaultAgent: (url) => undefined,
65
- fileFromPath: () => {
66
- throw new Error('The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/mastra-ai/client-js#file-uploads');
67
- },
68
- isFsReadStream: (value) => false,
69
- };
70
- }
71
- //# sourceMappingURL=web-runtime.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-runtime.mjs","sourceRoot":"","sources":["../src/_shims/web-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AI,KAAK,CACb,iFAAiF,cAAc,EAAE,CAClG,CAAC;YACJ,CAAC;SACF,CACF;QACH,cAAc;QACZ,aAAa;QACb,OAAO,cAAc,KAAK,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CACvD,MAAM,cAAc;YAClB,aAAa;YACb;gBACE,MAAM,IAAI,KAAK,CACb,uFAAuF,cAAc,EAAE,CACxG,CAAC;YACJ,CAAC;SACF,CACF;QACH,0BAA0B,EAAE,KAAK;QAC/B,aAAa;QACb,IAAc,EACd,IAAuB,EACK,EAAE,CAAC,CAAC;YAChC,GAAG,IAAI;YACP,IAAI,EAAE,IAAI,aAAa,CAAC,IAAI,CAAQ;SACrC,CAAC;QACF,eAAe,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,SAAS;QAC3C,YAAY,EAAE,GAAG,EAAE;YACjB,MAAM,IAAI,KAAK,CACb,iJAAiJ,CAClJ,CAAC;QACJ,CAAC;QACD,cAAc,EAAE,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK;KACtC,CAAC;AACJ,CAAC"}
@@ -1,83 +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
- declare const _fetch: typeof fetch;
7
- export { _fetch as fetch };
8
-
9
- type _Request = Request;
10
- export { _Request as Request };
11
-
12
- type _RequestInfo = RequestInfo;
13
- export { type _RequestInfo as RequestInfo };
14
-
15
- type _RequestInit = RequestInit;
16
- export { type _RequestInit as RequestInit };
17
-
18
- type _Response = Response;
19
- export { _Response as Response };
20
-
21
- type _ResponseInit = ResponseInit;
22
- export { type _ResponseInit as ResponseInit };
23
-
24
- type _ResponseType = ResponseType;
25
- export { type _ResponseType as ResponseType };
26
-
27
- type _BodyInit = BodyInit;
28
- export { type _BodyInit as BodyInit };
29
-
30
- type _Headers = Headers;
31
- export { _Headers as Headers };
32
-
33
- type _HeadersInit = HeadersInit;
34
- export { type _HeadersInit as HeadersInit };
35
-
36
- type EndingType = 'native' | 'transparent';
37
-
38
- export interface BlobPropertyBag {
39
- endings?: EndingType;
40
- type?: string;
41
- }
42
-
43
- export interface FilePropertyBag extends BlobPropertyBag {
44
- lastModified?: number;
45
- }
46
-
47
- export type FileFromPathOptions = Omit<FilePropertyBag, 'lastModified'>;
48
-
49
- type _FormData = FormData;
50
- declare const _FormData: typeof FormData;
51
- export { _FormData as FormData };
52
-
53
- type _File = File;
54
- declare const _File: typeof File;
55
- export { _File as File };
56
-
57
- type _Blob = Blob;
58
- declare const _Blob: typeof Blob;
59
- export { _Blob as Blob };
60
-
61
- export declare class Readable {
62
- readable: boolean;
63
- readonly readableEnded: boolean;
64
- readonly readableFlowing: boolean | null;
65
- readonly readableHighWaterMark: number;
66
- readonly readableLength: number;
67
- readonly readableObjectMode: boolean;
68
- destroyed: boolean;
69
- read(size?: number): any;
70
- pause(): this;
71
- resume(): this;
72
- isPaused(): boolean;
73
- destroy(error?: Error): this;
74
- [Symbol.asyncIterator](): AsyncIterableIterator<any>;
75
- }
76
-
77
- export declare class FsReadStream extends Readable {
78
- path: {}; // node type is string | Buffer
79
- }
80
-
81
- type _ReadableStream<R = any> = ReadableStream<R>;
82
- declare const _ReadableStream: typeof ReadableStream;
83
- 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
- */