clauder-hub 0.1.28 → 0.1.29
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 +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clauder-hub",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
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
|
@@ -38693,7 +38693,7 @@ async function probe(profileId) {
|
|
|
38693
38693
|
}
|
|
38694
38694
|
if (FIRST_RUN.some((marker) => flat2.includes(marker))) return true;
|
|
38695
38695
|
return flat2.includes("\u276F");
|
|
38696
|
-
},
|
|
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;
|