Skip to main content
Glama
memory.test.ts2.87 kB
import { describe, it, expect } from 'vitest'; import { CORE_MEMORY_NAMES, MEMORY_HIERARCHY, InitToolSchema, ReadToolSchema, UpdateToolSchema, SearchToolSchema, } from '../src/types/memory-v5.js'; describe('Memory Types v5', () => { describe('Core Memory Names', () => { it('should have all 7 core memory names', () => { expect(CORE_MEMORY_NAMES).toContain('projectbrief'); expect(CORE_MEMORY_NAMES).toContain('productContext'); expect(CORE_MEMORY_NAMES).toContain('activeContext'); expect(CORE_MEMORY_NAMES).toContain('systemPatterns'); expect(CORE_MEMORY_NAMES).toContain('techContext'); expect(CORE_MEMORY_NAMES).toContain('progress'); expect(CORE_MEMORY_NAMES).toContain('codebaseMap'); expect(CORE_MEMORY_NAMES).toHaveLength(7); // Cline's 7 core memories }); }); describe('Memory Hierarchy', () => { it('should have proper dependency structure', () => { expect(MEMORY_HIERARCHY.projectbrief.dependsOn).toEqual([]); expect(MEMORY_HIERARCHY.productContext.dependsOn).toContain('projectbrief'); expect(MEMORY_HIERARCHY.activeContext.dependsOn).toContain('productContext'); }); }); describe('Schema Validation', () => { it('should validate init tool schema', () => { const validInit = { projectPath: '/test/path', projectName: 'Test Project', }; expect(() => InitToolSchema.parse(validInit)).not.toThrow(); expect(() => InitToolSchema.parse({})).not.toThrow(); // all optional }); it('should validate read tool schema', () => { const validRead = { memoryName: 'projectbrief', projectPath: '/test/path', }; expect(() => ReadToolSchema.parse(validRead)).not.toThrow(); expect(() => ReadToolSchema.parse({ memoryName: 'activeContext' })).not.toThrow(); }); it('should validate update tool schema', () => { const validUpdate = { memoryName: 'activeContext', content: '# Active Context\nTest content', projectPath: '/test/path', }; expect(() => UpdateToolSchema.parse(validUpdate)).not.toThrow(); expect(() => UpdateToolSchema.parse({ memoryName: 'progress', content: 'Test content' })).not.toThrow(); }); it('should validate search tool schema with defaults', () => { const validSearch = { query: 'test query', }; const parsed = SearchToolSchema.parse(validSearch); expect(parsed.limit).toBe(10); expect(parsed.query).toBe('test query'); }); it('should validate search tool schema with code search', () => { const validSearch = { query: 'test query', codeSearch: 'similar', language: 'typescript', }; expect(() => SearchToolSchema.parse(validSearch)).not.toThrow(); }); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/romiluz13/memory-engineering-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server