feat(memory): add opt-in scoped memory tools

This commit is contained in:
sargatxet committed 2026-10-08 14:18:29 +02:00
1 parent cd09ed531d
commit e4e56db488
14 files changed
+618 -5

No files matched your search

+16
View File
@@ -28,6 +28,14 @@ test("does not duplicate an already configured package plugin", () => {
assert.equal(result.content, original)
})
test("recognizes an object-form plugin entry without replacing its options", () => {
const original = JSON.stringify({ plugins: [{ package: pluginName, options: { memory: { enabled: true } } }] }, null, 2)
const result = addPlugin(original, pluginName)
assert.equal(result.added, false)
assert.equal(result.content, original)
})
test("removes only the requested package plugin", () => {
const original = JSON.stringify({ plugins: ["other-plugin", pluginName] }, null, 2)
const result = removePlugin(original, pluginName)
@@ -36,6 +44,14 @@ test("removes only the requested package plugin", () => {
assert.deepEqual(JSON.parse(result.content).plugins, ["other-plugin"])
})
test("preserves an object-form plugin entry because it may contain user options", () => {
const original = JSON.stringify({ plugins: [{ package: pluginName, options: { memory: { enabled: true } } }] }, null, 2)
const result = removePlugin(original, pluginName)
assert.equal(result.removed, false)
assert.equal(result.content, original)
})
test("replaces a managed plugin entry while preserving JSONC comments", () => {
const original = `{
"plugins": [