メインコンテンツまでスキップ

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):

  1. Visit aiscouncil.com
  2. Click the install icon in the address bar (or go to Menu > "Install AI Supreme Council")
  3. The app opens in its own window, with its own taskbar entry

Chrome / Edge (Android):

  1. Visit aiscouncil.com
  2. Tap the browser menu (three dots)
  3. Select "Add to Home screen" or "Install app"

Safari (iOS / macOS):

  1. Visit aiscouncil.com
  2. Tap the Share button
  3. 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:

  1. First visit: All precached assets are downloaded and stored in the cache
  2. Subsequent visits: The cached version is served immediately (zero network latency), while the service worker fetches an updated version in the background
  3. 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:

FilePurpose
/HTML shell (redirects to /index.html)
/index.htmlThe complete application (~all JS, CSS, and HTML inline)
/icon.svgVector app icon
/icon-192.png192x192 PNG icon (Android home screen)
/icon-512.png512x512 PNG icon (splash screens, maskable)
/favicon.icoBrowser tab favicon
/manifest.webmanifestPWA 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

ResourceWhy
LLM API callsThese go directly to provider APIs (Anthropic, OpenAI, etc.) and require an internet connection
Registry updatesModel registry fetches from GitHub require network, but the app falls back to cached/bundled data
Cross-origin resourcesOnly same-origin requests are cached by the service worker
POST/PUT/DELETE requestsOnly GET requests are cached
API proxy callsRequests 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:

  1. Creates a new cache with the new name
  2. Precaches all assets into the new cache
  3. Deletes all old caches on activation
  4. Claims all open clients

This ensures that stale cached code is cleaned up after major updates.

Updating the App

Updates happen automatically:

  1. When you visit the page, the browser checks if sw.js has changed
  2. If it has, the new service worker is installed in the background
  3. On the next page load (or after all tabs are closed and reopened), the new service worker activates
  4. The new version is now served from cache
Force Update

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" }
]
}
FieldValuePurpose
displaystandaloneRuns without browser UI (address bar, tabs)
orientationanyWorks in portrait and landscape
theme_color#7c3aedPurple accent for status bar and title bar
background_color#000000Splash 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)