The cloaking patterns every site uses before its own, unless the site turns them off.
The site last chosen in either front end, when it still exists.
Adds a site and returns it as stored. Its first server becomes the Remote
server unless remoteServerId says otherwise.
SyncError E_CONFIG_INVALID when the site is not valid or its name is taken.
Adds a server to a site. The first server of a site becomes its Remote server.
The site with this id, as a copy that can be changed freely.
Every site, in the order they were added.
Reads sites.json again, for example after another process changed it.
Removes a site from the list and returns it. Its local folder, its servers' files, its saved secrets and its sync records are not touched.
Removes a server and clears any role it held.
Replaces a site with next, as edited in an editor. The id cannot change.
Replaces a server with next, as edited in an editor. The id cannot change.
Finds a site by id, by name ignoring case, or by a path inside its local root, where the deepest local root wins.
Records the site last chosen, so either front end can open on it; undefined clears it.
Changes a site in place. change may edit any field except id.
Changes the global cloaking patterns. Removing the last one removes the global cloaking from the file.
SyncError E_CONFIG_INVALID when a pattern is not valid.
Changes a server in place. change may edit any field except id.
StaticopenReads the master list, creating it on first use.
The master list of sites in
sites.json, shared by the CLI and the VS Code extension. Every write takes the lock file, re-reads the file so another process's change is never lost, validates the result, keeps the previous version assites.json.bak, and replaces the file atomically. A file that fails validation is never rewritten.