Commit Graph

1593 Commits

Author SHA1 Message Date
Jeff Emmett b3d6f2eba8 feat(rgov): add quadratic, conviction, multisig & sankey GovMods
Four new governance circuit shapes for delegated democracy:
- folk-gov-quadratic: weight transformer (sqrt/log/linear dampening)
- folk-gov-conviction: time-weighted conviction accumulator (gate/tuner modes)
- folk-gov-multisig: M-of-N multiplexor gate with signer management
- folk-gov-sankey: auto-discovered governance flow visualizer with animated SVG

Registered in canvas-tools (4 AI tool declarations), index exports,
mod.ts (shapes, tools, types, seed Circuit 3), folk-gov-project
(recognizes new types), and landing page (Advanced GovMods section).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 17:03:39 -07:00
Jeff Emmett 5f2b3fd8d1 fix(rcart): streamline Transak widget — skip exchange screen, auto-fill user data
Added hideExchangeScreen, isAutoFillUserData, and paymentMethod params
to both Transak endpoints. This skips the initial exchange screen (we
already provide all required fields) and auto-fills email for Lite KYC,
reducing friction for small transactions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 16:04:59 -07:00
Jeff Emmett 42546c9a63 fix: use internal mailcow relay (port 25) for all SMTP transports
SMTP auth on port 587 was broken across all modules due to stale
credentials. Since rspace is on the mailcow Docker network, all 6
SMTP transports now use unauthenticated relay on port 25 when the
host is the internal postfix container. Fixes emails for: payment
receipts, space invitations, inbox approvals, agent notifications,
scheduled emails, and publication sharing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 15:12:42 -07:00
Jeff Emmett 4919ca1021 fix(rcart): use port 25 internal relay for payment emails
SMTP auth credentials were stale, causing all payment confirmation
emails to silently fail. Since rspace is on the mailcow Docker network,
use unauthenticated relay on port 25 instead of port 587 with auth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 15:06:57 -07:00
Jeff Emmett 55067729b1 fix(rcart): graceful server-side page for paid/expired/cancelled payments
When a payment request is in a terminal state (paid, confirmed, expired,
cancelled, filled), the /pay/:id route now renders a static HTML page
with a clear message instead of loading the full JS component. Prevents
"corrupted content error" and shows a friendly "already paid" message.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:58:35 -07:00
Jeff Emmett f9dc06394c fix(rcart): force Transak dark mode with colorMode param
Text inputs were rendering in light mode making text invisible against
the dark background. Added colorMode: 'DARK' to both Transak widget
endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:52:28 -07:00
Jeff Emmett 15990cc147 fix(rcart): infer Transak fiat amount from crypto amount for stablecoins
When fiatAmount wasn't explicitly set on a payment request, Transak
defaulted to 300 USD. Now for USDC/USDT/DAI/cUSDC, the fiat amount
is inferred from the crypto amount (1:1 peg) so the widget opens with
the correct payment amount.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:48:48 -07:00
Jeff Emmett 4d06156e5f fix(rtime): scale commitment orbs relative to basket size
Orb radius now uses 8-15% of basket radius with sqrt(hours) scaling
instead of fixed pixel sizes (18+hours*9). Prevents orbs from being
oversized on small baskets or undersized on large ones. Hover expansion
also scales proportionally (15% instead of fixed 5px).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:41:05 -07:00
Jeff Emmett 0337797b7c fix(rtime): enable touch drag for commitment pool orbs on mobile
Add touch-action:none on canvas and preventDefault on pointerdown to
prevent the browser from claiming touch events for scroll/pan gestures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:35:45 -07:00
Jeff Emmett d4612d6fb8 fix(ascii-gen): handle raw HTML response from ascii-art service
The ascii-art service returns raw HTML, not JSON. Wrap response in
{html, text} JSON envelope and strip tags for plain text version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:31:22 -07:00
Jeff Emmett 46c326278a feat: ASCII art canvas tool, video gen fixes, scribus/notebook sidecars
- Add folk-ascii-gen canvas shape with pattern/palette selectors
- Add POST /api/ascii-gen proxy to ascii-art service
- Register create_ascii_art in canvas tools + triage panel
- Fix WAN 2.1 t2v endpoint URL (fal-ai/wan/v2.1 → fal-ai/wan-t2v)
- Convert video gen to async job queue (avoids Cloudflare timeouts)
- Fix Docker API Content-Type bug in sidecar-manager
- Convert scribus-novnc and open-notebook to on-demand sidecars
- Add ensureSidecar("scribus-novnc") to rDesign bridge proxy
- Fix Hono ContextVariableMap and handleTransakMessage type errors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:25:48 -07:00
Jeff Emmett 801de38b4a feat(rtime): commitment splitting, pool removal & approval workflow
When dragging a commitment to a task, hours are now split (min of
available, needed), the pool orb shrinks or disappears, and
connections track proposed/committed status with approve/decline UI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:20:48 -07:00
Jeff Emmett 4a54e6af16 fix: enforce subdomain routing — spaces are subdomains, never path segments
Audit and fix ~60 violations across 47 files where URLs were constructed
as /{space}/moduleId instead of /moduleId (subdomain provides the space).

- Add getModuleApiBase() helper to shared/url-helpers.ts
- Fix client components: use getModuleApiBase() for fetch URLs,
  rspaceNavUrl() for navigation
- Fix server routes: use c.get("isSubdomain") for redirects and
  JSON response URLs
- Fix OAuth callbacks (notion, google, clickup): subdomain-aware redirects
- Fix email notification URLs (rvote): use {space}.rspace.online format
- Fix webhook registration (rtasks/clickup): subdomain-aware endpoint URL
- Replace broken #getSpaceSlug() methods in folk-feed, folk-splat
- Replace NODE_ENV checks with proper isSubdomain checks (rdata, rnetwork)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:09:53 -07:00
Jeff Emmett 7c6861bf50 fix(transak): let Infisical inject all Transak keys instead of empty compose vars
Empty compose env vars were blocking Infisical secret injection at startup.
Only TRANSAK_ENV needs to be in compose; API keys and secrets come from Infisical.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 14:03:51 -07:00
Jeff Emmett d262eff097 fix(rgov): use path-only href instead of /${space}/ prefix
Spaces are subdomains, not path segments. /rspace is correct since
the space context comes from the subdomain.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 13:32:04 -07:00
Jeff Emmett 16f224f065 feat(rgov): add seed template with two example governance circuits
Seeds demo spaces with a "Build a Climbing Wall" circuit (labor threshold +
capital threshold + proprietor signoff → project) and a "Community Potluck"
circuit (budget knob + RSVPs threshold + venue signoff → project), each
pre-wired with arrows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 13:15:25 -07:00
Jeff Emmett 559d146099 feat(rgov): add GovMods landing page and onboarding
Rich landing page with do-ocratic framing, SVG circuit diagram,
"GovMods" branding, modular governance vs monolithic comparison,
and onboarding action. Module now has landingPage function for
bare-domain rendering.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 13:07:02 -07:00
Jeff Emmett f375eb1b43 feat(rgov): add rGov governance decision circuit module
Implements 5 new FolkShape web components for visual governance:
- folk-gov-binary: Yes/No signoff gates
- folk-gov-threshold: Numeric progress gates with contributions
- folk-gov-knob: SVG rotary parameter knobs with temporal viscosity
- folk-gov-project: Circuit aggregators (walks arrow graph backward)
- folk-gov-amendment: Modification proposals with approval voting

Also adds "satisfied" gate condition to folk-arrow, 5 AI canvas
tools, module registration, and all canvas.html wiring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 13:01:08 -07:00
Jeff Emmett 5f45014226 feat(rtime): unified Canvas view — merge Pool + Weave with pan/zoom
Replace 3-tab layout (Pool/Weave/Collaborate) with 2-tab Canvas + Collaborate.
Canvas tab has collapsible left pool panel with orbs alongside infinite SVG
canvas with pan/zoom (ctrl+wheel zoom, wheel pan, space+drag, touch pinch).

- Long-press orb in pool → drag onto canvas to create commitment node
- Drop on matching task port auto-creates wire connection
- Gold glow highlights unfulfilled task ports matching dragged skill
- "Frame as Tasks" button on solver results creates task nodes with
  dashed intent frame on canvas
- Add intentFrameId to Task schema for solver-to-task linkage
- Zoom controls overlay (+/−/reset)
- Light/dark theme support for all new elements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-03 12:06:58 -07:00
Jeff Emmett fab155b411 feat(rcart): add MoonPay integration with Transak fallback
Add MoonPay as the primary card payment provider for rCart. MoonPay
uses HMAC-SHA256 signed URLs (no session API needed, no IP whitelisting).
Falls back to Transak if MoonPay keys aren't configured.

- shared/moonpay.ts: URL builder with HMAC signing, currency mapping
- New /api/payments/:id/card-session endpoint picks provider automatically
- Frontend uses unified startCardPayment() with multi-provider message handling
- Set MOONPAY_API_KEY + MOONPAY_SECRET_KEY to activate

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 06:23:14 +00:00
Jeff Emmett c1e8048089 fix: allow TRANSAK_ENV to be set via Infisical (default STAGING)
Hardcoded PRODUCTION overrode the Infisical value. Use env var with
STAGING default until Transak production gateway auth issue is resolved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 05:46:41 +00:00
Jeff Emmett 125bed3ad7 fix: try gateway for Transak token refresh before legacy API
Production gateway rejects tokens from api.transak.com. Try getting
the access token from the gateway endpoint first (which staging
confirms works), then fall back to the legacy API endpoint.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 03:58:09 +00:00
Jeff Emmett e61da960ea feat: migrate to Transak Secure Widget URL API
Transak now requires widget URLs to be generated server-side via their
gateway session API. Direct query-parameter URLs are deprecated.

- Add getAccessToken() with 7-day caching for partner access tokens
- Add createSecureWidgetUrl() that calls the gateway session endpoint
- Falls back to legacy direct URL if gateway returns an error (e.g.
  production IP not yet whitelisted)
- Update rCart and rFlows to use the secure API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 03:17:18 +00:00
Jeff Emmett 4f87807438 fix(rcart): use defaultCryptoAmount for Transak widget
Transak rejects `cryptoAmount` when combined with fiatCurrency params.
Use `defaultCryptoAmount` which pre-fills the amount without conflicting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 03:02:19 +00:00
Jeff Emmett f469f3f40d fix(rcart): ensure Generate QR button is reachable on mobile
The payment request form button was cut off on mobile because the shell
uses height:100vh with overflow:hidden on #app. Add padding-bottom to
the .page container so the button scrolls into view within the flex
overflow:auto content area.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 02:56:53 +00:00
Jeff Emmett d8e954dfb6 fix: persist docs created via setDoc (fixes payment not found)
SyncServer.setDoc() was not calling onDocChange, so documents created
via setDoc (including payment requests) were only stored in memory and
lost on container restart. This caused "Payment request not found"
errors after deploys. Now setDoc triggers the same persistence callback
as changeDoc.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 02:54:11 +00:00
Jeff Emmett 19885c98e6 fix(rcart): make payment pages publicly accessible
Payment request URLs (e.g. /rcart/pay/:id) should be accessible without
authentication, even in private spaces. The API endpoints were already
exempted from auth, but the client-side shell gate was redirecting
unauthenticated visitors to the module landing page. Set
spaceVisibility="public" on the payment page render to bypass this.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 02:33:53 +00:00
Jeff Emmett 3c801aecaf fix(rcart): use popup for Transak in all environments
Transak production also sends X-Frame-Options: SAMEORIGIN, blocking
iframe embeds. Switch to popup window for all environments, not just
staging. Show "payment opened in new window" status with re-open button.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 02:26:30 +00:00
Jeff Emmett 1b8fcbdf47 fix(rcart): add Transak API key to docker-compose environment
TRANSAK_ENV was set to PRODUCTION but TRANSAK_API_KEY_PRODUCTION was
missing, causing the Transak session endpoint to return 503. Add the
env var reference so rCart card payments work in production.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 02:06:57 +00:00
Jeff Emmett 8c349d2003 fix(rflows): align Openfort wallet label with flow-service
Use `user-${email}` instead of raw `email` as the Openfort player label,
matching the flow-service convention. Openfort rejects colons in labels,
and both codepaths must use the same format so users get the same wallet
regardless of whether they on-ramp via rfunds.online or rspace.online.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 01:59:24 +00:00
Jeff Emmett 6364eb8deb feat(shell): add Request Access button and Go to My Space fallback on access gate
When a logged-in user visits a private space they don't have access to,
the gate now shows a "Request Access" button (calls POST /api/spaces/:slug/access-requests)
and a "Go to {username}'s Space" secondary link. Handles already-pending (409) gracefully.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 16:20:56 -07:00
Jeff Emmett 1cdbce0bcc fix(shell): update space-switcher on landing pages to show user's space or demo
Landing, module-landing, and sub-page-info pages showed a stale "Spaces"
dropdown. Now checks encryptid_session and sets the switcher to
{username}'s Space (logged in) or demo (logged out).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 16:05:14 -07:00
Jeff Emmett 2c3f8568a3 fix: use subdomain format {space}.rspace.online instead of path-based routing
Space creation popup slug field now shows input followed by .rspace.online
suffix instead of rspace.online/ prefix. Also fixes rtasks notification
link and browser extension help text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 15:16:07 -07:00
Jeff Emmett 52e2f77383 feat(canvas): add clipboard interop for tldraw/Excalidraw/JSON paste + Ctrl+C copy
CI/CD / deploy (push) Waiting to run Details
Enable pasting structured shape data from tldraw, Excalidraw, and generic
JSON into the rSpace canvas, with automatic type conversion and viewport
centering. Ctrl+C on selected shapes writes rSpace JSON to clipboard for
round-trip paste or external consumption.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 15:08:55 -07:00
Jeff Emmett 87bafc9d74 feat(rtime): port 14 missing hcc-mem-staging features to rTime module
- Connection & exec state persistence (POST /api/connections, PUT exec-state)
- Exec step detail forms for all 5 types (venue, comms, notes, prep, launch)
- Step state machine fix: click to expand/collapse, action button to complete
- Task editor links field with dynamic add/remove and server persistence
- Cyclos-aware launch handler with fallback to demo celebration
- Fix dead EXEC_STEPS[taskId] lookup, auto-place first task on empty canvas
- DID display truncation for unreadable DIDs in intent routes
- Dark/light theme toggle with localStorage persistence
- Hex hover stroke, commitment description in hex nodes, edit pencil on tasks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 15:08:43 -07:00
Jeff Emmett 5b4300db77 fix(ipfs): correct Kubo container hostname (collab-server-ipfs-1)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 15:06:05 -07:00
Jeff Emmett 789b74a776 ci: retrigger pipeline
CI/CD / deploy (push) Waiting to run Details
2026-04-02 15:05:16 -07:00
Jeff Emmett ca756b22aa Merge branch 'dev' 2026-04-02 14:28:19 -07:00
Jeff Emmett 1672477f68 feat(ipfs): add IPFS integration for backups and generated files
Pin encrypted backups and AI-generated files to Kubo (ipfs.jeffemmett.com)
as fire-and-forget redundancy. Filesystem remains primary storage — IPFS
failures are logged and swallowed. Adds /api/ipfs routes for status,
pin/unpin, and gateway proxy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 14:24:39 -07:00
Jeff Emmett c716723686 Merge branch 'dev'
CI/CD / deploy (push) Failing after 21m52s Details
2026-04-02 14:07:10 -07:00
Jeff Emmett 4b2592c27f fix(rinbox): handle IMAP socket errors to prevent server crash-loop
ImapFlow clients were created without .on('error') handlers. Socket
timeouts emitted unhandled errors that crashed the entire process,
taking down all 32 modules. Added error handlers to all 3 ImapFlow
instantiation sites and a process-level uncaughtException/unhandledRejection
safety net.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-02 13:50:45 -07:00
Jeff Emmett 83ae2e9bd9 Merge branch 'dev'
CI/CD / deploy (push) Successful in 6m9s Details
2026-04-01 15:54:15 -07:00
Jeff Emmett 14f7ccb090 fix(scribus): add healthcheck override for scribus-novnc
The Dockerfile's healthcheck hit a nonexistent /health endpoint, causing
permanent "unhealthy" status. Override with a check that accepts any HTTP
response (including 401) as proof the service is running.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 15:21:30 -07:00
Jeff Emmett 007df8a3bd Merge branch 'dev'
CI/CD / deploy (push) Waiting to run Details
2026-04-01 15:19:33 -07:00
Jeff Emmett c8e4aede02 feat(canvas): module-aware canvas architecture — shapes, tools, and toolbar gated by module
Modules now declare their canvas shapes and AI tools (canvasShapes/canvasToolIds
on RSpaceModule), creating a single source of truth that the canvas enforces:

- Phase 1: Extended RSpaceModule + ModuleInfo, added moduleId to CanvasToolDefinition
  with getToolsForModules() filter, added moduleOf() to ShapeRegistry, populated
  declarations in 9 modules, fixed 8 ungated toolbar buttons (rchoices, rwallet, rsocials)
- Phase 2: AI prompt sends enabledModules, server filters Gemini tool declarations
- Phase 3: folk-commitment-pool and folk-task-request show lock overlay when rtime disabled
- Phase 4: Extracted MODULE_META into shared lib/module-display.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 15:19:12 -07:00
Jeff Emmett 2a3c040990 Merge branch 'dev'
CI/CD / deploy (push) Successful in 6m57s Details
2026-04-01 14:59:38 -07:00
Jeff Emmett 3b0999da64 feat(rtime): commitment notifications + email delivery channel
- Fire commitment_accepted/commitment_declined notifications when solver
  results are accepted/rejected in intent-routes.ts
- Fire commitment_declined when a connection is deleted in mod.ts
- Add metadata (resultId, fromCommitmentId) to commitment_requested notify
- Fix actionUrl to use /rtime (subdomain-relative), not /{space}/rtime
- Add Accept/Decline action buttons in notification bell for
  commitment_requested events (same pattern as space_invite)
- Add email delivery channel to notification-service: sends from
  {space}-agent@rspace.online via SMTP, respects emailEnabled preference,
  inline HTML template with dark theme

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 14:59:10 -07:00
Jeff Emmett bbe93cde78 Merge branch 'dev'
CI/CD / deploy (push) Successful in 2m11s Details
2026-04-01 14:46:28 -07:00
Jeff Emmett c4b85a82e6 feat(rnetwork): graph visualization polish, delegation sync, layers persistence
Phase 1 — UX Polish: loading spinner, node hover glow (THREE.RingGeometry),
empty state, live slider labels, keyboard shortcuts (Esc/F/T/L), toast
notifications, touch-friendly sizing (@media <=768px).

Phase 2 — Live Data Integration: edit delegation flow (POST vs PATCH),
cross-component sync via CustomEvent("delegations-updated"), dynamic
getAuthUrl() fallback chain, sparkline weight tracking via trust events,
revocation-aware time slider, new GET /api/trust/events endpoint,
include_revoked + revokedAt support on /api/delegations/space.

Phase 3 — New Visualizations: BFS delegation path tracing (max depth 3),
node/edge opacity dimming for non-path elements, transitive chain indicators
(TorusGeometry when >30% received weight), network metrics sidebar (Gini
concentration index, top 5 influencers with click-to-focus), log-scale
flow thickness (1.5 + log10(1 + w*9) * 3).

Phase 4 — Layers Persistence: LayerConfig + CrossLayerFlowConfig schema
types, CRDT doc version bump to 2 with migration, saveLayerConfig/
getLayerConfig in local-first-client, auto-persist on rebuildLayerGraph,
restore-on-connect, onEngineTick sine-wave pulse animation for compatible
feed targets during wiring, wiring progress indicator banner.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 14:46:18 -07:00
Jeff Emmett 8f9aa98995 Merge branch 'dev'
CI/CD / deploy (push) Successful in 2m15s Details
2026-04-01 14:38:51 -07:00