agent-dag 3.2.1 → 3.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.
- package/README.md +18 -6
- package/bin/deck.js +9 -1
- package/dist/web/assets/index-3Q9bZKVe.js +171 -0
- package/dist/web/assets/index-D0YH-emg.css +1 -0
- package/dist/web/index.html +2 -2
- package/hook/hook.js +60 -14
- package/package.json +6 -3
- package/release-notes.json +36 -0
- package/src/server/agent-activity.mjs +27 -11
- package/src/server/browser-history.mjs +31 -5
- package/src/server/browser-presence.mjs +57 -12
- package/src/server/browser-react.mjs +31 -9
- package/src/server/browser-watch-store.mjs +56 -2
- package/src/server/browser-watch.mjs +90 -10
- package/src/server/ccusage.mjs +100 -3
- package/src/server/codex-quota.mjs +6 -2
- package/src/server/codex-usage.mjs +24 -1
- package/src/server/cswap-admin.mjs +0 -14
- package/src/server/cswap-auto.mjs +39 -1
- package/src/server/cswap-install.mjs +6 -1
- package/src/server/exec.mjs +44 -0
- package/src/server/index.mjs +127 -11
- package/src/server/installer.mjs +58 -3
- package/src/server/macmon.mjs +17 -6
- package/src/server/npx.mjs +6 -1
- package/src/server/open-url.mjs +25 -4
- package/src/server/quota.mjs +88 -26
- package/src/server/retire-sound-hook.mjs +36 -2
- package/src/server/self-update.mjs +17 -5
- package/src/server/system-metrics.mjs +28 -36
- package/src/server/uv-bootstrap.mjs +39 -3
- package/dist/web/assets/index-Bnn7d7u8.css +0 -1
- package/dist/web/assets/index-COdHVcLu.js +0 -149
package/README.md
CHANGED
|
@@ -76,8 +76,8 @@ The machine panel shows a **Thermal** section only where the machine actually an
|
|
|
76
76
|
|
|
77
77
|
| | reads | needs |
|
|
78
78
|
| --- | --- | --- |
|
|
79
|
-
| Linux | `/sys/class/hwmon
|
|
80
|
-
| Windows | the `Thermal Zone Information` performance counter | nothing — where the machine has an ACPI thermal zone. Many do not; see below |
|
|
79
|
+
| Linux | `/sys/class/hwmon`, then `/sys/class/thermal/thermal_zone*` | nothing |
|
|
80
|
+
| Windows | the `Thermal Zone Information` performance counter, then `MSAcpi_ThermalZoneTemperature`, then LibreHardwareMonitor's web server if it happens to be running | nothing — where the machine has an ACPI thermal zone. Many do not; see below |
|
|
81
81
|
| macOS, Intel | `ioreg` for the GPU, `pmset -g therm` for throttling | nothing |
|
|
82
82
|
| macOS, Apple Silicon | `macmon`, which the deck fetches for you | nothing |
|
|
83
83
|
|
|
@@ -85,14 +85,14 @@ Apple Silicon is the one that needs a tool, and it is not an oversight. No comma
|
|
|
85
85
|
|
|
86
86
|
You do not have to install it. The deck downloads the published binary into `~/.agents-deck/tools/macmon` — the same place it already keeps `uv` — verifies it against the SHA-256 the GitHub release publishes, checks that it runs, and only then uses it. Not through Homebrew, because a machine without Homebrew would need Homebrew installed first, and that is a large thing to do to somebody who asked for a dashboard. It happens in the background, after the deck is already up, and never on the first run's critical path.
|
|
87
87
|
|
|
88
|
-
It is skipped entirely on a machine that already answers
|
|
88
|
+
It is skipped entirely on a machine that already answers, on an Intel Mac — the release publishes an arm64 build and only that, so the architecture is checked before anything is fetched — and on one where you have `macmon` yourself, which is looked for on PATH and on either Homebrew prefix before the download is considered. `AGENTS_DECK_NO_DOWNLOAD=1` turns it off on its own; `AGENTS_DECK_NO_INSTALL=1` turns it off along with everything else.
|
|
89
89
|
|
|
90
90
|
#### Windows, and why it is often blank
|
|
91
91
|
|
|
92
92
|
Windows is the platform where this most often shows nothing, and that is not a defect in the deck. Measured on a physical Windows 11 laptop — a Lenovo IdeaPad L340, Intel i5-9300H, English install, checked both as an ordinary user and as an administrator:
|
|
93
93
|
|
|
94
94
|
- its firmware declares **zero** ACPI thermal zones, so the performance counter above is registered but has no instances
|
|
95
|
-
- `MSAcpi_ThermalZoneTemperature` answers `Not supported` **even to an administrator**
|
|
95
|
+
- `MSAcpi_ThermalZoneTemperature` — which the deck does try, in the same PowerShell child, whenever the counter has no instances — answers `Not supported` **even to an administrator**
|
|
96
96
|
- `Win32_TemperatureProbe` exists but every field reads `32768`, which is WMI's value for "unknown"
|
|
97
97
|
- the sensors are real and actively managed — Intel Dynamic Tuning is running — but it publishes them in `root\WMI EsifDeviceInformation`, which is **Access denied** without administrator
|
|
98
98
|
|
|
@@ -121,9 +121,19 @@ Quota is the one thing that is not just reading. It needs a live token, so when
|
|
|
121
121
|
|
|
122
122
|
## What it touches
|
|
123
123
|
|
|
124
|
-
It never steers an agent or edits your code, but it is not read-only either — besides the hook entry and its own event log, it manages the two tools it leans on, and it refreshes the Codex token it reads quota with, rewriting `~/.codex/auth.json` the way `codex` itself does.
|
|
124
|
+
It never steers an agent or edits your code, but it is not read-only either — besides the hook entry and its own event log, it manages the two tools it leans on, and it refreshes the Codex token it reads quota with, rewriting `~/.codex/auth.json` the way `codex` itself does. It also reads your browser's history when Browser Watch is on; that is its own section below, because it is the one thing here that is about you rather than about an agent.
|
|
125
125
|
|
|
126
|
-
What does go out is short and ordinary: a ~20-byte version check against the npm registry (plus one small request to confirm a version it has not seen before), installs and daily version checks for the two tools the deck manages (claude-swap from PyPI, ccusage from npm), and, while the page is open, quota reads to Anthropic and OpenAI signed with your own credentials — that is where those numbers live. `AGENTS_DECK_NO_INSTALL=1` turns off everything but the quota reads; `AGENTS_DECK_NO_DOWNLOAD=1` is the narrower version — no `uv` binary is fetched, the managed installs stay.
|
|
126
|
+
What does go out is short and ordinary: a ~20-byte version check against the npm registry (plus one small request to confirm a version it has not seen before), installs and daily version checks for the two tools the deck manages (claude-swap from PyPI, ccusage from npm), on an Apple Silicon Mac whose sensors stay silent one release lookup and one binary download from GitHub for `macmon`, and, while the page is open, quota reads to Anthropic and OpenAI signed with your own credentials — that is where those numbers live. `AGENTS_DECK_NO_INSTALL=1` turns off everything but the quota reads; `AGENTS_DECK_NO_DOWNLOAD=1` is the narrower version — no `uv` binary is fetched, the managed installs stay.
|
|
127
|
+
|
|
128
|
+
## Browser Watch
|
|
129
|
+
|
|
130
|
+
The panel behind the eye icon answers one question: **did something drive your browser while you were away?** An agent with browser control opens pages through an API, and Chromium records that — `visits.transition` says `FROM_API` rather than `LINK` or `TYPED`. So a run of those, in a stretch when you were not touching the machine, is a finding worth showing.
|
|
131
|
+
|
|
132
|
+
To answer it the deck reads the browsers' own history. That means, on each poll: it finds every Chromium profile (Chrome, Brave, Edge, Vivaldi), **copies each profile's `History` database** to a temp file — a live database cannot be opened safely — queries the visits newer than the moment this deck started, and deletes the copy. Nothing leaves the machine, and the copy exists for as long as one query takes.
|
|
133
|
+
|
|
134
|
+
**The switch decides whether any of that happens in the background.** With Browser Watch off, the deck's five-minute poll reads no browser at all; with it on, the poll reads, keeps what it finds in `~/.claude/agent-dag/browser-watch/state.json`, writes a line per finding to `watch.log` beside it, and performs whatever reaction you chose. Opening the panel always reads live, on either setting — that is you looking, and it is the only way the panel can tell you what is there.
|
|
135
|
+
|
|
136
|
+
Only visits **after this deck started** are ever considered. Your existing history is not swept, not archived and not shown.
|
|
127
137
|
|
|
128
138
|
## Accounts
|
|
129
139
|
|
|
@@ -195,6 +205,8 @@ Environment:
|
|
|
195
205
|
| `AGENTS_DECK_CLAUDE` | Full path to the `claude` CLI |
|
|
196
206
|
| `AGENTS_DECK_CCUSAGE` | Full path to your own `ccusage`, used ahead of everything else |
|
|
197
207
|
| `CLAUDE_SWAP_BACKUP` | Override the claude-swap store root the Accounts panel reads |
|
|
208
|
+
| `CLAUDE_CONFIG_DIR` | Override `~/.claude` — the hook entry, the event log and everything else the deck writes move with it |
|
|
209
|
+
| `AGENTS_DECK_LHM_PORT` | Port of a running LibreHardwareMonitor web server, when it is not 8085 (Windows temperatures) |
|
|
198
210
|
|
|
199
211
|
Usage history is read with `ccusage`, and the deck takes the first of these that answers: `AGENTS_DECK_CCUSAGE` if you set it, then the copy it installed for itself under `~/.agents-deck/ccusage`, then a `ccusage` on your PATH, then `npx -y ccusage@latest`. So installing ccusage yourself is enough — the deck will not fetch a second copy, and it works under `AGENTS_DECK_NO_INSTALL=1`, which is the combination that variable is for. When something fails, the modal names which of those four it was.
|
|
200
212
|
|
package/bin/deck.js
CHANGED
|
@@ -487,7 +487,15 @@ async function reportStartup(jobs) {
|
|
|
487
487
|
// The file it names is one only the user can repair, and every Claude Code
|
|
488
488
|
// session on this machine is reading it too.
|
|
489
489
|
write(row({ mark: G.fail, tone: P.err, label: "Claude hooks", detail: "not installed" }));
|
|
490
|
-
|
|
490
|
+
// THE WAY OUT, printed where the wall is. The installer's message is good —
|
|
491
|
+
// the path, the reason, "fix the file or move it aside" — and it is a file
|
|
492
|
+
// the user may not be able to edit: root-owned, on read-only media, or
|
|
493
|
+
// simply not theirs. This deck knows the remedy and used to keep it in a
|
|
494
|
+
// comment: --no-claude runs everything else, which on a Codex-only machine
|
|
495
|
+
// is the whole deck, over a settings.json belonging to a CLI they do not
|
|
496
|
+
// use.
|
|
497
|
+
console.error(`\n ${PRODUCT}: ${hooks.err.message}`);
|
|
498
|
+
console.error(` Or start with --no-claude to run without Claude hooks.\n`);
|
|
491
499
|
process.exit(1);
|
|
492
500
|
} else {
|
|
493
501
|
write(row({ mark: G.ok, label: "Claude hooks", detail: fileLink(hooks.v.hookPath) }));
|