agent-dag 3.22.1 → 3.22.3

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.
Files changed (70) hide show
  1. package/README.md +6 -477
  2. package/package.json +14 -48
  3. package/shim.js +107 -0
  4. package/LICENSE +0 -661
  5. package/LICENSING.md +0 -82
  6. package/THIRD_PARTY_NOTICES.md +0 -395
  7. package/bin/agent-dag.js +0 -626
  8. package/bin/deck.js +0 -1805
  9. package/dist/web/assets/index-CJYsv0lr.css +0 -1
  10. package/dist/web/assets/index-Ifm23DDC.js +0 -270
  11. package/dist/web/index.html +0 -49
  12. package/hook/hook.js +0 -542
  13. package/release-notes.json +0 -398
  14. package/src/server/activity.mjs +0 -52
  15. package/src/server/agent-activity.mjs +0 -522
  16. package/src/server/args.mjs +0 -183
  17. package/src/server/auto-update.mjs +0 -79
  18. package/src/server/block-notify.mjs +0 -173
  19. package/src/server/boot-deadline.mjs +0 -127
  20. package/src/server/brand.mjs +0 -16
  21. package/src/server/browser-history.mjs +0 -497
  22. package/src/server/browser-presence.mjs +0 -211
  23. package/src/server/browser-profiles.mjs +0 -279
  24. package/src/server/browser-react.mjs +0 -284
  25. package/src/server/browser-watch-store.mjs +0 -350
  26. package/src/server/browser-watch.mjs +0 -905
  27. package/src/server/ccusage.mjs +0 -1168
  28. package/src/server/claude-accounts.mjs +0 -951
  29. package/src/server/claude-dir.mjs +0 -213
  30. package/src/server/codex-auth.mjs +0 -388
  31. package/src/server/codex-dir.mjs +0 -171
  32. package/src/server/codex-quota.mjs +0 -449
  33. package/src/server/codex-usage.mjs +0 -512
  34. package/src/server/cswap-admin.mjs +0 -1562
  35. package/src/server/cswap-auto.mjs +0 -658
  36. package/src/server/cswap-install.mjs +0 -641
  37. package/src/server/deck-home.mjs +0 -243
  38. package/src/server/deck-prefs.mjs +0 -301
  39. package/src/server/deck-probe.mjs +0 -111
  40. package/src/server/detach.mjs +0 -244
  41. package/src/server/exec.mjs +0 -996
  42. package/src/server/global-install.mjs +0 -67
  43. package/src/server/hwmonitor.mjs +0 -56
  44. package/src/server/index.mjs +0 -6043
  45. package/src/server/installer.mjs +0 -912
  46. package/src/server/invoked-as.mjs +0 -144
  47. package/src/server/lan-about.mjs +0 -119
  48. package/src/server/lan-engine.mjs +0 -952
  49. package/src/server/lan-reach.mjs +0 -256
  50. package/src/server/lan-socket.mjs +0 -682
  51. package/src/server/lan-sync.mjs +0 -941
  52. package/src/server/lhm-parse.mjs +0 -91
  53. package/src/server/log-tail.mjs +0 -139
  54. package/src/server/log-writer.mjs +0 -322
  55. package/src/server/login-service.mjs +0 -473
  56. package/src/server/macmon.mjs +0 -310
  57. package/src/server/npx.mjs +0 -264
  58. package/src/server/open-url.mjs +0 -242
  59. package/src/server/presence.mjs +0 -40
  60. package/src/server/quota.mjs +0 -792
  61. package/src/server/relay-guard.mjs +0 -507
  62. package/src/server/reset-label.mjs +0 -78
  63. package/src/server/retire-sound-hook.mjs +0 -349
  64. package/src/server/running-deck.mjs +0 -234
  65. package/src/server/self-update.mjs +0 -1380
  66. package/src/server/stop-deck.mjs +0 -171
  67. package/src/server/supervisor.mjs +0 -392
  68. package/src/server/system-metrics.mjs +0 -1825
  69. package/src/server/term.mjs +0 -686
  70. package/src/server/uv-bootstrap.mjs +0 -337
@@ -1,67 +0,0 @@
1
- // Putting this package on the user's PATH, when they ask for it in words.
2
- //
3
- // `npx ccdeck` runs the deck and leaves nothing behind, which is the whole
4
- // contract of that command and is not something to quietly break: a tool that
5
- // installs itself globally because it decided that was better is the tool people
6
- // uninstall. So this exists behind `--install`, where somebody typed it.
7
- //
8
- // WHAT IT BUYS is the one thing an npx run cannot have. A login item must name a
9
- // path that will still be there tomorrow, and npx runs out of
10
- // ~/.npm/_npx/<hash>/, which npm deletes whenever it likes — so an npx deck can
11
- // run in the background and cannot start at login. A global install is a stable
12
- // path, and the service points at that.
13
- //
14
- // THE NAME IS THE ONE THEY TYPED. Three packages publish this deck — ccdeck,
15
- // agents-deck and agent-dag — and installing `ccdeck` for somebody who ran
16
- // `npx agent-dag` would hand them a command they did not ask for and leave the
17
- // one they did use pointing at a cache directory.
18
- import { posix as posixPath, win32 as winPath } from "node:path";
19
-
20
- /** Long enough for a cold registry fetch on a slow line, short enough that a
21
- * hung npm does not own the terminal for the afternoon. */
22
- export const INSTALL_TIMEOUT_MS = 180_000;
23
-
24
- /**
25
- * Where `npm i -g` puts a package's own directory.
26
- *
27
- * The joiner comes from the TARGET platform, not the host — `node:path`'s is
28
- * bound to the machine running it, and this repo has gone red on that three
29
- * times. See the note in deck-home.mjs.
30
- */
31
- export function globalScript(root, pkg, platform = process.platform) {
32
- if (typeof root !== "string" || root === "" || typeof pkg !== "string" || pkg === "") return null;
33
- const { join } = platform === "win32" ? winPath : posixPath;
34
- return join(root.trim(), pkg, "bin", "agent-dag.js");
35
- }
36
-
37
- /**
38
- * What npm answered, as a path or null.
39
- *
40
- * `npm root -g` prints one line and nothing else on success. Anything else —
41
- * a warning npm decided to print first, an empty answer, a non-zero exit — is
42
- * not a path, and guessing one would put the login item somewhere nothing lives.
43
- */
44
- export function readGlobalRoot(out) {
45
- if (!out?.ok) return null;
46
- const line = String(out.stdout ?? "").split(/\r?\n/).map(s => s.trim()).filter(Boolean).pop();
47
- return line && !line.startsWith("npm ") ? line : null;
48
- }
49
-
50
- /**
51
- * The sentence to show for a failed install.
52
- *
53
- * EACCES is the one worth naming, because it is the common one and the remedy
54
- * is not obvious: a global prefix owned by root needs either sudo or a prefix
55
- * of the user's own, and "permission denied" alone sends people to sudo when
56
- * the second is the better answer.
57
- */
58
- export function installFailure(out, { pkg = "ccdeck" } = {}) {
59
- const said = `${out?.stderr ?? ""}\n${out?.stdout ?? ""}`;
60
- if (out?.code === "ENOENT") return "npm is not on PATH, so there is nothing to install with";
61
- if (out?.timedOut) return "npm took too long — the registry may be unreachable";
62
- if (/EACCES|permission denied/i.test(said)) {
63
- return `npm cannot write to the global prefix. Either \`sudo npm i -g ${pkg}\`, or point npm at a prefix you own (\`npm config set prefix ~/.npm-global\`) and add its \`bin\` to PATH`;
64
- }
65
- const first = said.split(/\r?\n/).map(s => s.trim()).filter(Boolean)[0];
66
- return first || `npm exited ${out?.status ?? "non-zero"}`;
67
- }
@@ -1,56 +0,0 @@
1
- // Windows' temperature, when something else on the machine already has it.
2
- //
3
- // #747. On a modern Intel laptop Windows publishes no CPU temperature that an
4
- // ordinary process may read. Measured on a physical Windows 11 machine, both
5
- // elevated and not: the firmware declares zero ACPI thermal zones, MSAcpi
6
- // answers "Not supported" even to an administrator, Win32_TemperatureProbe is a
7
- // stub whose every field reads 32768, and the one source that DOES have the
8
- // numbers — Intel Dynamic Tuning's `EsifDeviceInformation` — is Access denied
9
- // without admin. That is the state of Windows, not a gap in this deck: there is
10
- // no standard user-mode API for it, which is why every tool that shows one
11
- // installs a kernel driver.
12
- //
13
- // LibreHardwareMonitor is such a tool. It installs that driver, reads the
14
- // registers directly, and — if its web server is switched on — publishes
15
- // everything as plain HTTP on localhost. Reading THAT needs no privileges at
16
- // all.
17
- //
18
- // SO THIS IS A READ, NEVER A REQUEST. The deck does not install
19
- // LibreHardwareMonitor, does not ask anybody to, and does not mention it: a
20
- // user must do nothing but install ccdeck. If the tool happens to be running —
21
- // and on the machines where this matters it often is, because the person who
22
- // wants a temperature has already gone and got one — the deck uses it. If not,
23
- // the section is not drawn, exactly as before.
24
- import { readTemps } from "./lhm-parse.mjs";
25
-
26
- /** LibreHardwareMonitor's default, and Open Hardware Monitor's before it. Not
27
- * probed across a range: a scan of somebody's loopback ports is not a thing to
28
- * do unasked, and a user who moved the port can say so. */
29
- export const LHM_URL = "http://127.0.0.1:8085/data.json";
30
-
31
- /** Short. A refused connection returns at once; this bounds the case where
32
- * something else holds the port open and never answers. */
33
- const TIMEOUT_MS = 1_500;
34
-
35
- export function lhmUrl(env = process.env) {
36
- const port = Number(env.AGENTS_DECK_LHM_PORT);
37
- return Number.isInteger(port) && port > 0 && port < 65536
38
- ? `http://127.0.0.1:${port}/data.json`
39
- : LHM_URL;
40
- }
41
-
42
- /**
43
- * CPU and GPU degrees from a running LibreHardwareMonitor, or nothing.
44
- *
45
- * Never throws: nothing listening is the ordinary answer, and it arrives as a
46
- * rejected fetch.
47
- */
48
- export async function readHwMonitorTemps({ env = process.env, fetchFn = fetch } = {}) {
49
- try {
50
- const res = await fetchFn(lhmUrl(env), { signal: AbortSignal.timeout(TIMEOUT_MS) });
51
- if (!res.ok) return {};
52
- return readTemps(await res.json());
53
- } catch {
54
- return {};
55
- }
56
- }