ccdeck 3.82.3 → 3.82.4
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/bin/cli/login-item.js +5 -0
- package/dist/web/assets/{BrowserWatchModal-BmRTh_xT.js → BrowserWatchModal-CWVooKxD.js} +1 -1
- package/dist/web/assets/{IntegrationModal-C_f526aV.js → IntegrationModal-DLX43RIK.js} +1 -1
- package/dist/web/assets/{RadioPanel-D2rkf9cg.js → RadioPanel-Cj6PjrvQ.js} +1 -1
- package/dist/web/assets/{TrafficRadar-BOgVBLIN.js → TrafficRadar-Bq1YcuHB.js} +1 -1
- package/dist/web/assets/{UsageHistoryModal-BJPTFwM9.js → UsageHistoryModal-CMSCca5_.js} +1 -1
- package/dist/web/assets/{app-DZdZoqJ6.js → app-BHxsMz3-.js} +6 -6
- package/dist/web/assets/{index-B4c5MZCc.js → index-B-l-VxLm.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/release-notes.json +12 -0
- package/src/server/login-service.mjs +109 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./app-
|
|
1
|
+
import"./app-BHxsMz3-.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))i(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})();
|
package/dist/web/index.html
CHANGED
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
document.documentElement.setAttribute("data-density", density === "tightest" || density === "tighter" || density === "compact" || density === "comfortable" ? density : "default");
|
|
78
78
|
})();
|
|
79
79
|
</script>
|
|
80
|
-
<script type="module" crossorigin src="/assets/index-
|
|
81
|
-
<link rel="modulepreload" crossorigin href="/assets/app-
|
|
80
|
+
<script type="module" crossorigin src="/assets/index-B-l-VxLm.js"></script>
|
|
81
|
+
<link rel="modulepreload" crossorigin href="/assets/app-BHxsMz3-.js">
|
|
82
82
|
<link rel="stylesheet" crossorigin href="/assets/app-CbXmr9rC.css">
|
|
83
83
|
</head>
|
|
84
84
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccdeck",
|
|
3
|
-
"version": "3.82.
|
|
3
|
+
"version": "3.82.4",
|
|
4
4
|
"description": "Local dashboard for Claude Code and Codex CLI sessions: which Claude Code session needs input, every tool call and Claude Code subagent live, token cost and quota, several Claude accounts. Run npx ccdeck.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/release-notes.json
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
+
"3.82.4": [
|
|
3
|
+
{
|
|
4
|
+
"title": "🪟 Start at login works on Windows without administrator rights",
|
|
5
|
+
"body": "Turning on Start at login now works on ordinary Windows accounts too. Before, Windows answered \"Access is denied\" unless ccdeck ran as an administrator.",
|
|
6
|
+
"priority": "highlight"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"title": "🧹 No error at login after removing ccdeck",
|
|
10
|
+
"body": "If Start at login is on and you remove ccdeck with npm uninstall, the login item now ends quietly instead of failing at every login.",
|
|
11
|
+
"notice": "On Windows, a login item turned on before this version keeps its old form until you turn Start at login off and on again."
|
|
12
|
+
}
|
|
13
|
+
],
|
|
2
14
|
"3.82.3": [
|
|
3
15
|
{
|
|
4
16
|
"title": "🖥️ Windows CPU performance limits",
|
|
@@ -43,6 +43,7 @@ import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node
|
|
|
43
43
|
// from a Mac — the same reason deck-home.mjs and claudeCliCandidates do it, and
|
|
44
44
|
// the third time this class of bug has been caught here.
|
|
45
45
|
import { posix as posixPath, win32 as winPath } from "node:path";
|
|
46
|
+
import { writeFileAtomic } from "./atomic-write.mjs";
|
|
46
47
|
|
|
47
48
|
/** The joiner for the platform being ASKED ABOUT, which is not always this one. */
|
|
48
49
|
const joinFor = (platform) => (platform === "win32" ? winPath.join : posixPath.join);
|
|
@@ -95,7 +96,7 @@ export function xmlEscape(s) {
|
|
|
95
96
|
* at. The default band is the honest one.
|
|
96
97
|
*/
|
|
97
98
|
export function plistFor({ execPath, script, logPath, label = SERVICE_LABEL, args = [], env = {} } = {}) {
|
|
98
|
-
const argv = [execPath, script, ...args].map(a => ` <string>${xmlEscape(a)}</string>`).join("\n");
|
|
99
|
+
const argv = [...GUARD_WORDS, execPath, script, ...args].map(a => ` <string>${xmlEscape(a)}</string>`).join("\n");
|
|
99
100
|
const vars = Object.entries({ AGENTS_DECK_DETACHED: "1", ...env })
|
|
100
101
|
.map(([k, v]) => ` <key>${xmlEscape(k)}</key>\n <string>${xmlEscape(v)}</string>`)
|
|
101
102
|
.join("\n");
|
|
@@ -128,6 +129,27 @@ ${vars}
|
|
|
128
129
|
* unit, and `%%` is the literal. */
|
|
129
130
|
const sdEscape = (s) => String(s).replace(/%/g, "%%");
|
|
130
131
|
|
|
132
|
+
/**
|
|
133
|
+
* What a login item runs on Linux and macOS, as the shell's own program text.
|
|
134
|
+
*
|
|
135
|
+
* ONE CONSTANT, with the paths handed over as positional arguments after it,
|
|
136
|
+
* never spliced into the text, so a space, a quote or a `$` in an install path
|
|
137
|
+
* is only ever an argument (the rule NODE_FALLBACK in installer.mjs follows).
|
|
138
|
+
* `$0` is the label, `$1` node, `$2` the deck's script and the rest its
|
|
139
|
+
* arguments. When the script is gone, because `npm uninstall -g ccdeck` took it
|
|
140
|
+
* and nothing took the login item, the job ends 0 and says nothing. Before, it
|
|
141
|
+
* was a node "Cannot find module" stack in deck.log and a failed unit at every
|
|
142
|
+
* login.
|
|
143
|
+
*/
|
|
144
|
+
export const LOGIN_GUARD = '[ -f "$2" ] || exit 0; exec "$@"';
|
|
145
|
+
/** The words in front of the old command, which is exactly [node, script, ...args]. */
|
|
146
|
+
const GUARD_WORDS = ["/bin/sh", "-c", LOGIN_GUARD, "ccdeck-login"];
|
|
147
|
+
/** The same words, as they stand in a systemd ExecStart line. */
|
|
148
|
+
const sdWord = (a) => {
|
|
149
|
+
const v = sdEscape(a).replace(/\$/g, "$$$$");
|
|
150
|
+
return /[\s"'\\]/.test(v) ? `"${v.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : v;
|
|
151
|
+
};
|
|
152
|
+
|
|
131
153
|
/**
|
|
132
154
|
* The systemd --user unit.
|
|
133
155
|
*
|
|
@@ -144,10 +166,7 @@ export function unitFor({ execPath, script, logPath, args = [], env = {}, produc
|
|
|
144
166
|
// and the same `%` in an install path made ExecStart a fatal error.
|
|
145
167
|
// An argument with whitespace, a quote or a backslash is quoted, with the
|
|
146
168
|
// C escapes systemd's word splitting reads inside the quotes.
|
|
147
|
-
const cmd = [execPath, script, ...args].map(
|
|
148
|
-
const v = sdEscape(a).replace(/\$/g, "$$$$");
|
|
149
|
-
return /[\s"'\\]/.test(v) ? `"${v.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"` : v;
|
|
150
|
-
}).join(" ");
|
|
169
|
+
const cmd = [...GUARD_WORDS, execPath, script, ...args].map(sdWord).join(" ");
|
|
151
170
|
// QUOTED, AND `%` ESCAPED. systemd.exec(5) splits an Environment= assignment
|
|
152
171
|
// on whitespace unless the whole thing is double-quoted, and it expands `%`
|
|
153
172
|
// specifiers in the value. ExecStart above quotes its own arguments; this
|
|
@@ -188,6 +207,19 @@ WantedBy=default.target
|
|
|
188
207
|
`;
|
|
189
208
|
}
|
|
190
209
|
|
|
210
|
+
/**
|
|
211
|
+
* The Windows account this process runs as, in the form a Task Scheduler
|
|
212
|
+
* <UserId> takes: DOMAIN\user (the machine name for a local account), or the
|
|
213
|
+
* bare user name when Windows left USERDOMAIN out. Empty when neither is set,
|
|
214
|
+
* and then the task is written without one, as before.
|
|
215
|
+
*/
|
|
216
|
+
export function windowsAccount(env = process.env) {
|
|
217
|
+
const user = String(env?.USERNAME ?? "").trim();
|
|
218
|
+
if (!user) return "";
|
|
219
|
+
const domain = String(env?.USERDOMAIN ?? "").trim();
|
|
220
|
+
return domain ? `${domain}\\${user}` : user;
|
|
221
|
+
}
|
|
222
|
+
|
|
191
223
|
/**
|
|
192
224
|
* The Task Scheduler job, as XML.
|
|
193
225
|
*
|
|
@@ -202,11 +234,20 @@ WantedBy=default.target
|
|
|
202
234
|
* UTF-16LE with a BOM on disk, which is what schtasks requires and what a file
|
|
203
235
|
* written as UTF-8 is silently rejected for.
|
|
204
236
|
*
|
|
205
|
-
* No <UserId
|
|
206
|
-
* login this task is about.
|
|
207
|
-
*
|
|
237
|
+
* No <UserId> in the PRINCIPAL: schtasks fills in the account running it, which
|
|
238
|
+
* is the one whose login this task is about.
|
|
239
|
+
*
|
|
240
|
+
* But the LOGON TRIGGER names the account, when the caller knows it. A logon
|
|
241
|
+
* trigger without one fires at ANY user's logon, and Windows lets only an
|
|
242
|
+
* administrator register that: on a real Windows 11 standard account, schtasks
|
|
243
|
+
* answered this file with "ERROR: Access is denied." while the same file with
|
|
244
|
+
* the account in the trigger was accepted (VM check, 2026-11-15). So the login
|
|
245
|
+
* item this deck offers never registered for an ordinary account. The name is
|
|
246
|
+
* the process's own USERDOMAIN\USERNAME (windowsAccount): not a guess, not
|
|
247
|
+
* translated on a localised Windows, the domain form for a domain user, and
|
|
248
|
+
* Task Scheduler resolves it to the account's SID when the task is registered.
|
|
208
249
|
*/
|
|
209
|
-
export function taskXmlFor({ execPath, script, args = [], product = "ccdeck" } = {}) {
|
|
250
|
+
export function taskXmlFor({ execPath, script, args = [], product = "ccdeck", userId = "" } = {}) {
|
|
210
251
|
// NO ENVIRONMENT BLOCK, and that is the schema's doing rather than an
|
|
211
252
|
// omission here: there is nowhere in a Task Scheduler task to put a variable.
|
|
212
253
|
// Which is the second reason Windows runs the LAUNCHER and lets it detach
|
|
@@ -214,7 +255,14 @@ export function taskXmlFor({ execPath, script, args = [], product = "ccdeck" } =
|
|
|
214
255
|
// way to carry it. The launcher writes deck.log either way, so the output
|
|
215
256
|
// this platform also cannot redirect lands in the same file as everywhere
|
|
216
257
|
// else.
|
|
217
|
-
|
|
258
|
+
// THROUGH cmd.exe, so a deck script that `npm uninstall -g` took away ends the
|
|
259
|
+
// task with exit 0 instead of node's "Cannot find module" window at every
|
|
260
|
+
// logon. `if exist` has no else, so a missing script runs nothing; /s strips
|
|
261
|
+
// the one outer pair of quotes and every path inside is quoted on its own.
|
|
262
|
+
// When the script exists this runs the same node on the same script with the
|
|
263
|
+
// same arguments as before.
|
|
264
|
+
const rest = args.map(a => ` ${/\s/.test(a) ? `"${a}"` : a}`).join("");
|
|
265
|
+
const argLine = `/d /s /c "if exist "${script}" ("${execPath}" "${script}"${rest})"`;
|
|
218
266
|
return `<?xml version="1.0" encoding="UTF-16"?>
|
|
219
267
|
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
|
220
268
|
<RegistrationInfo>
|
|
@@ -222,7 +270,7 @@ export function taskXmlFor({ execPath, script, args = [], product = "ccdeck" } =
|
|
|
222
270
|
</RegistrationInfo>
|
|
223
271
|
<Triggers>
|
|
224
272
|
<LogonTrigger>
|
|
225
|
-
<Enabled>true</Enabled
|
|
273
|
+
<Enabled>true</Enabled>${userId ? `\n <UserId>${xmlEscape(userId)}</UserId>` : ""}
|
|
226
274
|
</LogonTrigger>
|
|
227
275
|
</Triggers>
|
|
228
276
|
<Principals>
|
|
@@ -252,7 +300,7 @@ export function taskXmlFor({ execPath, script, args = [], product = "ccdeck" } =
|
|
|
252
300
|
</Settings>
|
|
253
301
|
<Actions Context="Author">
|
|
254
302
|
<Exec>
|
|
255
|
-
<Command
|
|
303
|
+
<Command>cmd.exe</Command>
|
|
256
304
|
<Arguments>${xmlEscape(argLine)}</Arguments>
|
|
257
305
|
</Exec>
|
|
258
306
|
</Actions>
|
|
@@ -528,7 +576,7 @@ export function installService({
|
|
|
528
576
|
// this deck owns.
|
|
529
577
|
const xmlPath = joinFor(platform)(logPathDir(logPath), `${SERVICE_LABEL}-task.xml`);
|
|
530
578
|
// UTF-16LE with a BOM: schtasks rejects UTF-8 with an unhelpful error.
|
|
531
|
-
fs.writeFileSync(xmlPath, "\uFEFF" + taskXmlFor({ execPath, script, args, product }), "utf16le");
|
|
579
|
+
fs.writeFileSync(xmlPath, "\uFEFF" + taskXmlFor({ execPath, script, args, product, userId: windowsAccount(env) }), "utf16le");
|
|
532
580
|
const cmd = registerCommand(platform, xmlPath);
|
|
533
581
|
const out = run(cmd.file, cmd.args, { encoding: "utf8", windowsHide: true });
|
|
534
582
|
if (out?.status !== 0) {
|
|
@@ -567,6 +615,54 @@ export function installService({
|
|
|
567
615
|
}
|
|
568
616
|
}
|
|
569
617
|
|
|
618
|
+
/**
|
|
619
|
+
* A login item written before the guard, as the guarded one. Text in, text
|
|
620
|
+
* out, null when there is nothing to change (already guarded, or not a shape
|
|
621
|
+
* this file writes). The old command was exactly [node, script, ...args], which
|
|
622
|
+
* is what the guard takes as its own positional arguments, so the words are put
|
|
623
|
+
* in front of it and nothing else in the file moves.
|
|
624
|
+
*/
|
|
625
|
+
export function guardedItemText(text, platform = process.platform) {
|
|
626
|
+
if (platform === "linux") {
|
|
627
|
+
const m = /^ExecStart=(.*)$/m.exec(text);
|
|
628
|
+
if (!m || m[1].startsWith("/bin/sh -c ") || m[1].trim() === "") return null;
|
|
629
|
+
return text.replace(/^ExecStart=.*$/m, () => `ExecStart=${GUARD_WORDS.map(sdWord).join(" ")} ${m[1]}`);
|
|
630
|
+
}
|
|
631
|
+
if (platform === "darwin") {
|
|
632
|
+
const m = /(<key>ProgramArguments<\/key>\s*<array>\n)(\s*<string>)([^<]*)(<\/string>)/.exec(text);
|
|
633
|
+
if (!m || m[3] === "/bin/sh") return null;
|
|
634
|
+
const words = GUARD_WORDS.map(a => ` <string>${xmlEscape(a)}</string>\n`).join("");
|
|
635
|
+
return text.replace(m[0], () => `${m[1]}${words}${m[2]}${m[3]}${m[4]}`);
|
|
636
|
+
}
|
|
637
|
+
return null;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Bring the login item of an older deck to the guarded form, on the platform's
|
|
642
|
+
* own file. File content only: no enable, no load, no schtasks, so nothing is
|
|
643
|
+
* started, stopped or registered by it. Windows keeps its task in the scheduler
|
|
644
|
+
* rather than in a file, and rewriting it would take schtasks, so it is not
|
|
645
|
+
* touched here. Answers whether it rewrote the file, never throws.
|
|
646
|
+
*/
|
|
647
|
+
export async function refreshLoginItem({
|
|
648
|
+
platform = process.platform,
|
|
649
|
+
home = homedir(),
|
|
650
|
+
env = process.env,
|
|
651
|
+
read = readFileSync,
|
|
652
|
+
} = {}) {
|
|
653
|
+
try {
|
|
654
|
+
if (platform !== "linux" && platform !== "darwin") return false;
|
|
655
|
+
const path = servicePath(platform, home, env);
|
|
656
|
+
const text = read(path, "utf8");
|
|
657
|
+
// Ours: the marker both writers put in every job.
|
|
658
|
+
if (!text.includes("AGENTS_DECK_DETACHED")) return false;
|
|
659
|
+
const next = guardedItemText(text, platform);
|
|
660
|
+
if (next === null || next === text) return false;
|
|
661
|
+
await writeFileAtomic(path, next);
|
|
662
|
+
return true;
|
|
663
|
+
} catch { return false; }
|
|
664
|
+
}
|
|
665
|
+
|
|
570
666
|
/**
|
|
571
667
|
* Take it away. Same contract: a verdict, never a throw.
|
|
572
668
|
*
|