@mastra/react 0.2.3-alpha.0 → 0.2.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 (20) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/{chunk-REDZDNFN-B9d_O-oZ.js → chunk-REDZDNFN-B1ouuY83.js} +2 -2
  3. package/dist/{chunk-REDZDNFN-B9d_O-oZ.js.map → chunk-REDZDNFN-B1ouuY83.js.map} +1 -1
  4. package/dist/{chunk-REDZDNFN-Dre-QyMV.cjs → chunk-REDZDNFN-CbkG5d3w.cjs} +2 -2
  5. package/dist/{chunk-REDZDNFN-Dre-QyMV.cjs.map → chunk-REDZDNFN-CbkG5d3w.cjs.map} +1 -1
  6. package/dist/{index-BrKmSy1n.js → index-BQSALCsO.js} +122 -122
  7. package/dist/{index-BrKmSy1n.js.map → index-BQSALCsO.js.map} +1 -1
  8. package/dist/{index-kMIXwQyE.cjs → index-DT_KGByV.cjs} +122 -122
  9. package/dist/{index-kMIXwQyE.cjs.map → index-DT_KGByV.cjs.map} +1 -1
  10. package/dist/index.cjs +1 -1
  11. package/dist/index.js +1 -1
  12. package/dist/{token-6GSAFR2W-XRCSVUPZ-B7ZkFki_.cjs → token-6GSAFR2W-XRCSVUPZ-D4lFShVi.cjs} +3 -3
  13. package/dist/{token-6GSAFR2W-XRCSVUPZ-B7ZkFki_.cjs.map → token-6GSAFR2W-XRCSVUPZ-D4lFShVi.cjs.map} +1 -1
  14. package/dist/{token-6GSAFR2W-XRCSVUPZ-DJZ6OlXQ.js → token-6GSAFR2W-XRCSVUPZ-nW1dYF0l.js} +3 -3
  15. package/dist/{token-6GSAFR2W-XRCSVUPZ-DJZ6OlXQ.js.map → token-6GSAFR2W-XRCSVUPZ-nW1dYF0l.js.map} +1 -1
  16. package/dist/{token-util-NEHG7TUY-U7CX7GS4-D1wA3Puq.cjs → token-util-NEHG7TUY-U7CX7GS4-BZFIAvf9.cjs} +2 -2
  17. package/dist/{token-util-NEHG7TUY-U7CX7GS4-D1wA3Puq.cjs.map → token-util-NEHG7TUY-U7CX7GS4-BZFIAvf9.cjs.map} +1 -1
  18. package/dist/{token-util-NEHG7TUY-U7CX7GS4-CUomXYUl.js → token-util-NEHG7TUY-U7CX7GS4-IihD8c3p.js} +2 -2
  19. package/dist/{token-util-NEHG7TUY-U7CX7GS4-CUomXYUl.js.map → token-util-NEHG7TUY-U7CX7GS4-IihD8c3p.js.map} +1 -1
  20. package/package.json +3 -3
@@ -986,6 +986,125 @@ const resolveToChildMessages = (messages) => {
986
986
  return childMessages;
987
987
  };
988
988
 
989
+ // src/request-context/index.ts
990
+ var RequestContext = class {
991
+ registry = /* @__PURE__ */ new Map();
992
+ constructor(iterable) {
993
+ this.registry = new Map(iterable);
994
+ }
995
+ /**
996
+ * set a value with strict typing if `Values` is a Record and the key exists in it.
997
+ */
998
+ set(key, value) {
999
+ this.registry.set(key, value);
1000
+ }
1001
+ /**
1002
+ * Get a value with its type
1003
+ */
1004
+ get(key) {
1005
+ return this.registry.get(key);
1006
+ }
1007
+ /**
1008
+ * Check if a key exists in the container
1009
+ */
1010
+ has(key) {
1011
+ return this.registry.has(key);
1012
+ }
1013
+ /**
1014
+ * Delete a value by key
1015
+ */
1016
+ delete(key) {
1017
+ return this.registry.delete(key);
1018
+ }
1019
+ /**
1020
+ * Clear all values from the container
1021
+ */
1022
+ clear() {
1023
+ this.registry.clear();
1024
+ }
1025
+ /**
1026
+ * Get all keys in the container
1027
+ */
1028
+ keys() {
1029
+ return this.registry.keys();
1030
+ }
1031
+ /**
1032
+ * Get all values in the container
1033
+ */
1034
+ values() {
1035
+ return this.registry.values();
1036
+ }
1037
+ /**
1038
+ * Get all entries in the container.
1039
+ * Returns a discriminated union of tuples for proper type narrowing when iterating.
1040
+ */
1041
+ entries() {
1042
+ return this.registry.entries();
1043
+ }
1044
+ /**
1045
+ * Get the size of the container
1046
+ */
1047
+ size() {
1048
+ return this.registry.size;
1049
+ }
1050
+ /**
1051
+ * Execute a function for each entry in the container.
1052
+ * The callback receives properly typed key-value pairs.
1053
+ */
1054
+ forEach(callbackfn) {
1055
+ this.registry.forEach(callbackfn);
1056
+ }
1057
+ /**
1058
+ * Custom JSON serialization method.
1059
+ * Converts the internal Map to a plain object for proper JSON serialization.
1060
+ * Non-serializable values (e.g., RPC proxies, functions, circular references)
1061
+ * are skipped to prevent serialization errors when storing to database.
1062
+ */
1063
+ toJSON() {
1064
+ const result = {};
1065
+ for (const [key, value] of this.registry.entries()) {
1066
+ if (this.isSerializable(value)) {
1067
+ result[key] = value;
1068
+ }
1069
+ }
1070
+ return result;
1071
+ }
1072
+ /**
1073
+ * Check if a value can be safely serialized to JSON.
1074
+ */
1075
+ isSerializable(value) {
1076
+ if (value === null || value === void 0) return true;
1077
+ if (typeof value === "function") return false;
1078
+ if (typeof value === "symbol") return false;
1079
+ if (typeof value !== "object") return true;
1080
+ try {
1081
+ JSON.stringify(value);
1082
+ return true;
1083
+ } catch {
1084
+ return false;
1085
+ }
1086
+ }
1087
+ /**
1088
+ * Get all values as a typed object for destructuring.
1089
+ * Returns Record<string, any> when untyped, or the Values type when typed.
1090
+ *
1091
+ * @example
1092
+ * ```typescript
1093
+ * const ctx = new RequestContext<{ userId: string; apiKey: string }>();
1094
+ * ctx.set('userId', 'user-123');
1095
+ * ctx.set('apiKey', 'key-456');
1096
+ * const { userId, apiKey } = ctx.all;
1097
+ * ```
1098
+ */
1099
+ get all() {
1100
+ return Object.fromEntries(this.registry);
1101
+ }
1102
+ };
1103
+
1104
+ function getDefaultExportFromCjs (x) {
1105
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
1106
+ }
1107
+
989
1108
  var __create$4 = Object.create;
990
1109
  var __defProp$6 = Object.defineProperty;
991
1110
  var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
@@ -3169,8 +3288,8 @@ var require_get_vercel_oidc_token = __commonJS$3({
3169
3288
  }
3170
3289
  try {
3171
3290
  const [{ getTokenPayload, isExpired }, { refreshToken }] = await Promise.all([
3172
- await Promise.resolve().then(() => require('./token-util-NEHG7TUY-U7CX7GS4-D1wA3Puq.cjs')),
3173
- await Promise.resolve().then(() => require('./token-6GSAFR2W-XRCSVUPZ-B7ZkFki_.cjs'))
3291
+ await Promise.resolve().then(() => require('./token-util-NEHG7TUY-U7CX7GS4-BZFIAvf9.cjs')),
3292
+ await Promise.resolve().then(() => require('./token-6GSAFR2W-XRCSVUPZ-D4lFShVi.cjs'))
3174
3293
  ]);
3175
3294
  if (!token || isExpired(getTokenPayload(token))) {
3176
3295
  await refreshToken();
@@ -5766,125 +5885,6 @@ var MastraBaseError = class extends Error {
5766
5885
  var MastraError = class extends MastraBaseError {
5767
5886
  };
5768
5887
 
5769
- // src/request-context/index.ts
5770
- var RequestContext = class {
5771
- registry = /* @__PURE__ */ new Map();
5772
- constructor(iterable) {
5773
- this.registry = new Map(iterable);
5774
- }
5775
- /**
5776
- * set a value with strict typing if `Values` is a Record and the key exists in it.
5777
- */
5778
- set(key, value) {
5779
- this.registry.set(key, value);
5780
- }
5781
- /**
5782
- * Get a value with its type
5783
- */
5784
- get(key) {
5785
- return this.registry.get(key);
5786
- }
5787
- /**
5788
- * Check if a key exists in the container
5789
- */
5790
- has(key) {
5791
- return this.registry.has(key);
5792
- }
5793
- /**
5794
- * Delete a value by key
5795
- */
5796
- delete(key) {
5797
- return this.registry.delete(key);
5798
- }
5799
- /**
5800
- * Clear all values from the container
5801
- */
5802
- clear() {
5803
- this.registry.clear();
5804
- }
5805
- /**
5806
- * Get all keys in the container
5807
- */
5808
- keys() {
5809
- return this.registry.keys();
5810
- }
5811
- /**
5812
- * Get all values in the container
5813
- */
5814
- values() {
5815
- return this.registry.values();
5816
- }
5817
- /**
5818
- * Get all entries in the container.
5819
- * Returns a discriminated union of tuples for proper type narrowing when iterating.
5820
- */
5821
- entries() {
5822
- return this.registry.entries();
5823
- }
5824
- /**
5825
- * Get the size of the container
5826
- */
5827
- size() {
5828
- return this.registry.size;
5829
- }
5830
- /**
5831
- * Execute a function for each entry in the container.
5832
- * The callback receives properly typed key-value pairs.
5833
- */
5834
- forEach(callbackfn) {
5835
- this.registry.forEach(callbackfn);
5836
- }
5837
- /**
5838
- * Custom JSON serialization method.
5839
- * Converts the internal Map to a plain object for proper JSON serialization.
5840
- * Non-serializable values (e.g., RPC proxies, functions, circular references)
5841
- * are skipped to prevent serialization errors when storing to database.
5842
- */
5843
- toJSON() {
5844
- const result = {};
5845
- for (const [key, value] of this.registry.entries()) {
5846
- if (this.isSerializable(value)) {
5847
- result[key] = value;
5848
- }
5849
- }
5850
- return result;
5851
- }
5852
- /**
5853
- * Check if a value can be safely serialized to JSON.
5854
- */
5855
- isSerializable(value) {
5856
- if (value === null || value === void 0) return true;
5857
- if (typeof value === "function") return false;
5858
- if (typeof value === "symbol") return false;
5859
- if (typeof value !== "object") return true;
5860
- try {
5861
- JSON.stringify(value);
5862
- return true;
5863
- } catch {
5864
- return false;
5865
- }
5866
- }
5867
- /**
5868
- * Get all values as a typed object for destructuring.
5869
- * Returns Record<string, any> when untyped, or the Values type when typed.
5870
- *
5871
- * @example
5872
- * ```typescript
5873
- * const ctx = new RequestContext<{ userId: string; apiKey: string }>();
5874
- * ctx.set('userId', 'user-123');
5875
- * ctx.set('apiKey', 'key-456');
5876
- * const { userId, apiKey } = ctx.all;
5877
- * ```
5878
- */
5879
- get all() {
5880
- return Object.fromEntries(this.registry);
5881
- }
5882
- };
5883
-
5884
- function getDefaultExportFromCjs (x) {
5885
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5886
- }
5887
-
5888
5888
  // ../_vendored/ai_v4/dist/chunk-OPIPXJLE.js
5889
5889
  var __create$2 = Object.create;
5890
5890
  var __defProp$3 = Object.defineProperty;
@@ -27786,4 +27786,4 @@ exports.useCreateWorkflowRun = useCreateWorkflowRun;
27786
27786
  exports.useEntity = useEntity;
27787
27787
  exports.useMastraClient = useMastraClient;
27788
27788
  exports.useStreamWorkflow = useStreamWorkflow;
27789
- //# sourceMappingURL=index-kMIXwQyE.cjs.map
27789
+ //# sourceMappingURL=index-DT_KGByV.cjs.map