@akshar5/cohall 0.2.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/LICENSE +21 -0
- package/README.md +206 -0
- package/bin/cohall.js +3129 -0
- package/bin/cohall.js.map +23 -0
- package/package.json +74 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Akshar Patel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# Cohall
|
|
2
|
+
|
|
3
|
+
Cohall lets agents on your own devices delegate work to each other. It is a
|
|
4
|
+
headless interoperability layer, not another agent harness: use it from Codex,
|
|
5
|
+
Claude Code, OpenCode, T3Code, Buzz, or any other tool that can run a command or
|
|
6
|
+
connect to a stdio MCP server.
|
|
7
|
+
|
|
8
|
+
One npm package provides:
|
|
9
|
+
|
|
10
|
+
- a durable self-hosted relay;
|
|
11
|
+
- an outbound-only device daemon;
|
|
12
|
+
- a human and agent-friendly CLI;
|
|
13
|
+
- one embedded, installable agent skill;
|
|
14
|
+
- an optional stdio MCP server;
|
|
15
|
+
- local Codex, Claude Code, and OpenCode execution adapters.
|
|
16
|
+
|
|
17
|
+
There is no Cohall desktop or web app. Your existing harness remains the UI.
|
|
18
|
+
|
|
19
|
+
## Architecture
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
Codex / Claude Code / OpenCode / T3Code / Buzz
|
|
23
|
+
CLI + skill or MCP
|
|
24
|
+
|
|
|
25
|
+
HTTPS / WSS
|
|
26
|
+
|
|
|
27
|
+
Cohall relay + SQLite
|
|
28
|
+
/ \
|
|
29
|
+
Mac device daemon Linux device daemon
|
|
30
|
+
local agent login local agent login
|
|
31
|
+
browser / Xcode repos / Docker
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The relay stores task prompts, final results, thread history, and provider
|
|
35
|
+
session IDs. It does not plan work, copy device credentials, or SSH into a
|
|
36
|
+
machine. Each device runs its own provider CLI with its existing local login,
|
|
37
|
+
configuration, skills, MCP servers, permissions, and workspace access.
|
|
38
|
+
|
|
39
|
+
## Quick start
|
|
40
|
+
|
|
41
|
+
Run Cohall anywhere Node.js 24 or newer is installed. Use whichever JavaScript
|
|
42
|
+
package manager is already available:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx -y @akshar5/cohall --version
|
|
46
|
+
bunx @akshar5/cohall --version
|
|
47
|
+
pnpm dlx @akshar5/cohall --version
|
|
48
|
+
yarn dlx @akshar5/cohall --version
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The examples below use `npx`; the other runners are interchangeable.
|
|
52
|
+
|
|
53
|
+
Start a local relay with an explicit owner token:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
export COHALL_TOKEN="$(openssl rand -hex 32)"
|
|
57
|
+
npx -y @akshar5/cohall relay
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The relay binds only to `127.0.0.1` by default. To expose it through a private
|
|
61
|
+
network or TLS reverse proxy, set `COHALL_RELAY_HOST=0.0.0.0` and explicitly opt
|
|
62
|
+
in with `COHALL_RELAY_ALLOW_REMOTE=true`. Do not expose plain HTTP to the public
|
|
63
|
+
internet.
|
|
64
|
+
|
|
65
|
+
Create a one-time pairing credential on an owner-authenticated machine:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
COHALL_RELAY_URL=https://cohall.example.com \
|
|
69
|
+
COHALL_TOKEN="$COHALL_TOKEN" \
|
|
70
|
+
npx -y @akshar5/cohall pair --label "MacBook"
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Transfer the token to the machine being added through a private channel, then
|
|
74
|
+
provide it on stdin so it never appears in process arguments or shell history:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
read -rsp 'Pairing token: ' pairing_token; printf '\n'
|
|
78
|
+
printf '%s' "$pairing_token" | npx -y @akshar5/cohall join \
|
|
79
|
+
--relay https://cohall.example.com \
|
|
80
|
+
--name macbook \
|
|
81
|
+
--workspace "$HOME/dev" \
|
|
82
|
+
--workspace "$HOME/.skillsync/repo"
|
|
83
|
+
unset pairing_token
|
|
84
|
+
|
|
85
|
+
npx -y @akshar5/cohall doctor
|
|
86
|
+
npx -y @akshar5/cohall device
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`join` exchanges the one-time token for separate client and device credentials,
|
|
90
|
+
then writes a per-user configuration file with Unix mode `0600`. Workspace roots
|
|
91
|
+
must already exist and are resolved to canonical paths.
|
|
92
|
+
|
|
93
|
+
## Use from an agent
|
|
94
|
+
|
|
95
|
+
Install the same embedded skill for Codex, Claude Code, and OpenCode:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npx -y @akshar5/cohall skill install all
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Then delegate from any harness with shell access:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx -y @akshar5/cohall devices
|
|
105
|
+
npx -y @akshar5/cohall delegate \
|
|
106
|
+
--target @macbook \
|
|
107
|
+
--provider codex \
|
|
108
|
+
--workspace /Users/me/dev/project \
|
|
109
|
+
--prompt 'Inspect the signed-in dashboard and identify why deployment 184 failed.' \
|
|
110
|
+
--context 'Focus on events after 15:00 UTC and return supporting links.'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The command waits by default and returns JSON. For asynchronous work:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npx -y @akshar5/cohall delegate --target @linux --no-wait \
|
|
117
|
+
--prompt 'Run the test suite and report failures.'
|
|
118
|
+
npx -y @akshar5/cohall wait <task-id> --timeout 1800
|
|
119
|
+
npx -y @akshar5/cohall cancel <task-id>
|
|
120
|
+
npx -y @akshar5/cohall thread <thread-id>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Follow-ups using the same `thread_id` resume the provider session on the target
|
|
124
|
+
device. Active cancellation remains `cancelling` until the target acknowledges
|
|
125
|
+
that its local process stopped.
|
|
126
|
+
|
|
127
|
+
## Optional MCP
|
|
128
|
+
|
|
129
|
+
Run `npx -y @akshar5/cohall integrations` for current setup commands. The MCP
|
|
130
|
+
server exposes:
|
|
131
|
+
|
|
132
|
+
- `list_devices`
|
|
133
|
+
- `delegate`
|
|
134
|
+
- `task_status`
|
|
135
|
+
- `wait_task`
|
|
136
|
+
- `cancel_task`
|
|
137
|
+
- `thread_context`
|
|
138
|
+
|
|
139
|
+
CLI plus skill and MCP create the same tasks. Configure one or the other in a
|
|
140
|
+
given harness; do not submit the same work through both.
|
|
141
|
+
|
|
142
|
+
See [integration examples](docs/integrations.md), [installation](docs/install.md),
|
|
143
|
+
and [service setup](docs/services.md).
|
|
144
|
+
|
|
145
|
+
## Provider behavior
|
|
146
|
+
|
|
147
|
+
Target devices advertise only provider executables they actually have:
|
|
148
|
+
|
|
149
|
+
| Provider | Required command | Session continuation |
|
|
150
|
+
| ----------- | ---------------- | ------------------------ |
|
|
151
|
+
| Codex | `codex` | `codex exec resume` |
|
|
152
|
+
| Claude Code | `claude` | `claude --resume` |
|
|
153
|
+
| OpenCode | `opencode` | `opencode run --session` |
|
|
154
|
+
|
|
155
|
+
Cohall does not bypass provider permissions. A paired client is authorized to
|
|
156
|
+
ask the local provider to act with that user account's normal authority, so do
|
|
157
|
+
not pair mutually untrusted users. Provider output and task backlogs are
|
|
158
|
+
bounded, one task runs at a time per device, and configured workspace roots are
|
|
159
|
+
enforced after resolving symlinks.
|
|
160
|
+
|
|
161
|
+
## Configuration
|
|
162
|
+
|
|
163
|
+
`npx -y @akshar5/cohall config` shows the active stored configuration without
|
|
164
|
+
printing tokens. `npx -y @akshar5/cohall configure` changes relay, name,
|
|
165
|
+
workspaces, model, or Codex sandbox.
|
|
166
|
+
Environment variables override stored values:
|
|
167
|
+
|
|
168
|
+
| Variable | Purpose |
|
|
169
|
+
| ----------------------------------------- | ---------------------------------------------- |
|
|
170
|
+
| `COHALL_CONFIG` | Configuration file override |
|
|
171
|
+
| `COHALL_RELAY_URL` | Relay URL for CLI, MCP, and device |
|
|
172
|
+
| `COHALL_CLIENT_TOKEN` | Client credential override |
|
|
173
|
+
| `COHALL_DEVICE_TOKEN` | Device credential override |
|
|
174
|
+
| `COHALL_TOKEN` | Relay owner credential |
|
|
175
|
+
| `COHALL_DEVICE_ID` | Stable device ID override |
|
|
176
|
+
| `COHALL_DEVICE_NAME` | Advertised device name |
|
|
177
|
+
| `COHALL_DEVICE_WORKSPACES` | Comma-separated workspace roots |
|
|
178
|
+
| `COHALL_DEVICE_WORKSPACES_JSON` | JSON workspace roots; supports commas in paths |
|
|
179
|
+
| `COHALL_MODEL` | Target provider model override |
|
|
180
|
+
| `COHALL_SANDBOX` | Codex sandbox override |
|
|
181
|
+
| `COHALL_THREAD_ID` | Inherited Cohall thread for nested delegation |
|
|
182
|
+
| `COHALL_DATA_DIR` | Relay database and owner-token directory |
|
|
183
|
+
| `COHALL_RELAY_HOST` / `COHALL_RELAY_PORT` | Relay listener |
|
|
184
|
+
| `COHALL_RELAY_ALLOW_REMOTE` | Explicit non-loopback binding opt-in |
|
|
185
|
+
|
|
186
|
+
The owner token can create pairing credentials, list sessions, and revoke them.
|
|
187
|
+
Ordinary client and device credentials are role-separated, device-bound where
|
|
188
|
+
applicable, expiring, and stored only as SHA-256 hashes by the relay.
|
|
189
|
+
|
|
190
|
+
## Development
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
bun install
|
|
194
|
+
bun run check
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
`bun run check` type-checks, lints, builds the npm executable, and tests the full
|
|
198
|
+
relay/device/CLI/MCP path with fake provider executables. GitHub Actions is
|
|
199
|
+
deliberately low-frequency because this is a private repository. See [release
|
|
200
|
+
operations](docs/releasing.md).
|
|
201
|
+
|
|
202
|
+
The relay guarantees durable at-least-once task delivery. Task assignment and
|
|
203
|
+
terminal events are idempotent; interrupted running tasks are re-queued after a
|
|
204
|
+
device or relay restart. A device accepts at most 100 outstanding tasks and
|
|
205
|
+
executes them one at a time. Thread context returns a byte-bounded recent window
|
|
206
|
+
and sets `truncated` when older content exists.
|