Offline Support
AI Supreme Council is a Progressive Web App (PWA) that works offline after the first visit. The entire application is a single HTML file with no external dependencies, so it can be cached completely by the browser's service worker.
Progressive Web App (PWA)
The app registers a service worker (sw.js) that caches all static assets on first load. On subsequent visits, the app loads instantly from cache -- even without an internet connection.
Installing as an App
Chrome / Edge (Desktop):
- Visit aiscouncil.com
- Click the install icon in the address bar (or go to Menu > "Install AI Supreme Council")
- The app opens in its own window, with its own taskbar entry
Chrome / Edge (Android):
- Visit aiscouncil.com
- Tap the browser menu (three dots)
- Select "Add to Home screen" or "Install app"
Safari (iOS / macOS):
- Visit aiscouncil.com
- Tap the Share button
- Select "Add to Home Screen"
When installed as a PWA, the app runs in standalone mode -- no browser chrome, full-screen experience, and it appears as a native app in your task switcher.
Service Worker Caching Strategy
The service worker uses a stale-while-revalidate strategy:
- First visit: All precached assets are downloaded and stored in the cache
- Subsequent visits: The cached version is served immediately (zero network latency), while the service worker fetches an updated version in the background
- Next visit after update: The updated version is served from cache
This means you always get instant load times, and updates arrive silently in the background.
What Gets Cached
The service worker precaches these files on install:
| File | Purpose |
|---|---|
/ | HTML shell (redirects to /index.html) |
/index.html | The complete application (~all JS, CSS, and HTML inline) |
/icon.svg | Vector app icon |
/icon-192.png | 192x192 PNG icon (Android home screen) |
/icon-512.png | 512x512 PNG icon (splash screens, maskable) |
/favicon.ico | Browser tab favicon |
/manifest.webmanifest | PWA manifest (name, icons, theme color) |
Additionally, any same-origin GET request that the app makes will be cached on first fetch and served from cache on subsequent requests (stale-while-revalidate).
What Is NOT Cached
| Resource | Why |
|---|---|
| LLM API calls | These go directly to provider APIs (Anthropic, OpenAI, etc.) and require an internet connection |
| Registry updates | Model registry fetches from GitHub require network, but the app falls back to cached/bundled data |
| Cross-origin resources | Only same-origin requests are cached by the service worker |
| POST/PUT/DELETE requests | Only GET requests are cached |
| API proxy calls | Requests to /v1/* are explicitly excluded from caching |
Offline Capabilities
When offline, you can:
- Browse existing chats -- all chat history is stored locally in IndexedDB
- Manage profiles -- create, edit, and delete bot profiles
- View and change settings -- all settings are in localStorage
- Export data -- download your backup JSON file
- Switch between bots -- all bot configs are stored locally
- Read previous conversations -- full message history available
When offline, you cannot:
- Send new messages -- requires an API call to the LLM provider
- Refresh the model registry -- requires fetching from GitHub
- Sign in -- OAuth requires network connectivity
- Install mini-programs -- requires fetching manifest and entry HTML
Ollama users with a local instance can still chat offline, since Ollama runs on localhost and does not require internet access.
Cache Versioning
The service worker uses a versioned cache name:
const CACHE = 'ais-v1.0.0';
When the version string changes (on a breaking update), the new service worker:
- Creates a new cache with the new name
- Precaches all assets into the new cache
- Deletes all old caches on activation
- Claims all open clients
This ensures that stale cached code is cleaned up after major updates.
Updating the App
Updates happen automatically:
- When you visit the page, the browser checks if
sw.jshas changed - If it has, the new service worker is installed in the background
- On the next page load (or after all tabs are closed and reopened), the new service worker activates
- The new version is now served from cache
To force an immediate update: open DevTools > Application > Service Workers, click "Update" on the registered service worker, then reload the page. Alternatively, hold Shift and click the browser's reload button to bypass the cache.
Web App Manifest
The manifest.webmanifest file defines how the app appears when installed:
{
"name": "AI Supreme Council",
"short_name": "AISCouncil",
"description": "Chat with Claude, GPT, or Grok -- no server, no setup.",
"start_url": "/",
"display": "standalone",
"background_color": "#000000",
"theme_color": "#7c3aed",
"categories": ["productivity", "utilities"],
"icons": [
{ "src": "icon.svg", "sizes": "any", "type": "image/svg+xml" },
{ "src": "icon-192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "icon-512.png", "sizes": "512x512", "type": "image/png" },
{ "src": "icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
]
}
| Field | Value | Purpose |
|---|---|---|
display | standalone | Runs without browser UI (address bar, tabs) |
orientation | any | Works in portrait and landscape |
theme_color | #7c3aed | Purple accent for status bar and title bar |
background_color | #000000 | Splash screen background while app loads |
Troubleshooting
The app shows an old version:
- Open DevTools > Application > Service Workers
- Click "Unregister" on the old service worker
- Reload the page
The app does not work offline:
- Ensure the service worker is registered (DevTools > Application > Service Workers)
- Ensure you have visited the page at least once while online
- Check that the cache exists (DevTools > Application > Cache Storage)
- Some browsers in private/incognito mode disable service workers
The install prompt does not appear:
- The page must be served over HTTPS (or
localhost) - The service worker must be registered and active
- The manifest must be valid and linked in the HTML
<head> - You must have visited the page at least twice with some time between visits (browser heuristic)