zas-agent 0.2.1 → 0.4.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.
Files changed (4) hide show
  1. package/CHANGELOG.md +45 -1
  2. package/README.md +47 -13
  3. package/dist/cli.js +1438 -500
  4. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,49 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.0] - 2026-09-03
11
+
12
+ ### Added
13
+
14
+ - `zas_send_direct` sends a file through Directo: a live, device-to-device
15
+ transfer into a channel in Directo mode. Nothing is stored. The agent
16
+ offers, the owner presses Receive on another device within ten minutes,
17
+ and the bytes travel encrypted over WebRTC. The call returns the result,
18
+ or a job id after a minute; `zas_jobs` follows the phases `offer`,
19
+ `connecting`, `flight`, `finishing`.
20
+ - `zas_send_direct_fallback` delivers the file of a Directo send that
21
+ failed in flight through reliable delivery: encrypted on this machine,
22
+ stored in Cloudflare R2 for up to 24 hours, off the owner's quota. It is
23
+ the owner's choice; the tool description tells the model to ask.
24
+ - A native dependency: `node-datachannel`, WebRTC for Node. npm installs a
25
+ prebuilt binary; the module loads the first time `zas_send_direct` runs,
26
+ and a machine where it cannot load answers `webrtc_unavailable`.
27
+ - New error codes: `not_claimed`, `direct_cancelled`, `direct_failed`,
28
+ `direct_not_failed`, `file_changed`, `webrtc_unavailable`,
29
+ `fallback_unavailable`.
30
+
31
+ ### Changed
32
+
33
+ - `zas_status` says `send (Directo)` for a channel in Directo mode, where it
34
+ said nothing. `zas_send_file` still refuses such a channel.
35
+
36
+ ## [0.3.0] - 2026-09-03
37
+
38
+ ### Added
39
+
40
+ - Pairing again in a profile that is already paired replaces the agent
41
+ instead of adding a second one. The terminal opens the pairing as the old
42
+ agent, the approval page says which agent it replaces and fills in its
43
+ name and channels, and the old agent is revoked in the same step that
44
+ creates the new one. If the server no longer accepts the old agent, `pair`
45
+ says so and creates a new agent.
46
+
47
+ ### Changed
48
+
49
+ - The help text, the tool descriptions and the README say "this agent" where
50
+ they said "this machine": a pairing is one profile's key pair, and one
51
+ machine can hold several.
52
+
10
53
  ## [0.2.1] - 2026-09-03
11
54
 
12
55
  ### Fixed
@@ -58,7 +101,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
58
101
  two separate identities that cannot read each other's keys.
59
102
  - Install snippets for Claude Code and Codex, printed by `zas-agent pair`.
60
103
 
61
- [Unreleased]: https://github.com/soke1556/zas-agent/compare/v0.2.1...HEAD
104
+ [Unreleased]: https://github.com/soke1556/zas-agent/compare/v0.3.0...HEAD
105
+ [0.3.0]: https://github.com/soke1556/zas-agent/compare/v0.2.1...v0.3.0
62
106
  [0.2.1]: https://github.com/soke1556/zas-agent/compare/v0.2.0...v0.2.1
63
107
  [0.2.0]: https://github.com/soke1556/zas-agent/compare/v0.1.1...v0.2.0
64
108
  [0.1.1]: https://github.com/soke1556/zas-agent/compare/v0.1.0...v0.1.1
package/README.md CHANGED
@@ -25,8 +25,9 @@ scope to the channels you choose, and that you can revoke.
25
25
 
26
26
  ## What it does
27
27
 
28
- Your coding agent gets seven tools. It can send a file or a note into a channel
29
- you picked, list what is in that channel, and pull one item back onto disk.
28
+ Your coding agent gets nine tools. It can send a file or a note into a channel
29
+ you picked, send a file live through Directo, list what is in that channel,
30
+ and pull one item back onto disk.
30
31
  Everything it sends is encrypted on your machine before it leaves, lands in your
31
32
  account, and is marked in the channel as sent by that agent. The agent has an
32
33
  identity of its own and never holds your account key: pairing mints a key pair
@@ -35,7 +36,7 @@ get a short-lived session.
35
36
 
36
37
  ## Install
37
38
 
38
- Pair the machine first, then hand the command to your harness.
39
+ Pair the agent first, then hand the command to your harness.
39
40
 
40
41
  **Pair**
41
42
 
@@ -147,8 +148,11 @@ ones marked *(server-side)* are enforced by the Zas server.
147
148
  *(server-side)*.
148
149
  - **No reading unless the grant says so.** `read` is a separate switch from
149
150
  `send`; without it, `zas_list_items` and `zas_get_item` are refused.
150
- - **No sending into a view-only channel, and none into a channel in Directo
151
- mode.** Both are refused before a byte is uploaded.
151
+ - **No stored sending into a view-only channel, and none into a channel in
152
+ Directo mode.** Both are refused before a byte is uploaded. A channel in
153
+ Directo mode takes `zas_send_direct`, a live transfer that stores nothing.
154
+ - **No receiving.** The agent sends through Directo; it never claims an
155
+ offer, so nothing can be pushed onto this machine through it.
152
156
  - **Nothing outside its allowlist.** The API refuses an agent on every route
153
157
  that is not on a short, explicit list, and Firestore rules refuse it your
154
158
  account document, your devices, and any channel without an active read grant
@@ -168,7 +172,7 @@ string ever reaches a terminal.
168
172
 
169
173
  | Code | What it means |
170
174
  | --- | --- |
171
- | `not_paired` | This machine is not paired yet. |
175
+ | `not_paired` | This agent is not paired yet. |
172
176
  | `identity_corrupt` | The identity file on disk is damaged. |
173
177
  | `agent_revoked` | The owner revoked this agent. |
174
178
  | `agent_forbidden` | Only the account owner can do that. |
@@ -177,6 +181,13 @@ string ever reaches a terminal.
177
181
  | `read_forbidden` | This agent cannot read that channel. |
178
182
  | `direct_mode` | That channel is in Directo mode. |
179
183
  | `not_direct_mode` | That channel is not in Directo mode. |
184
+ | `not_claimed` | Nobody received the file within ten minutes; the offer was withdrawn. |
185
+ | `direct_cancelled` | The offer was cancelled from the receiving side. |
186
+ | `direct_failed` | The Directo transfer failed in flight. |
187
+ | `direct_not_failed` | That job is not a Directo send that failed in flight. |
188
+ | `file_changed` | The file changed since the Directo offer. |
189
+ | `webrtc_unavailable` | The WebRTC engine could not be loaded on this machine. |
190
+ | `fallback_unavailable` | Reliable delivery is not available right now. |
180
191
  | `key_stale` | The channel key changed; the owner refreshes it by opening Zas. |
181
192
  | `quota_exceeded` | The account reached its storage limit. |
182
193
  | `rate_limited` | Too many sends in a row. |
@@ -203,22 +214,29 @@ stack trace.
203
214
 
204
215
  | Tool | What it does |
205
216
  | --- | --- |
206
- | `zas_status` | Says whether this machine is paired with a Zas account, and lists the owner's channels this agent may send to or read from. |
207
- | `zas_pair` | Pairs this machine with a Zas account. The first call returns a URL for the owner to open; a later call says whether they approved. If the page shows a code, a call with `code` claims with it. |
217
+ | `zas_status` | Says whether this agent is paired with a Zas account, and lists the owner's channels it may send to or read from. |
218
+ | `zas_pair` | Pairs this agent with a Zas account. The first call returns a URL for the owner to open; a later call says whether they approved. If the page shows a code, a call with `code` claims with it. In a profile that is already paired, approval replaces the old agent. |
208
219
  | `zas_send_file` | Sends a file from this machine into one of the owner's channels. Returns the item id, or a job id when the upload takes longer than a minute. |
209
220
  | `zas_send_note` | Sends a note — plain text, or a code snippet with its language — into one of the owner's channels. |
221
+ | `zas_send_direct` | Sends a file through Directo: a live, device-to-device transfer into a channel in Directo mode. Nothing is stored. The owner presses Receive on another device within ten minutes; the call returns the result, or a job id after a minute. |
222
+ | `zas_send_direct_fallback` | After a Directo send failed in flight, delivers the same file through reliable delivery: encrypted on this machine, stored in Cloudflare R2 for up to 24 hours, off the owner's quota. The owner's choice; the model is told to ask. |
210
223
  | `zas_list_items` | Lists the most recent items in one of the owner's channels. Needs a grant that includes reading. |
211
224
  | `zas_get_item` | Fetches one item. A note comes back as text; a file is written to disk. It never overwrites, so the path it answers with can differ from the one you asked for. |
212
- | `zas_jobs` | Lists the sends this server started, newest first, with the phase each one reached — and where a `job_id` from a long send is redeemed. |
225
+ | `zas_jobs` | Lists the sends and Directo transfers this server started, newest first, with the phase each one reached — and where a `job_id` from a long send is redeemed. |
213
226
 
214
227
  `channel` takes a channel name or a channel id. A name has to match exactly one
215
- of the channels you granted; with exactly one grant, `zas_send_file` and
216
- `zas_send_note` can leave it out.
228
+ of the channels you granted; with exactly one grant, `zas_send_file`,
229
+ `zas_send_note` and `zas_send_direct` can leave it out.
230
+
231
+ Directo needs a native module, [node-datachannel](https://github.com/murat-dogan/node-datachannel),
232
+ WebRTC for Node. npm installs a prebuilt binary for Windows, macOS and Linux;
233
+ the module loads the first time `zas_send_direct` runs, and a machine where it
234
+ cannot load answers `webrtc_unavailable`. Every other tool works without it.
217
235
 
218
236
  Two things worth knowing before you point a model at your account:
219
237
 
220
- - `zas_send_file` sends any file this process can read — `~/.ssh/id_rsa` and a
221
- `.env` included. Confirm with the owner before sending secrets, keys or
238
+ - `zas_send_file` and `zas_send_direct` send any file this process can read —
239
+ `~/.ssh/id_rsa` and a `.env` included. Confirm with the owner before sending secrets, keys or
222
240
  credentials. Its tool description says so, so the model reads it too.
223
241
  - `zas_get_item` writes a new file under `dest`, or under the system temp
224
242
  directory when you leave `dest` out. It never overwrites an existing file: a
@@ -260,6 +278,22 @@ Deleting the directory makes this machine forget the agent. It does not revoke
260
278
  anything: the account side is closed from the web app, under
261
279
  Settings → Agents → Revoke.
262
280
 
281
+ ## Pairing again
282
+
283
+ A pairing is one profile's key pair, not the machine and not the program. A
284
+ profile holds one agent. Running `zas-agent pair` in a profile that is already
285
+ paired opens a replacement: the terminal signs the request with the old
286
+ identity, the approval page says which agent it replaces and fills in its name
287
+ and channels, and the old agent is revoked in the same step that creates the
288
+ new one. Its row stays under Settings → Agents as revoked until you remove it,
289
+ and it keeps costing a slot until then. If the old agent was already revoked
290
+ or removed, `pair` says so and creates a new agent.
291
+
292
+ One machine that runs Claude Code and Codex has two profiles (`claude-code`
293
+ and `codex`), two agents, two approvals and two rows. Revoking one does not
294
+ touch the other. Two programs pointed at the same `--profile` act as one
295
+ agent: same keys, same channels, one row.
296
+
263
297
  ## Configuration
264
298
 
265
299
  | Setting | Default | What it changes |