Commit Graph

690 Commits

Author SHA1 Message Date
Jeff Emmett b438c33ae2 Replace CLAUDE.md symlink with actual file for Docker compatibility
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 02:29:06 -08:00
Jeff Emmett 411994d9a4 fix: make Markdown tool dark mode reactive to theme changes
- Replace useMemo with useState + MutationObserver for isDarkMode detection
- Add MDXEditor's built-in 'dark-theme' class for proper toolbar/icon theming
- Theme now switches instantly when user toggles dark/light mode

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:57:25 -08:00
Jeff Emmett 045a2baef8 Fix Traefik routing - use single service for multiple routers
Traefik cannot auto-link routers when multiple services are defined.
Fixed by using a single service (canvas) that both routers explicitly
reference via the .service label.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:52:41 -08:00
Jeff Emmett d605d25e6e Create task task-high.02 2025-12-03 22:35:50 -08:00
Jeff Emmett dbad316f85 Create task task-high.01 2025-12-03 22:34:45 -08:00
Jeff Emmett 846816b1aa Add production Traefik labels for jeffemmett.com
- Add router rules for jeffemmett.com and www.jeffemmett.com
- Keep staging.jeffemmett.com for testing
- Preparing for migration from Cloudflare Pages to Docker deployment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:34:34 -08:00
Jeff Emmett 2aeb2b0c34 Update task task-013 2025-12-03 22:29:46 -08:00
Jeff Emmett 3b0a05d78a Create task task-013 2025-12-03 22:29:30 -08:00
Jeff Emmett 8e77b84807 Update task task-012 2025-12-03 22:29:14 -08:00
Jeff Emmett c128d67b9f Fix npm peer dependency conflict with --legacy-peer-deps 2025-12-03 22:06:09 -08:00
Jeff Emmett aa6d160aea Add Docker configuration for self-hosted deployment
- Dockerfile: Multi-stage build with Vite frontend, nginx for serving
- nginx.conf: SPA routing, gzip, security headers
- docker-compose.yml: Traefik labels for staging.jeffemmett.com

Backend sync still uses Cloudflare Workers (jeffemmett-canvas.jeffemmett.workers.dev)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 22:03:25 -08:00
Jeff Emmett b183a4f7ea Add backlog tasks from worktrees and feature branches
- task-002: RunPod AI API Integration (worktree: add-runpod-AI-API)
- task-003: MulTmux Web Integration (worktree: mulTmux-webtree)
- task-004: IO Chip Feature (worktree: feature/io-chip)
- task-005: Automerge CRDT Sync
- task-006: Stripe Payment Integration
- task-007: Web3 Integration
- task-008: Audio Recording Feature
- task-009: Web Speech API Transcription
- task-010: Holon Integration
- task-011: Terminal Tool
- task-012: Dark Mode Theme

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 21:56:54 -08:00
Jeff Emmett 696d6f24bb Create task task-001 2025-12-03 15:42:13 -08:00
Jeff Emmett c5784cfd5a feat: standardize tool shapes with pin functionality and UI improvements
- Add pin functionality to ImageGen and VideoGen shapes
- Refactor ImageGen to use StandardizedToolWrapper with tags support
- Update StandardizedToolWrapper: grey tags, fix button overlap, improve header drag
- Fix index validation in AutomergeToTLStore for old format indices
- Update wrangler.toml with latest compatibility date and RunPod endpoint docs
- Refactor VideoGen to use captured editor reference for consistency

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 21:14:51 -08:00
Jeff Emmett 5a22786195 fix: sanitize shape indices and improve RunPod error handling
- Add index sanitization in Board.tsx to fix "Expected an index key"
  validation errors when selecting shapes with old format indices
- Improve RunPod error handling to properly display status messages
  (IN_PROGRESS, IN_QUEUE, FAILED) instead of generic errors
- Update wrangler.toml with current compatibility date and document
  RunPod endpoint configuration for reference
- Add sanitizeIndex helper function to convert invalid indices like
  "b1" to valid tldraw fractional indices like "a1"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 20:26:51 -08:00
Jeff Emmett e0f8107e1d fix: increase VideoGen timeout to 6 minutes for GPU cold starts
Video generation on RunPod can take significant time:
- GPU cold start: 30-120 seconds
- Model loading: 30-60 seconds
- Generation: 60-180 seconds

Increased polling timeout from 4 to 6 minutes and updated UI
to set proper expectations for users.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 18:51:41 -08:00
Jeff Emmett 1b234d9dda feat: add default RunPod endpoints for all AI services
All RunPod API functions now have hardcoded fallback values so
every user can access AI features without needing their own keys:

- Image Generation: Automatic1111 endpoint (tzf1j3sc3zufsy)
- Video Generation: Wan2.2 endpoint (4jql4l7l0yw0f3)
- Text Generation: vLLM endpoint (03g5hz3hlo8gr2)
- Transcription: Whisper endpoint (lrtisuv8ixbtub)
- Ollama: Netcup AI Orchestrator (ai.jeffemmett.com)

This ensures ImageGen, VideoGen, Mycelial Intelligence, and
transcription work for all users of the canvas out of the box.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 18:41:21 -08:00
Jeff Emmett b561640494 feat: add default AI endpoints for all users
Hardcoded fallback values for Ollama and RunPod text endpoints so
that all users have access to AI features without needing to
configure their own API keys:

- Ollama: defaults to https://ai.jeffemmett.com (Netcup AI Orchestrator)
- RunPod Text: defaults to pre-configured vLLM endpoint

This ensures Mycelial Intelligence works for everyone out of the box.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 18:38:09 -08:00
Jeff Emmett 9dc0433bf2 fix: register FathomNoteShape in customShapeUtils
The FathomNote shape was being created by FathomMeetingsBrowserShape
but wasn't registered with tldraw, causing "No shape util found for
type FathomNote" errors when loading canvases with Fathom notes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 16:22:23 -07:00
Jeff Emmett 6167276344 fix: improve index migration to handle all invalid formats
- Added isValidTldrawIndex() function to properly validate tldraw
  fractional indices (e.g., "a1", "a1V" are valid, "b1", "c1" are not)
- Apply migration to IndexedDB data as well as server data
- This fixes ValidationError when loading old data with invalid indices

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 16:19:30 -07:00
Jeff Emmett 139abcb5f2 fix: override sharp to 0.33.5 for Cloudflare Pages compatibility
Sharp 0.33.5 has prebuilt binaries for linux-x64 while the older
0.32.x version in @xenova/transformers requires native compilation.
Using npm overrides to force 0.33.5 throughout the dependency tree.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:15:32 -08:00
Jeff Emmett ee13540646 fix: skip optional deps to avoid sharp compilation on Cloudflare Pages
Added omit=optional to .npmrc to prevent @xenova/transformers from
trying to compile sharp with native dependencies. Sharp is only used
for server-side image processing which isn't needed in the browser.

Also added override for sharp version in package.json as fallback.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 23:03:36 -08:00
Jeff Emmett 3f0fb1f85d fix: migrate invalid shape indices in old data
Adds migrateStoreData() function to fix ValidationError when loading
old data with invalid index keys (e.g., 'b1' instead of fractional
indices like 'a1V'). The migration detects invalid indices and
regenerates valid ones using tldraw's getIndexAbove().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 22:40:21 -08:00
Jeff Emmett 25357871d8 fix: handle corrupted shapes causing "No nearest point found" errors
- Add cleanup routine on editor mount to remove corrupted draw/line shapes
  that have no points/segments (these cause geometry errors)
- Add global error handler to suppress geometry errors from tldraw
  instead of crashing the entire app
- Both fixes ensure old JSON data with corrupted shapes loads gracefully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 22:21:24 -08:00
Jeff Emmett ef3b5e7d0a fix: resolve TypeScript errors for Cloudflare Pages build
- Fix undefined 'result' variable reference in useWhisperTranscriptionSimple.ts
- Add type guards for array checks in ImageGenShapeUtil.tsx output handling
- Add Record<string, any> type assertions for response.json() calls in llmUtils.ts
- Remove unused 'isDark' parameter from MicrophoneIcon component
- Remove unused 'index' parameter in components.tsx map callback

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 21:51:54 -08:00
Jeff Emmett 3738b9c56b feat: fix Holon shape H3 validation + offline persistence + geometry error handling
Holon Shape Improvements:
- Add H3 cell ID validation before connecting to Holosphere
- Extract coordinates and resolution from H3 cell IDs automatically
- Improve data rendering with proper lens/item structure display
- Add "Generate H3 Cell" button for quick cell ID creation
- Update placeholders and error messages for H3 format
- Fix HolonBrowser validation and placeholder text

Geometry Error Fix:
- Add try-catch in ClickPropagator.eventHandler for shapes with invalid paths
- Add try-catch in CmdK for getShapesAtPoint geometry errors
- Prevents "No nearest point found" crashes from corrupted draw/line shapes

Offline Persistence:
- Add IndexedDB storage adapter for Automerge documents
- Implement document ID mapping for room persistence
- Merge local and server data on reconnection
- Support offline editing with automatic sync

Other Changes:
- Update .env.example with Ollama and RunPod configuration
- Add multmux Docker configuration files
- UI styling improvements for toolbar and share zone
- Remove auto-creation of MycelialIntelligence shape (now permanent UI bar)
- Various shape utility minor fixes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 21:36:02 -08:00
Jeff Emmett 144f5365c1 feat: move Mycelial Intelligence to permanent UI bar + fix ImageGen RunPod API
- Mycelial Intelligence UI refactor:
  - Created permanent floating bar at top of screen (MycelialIntelligenceBar.tsx)
  - Bar stays fixed and doesn't zoom with canvas
  - Collapses when clicking outside
  - Removed from toolbar tool menu
  - Added deprecated shape stub for backwards compatibility with old boards

- ImageGen RunPod fix:
  - Changed from async /run to sync /runsync endpoint
  - Fixed output parsing for output.images array format with base64

- Other updates:
  - Added FocusLockIndicator and UserSettingsModal UI components
  - mulTmux server and shape updates
  - Automerge sync and store improvements
  - Various CSS and UI refinements

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 23:57:26 -08:00
Jeff Emmett 30e2219551 feat: add Ollama private AI integration with model selection
- Add Ollama as priority AI provider (FREE, self-hosted)
- Add model selection UI in Settings dialog
- Support for multiple models: Llama 3.1 70B, Devstral, Qwen Coder, etc.
- Ollama server configured at http://159.195.32.209:11434
- Models dropdown shows quality vs speed tradeoffs
- Falls back to RunPod/cloud providers when Ollama unavailable

Models available:
- llama3.1:70b (Best quality, ~7s)
- devstral (Best for coding agents)
- qwen2.5-coder:7b (Fast coding)
- llama3.1:8b (Balanced)
- llama3.2:3b (Fastest)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 14:47:07 -08:00
Jeff Emmett 580598295b Merge branch 'mulTmux-webtree' - add collaborative terminal tool
Combines RunPod AI integration (ImageGen, VideoGen) with mulTmux
collaborative terminal functionality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 04:13:37 -08:00
Jeff Emmett 7eb60ebcf2 feat: update mulTmux terminal tool and improve shape utilities
Updates to collaborative terminal integration and various shape
improvements across the canvas.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 04:08:08 -08:00
Jeff Emmett d784b732e1 Merge branch 'add-runpod-AI-API' - RunPod AI integration with image and video generation 2025-11-26 03:54:54 -08:00
Jeff Emmett 78bd12a1d5 feat: add direct RunPod integration for video generation
- Add RunPod config helpers for image, video, text, whisper endpoints
- Update VideoGenShapeUtil to call RunPod video endpoint directly
- Add Ollama URL config for local LLM support
- Remove dependency on AI orchestrator backend (not yet built)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 03:52:01 -08:00
Jeff Emmett b502a08c62 Implement offline storage with IndexedDB for canvas documents
- Add @automerge/automerge-repo-storage-indexeddb for local persistence
- Create documentIdMapping utility to track roomId → documentId in IndexedDB
- Update useAutomergeSyncRepo with offline-first loading strategy:
  - Load from IndexedDB first for instant access
  - Sync with server in background when online
  - Track connection status (online/offline/syncing)
- Add OfflineIndicator component to show connection state
- Integrate offline indicator into Board component

Documents are now cached locally and available offline. Automerge CRDT
handles conflict resolution when syncing back online.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 03:03:37 -08:00
Jeff Emmett 9a53d65416 feat: add video generation and AI orchestrator client
- Add VideoGenShapeUtil with StandardizedToolWrapper for consistent UI
- Add VideoGenTool for canvas video generation
- Add AI Orchestrator client library for smart routing to RS 8000/RunPod
- Register new shapes and tools in Board.tsx
- Add deployment guides and migration documentation
- Ollama deployed on Netcup RS 8000 at 159.195.32.209:11434

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 02:56:55 -08:00
Jeff Emmett 1aec51e97b feat: add mulTmux collaborative terminal tool
Add mulTmux as an integrated workspace in canvas-website project:

- Node.js/TypeScript backend with tmux session management
- CLI client with blessed-based terminal UI
- WebSocket-based real-time collaboration
- Token-based authentication with invite links
- Session management (create, join, list)
- PM2 deployment scripts for AI server
- nginx reverse proxy configuration
- Workspace integration with npm scripts

Usage:
- npm run multmux:build - Build server and CLI
- npm run multmux:start - Start production server
- multmux create <name> - Create collaborative session
- multmux join <token> - Join existing session

See MULTMUX_INTEGRATION.md for full documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 02:41:03 -08:00
Jeff Emmett 1e55f3a576 Add GitHub to Gitea mirror workflow
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 18:00:44 -08:00
Jeff Emmett 380ea0ad3c perf: optimize bundle size with code splitting and disable sourcemaps
- Split large libraries into separate chunks:
  * tldraw: 1.97 MB → 510 KB gzipped
  * large-utils (gun, webnative): 1.54 MB → 329 KB gzipped
  * markdown editors: 1.52 MB → 438 KB gzipped
  * ml-libs (@xenova/transformers): 1.09 MB → 218 KB gzipped
  * AI SDKs: 182 KB → 42 KB gzipped
  * automerge: 283 KB → 70 KB gzipped

- Disable sourcemaps in production builds
- Main bundle reduced to 616 KB gzipped
- Improves initial page load time with on-demand chunk loading

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 21:03:10 -07:00
Jeff Emmett 08c8cc8d23 feat: add automatic Git worktree creation
Add Git hook and management scripts for automatic worktree creation when branching from main.

## Features

**Automatic Worktree Creation:**
- Post-checkout Git hook automatically creates worktrees for new branches
- Creates worktrees at `../repo-name-branch-name`
- Only activates when branching from main/master
- Smart detection to avoid duplicate worktrees

**Worktree Manager Script:**
- `list` - List all worktrees with branches
- `create <branch>` - Manually create worktree
- `remove <branch>` - Remove worktree
- `clean` - Remove all worktrees except main
- `goto <branch>` - Get path to worktree (for cd)
- `status` - Show git status of all worktrees

## Benefits

- Work on multiple branches simultaneously
- No need to stash when switching branches
- Run dev servers on different branches in parallel
- Compare code across branches easily
- Keep main branch clean

## Files Added

- `.git/hooks/post-checkout` - Auto-creates worktrees on branch creation
- `scripts/worktree-manager.sh` - Manual worktree management CLI
- `WORKTREE_SETUP.md` - Complete documentation and usage guide

## Usage

**Automatic (when branching from main):**
```bash
git checkout -b feature/new-feature
# Worktree automatically created at ../canvas-website-feature-new-feature
```

**Manual:**
```bash
./scripts/worktree-manager.sh create feature/my-feature
./scripts/worktree-manager.sh list
cd $(./scripts/worktree-manager.sh goto feature/my-feature)
```

See WORKTREE_SETUP.md for complete documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 20:55:30 -07:00
Jeff Emmett 495fea2a54 debug: add logging for coordinate defaults during sanitization 2025-11-19 20:25:24 -07:00
Jeff Emmett 6a14361838 fix: migrate geo shapes with props.text during Automerge load
Geo shapes saved before the tldraw schema change have props.text which is
no longer valid. This causes ValidationError on page reload when shapes are
loaded from Automerge:

  "ValidationError: At shape(type = geo).props.text: Unexpected property"

The migration logic was only in JSON import (CustomMainMenu.tsx), but shapes
loading from Automerge also need migration.

This fix adds the props.text → props.richText migration to the sanitizeRecord
function in AutomergeToTLStore.ts, ensuring geo shapes are properly migrated
when loaded from Automerge, matching the behavior during JSON import.

The original text is preserved in meta.text for backward compatibility with
search and other features that reference it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 16:25:58 -07:00
Jeff Emmett e69fcad457 fix: preserve coordinates and convert geo shape text during JSON import
- Fix coordinate collapse bug where shapes were resetting to (0,0)
- Convert geo shape props.text to props.richText (tldraw schema change)
- Preserve text in meta.text for backward compatibility
- Add .nvmrc to enforce Node 20
- Update package.json to require Node >=20.0.0
- Add debug logging for sync and import operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 16:14:23 -07:00
Jeff Emmett ed5628029d fix: use useMemo instead of useState for repo/adapter initialization
Fixed TypeScript error by changing from useState to useMemo for repo and
adapter initialization. This properly exposes the repo and adapter objects
instead of returning a state setter function.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 22:10:55 -07:00
Jeff Emmett f1acd09a4e fix: wait for network adapter to be ready before creating document
Added await for adapter.whenReady() to ensure WebSocket connection is
established before creating the Automerge document. This should enable
the Automerge Repo to properly send binary sync messages when document
changes occur.

Changes:
- Extract adapter from repo initialization to access it
- Wait for adapter.whenReady() before creating document
- Update useEffect dependencies to include adapter and workerUrl

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 22:07:24 -07:00
Jeff Emmett 06aa537e32 fix: restore working Automerge sync from pre-Cloudflare version
Reverted to the proven approach from commit 4dd8b2f where each client
creates its own Automerge document with repo.create(). The Automerge
binary sync protocol handles synchronization between clients through
the WebSocket network adapter, without requiring shared document IDs.

Key changes:
- Each client calls repo.create() to get a unique document
- Initial content loaded from server via HTTP/R2
- Binary sync messages broadcast between clients keep documents in sync
- No need for shared document ID storage/retrieval

This fixes the "Document unavailable" errors and enables real-time
collaboration across multiple board instances.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 21:59:59 -07:00
Jeff Emmett 99466d8c9d fix: simplify Automerge document creation for concurrent access
Removed document ID storage/retrieval logic that was causing "Document unavailable"
errors. Each client now creates its own Automerge document handle and syncs content
via WebSocket binary protocol. This allows multiple boards to load the same room
simultaneously without conflicts.

- Removed /room/:roomId/documentId endpoints usage
- Each client creates document with repo.create()
- Content syncs via Automerge's native binary sync protocol
- Initial content still loaded from server via HTTP

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 21:40:15 -07:00
Jeff Emmett 39d96db3cf fix: add await to repo.find() call
repo.find() returns a Promise<DocHandle>, not DocHandle directly.
Added missing await keyword to fix TypeScript build error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 21:26:42 -07:00
Jeff Emmett c13c0d18e1 fix: handle concurrent Automerge document access with try-catch
When multiple clients try to load the same room simultaneously, repo.find()
throws "Document unavailable" error if the document isn't in the repo yet.
Wrapped repo.find() in try-catch to create a new handle when document isn't
available, allowing multiple boards to load the same page concurrently.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 21:15:56 -07:00
Jeff Emmett 907b96d480 fix: use proper Automerge URL format for repo.find()
The issue was that repo.find() was creating a NEW document instead of
waiting for the existing one to sync from the network.

Changes:
- Use 'automerge:{documentId}' URL format for repo.find()
- Remove try-catch that was creating new documents
- Let repo.find() properly wait for network sync

This ensures all clients use the SAME document ID and can sync in real-time.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 21:00:18 -07:00
Jeff Emmett afa8d8498e fix: handle Document unavailable error with try-catch in repo.find()
When repo.find() is called for a document that exists on the server but not
locally, it throws 'Document unavailable' error. This fix:

- Wraps repo.find() in try-catch block
- Falls back to creating new handle if document not found
- Allows sync adapter to merge with server state via network

This handles the case where clients join existing rooms and need to sync
documents from the network.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 20:33:31 -07:00
Jeff Emmett e96e6480fe refactor: remove OddJS dependency and fix Automerge sync
Major Changes:
- Fix Automerge "Document unavailable" error by awaiting repo.find()
- Remove @oddjs/odd package and all related dependencies (205 packages)
- Remove location sharing features (OddJS filesystem-dependent)
- Simplify auth to use only CryptoAuthService (WebCryptoAPI-based)

Auth System Changes:
- Refactor AuthService to remove OddJS filesystem integration
- Update AuthContext to remove FileSystem references
- Delete unused auth files (account.ts, backup.ts, linking.ts)
- Delete unused auth components (Register.tsx, LinkDevice.tsx)

Location Features Removed:
- Delete all location components and routes
- Remove LocationShareShape from shape registry
- Clean up location references across codebase

Documentation Updates:
- Update WEBCRYPTO_AUTH.md to remove OddJS references
- Correct component names (CryptoLogin → CryptID)
- Update file structure and dependencies
- Fix Automerge README WebSocket path documentation

Build System:
- Successfully builds without OddJS dependencies
- All TypeScript errors resolved
- Production bundle size optimized

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 20:19:02 -07:00