@baleen37/ars 1.2.0 → 2.0.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/README.md CHANGED
@@ -47,11 +47,14 @@ local `ars` build: `darwin/arm64`, `linux/amd64`, and `linux/arm64`. Generated
47
47
  collector blobs and the root `ars` build artifact are local build outputs and
48
48
  must not be committed.
49
49
 
50
- ## Common roster and local identity
50
+ ## Localhost and remote inventory
51
51
 
52
52
  The default inventory is `${XDG_CONFIG_HOME}/ars/hosts` when
53
- `XDG_CONFIG_HOME` is set, otherwise `~/.config/ars/hosts`. Put one OpenSSH
54
- target on each line, in the order it should be reported:
53
+ `XDG_CONFIG_HOME` is set, otherwise `~/.config/ars/hosts`. The current computer
54
+ is always included as `localhost`; it requires no configuration. The hosts file
55
+ contains only OpenSSH peers. A missing hosts file is a valid local-only
56
+ configuration. Put one peer target on each line, in the order it should be
57
+ reported:
55
58
 
56
59
  ```text
57
60
  # ~/.config/ars/hosts
@@ -60,18 +63,14 @@ deploy@example.internal
60
63
  agent-mac
61
64
  ```
62
65
 
63
- Every managed computer uses the same `hosts` roster. On each computer, select
64
- that computer's exact roster entry once:
66
+ `ars localhost` opens only current-computer sessions. `localhost` is reserved
67
+ and cannot be added with `ars remote add`.
65
68
 
66
- ```sh
67
- ars local set devbox
68
- ```
69
-
70
- This writes `${XDG_CONFIG_HOME}/ars/local-host`, or
71
- `~/.config/ars/local-host` when `XDG_CONFIG_HOME` is unset. ARS never infers
72
- local identity from OS hostnames, DNS, SSH aliases, VPNs, users, or interfaces.
73
- The current computer is rendered as `local`, but its configured target remains
74
- the canonical identity used by JSON and routing.
69
+ When upgrading an existing installation, read the exact value from its
70
+ `${XDG_CONFIG_HOME}/ars/local-host` file, or `~/.config/ars/local-host` when
71
+ `XDG_CONFIG_HOME` is unset. Remove that exact entry and any literal `localhost`
72
+ entry from `hosts`, leaving only SSH peers. ARS does not read or delete the
73
+ legacy `local-host` file.
75
74
 
76
75
  Blank lines and comments in `hosts` are ignored. Targets may use names and
77
76
  aliases from the user's SSH config. Duplicates, whitespace, control characters,
@@ -79,19 +78,20 @@ a leading dash, and targets over 255 bytes make the entire inventory invalid.
79
78
 
80
79
  `ars remote add <host>` creates the inventory and its parent directory when
81
80
  missing, preserves existing comments, entries, and order, and rejects invalid
82
- or duplicate targets. A target beginning with `#` is rejected because inventory
83
- loading would interpret it as a comment. The command does not edit `~/.ssh/config`.
81
+ or duplicate targets. It also rejects the reserved `localhost` target. A target
82
+ beginning with `#` is rejected because inventory loading would interpret it as
83
+ a comment. The command does not edit `~/.ssh/config`.
84
84
 
85
85
  ## Commands
86
86
 
87
87
  The supported command forms are:
88
88
 
89
89
  ```sh
90
- ars # search sessions from every configured host
91
- ars devbox # search one configured host
90
+ ars # search localhost and every configured SSH peer
91
+ ars localhost # search only current-computer sessions
92
+ ars devbox # search one configured SSH peer
92
93
  ars list --json # return all hosts, sessions, and errors as JSON
93
94
  ars remote add devbox # add an SSH target to the ARS inventory
94
- ars local set devbox # mark this computer's exact roster entry
95
95
  ars --help # show all command forms
96
96
  ars remote --help # show remote command help
97
97
  ```
@@ -104,9 +104,12 @@ one-shot result.
104
104
  The screen has one line per session:
105
105
 
106
106
  ```text
107
- state | title | provider | local/host | project | runtime | activity age
107
+ state | title | provider | location | project | runtime | activity age
108
108
  ```
109
109
 
110
+ The location column is blank for current-computer sessions and shows the
111
+ configured SSH target for peers.
112
+
110
113
  `Active` contains ARS-owned runtimes: `attached(n)` has one or more terminal
111
114
  clients and `running` has none. `Recent` contains saved provider histories with
112
115
  no ARS runtime. The footer shows the selected row's full CWD, native ID, and
@@ -173,12 +176,12 @@ Public JSON uses dedicated DTOs and always ends with a newline:
173
176
  {
174
177
  "schema_version": 1,
175
178
  "hosts": [
176
- {"target": "devbox", "status": "ok"},
179
+ {"target": "localhost", "status": "ok"},
177
180
  {"target": "down", "status": "error"}
178
181
  ],
179
182
  "sessions": [
180
183
  {
181
- "host": "devbox",
184
+ "host": "localhost",
182
185
  "provider": "claude",
183
186
  "native_id": "123e4567-e89b-42d3-a456-426614174000",
184
187
  "updated_at": "2026-07-19T01:02:03Z",
@@ -193,7 +196,7 @@ Public JSON uses dedicated DTOs and always ends with a newline:
193
196
  ```
194
197
 
195
198
  `schema_version` is `1`. Timestamps are UTC-capable RFC3339Nano strings.
196
- `hosts` records every selected inventory target exactly once. `status=ok` with
199
+ `hosts` records every selected target exactly once. `status=ok` with
197
200
  an empty `sessions` array distinguishes a healthy empty host from an
198
201
  unreachable host. Stable error codes are `ssh_timeout`, `ssh_failed`,
199
202
  `unsupported_target`, `protocol_error`, and `resource_limit`.
@@ -282,17 +285,31 @@ host-key checking, remote create/detach with the same provider PID, and
282
285
  second-client handoff without modifying system sshd, persistent SSH state, or
283
286
  the default tmux server.
284
287
 
288
+ ### Real two-host acceptance
289
+
285
290
  Automated evidence is separate from real-host acceptance. Before release, use
286
- two genuinely ready hosts with the same ARS build and roster and verify:
287
-
288
- 1. Each host renders its own configured target as `local`, while canonical JSON
289
- session sets match.
290
- 2. Host A starts Claude, `Ctrl+Q` returns to its TUI, and the provider PID stays
291
- alive; host B then attaches the same PID and A returns to its TUI.
292
- 3. Repeat the same flow for Codex.
293
- 4. Network loss returns to the TUI without killing the provider, and an
291
+ two genuinely ready hosts with the same ARS build and reciprocal peer
292
+ inventories: host A's `hosts` file contains only host B's configured SSH target,
293
+ and host B's contains only host A's. Neither file lists its own computer.
294
+
295
+ Identity is intentionally observer-relative: a computer is `localhost` to
296
+ itself and its configured SSH target to its peer. Verify:
297
+
298
+ 1. Compare the two computers' visible session sets by `(provider, native ID)`,
299
+ not by host label or canonical session key.
300
+ 2. On host A, start a local Claude session, press `Ctrl+Q`, and confirm its PID
301
+ remains alive after A returns to its TUI.
302
+ 3. From A's TUI, attach to that local Claude runtime so A is actually attached.
303
+ While A is attached, select the same provider and native ID on B under A's
304
+ configured SSH target. Confirm A is forced back to its TUI and B attaches to
305
+ the same runtime and PID.
306
+ 4. While B remains attached, select that same local runtime on A again. Confirm
307
+ B is forced back to its TUI and A attaches to the same PID.
308
+ 5. Repeat steps 2–4 for a B-hosted Claude runtime, with A and B reversed.
309
+ 6. Repeat steps 2–5 for Codex.
310
+ 7. Network loss returns to the TUI without killing the provider, and an
294
311
  unreachable peer remains visible beside healthy sessions.
295
- 5. The user's default tmux server, configuration, keys, and sessions are
312
+ 8. The user's default tmux server, configuration, keys, and sessions are
296
313
  unchanged.
297
314
 
298
315
  If inventory, SSH, DNS, tmux, or provider readiness is missing, record this
package/package.json CHANGED
@@ -23,5 +23,5 @@
23
23
  "type": "git",
24
24
  "url": "git+https://github.com/baleen37/agent-remote-sessions.git"
25
25
  },
26
- "version": "1.2.0"
26
+ "version": "2.0.0"
27
27
  }
Binary file
Binary file
Binary file