@h-rig/server
v0.0.6-alpha.22
Published
Rig package
Readme
Rig Server
@rig/server is the local server that powers desktop, web, and TUI flows.
Responsibilities
- serve workspace snapshots and artifacts
- broker approvals and remote endpoint state
- expose websocket events for the UI
- isolate authenticated remote users in GitHub-user namespaces for auth state, project registry records, managed checkouts, and uploaded snapshots
Remote user namespaces
When a remote client imports a GitHub token or completes device auth, the server
looks up /user and derives the namespace from the stable GitHub numeric user id
(ghu-<id>). The login is retained as display metadata/fallback only; raw tokens
are never used in filesystem paths or API response metadata.
Default layout on hosted deployments:
/srv/rig/users/ghu-123456/.rig/state/github-auth.json
/srv/rig/users/ghu-123456/.rig/state/projects.json
/srv/rig/users/ghu-123456/remote-checkouts/<owner>/<repo>
/srv/rig/users/ghu-123456/remote-snapshots/<owner>/<repo>/<snapshot-id>RIG_REMOTE_USER_NAMESPACE_ROOT, RIG_REMOTE_CHECKOUT_BASE_DIR, and
RIG_REMOTE_SNAPSHOT_BASE_DIR can override the roots. Existing
remote-checkouts/default paths are treated as explicit/admin existing paths,
not as the authenticated default.
Commands
bun run rig server startbun test packages/server/src/server.test.ts
