Commit Graph

32 Commits

Author SHA1 Message Date
Jeff Emmett eb05639608 fix: use rspaceNavUrl for (you)rSpace CTA redirect + pass onSuccess callback
The auto-provision redirect was hardcoding /${slug}/canvas which is a
404 (canvas module id is "rspace"). Now uses rspaceNavUrl() for correct
subdomain/path routing. Also passes onSuccess to showAuthModal so
auto-provision runs even when signing in from a non-demo space.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 18:02:22 -08:00
Jeff Emmett 2ec5027285 feat: restyle rSpace.online about page to rApp theme + (you)rSpace CTA in space switcher
Restyled website/index.html to use the standard rl-* rich landing CSS
utilities matching all rApp module landing pages: rl-hero, rl-section,
rl-card, rl-grid-3, rl-icon-box, rl-cta-primary/secondary. All original
content preserved (EncryptID, Offline-First, Interoperable, Newsletter).

Added (you)rSpace CTA button in the space switcher dropdown — shows
"Sign in to create" or "Create (you)rSpace" when user has no owned space,
with auto-provision flow on click.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:50:30 -08:00
Jeff Emmett ab3132a5f0 feat: space cleanup + Edit Space modal (delete, update meta, manage members)
Backend: deleteCommunity(), updateSpaceMeta(), DELETE/PATCH space endpoints,
member CRUD, per-space access-requests GET. UI: gear icon on owned spaces,
3-tab Edit Space modal (Settings, Members, Invitations) in space switcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:35:24 -08:00
Jeff Emmett 9742bd1409 fix: zoom-aware drag, minimum-penetration collision, replace unicode escapes
- Shape drag now accounts for canvas CSS transform scale so elements
  track the cursor correctly at all zoom levels
- Collision resolution uses minimum penetration depth algorithm instead
  of movement-direction bias, preventing elements from flipping sides
- Replaced all \uD83D surrogate pair escapes and \u00D7/\u276E/\u276F/
  \u2022 escapes with actual Unicode characters across 60+ files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 16:48:50 -08:00
Jeff Emmett d850a7615e feat: MI canvas bridge, action executor, and enhanced context
- Add MiCanvasBridge for deep canvas state awareness (shapes, selection, viewport)
- Add MiActionExecutor to create/update/delete/move/connect shapes from MI responses
- Add MI action parsing (create-shape, connect, update-shape, delete-shape, move-shape, transform)
- Add selection transforms (align, distribute, arrange, match-size)
- Add tool suggestion schema for contextual MI hints
- Enhanced MI system prompt with action markers and transform commands
- Richer canvas context in /api/mi/ask (positions, connections, viewport, shape groups)
- Refactored tab-bar I/O chips for cleaner feed port rendering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 16:08:20 -08:00
Jeff Emmett ed675d286d feat: embed rich landing pages for all 21 rSpace modules
Replace broken proxy-based landing pages with inline HTML for every
module. Each gets a landing.ts exporting renderLanding() with hero,
how-it-works, features, and CTA sections using shared .rl-* CSS.

12 ported from standalone repos (rPubs, rWork, rVote, rCal, rCart,
rTrips, rNotes, rMaps, rForum, rInbox, rSocials, rWallet) and 9 new
(rBooks, rChoices, rData, rFiles, rFunds, rPhotos, rSplat, rSwag, rTube).

Infrastructure: RICH_LANDING_CSS in shell.ts, landingPage field on
RSpaceModule, routing checks inline content before proxy fallback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 15:36:48 -08:00
Jeff Emmett 286f08fadb feat: space access request flow with notifications
Add "Request Access" flow for inaccessible spaces: authenticated users
see all spaces in the dropdown (categorized as Your/Public/Discover),
can request access to restricted spaces, and space owners get in-app
notification badges with inline approve/deny actions.

- API: GET /api/spaces returns accessible/relationship/pendingRequest fields
- API: POST/PATCH /api/spaces/:slug/access-requests + GET /notifications
- Space switcher: 3-section layout with Discover section + Request Access modal
- Identity: notification polling (30s), red badge on avatar, approve/deny in dropdown

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 14:45:15 -08:00
Jeff Emmett 9e4648be62 feat: feed-aware flow wiring + CSS 3D interactive layer view
Replace SVG stack view with CSS 3D perspective scene featuring
glassmorphism layer planes, animated flow particles, orbit controls,
and a time scrubber. Flow creation dialog now filters kind buttons
by source/target feed compatibility with count badges. Contained
feeds (no outgoing flow) shown with lock icons on layer planes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 14:36:51 -08:00
Jeff Emmett f8bd09dbac feat: vertical toolbar, whiteboard tools, zoom dropdown, context-aware MI bar
- Convert canvas toolbar from horizontal (top center) to vertical (left side)
  with dropdowns opening to the right
- Add whiteboard "Draw" toolbar group: pencil, sticky note, rectangle, circle,
  line, eraser — renders SVG strokes on canvas overlay
- Nest zoom controls (in/out/reset) under a "Zoom" dropdown group
- Enhance rstack-mi to gather page context (open shapes, active tab, page title)
  and send to /api/mi/ask for context-aware responses
- Move FeedDefinition to lib/layer-types.ts, add feeds/acceptsFeeds to modules
- Extend rstack-tab-bar with feed compatibility helpers and 3D scene state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 14:29:24 -08:00
Jeff Emmett 726ef43952 feat: categorized rApp dropdown in tab bar + button
- Tab bar + button now shows full rApp dropdown with names, icons, descriptions
- Grouped by category (Creating, Planning, Communicating, etc.)
- Only shows modules not already open as tabs
- Shell passes module list to tab bar via setModules()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 14:11:33 -08:00
Jeff Emmett 3b6ea5afcd feat: creative tools suite — 7 tools in unified canvas toolbar
- Delete rProviders module (unused)
- Add hidden flag to module system, hide rSplat from app switcher
- Add fal.ai API proxies: image-gen (Flux Pro), video-gen t2v (WAN 2.1), i2v (Kling)
- New canvas shapes: folk-splat (3D viewer), folk-blender (3D gen), folk-drawfast (freehand drawing), folk-freecad (parametric CAD), folk-kicad (PCB design)
- Restructure canvas toolbar: new "Creative" group with all 7 tools, reduced "Media" group
- Add blender-gen, kicad, freecad REST-to-MCP bridge endpoints
- Fix standalone domain navigation to rspace.online landing pages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 13:57:50 -08:00
Jeff Emmett bd0916b60f security: remove hardcoded secrets, require env vars
Remove hardcoded encryption fallback and Postgres password defaults
flagged by GitGuardian. ENCRYPTION_SECRET and DATABASE_URL are now
required env vars that throw on missing rather than falling back to
insecure defaults.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 09:45:10 -08:00
Jeff Emmett f84b0b9914 refactor: remove rProviders from rApps, fix rSwag domain to rswag.online
rProviders (providers.mycofi.earth) is a separate project — removed
module registration, app switcher entry, tab bar badge, canvas embed
button, Traefik router, and standalone config. rSwag domain updated
from swag.mycofi.earth to rswag.online across all references.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 23:39:43 -08:00
Jeff Emmett 2cfe2c744d feat: app switcher links to landing pages, demo uses standalone rApp builds
App switcher on demo/bare domain now links to rspace.online/{moduleId}
landing pages instead of jumping straight to demo. "Try Demo" buttons
use standalone domain builds (rnotes.online, rvote.online, etc.) which
have better styling and more updated features. Falls back to
demo.rspace.online for modules without a standalone domain.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 23:09:10 -08:00
Jeff Emmett 8b9ccff256 fix: use bare domain rspace.online/r* for rApp links instead of personal subdomain
App switcher fallback was "personal" causing all rApp links to resolve
to personal.rspace.online/r*. Changed to "demo" so links use the bare
domain which the server rewrites to demo mode. Updated landing page
CTAs and ecosystem links to match.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 22:19:51 -08:00
Jeff Emmett 1bedc4e504 feat: bare-domain module routing — rspace.online/{moduleId} as default
App dropdown links now go to rspace.online/r* (bare domain) instead of
demo.rspace.online/r*. Only the "Try Demo" button links to the explicit
demo subdomain. Server internally rewrites bare-domain module paths to
/demo/{moduleId} while preserving the browser URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 19:22:06 -08:00
Jeff Emmett a5f8389239 feat: r-prefix module slugs, landing page, clickable rStack header
- Rename all 23 module IDs to r-prefixed slugs (canvas→rspace, notes→rnotes, etc.)
- Root rspace.online/ now serves the landing page instead of redirecting to demo
- rStack header in app switcher dropdown is now a clickable link to rstack.online
- Update all internal navigation links, badge maps, and URL helpers
- Space root redirects to /rspace instead of /canvas

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 19:04:22 -08:00
Jeff Emmett cc116e6be8 feat: canonical subdomain routing — {space}.rspace.online/{moduleId}
Consolidate URL routing so all rApps flow through
{space}.rspace.online/{moduleId} as the canonical URL pattern.

- Subdomain handler now routes all modules (not just canvas)
- Standalone domains (rvote.online etc) → 301 redirect to canonical
- Add shared/url-helpers.ts for subdomain-aware URL generation
- Update app-switcher, space-switcher, identity, tab-bar navigation
- Shell inline scripts use __rspaceNavUrl for all URL generation
- Path-based rspace.online/:space/:moduleId still works as fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 16:24:36 -08:00
Jeff Emmett e7ce57ce0b feat: auto-route users to personal/demo space + landing overlay
- Anon users visiting any rApp (standalone or unified) land on demo space
- Logged-in users auto-redirect to personal space (auto-provisioned)
- POST /api/spaces/auto-provision creates personal space on first visit
- Standalone domains support /<space> path prefix (rpubs.online/jeff)
- rspace.online/ redirects to /demo/canvas (app-first experience)
- Quarter-screen welcome overlay on demo space for first-time visitors
- Full landing page moved to /about
- Auth flow triggers auto-space-resolution on sign-in/register
- Demo space seeded with shapes for all 22 rApps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 15:47:47 -08:00
Jeff Emmett 38a5d84f72 feat: layered tab system with inter-layer flows and bidirectional feeds
Introduces the full layer/tab architecture for rSpace — each rApp becomes
a layer in a vertical stack with typed flows (economic, trust, data,
attention, governance, resource) connecting them.

New components:
- rstack-tab-bar: tab bar with flat/stack view toggle, drag reorder,
  drag-to-connect flow creation with kind/label/strength dialog
- folk-feed: canvas shape that pulls live data from other layers with
  bidirectional write-back (edit items inline, push changes to source API)
- layer-types: Layer, LayerFlow, FlowKind types and color palette

Automerge schema extended with layers, flows, activeLayerId, layerViewMode.
CommunitySync gains 11 new methods for layer/flow CRUD.

Feed definitions added to 10 modules (funds, notes, vote, choices, wallet,
data, work, network, trips, canvas) with typed feeds and acceptsFeeds.

RSpaceModule interface extended with FeedDefinition and acceptsFeeds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 15:29:03 -08:00
Jeff Emmett 4587387dec feat: consistent headers across all rApps + add mi AI assistant
Header consistency:
- Fix 52px → 56px header height in 7 module CSS files (pubs, funds,
  providers, books, swag, choices, cart)
- Remove custom header background overrides in books.css and pubs.css
- All pages now use the same 3-section header layout: left (app/space
  switchers), center (mi), right (identity)
- Add <rstack-mi> to all 4 standalone HTML pages (index, admin,
  create-space, canvas) and both shell renderers

mi AI assistant:
- New <rstack-mi> web component with search input "Ask mi anything..."
- Dropdown panel with streaming chat UI, typing indicator, markdown
  formatting
- POST /api/mi/ask endpoint: streams from Ollama with full rApp context
  in system prompt (all 22 modules, current space/module)
- Graceful fallback to keyword-based responses when Ollama unavailable
- Configurable via MI_MODEL and OLLAMA_URL env vars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 15:09:41 -08:00
Jeff Emmett 1ff0f69218 feat: wire up account settings endpoints (email, device, guardians)
Server (src/encryptid/server.ts):
- POST /api/account/email/start — send 6-digit verification code via SMTP
- POST /api/account/email/verify — verify code and set email on account
- POST /api/account/device/start — WebAuthn creation options for same-device
  passkey registration (authenticated, reuses existing userId)
- POST /api/account/device/complete — store additional credential under
  existing account

DB (src/encryptid/db.ts):
- Add 'device_registration' to StoredChallenge.type union
- Add 'email_verification' to StoredRecoveryToken.type union

Client (shared/components/rstack-identity.ts):
- Rewrite social recovery modal to use existing guardian API:
  GET /api/guardians, POST /api/guardians, DELETE /api/guardians/:id
- Loads existing guardians on open, adds/removes in real-time
- Shows guardian status (accepted/pending), invite emails sent on add
- Two name+email inputs (max 3 guardians, server-enforced)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 14:57:32 -08:00
Jeff Emmett cd33f7c050 feat: redesign identity modal and space switcher UX
- Auth modal: unified "Sign up / Sign in" landing with stacked passkey buttons,
  close X button, and "Powered by EncryptID" link to ridentity.online
- Logged-in dropdown: replace Profile/Recovery (auth.ridentity.online) with
  Add Email, Add Second Device, Add Social Recovery settings modals
- Add Email: two-step flow (enter email → verify code)
- Add Second Device: WebAuthn credential registration for backup access
- Add Social Recovery: trusted contacts with configurable threshold
- Space switcher: emoji visibility badges (🔓 green / 🔑 yellow / 🔒 red),
  remove slash prefix, match app-switcher button styling
- Add rdata.online to standalone domain list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 14:50:35 -08:00
Jeff Emmett 7e6d78f4cb refactor: reorganize app-switcher categories — Sharing, Observing, move rTube to Creating
Rename "Social & Media" to "Sharing", split out rData into new "Observing"
category, and move rTube from Social to Creating.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 13:30:44 -08:00
Jeff Emmett db78dbeeb9 feat: color-code space switcher by visibility and style as button
Space dropdown now shows visibility badges (PUBLIC/PRIVATE/PERMISSIONED)
with green/red/yellow color coding and left border accents. Trigger button
styled with background fill to match the rApps dropdown beside it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 13:27:26 -08:00
Jeff Emmett f84e45fc5a feat: rebrand AppSwitcher with pastel badges, rStack header, updated categories
- Pastel rainbow badges (rS, rN, rP, rC, rT...) replace plain emoji icons
- Emoji moved to right of app name in dropdown items
- rStack header with gradient badge at top of dropdown
- rStack footer link at bottom
- Canvas renamed to rSpace
- rMaps moved to Planning category
- "Sharing & Media" renamed to "Social & Sharing" with rNetwork at top
- Trigger button shows pastel badge + app name

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 19:36:58 -08:00
Jeff Emmett 64aad9bb68 feat: scrollable categorized rApp dropdown, rSpaces rename, overlap prevention
- rApp dropdown now scrollable (max-height: 70vh) with apps grouped into
  5 categories: Creating, Planning, Discussing & Deciding, Funding &
  Commerce, Sharing & Media
- Renamed canvas object terminology from "shapes" to "rSpaces" in UI labels
- New shapes placed on canvas automatically find free positions using
  spiral search to avoid overlapping existing shapes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:20:41 -08:00
Jeff Emmett 2d5103c7d6 Add 7-layer local-first data infrastructure
Crypto (PRF/HKDF/AES-256-GCM per-doc keys), Document (schema + manager),
Storage (encrypted IndexedDB), Sync (multi-doc WebSocket client + server),
Compute (local/server-delegated transforms), Query (views + search),
and Memory Card interchange format. 2919 lines across 10 files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 01:12:06 +00:00
Jeff Emmett f504ca1a68 Add rSplat module — Gaussian splat viewer with x402 gated uploads
New rSpace module for 3D Gaussian splat viewing. Gallery + full-viewport
Three.js/GaussianSplats3D viewer loaded via CDN importmap. EncryptID auth
on uploads, optional x402 micro-transaction gate. Reusable x402 Hono
middleware in shared/x402/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 20:55:45 +00:00
Jeff Emmett a6ad8c2264 Include all apps with standalone domains and user-accessible spaces
App switcher:
- Add standaloneDomain to ModuleInfo (exposed via /api/modules)
- Add missing standaloneDomain to 5 modules: funds, files, wallet,
  choices, forum (20/21 modules now have standalone domains)
- Show external link arrow on hover for each app's standalone site

Space switcher:
- Pass auth token when fetching /api/spaces so the API returns
  private (authenticated/members_only) spaces the user owns or
  is a member of
- Group spaces into "Your spaces" (with role badge) and "Public
  spaces" sections
- Reload space list on auth-change (sign-in/sign-out)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 01:44:12 +00:00
Jeff Emmett 835d15215e feat: add books module — Phase 2 port of rBooks to rSpace platform
Port rbooks-online (Next.js + React) as an rSpace module with Hono routes,
vanilla web components, and shared PostgreSQL schema. Includes library grid
(folk-book-shelf), flipbook PDF reader (folk-book-reader), upload with
EncryptID auth, IndexedDB caching, and standalone deployment support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 22:07:34 +00:00
Jeff Emmett 59d00588b4 feat: unified module system — Phase 0 shell + Phase 1 canvas module
Implement the rSpace module architecture that enables all r-suite apps
to run as modules within a single-origin platform at rspace.online,
while each module can still deploy standalone at its own domain.

Phase 0 — Shell + Module System:
- RSpaceModule interface (shared/module.ts) with routes, metadata, hooks
- Shell HTML renderer (server/shell.ts) for wrapping module content
- Three header web components: rstack-app-switcher, rstack-space-switcher,
  rstack-identity (refactored from rspace-header.ts into Shadow DOM)
- Space registry API (server/spaces.ts) — /api/spaces CRUD
- Hono-based server (server/index.ts) replacing raw Bun.serve fetch handler
  while preserving all WebSocket, API, and subdomain backward compat
- Shared PostgreSQL with per-module schema isolation (rbooks, rcart, etc.)
- Vite multi-entry build: shell.js + shell.css built alongside existing entries
- Module info API: GET /api/modules returns registered module metadata

Phase 1 — Canvas Module:
- modules/canvas/mod.ts exports canvasModule as first RSpaceModule
- Canvas routes mounted at /:space/canvas with shell wrapper
- Fallback serves existing canvas.html for backward compatibility
- /:space redirects to /:space/canvas

URL structure: rspace.online/{space}/{module} (e.g. /demo/canvas)
All existing subdomain routing (*.rspace.online) preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 21:54:15 +00:00