Remote / foldkit-remote-server

What this package owns

client owns
  which server facts are required

foldkit-remote-server owns
  requirement interpretation
  field authorization
  read grouping / de-duplication
  nested selection traversal
  normalized wire results

application Sources own
  how those facts are actually loaded or changed

Effect RPC / application owns
  transport + serialization + authentication

That separation matters. RemoteServer can decide that a client may read Project.name but not Project.privateNotes; only your Source knows whether that field comes from Postgres, another service, an in-memory index, or something else.

It does not own HTTP or WebSocket transport, authentication or session storage, a database connection, the client's normalized cache, or Surface activation. A durable write is the client's to keep (Remote's outbox) and the writer's to recognise when it comes again (a ledger); this package only passes its operation id through. Client-authored state that must merge across devices is foldkit-sync's.

Install

bash
pnpm add foldkit-remote-server

effect is a peer dependency; foldkit-remote comes with the package. foldkit-remote-drizzle is an optional Source compiler for Drizzle-backed entities and queries.