feat(artifacts): Share again takes a skill's newest version; a same-named upload updates it
A shared skill followed its owner's ~/.claude/skills folder only, so one uploaded from a browser (or living in a plugin) stayed at its first snapshot for good. Share again (a skill's ⋯ menu and detail sheet) now takes the owner's copy on the server — its source folder, else the same-named skill of a plugin they installed at user scope — and shares it; with no copy it asks for the folder and uploads it onto that row (`id`). An upload whose skill is named like one the uploader already has replaces that row's version instead of adding a twin. Installers are then offered Update, as before.
This commit is contained in:
@@ -238,7 +238,7 @@ const paths = {
|
||||
summary: "Skills from files: a file, a folder, a .zip/.skill or several skills",
|
||||
operationId: "uploadArtifactSkills",
|
||||
description:
|
||||
"`paths` is a JSON array of each file's relative path. Zip sizes are read before inflating; nothing is stored if any skill fails.",
|
||||
"`paths` is a JSON array of each file's relative path. Zip sizes are read before inflating; nothing is stored if any skill fails. A skill whose name matches one the caller already has (not a workspace's) becomes that row's new version (`replaced: true`, `changed`) instead of a second row; `id` (Share again) puts the ONE uploaded skill onto that row, under the row's name.",
|
||||
requestBody: multipart(
|
||||
{
|
||||
files: { type: "array", items: { type: "string", format: "binary" } },
|
||||
@@ -246,6 +246,7 @@ const paths = {
|
||||
name: { type: "string" },
|
||||
title: { type: "string" },
|
||||
description: { type: "string" },
|
||||
id: { type: "string", description: "Share again: the skill row the upload replaces." },
|
||||
},
|
||||
["files"]
|
||||
),
|
||||
|
||||
@@ -1113,6 +1113,26 @@ const paths = {
|
||||
},
|
||||
},
|
||||
},
|
||||
"/api/artifacts/{id}/reshare": {
|
||||
post: {
|
||||
tags: ["Artifacts"],
|
||||
summary: "Share again: a skill's newest version from its owner's folder on this server",
|
||||
operationId: "reshareArtifact",
|
||||
description:
|
||||
"The owner's skill folder (the row's source folder, else the same-named skill of a plugin the owner installed at user scope) becomes the new snapshot, and the row is shared (server mode); installers are then offered Update. 409 ENOSOURCE when the server has no copy: upload the folder with `id` on /api/artifacts/skill/upload. Same-origin only.",
|
||||
parameters: [pathParam("id", "Artifact id.")],
|
||||
responses: {
|
||||
200: ok("Taken.", {
|
||||
item: { type: "object" },
|
||||
changed: { type: "boolean" },
|
||||
}),
|
||||
400: errs("EBADKIND."),
|
||||
403: errs("EFORBIDDEN."),
|
||||
404: errs("ENOTFOUND."),
|
||||
409: errs("ENOSOURCE."),
|
||||
},
|
||||
},
|
||||
},
|
||||
"/api/artifacts/{id}/claim": {
|
||||
post: {
|
||||
tags: ["Artifacts"],
|
||||
|
||||
Reference in New Issue
Block a user