fix: per-user Today, native paste and drop on a local machine

- Today's spend in the status bar and the Claude Code statusline is the
  caller's own (`GET /api/pricing/cost?mine=1`, scope.ownSessionWhere), not
  every user's sum for an admin or analyst.
- A screenshot pasted into a local claude pane is sent as Claude Code's own
  image-paste key: Alt+V on Windows (Ctrl+V did nothing there), ^V elsewhere,
  and only when the machine can read its clipboard (wl-paste/xclip + a
  display on Linux), else it is uploaded (GET /api/run/native-paste {key}).
- A file manager's files pasted or dropped on a local browser go in by their
  own paths, read from the OS clipboard or the file manager's selection
  (server/lib/file-manager.js, POST /api/run/clipboard-files and
  /selected-files): no upload, no size limit. A copied image file is pasted
  by path, text that comes with a picture of it (spreadsheet cells) is
  pasted as text, Windows paths go in as `C:/…` mentions.
- Tab titles for Snapshot, Artifacts, Files and Administration.
- An npm tool AgentHub installed under ~/.local is updated there, not by its
  own updater into npm's global prefix.
This commit is contained in:
2026-10-26 11:18:05 +07:00
parent c59e196e41
commit f2f1cd9b6c
33 changed files with 1046 additions and 60 deletions
+19 -1
View File
@@ -64,4 +64,22 @@ function desktopEnv() {
return out;
}
module.exports = { desktopEnv, FORWARDED, __setExecImpl };
/**
* Whether a CLI in a pane started now can read this desktop's clipboard — what
* a native image paste (`^V`, the terminal's `lib/nativePaste.ts`) relies on.
* On Linux Claude Code shells out to `wl-paste` (Wayland) or `xclip` (X11);
* neither ships with a stock Ubuntu, and with neither — or with no display to
* reach — the `^V` pastes nothing at all, so the browser must upload instead.
* macOS and Windows read their clipboard with built-in tools.
*/
function canReadClipboard({
platform = process.platform,
env = null,
which = (name) => require("./ai-tools").which(name),
} = {}) {
if (platform !== "linux") return true;
const e = env || desktopEnv();
return !!((e.WAYLAND_DISPLAY && which("wl-paste")) || (e.DISPLAY && which("xclip")));
}
module.exports = { desktopEnv, canReadClipboard, FORWARDED, __setExecImpl };