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:
@@ -82,6 +82,21 @@ describe("scope", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("narrows ownSessionWhere to the caller's own sessions whatever the role", () => {
|
||||
const own = (req) => {
|
||||
const w = scope.ownSessionWhere(req);
|
||||
return db
|
||||
.prepare(`SELECT id FROM sessions WHERE ${w.where} ORDER BY id`)
|
||||
.all(...w.params)
|
||||
.map((r) => r.id);
|
||||
};
|
||||
assert.deepEqual(own(member(1)), ["s-unstamped", "s1"]);
|
||||
assert.deepEqual(own(admin), []);
|
||||
assert.deepEqual(own({ user: { ...admin.user, id: 2 } }), ["s2"]);
|
||||
assert.deepEqual(own(analyst), []);
|
||||
assert.equal(own(local).length, 5);
|
||||
});
|
||||
|
||||
it("answers per-id checks for lanes, sessions, agents and runs", () => {
|
||||
const m = member(1);
|
||||
assert.equal(scope.canSeeLane(m, 1), true);
|
||||
|
||||
Reference in New Issue
Block a user