feat: right-click menus in Files/Users/Artifacts; several SSH keys and accounts per host

- Files: right-click a sidebar workspace (Open, Copy path) or home (Open,
  Open Trash), a path crumb (Open, Download as zip, Paste into, Copy path),
  a Trash row (Restore, Copy path, Delete forever), the Trash area (Refresh,
  Empty Trash) and an admin's per-user Trash folder (Open, Empty Trash).
- Users: row menu (Edit + Open home in Files for an admin, Copy username/email).
- Artifacts: card menu repeating its buttons, plus Copy link for a page.
- Git identity: named SSH keys beside the default ones (id_<type>_<name>,
  max 10, DELETE ?id=); SSH logins per alias (`ssh://<alias>/` →
  `ssh://<user>@<host>/`, so several AWS CodeCommit accounts share a host),
  each optionally tied to one key (`agenthub.<from>.sshKey`) — a clone of
  that URL offers only that key and persists it. Terminal sshCommand follows
  the keys. Settings → Git: "More SSH keys" + account name/key in the AWS and
  other-host forms. Docs/API.md, OpenAPI updated.
This commit is contained in:
2026-10-15 16:42:47 +07:00
parent 758609775f
commit b058179177
24 changed files with 1510 additions and 126 deletions
+40 -3
View File
@@ -276,17 +276,23 @@ const paths = {
"/api/me/git/ssh-key": {
post: {
tags: ["Git identity"],
summary: "Make (or with `replace`, replace) the SSH key of `type`; the other type is kept",
summary:
"Make (or with `replace`, replace) the default SSH key of `type`, or with `name` one more beside it",
operationId: "generateSshKey",
requestBody: json({
replace: { type: "boolean" },
type: { type: "string", enum: ["ed25519", "rsa"] },
name: { type: "string", pattern: "^[a-z0-9][a-z0-9-]{0,31}$" },
}),
responses: { 201: { description: "The identity." } },
responses: {
201: { description: "The identity." },
400: { description: "EBADKEYNAME" },
409: { description: "EEXISTS (without replace, or the name is taken) / ETOOMANYKEYS" },
},
},
delete: {
tags: ["Git identity"],
summary: "Delete the SSH key of ?type=ed25519|rsa, or every key",
summary: "Delete one SSH key (?id=, or the default of ?type=ed25519|rsa), or every key",
operationId: "deleteSshKey",
parameters: [
{
@@ -295,6 +301,7 @@ const paths = {
required: false,
schema: { type: "string", enum: ["ed25519", "rsa"] },
},
{ name: "id", in: "query", required: false, schema: { type: "string" } },
],
responses: { 200: { description: "The identity." } },
},
@@ -311,6 +318,36 @@ const paths = {
},
},
},
"/api/me/git/ssh-user": {
put: {
tags: ["Git identity"],
summary:
"An SSH login: url.<ssh://user@host/>.insteadOf ssh://<alias or host>/, optionally tied to one key",
operationId: "setSshUser",
requestBody: json(
{
host: { type: "string" },
user: { type: "string" },
alias: { type: "string", pattern: "^[a-z0-9][a-z0-9-]{0,62}$" },
key: { type: "string" },
},
["host", "user"]
),
responses: {
200: { description: "The identity; `sshUsers: [{host, user, alias, key}]`." },
400: { description: "EBADHOST / EBADSSHUSER / EBADALIAS / ENOKEY" },
},
},
},
"/api/me/git/ssh-user/{from}": {
delete: {
tags: ["Git identity"],
summary: "Drop the SSH login of a host or alias (and its key link)",
operationId: "deleteSshUser",
parameters: [{ name: "from", in: "path", required: true, schema: { type: "string" } }],
responses: { 200: { description: "The identity." }, 404: { description: "ENOTFOUND" } },
},
},
"/api/me/git/https": {
post: {
tags: ["Git identity"],