ccdeck 3.45.0 → 3.47.0

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 (61) hide show
  1. package/README.md +79 -47
  2. package/bin/cli/startup.js +27 -3
  3. package/bin/deck.js +32 -1
  4. package/dist/web/assets/BrowserWatchModal-Bau0ttnH.js +1 -0
  5. package/dist/web/assets/IntegrationModal-8tTi25gA.js +6 -0
  6. package/dist/web/assets/RadioPanel-DbmJJPsz.js +1 -0
  7. package/dist/web/assets/TrafficRadar-CPjAXd5e.js +8 -0
  8. package/dist/web/assets/{UsageHistoryModal-DAhplVju.js → UsageHistoryModal-qfmvXdWJ.js} +1 -1
  9. package/dist/web/assets/app-BFFG6Wz8.js +321 -0
  10. package/dist/web/assets/app-DfcfHvcX.css +1 -0
  11. package/dist/web/assets/claude-settings-index-1Qg1AUda.js +1 -0
  12. package/dist/web/assets/{index-r8Ymr47Q.js → index-Ca87aJP9.js} +1 -1
  13. package/dist/web/index.html +3 -3
  14. package/package.json +1 -1
  15. package/release-notes.json +60 -0
  16. package/src/server/ccusage-install.mjs +58 -1
  17. package/src/server/ccusage-registry.mjs +289 -0
  18. package/src/server/ccusage-runner.mjs +9 -2
  19. package/src/server/claude-accounts.mjs +56 -19
  20. package/src/server/claude-login.mjs +129 -0
  21. package/src/server/claude-settings-catalog.d.mts +37 -0
  22. package/src/server/claude-settings-catalog.mjs +169 -0
  23. package/src/server/claude-settings-docs.mjs +109 -0
  24. package/src/server/claude-settings-index.json +251 -0
  25. package/src/server/claude-settings-routes.mjs +46 -0
  26. package/src/server/claude-settings.mjs +406 -0
  27. package/src/server/cli-arrival.mjs +64 -0
  28. package/src/server/cswap-admin.mjs +12 -3
  29. package/src/server/index.mjs +18 -2
  30. package/src/server/installer.mjs +24 -7
  31. package/src/server/integrations/proxy.mjs +11 -2
  32. package/src/server/integrations/routes.mjs +6 -4
  33. package/src/server/login-service.mjs +2 -2
  34. package/src/server/quota-close-watch.mjs +81 -0
  35. package/src/server/quota-closes.mjs +181 -0
  36. package/src/server/quota-history.mjs +8 -1
  37. package/src/server/quota-shape.mjs +12 -0
  38. package/src/server/quota.mjs +28 -1
  39. package/src/server/request-gates.mjs +3 -1
  40. package/src/server/skill-hook.mjs +28 -22
  41. package/src/server/system-metrics.mjs +4 -0
  42. package/src/server/tool-audit-operations.mjs +30 -10
  43. package/src/server/tool-audit-report.mjs +79 -7
  44. package/src/server/tool-audit-routes.mjs +5 -1
  45. package/src/server/tool-audit-skills.mjs +8 -3
  46. package/src/server/tool-audit.mjs +55 -5
  47. package/src/server/traffic-radar-capture.mjs +3 -3
  48. package/src/server/traffic-radar-config.mjs +43 -3
  49. package/src/server/traffic-radar-monitor.mjs +8 -5
  50. package/src/server/traffic-radar-permission.mjs +162 -0
  51. package/src/server/traffic-radar-platform.mjs +93 -20
  52. package/src/server/traffic-radar-routes.mjs +8 -18
  53. package/src/server/traffic-radar-service.mjs +81 -94
  54. package/src/server/traffic-radar.mjs +32 -9
  55. package/src/server/usage-routes.mjs +14 -2
  56. package/dist/web/assets/BrowserWatchModal-Cbzf3TWa.js +0 -1
  57. package/dist/web/assets/IntegrationModal-BnnBr0a3.js +0 -5
  58. package/dist/web/assets/RadioPanel-BIqrMLQN.js +0 -1
  59. package/dist/web/assets/TrafficRadar-D1gZCIwX.js +0 -8
  60. package/dist/web/assets/app-BW3NYUYB.js +0 -318
  61. package/dist/web/assets/app-C5RY_wZ4.css +0 -1
@@ -0,0 +1,169 @@
1
+ // Settings › Claude Code: the Claude Code settings the deck offers a control
2
+ // for, in its own words, and how each one is written to the user's
3
+ // settings.json.
4
+ //
5
+ // ONE TABLE FOR BOTH ENDS. The server checks every write against it
6
+ // (claude-settings.mjs) and the page draws one row per entry and indexes them
7
+ // for search (ClaudeCodeSettings.tsx, settings-search.ts), so a row can never
8
+ // offer a value the server would refuse, and a key the server does not know
9
+ // is never written.
10
+ //
11
+ // A SHORT LIST ON PURPOSE. Claude Code reads some two hundred and fifty keys
12
+ // (claude-settings-index.json lists them all, read-only). These are the ones
13
+ // a person running several sessions from the deck is likely to want and is
14
+ // unlikely to have found: plain switches and choices whose every value is
15
+ // safe to write. Permission modes, hooks, sandboxing, credentials and anything
16
+ // shaped as an object stay out, because a wrong press there is not undone by
17
+ // pressing again.
18
+ //
19
+ // THE DEFAULT IS AN ABSENT KEY. Choosing the value Claude Code uses when the
20
+ // key is unset removes the key rather than writing that value, so the file
21
+ // keeps only what the person changed, and a later change of default in Claude
22
+ // Code reaches them.
23
+ //
24
+ // ONLY A ROW THAT DOES WHAT IT SAYS. A key whose effect depends on the model
25
+ // is not here: `effortLevel` in the user file is ignored by Opus 5.5 and every
26
+ // model after it, which read `modelSettings` instead, and
27
+ // `alwaysThinkingEnabled: false` does nothing on a model that always thinks.
28
+ // Both are better changed where Claude Code shows the model, with /effort and
29
+ // /model.
30
+
31
+ export const CLAUDE_SETTINGS_DOCS = "https://code.claude.com/docs/en/settings-reference";
32
+
33
+ /** The captions the rows are drawn under, in the order they are drawn. */
34
+ export const CLAUDE_SETTING_GROUPS = [
35
+ { id: "sessions", title: "Your sessions" },
36
+ { id: "memory", title: "Memory and history" },
37
+ { id: "git", title: "Git" },
38
+ { id: "terminal", title: "Terminal" },
39
+ { id: "updates", title: "Updates" },
40
+ ];
41
+
42
+ /**
43
+ * kind:
44
+ * switch a Boolean key; `unset` is what Claude Code does without it
45
+ * choice a string key from `options`; `null` is the absent key
46
+ * days a whole number of days from `options`
47
+ * allowTool a bare tool name in permissions.deny; on is "not denied"
48
+ * attribution `attribution: false` when off, the key absent when on
49
+ *
50
+ * since: the oldest Claude Code that reads the value the row writes. Older
51
+ * ones ignore it, or for `attribution: false` skip the whole settings file
52
+ * over it, so the row is not written while the version cannot be read.
53
+ *
54
+ * overrides: environment variables Claude Code's reference says outrank the
55
+ * key, each with the value that does (`on`: 1, true, yes; `off`: 0, false,
56
+ * no) and what it makes of the row. Read from the `env` block of the files
57
+ * the deck reads, and from the deck's own environment.
58
+ *
59
+ * legacy: a value an older Claude Code kept in ~/.claude.json still applies
60
+ * while no settings file sets the key.
61
+ */
62
+ export const CLAUDE_SETTINGS = [
63
+ {
64
+ id: "crossSessionInbound", key: "crossSessionInbound", group: "sessions", kind: "choice", since: "2.1.224",
65
+ label: "Messages from other sessions",
66
+ note: "What a session does when another of your Claude Code sessions sends it a message.",
67
+ options: [
68
+ { value: null, label: "Claude Code decides" },
69
+ { value: "accept", label: "Accept" },
70
+ { value: "hold", label: "Ask me first" },
71
+ { value: "refuse", label: "Refuse" },
72
+ ],
73
+ keywords: ["peers", "cross-session", "sendmessage", "inbox", "other sessions", "messaging"],
74
+ },
75
+ {
76
+ id: "listAgents", key: "permissions.deny", tool: "ListAgents", group: "sessions", kind: "allowTool", since: "2.1.224",
77
+ label: "Let sessions find each other",
78
+ note: "On, Claude can list your other sessions, with each one's folder and whether it is busy. Off adds a deny rule for ListAgents.",
79
+ keywords: ["listagents", "peers", "see other sessions", "privacy", "isolation", "list agents"],
80
+ },
81
+ {
82
+ id: "isolatePeerMachines", key: "isolatePeerMachines", group: "sessions", kind: "switch", unset: false, since: "2.1.224",
83
+ label: "Ask before messaging other machines",
84
+ note: "Claude asks you before a message leaves this computer for a session on another machine or in the cloud.",
85
+ keywords: ["remote control", "cloud", "cross-machine", "approval"],
86
+ },
87
+ {
88
+ id: "autoMemoryEnabled", key: "autoMemoryEnabled", group: "memory", kind: "switch", unset: true,
89
+ label: "Auto memory",
90
+ note: "Claude keeps notes it learns while working and reads them in later sessions. Off, it does neither.",
91
+ overrides: [
92
+ { env: "CLAUDE_CODE_DISABLE_AUTO_MEMORY", when: "on", effect: "Off" },
93
+ { env: "CLAUDE_CODE_DISABLE_AUTO_MEMORY", when: "off", effect: "On" },
94
+ ],
95
+ keywords: ["memory", "remember", "notes", "memory.md"],
96
+ },
97
+ {
98
+ id: "autoCompactEnabled", key: "autoCompactEnabled", group: "memory", kind: "switch", unset: true,
99
+ label: "Compact automatically",
100
+ note: "Claude summarizes a long conversation when it nears the context limit, so the session can go on.",
101
+ overrides: [{ env: "DISABLE_AUTO_COMPACT", when: "on", effect: "Off" }],
102
+ keywords: ["compact", "context", "summarize", "context window"],
103
+ },
104
+ {
105
+ id: "cleanupPeriodDays", key: "cleanupPeriodDays", group: "memory", kind: "days", unset: 30,
106
+ label: "Keep conversations",
107
+ note: "Older conversations are deleted without a message and leave the resume list.",
108
+ options: [7, 14, 30, 90, 180, 365, 3650],
109
+ keywords: ["transcripts", "history", "retention", "delete", "resume", "cleanup"],
110
+ },
111
+ {
112
+ id: "fileCheckpointingEnabled", key: "fileCheckpointingEnabled", group: "memory", kind: "switch", unset: true,
113
+ label: "Checkpoints for rewind",
114
+ note: "Claude keeps a copy of each file before editing it, so a change can be rewound.",
115
+ overrides: [{ env: "CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING", when: "on", effect: "Off" }],
116
+ keywords: ["rewind", "checkpoint", "restore", "revert"],
117
+ },
118
+ {
119
+ id: "attribution", key: "attribution", group: "git", kind: "attribution", since: "2.1.281",
120
+ label: "Credit Claude in commits and pull requests",
121
+ note: "Off, Claude adds no Co-Authored-By line to commits and no attribution line to pull requests.",
122
+ keywords: ["co-authored-by", "co-author", "trailer", "generated with", "commit message", "pull request", "attribution"],
123
+ },
124
+ {
125
+ id: "spinnerTipsEnabled", key: "spinnerTipsEnabled", group: "terminal", kind: "switch", unset: true,
126
+ label: "Tips while Claude works",
127
+ note: "The tip under the spinner while a turn is running.",
128
+ keywords: ["spinner", "tips", "hints"],
129
+ },
130
+ {
131
+ id: "showTurnDuration", key: "showTurnDuration", group: "terminal", kind: "switch", unset: true, legacy: true,
132
+ label: "Show how long a turn took",
133
+ note: "The line after each turn that says how long Claude worked.",
134
+ keywords: ["duration", "time", "timer"],
135
+ },
136
+ {
137
+ id: "prefersReducedMotion", key: "prefersReducedMotion", group: "terminal", kind: "switch", unset: false,
138
+ label: "Reduce motion",
139
+ note: "Fewer animations in the terminal, such as the spinner, shimmer and flash effects.",
140
+ keywords: ["animation", "motion", "accessibility", "spinner"],
141
+ },
142
+ {
143
+ id: "autoUpdatesChannel", key: "autoUpdatesChannel", group: "updates", kind: "choice",
144
+ label: "Update channel",
145
+ note: "Stable follows a version about a week old and skips releases with major regressions.",
146
+ overrides: [
147
+ { env: "DISABLE_UPDATES", when: "on", effect: "Updates are off" },
148
+ { env: "DISABLE_AUTOUPDATER", when: "on", effect: "Background updates are off" },
149
+ ],
150
+ options: [
151
+ // `claude install latest` writes the default out, so it reads as this.
152
+ { value: null, label: "Latest", also: "latest" },
153
+ { value: "stable", label: "Stable" },
154
+ ],
155
+ keywords: ["updates", "release channel", "stable", "latest", "version"],
156
+ },
157
+ ];
158
+
159
+ /** The entry for an id, or undefined for any id the table does not hold. */
160
+ export function claudeSettingById(id) {
161
+ return CLAUDE_SETTINGS.find(entry => entry.id === id);
162
+ }
163
+
164
+ /** The label a `days` row shows for a number of days. */
165
+ export function daysLabel(days) {
166
+ if (days === 3650) return "10 years";
167
+ if (days === 365) return "1 year";
168
+ return days === 1 ? "1 day" : `${days} days`;
169
+ }
@@ -0,0 +1,109 @@
1
+ // The keys Claude Code documents, read out of its settings reference page
2
+ // (https://code.claude.com/docs/en/settings-reference.md) — the source for
3
+ // claude-settings-index.json (scripts/claude-settings-index.mjs).
4
+ //
5
+ // THE PAGE IS READ, NOT TRUSTED. It is Markdown written for people, so every
6
+ // field is taken from one fixed shape — a `### \`key\`` heading, then its
7
+ // "Type" and "Default" bullets — and a key whose shape does not match keeps
8
+ // what could be read and nothing guessed. The settings index table at the top
9
+ // of the page names each key's topic, scope and anchor.
10
+ //
11
+ // FACTS, NOT THE PAGE'S WORDS. The reference is Anthropic's, all rights
12
+ // reserved, so what is kept is what a key is — its name, topic, scope, the
13
+ // kind of value it takes, its choices, a literal default, the version that
14
+ // added it — and never a sentence of its description. The deck links to the
15
+ // page for those (Settings › Claude Code).
16
+
17
+ const ENTRY_HEADING = /^### `([A-Za-z][\w.]*)`\s*$/gm;
18
+ const INDEX_ROW = /^\| \[`([^`]+)`\]\(#([^)]*)\) \| .*? \| ([^|]+?) \| ([^|]+?) \|$/gm;
19
+
20
+ /** The bullet `* **Name**: text` of an entry, as the page wrote it, or null. */
21
+ function bullet(body, name) {
22
+ const m = new RegExp(`^\\* \\*\\*${name}\\*\\*: (.*)$`, "m").exec(body);
23
+ return m ? m[1].trim() : null;
24
+ }
25
+
26
+ /** A Default bullet that is a value rather than a sentence: one code span,
27
+ * or the word "unset". Anything worded is left to the page. */
28
+ function literalDefault(text) {
29
+ if (text === "unset") return "unset";
30
+ const m = /^`([^`]{1,40})`$/.exec(text ?? "");
31
+ return m ? m[1] : null;
32
+ }
33
+
34
+ /** What kind of value a Type bullet describes, in the deck's four words. */
35
+ function kindOf(type) {
36
+ const t = (type ?? "").toLowerCase();
37
+ if (t.startsWith("boolean")) return "boolean";
38
+ if (t.startsWith("string, one of")) return "choice";
39
+ if (t.startsWith("number") || t.startsWith("integer")) return "number";
40
+ if (t.startsWith("string")) return "text";
41
+ return "structured";
42
+ }
43
+
44
+ /** The quoted values listed under a "string, one of" Type bullet. */
45
+ function choices(body) {
46
+ const at = body.search(/^\* \*\*Type\*\*: string, one of/m);
47
+ if (at < 0) return [];
48
+ const out = [];
49
+ for (const line of body.slice(at).split("\n").slice(1)) {
50
+ const m = /^ {2}\* `"([^"`]+)"`/.exec(line);
51
+ if (m) out.push(m[1]);
52
+ else if (!/^ {2,}/.test(line)) break;
53
+ }
54
+ return out;
55
+ }
56
+
57
+ /** The lowest "Requires Claude Code vX" an entry names, or null. */
58
+ function since(body) {
59
+ const versions = [...body.matchAll(/[Rr]equires Claude Code v(\d+\.\d+\.\d+)/g)].map(m => m[1]);
60
+ if (!versions.length) return null;
61
+ return versions.sort((a, b) => {
62
+ const x = a.split(".").map(Number), y = b.split(".").map(Number);
63
+ return x[0] - y[0] || x[1] - y[1] || x[2] - y[2];
64
+ })[0];
65
+ }
66
+
67
+ /** The page's anchor for a heading, as its own links spell it, for a key the
68
+ * index table does not link. */
69
+ export function anchorFor(key) {
70
+ return key.toLowerCase().replace(/\./g, "-").replace(/[^a-z0-9-]+/g, "");
71
+ }
72
+
73
+ /**
74
+ * Every documented key, in the page's order: its topic, scope and anchor from
75
+ * the index table, and from its own entry the kind of value it holds, the
76
+ * choices for a choice, a literal default, and the lowest Claude Code version
77
+ * the entry names. Keys whose scope is "Global config" live in ~/.claude.json
78
+ * and not in settings.json.
79
+ */
80
+ export function parseSettingsReference(markdown) {
81
+ const topics = new Map();
82
+ for (const m of markdown.matchAll(INDEX_ROW)) topics.set(m[1], { anchor: m[2], topic: m[3].trim(), scope: m[4].trim() });
83
+ const headings = [...markdown.matchAll(ENTRY_HEADING)];
84
+ const keys = [];
85
+ headings.forEach((m, i) => {
86
+ const key = m[1];
87
+ const end = i + 1 < headings.length ? headings[i + 1].index : markdown.length;
88
+ let body = markdown.slice(m.index + m[0].length, end);
89
+ const section = body.search(/^## /m);
90
+ if (section >= 0) body = body.slice(0, section);
91
+ const type = bullet(body, "Type");
92
+ const row = topics.get(key);
93
+ const options = choices(body);
94
+ // "One of" a list of words rather than of fixed strings — a model name, a
95
+ // duration — is a string to type, not a choice.
96
+ const kind = kindOf(type) === "choice" && !options.length ? "text" : kindOf(type);
97
+ keys.push({
98
+ key,
99
+ topic: row?.topic ?? null,
100
+ scope: row?.scope ?? null,
101
+ kind,
102
+ ...(kind === "choice" ? { options } : {}),
103
+ default: literalDefault(bullet(body, "Default")),
104
+ since: since(body),
105
+ anchor: row?.anchor ?? anchorFor(key),
106
+ });
107
+ });
108
+ return { keys };
109
+ }