agent-dag 1.33.41 → 1.33.42

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.
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>agents-deck</title>
7
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-DNFdr9c6.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-DGlEPqUj.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-CF2yG9oG.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-dag",
3
- "version": "1.33.41",
3
+ "version": "1.33.42",
4
4
  "description": "Live deck of Claude Code and Codex agents — watch parallel subagents fork, call tools, and return on one calm canvas. Also available as npx ccdeck and npx agent-dag.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -15,6 +15,7 @@ import { spawn, spawnSync } from "node:child_process";
15
15
  import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
16
16
  import path from "node:path";
17
17
  import os from "node:os";
18
+ import { spawnSpec } from "./exec.mjs";
18
19
 
19
20
  const CACHE_MS = 120_000; // 2 min — modal is manual-open; cheap to keep warm
20
21
  const TIMEOUT_MS = 90_000;
@@ -27,12 +28,26 @@ const MARKER = path.join(CACHE_DIR, ".last-update-check");
27
28
 
28
29
  const _cache = new Map(); // key `${since}|${until}` → { result, at }
29
30
 
30
- // npm is a .cmd shim on Windows, which spawn can only launch through a shell.
31
- // Everywhere else shell:false — with a shell, Node warns that arguments are
32
- // concatenated rather than escaped, and the warning lands in our startup
33
- // banner now that these run at boot.
34
- const NPM = process.platform === "win32" ? "npm.cmd" : "npm";
35
- const NPM_SHELL = process.platform === "win32";
31
+ // npm is a .cmd shim on Windows, which spawn can only launch through cmd.exe.
32
+ // `shell: true` is the tempting way to get there and the wrong one: Node then
33
+ // joins file and args with single spaces and no quoting, so on a profile like
34
+ // C:\Users\John Smith the `--prefix <CACHE_DIR>` below arrived as
35
+ // `--prefix C:\Users\John` plus a bogus package spec `Smith\.agents-deck\...`,
36
+ // npm exited non-zero, and the managed install never materialised. spawnSpec
37
+ // routes the .cmd through cmd.exe with every argument quoted, and hands back
38
+ // the argument vector untouched everywhere else.
39
+ function npmSpec(args, platform = process.platform) {
40
+ return spawnSpec(platform === "win32" ? "npm.cmd" : "npm", args, platform);
41
+ }
42
+
43
+ /**
44
+ * What `spawn` gets for `npm install ccusage@<spec>`.
45
+ * Exported for tests: the platform is a parameter so the Windows command line
46
+ * can be checked from any OS.
47
+ */
48
+ export const installSpec = (spec = "latest", platform = process.platform) =>
49
+ npmSpec(["install", `ccusage@${spec}`, "--prefix", CACHE_DIR,
50
+ "--no-save", "--no-audit", "--no-fund", "--loglevel", "error"], platform);
36
51
 
37
52
  let _installing = null; // Promise guard so concurrent calls share one install
38
53
  let _checkedThisRun = false; // only kick the daily check once per process boot
@@ -68,11 +83,11 @@ function resolveEntry() {
68
83
  // the first-run cold path (we must have a binary before we can answer).
69
84
  function installSync(spec = "latest") {
70
85
  mkdirSync(CACHE_DIR, { recursive: true });
86
+ const { file, args, opts } = installSpec(spec);
71
87
  const r = spawnSync(
72
- NPM,
73
- ["install", `ccusage@${spec}`, "--prefix", CACHE_DIR,
74
- "--no-save", "--no-audit", "--no-fund", "--loglevel", "error"],
75
- { shell: NPM_SHELL, windowsHide: true, timeout: INSTALL_TIMEOUT_MS, encoding: "utf8" },
88
+ file,
89
+ args,
90
+ { windowsHide: true, timeout: INSTALL_TIMEOUT_MS, encoding: "utf8", ...opts },
76
91
  );
77
92
  if (r.status !== 0) {
78
93
  throw new Error(`npm install ccusage failed: ${(r.stderr || "").trim() || r.status}`);
@@ -83,11 +98,11 @@ function installSync(spec = "latest") {
83
98
  function installAsync(spec = "latest") {
84
99
  try {
85
100
  mkdirSync(CACHE_DIR, { recursive: true });
101
+ const { file, args, opts } = installSpec(spec);
86
102
  const child = spawn(
87
- NPM,
88
- ["install", `ccusage@${spec}`, "--prefix", CACHE_DIR,
89
- "--no-save", "--no-audit", "--no-fund", "--loglevel", "error"],
90
- { shell: NPM_SHELL, windowsHide: true, detached: false, stdio: "ignore" },
103
+ file,
104
+ args,
105
+ { windowsHide: true, detached: false, stdio: "ignore", ...opts },
91
106
  );
92
107
  child.on("error", () => {});
93
108
  child.unref?.();
@@ -118,8 +133,8 @@ function maybeBackgroundUpdate(installedVersion) {
118
133
  _checkedThisRun = true;
119
134
  touchMarker();
120
135
  try {
121
- const child = spawn(NPM, ["view", "ccusage", "version"],
122
- { shell: NPM_SHELL, windowsHide: true });
136
+ const { file, args, opts } = npmSpec(["view", "ccusage", "version"]);
137
+ const child = spawn(file, args, { windowsHide: true, ...opts });
123
138
  let out = "";
124
139
  child.stdout.on("data", d => { out += d; });
125
140
  child.on("error", () => {});