Appearance
Desktop Configuration Service
@soma/desktop-config is the shared Electron runtime config layer for Soma and Tapia.
It centralizes:
- stage detection
- stage-specific Electron data paths
- daemon socket naming
- agent socket naming
Package location:
desktop/desktp-config/
Main implementation:
desktop/desktp-config/src/stage-config.ts
What It Does
StageConfigService resolves a runtime stage and then adjusts Electron paths and local socket names to keep dev, staging, and prod installs isolated from each other.
For non-prod stages it rewrites Electron paths such as:
appDatauserDatasessionDatalogscachecrashDumps
It also updates the app name with the stage suffix.
Stage Resolution
The service resolves stage from:
- explicit environment overrides when allowed
- stage suffix in the packaged app name
devwhen running unpackaged in development- otherwise
prod
Important behavior:
- packaged apps ignore normal env overrides by default
- unpackaged/dev runs allow env overrides
productionnormalizes toprod
Socket Naming
Default socket directory:
/tmp
Default socket names for the Soma app family:
| Stage | Daemon socket | Agent socket |
|---|---|---|
prod | /tmp/soma-daemon.sock | /tmp/soma-agentd.sock |
dev | /tmp/soma-daemon-dev.sock | /tmp/soma-agentd-dev.sock |
staging | /tmp/soma-daemon-staging.sock | /tmp/soma-agentd-staging.sock |
The suffix rule is simple:
prod: no suffix- everything else:
-<stage>.sock
Local Development Implication
Your running daemons must match the stage-specific socket path the app expects.
Examples:
just run-daemon->/tmp/soma-daemon-dev.sockjust run-agentd->/tmp/soma-agentd-dev.sock
If the sockets do not match, the desktop app will fail to connect even if the processes are otherwise healthy.
Current Package Shape
The package currently exports its source entry directly:
desktop/desktp-config/package.json
So the important source of truth is the implementation in src/stage-config.ts.