refactor: replace Memento MCP with local memory

This commit is contained in:
Eyejoker
2026-03-31 23:22:50 +09:00
parent 42ed5ef113
commit c76126bd58
8 changed files with 160 additions and 407 deletions

View File

@@ -7,6 +7,7 @@ import {
assignRoom,
createTask,
getAllTasks,
recallMemories,
getRegisteredAgentTypesForJid,
getRegisteredGroup,
getStoredRoomSettings,
@@ -196,6 +197,56 @@ describe('schedule_task authorization', () => {
});
});
describe('persist_memory authorization', () => {
it('allows a room runtime to persist memory for its own room scope', async () => {
await processTaskIpc(
{
type: 'persist_memory',
scopeKind: 'room',
scopeKey: 'room:other-group',
content: 'compact summary',
keywords: ['room:other-group'],
source_kind: 'compact',
source_ref: 'compact:test',
},
'other-group',
false,
deps,
);
const recalled = recallMemories({
scopeKind: 'room',
scopeKey: 'room:other-group',
limit: 10,
});
expect(recalled).toHaveLength(1);
expect(recalled[0].content).toBe('compact summary');
});
it('blocks persist_memory when scopeKey does not match the source group', async () => {
await processTaskIpc(
{
type: 'persist_memory',
scopeKind: 'room',
scopeKey: 'room:third-group',
content: 'should be denied',
keywords: ['room:third-group'],
source_kind: 'compact',
},
'other-group',
false,
deps,
);
const recalled = recallMemories({
scopeKind: 'room',
scopeKey: 'room:third-group',
limit: 10,
});
expect(recalled).toHaveLength(0);
});
});
// --- pause_task authorization ---
describe('pause_task authorization', () => {