Rip out Theia, ship P5.1 attach E2E + Justine UI work-in-progress
Theia rip-out: - Delete app/api/theia-auth/route.ts (Traefik ForwardAuth shim) - Delete app/api/projects/[projectId]/workspace/route.ts and app/api/projects/prewarm/route.ts (Cloud Run Theia provisioning) - Delete lib/cloud-run-workspace.ts and lib/coolify-workspace.ts - Strip provisionTheiaWorkspace + theiaWorkspaceUrl/theiaAppUuid/ theiaError from app/api/projects/create/route.ts response - Remove Theia callbackUrl branch in app/auth/page.tsx - Drop "Open in Theia" button + xterm/Theia PTY copy in build/page.tsx - Drop theiaWorkspaceUrl from deployment/page.tsx Project type - Strip Theia IDE line + theia-code-os from advisor + agent-chat context strings - Scrub Theia mention from lib/auth/workspace-auth.ts comment P5.1 (custom apex domains + DNS): - lib/coolify.ts + lib/opensrs.ts: nameserver normalization, OpenSRS XML auth, Cloud DNS plumbing - scripts/smoke-attach-e2e.ts: full prod GCP + sandbox OpenSRS + prod Coolify smoke covering register/zone/A/NS/PATCH/cleanup In-progress (Justine onboarding/build, MVP setup, agent telemetry): - New (justine)/stories, project (home) layouts, mvp-setup, run, tasks routes + supporting components - Project shell + sidebar + nav refactor for the Stackless palette - Agent session API hardening (sessions, events, stream, approve, retry, stop) + atlas-chat, advisor, design-surfaces refresh - New scripts/sync-db-url-from-coolify.mjs + scripts/prisma-db-push.mjs + docker-compose.local-db.yml for local Prisma workflows - lib/dev-bypass.ts, lib/chat-context-refs.ts, lib/prd-sections.ts - Misc: stories CSS, debug/prisma route, modal-theme, BuildLivePlanPanel Made-with: Cursor
This commit is contained in:
42
public/sw.js
42
public/sw.js
@@ -1,38 +1,43 @@
|
||||
// VIBN Service Worker — enables PWA install + basic offline shell
|
||||
// VIBN Service Worker — PWA shell (production). Must always resolve respondWith to a Response.
|
||||
const CACHE = 'vibn-v1';
|
||||
|
||||
// Cache the app shell on install
|
||||
self.addEventListener('install', (e) => {
|
||||
e.waitUntil(
|
||||
caches.open(CACHE).then(cache =>
|
||||
cache.addAll(['/', '/manifest.json'])
|
||||
)
|
||||
caches.open(CACHE).then((cache) => cache.addAll(['/', '/manifest.json']))
|
||||
);
|
||||
self.skipWaiting();
|
||||
});
|
||||
|
||||
self.addEventListener('activate', () => self.clients.claim());
|
||||
|
||||
// Network-first for API calls, cache-first for static assets
|
||||
self.addEventListener('fetch', (e) => {
|
||||
const { request } = e;
|
||||
const url = new URL(request.url);
|
||||
|
||||
// Never cache API calls
|
||||
if (url.pathname.startsWith('/api/')) return;
|
||||
// Let the browser handle Next.js RSC, Turbopack/HMR, and dev endpoints — do not intercept.
|
||||
if (
|
||||
url.pathname.startsWith('/_next/') ||
|
||||
url.pathname.includes('__nextjs') ||
|
||||
url.search.includes('_rsc=')
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (url.pathname.startsWith('/api/')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Cache-first for static assets
|
||||
if (
|
||||
request.destination === 'image' ||
|
||||
request.destination === 'font' ||
|
||||
url.pathname.startsWith('/_next/static/')
|
||||
) {
|
||||
e.respondWith(
|
||||
caches.match(request).then(cached => {
|
||||
caches.match(request).then((cached) => {
|
||||
if (cached) return cached;
|
||||
return fetch(request).then(res => {
|
||||
return fetch(request).then((res) => {
|
||||
const clone = res.clone();
|
||||
caches.open(CACHE).then(c => c.put(request, clone));
|
||||
caches.open(CACHE).then((c) => c.put(request, clone));
|
||||
return res;
|
||||
});
|
||||
})
|
||||
@@ -40,8 +45,17 @@ self.addEventListener('fetch', (e) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Network-first for everything else (HTML pages)
|
||||
// Network-first; cache fallback must be a real Response (undefined breaks FetchEvent).
|
||||
e.respondWith(
|
||||
fetch(request).catch(() => caches.match(request))
|
||||
fetch(request)
|
||||
.catch(() => caches.match(request))
|
||||
.then((cachedOrFailed) => {
|
||||
if (cachedOrFailed instanceof Response) return cachedOrFailed;
|
||||
return new Response('Offline', {
|
||||
status: 503,
|
||||
statusText: 'Service Unavailable',
|
||||
headers: { 'Content-Type': 'text/plain' },
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user