clauder-hub 0.1.28 → 0.1.30
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/dist/index.js +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clauder-hub",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "A local dashboard that runs, watches and automates the Claude Code sessions of every project on the machine",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "goldyndevs <goldyndevs@gmail.com>",
|
package/server/dist/index.js
CHANGED
|
@@ -32309,7 +32309,7 @@ function childEnv() {
|
|
|
32309
32309
|
for (const [key, value] of Object.entries(process.env)) {
|
|
32310
32310
|
if (value !== void 0 && !INHERITED_MARKERS.includes(key)) env[key] = value;
|
|
32311
32311
|
}
|
|
32312
|
-
return { ...env, CLAUDER_HUB: "1", FORCE_COLOR: "1" };
|
|
32312
|
+
return { ...env, TERM: env.TERM || "xterm-256color", CLAUDER_HUB: "1", FORCE_COLOR: "1" };
|
|
32313
32313
|
}
|
|
32314
32314
|
function spawnTerminal(input) {
|
|
32315
32315
|
const cols = input.cols ?? 120;
|
|
@@ -38692,8 +38692,8 @@ async function probe(profileId) {
|
|
|
38692
38692
|
return false;
|
|
38693
38693
|
}
|
|
38694
38694
|
if (FIRST_RUN.some((marker) => flat2.includes(marker))) return true;
|
|
38695
|
-
return flat2.includes("\u276F");
|
|
38696
|
-
},
|
|
38695
|
+
return flat2.includes("\u276F") || lines2.some((line) => /^\s*>\s/.test(line));
|
|
38696
|
+
}, 6e4);
|
|
38697
38697
|
if (FIRST_RUN.some((marker) => squeeze2(screenText(screen).join("\n")).includes(marker))) {
|
|
38698
38698
|
return { profileId, at, items: [], error: "Not signed in: open a session under this account and sign in." };
|
|
38699
38699
|
}
|
|
@@ -38723,14 +38723,20 @@ async function probe(profileId) {
|
|
|
38723
38723
|
var readings = /* @__PURE__ */ new Map();
|
|
38724
38724
|
var running = /* @__PURE__ */ new Map();
|
|
38725
38725
|
var FRESH_MS = 10 * 6e4;
|
|
38726
|
+
var FAILED_MS = 3e4;
|
|
38727
|
+
async function probeWithRetry(profileId) {
|
|
38728
|
+
const first = await probe(profileId);
|
|
38729
|
+
if (!first.error || !/did not get to its prompt|exited before/.test(first.error)) return first;
|
|
38730
|
+
return probe(profileId);
|
|
38731
|
+
}
|
|
38726
38732
|
async function usageOf(profileId, fresh = false) {
|
|
38727
38733
|
if (!getProfile(profileId)) throw new Error("No such account.");
|
|
38728
38734
|
const known = readings.get(profileId);
|
|
38729
|
-
if (!fresh && known && Date.now() - Date.parse(known.at) < FRESH_MS) return known;
|
|
38735
|
+
if (!fresh && known && Date.now() - Date.parse(known.at) < (known.error ? FAILED_MS : FRESH_MS)) return known;
|
|
38730
38736
|
let pending = running.get(profileId);
|
|
38731
38737
|
if (!pending) {
|
|
38732
38738
|
pending = profileAuth(profileId).then(
|
|
38733
|
-
(auth2) => auth2?.loggedIn === false ? { profileId, at: (/* @__PURE__ */ new Date()).toISOString(), items: [], error: "Not signed in: open a session under this account and sign in." } :
|
|
38739
|
+
(auth2) => auth2?.loggedIn === false ? { profileId, at: (/* @__PURE__ */ new Date()).toISOString(), items: [], error: "Not signed in: open a session under this account and sign in." } : probeWithRetry(profileId)
|
|
38734
38740
|
).then((reading) => {
|
|
38735
38741
|
readings.set(profileId, reading);
|
|
38736
38742
|
return reading;
|