@mastra/mongodb 1.18.3 → 1.18.4-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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @mastra/mongodb
2
2
 
3
+ ## 1.18.4-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed the store package failing to load when installed with `@mastra/core` older than 1.63.1, and corrected the minimum supported core version. ([#22548](https://github.com/mastra-ai/mastra/pull/22548))
8
+
9
+ - Updated dependencies [[`0a9d29c`](https://github.com/mastra-ai/mastra/commit/0a9d29c0c4dbbaa6afc1c8146cdd41759cbd4002)]:
10
+ - @mastra/core@1.63.2-alpha.0
11
+
3
12
  ## 1.18.3
4
13
 
5
14
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-mongodb
3
3
  description: Documentation for @mastra/mongodb. Use when working with @mastra/mongodb APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/mongodb"
6
- version: "1.18.3"
6
+ version: "1.18.4-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.18.3",
2
+ "version": "1.18.4-alpha.0",
3
3
  "package": "@mastra/mongodb",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -10,7 +10,7 @@ let _mastra_core_agent = require("@mastra/core/agent");
10
10
  let _mastra_core_evals = require("@mastra/core/evals");
11
11
  let _mastra_core_storage_domains_skills = require("@mastra/core/storage/domains/skills");
12
12
  //#region package.json
13
- var version = "1.18.3";
13
+ var version = "1.18.4-alpha.0";
14
14
  //#endregion
15
15
  //#region src/vector/filter.ts
16
16
  /**
@@ -4352,6 +4352,18 @@ var MongoDBExperimentsStorage = class MongoDBExperimentsStorage extends _mastra_
4352
4352
  };
4353
4353
  //#endregion
4354
4354
  //#region src/storage/domains/knowledge/index.ts
4355
+ let assertDescriptionWithinBound;
4356
+ async function assertKnowledgeDescriptionWithinBoundCompat(description) {
4357
+ let assertWithinBound = assertDescriptionWithinBound;
4358
+ if (!assertWithinBound) {
4359
+ const resolvedAssert = (await import("@mastra/core/storage")).assertKnowledgeDescriptionWithinBound ?? ((value) => {
4360
+ if (value !== void 0 && value.length > 400) throw new Error("Knowledge node description exceeds the 400 UTF-16 code unit limit");
4361
+ });
4362
+ assertDescriptionWithinBound = resolvedAssert;
4363
+ assertWithinBound = resolvedAssert;
4364
+ }
4365
+ assertWithinBound(description);
4366
+ }
4355
4367
  const cloneScope = (scope) => [...scope];
4356
4368
  const canonicalName = (name) => name.trim().toLocaleLowerCase();
4357
4369
  const nodeReferenceId = (node) => typeof node === "string" ? node : node.id;
@@ -4485,7 +4497,7 @@ var KnowledgeMongoDB = class KnowledgeMongoDB extends _mastra_core_storage.Knowl
4485
4497
  });
4486
4498
  }
4487
4499
  async createNode(input) {
4488
- (0, _mastra_core_storage.assertKnowledgeDescriptionWithinBound)(input.description);
4500
+ await assertKnowledgeDescriptionWithinBoundCompat(input.description);
4489
4501
  const scope = (0, _mastra_core_storage.canonicalizeKnowledgeScope)(input.scope);
4490
4502
  return this.#connector.withTransaction(async (session) => {
4491
4503
  const existing = await this.#getNodeByName(input.name, scope, session);
@@ -4563,7 +4575,7 @@ var KnowledgeMongoDB = class KnowledgeMongoDB extends _mastra_core_storage.Knowl
4563
4575
  }).limit(input.limit ?? 100).toArray()).map(nodeFromDocument);
4564
4576
  }
4565
4577
  async updateNode(input) {
4566
- (0, _mastra_core_storage.assertKnowledgeDescriptionWithinBound)(input.description);
4578
+ await assertKnowledgeDescriptionWithinBoundCompat(input.description);
4567
4579
  return this.#connector.withTransaction(async (session) => {
4568
4580
  const existing = await this.#getNode(input.id, session);
4569
4581
  if (!existing) throw new _mastra_core_storage.KnowledgeNotFoundError("node", input.id);