@akshar5/cohall 0.4.9 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/install.md CHANGED
@@ -72,12 +72,14 @@ npx -y @akshar5/cohall pair --label "Workstation"
72
72
  unset owner_token
73
73
  ```
74
74
 
75
- Transfer it privately. On the machine being added, provide it through stdin so
76
- it does not appear in process arguments or shell history:
75
+ Transfer it privately. On the machine being added, `cohall init` collects any
76
+ missing values interactively, exchanges the pairing token, writes the
77
+ configuration, and installs the Cohall skill. Provide the token through stdin
78
+ so it does not appear in process arguments or shell history:
77
79
 
78
80
  ```bash
79
81
  read -rsp 'Pairing token: ' pairing_token; printf '\n'
80
- printf '%s' "$pairing_token" | npx -y @akshar5/cohall join \
82
+ printf '%s' "$pairing_token" | npx -y @akshar5/cohall init \
81
83
  --relay https://cohall.example.com \
82
84
  --name workstation \
83
85
  --providers codex \
@@ -85,6 +87,11 @@ printf '%s' "$pairing_token" | npx -y @akshar5/cohall join \
85
87
  unset pairing_token
86
88
  ```
87
89
 
90
+ When run in a terminal, omitted relay, name, workspace, provider, and token
91
+ values are prompted with useful defaults. Re-running `cohall init` repairs the
92
+ skill installation and reuses credentials when the selected relay has not
93
+ changed. `cohall join` remains the non-guided configuration primitive.
94
+
88
95
  Workspace roots must already exist. Cohall resolves them to canonical paths and
89
96
  rejects delegated work outside them.
90
97
 
@@ -93,7 +100,7 @@ For a client that submits work but never runs a device worker:
93
100
  ```bash
94
101
  npx -y @akshar5/cohall pair --client-only --label "Automation client"
95
102
  read -rsp 'Pairing token: ' pairing_token; printf '\n'
96
- printf '%s' "$pairing_token" | npx -y @akshar5/cohall join \
103
+ printf '%s' "$pairing_token" | npx -y @akshar5/cohall init \
97
104
  --relay https://cohall.example.com \
98
105
  --client-only
99
106
  unset pairing_token
@@ -102,6 +109,20 @@ unset pairing_token
102
109
  Automation may use a mode-`0600` token file with `join --token-file
103
110
  /path/to/token`.
104
111
 
112
+ ## Keep a device available
113
+
114
+ After a global installation, install and start the current user's device
115
+ service with one command:
116
+
117
+ ```bash
118
+ cohall service install
119
+ cohall doctor
120
+ ```
121
+
122
+ Linux uses a systemd user service, macOS uses a LaunchAgent, and Windows uses a
123
+ per-user scheduled task. The installer records the exact global Cohall
124
+ executable, so it refuses temporary package-runner and source-checkout paths.
125
+
105
126
  ## Providers
106
127
 
107
128
  Target devices advertise provider executables they can find. Authentication is
@@ -123,9 +144,13 @@ cohall configure --providers auto
123
144
  ## Configuration
124
145
 
125
146
  `cohall config` shows stored configuration without tokens. `cohall configure`
126
- changes the relay URL, device name, workspace roots, providers, model, or Codex
127
- sandbox. `cohall doctor` checks the effective configuration, relay connection,
128
- provider executables, authentication readiness, and versions.
147
+ changes the device name, workspace roots, providers, model, sandbox, or relay
148
+ for a fresh pairing. Use `cohall relay use <url>` when moving an existing relay;
149
+ it preserves credentials only after verifying them at the restored address.
150
+ Non-loopback HTTP is refused unless `--allow-http` explicitly confirms that an
151
+ independent private network such as Tailscale encrypts the connection.
152
+ `cohall doctor` checks the effective configuration, relay connection, provider
153
+ executables, authentication readiness, and versions.
129
154
 
130
155
  Configuration locations:
131
156
 
@@ -180,3 +205,30 @@ Use `cohall upgrade --to 1.2.3` for an exact version, `--dry-run` to inspect the
180
205
  plan, or `--no-restart` to leave services pending a manual restart. Back up a
181
206
  production relay's data directory before an upgrade because SQLite migrations
182
207
  run in place.
208
+
209
+ The relay owner can queue the same built-in upgrade across every registered
210
+ device:
211
+
212
+ ```bash
213
+ cohall upgrade --all --dry-run
214
+ cohall upgrade --all --to 1.2.3
215
+ cohall upgrades
216
+ cohall upgrades abandon <operation-id>
217
+ ```
218
+
219
+ All-device upgrades require the relay owner credential. They are stored by the
220
+ relay, wait for offline devices, and run after active tasks. `cohall upgrades`
221
+ shows the 50 newest queued, running, completed, or failed results. If a device is
222
+ permanently lost, the owner can abandon its operation so later all-device upgrades
223
+ are not blocked. Abandonment records a failed terminal result; it does not stop
224
+ an upgrade already executing on a reachable device. Forgetting an offline device
225
+ also closes its outstanding maintenance operation. The operation accepts only
226
+ `latest` or an exact semantic version and invokes Cohall's existing package
227
+ upgrade path; it cannot transport arbitrary commands. Devices running from a
228
+ temporary package runner report a failure until Cohall is installed globally on
229
+ that device.
230
+
231
+ Use `cohall doctor --all` for device health and version drift, `cohall versions`
232
+ for a compact version inventory, and `cohall usage` for retained task counts by
233
+ device, status, and provider. Usage is Cohall task activity, not provider token
234
+ or billing data.
package/docs/services.md CHANGED
@@ -23,24 +23,26 @@ Install and pair as the user that will run the daemon:
23
23
 
24
24
  ```bash
25
25
  npm install --global --prefix "$HOME/.local" @akshar5/cohall
26
- npx -y @akshar5/cohall doctor
26
+ cohall doctor
27
27
  ```
28
28
 
29
- Copy the service shipped in the globally installed package, then start it:
29
+ Install and start the current user's service:
30
30
 
31
31
  ```bash
32
- package_root="$(npm root --global --prefix "$HOME/.local")/@akshar5/cohall"
33
- install -Dm644 "$package_root/deploy/systemd/cohall-device.service" \
34
- "$HOME/.config/systemd/user/cohall-device.service"
35
- systemctl --user daemon-reload
36
- systemctl --user enable --now cohall-device
32
+ cohall service install
37
33
  journalctl --user -u cohall-device -f
34
+ ```
35
+
36
+ The generated service uses the exact executable that ran the installer. Linger
37
+ is optional. Without it, the user service starts after login and stops with the
38
+ user's service manager. With it, the service starts at boot and remains after
39
+ logout:
40
+
41
+ ```bash
38
42
  loginctl enable-linger "$USER"
39
43
  ```
40
44
 
41
- Linger is optional. Without it, the user service starts after login and stops
42
- with the user's service manager. With it, the service starts at boot and remains
43
- available after logout. Verify the configuration with:
45
+ Verify the configuration with:
44
46
 
45
47
  ```bash
46
48
  systemctl --user is-enabled cohall-device
@@ -88,24 +90,87 @@ the listener available across relay service restarts: new connections wait for
88
90
  the replacement process instead of failing. Existing WebSockets reconnect, and
89
91
  durable tasks resume after the replacement relay starts.
90
92
 
93
+ ## Move a relay
94
+
95
+ A relay's SQLite database and owner credential are its portable state. Use the
96
+ supported command instead of copying a live `cohall.db`: it uses SQLite's online
97
+ backup API so the snapshot is consistent while the old relay is running.
98
+
99
+ ```bash
100
+ cohall relay backup ./cohall-relay-backup
101
+ ```
102
+
103
+ Run that command with the same `COHALL_DATA_DIR` and operating-system account
104
+ as the relay service. The destination must be new and its parent must be
105
+ operator-owned or a sticky shared directory. Copy the resulting directory to
106
+ the new host over a private channel.
107
+
108
+ The backup contains exactly three files:
109
+
110
+ - `cohall.db`: devices, workspaces advertised by those devices, threads,
111
+ prompts, context, results, trace history, provider-session references,
112
+ durable upgrades, pairings, and hashed client/device session credentials;
113
+ - `owner-token`: the plaintext relay owner credential;
114
+ - `manifest.json`: format/version metadata and SHA-256 checksums.
115
+
116
+ It does not contain device-local Cohall configuration or bearer tokens,
117
+ workspace files, provider logins, service definitions, logs, DNS, reverse-proxy
118
+ configuration, or TLS keys. Back up those host-level pieces separately when
119
+ they are part of the deployment. Anyone who obtains this directory gets the
120
+ owner credential and sensitive task history, so encrypt it at rest when the
121
+ storage or transfer channel is not already protected.
122
+
123
+ On the new host, install Cohall and restore into the new service's data
124
+ directory before starting it:
125
+
126
+ ```bash
127
+ COHALL_DATA_DIR=/var/lib/cohall cohall relay restore ./cohall-relay-backup
128
+ ```
129
+
130
+ The target data directory must not already exist. Restore refuses to overwrite
131
+ one, rejects symlinked members, copies into a private staging directory, verifies
132
+ the staged file checksums and SQLite integrity, and publishes the restored
133
+ directory atomically. Run the command as the service account so the resulting
134
+ files have the correct owner. The restored `owner-token` file supplies the
135
+ owner credential when `COHALL_TOKEN` is unset; if the new service explicitly
136
+ sets that variable, it must use the same value.
137
+
138
+ Configure the private network or HTTPS endpoint, start the relay, and check its
139
+ health. If its address changed, update every client and device:
140
+
141
+ ```bash
142
+ cohall relay use https://new-relay.example.com
143
+ cohall doctor
144
+ ```
145
+
146
+ `relay use` first proves that every stored client and device credential works
147
+ against the new relay. Only then does it save the address. It restarts an
148
+ active managed device service automatically; use `--no-restart` when another
149
+ supervisor owns the process. Environment-based configurations must update
150
+ `COHALL_RELAY_URL` in their service environment instead.
151
+
152
+ HTTPS is required for non-loopback addresses because verification sends the
153
+ stored credentials to the new endpoint. When a private network such as Tailscale
154
+ provides the encrypted transport and the relay intentionally uses HTTP, make
155
+ that assumption explicit:
156
+
157
+ ```bash
158
+ cohall relay use http://cohall-vps.tailnet-name.ts.net:8787 --allow-http
159
+ ```
160
+
161
+ Keeping the same stable DNS or Tailscale name avoids the final per-device step.
162
+ Only change where that name resolves after the restored relay is healthy.
163
+
91
164
  ## macOS
92
165
 
93
- Run `npm install --global @akshar5/cohall`, copy the packaged launch agent, then
94
- update its executable path to match `command -v cohall`:
166
+ Run `npm install --global @akshar5/cohall`, then install and start the
167
+ LaunchAgent:
95
168
 
96
169
  ```bash
97
- package_root="$(npm root --global)/@akshar5/cohall"
98
- mkdir -p "$HOME/Library/LaunchAgents"
99
- cp "$package_root/deploy/launchd/com.cohall.device.plist" \
100
- "$HOME/Library/LaunchAgents/com.cohall.device.plist"
101
- cohall_path="$(command -v cohall)"
102
- /usr/libexec/PlistBuddy -c "Set :ProgramArguments:0 $cohall_path" \
103
- "$HOME/Library/LaunchAgents/com.cohall.device.plist"
104
- launchctl bootstrap gui/"$(id -u)" ~/Library/LaunchAgents/com.cohall.device.plist
105
- launchctl kickstart -k gui/"$(id -u)"/com.cohall.device
170
+ cohall service install
106
171
  ```
107
172
 
108
- The packaged LaunchAgent uses `RunAtLoad` and `KeepAlive`: it starts at login,
173
+ The generated LaunchAgent uses `RunAtLoad` and `KeepAlive`: it starts at login,
109
174
  restarts after failure, and reconnects when the network returns. It cannot run
110
175
  before that user logs in. Check it with:
111
176
 
@@ -122,9 +187,7 @@ Run `npm install --global @akshar5/cohall`, pair and verify the machine from
122
187
  PowerShell, then run:
123
188
 
124
189
  ```powershell
125
- $packageRoot = Join-Path (npm root --global) "@akshar5/cohall"
126
- powershell -ExecutionPolicy Bypass -File `
127
- (Join-Path $packageRoot "deploy/windows/install-device.ps1")
190
+ cohall service install
128
191
  ```
129
192
 
130
193
  The script registers a per-user scheduled task that starts `cohall device` at
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akshar5/cohall",
3
- "version": "0.4.9",
3
+ "version": "0.5.0",
4
4
  "description": "Let coding agents delegate work across your own devices.",
5
5
  "keywords": [
6
6
  "agents",