@mastra/libsql 1.22.1 → 1.22.2

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,23 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 1.22.2
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
11
+
12
+ ## 1.22.2-alpha.0
13
+
14
+ ### Patch Changes
15
+
16
+ - 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))
17
+
18
+ - Updated dependencies [[`0a9d29c`](https://github.com/mastra-ai/mastra/commit/0a9d29c0c4dbbaa6afc1c8146cdd41759cbd4002)]:
19
+ - @mastra/core@1.63.2-alpha.0
20
+
3
21
  ## 1.22.1
4
22
 
5
23
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-libsql
3
3
  description: Documentation for @mastra/libsql. Use when working with @mastra/libsql APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/libsql"
6
- version: "1.22.1"
6
+ version: "1.22.2"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.22.1",
2
+ "version": "1.22.2",
3
3
  "package": "@mastra/libsql",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -5786,6 +5786,18 @@ var HarnessLibSQL = class HarnessLibSQL extends _mastra_core_storage.HarnessStor
5786
5786
  };
5787
5787
  //#endregion
5788
5788
  //#region src/storage/domains/knowledge/index.ts
5789
+ let assertDescriptionWithinBound;
5790
+ async function assertKnowledgeDescriptionWithinBoundCompat(description) {
5791
+ let assertWithinBound = assertDescriptionWithinBound;
5792
+ if (!assertWithinBound) {
5793
+ const resolvedAssert = (await import("@mastra/core/storage")).assertKnowledgeDescriptionWithinBound ?? ((value) => {
5794
+ if (value !== void 0 && value.length > 400) throw new Error("Knowledge node description exceeds the 400 UTF-16 code unit limit");
5795
+ });
5796
+ assertDescriptionWithinBound = resolvedAssert;
5797
+ assertWithinBound = resolvedAssert;
5798
+ }
5799
+ assertWithinBound(description);
5800
+ }
5789
5801
  const visibleSql = `(scopeKey = ? OR substr(?, 1, length(scopeKey) + 1) = scopeKey || char(31))`;
5790
5802
  function parseJson$3(value) {
5791
5803
  if (typeof value === "string") return JSON.parse(value);
@@ -5951,7 +5963,7 @@ var KnowledgeLibSQL = class extends _mastra_core_storage.KnowledgeStorage {
5951
5963
  });
5952
5964
  }
5953
5965
  async createNode(input) {
5954
- (0, _mastra_core_storage.assertKnowledgeDescriptionWithinBound)(input.description);
5966
+ await assertKnowledgeDescriptionWithinBoundCompat(input.description);
5955
5967
  const scope = (0, _mastra_core_storage.canonicalizeKnowledgeScope)(input.scope);
5956
5968
  return this.#transaction(async (tx) => {
5957
5969
  const existing = await this.#getNodeByName(tx, input.name, scope);
@@ -6039,7 +6051,7 @@ var KnowledgeLibSQL = class extends _mastra_core_storage.KnowledgeStorage {
6039
6051
  })).rows.map(parseNode);
6040
6052
  }
6041
6053
  async updateNode(input) {
6042
- (0, _mastra_core_storage.assertKnowledgeDescriptionWithinBound)(input.description);
6054
+ await assertKnowledgeDescriptionWithinBoundCompat(input.description);
6043
6055
  return this.#transaction(async (tx) => {
6044
6056
  const existing = await this.#getNode(tx, input.id);
6045
6057
  if (!existing) throw new _mastra_core_storage.KnowledgeNotFoundError("node", input.id);