ccdeck 3.53.2 → 3.53.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 +1 -1
- package/dist/web/assets/{BrowserWatchModal-DedhCY8E.js → BrowserWatchModal-CJ0CW4Go.js} +1 -1
- package/dist/web/assets/{IntegrationModal-1m1mQQhW.js → IntegrationModal-DlJzBN8b.js} +1 -1
- package/dist/web/assets/{RadioPanel-Sgo5WNTi.js → RadioPanel-CHl3s3OH.js} +1 -1
- package/dist/web/assets/{TrafficRadar-BqjzLlO_.js → TrafficRadar-Cw3i0Hux.js} +1 -1
- package/dist/web/assets/{UsageHistoryModal-2pcftBwX.js → UsageHistoryModal-CiB5-CTH.js} +1 -1
- package/dist/web/assets/{app-BZaB84m4.js → app-2vj7uk2U.js} +82 -82
- package/dist/web/assets/{index-D1WZBFCw.js → index-D1YZbdq3.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/release-notes.json +2 -1
- package/src/server/deck-prefs.mjs +6 -1
- package/src/server/index.mjs +2 -1
- package/src/server/reports-routes.mjs +10 -0
- package/src/server/reports.mjs +46 -5
- package/src/server/ui-language.mjs +17 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./app-
|
|
1
|
+
import"./app-2vj7uk2U.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-D1YZbdq3.js"></script>
|
|
81
|
+
<link rel="modulepreload" crossorigin href="/assets/app-2vj7uk2U.js">
|
|
82
82
|
<link rel="stylesheet" crossorigin href="/assets/app-xTrs4aEH.css">
|
|
83
83
|
</head>
|
|
84
84
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccdeck",
|
|
3
|
-
"version": "3.53.
|
|
3
|
+
"version": "3.53.3",
|
|
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
|
@@ -49,6 +49,7 @@ import { normaliseOrigins } from "./account-origins.mjs";
|
|
|
49
49
|
import { normaliseUsage } from "./usage-day.mjs";
|
|
50
50
|
import { refSlug } from "./install-ref.mjs";
|
|
51
51
|
import { normaliseRating } from "./rating.mjs";
|
|
52
|
+
import { uiLanguageCode } from "./ui-language.mjs";
|
|
52
53
|
|
|
53
54
|
/** Set to "1" to keep the deck off the desktop whatever the stored preference
|
|
54
55
|
* says. Same sheet of switches as AGENTS_DECK_NO_DOWNLOAD and
|
|
@@ -121,11 +122,14 @@ export const DEFAULTS = Object.freeze({
|
|
|
121
122
|
// `firstSessionAt`/`firstProvider`/`activationSent` the install's first
|
|
122
123
|
// session and whether the "activated" event saying so got through — the times
|
|
123
124
|
// stay here, only a bucket leaves (activation.mjs); `rating` is the one
|
|
124
|
-
// question the deck asks about itself, answered or put off (rating.mjs)
|
|
125
|
+
// question the deck asks about itself, answered or put off (rating.mjs);
|
|
126
|
+
// `uiLanguage` is the language the page said it is showing, for the reports
|
|
127
|
+
// (ui-language.mjs).
|
|
125
128
|
report: Object.freeze({
|
|
126
129
|
installId: "", lastVersion: "", lastActiveDay: "", forget: "", usage: null,
|
|
127
130
|
installedAt: "", firstSessionAt: "", firstProvider: "", activationSent: false,
|
|
128
131
|
rating: Object.freeze(normaliseRating(null)),
|
|
132
|
+
uiLanguage: "",
|
|
129
133
|
}),
|
|
130
134
|
// The accounts this deck signed in itself, and the re-sign-in prompts
|
|
131
135
|
// somebody put off (#1893) — keyed by account identity, written by the deck
|
|
@@ -379,6 +383,7 @@ function normaliseReport(raw) {
|
|
|
379
383
|
ref: refSlug(src.ref) ?? "",
|
|
380
384
|
selfUpdate: selfUpdateMarker(src.selfUpdate),
|
|
381
385
|
rating: normaliseRating(src.rating),
|
|
386
|
+
uiLanguage: uiLanguageCode(src.uiLanguage),
|
|
382
387
|
};
|
|
383
388
|
}
|
|
384
389
|
|
package/src/server/index.mjs
CHANGED
|
@@ -151,7 +151,7 @@ import { handlePrefsGiveBack, handlePrefsRead, handlePrefsWrite } from "./prefs-
|
|
|
151
151
|
// Usage reports and the feedback dialog (#1853). The requests to
|
|
152
152
|
// api.ccdeck.dev are made in reports.mjs, never in this file.
|
|
153
153
|
import {
|
|
154
|
-
handleClientError, handleFeedback, handleFeedbackFacts, handleRatingRead, handleRatingWrite, handleReportsWrite,
|
|
154
|
+
handleClientError, handleFeedback, handleFeedbackFacts, handleRatingRead, handleRatingWrite, handleReportsWrite, handleUiLanguageWrite,
|
|
155
155
|
} from "./reports-routes.mjs";
|
|
156
156
|
import { reporter } from "./reports.mjs";
|
|
157
157
|
import { MANIFEST_PATH, offerManifest } from "./app-manifest.mjs";
|
|
@@ -348,6 +348,7 @@ export async function startServer({ port = 4317, host = "127.0.0.1", persist = n
|
|
|
348
348
|
if (req.method === "POST" && url.pathname === "/api/prefs") return guard(handlePrefsWrite(req, res), res);
|
|
349
349
|
if (req.method === "POST" && url.pathname === "/api/prefs/give-back") return guard(handlePrefsGiveBack(req, res), res);
|
|
350
350
|
if (req.method === "POST" && url.pathname === "/api/reports") return guard(handleReportsWrite(req, res), res);
|
|
351
|
+
if (req.method === "POST" && url.pathname === "/api/ui-language") return guard(handleUiLanguageWrite(req, res), res);
|
|
351
352
|
if (req.method === "GET" && url.pathname === "/api/feedback") return handleFeedbackFacts(req, res);
|
|
352
353
|
if (req.method === "POST" && url.pathname === "/api/feedback") return guard(handleFeedback(req, res), res);
|
|
353
354
|
if (req.method === "POST" && url.pathname === "/api/client-error") return guard(handleClientError(req, res), res);
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { reportsVetoed } from "./deck-prefs.mjs";
|
|
7
7
|
import { MAX_REQUEST_BYTES, isMultipart, readFeedbackForm, upstreamForm } from "./feedback-form.mjs";
|
|
8
8
|
import { readBody, readBytes, send } from "./http-io.mjs";
|
|
9
|
+
import { uiLanguageCode } from "./ui-language.mjs";
|
|
9
10
|
import { heldPrefs } from "./prefs-state.mjs";
|
|
10
11
|
import { REPORTS_API, deviceIdToken, installFacts, reporter, reportsOn } from "./reports.mjs";
|
|
11
12
|
|
|
@@ -28,6 +29,15 @@ export async function handleReportsWrite(req, res, { report = reporter } = {}) {
|
|
|
28
29
|
return send(res, 200, { ok: true, reports: heldPrefs.current().reports, reportsVetoed: reportsVetoed() });
|
|
29
30
|
}
|
|
30
31
|
|
|
32
|
+
/** `POST /api/ui-language` `{ code }`: the language the page is showing, kept for
|
|
33
|
+
* the usage reports (ui-language.mjs). Best effort: 400 for a code that is not
|
|
34
|
+
* a language tag, 200 `{ kept }` otherwise (not kept with reports off). */
|
|
35
|
+
export async function handleUiLanguageWrite(req, res, { report = reporter } = {}) {
|
|
36
|
+
const body = await readJson(req, res, 1_000);
|
|
37
|
+
if (!uiLanguageCode(body?.code)) return send(res, 400, { ok: false, reason: "bad_request" });
|
|
38
|
+
return send(res, 200, { ok: true, kept: await report.setUiLanguage(body.code) });
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
/** `GET /api/rating`: whether the page should ask "How useful is ccdeck to
|
|
32
42
|
* you?" now (rating.mjs says when). Nothing leaves the machine. */
|
|
33
43
|
export function handleRatingRead(_req, res, { report = reporter } = {}) {
|
package/src/server/reports.mjs
CHANGED
|
@@ -53,7 +53,10 @@
|
|
|
53
53
|
// Each event carries the install id, the version, the OS and CPU architecture,
|
|
54
54
|
// the channel (the desktop app, npm, or a source checkout) and the runtime, plus
|
|
55
55
|
// a coarse sketch of the environment: the logical CPU count, the RAM in MB, the
|
|
56
|
-
// locale, the
|
|
56
|
+
// locale, the language chosen in the deck's own page (`uiLanguage`, "ro" or
|
|
57
|
+
// "pt-BR": the page tells the server, which keeps it in prefs.json and omits it
|
|
58
|
+
// until a page has said it; never on the ping, errors or feedback), the shell
|
|
59
|
+
// and terminal names, and the Claude Code and Codex CLI
|
|
57
60
|
// versions — and, on install, update, active and activated, what the boot set
|
|
58
61
|
// up: whether the Claude hooks went in ("ok", "failed", "off") and whether
|
|
59
62
|
// Codex is watched ("on", "off"). Every one of those is a small fixed token or
|
|
@@ -104,6 +107,7 @@ import { RUNNING_VERSION } from "./running-version.mjs";
|
|
|
104
107
|
import { FEATURES, usageDay, utcDay } from "./usage-day.mjs";
|
|
105
108
|
import { setupFacts, sinceInstallBucket, whenSetupKnown } from "./activation.mjs";
|
|
106
109
|
import { notedRef, refSlug } from "./install-ref.mjs";
|
|
110
|
+
import { UI_LANGUAGE_MAX, uiLanguageCode } from "./ui-language.mjs";
|
|
107
111
|
import {
|
|
108
112
|
CLAUDE_PLANS, CODEX_PLANS, cappedCount, deckDepth, eventsBucket, launchBucket, memoryBucket, updateVia,
|
|
109
113
|
} from "./depth-facts.mjs";
|
|
@@ -142,6 +146,7 @@ const EMPTY_REPORT = Object.freeze({
|
|
|
142
146
|
installId: "", lastVersion: "", lastActiveDay: "", forget: "", usage: null,
|
|
143
147
|
installedAt: "", firstSessionAt: "", firstProvider: "", activationSent: false, ref: "", selfUpdate: null,
|
|
144
148
|
rating: normaliseRating(null),
|
|
149
|
+
uiLanguage: "",
|
|
145
150
|
});
|
|
146
151
|
|
|
147
152
|
/** Is this deck sending reports right now? The switch, which is on unless
|
|
@@ -165,7 +170,7 @@ export function reportsOn(prefs, env = process.env) {
|
|
|
165
170
|
// The keys the API caps, so a value that would be rejected for length is not
|
|
166
171
|
// sent: it is trimmed to the cap here instead. Only ever tokens the shape of a
|
|
167
172
|
// terminal name, a shell name, a locale or a version — never anything free.
|
|
168
|
-
const TOKEN_CAPS = { locale: 16, shell: 16, term: 32, claudeVersion: 32, codexVersion: 32, deviceId: 64 };
|
|
173
|
+
const TOKEN_CAPS = { locale: 16, shell: 16, term: 32, claudeVersion: 32, codexVersion: 32, deviceId: 64, uiLanguage: UI_LANGUAGE_MAX };
|
|
169
174
|
|
|
170
175
|
/** A value reduced to the API's token shape `^[0-9A-Za-z.+_-]+$`: spaces become
|
|
171
176
|
* "_" (so "Apple Terminal" rides as "Apple_Terminal"), every other disallowed
|
|
@@ -330,6 +335,7 @@ export function installFacts({
|
|
|
330
335
|
deviceId = deviceIdToken(),
|
|
331
336
|
claudeVersion,
|
|
332
337
|
codexVersion,
|
|
338
|
+
uiLanguage,
|
|
333
339
|
} = {}) {
|
|
334
340
|
const facts = {
|
|
335
341
|
version: String(version),
|
|
@@ -343,6 +349,9 @@ export function installFacts({
|
|
|
343
349
|
addIf(facts, "cpus", count(cpus));
|
|
344
350
|
addIf(facts, "memMb", count(memMb));
|
|
345
351
|
addIf(facts, "locale", token(locale, TOKEN_CAPS.locale));
|
|
352
|
+
// The language chosen in the deck's own page, which the reporter folds in
|
|
353
|
+
// from the prefs (factsNow); not the OS locale above.
|
|
354
|
+
addIf(facts, "uiLanguage", token(uiLanguage, TOKEN_CAPS.uiLanguage));
|
|
346
355
|
addIf(facts, "shell", token(shell, TOKEN_CAPS.shell));
|
|
347
356
|
addIf(facts, "term", token(term, TOKEN_CAPS.term));
|
|
348
357
|
// The one derived, hashed, personal field. Present on the events that carry
|
|
@@ -627,7 +636,39 @@ export function createReporter({
|
|
|
627
636
|
/** The full facts an event carries: the fixed install facts, plus whatever CLI
|
|
628
637
|
* versions are known this moment. */
|
|
629
638
|
function factsNow() {
|
|
630
|
-
return { ...facts, ...versionFacts() };
|
|
639
|
+
return { ...facts, ...versionFacts(), ...uiLanguageFact() };
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/** The page's language, from the prefs; nothing until a page has said it, and
|
|
643
|
+
* nothing with reports off (switching them off empties it). Never throws. */
|
|
644
|
+
function uiLanguageFact() {
|
|
645
|
+
try {
|
|
646
|
+
const p = prefs.current();
|
|
647
|
+
if (!reportsOn(p, env)) return {};
|
|
648
|
+
const out = {};
|
|
649
|
+
addIf(out, "uiLanguage", token(uiLanguageCode(p.report.uiLanguage), TOKEN_CAPS.uiLanguage));
|
|
650
|
+
return out;
|
|
651
|
+
} catch {
|
|
652
|
+
return {};
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/** The language a page is showing, kept for the reports. Only while reports
|
|
657
|
+
* are on (there is nothing to keep it for otherwise, and the page says it
|
|
658
|
+
* again on its next load); a code that is not a language tag is refused.
|
|
659
|
+
* Resolves to whether it was kept; never throws. */
|
|
660
|
+
async function setUiLanguage(code) {
|
|
661
|
+
try {
|
|
662
|
+
const next = uiLanguageCode(code);
|
|
663
|
+
if (!next) return false;
|
|
664
|
+
await Promise.resolve(ready).catch(() => {});
|
|
665
|
+
if (!reportsOn(prefs.current(), env)) return false;
|
|
666
|
+
if (prefs.current().report.uiLanguage === next) return true;
|
|
667
|
+
await prefs.update(prev => (reportsOn(prev, env) ? { report: { ...prev.report, uiLanguage: next } } : undefined));
|
|
668
|
+
return true;
|
|
669
|
+
} catch {
|
|
670
|
+
return false;
|
|
671
|
+
}
|
|
631
672
|
}
|
|
632
673
|
|
|
633
674
|
/** What the boot set up — the Claude hooks and the Codex watcher — as the two
|
|
@@ -1205,7 +1246,7 @@ export function createReporter({
|
|
|
1205
1246
|
const stack = typeof error?.stack === "string" ? scrub(error.stack, home, root).slice(0, STACK_MAX) : undefined;
|
|
1206
1247
|
// Less the runtime, and less the deviceId — an error is not one of the events
|
|
1207
1248
|
// the fingerprint rides on, so the personal field never leaves on one.
|
|
1208
|
-
const { runtime: _runtime, deviceId: _deviceId, ...fields } = factsNow();
|
|
1249
|
+
const { runtime: _runtime, deviceId: _deviceId, uiLanguage: _uiLanguage, ...fields } = factsNow();
|
|
1209
1250
|
return (await call("POST", "/v1/app/errors", { installId: p.report.installId, ...fields, where, message, stack })) === "sent";
|
|
1210
1251
|
}
|
|
1211
1252
|
|
|
@@ -1278,7 +1319,7 @@ export function createReporter({
|
|
|
1278
1319
|
|
|
1279
1320
|
return {
|
|
1280
1321
|
checkIn, ping, setReports, reportError, restoreUsage, restoreRating, saveUsage, sendActivation, willReport,
|
|
1281
|
-
reportUninstall, noteSelfUpdate, ratingAsk, rate, rateLater, sendRating, start, stop,
|
|
1322
|
+
reportUninstall, noteSelfUpdate, setUiLanguage, ratingAsk, rate, rateLater, sendRating, start, stop,
|
|
1282
1323
|
};
|
|
1283
1324
|
}
|
|
1284
1325
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// The language the user chose in ccdeck's own page ("ro", "pt-BR"), as the
|
|
2
|
+
// server keeps it for the usage reports (reports.mjs `uiLanguage`).
|
|
3
|
+
//
|
|
4
|
+
// The choice lives in the browser (localStorage, src/web/i18n), so the page
|
|
5
|
+
// tells the server (POST /api/ui-language) and the server keeps the answer in
|
|
6
|
+
// prefs.json under `report.uiLanguage`, where the reporter finds it with no
|
|
7
|
+
// page open. The server cannot import the web registry, so the check is the
|
|
8
|
+
// token's shape, and this file is the one place that shape is written.
|
|
9
|
+
|
|
10
|
+
/** A language tag as a token: "ro", "pt-BR", "zh-Hans". */
|
|
11
|
+
const SHAPE = /^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$/;
|
|
12
|
+
export const UI_LANGUAGE_MAX = 16;
|
|
13
|
+
|
|
14
|
+
/** The code if it is a language tag, else "" (which means: not known). */
|
|
15
|
+
export function uiLanguageCode(value) {
|
|
16
|
+
return typeof value === "string" && value.length <= UI_LANGUAGE_MAX && SHAPE.test(value) ? value : "";
|
|
17
|
+
}
|