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:
41
memory-viewer/server-dist/api.test.js
Normal file
41
memory-viewer/server-dist/api.test.js
Normal 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);
|
||||
});
|
||||
});
|
||||
1134
memory-viewer/server-dist/index.js
Normal file
1134
memory-viewer/server-dist/index.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user