@mastra/libsql 1.7.4 → 1.8.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 +22 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +55 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +55 -6
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +3 -2
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @mastra/libsql
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Implemented `updateObservationalMemoryConfig()` in Postgres, LibSQL, and MongoDB storage adapters. This enables per-record config overrides for observational memory thresholds, supporting the new `memory.updateObservationalMemoryConfig()` API in `@mastra/memory`. ([#15115](https://github.com/mastra-ai/mastra/pull/15115))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`f32b9e1`](https://github.com/mastra-ai/mastra/commit/f32b9e115a3c754d1c8cfa3f4256fba87b09cfb7), [`7d6f521`](https://github.com/mastra-ai/mastra/commit/7d6f52164d0cca099f0b07cb2bba334360f1c8ab), [`a50d220`](https://github.com/mastra-ai/mastra/commit/a50d220b01ecbc5644d489a3d446c3bd4ab30245), [`665477b`](https://github.com/mastra-ai/mastra/commit/665477bc104fd52cfef8e7610d7664781a70c220), [`4cc2755`](https://github.com/mastra-ai/mastra/commit/4cc2755a7194cb08720ff2ab4dffb4b4a5103dfd), [`ac7baf6`](https://github.com/mastra-ai/mastra/commit/ac7baf66ef1db15e03975ef4ebb02724f015a391), [`ed425d7`](https://github.com/mastra-ai/mastra/commit/ed425d78e7c66cbda8209fee910856f98c6c6b82), [`1371703`](https://github.com/mastra-ai/mastra/commit/1371703835080450ef3f9aea58059a95d0da2e5a), [`0df8321`](https://github.com/mastra-ai/mastra/commit/0df832196eeb2450ab77ce887e8553abdd44c5a6), [`98f8a8b`](https://github.com/mastra-ai/mastra/commit/98f8a8bdf5761b9982f3ad3acbe7f1cc3efa71f3), [`ba6f7e9`](https://github.com/mastra-ai/mastra/commit/ba6f7e9086d8281393f2acae60fda61de3bff1f9), [`7eb2596`](https://github.com/mastra-ai/mastra/commit/7eb25960d607e07468c9a10c5437abd2deaf1e9a), [`1805ddc`](https://github.com/mastra-ai/mastra/commit/1805ddc9c9b3b14b63749735a13c05a45af43a80), [`fff91cf`](https://github.com/mastra-ai/mastra/commit/fff91cf914de0e731578aacebffdeebef82f0440), [`61109b3`](https://github.com/mastra-ai/mastra/commit/61109b34feb0e38d54bee4b8ca83eb7345b1d557), [`33f1ead`](https://github.com/mastra-ai/mastra/commit/33f1eadfa19c86953f593478e5fa371093b33779)]:
|
|
12
|
+
- @mastra/core@1.23.0
|
|
13
|
+
|
|
14
|
+
## 1.8.0-alpha.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- Implemented `updateObservationalMemoryConfig()` in Postgres, LibSQL, and MongoDB storage adapters. This enables per-record config overrides for observational memory thresholds, supporting the new `memory.updateObservationalMemoryConfig()` API in `@mastra/memory`. ([#15115](https://github.com/mastra-ai/mastra/pull/15115))
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`a50d220`](https://github.com/mastra-ai/mastra/commit/a50d220b01ecbc5644d489a3d446c3bd4ab30245)]:
|
|
23
|
+
- @mastra/core@1.23.0-alpha.9
|
|
24
|
+
|
|
3
25
|
## 1.7.4
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -6557,14 +6557,26 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
6557
6557
|
);
|
|
6558
6558
|
}
|
|
6559
6559
|
}
|
|
6560
|
-
async getObservationalMemoryHistory(threadId, resourceId, limit = 10) {
|
|
6560
|
+
async getObservationalMemoryHistory(threadId, resourceId, limit = 10, options) {
|
|
6561
6561
|
try {
|
|
6562
6562
|
const lookupKey = this.getOMKey(threadId, resourceId);
|
|
6563
|
-
const
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6563
|
+
const conditions = [`"lookupKey" = ?`];
|
|
6564
|
+
const args = [lookupKey];
|
|
6565
|
+
if (options?.from) {
|
|
6566
|
+
conditions.push(`"createdAt" >= ?`);
|
|
6567
|
+
args.push(options.from.toISOString());
|
|
6568
|
+
}
|
|
6569
|
+
if (options?.to) {
|
|
6570
|
+
conditions.push(`"createdAt" <= ?`);
|
|
6571
|
+
args.push(options.to.toISOString());
|
|
6572
|
+
}
|
|
6573
|
+
args.push(limit);
|
|
6574
|
+
let sql = `SELECT * FROM "${OM_TABLE}" WHERE ${conditions.join(" AND ")} ORDER BY "generationCount" DESC LIMIT ?`;
|
|
6575
|
+
if (options?.offset != null) {
|
|
6576
|
+
args.push(options.offset);
|
|
6577
|
+
sql += ` OFFSET ?`;
|
|
6578
|
+
}
|
|
6579
|
+
const result = await this.#client.execute({ sql, args });
|
|
6568
6580
|
if (!result.rows) return [];
|
|
6569
6581
|
return result.rows.map((row) => this.parseOMRow(row));
|
|
6570
6582
|
} catch (error$1) {
|
|
@@ -7034,6 +7046,43 @@ var MemoryLibSQL = class extends storage.MemoryStorage {
|
|
|
7034
7046
|
);
|
|
7035
7047
|
}
|
|
7036
7048
|
}
|
|
7049
|
+
async updateObservationalMemoryConfig(input) {
|
|
7050
|
+
try {
|
|
7051
|
+
const selectResult = await this.#client.execute({
|
|
7052
|
+
sql: `SELECT config FROM "${OM_TABLE}" WHERE id = ?`,
|
|
7053
|
+
args: [input.id]
|
|
7054
|
+
});
|
|
7055
|
+
if (selectResult.rows.length === 0) {
|
|
7056
|
+
throw new error.MastraError({
|
|
7057
|
+
id: storage.createStorageErrorId("LIBSQL", "UPDATE_OM_CONFIG", "NOT_FOUND"),
|
|
7058
|
+
text: `Observational memory record not found: ${input.id}`,
|
|
7059
|
+
domain: error.ErrorDomain.STORAGE,
|
|
7060
|
+
category: error.ErrorCategory.THIRD_PARTY,
|
|
7061
|
+
details: { id: input.id }
|
|
7062
|
+
});
|
|
7063
|
+
}
|
|
7064
|
+
const row = selectResult.rows[0];
|
|
7065
|
+
const existing = row.config ? JSON.parse(row.config) : {};
|
|
7066
|
+
const merged = this.deepMergeConfig(existing, input.config);
|
|
7067
|
+
await this.#client.execute({
|
|
7068
|
+
sql: `UPDATE "${OM_TABLE}" SET config = ?, "updatedAt" = ? WHERE id = ?`,
|
|
7069
|
+
args: [JSON.stringify(merged), (/* @__PURE__ */ new Date()).toISOString(), input.id]
|
|
7070
|
+
});
|
|
7071
|
+
} catch (error$1) {
|
|
7072
|
+
if (error$1 instanceof error.MastraError) {
|
|
7073
|
+
throw error$1;
|
|
7074
|
+
}
|
|
7075
|
+
throw new error.MastraError(
|
|
7076
|
+
{
|
|
7077
|
+
id: storage.createStorageErrorId("LIBSQL", "UPDATE_OM_CONFIG", "FAILED"),
|
|
7078
|
+
domain: error.ErrorDomain.STORAGE,
|
|
7079
|
+
category: error.ErrorCategory.THIRD_PARTY,
|
|
7080
|
+
details: { id: input.id }
|
|
7081
|
+
},
|
|
7082
|
+
error$1
|
|
7083
|
+
);
|
|
7084
|
+
}
|
|
7085
|
+
}
|
|
7037
7086
|
// ============================================
|
|
7038
7087
|
// Async Buffering Methods
|
|
7039
7088
|
// ============================================
|