@mastra/libsql 1.7.2 → 1.7.3-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 +92 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/guides-agent-frameworks-ai-sdk.md +3 -3
- package/dist/index.cjs +14 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -7154,7 +7154,7 @@ var MemoryLibSQL = class extends MemoryStorage {
|
|
|
7154
7154
|
const newTokenCount = existingTokenCount + activatedTokens;
|
|
7155
7155
|
const existingPending = Number(row.pendingMessageTokens || 0);
|
|
7156
7156
|
const newPending = Math.max(0, existingPending - activatedMessageTokens);
|
|
7157
|
-
await this.#client.execute({
|
|
7157
|
+
const updateResult = await this.#client.execute({
|
|
7158
7158
|
sql: `UPDATE "${OM_TABLE}" SET
|
|
7159
7159
|
"activeObservations" = ?,
|
|
7160
7160
|
"observationTokenCount" = ?,
|
|
@@ -7162,7 +7162,9 @@ var MemoryLibSQL = class extends MemoryStorage {
|
|
|
7162
7162
|
"bufferedObservationChunks" = ?,
|
|
7163
7163
|
"lastObservedAt" = ?,
|
|
7164
7164
|
"updatedAt" = ?
|
|
7165
|
-
WHERE id =
|
|
7165
|
+
WHERE id = ?
|
|
7166
|
+
AND "bufferedObservationChunks" IS NOT NULL
|
|
7167
|
+
AND "bufferedObservationChunks" != '[]'`,
|
|
7166
7168
|
args: [
|
|
7167
7169
|
newActive,
|
|
7168
7170
|
newTokenCount,
|
|
@@ -7173,6 +7175,16 @@ var MemoryLibSQL = class extends MemoryStorage {
|
|
|
7173
7175
|
input.id
|
|
7174
7176
|
]
|
|
7175
7177
|
});
|
|
7178
|
+
if (updateResult.rowsAffected === 0) {
|
|
7179
|
+
return {
|
|
7180
|
+
chunksActivated: 0,
|
|
7181
|
+
messageTokensActivated: 0,
|
|
7182
|
+
observationTokensActivated: 0,
|
|
7183
|
+
messagesActivated: 0,
|
|
7184
|
+
activatedCycleIds: [],
|
|
7185
|
+
activatedMessageIds: []
|
|
7186
|
+
};
|
|
7187
|
+
}
|
|
7176
7188
|
const latestChunkHints = activatedChunks[activatedChunks.length - 1];
|
|
7177
7189
|
return {
|
|
7178
7190
|
chunksActivated: activatedChunks.length,
|