claudeck 1.0.4 → 1.0.5
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/package.json +1 -1
- package/server/routes/stats.js +12 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudeck",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A browser-based UI for Claude Code — chat, run workflows, manage MCP servers, track costs, and orchestrate autonomous agents from a local web interface. Installable as a PWA.",
|
|
6
6
|
"main": "server.js",
|
package/server/routes/stats.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Router } from "express";
|
|
2
|
-
import { execFile } from "child_process";
|
|
2
|
+
import { execFile, exec } from "child_process";
|
|
3
3
|
import { join } from "path";
|
|
4
4
|
import { existsSync } from "fs";
|
|
5
5
|
import { homedir } from "os";
|
|
@@ -28,6 +28,9 @@ function findClaudeBinary() {
|
|
|
28
28
|
if (process.platform === "win32") {
|
|
29
29
|
candidates.push(join(home, "AppData", "Local", "Programs", "claude", "claude.exe"));
|
|
30
30
|
candidates.push(join(home, ".claude", "local", "claude.exe"));
|
|
31
|
+
// npm global installs on Windows use .cmd shims
|
|
32
|
+
const appData = process.env.APPDATA || join(home, "AppData", "Roaming");
|
|
33
|
+
candidates.push(join(appData, "npm", "claude.cmd"));
|
|
31
34
|
}
|
|
32
35
|
for (const p of candidates) {
|
|
33
36
|
if (existsSync(p)) return p;
|
|
@@ -43,12 +46,16 @@ router.get("/account", async (req, res) => {
|
|
|
43
46
|
try {
|
|
44
47
|
const data = await new Promise((resolve, reject) => {
|
|
45
48
|
const opts = { timeout: 10000 };
|
|
46
|
-
|
|
47
|
-
if (process.platform === "win32") opts.shell = true;
|
|
48
|
-
execFile(claudeBin, ["auth", "status"], opts, (err, stdout) => {
|
|
49
|
+
const cb = (err, stdout) => {
|
|
49
50
|
if (err) return reject(err);
|
|
50
51
|
try { resolve(JSON.parse(stdout)); } catch (e) { reject(e); }
|
|
51
|
-
}
|
|
52
|
+
};
|
|
53
|
+
// On Windows, use exec so .cmd shims on PATH resolve correctly
|
|
54
|
+
if (process.platform === "win32") {
|
|
55
|
+
exec("claude auth status", opts, cb);
|
|
56
|
+
} else {
|
|
57
|
+
execFile(claudeBin, ["auth", "status"], opts, cb);
|
|
58
|
+
}
|
|
52
59
|
});
|
|
53
60
|
cachedAccountInfo = {
|
|
54
61
|
email: data.email || null,
|