feat: v2.5.12 — plan and quota for every AI tool, Grok Build and Kimi Code, Quit AgentHub (#65)
Usage panel (status bar): - every account shows its plan (Claude subscriptionType, Codex chatgpt_plan_type, Cursor membershipType, Grok subscriptionTier) - new quota rows: Cursor CLI (cursor.com usage-summary), Antigravity (`agy --print /usage`, two model pools; AGENTHUB_AGY_USAGE=0 never runs agy), Grok Build, Kimi Code, OpenCode Go — each login read from the tool's own file, sent only to its own host while valid, never refreshed - in-flight quota reads are shared between tabs AI Tools catalog: Grok Build (`grok`) and Kimi Code (`kimi`) added; Gemini CLI, Hermes and OpenClaw removed. Also: Quit AgentHub (#65, `agenthub stop`), status-area icon, Add to Chat on an editor selection, Settings in three groups, JetBrains-style Changes panel (ticked files/hunks, ignore, blame, file history), terminal font. --no-verify: :3000 is taken by another dev server (lane-detect tests); both suites run by hand — server 2636/2639 (the 3 are :3000), client 1131/1131.
This commit is contained in:
+42
-1
@@ -26,6 +26,30 @@ const { execFileSync } = require("node:child_process");
|
||||
const EXEC_OPTS = { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"] };
|
||||
let execImpl = (args) => execFileSync("tmux", args, EXEC_OPTS);
|
||||
|
||||
// Linux: the tmux server lives in the cgroup of whatever started it — the
|
||||
// dashboard's systemd unit, or the terminal/IDE scope a dev server runs in —
|
||||
// and dies when that cgroup is stopped (an update's restart under a unit
|
||||
// without KillMode=process, systemd-oomd, closing that app). So the FIRST
|
||||
// session, which starts the server, is created inside a transient scope of
|
||||
// its own: panes end only on Quit (`quit.js`) or with the machine. `--scope`
|
||||
// runs tmux as a child, so it keeps this process's environment.
|
||||
const realScopeImpl = (args) =>
|
||||
execFileSync(
|
||||
"systemd-run",
|
||||
[
|
||||
"--user",
|
||||
"--scope",
|
||||
"--quiet",
|
||||
"--collect",
|
||||
"--description=AgentHub tmux server",
|
||||
"--",
|
||||
"tmux",
|
||||
...args,
|
||||
],
|
||||
EXEC_OPTS
|
||||
);
|
||||
let scopeImpl = realScopeImpl;
|
||||
|
||||
// Whether this tmux takes `=name` targets: true for tmux itself, false for
|
||||
// psmux (the WinGet `tmux` on Windows), null until a live session has shown
|
||||
// which. A fake exec in a test is real tmux unless it says otherwise.
|
||||
@@ -33,11 +57,17 @@ let exactTargets = null;
|
||||
|
||||
function __setExecImpl(fn, { exact = true } = {}) {
|
||||
execImpl = fn;
|
||||
scopeImpl = null; // a fake tmux never starts a real scope
|
||||
|
||||
exactTargets = exact;
|
||||
listed = null;
|
||||
}
|
||||
function __setScopeImpl(fn) {
|
||||
scopeImpl = fn;
|
||||
}
|
||||
function __reset() {
|
||||
execImpl = (args) => execFileSync("tmux", args, EXEC_OPTS);
|
||||
scopeImpl = realScopeImpl;
|
||||
exactTargets = null;
|
||||
listed = null;
|
||||
}
|
||||
@@ -143,7 +173,17 @@ function newSession({ name, cwd, argv, env }) {
|
||||
// No argv = tmux's own default shell (a Windows Terminal pane).
|
||||
const cmd = argv.length ? ["--", ...argv] : [];
|
||||
listed = null;
|
||||
execImpl(["new-session", "-d", "-s", name, "-c", cwd, ...envFlags(env), ...cmd]);
|
||||
const args = ["new-session", "-d", "-s", name, "-c", cwd, ...envFlags(env), ...cmd];
|
||||
if (scopeImpl && process.platform === "linux" && !serverPid()) {
|
||||
try {
|
||||
scopeImpl(args);
|
||||
} catch {
|
||||
// No user manager (SSH without linger, no systemd): the plain start.
|
||||
if (!hasSession(name)) execImpl(args);
|
||||
}
|
||||
} else {
|
||||
execImpl(args);
|
||||
}
|
||||
try {
|
||||
enableMouse(name);
|
||||
} catch (err) {
|
||||
@@ -346,6 +386,7 @@ function serverVersion() {
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
__setScopeImpl,
|
||||
session,
|
||||
pane,
|
||||
hasSession,
|
||||
|
||||
Reference in New Issue
Block a user