@mastra/server 1.29.0-alpha.6 → 1.29.1-alpha.1

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 (92) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/{chunk-TRMAUC6D.cjs → chunk-3C3OXZPL.cjs} +4 -4
  3. package/dist/{chunk-TRMAUC6D.cjs.map → chunk-3C3OXZPL.cjs.map} +1 -1
  4. package/dist/{chunk-HBMTKCJL.cjs → chunk-53QVLUCB.cjs} +3 -3
  5. package/dist/{chunk-HBMTKCJL.cjs.map → chunk-53QVLUCB.cjs.map} +1 -1
  6. package/dist/{chunk-UMLVM74X.js → chunk-7NYP7OX2.js} +3 -3
  7. package/dist/{chunk-UMLVM74X.js.map → chunk-7NYP7OX2.js.map} +1 -1
  8. package/dist/{chunk-PBYMU4C4.js → chunk-EPCOAEFM.js} +5 -3
  9. package/dist/{chunk-PBYMU4C4.js.map → chunk-EPCOAEFM.js.map} +1 -1
  10. package/dist/{chunk-SJGVGNXJ.cjs → chunk-EPRYRKVV.cjs} +7 -7
  11. package/dist/{chunk-SJGVGNXJ.cjs.map → chunk-EPRYRKVV.cjs.map} +1 -1
  12. package/dist/{chunk-D4DWAPZU.js → chunk-GKLP6PD3.js} +3 -3
  13. package/dist/{chunk-D4DWAPZU.js.map → chunk-GKLP6PD3.js.map} +1 -1
  14. package/dist/{chunk-T32ZPNKL.cjs → chunk-GXCTBYTR.cjs} +4 -4
  15. package/dist/{chunk-T32ZPNKL.cjs.map → chunk-GXCTBYTR.cjs.map} +1 -1
  16. package/dist/{chunk-QZSLYLW4.js → chunk-HU57X24H.js} +3 -3
  17. package/dist/{chunk-QZSLYLW4.js.map → chunk-HU57X24H.js.map} +1 -1
  18. package/dist/{chunk-SRVUIHVN.js → chunk-JKNEQ3J4.js} +3 -3
  19. package/dist/{chunk-SRVUIHVN.js.map → chunk-JKNEQ3J4.js.map} +1 -1
  20. package/dist/{chunk-E4SZPFH3.js → chunk-JLLUTTIP.js} +3 -3
  21. package/dist/{chunk-E4SZPFH3.js.map → chunk-JLLUTTIP.js.map} +1 -1
  22. package/dist/{chunk-NIGJATIB.cjs → chunk-LIHUIA74.cjs} +5 -5
  23. package/dist/{chunk-NIGJATIB.cjs.map → chunk-LIHUIA74.cjs.map} +1 -1
  24. package/dist/{chunk-2XESZTZT.cjs → chunk-LOUG7JBX.cjs} +10 -10
  25. package/dist/{chunk-2XESZTZT.cjs.map → chunk-LOUG7JBX.cjs.map} +1 -1
  26. package/dist/{chunk-MIZHXCAC.js → chunk-NIZUR27T.js} +79 -34
  27. package/dist/chunk-NIZUR27T.js.map +1 -0
  28. package/dist/{chunk-OY6VG2JH.cjs → chunk-P6OB5MFM.cjs} +818 -35
  29. package/dist/chunk-P6OB5MFM.cjs.map +1 -0
  30. package/dist/{chunk-AZI2SAH6.cjs → chunk-PTTZTL3P.cjs} +6 -6
  31. package/dist/{chunk-AZI2SAH6.cjs.map → chunk-PTTZTL3P.cjs.map} +1 -1
  32. package/dist/{chunk-34CASLHS.js → chunk-SMDDF5Q2.js} +3 -3
  33. package/dist/{chunk-34CASLHS.js.map → chunk-SMDDF5Q2.js.map} +1 -1
  34. package/dist/{chunk-FJC2FLV6.js → chunk-TXQIQQRH.js} +3 -3
  35. package/dist/{chunk-FJC2FLV6.js.map → chunk-TXQIQQRH.js.map} +1 -1
  36. package/dist/{chunk-JOGDEYIU.cjs → chunk-UHIBPBN7.cjs} +79 -34
  37. package/dist/chunk-UHIBPBN7.cjs.map +1 -0
  38. package/dist/{chunk-J5JMA2EP.cjs → chunk-XCZ44WKI.cjs} +5 -3
  39. package/dist/chunk-XCZ44WKI.cjs.map +1 -0
  40. package/dist/{chunk-LCYZZIAU.js → chunk-Y3VOPMKQ.js} +800 -17
  41. package/dist/chunk-Y3VOPMKQ.js.map +1 -0
  42. package/dist/{chunk-ROPYYPBZ.js → chunk-YA4B6LPU.js} +4 -4
  43. package/dist/{chunk-ROPYYPBZ.js.map → chunk-YA4B6LPU.js.map} +1 -1
  44. package/dist/{chunk-HK6NFKTA.cjs → chunk-ZWIUMFSO.cjs} +4 -4
  45. package/dist/{chunk-HK6NFKTA.cjs.map → chunk-ZWIUMFSO.cjs.map} +1 -1
  46. package/dist/docs/SKILL.md +1 -1
  47. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  48. package/dist/{observational-memory-YYO73QMY-KGMPHQD4.cjs → observational-memory-YYO73QMY-CHIPDTZY.cjs} +26 -26
  49. package/dist/{observational-memory-YYO73QMY-KGMPHQD4.cjs.map → observational-memory-YYO73QMY-CHIPDTZY.cjs.map} +1 -1
  50. package/dist/{observational-memory-YYO73QMY-Q4SXDDYL.js → observational-memory-YYO73QMY-JNLMPY5B.js} +3 -3
  51. package/dist/{observational-memory-YYO73QMY-Q4SXDDYL.js.map → observational-memory-YYO73QMY-JNLMPY5B.js.map} +1 -1
  52. package/dist/{probe-image-size-7HF7Q24F.cjs → probe-image-size-H2PYJKCK.cjs} +113 -12
  53. package/dist/probe-image-size-H2PYJKCK.cjs.map +1 -0
  54. package/dist/{probe-image-size-M5NYSF5D.js → probe-image-size-QWKVSEOF.js} +113 -12
  55. package/dist/probe-image-size-QWKVSEOF.js.map +1 -0
  56. package/dist/server/handlers/a2a.cjs +10 -10
  57. package/dist/server/handlers/a2a.js +1 -1
  58. package/dist/server/handlers/agent-builder.cjs +16 -16
  59. package/dist/server/handlers/agent-builder.js +1 -1
  60. package/dist/server/handlers/agents.cjs +37 -37
  61. package/dist/server/handlers/agents.d.ts.map +1 -1
  62. package/dist/server/handlers/agents.js +1 -1
  63. package/dist/server/handlers/auth.cjs +11 -11
  64. package/dist/server/handlers/auth.d.ts +16 -0
  65. package/dist/server/handlers/auth.d.ts.map +1 -1
  66. package/dist/server/handlers/auth.js +1 -1
  67. package/dist/server/handlers/conversations.cjs +5 -5
  68. package/dist/server/handlers/conversations.js +1 -1
  69. package/dist/server/handlers/responses.cjs +4 -4
  70. package/dist/server/handlers/responses.js +1 -1
  71. package/dist/server/handlers/scores.cjs +7 -7
  72. package/dist/server/handlers/scores.js +1 -1
  73. package/dist/server/handlers/tools.cjs +6 -6
  74. package/dist/server/handlers/tools.js +1 -1
  75. package/dist/server/handlers/voice.cjs +8 -8
  76. package/dist/server/handlers/voice.js +1 -1
  77. package/dist/server/handlers.cjs +16 -16
  78. package/dist/server/handlers.js +8 -8
  79. package/dist/server/schemas/auth.d.ts +11 -0
  80. package/dist/server/schemas/auth.d.ts.map +1 -1
  81. package/dist/server/schemas/index.cjs +19 -19
  82. package/dist/server/schemas/index.js +1 -1
  83. package/dist/server/server-adapter/index.cjs +75 -75
  84. package/dist/server/server-adapter/index.js +9 -9
  85. package/package.json +9 -9
  86. package/dist/chunk-J5JMA2EP.cjs.map +0 -1
  87. package/dist/chunk-JOGDEYIU.cjs.map +0 -1
  88. package/dist/chunk-LCYZZIAU.js.map +0 -1
  89. package/dist/chunk-MIZHXCAC.js.map +0 -1
  90. package/dist/chunk-OY6VG2JH.cjs.map +0 -1
  91. package/dist/probe-image-size-7HF7Q24F.cjs.map +0 -1
  92. package/dist/probe-image-size-M5NYSF5D.js.map +0 -1
@@ -2734,9 +2734,9 @@ var require_cookies = chunkO7I5CWRX_cjs.__commonJS({
2734
2734
  }
2735
2735
  });
2736
2736
 
2737
- // ../../node_modules/.pnpm/sax@1.4.4/node_modules/sax/lib/sax.js
2737
+ // ../../node_modules/.pnpm/sax@1.6.0/node_modules/sax/lib/sax.js
2738
2738
  var require_sax = chunkO7I5CWRX_cjs.__commonJS({
2739
- "../../node_modules/.pnpm/sax@1.4.4/node_modules/sax/lib/sax.js"(exports$1) {
2739
+ "../../node_modules/.pnpm/sax@1.6.0/node_modules/sax/lib/sax.js"(exports$1) {
2740
2740
  (function(sax) {
2741
2741
  sax.parser = function(strict, opt) {
2742
2742
  return new SAXParser(strict, opt);
@@ -2787,9 +2787,13 @@ var require_sax = chunkO7I5CWRX_cjs.__commonJS({
2787
2787
  clearBuffers(parser);
2788
2788
  parser.q = parser.c = "";
2789
2789
  parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH;
2790
+ parser.encoding = null;
2790
2791
  parser.opt = opt || {};
2791
2792
  parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;
2792
2793
  parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase";
2794
+ parser.opt.maxEntityCount = parser.opt.maxEntityCount || 512;
2795
+ parser.opt.maxEntityDepth = parser.opt.maxEntityDepth || 4;
2796
+ parser.entityCount = parser.entityDepth = 0;
2793
2797
  parser.tags = [];
2794
2798
  parser.closed = parser.closedRoot = parser.sawRoot = false;
2795
2799
  parser.tag = parser.error = null;
@@ -2901,6 +2905,29 @@ var require_sax = chunkO7I5CWRX_cjs.__commonJS({
2901
2905
  function createStream(strict, opt) {
2902
2906
  return new SAXStream(strict, opt);
2903
2907
  }
2908
+ function determineBufferEncoding(data, isEnd) {
2909
+ if (data.length >= 2) {
2910
+ if (data[0] === 255 && data[1] === 254) {
2911
+ return "utf-16le";
2912
+ }
2913
+ if (data[0] === 254 && data[1] === 255) {
2914
+ return "utf-16be";
2915
+ }
2916
+ }
2917
+ if (data.length >= 3 && data[0] === 239 && data[1] === 187 && data[2] === 191) {
2918
+ return "utf8";
2919
+ }
2920
+ if (data.length >= 4) {
2921
+ if (data[0] === 60 && data[1] === 0 && data[2] === 63 && data[3] === 0) {
2922
+ return "utf-16le";
2923
+ }
2924
+ if (data[0] === 0 && data[1] === 60 && data[2] === 0 && data[3] === 63) {
2925
+ return "utf-16be";
2926
+ }
2927
+ return "utf8";
2928
+ }
2929
+ return isEnd ? "utf8" : null;
2930
+ }
2904
2931
  function SAXStream(strict, opt) {
2905
2932
  if (!(this instanceof SAXStream)) {
2906
2933
  return new SAXStream(strict, opt);
@@ -2918,6 +2945,7 @@ var require_sax = chunkO7I5CWRX_cjs.__commonJS({
2918
2945
  me._parser.error = null;
2919
2946
  };
2920
2947
  this._decoder = null;
2948
+ this._decoderBuffer = null;
2921
2949
  streamWraps.forEach(function(ev) {
2922
2950
  Object.defineProperty(me, "on" + ev, {
2923
2951
  get: function() {
@@ -2941,12 +2969,31 @@ var require_sax = chunkO7I5CWRX_cjs.__commonJS({
2941
2969
  value: SAXStream
2942
2970
  }
2943
2971
  });
2972
+ SAXStream.prototype._decodeBuffer = function(data, isEnd) {
2973
+ if (this._decoderBuffer) {
2974
+ data = Buffer.concat([this._decoderBuffer, data]);
2975
+ this._decoderBuffer = null;
2976
+ }
2977
+ if (!this._decoder) {
2978
+ var encoding = determineBufferEncoding(data, isEnd);
2979
+ if (!encoding) {
2980
+ this._decoderBuffer = data;
2981
+ return "";
2982
+ }
2983
+ this._parser.encoding = encoding;
2984
+ this._decoder = new TextDecoder(encoding);
2985
+ }
2986
+ return this._decoder.decode(data, { stream: !isEnd });
2987
+ };
2944
2988
  SAXStream.prototype.write = function(data) {
2945
2989
  if (typeof Buffer === "function" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(data)) {
2946
- if (!this._decoder) {
2947
- this._decoder = new TextDecoder("utf8");
2990
+ data = this._decodeBuffer(data, false);
2991
+ } else if (this._decoderBuffer) {
2992
+ var remaining = this._decodeBuffer(Buffer.alloc(0), true);
2993
+ if (remaining) {
2994
+ this._parser.write(remaining);
2995
+ this.emit("data", remaining);
2948
2996
  }
2949
- data = this._decoder.decode(data, { stream: true });
2950
2997
  }
2951
2998
  this._parser.write(data.toString());
2952
2999
  this.emit("data", data);
@@ -2956,7 +3003,13 @@ var require_sax = chunkO7I5CWRX_cjs.__commonJS({
2956
3003
  if (chunk && chunk.length) {
2957
3004
  this.write(chunk);
2958
3005
  }
2959
- if (this._decoder) {
3006
+ if (this._decoderBuffer) {
3007
+ var finalChunk = this._decodeBuffer(Buffer.alloc(0), true);
3008
+ if (finalChunk) {
3009
+ this._parser.write(finalChunk);
3010
+ this.emit("data", finalChunk);
3011
+ }
3012
+ } else if (this._decoder) {
2960
3013
  var remaining = this._decoder.decode();
2961
3014
  if (remaining) {
2962
3015
  this._parser.write(remaining);
@@ -3350,6 +3403,39 @@ var require_sax = chunkO7I5CWRX_cjs.__commonJS({
3350
3403
  function emit(parser, event, data) {
3351
3404
  parser[event] && parser[event](data);
3352
3405
  }
3406
+ function getDeclaredEncoding(body) {
3407
+ var match = body && body.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);
3408
+ return match ? match[2] : null;
3409
+ }
3410
+ function normalizeEncodingName(encoding) {
3411
+ if (!encoding) {
3412
+ return null;
3413
+ }
3414
+ return encoding.toLowerCase().replace(/[^a-z0-9]/g, "");
3415
+ }
3416
+ function encodingsMatch(detectedEncoding, declaredEncoding) {
3417
+ const detected = normalizeEncodingName(detectedEncoding);
3418
+ const declared = normalizeEncodingName(declaredEncoding);
3419
+ if (!detected || !declared) {
3420
+ return true;
3421
+ }
3422
+ if (declared === "utf16") {
3423
+ return detected === "utf16le" || detected === "utf16be";
3424
+ }
3425
+ return detected === declared;
3426
+ }
3427
+ function validateXmlDeclarationEncoding(parser, data) {
3428
+ if (!parser.strict || !parser.encoding || !data || data.name !== "xml") {
3429
+ return;
3430
+ }
3431
+ var declaredEncoding = getDeclaredEncoding(data.body);
3432
+ if (declaredEncoding && !encodingsMatch(parser.encoding, declaredEncoding)) {
3433
+ strictFail(
3434
+ parser,
3435
+ "XML declaration encoding " + declaredEncoding + " does not match detected stream encoding " + parser.encoding.toUpperCase()
3436
+ );
3437
+ }
3438
+ }
3353
3439
  function emitNode(parser, nodeType, data) {
3354
3440
  if (parser.textNode) closeText(parser);
3355
3441
  emit(parser, nodeType, data);
@@ -3926,10 +4012,12 @@ var require_sax = chunkO7I5CWRX_cjs.__commonJS({
3926
4012
  continue;
3927
4013
  case S.PROC_INST_ENDING:
3928
4014
  if (c === ">") {
3929
- emitNode(parser, "onprocessinginstruction", {
4015
+ const procInstEndData = {
3930
4016
  name: parser.procInstName,
3931
4017
  body: parser.procInstBody
3932
- });
4018
+ };
4019
+ validateXmlDeclarationEncoding(parser, procInstEndData);
4020
+ emitNode(parser, "onprocessinginstruction", procInstEndData);
3933
4021
  parser.procInstName = parser.procInstBody = "";
3934
4022
  parser.state = S.TEXT;
3935
4023
  } else {
@@ -4142,9 +4230,22 @@ var require_sax = chunkO7I5CWRX_cjs.__commonJS({
4142
4230
  if (c === ";") {
4143
4231
  var parsedEntity = parseEntity(parser);
4144
4232
  if (parser.opt.unparsedEntities && !Object.values(sax.XML_ENTITIES).includes(parsedEntity)) {
4233
+ if ((parser.entityCount += 1) > parser.opt.maxEntityCount) {
4234
+ error(
4235
+ parser,
4236
+ "Parsed entity count exceeds max entity count"
4237
+ );
4238
+ }
4239
+ if ((parser.entityDepth += 1) > parser.opt.maxEntityDepth) {
4240
+ error(
4241
+ parser,
4242
+ "Parsed entity depth exceeds max entity depth"
4243
+ );
4244
+ }
4145
4245
  parser.entity = "";
4146
4246
  parser.state = returnState;
4147
4247
  parser.write(parsedEntity);
4248
+ parser.entityDepth -= 1;
4148
4249
  } else {
4149
4250
  parser[buffer] += parsedEntity;
4150
4251
  parser.entity = "";
@@ -9806,13 +9907,13 @@ var require_probe_image_size = chunkO7I5CWRX_cjs.__commonJS({
9806
9907
  module.exports.Error = require_common().ProbeError;
9807
9908
  }
9808
9909
  });
9809
- var probeImageSize7HF7Q24F = require_probe_image_size();
9910
+ var probeImageSizeH2PYJKCK = require_probe_image_size();
9810
9911
  /*! Bundled license information:
9811
9912
 
9812
9913
  sax/lib/sax.js:
9813
9914
  (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
9814
9915
  */
9815
9916
 
9816
- module.exports = probeImageSize7HF7Q24F;
9817
- //# sourceMappingURL=probe-image-size-7HF7Q24F.cjs.map
9818
- //# sourceMappingURL=probe-image-size-7HF7Q24F.cjs.map
9917
+ module.exports = probeImageSizeH2PYJKCK;
9918
+ //# sourceMappingURL=probe-image-size-H2PYJKCK.cjs.map
9919
+ //# sourceMappingURL=probe-image-size-H2PYJKCK.cjs.map