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.
- package/README.md +6 -477
- package/package.json +14 -48
- package/shim.js +107 -0
- package/LICENSE +0 -661
- package/LICENSING.md +0 -82
- package/THIRD_PARTY_NOTICES.md +0 -395
- package/bin/agent-dag.js +0 -626
- package/bin/deck.js +0 -1805
- package/dist/web/assets/index-CJYsv0lr.css +0 -1
- package/dist/web/assets/index-Ifm23DDC.js +0 -270
- package/dist/web/index.html +0 -49
- package/hook/hook.js +0 -542
- package/release-notes.json +0 -398
- package/src/server/activity.mjs +0 -52
- package/src/server/agent-activity.mjs +0 -522
- package/src/server/args.mjs +0 -183
- package/src/server/auto-update.mjs +0 -79
- package/src/server/block-notify.mjs +0 -173
- package/src/server/boot-deadline.mjs +0 -127
- package/src/server/brand.mjs +0 -16
- package/src/server/browser-history.mjs +0 -497
- package/src/server/browser-presence.mjs +0 -211
- package/src/server/browser-profiles.mjs +0 -279
- package/src/server/browser-react.mjs +0 -284
- package/src/server/browser-watch-store.mjs +0 -350
- package/src/server/browser-watch.mjs +0 -905
- package/src/server/ccusage.mjs +0 -1168
- package/src/server/claude-accounts.mjs +0 -951
- package/src/server/claude-dir.mjs +0 -213
- package/src/server/codex-auth.mjs +0 -388
- package/src/server/codex-dir.mjs +0 -171
- package/src/server/codex-quota.mjs +0 -449
- package/src/server/codex-usage.mjs +0 -512
- package/src/server/cswap-admin.mjs +0 -1562
- package/src/server/cswap-auto.mjs +0 -658
- package/src/server/cswap-install.mjs +0 -641
- package/src/server/deck-home.mjs +0 -243
- package/src/server/deck-prefs.mjs +0 -301
- package/src/server/deck-probe.mjs +0 -111
- package/src/server/detach.mjs +0 -244
- package/src/server/exec.mjs +0 -996
- package/src/server/global-install.mjs +0 -67
- package/src/server/hwmonitor.mjs +0 -56
- package/src/server/index.mjs +0 -6043
- package/src/server/installer.mjs +0 -912
- package/src/server/invoked-as.mjs +0 -144
- package/src/server/lan-about.mjs +0 -119
- package/src/server/lan-engine.mjs +0 -952
- package/src/server/lan-reach.mjs +0 -256
- package/src/server/lan-socket.mjs +0 -682
- package/src/server/lan-sync.mjs +0 -941
- package/src/server/lhm-parse.mjs +0 -91
- package/src/server/log-tail.mjs +0 -139
- package/src/server/log-writer.mjs +0 -322
- package/src/server/login-service.mjs +0 -473
- package/src/server/macmon.mjs +0 -310
- package/src/server/npx.mjs +0 -264
- package/src/server/open-url.mjs +0 -242
- package/src/server/presence.mjs +0 -40
- package/src/server/quota.mjs +0 -792
- package/src/server/relay-guard.mjs +0 -507
- package/src/server/reset-label.mjs +0 -78
- package/src/server/retire-sound-hook.mjs +0 -349
- package/src/server/running-deck.mjs +0 -234
- package/src/server/self-update.mjs +0 -1380
- package/src/server/stop-deck.mjs +0 -171
- package/src/server/supervisor.mjs +0 -392
- package/src/server/system-metrics.mjs +0 -1825
- package/src/server/term.mjs +0 -686
- package/src/server/uv-bootstrap.mjs +0 -337
package/shim.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The old names, kept working.
|
|
3
|
+
//
|
|
4
|
+
// This deck was published under three names for its whole life — `ccdeck`,
|
|
5
|
+
// `agents-deck` and `agent-dag` — and the README, the banner and the docs have
|
|
6
|
+
// pointed at `ccdeck` for a long time. Publishing one product three times is a
|
|
7
|
+
// cost paid on every release forever, and a person reading two different
|
|
8
|
+
// commands for one tool has to work out that they are the same tool.
|
|
9
|
+
//
|
|
10
|
+
// SO THE OTHER TWO STOP BEING THE DECK AND BECOME A DOOR TO IT. They depend on
|
|
11
|
+
// `ccdeck`, print the command to use next time, and hand over. Nothing anybody
|
|
12
|
+
// has typed into a script or an alias stops working, and nobody is left on a
|
|
13
|
+
// version that quietly never updates again.
|
|
14
|
+
//
|
|
15
|
+
// A DEPENDENCY RATHER THAN `npx ccdeck`. Spawning npx would mean a second
|
|
16
|
+
// registry resolution on every single start — slower, and a hard requirement on
|
|
17
|
+
// the network even when everything needed is already on disk. Declaring the
|
|
18
|
+
// dependency makes npm fetch the deck once, alongside this, and this then runs
|
|
19
|
+
// the binary out of node_modules. One resolution, no runtime fetch.
|
|
20
|
+
//
|
|
21
|
+
// WHAT IT MUST NOT DO is get in the way. The notice goes to stderr so a script
|
|
22
|
+
// reading stdout is unaffected, every argument is passed through untouched,
|
|
23
|
+
// the child inherits the terminal so the deck's own output is unchanged, and
|
|
24
|
+
// the exit code is the deck's. Somebody who never reads the notice still gets
|
|
25
|
+
// exactly the deck they asked for.
|
|
26
|
+
import { spawn } from "node:child_process";
|
|
27
|
+
import { createRequire } from "node:module";
|
|
28
|
+
import { existsSync } from "node:fs";
|
|
29
|
+
import { dirname, join } from "node:path";
|
|
30
|
+
|
|
31
|
+
const require = createRequire(import.meta.url);
|
|
32
|
+
|
|
33
|
+
/** The name this copy was started as, for a notice that names the right thing.
|
|
34
|
+
*
|
|
35
|
+
* From the manifest sitting beside this file, not from `npm_package_name`:
|
|
36
|
+
* npm sets that for lifecycle scripts and NOT for a bin, so the first version
|
|
37
|
+
* of this printed "this package is the old name" to anybody who ran it. */
|
|
38
|
+
function calledAs() {
|
|
39
|
+
try {
|
|
40
|
+
return require(new URL("./package.json", import.meta.url).pathname).name || "this package";
|
|
41
|
+
} catch {
|
|
42
|
+
return "this package";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const CALLED_AS = calledAs();
|
|
46
|
+
|
|
47
|
+
/** Where the real deck's launcher is.
|
|
48
|
+
*
|
|
49
|
+
* Resolved through `ccdeck`'s own manifest rather than by guessing a path:
|
|
50
|
+
* a dependency can be hoisted to a parent `node_modules`, nested under this
|
|
51
|
+
* one, or linked, and only the resolver knows which happened here. */
|
|
52
|
+
function deckLauncher() {
|
|
53
|
+
let manifestPath;
|
|
54
|
+
try {
|
|
55
|
+
manifestPath = require.resolve("ccdeck/package.json");
|
|
56
|
+
} catch {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const root = dirname(manifestPath);
|
|
60
|
+
let bin;
|
|
61
|
+
try {
|
|
62
|
+
bin = require(manifestPath).bin;
|
|
63
|
+
} catch {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
// `bin` is a string for a single-binary package and a map for this one.
|
|
67
|
+
const rel = typeof bin === "string" ? bin : bin?.ccdeck ?? Object.values(bin ?? {})[0];
|
|
68
|
+
if (typeof rel !== "string") return null;
|
|
69
|
+
const full = join(root, rel);
|
|
70
|
+
return existsSync(full) ? full : null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const launcher = deckLauncher();
|
|
74
|
+
|
|
75
|
+
if (!launcher) {
|
|
76
|
+
// Say what to run rather than what went wrong internally: the reader's next
|
|
77
|
+
// move is the same either way, and it is one command.
|
|
78
|
+
process.stderr.write(
|
|
79
|
+
`\n ${CALLED_AS} is now a pointer to ccdeck, and ccdeck could not be found beside it.\n` +
|
|
80
|
+
` Run this instead:\n\n npx ccdeck\n\n`,
|
|
81
|
+
);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
process.stderr.write(
|
|
86
|
+
`\n ${CALLED_AS} is the old name for this deck. It still works and always will.\n` +
|
|
87
|
+
` The name it is published under now is ccdeck:\n\n npx ccdeck\n\n` +
|
|
88
|
+
` Starting it for you.\n\n`,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
// `inherit` on all three, so the deck owns the terminal exactly as it would if
|
|
92
|
+
// it had been started directly — its prompts, its colours, its Ctrl-C.
|
|
93
|
+
const child = spawn(process.execPath, [launcher, ...process.argv.slice(2)], { stdio: "inherit" });
|
|
94
|
+
|
|
95
|
+
// The deck's exit is this process's exit, signal included: a supervisor reading
|
|
96
|
+
// the code has to see what the deck actually did, not what a wrapper decided.
|
|
97
|
+
child.on("exit", (code, signal) => {
|
|
98
|
+
if (signal) {
|
|
99
|
+
process.kill(process.pid, signal);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
process.exit(code ?? 0);
|
|
103
|
+
});
|
|
104
|
+
child.on("error", err => {
|
|
105
|
+
process.stderr.write(`\n Could not start ccdeck: ${err?.message ?? err}\n\n npx ccdeck\n\n`);
|
|
106
|
+
process.exit(1);
|
|
107
|
+
});
|