agents-deck 1.18.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.
@@ -0,0 +1,14 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>agents-deck</title>
7
+ <link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='84' font-size='84'%3E%E2%97%89%3C/text%3E%3C/svg%3E" />
8
+ <script type="module" crossorigin src="/assets/index-uANyTzBq.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-DGqLVo1U.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
package/hook/hook.js ADDED
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env node
2
+ // agent-dag hook forwarder. Invoked by Claude Code or Codex CLI as a command
3
+ // hook. Reads stdin (event JSON), tags it with the provider passed via
4
+ // `--provider <name>`, finds the matching agent-dag server via per-workspace
5
+ // discovery files in ~/.claude/agent-dag/, and POSTs the payload. Dead
6
+ // instances are cleaned up.
7
+ "use strict";
8
+
9
+ const fs = require("fs");
10
+ const path = require("path");
11
+ const http = require("http");
12
+ const os = require("os");
13
+
14
+ // Hard cap so a stuck server can never wedge the host CLI.
15
+ setTimeout(() => process.exit(0), 1500);
16
+
17
+ // Single shared discovery dir — Claude Code and Codex CLI both register here
18
+ // via the installer. Lets one running agent-dag server receive both providers.
19
+ const DIR = path.join(os.homedir(), ".claude", "agent-dag");
20
+
21
+ function parseProvider(argv) {
22
+ for (let i = 0; i < argv.length; i++) {
23
+ if (argv[i] === "--provider" && i + 1 < argv.length) return argv[i + 1];
24
+ }
25
+ return "claude";
26
+ }
27
+ const PROVIDER = parseProvider(process.argv.slice(2));
28
+
29
+ function normPath(p) {
30
+ let r = path.resolve(p);
31
+ try { r = fs.realpathSync(r); } catch {}
32
+ return r;
33
+ }
34
+
35
+ function isAlive(pid) {
36
+ try { process.kill(pid, 0); return true; }
37
+ catch (e) { return e && e.code === "EPERM"; }
38
+ }
39
+
40
+ let input = "";
41
+ process.stdin.setEncoding("utf8");
42
+ process.stdin.on("data", c => { input += c; });
43
+ process.stdin.on("end", () => {
44
+ let parsed;
45
+ try { parsed = JSON.parse(input); } catch { return process.exit(0); }
46
+ const cwd = parsed && parsed.cwd;
47
+ if (!cwd) return process.exit(0);
48
+
49
+ // Stamp provider so the server / reducer can branch on it without
50
+ // re-sniffing payload shape.
51
+ if (parsed && typeof parsed === "object" && !parsed.provider) {
52
+ parsed.provider = PROVIDER;
53
+ }
54
+ const taggedInput = JSON.stringify(parsed);
55
+
56
+ const resolvedCwd = normPath(cwd);
57
+
58
+ let files;
59
+ try {
60
+ files = fs.readdirSync(DIR).filter(f => f.endsWith(".json"));
61
+ } catch { return process.exit(0); }
62
+ if (!files.length) return process.exit(0);
63
+
64
+ const matches = [];
65
+ for (const file of files) {
66
+ let d;
67
+ try { d = JSON.parse(fs.readFileSync(path.join(DIR, file), "utf8")); } catch { continue; }
68
+ if (typeof d.workspace !== "string" || !d.pid || !d.port) continue;
69
+
70
+ if (!isAlive(d.pid)) {
71
+ try { fs.unlinkSync(path.join(DIR, file)); } catch {}
72
+ continue;
73
+ }
74
+
75
+ if (d.workspace === "") {
76
+ matches.push({ d, wsLen: 0 });
77
+ continue;
78
+ }
79
+ const ws = normPath(d.workspace);
80
+ if (resolvedCwd === ws || resolvedCwd.startsWith(ws + path.sep)) {
81
+ matches.push({ d, wsLen: ws.length });
82
+ }
83
+ }
84
+
85
+ if (!matches.length) return process.exit(0);
86
+
87
+ matches.sort((a, b) => b.wsLen - a.wsLen);
88
+ const bestLen = matches[0].wsLen;
89
+ const targets = matches.filter(m => m.wsLen === bestLen);
90
+
91
+ let pending = targets.length;
92
+ const done = () => { if (--pending <= 0) process.exit(0); };
93
+
94
+ for (const { d } of targets) {
95
+ let settled = false;
96
+ const finish = () => { if (settled) return; settled = true; done(); };
97
+ const req = http.request({
98
+ hostname: "127.0.0.1",
99
+ port: d.port,
100
+ path: "/api/event",
101
+ method: "POST",
102
+ headers: { "Content-Type": "application/json" },
103
+ timeout: 1000,
104
+ }, res => { res.resume(); res.on("end", finish); });
105
+ req.on("error", finish);
106
+ req.on("timeout", () => req.destroy());
107
+ req.write(taggedInput);
108
+ req.end();
109
+ }
110
+ });
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "agents-deck",
3
+ "version": "1.18.0",
4
+ "description": "Live deck of Claude Code and Codex agents — watch parallel subagents fork, call tools, and return on one calm canvas.",
5
+ "type": "module",
6
+ "bin": {
7
+ "agents-deck": "bin/agent-dag.js",
8
+ "agent-dag": "bin/agent-dag.js"
9
+ },
10
+ "files": [
11
+ "bin",
12
+ "hook",
13
+ "src/server",
14
+ "dist/web",
15
+ "LICENSE",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "dev:web": "vite",
20
+ "build:web": "vite build",
21
+ "dev:server": "node src/server/index.mjs",
22
+ "start": "node bin/agent-dag.js",
23
+ "build": "vite build",
24
+ "test": "vitest run",
25
+ "prepublishOnly": "vite build"
26
+ },
27
+ "engines": {
28
+ "node": ">=18"
29
+ },
30
+ "keywords": [
31
+ "claude-code",
32
+ "claude",
33
+ "anthropic",
34
+ "agents",
35
+ "subagents",
36
+ "visualization",
37
+ "dashboard",
38
+ "hooks",
39
+ "observability",
40
+ "dag",
41
+ "deck",
42
+ "graph",
43
+ "live"
44
+ ],
45
+ "author": "Bargan Constantin",
46
+ "license": "MIT",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "git+https://github.com/BarganConstantin/agents-deck.git"
50
+ },
51
+ "bugs": {
52
+ "url": "https://github.com/BarganConstantin/agents-deck/issues"
53
+ },
54
+ "homepage": "https://github.com/BarganConstantin/agents-deck#readme",
55
+ "dependencies": {
56
+ "open": "^10.1.0"
57
+ },
58
+ "devDependencies": {
59
+ "@types/react": "^18.3.12",
60
+ "@types/react-dom": "^18.3.1",
61
+ "@vitejs/plugin-react": "^4.3.4",
62
+ "dagre": "^0.8.5",
63
+ "react": "^18.3.1",
64
+ "react-dom": "^18.3.1",
65
+ "reactflow": "^11.11.4",
66
+ "typescript": "^5.6.3",
67
+ "vite": "^6.0.0",
68
+ "vitest": "^2.1.9"
69
+ }
70
+ }