agent-dag 1.17.0 → 1.19.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 +74 -34
- package/bin/agent-dag.js +9 -9
- package/dist/web/assets/index-Bs89BdrR.js +62 -0
- package/dist/web/assets/{index-DGqLVo1U.css → index-CVsr6RfQ.css} +1 -1
- package/dist/web/index.html +3 -3
- package/package.json +7 -5
- package/src/server/index.mjs +29 -6
- package/src/server/quota.mjs +133 -0
- package/dist/web/assets/index-DqX-Cmxy.js +0 -62
package/README.md
CHANGED
|
@@ -1,59 +1,99 @@
|
|
|
1
|
-
#
|
|
1
|
+
# agents-deck
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/agents-deck)
|
|
4
|
+
[](https://www.npmjs.com/package/agents-deck)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://nodejs.org)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
Live canvas for **Claude Code** and **OpenAI Codex** agents. Watch parallel subagents fork, call tools, and finish — all on one calm graph.
|
|
9
|
+
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
## Quick start
|
|
6
13
|
|
|
7
14
|
```bash
|
|
8
|
-
npx
|
|
15
|
+
npx agents-deck
|
|
9
16
|
```
|
|
10
17
|
|
|
11
|
-
Opens http://127.0.0.1:4317
|
|
18
|
+
Opens **http://127.0.0.1:4317** and auto-registers the Claude Code hook. Start any Claude Code or Codex session and the graph fills in live.
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
No config. No install step. Ctrl+C to stop.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- **Live DAG** — nodes are agents, edges are spawns and tool calls; in-flight edges animate, settled edges fade
|
|
25
|
+
- **Dual provider** — Claude Code via hooks, Codex via log-tail; both appear on the same canvas; the model chip (`Opus 4.8`, `GPT-5.5`) tells them apart
|
|
26
|
+
- **Click-to-inspect** — click any node for prompt, tool calls, token usage, and timing
|
|
27
|
+
- **Persistent replay** — events survive restarts; the log at `~/.claude/agent-dag/events.jsonl` replays the last session on open
|
|
28
|
+
- **Workspace filter** — `--scope` limits capture to the current directory; `--workspace <path>` for any subtree
|
|
29
|
+
- **Zero trust step for Codex** — no hook install, no `/hooks` trust prompt; the server tails `~/.codex/sessions/` directly
|
|
30
|
+
|
|
31
|
+
## How it works
|
|
32
|
+
|
|
33
|
+
Two capture paths feed one SSE stream → one browser canvas.
|
|
34
|
+
|
|
35
|
+
**Claude Code** — on first run `agents-deck` injects a hook entry into `~/.claude/settings.json` for every relevant event:
|
|
14
36
|
|
|
15
37
|
```
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
--workspace <path> Only capture sessions whose cwd is inside <path>
|
|
19
|
-
--scope Restrict to the current working directory
|
|
20
|
-
--all Capture sessions from all workspaces (machine-wide; default)
|
|
21
|
-
--codex Force-enable Codex capture even if ~/.codex/ is missing
|
|
22
|
-
--no-codex Skip Codex capture (Claude only)
|
|
23
|
-
--history <path> Override events log file (default: ~/.claude/agent-dag/events.jsonl)
|
|
24
|
-
--no-persist RAM-only mode, no log file
|
|
25
|
-
--uninstall Remove agent-dag hooks from ~/.claude/settings.json
|
|
26
|
-
-h, --help Show help
|
|
38
|
+
SessionStart · UserPromptSubmit · PreToolUse · PostToolUse · PostToolUseFailure
|
|
39
|
+
SubagentStart · SubagentStop · Stop · SessionEnd · Notification
|
|
27
40
|
```
|
|
28
41
|
|
|
29
|
-
|
|
42
|
+
Each hook fires the bundled `hook.js`, which POSTs the event JSON to the running server.
|
|
30
43
|
|
|
31
|
-
|
|
32
|
-
- Node = agent (root session, subagent).
|
|
33
|
-
- Edge = parent → child (spawn) or agent → tool (call).
|
|
34
|
-
- In-flight edges animate; settled edges fade.
|
|
35
|
-
- Click a node for details.
|
|
44
|
+
**OpenAI Codex** — Codex CLI hooks don't fire reliably on Windows (the sandbox refuses to spawn them). Instead, the server tails Codex's rollout files at `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl` and reconstructs an equivalent event stream — session start, prompts, tool calls, token usage, model. No hook install, no trust step needed. Set `CODEX_HOME` to override the default path.
|
|
36
45
|
|
|
37
|
-
##
|
|
46
|
+
## Options
|
|
38
47
|
|
|
39
|
-
|
|
48
|
+
```
|
|
49
|
+
agents-deck [options]
|
|
50
|
+
|
|
51
|
+
-p, --port <number> Preferred port (default: 4317; fallback: random 4318–4400)
|
|
52
|
+
--no-open Don't open the browser automatically
|
|
53
|
+
--workspace <path> Only capture sessions whose cwd is inside <path>
|
|
54
|
+
--scope Restrict to the current working directory
|
|
55
|
+
--all Capture every session on this machine (default)
|
|
56
|
+
--history <path> Override the events log file
|
|
57
|
+
(default: ~/.claude/agent-dag/events.jsonl)
|
|
58
|
+
--no-persist RAM-only mode — don't write or replay the log
|
|
59
|
+
--codex Force Codex capture even if ~/.codex/ is missing
|
|
60
|
+
--no-codex Skip Codex capture (Claude only)
|
|
61
|
+
--uninstall Remove agents-deck hooks from settings files
|
|
62
|
+
-h, --help Show this help
|
|
63
|
+
```
|
|
40
64
|
|
|
41
|
-
|
|
65
|
+
## Uninstall
|
|
42
66
|
|
|
43
|
-
|
|
67
|
+
```bash
|
|
68
|
+
npx agents-deck --uninstall
|
|
69
|
+
```
|
|
44
70
|
|
|
45
|
-
|
|
71
|
+
Removes all hook entries injected by agents-deck from `~/.claude/settings.json` (and `~/.codex/hooks.json` if present).
|
|
46
72
|
|
|
47
|
-
|
|
73
|
+
## Legacy name
|
|
48
74
|
|
|
49
|
-
|
|
75
|
+
Formerly **agent-dag**. Both names publish the same package and the `agent-dag` command is a built-in alias — existing installs and scripts keep working.
|
|
50
76
|
|
|
51
77
|
```bash
|
|
52
|
-
|
|
78
|
+
# both work identically
|
|
79
|
+
npx agents-deck
|
|
80
|
+
npx agent-dag
|
|
53
81
|
```
|
|
54
82
|
|
|
55
|
-
|
|
83
|
+
## Design
|
|
84
|
+
|
|
85
|
+
One canvas. No tabs. No kanban.
|
|
86
|
+
|
|
87
|
+
- Node = agent (root session or subagent)
|
|
88
|
+
- Edge = parent → child (spawn) or agent → tool (call)
|
|
89
|
+
- In-flight = animated; settled = dimmed
|
|
90
|
+
- Click a node for full details
|
|
91
|
+
|
|
92
|
+
## Requirements
|
|
93
|
+
|
|
94
|
+
- Node.js ≥ 18
|
|
95
|
+
- Claude Code CLI or OpenAI Codex CLI (or both)
|
|
56
96
|
|
|
57
|
-
##
|
|
97
|
+
## License
|
|
58
98
|
|
|
59
|
-
|
|
99
|
+
MIT © [Bargan Constantin](https://github.com/BarganConstantin)
|
package/bin/agent-dag.js
CHANGED
|
@@ -24,13 +24,13 @@ if (flags.uninstall) {
|
|
|
24
24
|
const { uninstallHooks, hasCodexInstalled } = await import(pathToFileURL(join(PKG_ROOT, "src/server/installer.mjs")).href);
|
|
25
25
|
const claude = await uninstallHooks({ provider: "claude" });
|
|
26
26
|
console.log(claude.changed
|
|
27
|
-
? `
|
|
28
|
-
: "
|
|
27
|
+
? `agents-deck: hooks removed from ${claude.settingsPath}`
|
|
28
|
+
: "agents-deck: no Claude hooks to remove");
|
|
29
29
|
if (hasCodexInstalled()) {
|
|
30
30
|
const codex = await uninstallHooks({ provider: "codex" });
|
|
31
31
|
console.log(codex.changed
|
|
32
|
-
? `
|
|
33
|
-
: "
|
|
32
|
+
? `agents-deck: hooks removed from ${codex.settingsPath}`
|
|
33
|
+
: "agents-deck: no Codex hooks to remove");
|
|
34
34
|
}
|
|
35
35
|
process.exit(0);
|
|
36
36
|
}
|
|
@@ -59,7 +59,7 @@ const wantCodex = flags.noCodex
|
|
|
59
59
|
|
|
60
60
|
const WEB_DIST = join(PKG_ROOT, "dist", "web", "index.html");
|
|
61
61
|
if (!existsSync(WEB_DIST)) {
|
|
62
|
-
console.error("
|
|
62
|
+
console.error("agents-deck: ui not built. run `npm run build` (or `pnpm build`) first.");
|
|
63
63
|
process.exit(1);
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -88,7 +88,7 @@ async function printBanner() {
|
|
|
88
88
|
|
|
89
89
|
// Each entry: [rendered string with ANSI, visible char count, left-border color, right-border color]
|
|
90
90
|
const rows = [
|
|
91
|
-
{ l: ` ${C.bCyan}${C.bold}◉${C.reset} ${C.white}${C.bold}
|
|
91
|
+
{ l: ` ${C.bCyan}${C.bold}◉${C.reset} ${C.white}${C.bold}agents-deck${C.reset} ${C.dim}v${PKG_VERSION}${C.reset}`, vis: 19 + PKG_VERSION.length, lc: C.blue, rc: C.blue },
|
|
92
92
|
{ l: ` ${C.dim}live DAG · Claude Code + Codex${C.reset}`, vis: 32, lc: C.magenta, rc: C.magenta },
|
|
93
93
|
{ l: ` ${C.yellow}watch agents fork ${C.cyan}→${C.reset} ${C.green}tools fire${C.reset}`, vis: 34, lc: C.bMag, rc: C.bMag },
|
|
94
94
|
];
|
|
@@ -206,10 +206,10 @@ function parseArgs(args) {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
function printHelp() {
|
|
209
|
-
process.stdout.write(`
|
|
209
|
+
process.stdout.write(`agents-deck — live deck of Claude Code + Codex agents
|
|
210
210
|
|
|
211
211
|
Usage:
|
|
212
|
-
|
|
212
|
+
agents-deck [options]
|
|
213
213
|
|
|
214
214
|
Options:
|
|
215
215
|
-p, --port <number> Preferred port (default: 4317; falls back to random 4318–4400)
|
|
@@ -221,7 +221,7 @@ Options:
|
|
|
221
221
|
--no-persist Don't write or replay events log (RAM-only)
|
|
222
222
|
--codex Force-enable Codex capture even if ~/.codex/ missing
|
|
223
223
|
--no-codex Skip Codex capture (Claude only)
|
|
224
|
-
--uninstall Remove
|
|
224
|
+
--uninstall Remove agents-deck Claude hook entries
|
|
225
225
|
-h, --help Show this help
|
|
226
226
|
`);
|
|
227
227
|
}
|