Commit Graph

640 Commits

Author SHA1 Message Date
Jeff Emmett 0aa74f952e Update task task-058 2025-12-25 20:26:35 -05:00
Jeff Emmett 5bad65eed6 feat: add server-side AI service proxies for fal.ai and RunPod
Add proxy endpoints to Cloudflare Worker for AI services, keeping
API credentials server-side for better security architecture.

Changes:
- Add fal.ai proxy endpoints (/api/fal/*) for image generation
- Add RunPod proxy endpoints (/api/runpod/*) for image, video, text, whisper
- Update client code to use proxy pattern:
  - useLiveImage.tsx (fal.ai live image generation)
  - VideoGenShapeUtil.tsx (video generation)
  - ImageGenShapeUtil.tsx (image generation)
  - runpodApi.ts (whisper transcription)
  - llmUtils.ts (LLM text generation)
- Add Environment types for AI service configuration
- Improve Automerge migration: compare shape counts between formats
  to prevent data loss during format conversion

To deploy, set secrets:
  wrangler secret put FAL_API_KEY
  wrangler secret put RUNPOD_API_KEY

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 20:26:04 -05:00
Jeff Emmett fc117299ab Update task task-027 2025-12-25 18:59:45 -05:00
Jeff Emmett 1063ea7730 fix: add debug logging and re-emit peer-candidate for Automerge sync
- Add extensive debug logging to track sync message flow
- Re-emit peer-candidate after documentId is set to trigger Repo sync
- Fix timing issue where peer connected before document existed
- This should enable Automerge binary sync protocol (task-027)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 18:59:21 -05:00
Jeff Emmett 142433669e Update task task-051 2025-12-25 18:38:50 -05:00
Jeff Emmett ad2cb095e0 Update task task-027 2025-12-25 18:38:09 -05:00
Jeff Emmett 0fc80f7496 fix: convert props.text to richText for text shape sync (task-026)
Text shapes arriving from other clients had props.text but the
deserialization code was initializing richText to empty before
deleting props.text, causing content loss.

Added text → richText conversion in AutomergeToTLStore.ts before
the empty initialization, similar to the existing conversion for
geo shapes.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 18:34:52 -05:00
Jeff Emmett 9a4cf18e13 Update task task-058 2025-12-25 18:33:19 -05:00
Jeff Emmett 406d5fb056 Update task task-026 2025-12-25 18:30:28 -05:00
Jeff Emmett 7ce7a9aab6 Create task task-058 2025-12-25 18:30:07 -05:00
Jeff Emmett ccb5acc164 perf: improve loading times with better code splitting
- Improve Vite chunk splitting (Board.js 7.3MB → 5.6MB, 23% smaller)
- Add separate chunks for codemirror, onnx, daily-video, sanitizers
- Enable gzip for wasm and octet-stream in nginx
- Add dns-prefetch and preconnect hints for worker URLs
- Increase gzip compression level to 6

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 23:36:57 -05:00
Jeff Emmett 6f606995a4 feat: update Docker config for VITE_WORKER_ENV support
- Dockerfile now uses VITE_WORKER_ENV instead of hardcoded worker URL
- docker-compose.yml uses VITE_WORKER_ENV=production
- docker-compose.dev.yml uses VITE_WORKER_ENV=staging (points to dev worker)
- Staging site will use jeffemmett-canvas-dev.jeffemmett.workers.dev

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 22:48:27 -05:00
Jeff Emmett f15397d19f fix: correct dev worker URL after deployment
- jeffemmett-canvas-dev.jeffemmett.workers.dev is the actual deployed URL

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 22:45:19 -05:00
Jeff Emmett cf554986a1 feat: add staging environment for Netcup deployment
- Update workerUrl.ts to support staging/dev environments pointing to Cloudflare dev worker
- 'staging' and 'dev' now use jeffemmett-canvas-automerge-dev worker
- 'local' still uses localhost:5172 for local development
- Set VITE_WORKER_ENV=staging when building for Netcup staging

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 22:32:19 -05:00
Jeff Emmett f9208719b0 fix: address multiple runtime issues
- Register missing shape types in Automerge schema (CalendarEvent, HolonBrowser, PrivateWorkspace, GoogleItem, WorkflowBlock)
- Improve connections API error handling to detect HTML responses gracefully
- Clean up Vite config debug logs
- Add static PWA manifest and link to index.html for proper manifest serving

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 21:06:20 -05:00
Jeff Emmett 0d6b62d1c7 fix: remove orphaned debug statements causing build errors
- Remove incomplete console.log cleanup artifacts across 17 files
- Fix orphaned object literals left from previous debug removal
- Prefix unused callback parameters with underscores
- Update Drawfast shape to side-by-side INPUT/OUTPUT layout (900x500)
- Remove unused overlay toggle from Drawfast controls

Files fixed: AutomergeToTLStore, TLStoreToAutomerge, useAutomergeSyncRepo,
FathomMeetingsPanel, NetworkGraphPanel, sessionPersistence, quartzSync,
testClientConfig, useCollaboration, Board, DrawfastShapeUtil,
FathomMeetingsBrowserShapeUtil, MapShapeUtil, FathomMeetingsTool,
HolonTool, overrides, githubSetupValidator

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 19:38:27 -05:00
Jeff Emmett 771840605a chore: remove verbose console.log debug statements
Cleaned up ~280 console.log statements across 64 files:
- Board.tsx: removed permission, auth, and shape visibility debug logs
- useWhisperTranscriptionSimple.ts: removed audio processing debug logs
- Automerge files: removed sync and patch debug logs
- Shape utilities: removed component lifecycle debug logs
- Lib files: removed API and config debug logs

Kept console.error and console.warn for actual error conditions.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 16:32:58 -05:00
Jeff Emmett c6f716bafa fix: add crossOrigin to video element to prevent tainted canvas errors
Videos from fal.media were causing "Tainted canvases may not be exported"
errors when tldraw tried to capture screenshots/exports. Adding crossOrigin="anonymous"
allows the browser to request the video with CORS headers.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 16:29:11 -05:00
Jeff Emmett 4f4555b414 feat: auto-configure FAL API key for Drawfast tool
- Updated LiveImageProvider to use getFalConfig() from clientConfig
- Drawfast now automatically uses the default FAL API key
- Users no longer need to manually enter API key to use the tool

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 11:07:57 -05:00
Jeff Emmett 6cff29e164 feat: disable Holon functionality via HOLON_ENABLED flag
- Added HOLON_ENABLED feature flag (set to false) to completely disable Holon functionality
- HoloSphereService methods now return early with default values when disabled
- Removed all console.log/error output when Holon is disabled
- HolonShapeUtil shows "Feature Disabled" message when flag is false
- HolonBrowser shows disabled message instead of attempting connections
- Code preserved for future Nostr integration re-enablement

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 10:54:13 -05:00
Jeff Emmett bba1f7955a fix: prevent stale cache issues with proper no-cache headers
- Add no-cache headers for index.html, sw.js, registerSW.js, manifest.webmanifest
- Add skipWaiting and clientsClaim to workbox config for immediate SW updates
- This ensures new deployments are picked up immediately without manual cache clearing

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 10:43:25 -05:00
Jeff Emmett 3ff8d5c692 chore: clean up verbose console logs in AuthContext and VideoChatShapeUtil
Removed debug console.log statements while keeping console.error for
actual error conditions. This reduces console noise during normal
operation.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 10:42:14 -05:00
Jeff Emmett c6ed0b77d8 fix: register Calendar and Drawfast shapes in automerge store
Added missing Calendar and Drawfast shapes to the automerge store
schema registration to fix ValidationError when using these tools.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 10:36:51 -05:00
Jeff Emmett c4cb97c0bf chore: disable Multmux, Holon, and MycroZineGenerator tools
Temporarily hiding these tools from context menu and toolbar
until they are in a better working state.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 09:17:50 -05:00
Jeff Emmett 0111f04db2 feat: enable all tools in context menu and toolbar for dev testing
Enabled:
- Drawfast
- Holon
- Multmux/Terminal
- MycroZineGenerator

All tools now available in both the right-click context menu and
the top toolbar for testing on the dev/staging branch.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:31:12 -05:00
Jeff Emmett 0329395362 feat: switch VideoGen from RunPod to fal.ai
- Add fal.ai configuration to clientConfig.ts with default API key
- Update VideoGenShapeUtil to use fal.ai WAN 2.1 endpoints
- I2V mode uses fal-ai/wan-i2v, T2V mode uses fal-ai/wan-t2v
- Much faster startup time (no cold start) vs RunPod
- Processing time reduced from 2-6 min to 30-90 seconds

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 20:31:04 -05:00
Jeff Emmett 79f3d7e96b feat: re-enable VideoGen tool in toolbar and context menu
Re-enabled the video generation tool for testing with the new fal.ai
MCP server backend. The tool was previously hidden while being developed.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 20:22:20 -05:00
Jeff Emmett 5fc505f1fc feat: add Flowy-like workflow builder system
Implements a visual workflow builder with:
- WorkflowBlockShapeUtil: Visual blocks with typed input/output ports
- WorkflowBlockTool: Click-to-place tool for adding blocks
- Block registry with 20+ blocks (triggers, actions, conditions, transformers, AI, outputs)
- Port validation and type compatibility checking
- WorkflowPropagator for real-time data flow between connected blocks
- Workflow executor for manual execution with topological ordering
- WorkflowPalette UI sidebar with searchable block categories
- JSON serialization for workflow export/import
- Workflow templates (API request, LLM chain, conditional)

Blocks are accessible via "Workflow Blocks" button in toolbar dropdown.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 15:45:27 -05:00
Jeff Emmett a938b38d1f fix: use BaseBoxShapeTool for CalendarTool
The custom StateNode click handler wasn't working properly.
Switched to BaseBoxShapeTool like MapTool for reliable click-to-place.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 12:00:17 -05:00
Jeff Emmett 80202b2357 chore: remove broken workflow files temporarily
The Flowy workflow files have TypeScript errors that prevent builds.
Removing them entirely until they can be properly fixed and tested.

Files removed:
- src/components/workflow/
- src/css/workflow.css
- src/lib/workflow/
- src/propagators/WorkflowPropagator.ts
- src/shapes/WorkflowBlockShapeUtil.tsx
- src/tools/WorkflowBlockTool.ts

The commented-out imports in Board.tsx and CustomToolbar.tsx remain
as documentation of what needs to be re-added.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:33:50 -05:00
Jeff Emmett c42d78266e fix: disable Flowy workflow feature temporarily
Workflow Builder (Flowy-style visual workflow blocks) has TypeScript errors.
Temporarily disabling to allow Calendar feature to deploy.

Features disabled:
- WorkflowBlockShape (visual workflow blocks)
- WorkflowBlockTool (click-to-place workflow blocks)
- WorkflowPropagator (real-time data flow between blocks)
- WorkflowPalette (drag-and-drop block palette)

TODO: Fix workflow TypeScript errors and re-enable when ready to test.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:23:32 -05:00
Jeff Emmett 9167342d98 fix: resolve TypeScript build errors for calendar and workflow
- CalendarEventShapeUtil: Fix destructuring (w,h are in props, not shape)
- CalendarPanel: Prefix unused variables with underscore
- YearViewPanel: Prefix unused variables with underscore
- Add missing workflow files (WorkflowPropagator, WorkflowBlockShape, etc.)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:20:15 -05:00
Jeff Emmett fd0196c6a2 feat: add calendar tool to context menu and keyboard shortcuts
- Add Calendar to Create Tool submenu in context menu
- Add Calendar to keyboard shortcuts dialog

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:09:09 -05:00
Jeff Emmett 4bf46a34e6 feat: add unified calendar tool with switchable views
- Add CalendarShapeUtil with view tabs (Browser/Widget/Year)
- Add CalendarTool for placing calendar on canvas
- Add CalendarEventShapeUtil for spawning event cards
- Add CalendarPanel component with month/week views
- Add YearViewPanel component with 12-month grid
- Add useCalendarEvents hook for fetching encrypted calendar data
- Single keyboard shortcut (Ctrl+Alt+K) with in-shape view switching
- Auto-resize when switching between views

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 11:02:13 -05:00
Jeff Emmett 9f2cc9267e fix: resolve content area height issue in StandardizedToolWrapper
- Remove conflicting height calc in contentStyle (was conflicting with flex:1)
- Use minHeight:0 to allow proper flex shrinking
- Add debug logging for pin toggle to diagnose pin button issues

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 22:18:11 -05:00
Jeff Emmett 1bd509de08 chore: temporarily disable MycroZine generator for debugging
Commented out MycroZine generator from toolbar and context menu until
further debugging is completed.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 22:11:13 -05:00
Jeff Emmett 22cd773688 fix: improve onboarding tour first step to show full canvas
- Add noSpotlight option for steps that dim the canvas without a cutout
- Add center placement for viewport-centered tooltips
- Update first step to welcome users to the full canvas space
- Replace arbitrary square highlight with uniform overlay

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 22:09:03 -05:00
Jeff Emmett 3d337fb5fd Update Open Graph metadata with research focus
- Add og-image.jpg (1200x630) for link previews
- Update description to reflect current research areas
- Fix typo in og:description ("doesn't" -> proper description)
- Topics: mycoeconomics, token engineering, psilo-cybernetics,
  zero-knowledge, local-first, institutional neuroplasticity

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 22:09:55 +01:00
Jeff Emmett 7feea26188 feat: upgrade MycroZine generator to use full standalone API
- Use /api/outline for AI-generated 8-page outlines via Gemini
- Use /api/generate-page for individual page image generation
- Use /api/regenerate-page for page regeneration with feedback
- Use /api/print-layout for 300 DPI print-ready layout generation
- Remove legacy local generation functions
- Add proper error handling and API response parsing
- Include folding instructions in completion message

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 08:58:22 -05:00
Jeff Emmett 3cda68370e fix: improve admin request button error handling
- Added adminRequestError state to track request failures
- Parse and display server error messages to user
- Show red error button with retry option on failure
- Display error message below button explaining what went wrong

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-21 00:55:46 -05:00
Jeff Emmett 3a788539f7 fix: make share and settings dropdowns opaque
- Use explicit background colors instead of CSS variables
- Add dark mode detection to ShareBoardButton
- Prevents see-through dropdowns

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 00:01:59 -05:00
Jeff Emmett f2fc6f47d3 fix: register MycroZineGenerator shape with automerge schema
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 23:59:21 -05:00
Jeff Emmett d887a77de5 test: trigger webhook deploy 2025-12-19 23:49:44 -05:00
Jeff Emmett 98d460f95e feat: add Show Tutorial button, temporarily disable NetworkGraphPanel
- Add "Show Tutorial" button to mobile menu to trigger onboarding tour
- Comment out NetworkGraphPanel for main branch (code preserved)
- Add class name to CryptID dropdown for tour targeting

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 18:57:42 -05:00
Jeff Emmett 6a85381a6c feat: add onboarding tooltip tour for new users
- Create 6-step spotlight tour covering key features:
  - Local-first storage
  - Encrypted identity (CryptID)
  - Share & collaborate
  - Creative toolkit
  - Mycelial Intelligence
  - Keyboard shortcuts

- Features:
  - Auto-starts for first-time users (1.5s delay)
  - Spotlight effect with darkened backdrop
  - Keyboard navigation (Escape, arrows, Enter)
  - "Show Tutorial" button in settings (desktop + mobile)
  - Dark mode support
  - Progress dots indicator

- New files: src/ui/OnboardingTour/{index,OnboardingTour,TourTooltip,tourSteps}.ts(x)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 18:10:23 -05:00
Jeff Emmett 09eb17605e feat: mobile UI improvements + staging deployment setup
- Remove anonymous viewer popup (anonymous users can now edit)
- Mobile menu consolidation: gear icon with all menus combined
- Connection status notifications below MI bar (Offline use, Reconnecting, Live)
- Network graph panel starts collapsed on mobile
- MI bar positioned at top on mobile

Deployment:
- Add docker-compose.dev.yml for staging.jeffemmett.com (dev branch)
- Update production docker-compose.yml to remove staging route

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 15:14:05 -05:00
Jeff Emmett db070f47ee fix: resolve Three.js Text component error and modal close issues
- Downgrade three.js from 0.182 to 0.168 to fix customDepthMaterial
  getter-only property breaking change (drei issue #2403)
- Add stable useCallback for modal close handler to prevent
  reference instability
- Improve ESC key handler with ref pattern and capture phase
  to ensure reliable modal closing

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 15:08:55 -05:00
Jeff Emmett 0e7b0aa44f docs: update MycroZine task notes with RunPod proxy fix
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 23:21:24 -05:00
Jeff Emmett 7bfc6ff576 feat: route MycroZine image generation through RunPod proxy
- Updated generatePageImage to use zine.jeffemmett.com API
- Removed direct Gemini API calls (were geo-blocked in EU)
- Now uses RunPod US-based proxy for reliable image generation
- Fixed TypeScript types for API responses

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 23:18:13 -05:00
Jeff Emmett 8cf0bad804 feat: Gemini image generation for MycroZine + Tailscale dev support
MycroZine Generator:
- Implement actual Gemini image generation (replaces placeholders)
- Use Nano Banana Pro (gemini-2.0-flash-exp-image-generation) as primary
- Fallback to Gemini 2.0 Flash experimental
- Graceful degradation to placeholder if no API key

Client Config:
- Add geminiApiKey to ClientConfig interface
- Add isGeminiConfigured() and getGeminiConfig() functions
- Support user-specific API keys from localStorage

Local Development:
- Fix CORS to allow Tailscale IPs (100.x) and all private ranges
- Update cryptidEmailService to use same host for worker URL on local IPs
- Supports localhost, LAN (192.168.x, 10.x, 172.16-31.x), and Tailscale

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 21:35:20 -05:00