@mastra/libsql 0.0.0-knowledge-w1-20261008204450 → 0.0.0-knowledge-w1-20261009033246
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/dist/docs/SKILL.md
CHANGED
|
@@ -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: "0.0.0-knowledge-w1-
|
|
6
|
+
version: "0.0.0-knowledge-w1-20261009033246"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
package/dist/index.cjs
CHANGED
|
@@ -7355,7 +7355,7 @@ var KnowledgeLibSQL = class extends _mastra_core_storage.KnowledgeStorage {
|
|
|
7355
7355
|
input.version
|
|
7356
7356
|
]
|
|
7357
7357
|
})).rowsAffected === 0) throw new _mastra_core_storage.KnowledgeConflictError(input.id);
|
|
7358
|
-
await this.#
|
|
7358
|
+
if ((0, _mastra_core_storage.knowledgeScopeKey)(existing.scope) !== (0, _mastra_core_storage.knowledgeScopeKey)(scope)) await this.#swapIdentityScopes(tx, input.id, existing.scope, scope, now);
|
|
7359
7359
|
if (input.content !== void 0 || input.name !== void 0 || input.scope !== void 0) await this.#replaceMentions(tx, "node", input.id, content ?? "", input.resolutionScope ?? scope, scope);
|
|
7360
7360
|
await this.#activity(tx, "node-updated", "node", input.id, scope);
|
|
7361
7361
|
if ((0, _mastra_core_storage.knowledgeScopeKey)(existing.scope) !== (0, _mastra_core_storage.knowledgeScopeKey)(scope)) {
|
|
@@ -7864,6 +7864,28 @@ var KnowledgeLibSQL = class extends _mastra_core_storage.KnowledgeStorage {
|
|
|
7864
7864
|
});
|
|
7865
7865
|
}
|
|
7866
7866
|
/**
|
|
7867
|
+
* Move a node's identity memberships from `from` to `to` without touching structural
|
|
7868
|
+
* placements added by `#placeNodeInScopes`, which a scope change must not erase.
|
|
7869
|
+
*/
|
|
7870
|
+
async #swapIdentityScopes(executor, nodeId, from, to, addedAt) {
|
|
7871
|
+
const next = await this.#resolveScopeNodeIds(executor, to);
|
|
7872
|
+
for (const scopeNodeId of await this.#resolveScopeNodeIds(executor, from)) {
|
|
7873
|
+
if (next.includes(scopeNodeId)) continue;
|
|
7874
|
+
await executor.execute({
|
|
7875
|
+
sql: `DELETE FROM "${TABLE_KNOWLEDGE_NODE_SCOPES}" WHERE nodeId=? AND scopeNodeId=?`,
|
|
7876
|
+
args: [nodeId, scopeNodeId]
|
|
7877
|
+
});
|
|
7878
|
+
}
|
|
7879
|
+
for (const scopeNodeId of next) await executor.execute({
|
|
7880
|
+
sql: `INSERT OR IGNORE INTO "${TABLE_KNOWLEDGE_NODE_SCOPES}" (nodeId,scopeNodeId,addedAt) VALUES (?,?,?)`,
|
|
7881
|
+
args: [
|
|
7882
|
+
nodeId,
|
|
7883
|
+
scopeNodeId,
|
|
7884
|
+
addedAt.toISOString()
|
|
7885
|
+
]
|
|
7886
|
+
});
|
|
7887
|
+
}
|
|
7888
|
+
/**
|
|
7867
7889
|
* Additive structural placement: every address must resolve to a live scope node
|
|
7868
7890
|
* (unlike identity membership, an unknown address is a caller error, not a lazy
|
|
7869
7891
|
* materialization miss). Runs inside the caller's transaction, so a throw aborts
|