wongxy on Discord: 资源库技能支持批量删除 (batch delete for the Library's
skills). The library's own skills already have this: Select, then
Remove…, since #1852 (a4385e099, v0.1.1217). The skills under "In your
agents" (the ones an agent has of its own) could only be removed one at
a time. This adds the same for them.
What it does:
- RemoveFoundSkills(names), POST /api/library/skills/remove-found-some.
One change takes each name out exactly as RemoveFoundSkill does (its
body is now removeFound, shared by both). Folders and byte copies, the
shared ~/.agents/skills entry and a folder in the library's own folder
go to magpie's backups, not the OS trash and not deleted. Links are
taken away. A folder elsewhere that the skill only links to stays, and
so does another skill by that name.
- A name that can't be taken out is left as it was and goes in
Result.Unremoved; the others go all the same. When none can go the
change fails, the endpoint answers 400, and nothing is touched.
- The "In your agents" heading gets its own Select. Each row gets a
box, its own buttons go, and a bar has All, Clear, the count, Remove…
and Done. Remove… asks once, naming the count, the agents, how many
folders go to the backups, how many are only unlinked and how many
have a shared entry. A name that wasn't removed stays picked, with its
error in its row's place, and the status names it.
- Only one Select is on at a time: while either is on, the other is
dimmed with a title saying why ("Done picking … first"). Ending one
from the other took its bar away above the pointer and scrolled the
page.
- Eight new strings in zh, zh-TW, ja and de.
Run:
- TestRemoveFoundSkills: picks notes (a folder plus a byte copy), dev (a
link to a folder of the user's own), stuck (a read-only folder in
Gemini's skills) and notes again. Checks that stuck is in Unremoved
with its files intact, that the others are gone with their backups,
that dev's own folder stays, that keep (not picked) stays, that
"none can go" fails and touches nothing, and that no names is refused.
Broken by hand, it goes red both ways: returning on the first error
("permission denied", the change fails), and dropping Unremoved
("unremoved: []").
- found-skill-pick-remove.test.cjs in Chromium and WebKit, en, zh,
zh-TW, ja and de, at 1100 and 420: 11/11 each. Every press checks
that nothing scrolled and that the pressed button didn't move. It
covers the one-Select-at-a-time rule both ways, picking 3 and the
sheet's title and lines, Clear, a partial failure, the 400 when none
can go, and All then unpicking one. Broken by hand (failed names not
kept, or unpicked anyway), it goes red: 0/11.
- 80 Library, skill, group, removal, i18n-keys, gui-de/ja/zh-tw and
click-scroll GUI test files: Chromium 458/458; WebKit 456/458. The
two reds are group-member-info (en) and library-mcp-tool-switch
(zh-TW 980), both "locator.click: Timeout 5000ms exceeded". Both fail
the same way, with different cases each run, at 2c3112969 with this
change stashed.
- gofmt -l is clean. go vet passes on darwin, GOOS=linux -tags nogui
and GOOS=windows; go build passes on all three.
- go test -tags nogui ./... under a sandbox HOME, rebased on a069f224c:
all pass except internal/gateway, which hit the default 10m timeout
while the GUI suites were running alongside it. Run alone with
-timeout 25m it passed in 327s.
Not tried against a real agent's skills folder; only the sandbox HOME.
Reported-by: wongxy (Discord)
Until now the only action on such a row was Bring in: removing it meant
bringing it in and then removing it from the library. RemoveFoundSkill
(skills/remove-found) takes out of each agent that has it its folder, or
its copy of the very same files, and its links; its entry in the shared
~/.agents/skills, which agents read too, and a folder of it in the
library's own folder go as well. Nothing is deleted: folders go to the
backups (setAside), links are taken away, and a folder elsewhere that the
agents only linked to stays where it is. Another skill by that name
(Others) is a different skill and stays. The page asks first and says
which agents it leaves and what stays.
TestRemoveFoundSkill (library), TestLibraryPage's new part (TUI) and
remove-found-skill.test.cjs (GUI) fail without the change. The GUI test
fails 4 of 4 with library.js from before it, and passes in Chromium and
WebKit, in en, zh, ja and de, and at 440px wide.
Run: go test -tags nogui ./internal/library ./internal/tui ./internal/gui,
and go vet for linux, windows and darwin with -tags nogui, in Docker
(golang:1.26.8, a temporary HOME). The Mac's syspolicyd held test binaries
at launch. On the Mac, in Chromium and WebKit: remove-found-skill, gui-ja,
gui-de, i18n-keys, import-all-skills, own-skill, shared-skills,
library-own-folder, library-items, remove-all-skills,
library-desktop-skills, skill-name-many-agents and mobile-web, 133 of 133.
In one earlier run of that set at load ~40, mobile-web's WebKit "idle
scripts cannot scroll" failed once. It passed 3 of 3 alone with this
change, and passed in the full rerun. Not tried: the reporter's own agents,
and a WSL agent's folder.