clauder-hub 0.1.25 → 0.1.27
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 +46 -28
- package/web/dist/assets/{MonacoDiff-wYXaL62z.js → MonacoDiff-DI7KbkGb.js} +1 -1
- package/web/dist/assets/{MonacoEditor-4_XjNLmt.js → MonacoEditor-DiEjsDTu.js} +3 -3
- package/web/dist/assets/{cssMode-D-xktXjH.js → cssMode-D2nzrBVe.js} +1 -1
- package/web/dist/assets/{freemarker2-Ds8Y8JWb.js → freemarker2-B8IA4gTP.js} +1 -1
- package/web/dist/assets/{handlebars-ABKapBAI.js → handlebars-I4ElyUYY.js} +1 -1
- package/web/dist/assets/{html-B-pd37GW.js → html-Cmg1czOW.js} +1 -1
- package/web/dist/assets/{htmlMode-DN1D04yg.js → htmlMode-D8Z0p7bH.js} +1 -1
- package/web/dist/assets/{index-CGTvp3I-.js → index-C9_hBHoq.js} +63 -63
- package/web/dist/assets/{index-U4KuxlPt.js → index-Dwir2zBR.js} +1 -1
- package/web/dist/assets/{javascript-BA7QRYtB.js → javascript-CjDmK_hr.js} +1 -1
- package/web/dist/assets/{jsonMode-CLfW8kHs.js → jsonMode-CT5GOiJ2.js} +1 -1
- package/web/dist/assets/{liquid-DXeDHLtF.js → liquid-KgFJ9Ko8.js} +1 -1
- package/web/dist/assets/{lspLanguageFeatures-DdBQGeuj.js → lspLanguageFeatures-BbvCFjrh.js} +1 -1
- package/web/dist/assets/{mdx-BXG7yMhg.js → mdx-Bi2-D061.js} +1 -1
- package/web/dist/assets/{python-Dpig-Cg1.js → python-BSdVb9bs.js} +1 -1
- package/web/dist/assets/{razor-DTGXLTRr.js → razor-CxXC7Zbj.js} +1 -1
- package/web/dist/assets/{tsMode-COFfMmSX.js → tsMode-WTcRXYLc.js} +1 -1
- package/web/dist/assets/{typescript-BGQO1YrZ.js → typescript-DG_EWgcL.js} +1 -1
- package/web/dist/assets/{workers-BuJcoTib.js → workers-DJvxTuY4.js} +1 -1
- package/web/dist/assets/{xml-DaTtKR3i.js → xml-OusoHvGM.js} +1 -1
- package/web/dist/assets/{yaml-CDpAzLnt.js → yaml-DEKHZ7vN.js} +1 -1
- package/web/dist/index.html +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clauder-hub",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
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
|
@@ -34802,6 +34802,40 @@ CREATE TABLE IF NOT EXISTS hub_settings (
|
|
|
34802
34802
|
}
|
|
34803
34803
|
});
|
|
34804
34804
|
|
|
34805
|
+
// server/src/hubSettings.ts
|
|
34806
|
+
function flag(key, fallback) {
|
|
34807
|
+
const row = globalDb.prepare("SELECT value FROM hub_settings WHERE key = ?").get(key);
|
|
34808
|
+
return row ? row.value !== "0" : fallback;
|
|
34809
|
+
}
|
|
34810
|
+
function setFlag(key, on) {
|
|
34811
|
+
globalDb.prepare("INSERT INTO hub_settings (key, value, updated_at) VALUES (?, ?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at").run(key, on ? "1" : "0", now());
|
|
34812
|
+
}
|
|
34813
|
+
function hubSettings() {
|
|
34814
|
+
return { resumeOnStart: flag("resumeOnStart", true), confirmStop: flag("confirmStop", true), fullscreen: flag("fullscreen", false) };
|
|
34815
|
+
}
|
|
34816
|
+
function saveHubSettings(patch) {
|
|
34817
|
+
for (const key of ["resumeOnStart", "confirmStop", "fullscreen"]) {
|
|
34818
|
+
if (typeof patch[key] === "boolean") setFlag(key, patch[key]);
|
|
34819
|
+
}
|
|
34820
|
+
return hubSettings();
|
|
34821
|
+
}
|
|
34822
|
+
function sessionEnvFromSettings() {
|
|
34823
|
+
return flag("fullscreen", false) ? { CLAUDE_CODE_NO_FLICKER: "1" } : {};
|
|
34824
|
+
}
|
|
34825
|
+
var init_hubSettings = __esm({
|
|
34826
|
+
"server/src/hubSettings.ts"() {
|
|
34827
|
+
"use strict";
|
|
34828
|
+
init_db();
|
|
34829
|
+
globalDb.exec(`
|
|
34830
|
+
CREATE TABLE IF NOT EXISTS hub_settings (
|
|
34831
|
+
key TEXT PRIMARY KEY,
|
|
34832
|
+
value TEXT NOT NULL,
|
|
34833
|
+
updated_at TEXT NOT NULL
|
|
34834
|
+
);
|
|
34835
|
+
`);
|
|
34836
|
+
}
|
|
34837
|
+
});
|
|
34838
|
+
|
|
34805
34839
|
// server/src/sessions.ts
|
|
34806
34840
|
import { randomUUID } from "node:crypto";
|
|
34807
34841
|
import fs12 from "node:fs";
|
|
@@ -34948,7 +34982,7 @@ function startSession(options) {
|
|
|
34948
34982
|
profile = excluded.profile, run_id = COALESCE(excluded.run_id, sessions.run_id), updated_at = excluded.updated_at`
|
|
34949
34983
|
).run(sessionId, existing?.origin ?? options.origin ?? "manual", options.runId ?? null, category, JSON.stringify(toolset), purpose ? JSON.stringify(purpose) : null, profile, stamp, stamp);
|
|
34950
34984
|
openSessionsAdd(sessionId);
|
|
34951
|
-
return spawnTerminal({ file: claude2, args, sessionId, token, cols: options.cols, rows: options.rows, env: profileEnv(profile) });
|
|
34985
|
+
return spawnTerminal({ file: claude2, args, sessionId, token, cols: options.cols, rows: options.rows, env: { ...sessionEnvFromSettings(), ...profileEnv(profile) } });
|
|
34952
34986
|
}
|
|
34953
34987
|
function openSessionIds() {
|
|
34954
34988
|
const row = db.prepare("SELECT value FROM settings WHERE key = 'openSessions'").get();
|
|
@@ -35067,6 +35101,7 @@ var init_sessions = __esm({
|
|
|
35067
35101
|
init_toolset();
|
|
35068
35102
|
init_purposes();
|
|
35069
35103
|
init_profiles();
|
|
35104
|
+
init_hubSettings();
|
|
35070
35105
|
init_transcripts();
|
|
35071
35106
|
hubPort = 0;
|
|
35072
35107
|
}
|
|
@@ -38584,32 +38619,7 @@ init_projects();
|
|
|
38584
38619
|
init_prompts();
|
|
38585
38620
|
init_sessions();
|
|
38586
38621
|
init_resume();
|
|
38587
|
-
|
|
38588
|
-
// server/src/hubSettings.ts
|
|
38589
|
-
init_db();
|
|
38590
|
-
init_resume();
|
|
38591
|
-
globalDb.exec(`
|
|
38592
|
-
CREATE TABLE IF NOT EXISTS hub_settings (
|
|
38593
|
-
key TEXT PRIMARY KEY,
|
|
38594
|
-
value TEXT NOT NULL,
|
|
38595
|
-
updated_at TEXT NOT NULL
|
|
38596
|
-
);
|
|
38597
|
-
`);
|
|
38598
|
-
function flag(key, fallback) {
|
|
38599
|
-
const row = globalDb.prepare("SELECT value FROM hub_settings WHERE key = ?").get(key);
|
|
38600
|
-
return row ? row.value === "1" : fallback;
|
|
38601
|
-
}
|
|
38602
|
-
function setFlag(key, on) {
|
|
38603
|
-
globalDb.prepare("INSERT INTO hub_settings (key, value, updated_at) VALUES (?, ?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at").run(key, on ? "1" : "0", now());
|
|
38604
|
-
}
|
|
38605
|
-
function hubSettings() {
|
|
38606
|
-
return { resumeOnStart: resumeOnStart(), confirmStop: flag("confirmStop", true) };
|
|
38607
|
-
}
|
|
38608
|
-
function saveHubSettings(patch) {
|
|
38609
|
-
if (typeof patch.resumeOnStart === "boolean") setResumeOnStart(patch.resumeOnStart);
|
|
38610
|
-
if (typeof patch.confirmStop === "boolean") setFlag("confirmStop", patch.confirmStop);
|
|
38611
|
-
return hubSettings();
|
|
38612
|
-
}
|
|
38622
|
+
init_hubSettings();
|
|
38613
38623
|
|
|
38614
38624
|
// server/src/usage.ts
|
|
38615
38625
|
var import_headless2 = __toESM(require_xterm_headless(), 1);
|
|
@@ -38620,6 +38630,7 @@ init_terminals();
|
|
|
38620
38630
|
import * as pty2 from "@lydell/node-pty";
|
|
38621
38631
|
import fs16 from "node:fs";
|
|
38622
38632
|
import path18 from "node:path";
|
|
38633
|
+
var FIRST_RUN = ["choosethetextstyle", "selectloginmethod", "let'sgetstarted", "pleaserun/login", "notloggedin", "invalidapikey"];
|
|
38623
38634
|
var COLS = 120;
|
|
38624
38635
|
var ROWS = 80;
|
|
38625
38636
|
var sleep3 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -38679,8 +38690,12 @@ async function probe(profileId) {
|
|
|
38679
38690
|
}
|
|
38680
38691
|
return false;
|
|
38681
38692
|
}
|
|
38693
|
+
if (FIRST_RUN.some((marker) => flat2.includes(marker))) return true;
|
|
38682
38694
|
return flat2.includes("\u276F");
|
|
38683
38695
|
}, 25e3);
|
|
38696
|
+
if (FIRST_RUN.some((marker) => squeeze2(screenText(screen).join("\n")).includes(marker))) {
|
|
38697
|
+
return { profileId, at, items: [], error: "Not signed in: open a session under this account and sign in." };
|
|
38698
|
+
}
|
|
38684
38699
|
if (!ready) {
|
|
38685
38700
|
const flat2 = squeeze2(screenText(screen).join("\n"));
|
|
38686
38701
|
if (flat2.includes("login") || flat2.includes("signin")) return { profileId, at, items: [], error: "Not signed in." };
|
|
@@ -38713,7 +38728,9 @@ async function usageOf(profileId, fresh = false) {
|
|
|
38713
38728
|
if (!fresh && known && Date.now() - Date.parse(known.at) < FRESH_MS) return known;
|
|
38714
38729
|
let pending = running.get(profileId);
|
|
38715
38730
|
if (!pending) {
|
|
38716
|
-
pending =
|
|
38731
|
+
pending = profileAuth(profileId).then(
|
|
38732
|
+
(auth2) => auth2?.loggedIn === false ? { profileId, at: (/* @__PURE__ */ new Date()).toISOString(), items: [], error: "Not signed in: open a session under this account and sign in." } : probe(profileId)
|
|
38733
|
+
).then((reading) => {
|
|
38717
38734
|
readings.set(profileId, reading);
|
|
38718
38735
|
return reading;
|
|
38719
38736
|
}).finally(() => running.delete(profileId));
|
|
@@ -38866,6 +38883,7 @@ hubApi.put("/hub/profiles/:id", wrap2((req) => renameProfile(req.params.id, req.
|
|
|
38866
38883
|
hubApi.delete("/hub/profiles/:id", wrap2((req) => removeProfile(req.params.id)));
|
|
38867
38884
|
hubApi.put("/hub/default-profile", wrap2((req) => ({ defaultId: setHubDefaultProfile(String(req.body?.id ?? "")) })));
|
|
38868
38885
|
hubApi.get("/hub/usage", wrap2((req) => usageOfAll(req.query.fresh === "1")));
|
|
38886
|
+
hubApi.get("/hub/usage/:id", wrap2((req) => usageOf(req.params.id, req.query.fresh === "1")));
|
|
38869
38887
|
hubApi.get("/hub/settings", wrap2(() => hubSettings()));
|
|
38870
38888
|
hubApi.put("/hub/settings", wrap2((req) => saveHubSettings(req.body ?? {})));
|
|
38871
38889
|
hubApi.get("/hub/resume-on-start", wrap2(() => ({ on: resumeOnStart() })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as c}from"./index-
|
|
1
|
+
import{r,j as c}from"./index-C9_hBHoq.js";import{w as f,l as p}from"./MonacoEditor-DiEjsDTu.js";function M({original:u,modified:l,path:d,onChange:o}){const e=r.useRef(o);e.current=o;const n=r.useRef(null);return r.useEffect(()=>()=>{var t;return(t=n.current)==null?void 0:t.dispose()},[]),c.jsx(f,{height:"100%",theme:"clauder-dark",original:u,modified:l,language:p(d),loading:null,onMount:t=>{var a;const i=t.getModifiedEditor();(a=n.current)==null||a.dispose(),n.current=i.onDidChangeModelContent(()=>{var s;return(s=e.current)==null?void 0:s.call(e,i.getValue())})},options:{readOnly:!o,originalEditable:!1,renderSideBySide:!0,useInlineViewWhenSpaceIsLimited:!1,fontSize:12,fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",minimap:{enabled:!1},scrollBeyondLastLine:!1,automaticLayout:!0,renderOverviewRuler:!0,padding:{top:8,bottom:8}}})}export{M as default};
|