@mastra/elasticsearch 1.4.6-alpha.0 → 1.4.6-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.
@@ -3,7 +3,7 @@ name: mastra-elasticsearch
3
3
  description: Documentation for @mastra/elasticsearch. Use when working with @mastra/elasticsearch APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/elasticsearch"
6
- version: "1.4.6-alpha.0"
6
+ version: "1.4.6-alpha.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.6-alpha.0",
2
+ "version": "1.4.6-alpha.1",
3
3
  "package": "@mastra/elasticsearch",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -6,10 +6,9 @@ let _mastra_core_vector = require("@mastra/core/vector");
6
6
  let _mastra_core_vector_filter = require("@mastra/core/vector/filter");
7
7
  let _mastra_core_agent = require("@mastra/core/agent");
8
8
  let _mastra_core_evals = require("@mastra/core/evals");
9
- //#region package.json
10
- var version = "1.4.6-alpha.0";
11
- //#endregion
12
- //#region src/vector/filter.ts
9
+ // package.json
10
+ var version = "1.4.6-alpha.1";
11
+ // src/vector/filter.ts
13
12
  /**
14
13
  * Translator for ElasticSearch filter queries.
15
14
  * Maintains ElasticSearch-compatible syntax while ensuring proper validation
@@ -235,8 +234,7 @@ var ElasticSearchFilterTranslator = class extends _mastra_core_vector_filter.Bas
235
234
  return { range: { [field]: rangeParams } };
236
235
  }
237
236
  };
238
- //#endregion
239
- //#region src/vector/index.ts
237
+ // src/vector/index.ts
240
238
  const METRIC_MAPPING = {
241
239
  cosine: "cosine",
242
240
  euclidean: "l2_norm",
@@ -842,8 +840,7 @@ var ElasticSearchVector = class extends _mastra_core_vector.MastraVector {
842
840
  }
843
841
  }
844
842
  };
845
- //#endregion
846
- //#region src/storage/domains/utils.ts
843
+ // src/storage/domains/utils.ts
847
844
  /**
848
845
  * Generate a document key from table name and key parts.
849
846
  *
@@ -885,8 +882,7 @@ function processRecord(tableName, record) {
885
882
  processedRecord
886
883
  };
887
884
  }
888
- //#endregion
889
- //#region src/storage/db.ts
885
+ // src/storage/db.ts
890
886
  const SEARCH_PAGE_SIZE = 1e3;
891
887
  /**
892
888
  * Thin document-store layer over ElasticSearch.
@@ -1120,8 +1116,7 @@ var ElasticSearchDB = class {
1120
1116
  }
1121
1117
  }
1122
1118
  };
1123
- //#endregion
1124
- //#region src/storage/domains/memory/index.ts
1119
+ // src/storage/domains/memory/index.ts
1125
1120
  var MemoryElasticSearch = class extends _mastra_core_storage.MemoryStorage {
1126
1121
  supportsPartialThreadUpdate = true;
1127
1122
  db;
@@ -1956,8 +1951,7 @@ function getMessageScore(message) {
1956
1951
  const index = typeof message._index === "number" ? message._index : 0;
1957
1952
  return createdAtScore * 1e3 + index;
1958
1953
  }
1959
- //#endregion
1960
- //#region src/storage/domains/scores/index.ts
1954
+ // src/storage/domains/scores/index.ts
1961
1955
  /** Returns true when a row matches the multi-tenant scope filters (or none provided). */
1962
1956
  function matchesTenancy(row, filters) {
1963
1957
  if (filters?.organizationId !== void 0 && row.organizationId !== filters.organizationId) return false;
@@ -2092,8 +2086,7 @@ var ScoresElasticSearch = class extends _mastra_core_storage.ScoresStorage {
2092
2086
  };
2093
2087
  }
2094
2088
  };
2095
- //#endregion
2096
- //#region src/storage/domains/workflows/index.ts
2089
+ // src/storage/domains/workflows/index.ts
2097
2090
  function parseWorkflowRun(row) {
2098
2091
  let parsedSnapshot = row.snapshot;
2099
2092
  if (typeof parsedSnapshot === "string") try {
@@ -2386,8 +2379,7 @@ var WorkflowsElasticSearch = class extends _mastra_core_storage.WorkflowsStorage
2386
2379
  }
2387
2380
  }
2388
2381
  };
2389
- //#endregion
2390
- //#region src/storage/store.ts
2382
+ // src/storage/store.ts
2391
2383
  /**
2392
2384
  * ElasticSearch storage adapter for Mastra.
2393
2385
  *
@@ -2459,7 +2451,6 @@ var ElasticSearchStore = class extends _mastra_core_storage.MastraStorage {
2459
2451
  if (this.shouldManageConnection) await this.client.close();
2460
2452
  }
2461
2453
  };
2462
- //#endregion
2463
2454
  exports.ElasticSearchStore = ElasticSearchStore;
2464
2455
  exports.ElasticSearchVector = ElasticSearchVector;
2465
2456
  exports.MemoryElasticSearch = MemoryElasticSearch;