Commit Graph

396 Commits

Author SHA1 Message Date
Jeff Emmett 2c95c8c57c Merge branch 'dev' 2026-03-02 22:05:52 -08:00
Jeff Emmett ebdda1e443 feat: enhanced rinbox multisig approval UI, module landing pages, help guide
- Rinbox: visual multisig approval cards with signer avatars, progress bars,
  email previews, status-colored borders, and compose-for-approval form
- Rinbox: help/guide popout with feature cards, how-it-works steps, use cases
- Rinbox: rich demo data with threaded comments, signer lists, multiple mailboxes
- Module landing pages: improved UX descriptions for rBooks, rCal, rNotes,
  rTrips, rVote, rWork with proper feature descriptions
- Added landingPage support to RSpaceModule interface and server routing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 22:05:08 -08:00
Jeff Emmett 8bcd33a448 Merge branch 'dev' 2026-03-02 21:59:19 -08:00
Jeff Emmett e3c4d74b1a fix: update Gemini model names from deprecated -exp to current versions
gemini-2.0-flash-exp was removed from the API. Updated to:
- gemini-2.5-flash for text generation
- gemini-2.5-pro for outline/reasoning
- gemini-2.5-flash-image for image generation with responseModalities

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 21:43:42 -08:00
Jeff Emmett e644797001 feat: Sankey-proportional edges + node satisfaction bars in rFunds diagram
Edge widths now reflect actual dollar flow (source rates, overflow excess,
spending drain) instead of just allocation percentages. Zero-flow paths
render as ghost edges. Edge labels show dollar amounts alongside percentages.
Funnel nodes display an inflow satisfaction bar showing how much of their
expected inflow is actually arriving. Outcome progress bars enhanced to 8px
with dollar labels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 21:30:12 -08:00
Jeff Emmett 74a5142349 feat: Gemini AI integration + zine generator + fix Ollama network
- Add /api/prompt multi-provider endpoint (Gemini Flash/Pro + 4 Ollama models)
- Add /api/gemini/image with fallback cascade (gemini-2.0-flash → imagen-3.0)
- Add /api/zine/outline, /api/zine/page, /api/zine/regenerate-section
- Create folk-zine-gen.ts: 8-page MycroZine generator with editable text
  and per-section regeneration (text + image independently)
- Update folk-prompt.ts: multi-provider model dropdown (Gemini + Ollama)
- Update folk-image-gen.ts: add Gemini provider toggle + new styles
- Connect rspace to ai-internal Docker network for Ollama access
- Fetch GEMINI_API_KEY from Infisical claude-ops/ai (no plaintext secrets)
- Update entrypoint.sh: dual Infisical project support (primary + AI)
- Install @google/generative-ai, @google/genai SDKs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 21:27:11 -08:00
Jeff Emmett cd53a512da Merge branch 'dev' 2026-03-02 21:10:41 -08:00
Jeff Emmett 20ef1e9ec4 fix: single-click opens editor on rFunds flow nodes
Previously only double-click opened the editor/modal. Now single click
(without dragging) opens the side editor panel. Double-click still
opens rich modals for outcome/source nodes. Added drag threshold (5px)
so clicks don't accidentally start dragging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 21:10:31 -08:00
Jeff Emmett a01c5fc267 Merge branch 'dev' — resolve getApiBase conflicts (take dev version)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 21:02:31 -08:00
Jeff Emmett b6ddd4a833 fix: getApiBase() across all 16 rApp modules for subdomain routing
All modules had getApiBase() matching wrong module names (e.g. /vote
instead of /rvote) and requiring /{space}/ prefix in the URL path.
On subdomains like jeff.rspace.online, the browser URL is /rfunds/...
not /jeff/rfunds/..., so the regex never matched.

New pattern: /^(\/[^/]+)?\/rmodule/ handles both:
- Subdomain: /rfunds/... → base = /rfunds
- Direct: /demo/rfunds/... → base = /demo/rfunds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 21:01:06 -08:00
Jeff Emmett 402db7727f Merge branch 'dev' 2026-03-02 20:44:24 -08:00
Jeff Emmett cb5952c770 fix: allow tool placement over existing shapes on canvas
Move pendingTool check before the e.target gate so clicking
anywhere on the canvas places the tool, even over existing elements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:44:15 -08:00
Jeff Emmett c5085f2244 Merge branch 'dev' 2026-03-02 20:28:48 -08:00
Jeff Emmett e4ad1b68e9 fix: move encryptid containers to rspace-internal network
The encryptid-internal network had persistent Docker networking issues
(TCP CONNECT_TIMEOUT between containers on the same bridge). Using the
rspace-internal network which already works for rspace↔rspace-db.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:28:35 -08:00
Jeff Emmett 483c61966c Merge branch 'dev' 2026-03-02 20:24:17 -08:00
Jeff Emmett 7d8f64d17c fix: make pencil tool temporary, return to selector on ESC
Drawing tools (pencil, rect, circle, line) now auto-clear after one
stroke, returning to the default selector tool. ESC clears any active
whiteboard tool. Switching to another toolbar tool also clears the
active whiteboard tool.

This fixes the resize issue — when a whiteboard tool was stuck active,
canvasContent had pointer-events:none which blocked all shape
interactions including resize handles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:24:09 -08:00
Jeff Emmett 7c8bbc17c8 Merge branch 'dev' 2026-03-02 20:23:37 -08:00
Jeff Emmett cb828fc605 fix: add retry logic to EncryptID database init for Docker networking delays
Docker container networking can take a moment to stabilize even after
depends_on health checks pass. This adds 5 retries with exponential
backoff (2s, 4s, 6s, 8s, 10s) to survive transient CONNECT_TIMEOUT errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:23:26 -08:00
Jeff Emmett 96b0a48436 Merge branch 'dev' 2026-03-02 20:07:37 -08:00
Jeff Emmett 6d1661a4f3 feat: template seeding system for new spaces
Every non-demo space gets generic "Getting Started" content (~25 shapes)
covering all rApp modules so users see what each module can do immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 20:03:45 -08:00
Jeff Emmett 67820e7db5 Merge branch 'dev' 2026-03-02 19:57:39 -08:00
Jeff Emmett 4e9284fa5a feat: feed view — mobile-friendly infinite scroll for canvas
Add a toggle that switches the 2D spatial canvas into a vertical
scrollable feed layout. Shapes flow as a flex-column list, sortable
by position, creation time, type, or alphabetically. Pan/zoom/drag
gestures are suppressed in feed mode while shape editing stays active.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 19:57:24 -08:00
Jeff Emmett 928d03f372 Merge branch 'dev' 2026-03-02 19:39:50 -08:00
Jeff Emmett dfa09a39f6 feat: email invite endpoint, canvas share panel, backlog task-77 done
- Add POST /:slug/invite email endpoint (nodemailer via Mailcow SMTP)
- Add share badge + panel UI to canvas whiteboard
- Mark task-77 (encrypted VPS backup) as Done with updated references

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 19:39:43 -08:00
Jeff Emmett 8659d3a6ec Merge branch 'dev' 2026-03-02 19:36:27 -08:00
Jeff Emmett 1ff4c5ace7 refactor: consolidate EncryptID into main docker-compose.yml
Merge encryptid + encryptid-db services from separate docker-compose.encryptid.yml
into the main compose file. Update Dockerfile.encryptid to use additional_contexts
for encryptid-sdk (matching main Dockerfile pattern) instead of fragile context: ..

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 19:36:17 -08:00
Jeff Emmett 13293799b6 Merge branch 'dev' 2026-03-02 19:28:26 -08:00
Jeff Emmett 94c5346eda fix: account completion indicators, email verify token type, SW cache
- Add /api/account/status endpoint returning email, multi-device,
  social recovery completion state
- Show red/green status dots on Account modal section headers for
  incomplete vs complete steps (email, device, recovery, data storage)
- Highlight Data Storage section with red warning when using local-only
  storage so users know they're responsible for their own data
- Fix email verification 500 error: change token type from
  'email_verification' to 'email_verify' to match DB check constraint
- Fix service worker: skip non-http(s) schemes to prevent
  chrome-extension:// cache put errors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 19:28:13 -08:00
Jeff Emmett 63d8cb63fa Merge branch 'dev' 2026-03-02 19:25:49 -08:00
Jeff Emmett 606c60c511 fix: remove auto-redirect from demo space when logged in
Logged-in users visiting demo.rspace.online were auto-redirected to
their personal subdomain. Remove this redirect so the demo stays
accessible regardless of auth state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 19:25:41 -08:00
Jeff Emmett 0c56569a00 Merge branch 'dev' 2026-03-02 19:21:05 -08:00
Jeff Emmett 48769281c6 feat: animated edges, rich node modals, hover effects for rFunds Diagram
Port standalone rfunds-online UX polish to rSpace integration:
- Animated flowing edges with glow paths and CSS-animated dashes
- Wider Sankey-proportional stroke widths (12/10/8px)
- Rich outcome modal with phase accordion, task checkboxes, funding progress
- Rich source modal with type picker grid and type-specific config
- Node hover tooltips showing key stats + connected edge highlighting
- Sufficiency glow pulse on funnel status text

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 19:20:55 -08:00
Jeff Emmett 2b5ef14946 Merge branch 'dev' 2026-03-02 19:01:07 -08:00
Jeff Emmett 7ffabe9b0a fix: use source 'card' and require funnelId for Flow Service deposit
Flow Service expects source to be wallet|card|bank, not 'transak'.
funnelId falls back to FUNNEL_ID env var when not in partnerOrderId.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 18:55:59 -08:00
Jeff Emmett bedc5652dc Merge branch 'dev' 2026-03-02 18:25:20 -08:00
Jeff Emmett 0ef5aad3ad chore: add backlog tasks 79-81
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 18:25:12 -08:00
Jeff Emmett 0fb8bb782e Merge branch 'dev' 2026-03-02 18:20:42 -08:00
Jeff Emmett 1af7df41bb feat: Tiptap rich text editor for rNotes — toolbar, slash commands, sync
Replace bare contenteditable divs with a full Tiptap editor (vanilla JS,
no React) inside the <folk-notes-app> web component. Adds formatting
toolbar (bold/italic/underline/strike/code, heading dropdown, lists,
blockquote, code block, link/image insert, undo/redo), slash command
menu (/ at start of empty block), syntax-highlighted code blocks via
lowlight, and task list checkboxes.

Zone-based rendering keeps the editor DOM persistent across re-renders.
Content stored as Tiptap JSON in the existing Automerge content field
with a new contentFormat discriminator. Legacy HTML notes auto-migrate
on first edit. Remote sync updates applied without cursor disruption.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 18:20:33 -08:00
Jeff Emmett a70d5fc1a2 fix: use c.req.json() for Transak webhook body parsing
Hono consumes the request body upstream, so c.req.raw.clone().text()
returns empty. Use c.req.json() directly and re-serialize for HMAC.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 18:10:04 -08:00
Jeff Emmett 4bca76cf45 fix: handle body read in Transak webhook — clone request for HMAC + JSON
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 18:08:24 -08:00
Jeff Emmett 34c96b5a45 feat: Transak credit card → USDC fiat on-ramp for rFunds TBFF
Add Transak widget integration so users can fund flows with a credit card.
Server receives webhook on order completion and deposits USDC into the flow
via the existing Flow Service API. Includes HMAC signature verification
when TRANSAK_WEBHOOK_SECRET is configured.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 18:04:53 -08:00
Jeff Emmett 7f3747bf74 Merge branch 'dev' 2026-03-02 17:09:17 -08:00
Jeff Emmett 46c2a0b035 feat: layered local-first data architecture — encrypted backup, relay persistence, at-rest encryption
Implement the 4-layer data model (device → encrypted backup → shared sync → federated):

- Extract shared encryption-utils from community-store (deriveSpaceKey, AES-256-GCM, rSEN format)
- Encrypt module docs at rest when space has meta.encrypted === true
- Fix relay mode persistence: relay-backup/relay-restore wire protocol + .automerge.enc blob storage
- Add backup store + REST API (PUT/GET/DELETE /api/backup/:space/:docId) with JWT auth
- Add client BackupSyncManager with delta-only push, full restore, auto-backup
- Wire backup stubs in encryptid-bridge to BackupSyncManager
- Add rspace-backups Docker volume
- Create docs/DATA-ARCHITECTURE.md design doc with threat model and data flow diagrams

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:09:07 -08:00
Jeff Emmett c906efc3e6 Merge branch 'dev' 2026-03-02 16:46:07 -08:00
Jeff Emmett 5ee59f86d6 feat: people online panel — live peer presence on canvas
- community-sync: re-announce on reconnect, handle peer-list/joined/left/ping events
- presence: export peerIdToColor helper
- server: track peer announcements, broadcast join/leave, relay ping-user
- canvas: people online badge + expandable panel with avatar dots and ping button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:45:57 -08:00
Jeff Emmett 5241b37922 Merge branch 'dev' 2026-03-02 16:38:27 -08:00
Jeff Emmett 4dd212ef7d fix: add shared/local-first to EncryptID Docker build context
login-button.ts imports encryptid-bridge from shared/local-first/
which was missing from the Dockerfile.encryptid COPY steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:38:18 -08:00
Jeff Emmett ac2eebb966 Merge branch 'dev' 2026-03-02 16:34:56 -08:00
Jeff Emmett 88118cd157 fix: use server-initiated WebAuthn flow for guardian acceptance and login
The guardian page and auth.rspace.online login page were using the
client-side authenticatePasskey()/registerPasskey() SDK functions which
generate their own challenge and return AuthenticationResult — but then
tried to send result.challenge and result.credential (both undefined)
to the server. This caused postgres to throw "UNDEFINED_VALUE" resulting
in a 500 "Internal Server Error" that the client couldn't parse as JSON.

Fix: use the proper server-initiated flow matching rstack-identity.ts:
1. POST /api/auth/start (or /register/start) to get server challenge
2. navigator.credentials.get/create with that challenge
3. POST /api/auth/complete (or /register/complete) with challenge + credential

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:34:43 -08:00
Jeff Emmett dc6c6a4042 Merge branch 'dev' 2026-03-02 16:25:37 -08:00