- PWA shell with service worker offline caching - Encrypted vault using IndexedDB - Lightning/L402 module placeholder - Ollama bridge placeholder - MIT license, no proprietary deps Co-authored-by: Hermes <hermes@nousresearch.com>
6 lines
586 B
JavaScript
6 lines
586 B
JavaScript
const CACHE = 'sovereign-v1';
|
|
const ASSETS = ['./', './index.html'];
|
|
self.addEventListener('install', (e) => { e.waitUntil(caches.open(CACHE).then(c => c.addAll(ASSETS)).then(() => self.skipWaiting())); });
|
|
self.addEventListener('activate', (e) => { e.waitUntil(self.clients.claim()); });
|
|
self.addEventListener('fetch', (e) => { e.respondWith(caches.match(e.request).then(r => r || fetch(e.request).then(res => { if (res.status === 200) { const clone = res.clone(); caches.open(CACHE).then(c => c.put(e.request, clone)); } return res; }).catch(() => caches.match('./index.html'))); });
|