@akshar5/cohall 0.8.0 → 0.10.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/CHANGELOG.md +53 -0
- package/README.md +84 -17
- package/bin/cohall.js +1922 -544
- package/bin/cohall.js.map +23 -22
- package/deploy/windows/install-device.ps1 +25 -2
- package/docs/grok-bot.md +7 -0
- package/docs/install.md +32 -5
- package/docs/integrations.md +188 -7
- package/docs/muse.md +162 -0
- package/docs/releasing.md +2 -2
- package/docs/services.md +68 -12
- package/package.json +1 -1
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
param(
|
|
2
2
|
[Parameter(Mandatory = $true)][string]$NodeExecutable,
|
|
3
3
|
[Parameter(Mandatory = $true)][string]$Entrypoint,
|
|
4
|
-
[Parameter(Mandatory = $true)][string]$ConfigurationPath
|
|
4
|
+
[Parameter(Mandatory = $true)][string]$ConfigurationPath,
|
|
5
|
+
[string]$PnpmHome,
|
|
6
|
+
[string]$PnpmExecutable,
|
|
7
|
+
[string]$PnpmStoreDir,
|
|
8
|
+
[string]$PnpmGlobalDir,
|
|
9
|
+
[string]$PnpmGlobalBinDir
|
|
5
10
|
)
|
|
6
11
|
|
|
7
12
|
$ErrorActionPreference = "Stop"
|
|
@@ -10,10 +15,28 @@ function Quote-Literal([string]$Value) {
|
|
|
10
15
|
return "'" + $Value.Replace("'", "''") + "'"
|
|
11
16
|
}
|
|
12
17
|
|
|
18
|
+
$pnpmEnvironment = if ($PnpmHome) {
|
|
19
|
+
"`$env:PNPM_HOME = $(Quote-Literal $PnpmHome)`r`n`$env:PATH = $(Quote-Literal ((Join-Path $PnpmHome 'bin') + ';' + $PnpmHome)) + ';' + `$env:PATH`r`n"
|
|
20
|
+
} else { "" }
|
|
21
|
+
|
|
22
|
+
if ($PnpmExecutable) {
|
|
23
|
+
$pnpmEnvironment += "`$env:COHALL_PNPM_EXECUTABLE = $(Quote-Literal $PnpmExecutable)`r`n"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if ($PnpmStoreDir) {
|
|
27
|
+
$pnpmEnvironment += "`$env:COHALL_PNPM_STORE_DIR = $(Quote-Literal $PnpmStoreDir)`r`n"
|
|
28
|
+
}
|
|
29
|
+
if ($PnpmGlobalDir) {
|
|
30
|
+
$pnpmEnvironment += "`$env:COHALL_PNPM_GLOBAL_DIR = $(Quote-Literal $PnpmGlobalDir)`r`n"
|
|
31
|
+
}
|
|
32
|
+
if ($PnpmGlobalBinDir) {
|
|
33
|
+
$pnpmEnvironment += "`$env:COHALL_PNPM_GLOBAL_BIN_DIR = $(Quote-Literal $PnpmGlobalBinDir)`r`n`$env:PATH = $(Quote-Literal $PnpmGlobalBinDir) + ';' + `$env:PATH`r`n"
|
|
34
|
+
}
|
|
35
|
+
|
|
13
36
|
$bootstrap = @"
|
|
14
37
|
`$ErrorActionPreference = 'Stop'
|
|
15
38
|
`$env:COHALL_CONFIG = $(Quote-Literal $ConfigurationPath)
|
|
16
|
-
`$env:PATH = $(Quote-Literal (Split-Path -Parent $NodeExecutable)) + ';' + `$env:PATH
|
|
39
|
+
${pnpmEnvironment}`$env:PATH = $(Quote-Literal (Split-Path -Parent $NodeExecutable)) + ';' + `$env:PATH
|
|
17
40
|
& $(Quote-Literal $NodeExecutable) $(Quote-Literal $Entrypoint) device
|
|
18
41
|
exit `$LASTEXITCODE
|
|
19
42
|
"@
|
package/docs/grok-bot.md
CHANGED
|
@@ -164,6 +164,13 @@ See [Bot replies and cancellation](../README.md#talk-to-your-grok-bots) for
|
|
|
164
164
|
how Cohall records the answer. The local gateway is experimental and may change
|
|
165
165
|
with Grok Bot updates.
|
|
166
166
|
|
|
167
|
+
Bots must preserve the task and `--run-id` in their supplied callback command.
|
|
168
|
+
Use `--question 'Your question'` for essential missing information, then end the
|
|
169
|
+
turn. The requester answers with `cohall answer`; Cohall sends a resumed handoff
|
|
170
|
+
with the answer and a new callback. Questions submitted while the worker is
|
|
171
|
+
disconnected reach the requester's inbox when it reconnects. Paused tasks can be cancelled. See
|
|
172
|
+
[clarification and resume](integrations.md#clarification-and-resume).
|
|
173
|
+
|
|
167
174
|
## Give the setup to a Bot
|
|
168
175
|
|
|
169
176
|
Once you have added the Tailscale policy, you can send this to a Bot on the
|
package/docs/install.md
CHANGED
|
@@ -90,7 +90,9 @@ unset pairing_token
|
|
|
90
90
|
When run in a terminal, omitted relay, name, workspace, provider, and token
|
|
91
91
|
values are prompted with useful defaults. Re-running `cohall init` repairs the
|
|
92
92
|
skill installation and reuses credentials when the selected relay has not
|
|
93
|
-
changed.
|
|
93
|
+
changed. Keeping the default workspace retains all configured roots;
|
|
94
|
+
`init --client-only` also retains the worker's provider selection unless
|
|
95
|
+
`--providers` overrides it. `cohall join` remains the non-guided configuration primitive.
|
|
94
96
|
|
|
95
97
|
Workspace roots must be existing directories. Cohall resolves them to canonical paths and
|
|
96
98
|
rejects delegated work outside them.
|
|
@@ -148,6 +150,10 @@ cohall configure --providers codex,claude-code
|
|
|
148
150
|
cohall configure --providers auto
|
|
149
151
|
```
|
|
150
152
|
|
|
153
|
+
Restart the worker after changing its provider selection. Queued work for a
|
|
154
|
+
disabled provider fails with an error instead of starting that provider.
|
|
155
|
+
`auto` enables all detected providers.
|
|
156
|
+
|
|
151
157
|
## Configuration
|
|
152
158
|
|
|
153
159
|
`cohall config` shows stored configuration without tokens. `cohall configure`
|
|
@@ -212,15 +218,34 @@ the new version, and restarts only active Cohall services. If a service points
|
|
|
212
218
|
to another global installation, Cohall stops and reports the correct executable
|
|
213
219
|
instead of restarting the wrong job.
|
|
214
220
|
|
|
215
|
-
|
|
216
|
-
|
|
221
|
+
Upgrades and device service installation require a verified global installation.
|
|
222
|
+
Project dependencies and package-runner caches are rejected before making changes.
|
|
223
|
+
For npm, the global `cohall` command must still point to this installation.
|
|
224
|
+
For Bun, Cohall checks the selected Bun executable's configured global directory,
|
|
225
|
+
including custom `install.globalDir` or `BUN_INSTALL_GLOBAL_DIR` settings, and pins
|
|
226
|
+
installation to that directory. Use the same Bun configuration when invoking
|
|
227
|
+
Cohall; a different global directory is rejected.
|
|
228
|
+
|
|
229
|
+
The default target, `latest`, is resolved through that package manager using its
|
|
230
|
+
registry and network settings, then pinned before installation. Bun installations
|
|
231
|
+
require Bun 1.2.15 or newer for this lookup; older Bun versions can still use an
|
|
232
|
+
exact `--to` version. If `latest` is older than the running or installed version,
|
|
233
|
+
Cohall leaves the installation and services untouched. Version ordering includes
|
|
234
|
+
prereleases and ignores build metadata. A failed or invalid lookup, or unreadable
|
|
235
|
+
installed package metadata, stops the upgrade before installation. Use an exact
|
|
236
|
+
`--to` version to repair damaged metadata.
|
|
237
|
+
|
|
238
|
+
Use `cohall upgrade --to 1.2.3` for an exact version, including an intentional
|
|
239
|
+
rollback. Use `--dry-run` to inspect the plan, or `--no-restart` to leave services
|
|
240
|
+
pending a manual restart. Back up a
|
|
217
241
|
production relay's data directory before an upgrade because SQLite migrations
|
|
218
242
|
run in place.
|
|
219
243
|
|
|
220
244
|
An exact version already installed on disk skips package installation and still
|
|
221
245
|
restarts active services. Dry runs and failed installations preserve restart
|
|
222
246
|
recovery state. A new explicit version takes precedence over an older recovery
|
|
223
|
-
record.
|
|
247
|
+
record, while retaining unfinished restarts for the new version. `--no-restart`
|
|
248
|
+
also preserves pending restarts for a later retry.
|
|
224
249
|
|
|
225
250
|
Upgrade tools use the first PATH candidate that passes ownership and permission
|
|
226
251
|
checks. Unsafe candidates are skipped; an explicit executable path must pass
|
|
@@ -240,7 +265,9 @@ cohall upgrades abandon <operation-id>
|
|
|
240
265
|
|
|
241
266
|
All-device upgrades require the relay owner credential. They are stored by the
|
|
242
267
|
relay, wait for offline devices, and run after active tasks. `cohall upgrades`
|
|
243
|
-
shows the 50 newest queued, running, completed, or failed results.
|
|
268
|
+
shows the 50 newest queued, running, completed, or failed results. A `latest`
|
|
269
|
+
operation applies the same downgrade check on each device when it executes;
|
|
270
|
+
upgrade older daemons individually once to gain this protection. Upgrade devices
|
|
244
271
|
older than Cohall 0.5.0 individually once before using all-device upgrades; the
|
|
245
272
|
relay rejects work that their daemons cannot understand. If a device is permanently
|
|
246
273
|
lost, the owner can abandon its operation so later all-device upgrades are not
|
package/docs/integrations.md
CHANGED
|
@@ -4,12 +4,159 @@ CLI plus skill is the recommended integration. MCP is available for harnesses
|
|
|
4
4
|
that prefer native tool discovery. Both create the same relay tasks; use one
|
|
5
5
|
entry point per task.
|
|
6
6
|
|
|
7
|
-
For queued work, `cohall inbox` or the MCP `completion_inbox` tool lists
|
|
8
|
-
the sending client has not handled. Fetch a full
|
|
9
|
-
<task-id>` or `task_status`, then use
|
|
10
|
-
`acknowledge_completion` to remove it from the inbox. A synchronous `delegate`
|
|
7
|
+
For queued work, `cohall inbox` or the MCP `completion_inbox` tool lists questions
|
|
8
|
+
awaiting answers and results the sending client has not handled. Fetch a full
|
|
9
|
+
result with `cohall status <task-id>` or `task_status`, then use
|
|
10
|
+
`cohall inbox ack <task-id>` or `acknowledge_completion` to remove it from the inbox. A synchronous `delegate`
|
|
11
11
|
call acknowledges its result automatically.
|
|
12
12
|
|
|
13
|
+
Cancelling an MCP `delegate` or `wait_task` request stops its wait and polling.
|
|
14
|
+
Accepted work continues. To stop coding work, use `cancel_task` or a task deadline.
|
|
15
|
+
Later completions stay in the inbox.
|
|
16
|
+
|
|
17
|
+
## Retrying submissions
|
|
18
|
+
|
|
19
|
+
Generate and save a UUID v4 before submitting work. Pass it as `--request-id`
|
|
20
|
+
on `send` or `delegate`, or as `request_id` on the MCP `delegate` tool:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
cohall delegate --target @<device-id> \
|
|
24
|
+
--request-id 11111111-1111-4111-8111-111111111111 \
|
|
25
|
+
--prompt 'Inspect deployment 184.' --no-wait
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
After a lost response, repeat the submission with the same ID, input, and client
|
|
29
|
+
credential. The relay returns the original task's current state, including
|
|
30
|
+
after a relay restart. Retries create no second task or thread message. Worker
|
|
31
|
+
execution remains at least once: a run interrupted by a disconnect can restart.
|
|
32
|
+
If the worker is still running that turn, it confirms the active run after
|
|
33
|
+
reconnecting so progress and clarification continue without starting it again.
|
|
34
|
+
The task keeps its original start time; its trace records the new acknowledgment.
|
|
35
|
+
Requests without an ID continue to create a new task each time.
|
|
36
|
+
|
|
37
|
+
Use a device UUID or `@device-uuid/bot-id` from `cohall bots` for retries. These
|
|
38
|
+
targets bypass live name discovery when a request ID is supplied, so the original
|
|
39
|
+
task can still be recovered after its target is forgotten or stops advertising
|
|
40
|
+
the provider. Names need discovery on each call. With a request ID, a thread
|
|
41
|
+
follow-up must select a target or provider explicitly. Select the Bot explicitly
|
|
42
|
+
for a Bot follow-up. Cohall does not retry submissions automatically.
|
|
43
|
+
|
|
44
|
+
IDs belong to the original requester credential. Another pairing or the relay
|
|
45
|
+
owner has a separate ID namespace. Keep all task input unchanged, including
|
|
46
|
+
context, thread and parent IDs, workspace, target, provider, deadline, and attachment
|
|
47
|
+
names and bytes. Reusing an ID with changed input returns HTTP 409. Default Codex and
|
|
48
|
+
an empty attachment list normalize to their omitted forms.
|
|
49
|
+
|
|
50
|
+
Used IDs and input hashes remain in the relay database and its backups after
|
|
51
|
+
terminal task history is pruned. They have no expiry. The retained record has no
|
|
52
|
+
prompt, context, or attachment content. If the original task was pruned, retrying
|
|
53
|
+
returns HTTP 410 and the ID stays consumed. Check whether that work completed
|
|
54
|
+
before deciding to submit new work with a new ID. Upgrade older relays before
|
|
55
|
+
using request IDs; clients reject unsupported relays before submission.
|
|
56
|
+
|
|
57
|
+
## Clarification and resume
|
|
58
|
+
|
|
59
|
+
A worker missing essential information can ask the sender, then end its current
|
|
60
|
+
turn immediately:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
cohall request-input --question 'Which branch should I use?'
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The task and current turn IDs are inherited during delegated coding work.
|
|
67
|
+
Outside that environment, supply `<task-id>` explicitly. `--run-id <run-id>`
|
|
68
|
+
selects a specific worker turn; otherwise Cohall reads the task's current turn.
|
|
69
|
+
MCP provides `task_request_input` with `question`, optional `task_id`, and optional
|
|
70
|
+
`run_id`. Grok Bots use the callback command supplied in their handoff with
|
|
71
|
+
`--question` and its `--run-id`.
|
|
72
|
+
|
|
73
|
+
After the worker ends its turn, the task becomes `needs_input` and frees its
|
|
74
|
+
worker slot. `delegate`, `send`, and `wait` return at this state as well as at a
|
|
75
|
+
terminal result. Read `input_request.id` and `input_request.question` in their
|
|
76
|
+
JSON or `status`; inbox entries use `inputRequest` instead. Questions cannot be
|
|
77
|
+
acknowledged as completions.
|
|
78
|
+
|
|
79
|
+
The original requester credential or relay owner answers the current question:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
cohall answer <task-id> --request-id <question-id> --message 'Use main.'
|
|
83
|
+
cohall wait <task-id> --timeout 1800
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Answers also support `--message-file <path>` or `--message -` for stdin. MCP
|
|
87
|
+
provides `task_answer` with `task_id`, `request_id`, and `answer`, followed by
|
|
88
|
+
`wait_task`. A stale question ID or duplicate answer is rejected. Use known
|
|
89
|
+
facts from the conversation; ask the user when the answer is missing.
|
|
90
|
+
|
|
91
|
+
The same task and thread resume on their original target, using the saved
|
|
92
|
+
provider session when available. Answered questions are included in the resumed
|
|
93
|
+
prompt, including after a restart. An offline target waits in the queue. Each
|
|
94
|
+
task permits ten questions; each question and answer must be nonblank and at most
|
|
95
|
+
4096 UTF-8 bytes. Cancel a paused task with `cohall cancel <task-id>`.
|
|
96
|
+
Tasks awaiting their first dispatch cancel immediately. Coding tasks that may
|
|
97
|
+
have reached a worker stay `cancelling` until it confirms termination, including
|
|
98
|
+
tasks requeued after a disconnect and paused tasks. An offline worker acknowledges
|
|
99
|
+
the cancellation after reconnecting.
|
|
100
|
+
|
|
101
|
+
The assigned task, including its prompt, context, and clarification history,
|
|
102
|
+
must fit the 1 MiB transfer limit. Oversized assignments fail with an explicit
|
|
103
|
+
error; retry with a shorter prompt or context.
|
|
104
|
+
|
|
105
|
+
Each task supports up to ten clarification questions. If a Bot ends its turn
|
|
106
|
+
with another question after that limit, the task fails with a visible error
|
|
107
|
+
and releases the Bot for subsequent work.
|
|
108
|
+
|
|
109
|
+
Upgrade the relay, requester, and worker before using clarification. Resumed
|
|
110
|
+
tasks and Bot turns using a run ID remain queued while the worker lacks
|
|
111
|
+
clarification support. Inbox checks
|
|
112
|
+
and waits poll the relay; Cohall does not wake a requester to deliver a question.
|
|
113
|
+
|
|
114
|
+
## Task deadlines
|
|
115
|
+
|
|
116
|
+
`--timeout` and MCP `timeout_seconds` limit how long the requester waits.
|
|
117
|
+
The limit covers task-status lookup and polling, including slow responses.
|
|
118
|
+
Timing out stops the wait; accepted work continues and later completions stay in the inbox.
|
|
119
|
+
To stop coding work at a fixed time, give `delegate` a future UTC timestamp:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
cohall delegate --target @linux --no-wait \
|
|
123
|
+
--deadline 2030-01-01T18:00:00Z \
|
|
124
|
+
--prompt 'Run the test suite and report failures.'
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
MCP `delegate` accepts `deadline` in the same format. HTTP `POST /api/tasks`
|
|
128
|
+
accepts `expiresAt`. Task results return `expires_at`; relay task records and
|
|
129
|
+
traces use `expiresAt`. Omit the field for work without a deadline.
|
|
130
|
+
|
|
131
|
+
The deadline covers queueing, execution, and time awaiting clarification.
|
|
132
|
+
Restarting or resuming a task keeps its original deadline. An expired task
|
|
133
|
+
fails with `Task deadline exceeded`. Tasks awaiting their first dispatch fail
|
|
134
|
+
without contacting the worker. Tasks that may have reached a worker stay
|
|
135
|
+
`cancelling` until it confirms termination. An offline worker
|
|
136
|
+
acknowledges after reconnecting; its local timer stops active coding work even
|
|
137
|
+
while disconnected. A manual cancellation requested before the deadline still
|
|
138
|
+
finishes as `cancelled`.
|
|
139
|
+
|
|
140
|
+
Upgrade the requester, relay, and target worker before using deadlines. Cohall
|
|
141
|
+
rejects older relays and targets that do not advertise deadline support. Saved
|
|
142
|
+
deadline tasks stay queued if their worker is downgraded, and still expire.
|
|
143
|
+
Deadlines apply to coding providers only. The Grok Bot gateway cannot safely
|
|
144
|
+
stop a specific turn, so Bot deadline requests are rejected.
|
|
145
|
+
|
|
146
|
+
## Worker progress
|
|
147
|
+
|
|
148
|
+
Workers can report a brief milestone with `cohall progress --message "Running
|
|
149
|
+
tests"` or MCP `task_progress`. Both inherit the task ID during delegated work;
|
|
150
|
+
otherwise supply the task ID explicitly. Notes must be nonblank and at most
|
|
151
|
+
1024 UTF-8 bytes. Only the task's target device or relay owner may update a
|
|
152
|
+
running task. Use milestones, never logs or secrets.
|
|
153
|
+
|
|
154
|
+
`cohall status <task-id>`, `cohall trace <task-id> --follow`, and MCP `task_status`
|
|
155
|
+
and `task_trace` include the latest note and timestamp. Notes replace one another
|
|
156
|
+
and clear when work is requeued, pauses for input, or finishes.
|
|
157
|
+
Reporting progress requires an updated relay; it does not change task status
|
|
158
|
+
or acknowledge a completion.
|
|
159
|
+
|
|
13
160
|
## CLI plus skill
|
|
14
161
|
|
|
15
162
|
```bash
|
|
@@ -27,6 +174,27 @@ With a client credential, `doctor` starts Cohall's MCP server and verifies that
|
|
|
27
174
|
it lists tools. This checks the local server; the agent host still needs a
|
|
28
175
|
working MCP configuration to load it.
|
|
29
176
|
|
|
177
|
+
A running MCP server checks its launched executable at most once per minute
|
|
178
|
+
when returning tool results. If that file changes to a different Cohall version,
|
|
179
|
+
the next checked result includes a notice to restart the Cohall MCP connection
|
|
180
|
+
in your agent host. Each detected version produces one notice; the tool's
|
|
181
|
+
normal result is preserved. The server does not restart an active session.
|
|
182
|
+
Version probes time out after two seconds and failed probes retry on a later
|
|
183
|
+
tool call. This detects changes to the launched file, including a replaced
|
|
184
|
+
symlink target. It does not check the npm registry or other installations. An
|
|
185
|
+
`npx` session using an unchanged cache path must be restarted to load a newer
|
|
186
|
+
package.
|
|
187
|
+
|
|
188
|
+
`doctor` also checks the client credential with an authenticated relay request.
|
|
189
|
+
The `client_authentication` result separates rejected credentials and relay
|
|
190
|
+
request failures from an offline device. `client_credential` reports only
|
|
191
|
+
whether a credential is configured. The authentication check is skipped when
|
|
192
|
+
the relay is unreachable or no client credential is configured.
|
|
193
|
+
|
|
194
|
+
`doctor` warns when a configured Grok Bot gateway is unavailable in automatic
|
|
195
|
+
provider mode or when `grok-bot` is explicitly selected. An explicit provider
|
|
196
|
+
list that excludes `grok-bot` skips this warning.
|
|
197
|
+
|
|
30
198
|
Any other harness with shell access can invoke the CLI directly. No Cohall UI
|
|
31
199
|
extension is required.
|
|
32
200
|
|
|
@@ -36,6 +204,15 @@ infers `grok-bot` from a Bot target. See [Grok Bot setup](../README.md#talk-to-y
|
|
|
36
204
|
for messaging details, and [computer setup](grok-bot.md) for Tailscale, pairing,
|
|
37
205
|
and the local gateway.
|
|
38
206
|
|
|
207
|
+
Device discovery uses `GET /api/devices/page`, returning `devices` and an
|
|
208
|
+
optional `nextCursor`. Pass that cursor as `after` on the next request; an absent
|
|
209
|
+
cursor ends the list. Pages contain up to 16 devices and at most 3 MiB of JSON.
|
|
210
|
+
They follow device UUID order; clients sort the complete list by name.
|
|
211
|
+
`GET /api/devices` still returns the full array for older clients.
|
|
212
|
+
Updated clients fall back to that array on older relays, retaining its 2 MiB
|
|
213
|
+
response limit. Upgrade both the relay and client for large device or Bot
|
|
214
|
+
inventories.
|
|
215
|
+
|
|
39
216
|
When delegating from a conversation, the sending agent must distill why the user
|
|
40
217
|
is asking, relevant facts and prior findings, constraints, and the intended
|
|
41
218
|
decision into Cohall's `context` field. Cohall cannot read the harness transcript
|
|
@@ -95,11 +272,15 @@ Add to `opencode.json`:
|
|
|
95
272
|
|
|
96
273
|
## Isolated environments
|
|
97
274
|
|
|
275
|
+
For a hosted Muse sandbox, see [Muse requester setup](muse.md) for client-only
|
|
276
|
+
pairing, proxy access, and collecting delegated results.
|
|
277
|
+
|
|
98
278
|
The MCP subprocess reads the current user's Cohall configuration. If a harness
|
|
99
279
|
uses an isolated environment, pass `COHALL_CONFIG` with an absolute path to that
|
|
100
280
|
configuration file. Alternatively pass `COHALL_RELAY_URL` and
|
|
101
281
|
`COHALL_CLIENT_TOKEN` directly.
|
|
102
282
|
|
|
103
|
-
Never place an owner or device token in an MCP configuration.
|
|
104
|
-
|
|
105
|
-
|
|
283
|
+
Never place an owner or device token in an MCP configuration. Task tracing through
|
|
284
|
+
`cohall trace <task-id>` or `task_trace` omits prompts, final results, credentials,
|
|
285
|
+
and provider session IDs. It includes worker progress and clarification text;
|
|
286
|
+
inspect those fields before sharing a trace.
|
package/docs/muse.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Muse requester setup
|
|
2
|
+
|
|
3
|
+
Muse can submit tasks to Cohall from a sandbox with shell access, Node.js 24 or
|
|
4
|
+
newer, and an approved network route to your relay. Pair it as a client-only
|
|
5
|
+
requester. Your existing Cohall device workers run the delegated work.
|
|
6
|
+
|
|
7
|
+
The requester commands have been verified through an authenticated proxy.
|
|
8
|
+
The hosted Muse integration has not been tested end to end.
|
|
9
|
+
|
|
10
|
+
Cohall has no Muse worker adapter or Muse wake integration. This setup does not
|
|
11
|
+
make Muse a target in `cohall devices` or start a new Muse turn when work arrives.
|
|
12
|
+
|
|
13
|
+
## Relay access
|
|
14
|
+
|
|
15
|
+
Use an HTTPS relay address reachable from the sandbox. A private relay requires
|
|
16
|
+
an approved private network route or tunnel proxy provided by the sandbox host.
|
|
17
|
+
Tailscale access on your computer does not give the sandbox the same access.
|
|
18
|
+
Keep the relay address stable. If the relay moves with its existing data, switch
|
|
19
|
+
the stored address after the new endpoint is reachable:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
unset COHALL_RELAY_URL
|
|
23
|
+
npx -y @akshar5/cohall relay use https://new-relay.example.com
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This verifies and preserves the stored credential. Changing only
|
|
27
|
+
`COHALL_RELAY_URL` does not reuse a credential bound to the old address.
|
|
28
|
+
See [relay migration](../README.md#move-a-relay) for moving the relay data.
|
|
29
|
+
|
|
30
|
+
Cohall's requester uses Node's `fetch`. In a proxy-only environment, enable
|
|
31
|
+
Node's use of the proxy settings before starting Cohall:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
export NODE_USE_ENV_PROXY=1
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Preserve the host's `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`, and
|
|
38
|
+
`NODE_EXTRA_CA_CERTS` settings. If the regular egress proxy cannot reach the
|
|
39
|
+
private relay, obtain the correct route from the host operator. Do not guess
|
|
40
|
+
proxy endpoints or copy proxy credentials into chat, command arguments, or
|
|
41
|
+
checked-in files. A relay listed in `NO_PROXY` bypasses the proxy, which fails
|
|
42
|
+
when the sandbox has no direct route to it.
|
|
43
|
+
|
|
44
|
+
`NODE_USE_ENV_PROXY=1` is supported for `fetch` starting with Node.js 24.0.0,
|
|
45
|
+
as documented in [Node's 24.0.0 command-line API](https://nodejs.org/download/release/v24.0.0/docs/api/cli.html#node_use_env_proxy1).
|
|
46
|
+
The separate `--use-env-proxy` flag and `http`/`https` agent support need 24.5.0;
|
|
47
|
+
this guide uses the environment variable with `fetch`.
|
|
48
|
+
See [Node's proxy and certificate guidance](https://nodejs.org/en/learn/http/enterprise-network-configuration).
|
|
49
|
+
Keep certificate verification enabled; use the host-provided CA bundle when
|
|
50
|
+
its proxy or relay requires one.
|
|
51
|
+
|
|
52
|
+
## Pair the requester
|
|
53
|
+
|
|
54
|
+
On an owner-authenticated machine, create a single-use client pairing token
|
|
55
|
+
valid for ten minutes:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx -y @akshar5/cohall pair --client-only --label "Muse"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Transfer that token privately to a mode-`0600` file in the sandbox. Keep the
|
|
62
|
+
owner and device credentials on their own machines. Choose a private writable
|
|
63
|
+
configuration path, outside shared repositories and artifacts:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
export COHALL_CONFIG=/absolute/private/path/cohall/config.json
|
|
67
|
+
|
|
68
|
+
npx -y @akshar5/cohall join \
|
|
69
|
+
--relay https://cohall.example.com \
|
|
70
|
+
--client-only \
|
|
71
|
+
--name Muse \
|
|
72
|
+
--token-file /absolute/private/path/cohall-pairing-token
|
|
73
|
+
|
|
74
|
+
npx -y @akshar5/cohall doctor
|
|
75
|
+
npx -y @akshar5/cohall devices
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`join` stores the client credential at `COHALL_CONFIG`; it does not install a
|
|
79
|
+
worker service. No workspace or coding provider is required for this requester.
|
|
80
|
+
`doctor` should report a reachable relay and `client_authentication.status` of
|
|
81
|
+
`ok`. Its MCP check verifies the local Cohall server, not Muse's tool loading.
|
|
82
|
+
|
|
83
|
+
Use the same `COHALL_CONFIG` and network environment for later commands. If the
|
|
84
|
+
sandbox is replaced, retain the configuration through the host's private
|
|
85
|
+
persistent storage or issue a new pairing token. Cohall cannot preserve a file
|
|
86
|
+
the host discards.
|
|
87
|
+
|
|
88
|
+
Client credentials expire 90 days after pairing. Before expiry, collect and
|
|
89
|
+
acknowledge completed work and record any outstanding task IDs. Have the relay
|
|
90
|
+
owner create a new client-only pairing token, repeat `join` with that new token
|
|
91
|
+
file, and run `doctor` again. Each pairing has a separate completion inbox;
|
|
92
|
+
results from earlier pairings remain accessible through `status <task-id>` while
|
|
93
|
+
the relay retains those tasks. Preserving the configuration does not extend the
|
|
94
|
+
credential's expiry. Clarification answers require the original requester
|
|
95
|
+
credential or relay owner; ask the owner to answer outstanding questions from
|
|
96
|
+
an expired pairing.
|
|
97
|
+
|
|
98
|
+
## Delegate and collect results
|
|
99
|
+
|
|
100
|
+
For work that may exceed the host's command timeout, enqueue it and keep the
|
|
101
|
+
returned task ID:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx -y @akshar5/cohall delegate \
|
|
105
|
+
--target @workstation \
|
|
106
|
+
--prompt-file /absolute/path/task.txt \
|
|
107
|
+
--context-file /absolute/path/context.txt \
|
|
108
|
+
--no-wait
|
|
109
|
+
|
|
110
|
+
npx -y @akshar5/cohall status <task-id>
|
|
111
|
+
npx -y @akshar5/cohall inbox
|
|
112
|
+
npx -y @akshar5/cohall inbox ack <task-id>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Replace `@workstation` with a name or ID from `devices`. Send the question,
|
|
116
|
+
relevant facts, prior findings, and constraints in the prompt and context files.
|
|
117
|
+
Cohall cannot read the Muse conversation automatically.
|
|
118
|
+
|
|
119
|
+
Fetch the full result with `status` and acknowledge it after handling it. If
|
|
120
|
+
`status`, `wait`, or `delegate` returns `needs_input`, read `input_request` and
|
|
121
|
+
answer its question using known conversation facts:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
npx -y @akshar5/cohall answer <task-id> \
|
|
125
|
+
--request-id <input-request-id> --message-file /absolute/path/answer.txt
|
|
126
|
+
npx -y @akshar5/cohall wait <task-id> --timeout 900
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The same task resumes on its worker. Questions appear in `inbox` as
|
|
130
|
+
`inputRequest`; answer or cancel them instead of acknowledging them. Upgrade
|
|
131
|
+
the requester, relay, and worker first; see
|
|
132
|
+
[clarification and resume](integrations.md#clarification-and-resume).
|
|
133
|
+
|
|
134
|
+
`wait <task-id> --timeout <seconds>` polls a specific task; it does not listen
|
|
135
|
+
for incoming requests or wake Muse. A wait timeout leaves the task running.
|
|
136
|
+
If the host ends long commands or does not deliver background output, check
|
|
137
|
+
`status` or `inbox` during subsequent turns. Scheduling and background command
|
|
138
|
+
notifications depend on the host.
|
|
139
|
+
|
|
140
|
+
When coding work must stop by a fixed time, add
|
|
141
|
+
`--deadline <future-UTC-ISO-timestamp>` to `delegate`. The deadline includes time
|
|
142
|
+
waiting for clarification and survives restarts. Upgrade the requester, relay,
|
|
143
|
+
and worker first. See [task deadlines](integrations.md#task-deadlines) for
|
|
144
|
+
cancellation states and offline behavior.
|
|
145
|
+
|
|
146
|
+
## Optional MCP
|
|
147
|
+
|
|
148
|
+
If your Muse host supports local stdio MCP subprocesses, configure it to launch:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
npx -y @akshar5/cohall mcp
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Pass the same `COHALL_CONFIG`, `NODE_USE_ENV_PROXY=1`, and applicable proxy and CA
|
|
155
|
+
settings into that subprocess through the host's secure environment mechanism.
|
|
156
|
+
Use only the client credential. Cohall's MCP transport is stdio; the relay URL
|
|
157
|
+
is not a remote MCP endpoint.
|
|
158
|
+
|
|
159
|
+
For queued work, call `delegate` with `wait: false`, then `task_status` or
|
|
160
|
+
`completion_inbox`. Answer `needs_input` with `task_answer`, then `wait_task`.
|
|
161
|
+
Use `acknowledge_completion` after handling a completed result.
|
|
162
|
+
See [agent integrations](integrations.md) for the common CLI and MCP behavior.
|
package/docs/releasing.md
CHANGED
|
@@ -12,8 +12,8 @@ npm pack --dry-run
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
The Check workflow runs when manually dispatched or when a non-draft pull
|
|
15
|
-
request is opened or marked ready for review.
|
|
16
|
-
|
|
15
|
+
request is opened, reopened, updated, or marked ready for review. New commits
|
|
16
|
+
cancel an earlier run for the same pull request and start a fresh check.
|
|
17
17
|
|
|
18
18
|
After releasable conventional commits reach `main`, Release Please opens or
|
|
19
19
|
updates one release pull request. Merging it creates the version tag and GitHub
|
package/docs/services.md
CHANGED
|
@@ -17,6 +17,18 @@ The relay's data directory must be persistent. Cohall uses at-least-once deliver
|
|
|
17
17
|
work interrupted during execution can run again after recovery, so consequential
|
|
18
18
|
tasks should be idempotent.
|
|
19
19
|
|
|
20
|
+
Device workers retry the connection after two seconds if the relay does not
|
|
21
|
+
accept it within ten seconds. Once connected, workers reconnect if no relay ping
|
|
22
|
+
arrives for 45 seconds. The relay sends a ping every 30 seconds. This also recovers
|
|
23
|
+
connections that go silent without closing the socket. Active work continues
|
|
24
|
+
during a disconnect, and pending results are sent after reconnecting.
|
|
25
|
+
|
|
26
|
+
On macOS and Linux, `cohall device` handles SIGINT and SIGTERM by stopping active
|
|
27
|
+
coding providers and waiting for their process cleanup. It starts no queued work
|
|
28
|
+
during shutdown. Forced termination, including SIGKILL, cannot run that cleanup;
|
|
29
|
+
a custom supervisor must stop the worker's entire process tree. The Linux
|
|
30
|
+
systemd service does this through its default control-group termination.
|
|
31
|
+
|
|
20
32
|
## Linux device daemon
|
|
21
33
|
|
|
22
34
|
Install and pair as the user that will run the daemon:
|
|
@@ -33,11 +45,22 @@ cohall service install
|
|
|
33
45
|
journalctl --user -u cohall-device -f
|
|
34
46
|
```
|
|
35
47
|
|
|
48
|
+
The user unit is written under `$XDG_CONFIG_HOME/systemd/user` when that variable
|
|
49
|
+
is an absolute path, or `$HOME/.config/systemd/user` otherwise.
|
|
50
|
+
|
|
36
51
|
The generated service uses the exact Cohall executable and puts the current
|
|
37
|
-
Node.js directory first on `PATH`.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
Node.js directory first on `PATH`. Linux and macOS services include the configured
|
|
53
|
+
pnpm home and its `bin` subdirectory. For pnpm installations, services also save
|
|
54
|
+
the selected pnpm executable, global package directory, global bin directory, and
|
|
55
|
+
store directory.
|
|
56
|
+
This preserves custom paths supplied through shell configuration and prevents a
|
|
57
|
+
Corepack shim on the service PATH from redirecting upgrades. Global pnpm operations
|
|
58
|
+
ignore the current project’s Corepack manager specification.
|
|
59
|
+
|
|
60
|
+
The service records the resolved configuration file, including `COHALL_CONFIG` or
|
|
61
|
+
`XDG_CONFIG_HOME` overrides. Reinstall it after moving that file or replacing a
|
|
62
|
+
Node.js or pnpm executable at a different path. Reinstalling restarts an existing
|
|
63
|
+
worker to apply the changes.
|
|
41
64
|
|
|
42
65
|
Some Grok Bot cloud computers have no systemd user manager. On those hosts,
|
|
43
66
|
follow [Grok Bot computer setup](grok-bot.md) for a supported supervisor or
|
|
@@ -157,8 +180,11 @@ cohall doctor
|
|
|
157
180
|
|
|
158
181
|
`relay use` first proves that every stored client and device credential works
|
|
159
182
|
against the new relay. Only then does it save the address. It restarts an
|
|
160
|
-
active managed device service automatically
|
|
161
|
-
|
|
183
|
+
active managed device service automatically and leaves stopped workers stopped.
|
|
184
|
+
Repeat the command to retry a failed restart or apply a previously saved address;
|
|
185
|
+
credentials are verified again, and an unchanged address is not rewritten.
|
|
186
|
+
Use `--no-restart` when another supervisor owns the process.
|
|
187
|
+
Environment-based configurations must update
|
|
162
188
|
`COHALL_RELAY_URL` in their service environment instead.
|
|
163
189
|
|
|
164
190
|
HTTPS is required for non-loopback addresses because verification sends the
|
|
@@ -212,16 +238,43 @@ change. It does not run before that user logs on.
|
|
|
212
238
|
|
|
213
239
|
## Upgrade running services
|
|
214
240
|
|
|
215
|
-
Run `cohall upgrade` from a global npm, Bun, or pnpm installation.
|
|
241
|
+
Run `cohall upgrade` from a verified global npm, Bun, or pnpm installation.
|
|
242
|
+
Project-local dependencies and package-runner caches cannot upgrade or install a
|
|
243
|
+
device service; use the global `cohall` command. pnpm shared-store entrypoints
|
|
244
|
+
must be reached through their stable global package link. It updates
|
|
216
245
|
that installation and restarts only active managed Cohall services, with relays
|
|
217
246
|
restarted before device workers. Active services restart even when the installed
|
|
218
247
|
files already match the requested version. Socket-activated relays keep accepting
|
|
219
248
|
new connections while their process is replaced, and delegated upgrades finish
|
|
220
249
|
through durable restart recovery.
|
|
221
250
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
251
|
+
Bun upgrades verify and retain the selected manager's configured global directory.
|
|
252
|
+
If that directory is set only by shell environment variables, set
|
|
253
|
+
`BUN_INSTALL_GLOBAL_DIR` in the service environment too; shell overrides are not
|
|
254
|
+
copied when installing a service. A mismatched Bun global directory stops the
|
|
255
|
+
upgrade before installation.
|
|
256
|
+
|
|
257
|
+
If a restart fails, inactive or missing services remain listed in
|
|
258
|
+
`services_pending_restart` and their recovery state is preserved. Repair or start
|
|
259
|
+
the affected service, then rerun the same upgrade command. Recovery verifies each
|
|
260
|
+
active service's installation before restarting it. Changing the target version
|
|
261
|
+
retains unfinished restarts under the new version, including with `--no-restart`.
|
|
262
|
+
|
|
263
|
+
Before changing files, Cohall verifies that active systemd jobs, launchd jobs,
|
|
264
|
+
and Windows scheduled tasks use the same global installation as the invoked
|
|
265
|
+
CLI. If they differ, use the executable named in the error or reinstall the
|
|
266
|
+
device service with `cohall service install`. Windows tasks with unrecognized or
|
|
267
|
+
multiple actions must also be reinstalled before upgrading.
|
|
268
|
+
|
|
269
|
+
pnpm device services use the stable global package link so replacing or removing
|
|
270
|
+
an old package directory does not leave the worker on the old version. Services
|
|
271
|
+
installed by older Cohall versions may be pinned to a version-specific directory.
|
|
272
|
+
After updating the global CLI, run `cohall service install` through pnpm's
|
|
273
|
+
global `cohall` command once to replace the saved executable. Cohall rejects
|
|
274
|
+
pinned active services before changing
|
|
275
|
+
packages. This applies to systemd, launchd, and Windows scheduled tasks. For a
|
|
276
|
+
manually configured pnpm relay, change its service executable to the stable
|
|
277
|
+
package path named in the error.
|
|
225
278
|
|
|
226
279
|
Direct `npm install --global`, `bun add --global`, or `pnpm add --global`
|
|
227
280
|
replaces files on disk but cannot replace code already loaded by a running Node
|
|
@@ -234,14 +287,17 @@ Start with `cohall doctor`. It reports relay reachability, device connectivity,
|
|
|
234
287
|
provider selection, executable discovery, and version information without
|
|
235
288
|
printing credentials.
|
|
236
289
|
|
|
237
|
-
Inspect a task's
|
|
238
|
-
|
|
290
|
+
Inspect a task's lifecycle, including dispatches, reconnect-driven requeues,
|
|
291
|
+
execution, clarification, cancellation, and completion:
|
|
239
292
|
|
|
240
293
|
```bash
|
|
241
294
|
cohall trace <task-id>
|
|
242
295
|
cohall trace <task-id> --follow
|
|
243
296
|
```
|
|
244
297
|
|
|
298
|
+
Traces omit prompts, final results, credentials, and provider session IDs. They
|
|
299
|
+
include progress and clarification text; inspect those fields before sharing.
|
|
300
|
+
|
|
245
301
|
Use `journalctl --user -u cohall-device -f` for a Linux device and
|
|
246
302
|
`journalctl -u cohall-relay -f` for a system relay. The trace is durable and
|
|
247
303
|
portable; service logs remain machine-local.
|