@mkhuda/agent-ps 0.3.0 → 0.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.0
4
+
5
+ The token counts four agents were already writing.
6
+
7
+ - Token counts for Claude Code, Codex, Pi and CommandCode, which all record
8
+ what a turn spent and were simply never read. Seven of the eight agents now
9
+ report what a session cost.
10
+ - The counts are summed over a whole log, which is the one thing here that
11
+ reads a file end to end, so it happens only for the session whose detail
12
+ panel is open. Logs are append only, so a session that grew costs the bytes
13
+ it just wrote rather than all of it again.
14
+ - `agent-ps list` now says when `ps` or `lsof` failed even where the table came
15
+ back with rows, rather than only when it came back empty.
16
+ - The tests run in CI, across every supported interpreter.
17
+
18
+ ## 0.4.0
19
+
20
+ Antigravity, and a legend that was lying about one of the colours.
21
+
22
+ - Google's `agy` is the eighth agent. Each conversation is its own SQLite file,
23
+ but the fields worth showing sit inside protobuf blobs rather than columns, so
24
+ they are read out one at a time: the workspace by its length prefix, the
25
+ opening request from its tags, and the model from the small metadata blob
26
+ rather than the large one, which also holds whatever the session was reading
27
+ and will happily hand back another agent's name.
28
+ - Its steps carry the same status whether a turn is running or finished, so it
29
+ is the one agent whose busy and idle cannot be told apart. That column stays a
30
+ dash rather than guessing at it.
31
+ - The legend coloured the wrong letters. It found each agent by searching the
32
+ line it had just built, and `copilot` contains `pi`, so two letters in the
33
+ middle of one name were painted in another's colour while the real `pi` was
34
+ left with none. Positions are recorded while the line is composed now.
35
+ - An eighth agent had nowhere to go: a basic terminal has seven usable colours
36
+ and the new one would have worn the first one's. Terminals offering 256 now
37
+ draw from a wider palette without disturbing the seven already learned.
38
+
3
39
  ## 0.3.0
4
40
 
5
41
  The detail panel earns its screen.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <div align="center">
2
2
 
3
3
  <img src="https://raw.githubusercontent.com/mkhuda/agent-ps/main/images/agent-ps-screenshot.jpg" width="900"
4
- alt="agent-ps listing sessions from claude, hermes, codex, opencode, pi, commandcode and copilot side by side, each with its model, uptime, idle time, cpu, memory, disk and working directory, with two hermes background helpers at the bottom">
4
+ alt="agent-ps listing eleven sessions across all eight agents at once, each agent named in its own colour, with columns for model, uptime, time since the last turn, cpu, memory and disk. Three antigravity sessions, two hermes background helpers, a copilot chat with no process of its own, and a busy claude session highlighted at the top.">
5
5
 
6
6
  # agent-ps
7
7
 
@@ -13,7 +13,7 @@ what a session was.**
13
13
  [![npm](https://img.shields.io/npm/v/%40mkhuda%2Fagent-ps?style=flat-square&color=blue&label=npm)](https://www.npmjs.com/package/@mkhuda/agent-ps)
14
14
  [![license](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](https://github.com/mkhuda/agent-ps/blob/main/LICENSE)
15
15
  ![python](https://img.shields.io/badge/python-3.8%2B-blue?style=flat-square)
16
- ![agents](https://img.shields.io/badge/agents-7-orange?style=flat-square)
16
+ ![agents](https://img.shields.io/badge/agents-8-orange?style=flat-square)
17
17
  ![dependencies](https://img.shields.io/badge/dependencies-none-brightgreen?style=flat-square)
18
18
 
19
19
  [Install](#install) | [Usage](#usage) | [Agents](#agents) |
@@ -28,7 +28,7 @@ curl -fsSL https://raw.githubusercontent.com/mkhuda/agent-ps/main/install.sh | s
28
28
  `ps aux | grep claude` gives you PIDs. It will not tell you which one is the
29
29
  session you are talking to, what model it is spending on, whether it has been
30
30
  idle for three days, or which rows are background daemons that outlived the
31
- terminal that started them. It also misses the other six agents entirely.
31
+ terminal that started them. It also misses the other seven agents entirely.
32
32
 
33
33
  agent-ps lists every session with its agent, model, working directory, uptime,
34
34
  idle time and disk footprint, then stops one process tree, every background
@@ -68,8 +68,7 @@ pnpm dlx @mkhuda/agent-ps
68
68
  bunx @mkhuda/agent-ps
69
69
  ```
70
70
 
71
- The npm package is scoped because the plain name is too close to an existing
72
- one. Either way the command it gives you is `agent-ps`.
71
+ Either way the command it gives you is `agent-ps`.
73
72
 
74
73
  ### Just the file
75
74
 
@@ -98,7 +97,7 @@ looking at.
98
97
 
99
98
  ### What it needs, and how to remove it
100
99
 
101
- Python 3.8 or later and nothing from PyPI. Tested on 3.8, 3.9, 3.10 and 3.14.
100
+ Python 3.8 or later and nothing from PyPI. Tested on 3.8, 3.9, 3.12 and 3.13.
102
101
  macOS and Linux; Windows is out because `curses` is not in its standard library.
103
102
  It shells out to `ps`, and on macOS to `lsof`, which is how a process is matched
104
103
  to a session everywhere except Claude Code.
@@ -115,25 +114,23 @@ agent-ps only ever reads the agents' own files.
115
114
  Each agent keeps its own colour in the table, and the same colours label the
116
115
  legend above the keys.
117
116
 
118
- | Agent | | Sessions in | Paired by | Tokens | Reopened with |
119
- |---|---|---|---|---|---|
120
- | [Claude Code](https://claude.com/claude-code) | ![yellow](https://img.shields.io/badge/-d4a72c?style=flat-square) | JSONL | the agent itself | no | `claude --resume` |
121
- | [Pi](https://pi.dev) | ![cyan](https://img.shields.io/badge/-00a3a3?style=flat-square) | JSONL | directory | no | `pi --session` |
122
- | CommandCode | ![magenta](https://img.shields.io/badge/-b83fb8?style=flat-square) | JSONL | directory | no | `cmd --resume` |
123
- | [Codex CLI](https://github.com/openai/codex) | ![green](https://img.shields.io/badge/-3f9e3f?style=flat-square) | JSONL | directory | no | `codex resume` |
124
- | [OpenCode](https://github.com/sst/opencode) | ![blue](https://img.shields.io/badge/-3b6fd4?style=flat-square) | SQLite | directory | yes | `opencode --session` |
125
- | Hermes | ![red](https://img.shields.io/badge/-c0392b?style=flat-square) | SQLite | directory | yes | `hermes --resume` |
126
- | GitHub Copilot | ![white](https://img.shields.io/badge/-cfd3d8?style=flat-square) | VS Code storage | no process | yes | in the editor |
127
-
128
- Only Claude Code records which process is running which session, so every other
129
- pairing is matched on working directory and shown as a guess. OpenCode, Hermes
130
- and Copilot count tokens and cost, which the detail panel shows. Agents you have
131
- not installed are skipped, not reported as missing.
132
-
133
- Copilot is the exception to everything. It runs inside the VS Code extension
134
- host, so it has no process of its own: no PID, no uptime, no CPU or memory, and
135
- nothing to stop. What it does have is the credits each turn spent, which the free
136
- tier meters and nothing else surfaces. A chat counts as open while its workspace
117
+ | Agent | | Sessions in | Paired by | Reopened with |
118
+ |---|---|---|---|---|
119
+ | [Claude Code](https://claude.com/claude-code) | ![yellow](https://img.shields.io/badge/-d4a72c?style=flat-square) | JSONL | the agent itself | `claude --resume` |
120
+ | [Pi](https://pi.dev) | ![cyan](https://img.shields.io/badge/-00a3a3?style=flat-square) | JSONL | directory | `pi --session` |
121
+ | CommandCode | ![magenta](https://img.shields.io/badge/-b83fb8?style=flat-square) | JSONL | directory | `cmd --resume` |
122
+ | [Codex CLI](https://github.com/openai/codex) | ![green](https://img.shields.io/badge/-3f9e3f?style=flat-square) | JSONL | directory | `codex resume` |
123
+ | [OpenCode](https://github.com/sst/opencode) | ![blue](https://img.shields.io/badge/-3b6fd4?style=flat-square) | SQLite | directory | `opencode --session` |
124
+ | Hermes | ![red](https://img.shields.io/badge/-c0392b?style=flat-square) | SQLite | directory | `hermes --resume` |
125
+ | GitHub Copilot | ![white](https://img.shields.io/badge/-cfd3d8?style=flat-square) | VS Code storage | no process | in the editor |
126
+ | Antigravity | ![blue](https://img.shields.io/badge/-5f87ff?style=flat-square) | SQLite per conversation | directory | `agy --conversation` |
127
+
128
+ Only Claude Code records which process is running which session. Every other
129
+ pairing is matched on working directory and shown as a guess. Tokens and cost
130
+ appear in the detail panel.
131
+
132
+ Copilot is the exception: it runs inside the VS Code extension host, so it has no
133
+ process of its own and nothing to stop. A chat counts as open while its workspace
137
134
  is open in the editor.
138
135
 
139
136
  ## Usage
@@ -168,11 +165,10 @@ something.
168
165
  Those keys live at the bottom of the screen, under a line naming every agent on
169
166
  screen in its own colour and, on the right, what the table is sorted by:
170
167
 
171
- ![The bottom of the screen: a legend naming each agent in its own colour, the sort shown in words on the right, and the key bar beneath it](https://raw.githubusercontent.com/mkhuda/agent-ps/main/images/agent-ps-footer-screenshot.jpg)
168
+ ![The bottom of the screen: a legend naming all eight agents, each in its own colour, the sort order spelled out on the right, and the key bar beneath it](https://raw.githubusercontent.com/mkhuda/agent-ps/main/images/agent-ps-footer-screenshot.jpg)
172
169
 
173
- That middle line does three jobs. It is the key to the colours in the AGENT
174
- column, it says the sort order in words so the marked heading is never a guess,
175
- and it is where a note appears for a few seconds after you act on something.
170
+ That middle line is the key to the colours, names the sort order in words, and
171
+ is where a note appears for a few seconds after you act on something.
176
172
 
177
173
  Backspacing a filter down to nothing leaves filter mode, so the key bar comes
178
174
  back without reaching for escape.
@@ -203,20 +199,17 @@ ended sessions, then `s` until DISK is marked.
203
199
 
204
200
  ### The detail panel
205
201
 
206
- Enter on a live session opens everything known about it, grouped in the order
207
- the questions arrive: what the session is, what it is doing to the machine, what
208
- it has cost, and the command line last, since it is long and rarely the
209
- question.
202
+ Enter on a live session opens everything known about it, in four groups: what
203
+ the session is, what it is doing to the machine, what it has cost, and the
204
+ command line.
210
205
 
211
206
  <img src="https://raw.githubusercontent.com/mkhuda/agent-ps/main/images/agent-ps-detail.jpg" width="620"
212
207
  alt="The detail panel for a Claude Code session, in four groups. Session: agent, id, status, model, title and directory. Process: pid with its parent, uptime, and time since the last turn. Usage: cpu, memory, and a 41M disk total broken into 28M of transcript, 11M of subagent logs and 2M of file history. Command: the command line that started it.">
213
208
 
214
- The disk total is broken down, because the number on its own is not something
215
- you can act on. Forty megabytes of transcript and forty of file history call for
216
- different answers, and until you can see which it is there is nothing to decide.
209
+ The disk total is broken down by what is holding it, since transcript and file
210
+ history call for different answers.
217
211
 
218
- Where the agent counts tokens, they are here too. Hermes and OpenCode report
219
- cost, Copilot reports the credits a turn spent:
212
+ Tokens and cost are here too, and Copilot reports the credits a turn spent:
220
213
 
221
214
  ```
222
215
  provider opencode-free
@@ -230,14 +223,13 @@ directory rather than reported, so you know before pressing `k` that the pairing
230
223
  is a guess.
231
224
 
232
225
  Enter on an ended session reopens it in a new terminal tab instead. Copilot
233
- chats live in the editor, so they have no reopen command and say so.
226
+ chats reopen in the editor.
234
227
 
235
228
  ### The advisory line
236
229
 
237
230
  A line above the keys points out whatever is worth a look: background helpers
238
231
  left running, sessions untouched for a day, or ended sessions you could resume.
239
- It names the key that acts on it, and only ever shows one thing, since a wall of
240
- warnings teaches people to ignore the line.
232
+ It names the key that acts on it, and shows one thing at a time.
241
233
 
242
234
  ## Scripting
243
235
 
@@ -275,18 +267,14 @@ the table and exits.
275
267
  | CPU, MEM | the same `ps` call |
276
268
  | DISK | everything that session left on disk |
277
269
  | DIR | the working directory |
278
- | TITLE | the session title, or its opening prompt where the agent keeps none |
270
+ | TITLE | the session title, or its opening prompt |
279
271
 
280
- UPTIME and ACTIVE often disagree, and that is the point. A process can be five
281
- days old and have answered a minute ago. UPTIME comes from the process table,
282
- ACTIVE from the modification time of the log, which is appended on every turn,
283
- so an ended session shows a dash under UPTIME and only ACTIVE says how stale it
284
- is.
272
+ UPTIME and ACTIVE often disagree: a process can be five days old and have
273
+ answered a minute ago. UPTIME comes from the process table, ACTIVE from the log,
274
+ which is appended on every turn.
285
275
 
286
- Each agent gets its own colour in the AGENT column, assigned in registry order,
287
- and the same colours appear in the legend, which makes that line the key to the
288
- palette. A selected row keeps its own highlight rather than being broken up, so
289
- the cursor stays unmistakable. Terminals without colour fall back to plain text.
276
+ Each agent has its own colour, and the legend above the keys is the key to it.
277
+ Terminals without colour fall back to plain text.
290
278
 
291
279
  ## A PID marked with a question mark
292
280
 
@@ -360,7 +348,7 @@ install fetches. The build is reproducible: the same source always produces the
360
348
  same bytes, so the committed executable can be checked against the tree.
361
349
 
362
350
  ```
363
- d5f2e2bd6d35e148e461c60c7cb7bd80fce272a15efb462a7dd513955ef5a2b6 agent-ps
351
+ d46f6f55086b25c4efab962d2945e70c2c486aa62931cf6e532cec2c16174496 agent-ps
364
352
  ```
365
353
 
366
354
  Adding an agent takes one class and one line in the registry. See
package/agent-ps CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mkhuda/agent-ps",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "A process table for coding agent sessions. Claude Code, Codex, OpenCode, Hermes, Pi, CommandCode and Copilot in one view, with models, idle time, disk use and one key to stop them.",
5
5
  "keywords": [
6
6
  "cli",