Skip to content

Latest commit

 

History

History
 
 

server

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

App Server

The desktop app's own Node server. Electron main starts it, and the UI talks to it over WebSocket RPC. It owns app.db and is a client of one or more CodeWork RPC servers, local and paired.

What It Owns

  • app.db. Kept at <home>/desktop/<channel>/app.db, where <home> is CODEWORK_HOME_DIR, else ~/.codework. Tests name the file with CODEWORK_DATABASE.
  • The machine list. Every RPC server the app knows is a row: local ones found through a home, remote ones paired with a one-time code.
  • A mirror of host state. The sync keeps app.db a copy of each machine's sessions, threads and usage, so reads answer while a machine is away. Commands go to the machine a session is on.
  • Desktop-only state. Issue tracking, tabs, the desk, per-package kv and the event bus live here and nowhere else.
  • Widget backends. Built-in backends from @codeworksh/web/backends run inside this process.

Boundaries

  • It never touches project files. Folders, projects, clones, git diffs and skills are all RPC calls to a host. The host is where agents run and where files live, so the app works the same against a remote machine.
  • It never runs codework serve. A local server's lifecycle goes through codework service <action>.
  • The UI speaks @codeworksh/contract. This server speaks the harness protocol through its contract, @codeworksh/schema/host.

Code Map

Working Locally

It runs as part of vp run dev:desktop from the root. On its own, vp run dev here rebuilds the bundle on change and vp test runs the tests; the live project needs OrbStack machines. See development, testing and desktop internals.