@mastra/rag 2.0.0 → 2.1.0-alpha.0

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.
package/dist/index.js CHANGED
@@ -79,7 +79,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
79
79
 
80
80
  // ../../node_modules/.pnpm/secure-json-parse@2.7.0/node_modules/secure-json-parse/index.js
81
81
  var require_secure_json_parse = __commonJS({
82
- "../../node_modules/.pnpm/secure-json-parse@2.7.0/node_modules/secure-json-parse/index.js"(exports, module) {
82
+ "../../node_modules/.pnpm/secure-json-parse@2.7.0/node_modules/secure-json-parse/index.js"(exports$1, module) {
83
83
  var hasBuffer = typeof Buffer !== "undefined";
84
84
  var suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
85
85
  var suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
@@ -4853,7 +4853,352 @@ var RecursiveCharacterTransformer = class _RecursiveCharacterTransformer extends
4853
4853
  " ",
4854
4854
  ""
4855
4855
  ];
4856
- // ... (add other language cases following the same pattern)
4856
+ case "php" /* PHP */:
4857
+ return [
4858
+ "\\nnamespace ",
4859
+ "\\nuse ",
4860
+ "\\nclass ",
4861
+ "\\ninterface ",
4862
+ "\\ntrait ",
4863
+ "\\nfunction ",
4864
+ "\\npublic ",
4865
+ "\\nprivate ",
4866
+ "\\nprotected ",
4867
+ "\\nif ",
4868
+ "\\nforeach ",
4869
+ "\\nfor ",
4870
+ "\\nwhile ",
4871
+ "\\nswitch ",
4872
+ "\\ncase ",
4873
+ "\\n\\n",
4874
+ "\\n",
4875
+ " ",
4876
+ ""
4877
+ ];
4878
+ case "go" /* GO */:
4879
+ return [
4880
+ "\npackage ",
4881
+ "\nimport ",
4882
+ "\nfunc ",
4883
+ "\ntype ",
4884
+ "\nstruct ",
4885
+ "\ninterface ",
4886
+ "\nconst ",
4887
+ "\nvar ",
4888
+ "\nif ",
4889
+ "\nfor ",
4890
+ "\nswitch ",
4891
+ "\ncase ",
4892
+ "\n\n",
4893
+ "\n",
4894
+ " ",
4895
+ ""
4896
+ ];
4897
+ case "java" /* JAVA */:
4898
+ case "scala" /* SCALA */:
4899
+ return [
4900
+ "\npackage ",
4901
+ "\nimport ",
4902
+ "\nclass ",
4903
+ "\ninterface ",
4904
+ "\nenum ",
4905
+ "\npublic ",
4906
+ "\nprotected ",
4907
+ "\nprivate ",
4908
+ "\nstatic ",
4909
+ "\nvoid ",
4910
+ "\nif ",
4911
+ "\nfor ",
4912
+ "\nwhile ",
4913
+ "\nswitch ",
4914
+ "\ncase ",
4915
+ "\n\n",
4916
+ "\n",
4917
+ " ",
4918
+ ""
4919
+ ];
4920
+ case "kotlin" /* KOTLIN */:
4921
+ return [
4922
+ "\npackage ",
4923
+ "\nimport ",
4924
+ "\nclass ",
4925
+ "\ninterface ",
4926
+ "\nfun ",
4927
+ "\nval ",
4928
+ "\nvar ",
4929
+ "\nobject ",
4930
+ "\ncompanion ",
4931
+ "\nif ",
4932
+ "\nfor ",
4933
+ "\nwhile ",
4934
+ "\nwhen ",
4935
+ "\n\n",
4936
+ "\n",
4937
+ " ",
4938
+ ""
4939
+ ];
4940
+ case "js" /* JS */:
4941
+ return [
4942
+ "\nclass ",
4943
+ "\nfunction ",
4944
+ "\nconst ",
4945
+ "\nlet ",
4946
+ "\nvar ",
4947
+ "\nif ",
4948
+ "\nfor ",
4949
+ "\nwhile ",
4950
+ "\nswitch ",
4951
+ "\ncase ",
4952
+ "\ndefault ",
4953
+ "\n\n",
4954
+ "\n",
4955
+ " ",
4956
+ ""
4957
+ ];
4958
+ case "python" /* PYTHON */:
4959
+ return [
4960
+ "\nclass ",
4961
+ "\ndef ",
4962
+ "\n def ",
4963
+ "\n def ",
4964
+ "\nasync def ",
4965
+ "\nif ",
4966
+ "\nfor ",
4967
+ "\nwhile ",
4968
+ "\ntry ",
4969
+ "\nexcept ",
4970
+ "\n\n",
4971
+ "\n",
4972
+ " ",
4973
+ ""
4974
+ ];
4975
+ case "ruby" /* RUBY */:
4976
+ return [
4977
+ "\nmodule ",
4978
+ "\nclass ",
4979
+ "\ndef ",
4980
+ "\nif ",
4981
+ "\nunless ",
4982
+ "\nwhile ",
4983
+ "\nfor ",
4984
+ "\nbegin ",
4985
+ "\nrescue ",
4986
+ "\n\n",
4987
+ "\n",
4988
+ " ",
4989
+ ""
4990
+ ];
4991
+ case "rust" /* RUST */:
4992
+ return [
4993
+ "\nmod ",
4994
+ "\nuse ",
4995
+ "\nfn ",
4996
+ "\nstruct ",
4997
+ "\nenum ",
4998
+ "\nimpl ",
4999
+ "\ntrait ",
5000
+ "\nconst ",
5001
+ "\nlet ",
5002
+ "\nif ",
5003
+ "\nfor ",
5004
+ "\nwhile ",
5005
+ "\nmatch ",
5006
+ "\n\n",
5007
+ "\n",
5008
+ " ",
5009
+ ""
5010
+ ];
5011
+ case "swift" /* SWIFT */:
5012
+ return [
5013
+ "\nimport ",
5014
+ "\nclass ",
5015
+ "\nstruct ",
5016
+ "\nenum ",
5017
+ "\nprotocol ",
5018
+ "\nfunc ",
5019
+ "\nvar ",
5020
+ "\nlet ",
5021
+ "\nif ",
5022
+ "\nfor ",
5023
+ "\nwhile ",
5024
+ "\nswitch ",
5025
+ "\ncase ",
5026
+ "\n\n",
5027
+ "\n",
5028
+ " ",
5029
+ ""
5030
+ ];
5031
+ case "html" /* HTML */:
5032
+ return [
5033
+ "<body",
5034
+ "<div",
5035
+ "<p",
5036
+ "<br",
5037
+ "<li",
5038
+ "<h1",
5039
+ "<h2",
5040
+ "<h3",
5041
+ "<h4",
5042
+ "<h5",
5043
+ "<h6",
5044
+ "<span",
5045
+ "<table",
5046
+ "<tr",
5047
+ "<td",
5048
+ "<th",
5049
+ "<ul",
5050
+ "<ol",
5051
+ "<header",
5052
+ "<footer",
5053
+ "<nav",
5054
+ "\n\n",
5055
+ "\n",
5056
+ " ",
5057
+ ""
5058
+ ];
5059
+ case "sol" /* SOL */:
5060
+ return [
5061
+ "\npragma ",
5062
+ "\nimport ",
5063
+ "\ncontract ",
5064
+ "\ninterface ",
5065
+ "\nlibrary ",
5066
+ "\nfunction ",
5067
+ "\nevent ",
5068
+ "\nmodifier ",
5069
+ "\nerror ",
5070
+ "\nstruct ",
5071
+ "\nenum ",
5072
+ "\nif ",
5073
+ "\nfor ",
5074
+ "\nwhile ",
5075
+ "\n\n",
5076
+ "\n",
5077
+ " ",
5078
+ ""
5079
+ ];
5080
+ case "csharp" /* CSHARP */:
5081
+ return [
5082
+ "\nnamespace ",
5083
+ "\nusing ",
5084
+ "\nclass ",
5085
+ "\ninterface ",
5086
+ "\nstruct ",
5087
+ "\nenum ",
5088
+ "\npublic ",
5089
+ "\nprivate ",
5090
+ "\nprotected ",
5091
+ "\ninternal ",
5092
+ "\nvoid ",
5093
+ "\nif ",
5094
+ "\nfor ",
5095
+ "\nwhile ",
5096
+ "\nswitch ",
5097
+ "\ncase ",
5098
+ "\n\n",
5099
+ "\n",
5100
+ " ",
5101
+ ""
5102
+ ];
5103
+ case "cobol" /* COBOL */:
5104
+ return [
5105
+ "\nIDENTIFICATION DIVISION",
5106
+ "\nENVIRONMENT DIVISION",
5107
+ "\nDATA DIVISION",
5108
+ "\nPROCEDURE DIVISION",
5109
+ "\nWORKING-STORAGE SECTION",
5110
+ "\nPERFORM ",
5111
+ "\nIF ",
5112
+ "\nEVALUATE ",
5113
+ "\n\n",
5114
+ "\n",
5115
+ " ",
5116
+ ""
5117
+ ];
5118
+ case "lua" /* LUA */:
5119
+ return ["\nfunction ", "\nlocal function ", "\nif ", "\nfor ", "\nwhile ", "\nrepeat ", "\n\n", "\n", " ", ""];
5120
+ case "perl" /* PERL */:
5121
+ return [
5122
+ "\nsub ",
5123
+ "\npackage ",
5124
+ "\nuse ",
5125
+ "\nmy ",
5126
+ "\nour ",
5127
+ "\nif ",
5128
+ "\nunless ",
5129
+ "\nwhile ",
5130
+ "\nfor ",
5131
+ "\nforeach ",
5132
+ "\n\n",
5133
+ "\n",
5134
+ " ",
5135
+ ""
5136
+ ];
5137
+ case "haskell" /* HASKELL */:
5138
+ return [
5139
+ "\nmodule ",
5140
+ "\nimport ",
5141
+ "\ndata ",
5142
+ "\ntype ",
5143
+ "\nnewtype ",
5144
+ "\nclass ",
5145
+ "\ninstance ",
5146
+ "\nwhere ",
5147
+ "\nlet ",
5148
+ "\nif ",
5149
+ "\ncase ",
5150
+ "\n\n",
5151
+ "\n",
5152
+ " ",
5153
+ ""
5154
+ ];
5155
+ case "elixir" /* ELIXIR */:
5156
+ return [
5157
+ "\ndefmodule ",
5158
+ "\ndefprotocol ",
5159
+ "\ndefimpl ",
5160
+ "\ndef ",
5161
+ "\ndefp ",
5162
+ "\ndefmacro ",
5163
+ "\nif ",
5164
+ "\ncase ",
5165
+ "\ncond ",
5166
+ "\n\n",
5167
+ "\n",
5168
+ " ",
5169
+ ""
5170
+ ];
5171
+ case "powershell" /* POWERSHELL */:
5172
+ return [
5173
+ "\nfunction ",
5174
+ "\nfilter ",
5175
+ "\nparam ",
5176
+ "\nif ",
5177
+ "\nforeach ",
5178
+ "\nfor ",
5179
+ "\nwhile ",
5180
+ "\nswitch ",
5181
+ "\n\n",
5182
+ "\n",
5183
+ " ",
5184
+ ""
5185
+ ];
5186
+ case "proto" /* PROTO */:
5187
+ return [
5188
+ "\nsyntax ",
5189
+ "\npackage ",
5190
+ "\nimport ",
5191
+ "\nmessage ",
5192
+ "\nservice ",
5193
+ "\nenum ",
5194
+ "\nrpc ",
5195
+ "\n\n",
5196
+ "\n",
5197
+ " ",
5198
+ ""
5199
+ ];
5200
+ case "rst" /* RST */:
5201
+ return ["\n=+\n", "\n-+\n", "\n\\*+\n", "\n\\.\\. ", "\n\n", "\n", " ", ""];
4857
5202
  default:
4858
5203
  throw new Error(`Language ${language} is not supported! Please choose from ${Object.values(Language)}`);
4859
5204
  }