@mastra/server 1.29.0 → 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 +16 -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 +6 -6
  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
@@ -2732,9 +2732,9 @@ var require_cookies = __commonJS({
2732
2732
  }
2733
2733
  });
2734
2734
 
2735
- // ../../node_modules/.pnpm/sax@1.4.4/node_modules/sax/lib/sax.js
2735
+ // ../../node_modules/.pnpm/sax@1.6.0/node_modules/sax/lib/sax.js
2736
2736
  var require_sax = __commonJS({
2737
- "../../node_modules/.pnpm/sax@1.4.4/node_modules/sax/lib/sax.js"(exports$1) {
2737
+ "../../node_modules/.pnpm/sax@1.6.0/node_modules/sax/lib/sax.js"(exports$1) {
2738
2738
  (function(sax) {
2739
2739
  sax.parser = function(strict, opt) {
2740
2740
  return new SAXParser(strict, opt);
@@ -2785,9 +2785,13 @@ var require_sax = __commonJS({
2785
2785
  clearBuffers(parser);
2786
2786
  parser.q = parser.c = "";
2787
2787
  parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH;
2788
+ parser.encoding = null;
2788
2789
  parser.opt = opt || {};
2789
2790
  parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;
2790
2791
  parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase";
2792
+ parser.opt.maxEntityCount = parser.opt.maxEntityCount || 512;
2793
+ parser.opt.maxEntityDepth = parser.opt.maxEntityDepth || 4;
2794
+ parser.entityCount = parser.entityDepth = 0;
2791
2795
  parser.tags = [];
2792
2796
  parser.closed = parser.closedRoot = parser.sawRoot = false;
2793
2797
  parser.tag = parser.error = null;
@@ -2899,6 +2903,29 @@ var require_sax = __commonJS({
2899
2903
  function createStream(strict, opt) {
2900
2904
  return new SAXStream(strict, opt);
2901
2905
  }
2906
+ function determineBufferEncoding(data, isEnd) {
2907
+ if (data.length >= 2) {
2908
+ if (data[0] === 255 && data[1] === 254) {
2909
+ return "utf-16le";
2910
+ }
2911
+ if (data[0] === 254 && data[1] === 255) {
2912
+ return "utf-16be";
2913
+ }
2914
+ }
2915
+ if (data.length >= 3 && data[0] === 239 && data[1] === 187 && data[2] === 191) {
2916
+ return "utf8";
2917
+ }
2918
+ if (data.length >= 4) {
2919
+ if (data[0] === 60 && data[1] === 0 && data[2] === 63 && data[3] === 0) {
2920
+ return "utf-16le";
2921
+ }
2922
+ if (data[0] === 0 && data[1] === 60 && data[2] === 0 && data[3] === 63) {
2923
+ return "utf-16be";
2924
+ }
2925
+ return "utf8";
2926
+ }
2927
+ return isEnd ? "utf8" : null;
2928
+ }
2902
2929
  function SAXStream(strict, opt) {
2903
2930
  if (!(this instanceof SAXStream)) {
2904
2931
  return new SAXStream(strict, opt);
@@ -2916,6 +2943,7 @@ var require_sax = __commonJS({
2916
2943
  me._parser.error = null;
2917
2944
  };
2918
2945
  this._decoder = null;
2946
+ this._decoderBuffer = null;
2919
2947
  streamWraps.forEach(function(ev) {
2920
2948
  Object.defineProperty(me, "on" + ev, {
2921
2949
  get: function() {
@@ -2939,12 +2967,31 @@ var require_sax = __commonJS({
2939
2967
  value: SAXStream
2940
2968
  }
2941
2969
  });
2970
+ SAXStream.prototype._decodeBuffer = function(data, isEnd) {
2971
+ if (this._decoderBuffer) {
2972
+ data = Buffer.concat([this._decoderBuffer, data]);
2973
+ this._decoderBuffer = null;
2974
+ }
2975
+ if (!this._decoder) {
2976
+ var encoding = determineBufferEncoding(data, isEnd);
2977
+ if (!encoding) {
2978
+ this._decoderBuffer = data;
2979
+ return "";
2980
+ }
2981
+ this._parser.encoding = encoding;
2982
+ this._decoder = new TextDecoder(encoding);
2983
+ }
2984
+ return this._decoder.decode(data, { stream: !isEnd });
2985
+ };
2942
2986
  SAXStream.prototype.write = function(data) {
2943
2987
  if (typeof Buffer === "function" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(data)) {
2944
- if (!this._decoder) {
2945
- this._decoder = new TextDecoder("utf8");
2988
+ data = this._decodeBuffer(data, false);
2989
+ } else if (this._decoderBuffer) {
2990
+ var remaining = this._decodeBuffer(Buffer.alloc(0), true);
2991
+ if (remaining) {
2992
+ this._parser.write(remaining);
2993
+ this.emit("data", remaining);
2946
2994
  }
2947
- data = this._decoder.decode(data, { stream: true });
2948
2995
  }
2949
2996
  this._parser.write(data.toString());
2950
2997
  this.emit("data", data);
@@ -2954,7 +3001,13 @@ var require_sax = __commonJS({
2954
3001
  if (chunk && chunk.length) {
2955
3002
  this.write(chunk);
2956
3003
  }
2957
- if (this._decoder) {
3004
+ if (this._decoderBuffer) {
3005
+ var finalChunk = this._decodeBuffer(Buffer.alloc(0), true);
3006
+ if (finalChunk) {
3007
+ this._parser.write(finalChunk);
3008
+ this.emit("data", finalChunk);
3009
+ }
3010
+ } else if (this._decoder) {
2958
3011
  var remaining = this._decoder.decode();
2959
3012
  if (remaining) {
2960
3013
  this._parser.write(remaining);
@@ -3348,6 +3401,39 @@ var require_sax = __commonJS({
3348
3401
  function emit(parser, event, data) {
3349
3402
  parser[event] && parser[event](data);
3350
3403
  }
3404
+ function getDeclaredEncoding(body) {
3405
+ var match = body && body.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);
3406
+ return match ? match[2] : null;
3407
+ }
3408
+ function normalizeEncodingName(encoding) {
3409
+ if (!encoding) {
3410
+ return null;
3411
+ }
3412
+ return encoding.toLowerCase().replace(/[^a-z0-9]/g, "");
3413
+ }
3414
+ function encodingsMatch(detectedEncoding, declaredEncoding) {
3415
+ const detected = normalizeEncodingName(detectedEncoding);
3416
+ const declared = normalizeEncodingName(declaredEncoding);
3417
+ if (!detected || !declared) {
3418
+ return true;
3419
+ }
3420
+ if (declared === "utf16") {
3421
+ return detected === "utf16le" || detected === "utf16be";
3422
+ }
3423
+ return detected === declared;
3424
+ }
3425
+ function validateXmlDeclarationEncoding(parser, data) {
3426
+ if (!parser.strict || !parser.encoding || !data || data.name !== "xml") {
3427
+ return;
3428
+ }
3429
+ var declaredEncoding = getDeclaredEncoding(data.body);
3430
+ if (declaredEncoding && !encodingsMatch(parser.encoding, declaredEncoding)) {
3431
+ strictFail(
3432
+ parser,
3433
+ "XML declaration encoding " + declaredEncoding + " does not match detected stream encoding " + parser.encoding.toUpperCase()
3434
+ );
3435
+ }
3436
+ }
3351
3437
  function emitNode(parser, nodeType, data) {
3352
3438
  if (parser.textNode) closeText(parser);
3353
3439
  emit(parser, nodeType, data);
@@ -3924,10 +4010,12 @@ var require_sax = __commonJS({
3924
4010
  continue;
3925
4011
  case S.PROC_INST_ENDING:
3926
4012
  if (c === ">") {
3927
- emitNode(parser, "onprocessinginstruction", {
4013
+ const procInstEndData = {
3928
4014
  name: parser.procInstName,
3929
4015
  body: parser.procInstBody
3930
- });
4016
+ };
4017
+ validateXmlDeclarationEncoding(parser, procInstEndData);
4018
+ emitNode(parser, "onprocessinginstruction", procInstEndData);
3931
4019
  parser.procInstName = parser.procInstBody = "";
3932
4020
  parser.state = S.TEXT;
3933
4021
  } else {
@@ -4140,9 +4228,22 @@ var require_sax = __commonJS({
4140
4228
  if (c === ";") {
4141
4229
  var parsedEntity = parseEntity(parser);
4142
4230
  if (parser.opt.unparsedEntities && !Object.values(sax.XML_ENTITIES).includes(parsedEntity)) {
4231
+ if ((parser.entityCount += 1) > parser.opt.maxEntityCount) {
4232
+ error(
4233
+ parser,
4234
+ "Parsed entity count exceeds max entity count"
4235
+ );
4236
+ }
4237
+ if ((parser.entityDepth += 1) > parser.opt.maxEntityDepth) {
4238
+ error(
4239
+ parser,
4240
+ "Parsed entity depth exceeds max entity depth"
4241
+ );
4242
+ }
4143
4243
  parser.entity = "";
4144
4244
  parser.state = returnState;
4145
4245
  parser.write(parsedEntity);
4246
+ parser.entityDepth -= 1;
4146
4247
  } else {
4147
4248
  parser[buffer] += parsedEntity;
4148
4249
  parser.entity = "";
@@ -9804,13 +9905,13 @@ var require_probe_image_size = __commonJS({
9804
9905
  module.exports.Error = require_common().ProbeError;
9805
9906
  }
9806
9907
  });
9807
- var probeImageSizeM5NYSF5D = require_probe_image_size();
9908
+ var probeImageSizeQWKVSEOF = require_probe_image_size();
9808
9909
  /*! Bundled license information:
9809
9910
 
9810
9911
  sax/lib/sax.js:
9811
9912
  (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
9812
9913
  */
9813
9914
 
9814
- export { probeImageSizeM5NYSF5D as default };
9815
- //# sourceMappingURL=probe-image-size-M5NYSF5D.js.map
9816
- //# sourceMappingURL=probe-image-size-M5NYSF5D.js.map
9915
+ export { probeImageSizeQWKVSEOF as default };
9916
+ //# sourceMappingURL=probe-image-size-QWKVSEOF.js.map
9917
+ //# sourceMappingURL=probe-image-size-QWKVSEOF.js.map