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

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -0,0 +1,21 @@
{
"name": "Memory Viewer",
"short_name": "Memory",
"description": "Browse and edit your AI agent's memory files",
"start_url": "/",
"display": "standalone",
"background_color": "#030712",
"theme_color": "#030712",
"icons": [
{
"src": "/icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/icon-512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

View File

@@ -0,0 +1,60 @@
const CACHE_NAME = 'memory-viewer-v1';
const STATIC_ASSETS = ['/'];
// Install: cache shell
self.addEventListener('install', (e) => {
e.waitUntil(
caches.open(CACHE_NAME).then((cache) => cache.addAll(STATIC_ASSETS))
);
self.skipWaiting();
});
// Activate: clean old caches
self.addEventListener('activate', (e) => {
e.waitUntil(
caches.keys().then((keys) =>
Promise.all(keys.filter((k) => k !== CACHE_NAME).map((k) => caches.delete(k)))
)
);
self.clients.claim();
});
// Fetch: network-first for API, cache-first for assets
self.addEventListener('fetch', (e) => {
const url = new URL(e.request.url);
// API calls: network only
if (url.pathname.startsWith('/api/') || url.pathname.startsWith('/ws')) {
return;
}
// Assets with hash in filename: cache-first (immutable)
if (url.pathname.startsWith('/assets/') && url.pathname.match(/\-[a-zA-Z0-9_-]{8}\./)) {
e.respondWith(
caches.match(e.request).then((cached) => {
if (cached) return cached;
return fetch(e.request).then((resp) => {
if (resp.ok) {
const clone = resp.clone();
caches.open(CACHE_NAME).then((cache) => cache.put(e.request, clone));
}
return resp;
});
})
);
return;
}
// HTML: network-first, fallback to cache
e.respondWith(
fetch(e.request)
.then((resp) => {
if (resp.ok) {
const clone = resp.clone();
caches.open(CACHE_NAME).then((cache) => cache.put(e.request, clone));
}
return resp;
})
.catch(() => caches.match(e.request))
);
});