agent-dag 1.42.0 → 1.44.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.
- package/README.md +10 -6
- package/bin/agent-dag.js +63 -9
- package/bin/deck.js +46 -11
- package/dist/web/assets/index-DBsxIfdM.js +78 -0
- package/dist/web/assets/index-XtT5NdJI.css +1 -0
- package/dist/web/index.html +2 -2
- package/hook/notify.mjs +104 -0
- package/package.json +2 -2
- package/src/server/ccusage.mjs +114 -2
- package/src/server/claude-accounts.mjs +145 -1
- package/src/server/codex-quota.mjs +95 -3
- package/src/server/codex-usage.mjs +108 -3
- package/src/server/cswap-admin.mjs +180 -6
- package/src/server/cswap-auto.mjs +209 -10
- package/src/server/cswap-install.mjs +238 -17
- package/src/server/exec.mjs +130 -11
- package/src/server/index.mjs +226 -19
- package/src/server/installer.mjs +145 -22
- package/src/server/invoked-as.mjs +16 -14
- package/src/server/quota.mjs +131 -34
- package/src/server/self-update.mjs +262 -21
- package/src/server/sound-hook.mjs +158 -28
- package/src/server/supervisor.mjs +36 -0
- package/src/server/system-metrics.mjs +105 -7
- package/src/server/uv-bootstrap.mjs +48 -11
- package/dist/web/assets/index-CHFnwsds.css +0 -1
- package/dist/web/assets/index-DLihciEi.js +0 -78
- package/hook/notify.js +0 -60
package/hook/notify.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Plays a short sound when Claude Code finishes a turn. Installed by
|
|
3
|
-
// agents-deck as a Stop hook and toggled from the deck's topbar.
|
|
4
|
-
//
|
|
5
|
-
// The platform check happens HERE, at run time, rather than in the settings
|
|
6
|
-
// entry that invokes it. Hand-written sound hooks are almost always a single
|
|
7
|
-
// OS-specific command — `afplay` on a Mac, a PowerShell one-liner on Windows —
|
|
8
|
-
// which does nothing on any other machine, and typically ends in `|| true`, so
|
|
9
|
-
// the failure is silent. One script that picks its own player means the same
|
|
10
|
-
// settings.json works on every machine the user syncs it to.
|
|
11
|
-
import { spawn } from "node:child_process";
|
|
12
|
-
import { existsSync } from "node:fs";
|
|
13
|
-
|
|
14
|
-
// First entry whose file exists wins. Each is a [command, args] pair.
|
|
15
|
-
function players() {
|
|
16
|
-
if (process.platform === "darwin") {
|
|
17
|
-
const sound = ["/System/Library/Sounds/Glass.aiff", "/System/Library/Sounds/Ping.aiff"]
|
|
18
|
-
.find(existsSync);
|
|
19
|
-
return sound ? [["afplay", [sound]]] : [];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (process.platform === "win32") {
|
|
23
|
-
// PlaySync inside the hook process keeps the sound from being cut off when
|
|
24
|
-
// the shell exits, which is what a bare Media.SoundPlayer call would do.
|
|
25
|
-
const ps = "(New-Object Media.SoundPlayer 'C:\\Windows\\Media\\tada.wav').PlaySync()";
|
|
26
|
-
return [["powershell.exe", ["-NoProfile", "-Command", ps]]];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Linux and the BSDs: no single player is guaranteed, so try the common ones
|
|
30
|
-
// in order of how likely they are to be present on a desktop install. The
|
|
31
|
-
// freedesktop sound theme ships with most of them.
|
|
32
|
-
const wav = [
|
|
33
|
-
"/usr/share/sounds/freedesktop/stereo/complete.oga",
|
|
34
|
-
"/usr/share/sounds/freedesktop/stereo/bell.oga",
|
|
35
|
-
].find(existsSync);
|
|
36
|
-
return [
|
|
37
|
-
["canberra-gtk-play", ["--id", "complete"]],
|
|
38
|
-
...(wav ? [["paplay", [wav]], ["aplay", [wav]]] : []),
|
|
39
|
-
// Last resort: the terminal bell. Silent under many configs, but costs
|
|
40
|
-
// nothing to try and works over SSH where no audio device exists.
|
|
41
|
-
["printf", ["\\a"]],
|
|
42
|
-
];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Try each candidate until one starts without ENOENT. Detached and unref'd so
|
|
46
|
-
// the hook returns immediately — Claude Code waits on hook processes, and a
|
|
47
|
-
// two-second sound should not be two seconds of latency at the end of a turn.
|
|
48
|
-
function play(candidates, i = 0) {
|
|
49
|
-
if (i >= candidates.length) return;
|
|
50
|
-
const [cmd, args] = candidates[i];
|
|
51
|
-
try {
|
|
52
|
-
const child = spawn(cmd, args, { stdio: "ignore", detached: true, shell: false });
|
|
53
|
-
child.on("error", () => play(candidates, i + 1)); // not installed — next
|
|
54
|
-
child.unref();
|
|
55
|
-
} catch {
|
|
56
|
-
play(candidates, i + 1);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
play(players());
|