webhelm 1.0.9 → 1.0.10
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/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Use `npx skills add lalalic/webhelm --skill webhelm` to install agent guidance.
|
|
|
31
31
|
|
|
32
32
|
## WebHelm Chrome Extension control panel
|
|
33
33
|
|
|
34
|
-
The daemon-managed Chrome Extension is installed from the npm Runtime and does not require the Chrome Web Store. Click the WebHelm toolbar icon to see daemon connectivity, each configured workspace's available capacity and current Session count. The badge shows
|
|
34
|
+
The daemon-managed Chrome Extension is installed from the npm Runtime and does not require the Chrome Web Store. Click the WebHelm toolbar icon to see daemon connectivity, each configured workspace's available capacity and current Session count. The toolbar badge shows the number of **active daemon Sessions** across all workspaces (including `0` when idle). `!` means the daemon heartbeat is stale and `?` means the Session count is unknown. The popup separately shows pool availability and idle tabs.
|
|
35
35
|
|
|
36
36
|
The popup has a confirmation step to stop one Session, clear Sessions in one workspace, or clear Sessions across all workspaces. These actions are executed by the same Node daemon as the CLI, over the existing CDP-backed Extension RPC. No shell access or HTTP listener is granted to the Extension. The persistent ChatGPT queue is not deleted, and queued work may create new Sessions afterward.
|
|
37
37
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { WorkspaceManager } from "./workspace-manager.mjs";
|
|
2
2
|
import { ControlChannel } from "./control-channel.mjs";
|
|
3
3
|
import { summarizeWorkspaces } from "./workspace-summary.mjs";
|
|
4
|
+
import { sessionBadge } from "./session-badge.mjs";
|
|
4
5
|
|
|
5
6
|
const manager = new WorkspaceManager(chrome);
|
|
6
7
|
const control = new ControlChannel(chrome);
|
|
@@ -8,19 +9,11 @@ const closingWindowIds = new Set();
|
|
|
8
9
|
let badgeTimer = null;
|
|
9
10
|
|
|
10
11
|
async function refreshBadge() {
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
await chrome.action.
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
await chrome.action.setBadgeBackgroundColor({
|
|
18
|
-
color: !state.connected || available === null ? "#667085"
|
|
19
|
-
: available === 0 ? "#A43145" : "#345FD5",
|
|
20
|
-
});
|
|
21
|
-
await chrome.action.setTitle({title: state.connected
|
|
22
|
-
? `WebHelm — ${available === null ? "unknown" : available} available slot(s) across ${summary.workspaces.length} workspace(s)`
|
|
23
|
-
: "WebHelm — daemon offline or status stale"});
|
|
12
|
+
const {connected, sessionCount} = await control.status();
|
|
13
|
+
const badge = sessionBadge({connected, sessionCount});
|
|
14
|
+
await chrome.action.setBadgeText({text: badge.text});
|
|
15
|
+
await chrome.action.setBadgeBackgroundColor({color: badge.color});
|
|
16
|
+
await chrome.action.setTitle({title: badge.title});
|
|
24
17
|
}
|
|
25
18
|
|
|
26
19
|
function scheduleBadge() {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Toolbar badge reports daemon-owned Sessions, not browser pool capacity.
|
|
2
|
+
export function sessionBadge({connected, sessionCount}) {
|
|
3
|
+
if (!connected) return {
|
|
4
|
+
text: '!', color: '#667085', title: 'WebHelm — daemon offline or status stale',
|
|
5
|
+
};
|
|
6
|
+
if (!Number.isInteger(sessionCount) || sessionCount < 0) return {
|
|
7
|
+
text: '?', color: '#667085', title: 'WebHelm — active session count unavailable',
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
text: sessionCount > 99 ? '99+' : String(sessionCount),
|
|
11
|
+
color: sessionCount === 0 ? '#667085' : '#345FD5',
|
|
12
|
+
title: `WebHelm — ${sessionCount} active Session${sessionCount === 1 ? '' : 's'}`,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -10,7 +10,7 @@ export const EXTENSION_HOME=path.resolve(process.env.WEBHELM_EXTENSION_HOME || p
|
|
|
10
10
|
const SOURCE=fileURLToPath(new URL('./extension/',import.meta.url));
|
|
11
11
|
const FILES=[
|
|
12
12
|
'manifest.json','service-worker.mjs','workspace-manager.mjs','workspace.html','helm.html','workspace-page.mjs',
|
|
13
|
-
'control-channel.mjs','workspace-summary.mjs','popup.html','popup.mjs',
|
|
13
|
+
'control-channel.mjs','workspace-summary.mjs','session-badge.mjs','popup.html','popup.mjs',
|
|
14
14
|
...[16,32,48,128].map(size => `icons/webhelm-${size}.png`),
|
|
15
15
|
];
|
|
16
16
|
|