Add memory-viewer from silicondawn

- Web UI for browsing and editing OpenClaw memory files
- Cloned from https://github.com/silicondawn/memory-viewer
- Built and running on port 8901
- Features: file tree, markdown rendering, search, live reload
- Full access to MEMORY.md, daily notes, skills, automations
This commit is contained in:
Krilly
2026-02-21 02:28:57 +00:00
parent 690a2e31b3
commit c9acf0c4da
78 changed files with 18899 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
import { describe, it, expect } from 'vitest';
import { app } from './index.js';
describe('Server API', () => {
it('GET /api/info returns bot info', async () => {
// Note: This relies on actual file system unless mocked.
// Ideally we mock fs, but for integration test on CI it's fine.
const res = await app.request('/api/info');
expect(res.status).toBe(200);
const data = await res.json();
expect(data).toHaveProperty('version');
});
it('GET /api/agent/status returns structure', async () => {
const res = await app.request('/api/agent/status');
expect(res.status).toBe(200);
const data = await res.json();
expect(data).toHaveProperty('config');
expect(data).toHaveProperty('gateway');
});
});
describe('Backlinks API', () => {
// These tests rely on the actual WORKSPACE directory (~/clawd by default)
// They test the API structure and basic behavior
it('GET /api/resolve-wikilink returns 400 without link', async () => {
const res = await app.request('/api/resolve-wikilink');
expect(res.status).toBe(400);
});
it('GET /api/resolve-wikilink resolves existing file', async () => {
// MEMORY.md should exist in the workspace
const res = await app.request('/api/resolve-wikilink?link=MEMORY');
expect(res.status).toBe(200);
const data = await res.json();
expect(data).toHaveProperty('found');
expect(data).toHaveProperty('path');
});
it('GET /api/resolve-wikilink returns not found for nonexistent', async () => {
const res = await app.request('/api/resolve-wikilink?link=nonexistent-file-that-does-not-exist-12345');
expect(res.status).toBe(200);
const data = await res.json();
expect(data.found).toBe(false);
});
});

File diff suppressed because it is too large Load Diff