@agora-build/atem 0.6.19 → 0.7.1

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 (2) hide show
  1. package/README.md +99 -25
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @agora-build/atem
2
2
 
3
- A terminal that connects builders, Agora platform, and AI agents. Manage Agora projects and tokens, route tasks between [Astation](https://github.com/Agora-Build/Astation) and AI coding agents, drive voice-powered coding workflows, and more -- all from a single CLI/TUI.
3
+ A terminal that connects builders, Agora platform, and AI agents. Manage Agora projects and tokens, route tasks between [Astation](https://github.com/Agora-Build/Astation) and AI coding agents, and more -- all from a single CLI/TUI.
4
4
 
5
5
  ## Install
6
6
 
@@ -34,15 +34,17 @@ atem repl # Interactive REPL with AI command inter
34
34
  ```bash
35
35
  atem login # Log in with Agora Console (opens browser)
36
36
  atem logout # Log out from SSO
37
- atem pair # Pair with Astation, then verify this device
37
+ atem status # Account, pairing, verification and credentials (offline, read-only)
38
+ atem pair # Pair with Astation, then verify this device (shows the status when already paired)
38
39
  atem pair --save # Same, and keep credentials for offline use
39
- atem unpair [--yes] # Remove all Astation pairings (asks first)
40
+ atem pair verify # Verify this device with the paired Astation (no re-pairing)
41
+ atem unpair [--yes] # Remove all Astation pairings and saved sessions (asks first)
40
42
  ```
41
43
 
42
44
  `atem login` unlocks a limited set: project list, tokens for the active
43
45
  project, and the dev servers (`serv rtc`, `serv convo`, `serv webhooks`).
44
46
  Pairing with Astation unlocks the full set: vault, sync, memory, skills,
45
- `atem cred`, and Astation-driven remote agent control, voice coding and mark
47
+ `atem cred`, and Astation-driven terminal viewing, chat and mark
46
48
  tasks. `serv files`, `config`, and tokens from
47
49
  `AGORA_APP_ID`/`AGORA_APP_CERTIFICATE` need neither.
48
50
 
@@ -52,15 +54,23 @@ atem and your Mac each show a 12-character safety code. If they match, type
52
54
  Either side can finish first. atem reads that `y` from the terminal itself,
53
55
  never from piped input or keys typed earlier, so run `atem pair` in an
54
56
  interactive terminal. If verification fails, the pairing stays saved, Astation
55
- is told, and `atem pair` exits nonzero; run it again to verify. A connected or SSO-paired session alone does not
56
- mean the device is verified; check `atem cred status`. With `--save`
57
+ is told, and `atem pair` exits nonzero; run `atem pair verify` to retry. A connected or SSO-paired session alone does not
58
+ mean the device is verified; check `atem status`. With `--save`
57
59
  the credentials keep working when Astation disconnects; without it they stop
58
60
  5 minutes after the disconnect (atem asks when `--save` isn't given).
59
61
 
62
+ Once paired, `atem pair` only prints the status (`Already paired. Verify this
63
+ device: atem pair verify · Replace the pairing: atem unpair, then atem pair`):
64
+ it never pairs again or changes keys, trust or sessions. `atem pair verify`
65
+ verifies the existing pairing on the runtime's Astation link, does nothing when the
66
+ device is already verified, and refuses after a revocation (run `atem unpair`,
67
+ which sets the revoked keys aside, then `atem pair`). `atem status` reads only
68
+ local files and an already running key agent; it never connects, so
69
+ authorization and relay show as `unknown (stale)`.
70
+
60
71
  ### Device keys (`atem cred`)
61
72
 
62
73
  ```bash
63
- atem cred status # Show whether this device is verified, its home Astation and its key agent
64
74
  atem cred unlock # Unlock this device's keys (approve with Touch ID on your Mac)
65
75
  atem cred lock # Wipe unlocked keys and stop the key agent
66
76
  atem cred projects # Send known Git projects to Astation's credential picker (keys must be unlocked)
@@ -68,7 +78,9 @@ atem cred projects # Send known Git projects to Astation's
68
78
 
69
79
  This device's keys are sealed on disk under a storage key that only the paired
70
80
  Mac (the home Astation) holds. `atem cred unlock` asks the Mac for it (Touch
71
- ID) and starts a background `atem key-agent` that holds the keys in memory.
81
+ ID) and starts a background `atem key-agent` that holds the keys in memory;
82
+ on a device no Astation verified it stops with `This device isn't verified.
83
+ Run atem pair verify first.` and never starts pairing or verification.
72
84
  `atem cred lock` wipes them and stops the agent. After upgrading atem, run
73
85
  `atem cred lock` then `atem cred unlock` to pick up the new agent.
74
86
 
@@ -203,7 +215,7 @@ such as timestamps and ciphertext sizes; it is not authoritative for device
203
215
  trust or encryption state. Migration cannot prove that a server erased old
204
216
  plaintext backups.
205
217
 
206
- The device must be verified (`atem pair`) and unlocked (`atem cred unlock`).
218
+ The device must be verified (`atem pair`, or `atem pair verify` to retry) and unlocked (`atem cred unlock`).
207
219
  While it is locked, `atem sync` keeps changes queued. Switching encryption on
208
220
  or off migrates existing data; each verified atem finishes its part at its next
209
221
  `atem cred unlock` (`atem sync` alone doesn't contact Astation). **Turning on**
@@ -263,15 +275,37 @@ atem agent launch codex # Open the original Codex CLI in an Atem
263
275
  atem agent launch claude --continue # Arguments after the agent type go to that CLI: continue the last Claude session
264
276
  atem agent launch codex resume --last # Continue the last Codex session
265
277
  atem agent launch claude -- --help # Use -- to read the agent's own help
278
+ atem agent list # The sessions the background runtime holds
279
+ atem agent attach ses-… # Reopen a session (screen restored)
280
+ atem agent stop ses-… # Stop a session
266
281
  ```
267
282
 
268
283
  `atem agent launch [claude|claude-code|codex] [ARGS]...` runs the installed
269
284
  `claude` or `codex` CLI, unchanged, in a full-screen Atem terminal. It uses
270
285
  your working directory and your own login for that CLI. Nothing here replaces
271
- the CLI with an API conversation. It works without Astation. If you are
272
- paired, Astation can view the same session and take control of it (one
273
- viewer per session; while Astation holds control, local typing is refused until you press
274
- the prefix, then `g`). Quitting Atem ends the session.
286
+ the CLI with an API conversation. It works without Astation.
287
+
288
+ Sessions belong to a background `atem runtime` (started on demand, one per
289
+ profile; it exits after 10 minutes with no sessions and no frontends), and each agent runs in its own `atem
290
+ worker` process. Closing the terminal window or hiding it (prefix, then `h`)
291
+ leaves the session running; `atem agent attach` reopens it. Several Claude
292
+ and Codex sessions can run at once, and they keep running if the runtime
293
+ itself restarts. The runtime also holds this machine's one Astation
294
+ connection: `atem pair`, `atem pair verify`, `atem cred unlock` and `atem cred
295
+ projects` run on it (they start the runtime if needed) and never open their
296
+ own, so pairing never disconnects a running session. When an agent that
297
+ printed something ends, its last output and a short summary are saved under
298
+ `~/.config/atem/logs/<session id>/`.
299
+
300
+ If you are paired and verified, Astation can view each session, take control
301
+ of it (one controller at a time, on a lease Astation keeps renewing; typing
302
+ locally takes control back at once), and chat with the agent: sending a
303
+ prompt takes control when nobody holds it (if another device does, Astation
304
+ asks before taking over), the whole retained conversation can be scrolled
305
+ back page by page, and each finished prompt names its reply messages.
306
+ Every remote request names the exact session and speaks atem-session r8
307
+ (Astation must be current: older clients are refused); old `agentInput`,
308
+ `agentPrompt`, voice and `userCommand` messages were removed.
275
309
 
276
310
  Atem's own keys start with a prefix, Ctrl+] by default. Press it, then:
277
311
 
@@ -290,15 +324,11 @@ The bottom row reads, for example,
290
324
 
291
325
  - `Claude` or `Codex` is the agent on screen.
292
326
  - `Local` means your keyboard drives the agent; `Remote` means Astation holds
293
- control and local typing is refused until you press the prefix, then `g`.
294
- - `Astation ✓` means an authenticated Astation link; `Astation ✗` means none
295
- (not paired, Astation unreachable, or re-authenticating). When Astation
296
- challenges an open connection again (for example after it alone reconnected
297
- to the relay), Atem briefly shows `Astation ✗`, drops remote viewers and
298
- control, and answers with the saved session; it shows `✓` again once Astation
299
- accepts. If Astation refuses or doesn't answer within 15 seconds, Atem
300
- records a notice and reconnects with the saved session (a refused session
301
- needs `atem pair`). Remote viewers subscribe again afterwards, view only.
327
+ control. Typing takes it back (prefix, then `g`, does it without typing).
328
+ - `Astation ✓` means the runtime's Astation link is authenticated; `Astation
329
+ ✗` means none (not paired, Astation unreachable, or re-authenticating).
330
+ Every reconnect or re-authentication is a new remote attachment: Astation
331
+ views again and asks for control again.
302
332
  - `Notice` appears once Atem has recorded a warning or status message. Press
303
333
  the prefix, then `?`, to read the recent notices (newest first).
304
334
 
@@ -307,15 +337,59 @@ Press the prefix twice to send it to the agent. To change it, set
307
337
  `ATEM_TERMINAL_PREFIX` (which wins over the file). Ctrl+], Ctrl+\ or
308
338
  Ctrl+<letter> other than i or m are accepted. The `CLAUDE_CLI_BIN`/`CLAUDE_CLI_ARGS`
309
339
  and `CODEX_CLI_BIN`/`CODEX_CLI_ARGS` variables still override the command.
310
- See [`designs/terminal-v1-implementation.md`](https://github.com/Agora-Build/Atem/blob/main/designs/terminal-v1-implementation.md).
340
+ See [`designs/agent-runtime.md`](https://github.com/Agora-Build/Atem/blob/main/designs/agent-runtime.md).
341
+
342
+ **Chat from Astation.** Astation can open a chat view of a Claude session
343
+ launched with `atem agent launch claude`: your prompts appear as messages and
344
+ Claude's replies come from its own session log, with a status of ready,
345
+ working, waiting or unknown. Atem adds its hooks with `--settings` for that run
346
+ only; your `~/.claude` settings are not changed. A prompt sent from chat needs
347
+ control of the session, is typed into Claude once, and is reported as
348
+ accepted, then complete (or failed) when Claude's turn ends.
349
+ Codex works the same way once you allow Atem's Codex hooks (asked
350
+ once on the first `atem agent launch codex`, see below): Atem reads Codex's
351
+ own session log, so Codex shows ready, working, waiting or unknown. Codex
352
+ reports nothing before its first prompt, so type the first prompt in the
353
+ terminal; after that chat prompts work. Replies arrive whole (no streaming),
354
+ and Codex's chat has no reasoning text or error details.
355
+ Interrupt from chat stops a running turn only. See
356
+ [`designs/agent-chat-host.md`](https://github.com/Agora-Build/Atem/blob/main/designs/agent-chat-host.md).
357
+
358
+ **Approve prompts from Astation and your phone.** When Claude Code or Codex
359
+ asks for permission to run a tool, Astation shows the request as a card (in
360
+ a Claude chat view too) and Atem asks the relay to notify your devices
361
+ with control. A card shows the tool and a short summary — the command's first
362
+ line or the file path, never file contents — and offers **Allow once**,
363
+ **Always allow** (Claude: one of the rules Claude itself suggests, with where
364
+ it is saved; Codex, for shell commands only: **Always allow this command** —
365
+ exactly this command in this folder, for the rest of this Codex process, kept
366
+ by Atem; later runs of
367
+ the very same command are allowed without asking and show as "auto allowed",
368
+ and the rule can be revoked from Astation) or **Deny** (with an optional
369
+ note for the agent).
370
+ Answering needs no control of the session: any of your devices that can
371
+ control it answers, whoever is typing, and the first answer wins. The
372
+ finished card shows how it ended. The terminal can
373
+ always answer instead: Claude keeps its own dialog on screen (the first
374
+ answer wins), and for Codex any key you type in the terminal hands the
375
+ prompt back to Codex's own dialog. If nobody answers, nothing is allowed:
376
+ after the hook's wait (Claude 10 min, Codex 5 min) the agent asks in the
377
+ terminal as usual. Claude gets the hook with `--settings` for each launch;
378
+ to turn it off, set `approvals_hook = false` under `[claude]` in
379
+ `~/.config/atem/config.toml` (Claude sessions launched afterwards keep their
380
+ prompts in the terminal).
381
+ The first `atem agent launch codex` asks once whether to add Atem's hooks
382
+ (one per Codex event, for approvals and chat) to `~/.codex/hooks.json`, after
383
+ your own (a backup is kept as `hooks.json.atem-bak`); to turn them off later,
384
+ set `hooks = false` under `[codex]` in `~/.config/atem/config.toml` — the next
385
+ `atem agent launch codex` removes them. See §6a and the r8 appendix of the [session protocol](https://github.com/Agora-Build/Atem/blob/main/designs/protocol/atem-session-v1.md).
311
386
 
312
387
  ## TUI Modes
313
388
 
314
389
  | Mode | Description |
315
390
  |------|-------------|
316
391
  | **Main Menu** | Navigate between features |
317
- | **Claude Chat** | Claude Code CLI integration via PTY |
318
- | **Codex Chat** | Codex terminal integration via PTY |
392
+ | **Agent Sessions** | The runtime's Claude/Codex sessions: launch or attach |
319
393
  | **Token Gen** | Generate Agora RTC/RTM tokens locally |
320
394
  | **Projects** | Browse Agora projects via API |
321
395
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agora-build/atem",
3
- "version": "0.6.19",
3
+ "version": "0.7.1",
4
4
  "description": "A terminal that connects people, Agora platform, and AI agents.",
5
5
  "bin": {
6
6
  "atem": "bin/atem"