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 CHANGED
@@ -1,59 +1,99 @@
1
- # agent-dag
1
+ # agents-deck
2
2
 
3
- Live DAG of Claude Code **and OpenAI Codex** agents. Watch parallel subagents fork, call tools, and return — all on one calm canvas.
3
+ [![npm](https://img.shields.io/npm/v/agents-deck?color=cb3837&logo=npm&logoColor=white)](https://www.npmjs.com/package/agents-deck)
4
+ [![npm downloads](https://img.shields.io/npm/dm/agents-deck?color=blue)](https://www.npmjs.com/package/agents-deck)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
+ [![Node.js >=18](https://img.shields.io/badge/node-%3E%3D18-brightgreen?logo=node.js&logoColor=white)](https://nodejs.org)
4
7
 
5
- ## Run
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
+ ![agents-deck — live agent DAG](image_2026-06-16_08-58-42.png)
11
+
12
+ ## Quick start
6
13
 
7
14
  ```bash
8
- npx agent-dag
15
+ npx agents-deck
9
16
  ```
10
17
 
11
- Opens http://127.0.0.1:4317 (or a random port in 4318–4400 if 4317 is taken). Start a Claude Code **or Codex** session in any directory and watch the graph fill in. Both providers render side by side on the same canvas; the model chip on each node tells them apart (e.g. `Opus 4.8`, `GPT-5.5`).
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
- ## Options
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
- -p, --port <number> Preferred port (default: 4317; falls back to random 4318–4400)
17
- --no-open Don't open the browser automatically
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
- ## Design
42
+ Each hook fires the bundled `hook.js`, which POSTs the event JSON to the running server.
30
43
 
31
- - One canvas. No tabs. No kanban.
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
- ## How it works
46
+ ## Options
38
47
 
39
- Two providers, two capture paths — both stream to the same server, which pushes events to the browser over SSE.
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
- **Claude Code** — `agent-dag` registers a hook script in `~/.claude/settings.json` for these events:
65
+ ## Uninstall
42
66
 
43
- `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `SubagentStart`, `SubagentStop`, `Stop`, `SessionEnd`, `Notification`.
67
+ ```bash
68
+ npx agents-deck --uninstall
69
+ ```
44
70
 
45
- The hook forwards the event JSON to the running server.
71
+ Removes all hook entries injected by agents-deck from `~/.claude/settings.json` (and `~/.codex/hooks.json` if present).
46
72
 
47
- **OpenAI Codex** — Codex CLI hooks don't fire reliably on Windows (the sandbox refuses to spawn the hook command), so instead the server tails Codex's session rollout files at `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl` and reconstructs the same event stream (session start, prompts, tool calls, token usage, model). No hook install and no `/hooks` trust step is needed — just run a Codex session and it shows up. Honors `CODEX_HOME` if set.
73
+ ## Legacy name
48
74
 
49
- ## Uninstall
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
- npx agent-dag --uninstall
78
+ # both work identically
79
+ npx agents-deck
80
+ npx agent-dag
53
81
  ```
54
82
 
55
- Removes all hooks from `~/.claude/settings.json`.
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
- ## Status
97
+ ## License
58
98
 
59
- Pre-alpha. Names, ports, and event shapes may change.
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
- ? `agent-dag: hooks removed from ${claude.settingsPath}`
28
- : "agent-dag: no Claude hooks to remove");
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
- ? `agent-dag: hooks removed from ${codex.settingsPath}`
33
- : "agent-dag: no Codex hooks to remove");
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("agent-dag: ui not built. run `npm run build` (or `pnpm build`) first.");
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}agent-dag${C.reset} ${C.dim}v${PKG_VERSION}${C.reset}`, vis: 17 + PKG_VERSION.length, lc: C.blue, rc: C.blue },
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(`agent-dag — live DAG of Claude Code + Codex agents
209
+ process.stdout.write(`agents-deck — live deck of Claude Code + Codex agents
210
210
 
211
211
  Usage:
212
- agent-dag [options]
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 agent-dag Claude hook entries
224
+ --uninstall Remove agents-deck Claude hook entries
225
225
  -h, --help Show this help
226
226
  `);
227
227
  }