@agora-build/atem 0.6.19 → 0.7.2

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 +111 -30
  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, credentials, Astation link and sessions (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 the Astation pairing (asks first; your own login stays)
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,25 +54,41 @@ 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
- the credentials keep working when Astation disconnects; without it they stop
58
- 5 minutes after the disconnect (atem asks when `--save` isn't given).
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`
59
+ the login Astation shares keeps working when Astation disconnects; without it
60
+ it stops 5 minutes after the disconnect (atem asks when `--save` isn't given).
61
+ While it may be used, Agora API calls (`atem project list`) use it; otherwise
62
+ they use your own `atem login`. One pairing at a time: `atem unpair` removes
63
+ it and keeps your own login.
64
+
65
+ Once paired, `atem pair` only prints the status (`Already paired. Verify this
66
+ device: atem pair verify · Replace the pairing: atem unpair, then atem pair`):
67
+ it never pairs again or changes keys, trust or sessions. `atem pair verify`
68
+ verifies the existing pairing on the runtime's Astation link, does nothing when the
69
+ device is already verified, and refuses after a revocation (run `atem unpair`,
70
+ which sets the revoked keys aside, then `atem pair`). `atem status` reads
71
+ local files and asks an already running cred agent and `atem runtime`
72
+ (never starting either, never writing, never using the network): the session
73
+ authorization, the Astation link and the local agents, or `no runtime
74
+ running`.
59
75
 
60
76
  ### Device keys (`atem cred`)
61
77
 
62
78
  ```bash
63
- atem cred status # Show whether this device is verified, its home Astation and its key agent
64
79
  atem cred unlock # Unlock this device's keys (approve with Touch ID on your Mac)
65
- atem cred lock # Wipe unlocked keys and stop the key agent
80
+ atem cred lock # Wipe unlocked keys and stop the cred agent
66
81
  atem cred projects # Send known Git projects to Astation's credential picker (keys must be unlocked)
67
82
  ```
68
83
 
69
84
  This device's keys are sealed on disk under a storage key that only the paired
70
85
  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.
86
+ ID) and starts a background `atem cred-agent` that holds the keys in memory;
87
+ on a device no Astation verified it stops with `This device isn't verified.
88
+ Run atem pair verify first.` and never starts pairing or verification.
72
89
  `atem cred lock` wipes them and stops the agent. After upgrading atem, run
73
- `atem cred lock` then `atem cred unlock` to pick up the new agent.
90
+ `atem cred lock` then `atem cred unlock` to pick up the new agent (the unlock
91
+ first updates Atem's runtime, which starts the agent, to the new build).
74
92
 
75
93
  `atem cred projects` sends this repo's Git remote, and the project names atem
76
94
  remembers, to Astation's credential picker, encrypted to your Mac. An
@@ -81,7 +99,7 @@ values from Astation's local Credentials store (`atem cred get/list`) is not
81
99
  available yet; it is described in the
82
100
  [encryption design](https://github.com/Agora-Build/Atem/blob/main/designs/e2e-encryption.md).
83
101
 
84
- Updated clients and key agents retain the remote's original capitalization,
102
+ Updated clients and cred agents retain the remote's original capitalization,
85
103
  such as `github.com/Agora-Build/Atem`; project identity and duplicate checks
86
104
  ignore case. Older clients/agents may report lowercase names. Reports are
87
105
  encrypted even when memory encryption is off and can remain in the picker
@@ -203,7 +221,7 @@ such as timestamps and ciphertext sizes; it is not authoritative for device
203
221
  trust or encryption state. Migration cannot prove that a server erased old
204
222
  plaintext backups.
205
223
 
206
- The device must be verified (`atem pair`) and unlocked (`atem cred unlock`).
224
+ The device must be verified (`atem pair`, or `atem pair verify` to retry) and unlocked (`atem cred unlock`).
207
225
  While it is locked, `atem sync` keeps changes queued. Switching encryption on
208
226
  or off migrates existing data; each verified atem finishes its part at its next
209
227
  `atem cred unlock` (`atem sync` alone doesn't contact Astation). **Turning on**
@@ -263,15 +281,38 @@ atem agent launch codex # Open the original Codex CLI in an Atem
263
281
  atem agent launch claude --continue # Arguments after the agent type go to that CLI: continue the last Claude session
264
282
  atem agent launch codex resume --last # Continue the last Codex session
265
283
  atem agent launch claude -- --help # Use -- to read the agent's own help
284
+ atem agent list # The sessions the background runtime holds
285
+ atem agent attach ses-… # Reopen a session (screen restored)
286
+ atem agent stop ses-… # Stop a session
287
+ atem runtime restart # Restart the runtime as this build; sessions keep running
266
288
  ```
267
289
 
268
290
  `atem agent launch [claude|claude-code|codex] [ARGS]...` runs the installed
269
291
  `claude` or `codex` CLI, unchanged, in a full-screen Atem terminal. It uses
270
292
  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.
293
+ the CLI with an API conversation. It works without Astation.
294
+
295
+ Sessions belong to a background `atem runtime` (started on demand, one per
296
+ profile; it exits after 10 minutes with no sessions and no frontends), and each agent runs in its own `atem
297
+ worker` process. Closing the terminal window or hiding it (prefix, then `h`)
298
+ leaves the session running; `atem agent attach` reopens it. Several Claude
299
+ and Codex sessions can run at once, and they keep running if the runtime
300
+ itself restarts. The runtime also holds this machine's one Astation
301
+ connection: `atem pair`, `atem pair verify`, `atem cred unlock` and `atem cred
302
+ projects` run on it (they start the runtime if needed) and never open their
303
+ own, so pairing never disconnects a running session. When an agent that
304
+ printed something ends, its last output and a short summary are saved under
305
+ `~/.config/atem/logs/<session id>/`.
306
+
307
+ If you are paired and verified, Astation can view each session, take control
308
+ of it (one controller at a time, on a lease Astation keeps renewing; typing
309
+ locally takes control back at once), and chat with the agent: sending a
310
+ prompt takes control when nobody holds it (if another device does, Astation
311
+ asks before taking over), the whole retained conversation can be scrolled
312
+ back page by page, and each finished prompt names its reply messages.
313
+ Every remote request names the exact session and speaks atem-session r8
314
+ (Astation must be current: older clients are refused); old `agentInput`,
315
+ `agentPrompt`, voice and `userCommand` messages were removed.
275
316
 
276
317
  Atem's own keys start with a prefix, Ctrl+] by default. Press it, then:
277
318
 
@@ -290,15 +331,11 @@ The bottom row reads, for example,
290
331
 
291
332
  - `Claude` or `Codex` is the agent on screen.
292
333
  - `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.
334
+ control. Typing takes it back (prefix, then `g`, does it without typing).
335
+ - `Astation ✓` means the runtime's Astation link is authenticated; `Astation
336
+ ✗` means none (not paired, Astation unreachable, or re-authenticating).
337
+ Every reconnect or re-authentication is a new remote attachment: Astation
338
+ views again and asks for control again.
302
339
  - `Notice` appears once Atem has recorded a warning or status message. Press
303
340
  the prefix, then `?`, to read the recent notices (newest first).
304
341
 
@@ -307,15 +344,59 @@ Press the prefix twice to send it to the agent. To change it, set
307
344
  `ATEM_TERMINAL_PREFIX` (which wins over the file). Ctrl+], Ctrl+\ or
308
345
  Ctrl+<letter> other than i or m are accepted. The `CLAUDE_CLI_BIN`/`CLAUDE_CLI_ARGS`
309
346
  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).
347
+ See [`designs/agent-runtime.md`](https://github.com/Agora-Build/Atem/blob/main/designs/agent-runtime.md).
348
+
349
+ **Chat from Astation.** Astation can open a chat view of a Claude session
350
+ launched with `atem agent launch claude`: your prompts appear as messages and
351
+ Claude's replies come from its own session log, with a status of ready,
352
+ working, waiting or unknown. Atem adds its hooks with `--settings` for that run
353
+ only; your `~/.claude` settings are not changed. A prompt sent from chat needs
354
+ control of the session, is typed into Claude once, and is reported as
355
+ accepted, then complete (or failed) when Claude's turn ends.
356
+ Codex works the same way once you allow Atem's Codex hooks (asked
357
+ once on the first `atem agent launch codex`, see below): Atem reads Codex's
358
+ own session log, so Codex shows ready, working, waiting or unknown. Codex
359
+ reports nothing before its first prompt, so type the first prompt in the
360
+ terminal; after that chat prompts work. Replies arrive whole (no streaming),
361
+ and Codex's chat has no reasoning text or error details.
362
+ Interrupt from chat stops a running turn only. See
363
+ [`designs/agent-chat-host.md`](https://github.com/Agora-Build/Atem/blob/main/designs/agent-chat-host.md).
364
+
365
+ **Approve prompts from Astation and your phone.** When Claude Code or Codex
366
+ asks for permission to run a tool, Astation shows the request as a card (in
367
+ a Claude chat view too) and Atem asks the relay to notify your devices
368
+ with control. A card shows the tool and a short summary — the command's first
369
+ line or the file path, never file contents — and offers **Allow once**,
370
+ **Always allow** (Claude: one of the rules Claude itself suggests, with where
371
+ it is saved; Codex, for shell commands only: **Always allow this command** —
372
+ exactly this command in this folder, for the rest of this Codex process, kept
373
+ by Atem; later runs of
374
+ the very same command are allowed without asking and show as "auto allowed",
375
+ and the rule can be revoked from Astation) or **Deny** (with an optional
376
+ note for the agent).
377
+ Answering needs no control of the session: any of your devices that can
378
+ control it answers, whoever is typing, and the first answer wins. The
379
+ finished card shows how it ended. The terminal can
380
+ always answer instead: Claude keeps its own dialog on screen (the first
381
+ answer wins), and for Codex any key you type in the terminal hands the
382
+ prompt back to Codex's own dialog. If nobody answers, nothing is allowed:
383
+ after the hook's wait (Claude 10 min, Codex 5 min) the agent asks in the
384
+ terminal as usual. Claude gets the hook with `--settings` for each launch;
385
+ to turn it off, set `approvals_hook = false` under `[claude]` in
386
+ `~/.config/atem/config.toml` (Claude sessions launched afterwards keep their
387
+ prompts in the terminal).
388
+ The first `atem agent launch codex` asks once whether to add Atem's hooks
389
+ (one per Codex event, for approvals and chat) to `~/.codex/hooks.json`, after
390
+ your own (a backup is kept as `hooks.json.atem-bak`); to turn them off later,
391
+ set `hooks = false` under `[codex]` in `~/.config/atem/config.toml` — the next
392
+ `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
393
 
312
394
  ## TUI Modes
313
395
 
314
396
  | Mode | Description |
315
397
  |------|-------------|
316
398
  | **Main Menu** | Navigate between features |
317
- | **Claude Chat** | Claude Code CLI integration via PTY |
318
- | **Codex Chat** | Codex terminal integration via PTY |
399
+ | **Agent Sessions** | The runtime's Claude/Codex sessions: launch or attach |
319
400
  | **Token Gen** | Generate Agora RTC/RTM tokens locally |
320
401
  | **Projects** | Browse Agora projects via API |
321
402
 
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.2",
4
4
  "description": "A terminal that connects people, Agora platform, and AI agents.",
5
5
  "bin": {
6
6
  "atem": "bin/atem"