Spaces:
Sleeping
Sleeping
Commit History
-
Remove custom_headers to allow iframe embedding
- Custom COOP/COEP headers were blocking iframe embedding - Service worker now handles headers client-side conditionally - Direct access: SharedArrayBuffer enabled (AI multi-threaded) - Iframe embed: No headers, AI uses single-threaded mode7593c48 -
fix: detect iframe requests in service worker and skip COOP headers
Modified coi-serviceworker to check Sec-Fetch-Dest header. When the request destination is "iframe", skip adding Cross-Origin-Opener-Policy headers which block iframe embedding. This allows: - Direct access: Full SharedArrayBuffer support with COOP headers - Iframe embedding: Works without COOP (AI uses single-thread mode) Co-Authored-By: Claude <noreply@anthropic.com>a5530bb -
fix: deregister coi-serviceworker in iframe mode
When the page is in an iframe, deregister any existing service worker that was registered from a previous direct visit. This prevents the COEP headers from blocking cross-origin resources in the HF Space iframe. Co-Authored-By: Claude <noreply@anthropic.com>0b5b16e -
fix: skip coi-serviceworker in iframe to allow HF Space embedding
The COOP header (Cross-Origin-Opener-Policy: same-origin) was blocking iframe embedding on huggingface.co/spaces. Now the service worker only registers when not in an iframe. Trade-off: - Direct access: Full SharedArrayBuffer support (faster AI) - Iframe embedding: No SharedArrayBuffer (AI uses single-thread, but works) Co-Authored-By: Claude <noreply@anthropic.com>d182f15
-
fix(docker): improve startup script with better error handling and logging
Added verbose logging to diagnose runtime errors: - Log container startup time and environment - Use curl -f flag to fail on HTTP errors - Report downloaded file sizes - List ONNX directory contents before starting server Co-Authored-By: Claude <noreply@anthropic.com>fa72e90
-
Trigger rebuild with updated timestamp
HF requires ONNX files in LFS, curl download at startup handles this. Co-Authored-By: Claude <noreply@anthropic.com>958f00f -
fix(docker): download LFS files at startup instead of COPY
Docker COPY doesn't resolve Git LFS pointers. Instead, use a startup script to download ONNX files from HuggingFace at container start. This ensures ONNX model files are properly available for VS AI mode. Co-Authored-By: Claude <noreply@anthropic.com>c4a0a71 -
fix(docker): use git clone to properly resolve LFS files
Docker COPY doesn't resolve Git LFS pointers during build. Instead, clone the repo at build time (with git lfs pull) to get actual files. This ensures ONNX model files are properly available in the container. Co-Authored-By: Claude <noreply@anthropic.com>8c8e029 -
fix(docker): install git-lfs to fetch large model files
Added git and git-lfs installation to Docker build to properly resolve LFS pointers for ONNX model files. The COPY command may only get LFS pointers, so we need to explicitly pull the actual files. Co-Authored-By: Claude <noreply@anthropic.com>11efae4 -
fix(docker): use regex instead of require('path') for extension check
Use regex /\.[a-zA-Z0-9]+$/ to detect file extensions in SPA catch-all route, avoiding ESM/CommonJS compatibility issues with require(). Co-Authored-By: Claude <noreply@anthropic.com>b92158e -
fix(docker): add path.extname check to SPA catch-all route
The inline docker-entry.ts now skips files with extensions (.onnx, .wasm), allowing static middleware to serve them correctly. This fixes ONNX model loading on HF Space which was incorrectly returning index.html. Co-Authored-By: Claude <noreply@anthropic.com>55a6cd7 -
fix: exclude static files from SPA catch-all route
Files with extensions (.onnx, .wasm, etc.) now bypass the SPA handler, allowing the static middleware to serve them correctly. This fixes ONNX model loading which was incorrectly returning index.html. Co-Authored-By: Claude <noreply@anthropic.com>001aa74 -
feat: add coi-serviceworker for SharedArrayBuffer support
Enables cross-origin isolation on client side for ONNX Runtime Web multi-threading support without requiring server-side COOP/COEP headers. This fixes VS AI mode which requires SharedArrayBuffer for ONNX inference. Co-Authored-By: Claude <noreply@anthropic.com>f553531 -
chore: trigger rebuild for COOP/COEP headers
cc0f5f7 -
feat: add COOP/COEP headers for SharedArrayBuffer support (VS AI mode)
df482fa -
fix: rebuild frontend dist with room rename feature
eb57696 -
feat: room rename and room switching with confirmation
New features: - Room rename: admins can rename rooms with editable input - Room switching during game: confirmation dialog prevents accidental game abandonment - Auto-resign when leaving active game after confirmation Bug fixes included: - Race conditions in join logic - Reconnect logic to rejoin previous room - Memory leak prevention in socket listeners - Fixed offX() methods undefined handler6f4808d
-
fix(vs-people): enable resign functionality to emit socket event
The resign function was showing confirmation but not actually emitting the resign event. Now properly calls socketApi.resign() for multiplayer. Co-Authored-By: Claude <noreply@anthropic.com>e144fd4 -
fix: sync board shape when joining existing room
When joining an existing room, now properly syncs: - Board shape from server's gameState - Game moves from TGN - Viewport rendering with correct board Co-Authored-By: Claude <noreply@anthropic.com>df4bec6 -
fix: fall back to initializeGame when TGN loading fails
When gameReset event has TGN but parsing fails, now properly falls back to initializeGame() with the server's boardShape. Co-Authored-By: Claude <noreply@anthropic.com>49798bd -
fix: properly apply board shape from server in gameReset event
When server sends gameReset event with new boardShape, now correctly: - Use initializeGame() to create new game with new shape - Update viewport with setBoardShape() - Update board shape dropdown to match Co-Authored-By: Claude <noreply@anthropic.com>b78e8db -
feat(debug): add window.trigoApi for testing
e367b4e -
fix(vs-people): initialize socket listeners when switching game modes
a7d41bc -
Trigger rebuild
a4a9194
-
feat: switch to hash-based routing for better static hosting
- Change router from createWebHistory to createWebHashHistory - Update useRoomHash to use query params instead of hash for room IDs - URLs now: /#/vs-people?room=ABC1234577c3cea -
Deploy: add startup logging to debug VS People mode
f2d331b -
Deploy: include pre-built dist folder in git
- Remove 'dist' from app/.gitignore so pre-built assets are tracked - Update deploy.sh to automatically remove dist from .gitignore - Include frontend dist folder with all assets876d29c -
Deploy: fix build by keeping pre-built dist folder
- Updated deploy.sh to not remove dist folder - Dockerfile expects pre-built frontend assets63a8db2 -
Deploy: fix room selector reactivity bug
- Use spread operator for immutable array updates - Add debug logging for room events - Add hf-autoplay.cjs test script3a12496 -
fix: remove .env.local from Dockerfile (local dev file only)
2aea863 -
Update: fix disconnect state sync and dynamic socket URL
Changes: - Fix room showing "full" after player disconnect - Clean up stale disconnected player entries - Use window.location.origin for dynamic socket URL - Add Vite proxy for socket.io support - Rebuild frontend with latest changes Co-Authored-By: Claude <noreply@anthropic.com>f6a5e63
-
Fix: Docker-specific entry point with correct paths
172c3de -
Test: run TypeScript directly with tsx
006b994 -
Fix: add node_modules symlinks for module resolution
255c58f -
Test: full esbuild bundle with external deps
654dfbb -
Test: Express + Socket.io server
aba34fa -
Test: simple Express ESM server to verify module resolution
cb658ec -
Bundle all dependencies (remove --external flags)
48fe432 -
Debug: restore Node server with startup wrapper
1f609d0 -
Test: minimal static file server to debug container startup
e5bc874 -
Debug: add syntax check, install onnxruntime-web for WASM
7e9c04f -
Debug: add file verification, remove unneeded public folder copy
e068877 -
Fix .dockerignore: keep WASM files needed for onnxruntime
f4876c1 -
Fix Docker build: copy inc/ before esbuild, allow .env.local
a6949ee -
Use .dockerignore to exclude LFS files (WASM, ONNX)
- Add LFS file patterns to .dockerignore - Simplify Dockerfile to copy entire directories - LFS files will be excluded automatically Co-Authored-By: Claude <noreply@anthropic.com>1383f8e -
Force rebuild with new timestamp
Co-Authored-By: Claude <noreply@anthropic.com>6961147 -
Skip LFS files (ONNX, WASM) - copy only essential frontend files
LFS files don't work properly in Docker builds. Skip them for now - app will work for basic gameplay without AI. Co-Authored-By: Claude <noreply@anthropic.com>fc1befc -
Add error handling to diagnose cp failure
Show directory contents if cp fails. Co-Authored-By: Claude <noreply@anthropic.com>cfb16ef -
Create app directory before copying dist
mkdir -p app before cp -r. Co-Authored-By: Claude <noreply@anthropic.com>4ee4b23 -
Add debug output for cloned repo contents
Check what's in the cloned repo after git lfs pull. Co-Authored-By: Claude <noreply@anthropic.com>2548820