ac4af582301a4e8a29245dbba767eba31334ddf9
14
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
9f6407321d |
library: a project whose folder was deleted outside magpie comes off the list when it's removed (#3510)
RemoveProject empties a project (Skills, Servers, then syncProject) and takes the entry off the list only once nothing magpie placed or wrote is left in it. But the only thing that empties those records, syncProject, gives up on a folder that's gone: it says "the folder is gone" and returns with the records as they were — and the Result RemoveProject hands it is thrown away, so the removal itself says nothing; the toast the user sees is the one the full sync after every change reports. With the folder gone there is nothing magpie can ever take back, so the records never empty and the entry stays for good: the only way out was the keep checkbox, which takes the entry off the list without looking at the folder (#514), though that reads as keeping what magpie wrote, not as the way out of a dead removal. So removal now does what a skill's removal already does when its folder is gone (removeSkill: only the entry goes): a folder that isn't there has nothing of magpie's on disk to take back, so the project and the records of what it placed and wrote go together, and the removal says nothing failed. A folder that is there removes as before; a project gone from disk still shows its "folder is gone" badge and still reports the folder on a full sync; keep is untouched. TestRemoveProjectWhoseFolderIsGone is new: a project with placed skills whose folder is deleted outside magpie, removed without keep — the entry goes, the Result has no problem, the library's skills stay; and a gone project removed with keep goes off the list as it always did. It fails without the change (the removal says "the folder is gone" and the entry stays) and passes with it. go test -tags nogui -count=1 ./internal/library/ pass (28 project and gone-family tests targeted first); gofmt, go vet -tags nogui and go build -tags nogui ./... pass. The cgo warning from internal/gui/trayimage_darwin.go is there before this change. Generated-by: GLM-5.3-Flash (ZCode) Reviewed and ported, narrowed: only a folder known to be gone (not there, or not a folder) drops the records. A Stat that fails another way (no permission, a drive answering with an error) isn't known to be gone, so the removal goes as before and the records stay, to be taken back once the folder answers; TestRemoveProjectWhoseFolderCantBeRead pins it. Run on mote (darwin arm64, Go 1.26.8): go test -tags nogui -count=1 ./internal/library/ ok 73.8s. On Linux (wsl-run, magpie-desktop): -run TestRemoveProject ok. Broken by hand: projects.go back at main, tests kept: TestRemoveProjectWhoseFolderIsGone FAIL "the removal said: [... the folder is gone]", the entry left with Placed [.agents/skills/pdf .claude/skills/pdf]. The patch's own check (err != nil): TestRemoveProjectWhoseFolderCantBeRead FAIL "projects: []". Not tried: removing a deleted project from the GUI on Windows, the reporter's system. Co-authored-by: ggbdpq <ggbdpq@gmail.com> |
||
|
|
5957223d89 |
library: a project's skills can be given to DeepSeek Harness, in the project's .agents/skills
xingchen_c on Discord (#general, 11-04): "资源库按照项目配置能否支持一下dsh".
projectSkillsDirs left dsh out, its comment saying it reads no project
folder magpie can rely on. It does, and always has: the skill provider
every dsh profile mounts (dsh-base's cordis.patch.yml, id skill-filesystem)
scans <projectRoot>/.dsh/skills (rank 100) and <projectRoot>/.agents/skills
(rank 200), the project root being the nearest folder up from the
session's cwd with a .git, else the cwd (roots and findProjectRoot in
@deepseek-ai/dsh-skill-filesystem 0.2.1-rc.5; the same two joins in
0.0.1-rc.3, 0.1.0-rc.6, 0.1.5-rc.3, 0.1.7-rc.2, 0.2.0-rc.2, 0.2.1-rc.1
and 0.2.2-alpha.3). dsh now gets the shared .agents/skills, so the
project row lists it and one link serves it with Codex and the rest.
MCP stays as it was: dsh's servers are dsh-mcp-client rows in a
profile's patch layers (bundles, the profile's and $DSH_HOME's
cordis.patch.yml, --patch overlays; composeProfile in @deepseek-ai/dsh
0.2.1-rc.5), none of them the project's. Said in project_mcp.go and
docs/subsystems/library.md.
Run:
- mote: go test -count=1 ./internal/library/ ok (102.9s); gofmt -l
clean; GOOS=windows and GOOS=linux go vet ./internal/library/ ok.
- Broken by hand: TestProjectSkillsDsh with projects.go at origin/main
fails ("magpie knows of no folder dsh reads a project's skills from").
- Real dsh: @deepseek-ai/dsh 0.2.1-rc.5 from npm on mote, sandbox HOME
and DSH_HOME, headless profile against a fake OpenAI-compatible server.
Run in a folder with .git, a skill linked into its .agents/skills is in
the request's <available_skills>; run in a folder with no .git, its own
.agents/skills is read; run in a subfolder of the repository, only the
root's is read, not the subfolder's (filed as #5172).
- GUI: /api/library's view from library.Read with a sandbox ~/.dsh,
served to the real assets in Chromium and WebKit, en and zh: the
project card's skill rows have a dsh chip (lit where given), and the
"reads no project skills folder" line no longer names it.
Not tried: the dsh Desktop app (its own profile; the same base bundle
is assumed, not checked); the full GUI suite (no GUI file changed);
Windows copy mode with a real dsh.
|
||
|
|
769355ab93 |
library: an MCP server's startup timeout reaches Codex as startup_timeout_sec, a hand-written one stays (#3168, miaomiaozi)
The Library's MCP server editor has a "Startup timeout" field (seconds), shown when an agent that reads one is installed (AgentView.Startup; Codex only). It is written to Codex's [mcp_servers.<name>] startup_timeout_sec, user-wide and in a project's .codex/config.toml. Empty writes nothing, so Codex keeps its own 30s, as before. The key and its unit are from Codex's own source: RawMcpServerConfig in codex-rs/config/src/mcp_types.rs (cb2581dae8de) has startup_timeout_sec: Option<f64> in seconds, and the older startup_timeout_ms, which is read only when _sec is absent. A value the user wrote in config.toml is never written over. magpie records the value it last wrote (Applied.Startup per agent, Project.Startup per project file). A value in the entry that differs from that record, one there before magpie wrote any, or any startup_timeout_ms, is the user's (startupTheirs), and magpie leaves the key alone. Once the user takes theirs out, magpie's goes in. The TUI's server editor keeps the GUI-set value, as it does for OAuth. Other agents with a startup timeout (Grok Build, Hermes, OpenCode) and a `magpie mcp add` flag are #3536. Run, in a sandbox HOME with pinned GOMODCACHE/GOCACHE: - go test -tags nogui ./internal/library ./internal/tui: ok (162s, 16s). - New tests: TestCodexStartupTimeout, TestCodexStartupTimeoutKeepsUsers, TestCodexProjectStartupTimeout. Broken by hand, each red: every existing value counted as the user's -> "startup_timeout_sec = 120, want 45"; magpie always winning -> "= 20, want 90"; no encode (the old code) -> "= <nil>, want 120". - GUI: new mcp-startup-timeout.test.cjs, Chromium and WebKit, en zh zh-TW ja de, 1100 and 390px: 22/22; red on the old client.js (no field). The 59 GUI files the change reaches (mcp-*, library-*, i18n-keys, gui-de/ja/zh-tw, every editServer/lib-editor file): 935 of 937 pass. The red, library-row-remove's hook-row trash in Chromium, fails the same way on origin/main |
||
|
|
e413512d8e |
library: an agent whose CLI is gone (only its config folder left) is no Library write target, and nothing it already has is removed (#2254, ggbdpq)
After an agent is uninstalled, the Agents page shows "CLI not found"
(
|
||
|
|
a894559e23 |
library: a project's skills and MCP servers reach Qoder, CodeBuddy, Droid, Cline and Command Code (eirc on Discord)
eirc could give Qoder and other agents skills and MCP servers only
user-wide; Library's project page didn't offer them. Each agent now gets
the project folder or file its own source or docs say it reads:
- Qoder, Qoder CN: skills in .qoder/skills, servers in
.qoder/settings.json's mcpServers (@qoder-ai/qodercli and
@qodercn-ai/qoderclicn 1.1.69: projectConfigDirName ".qoder",
getProjectSkillsDir = <config>/skills; docs.qoder.com/cli/mcp-reference).
- CodeBuddy Code: skills in .codebuddy/skills, servers in .mcp.json, or
mcp.json when the project has only that (2.164.0 reads the first of
[.mcp.json, mcp.json]).
- Droid: servers in .factory/mcp.json, skills in .agents/skills
(docs.factory.com).
- Cline: skills in .agents/skills (CLI 3.0.70 reads .clinerules, .cline
and .agents /skills).
- Command Code: skills in .commandcode/skills (commandcode.ai/docs/skills).
Left out, unconfirmed: Command Code's project MCP (.mcp.json in its own
transport shape, which would clash with Claude's), Copilot CLI's project
MCP, Zed's .zed/settings.json, WorkBuddy. docs/subsystems/library.md gets
a Projects row.
Run: go test -tags nogui ./internal/library (temp HOME, pinned module
cache); the three new tests in project_targets_test.go fail with the map
entries reverted ("magpie knows of no folder qoder reads a project's
skills from"), and the CodeBuddy mcp.json test fails with that fallback
turned off. gofmt -l clean; go vet -tags nogui on darwin, linux and
windows. No GUI asset changed (the page takes both from sync.go). Not
tried with the real Qoder, CodeBuddy or Droid CLIs.
|
||
|
|
97751188ea |
library: an unreadable skill copy stays in place during sync (#1102)
An unreadable subfolder in an agent's copy of a skill hid edits from the timestamp scan, which ignored read and stat errors. So switching copy/link mode, refreshing the skill, or removing a duplicate copy could replace the copy and lose those edits. Shared-folder deduplication could remove SKILL.md before failing on the unreadable subtree. changedAt and copyIsFresh now return the scan error. The copy is kept in place for that sync (Library.blockedSkills) and reported as a Problem naming the path. This covers agent copies, shared-folder deduplication, project copies and Claude Desktop copies. Other agents still sync, and a later sync tries again once the copy can be read. Merged onto main. #1449 added two callers of changedAt in skill_changed.go: - libraryHash doesn't remember a hash for a folder it couldn't wholly read. - editState says unknown for an agent's copy it couldn't wholly read, so an update from GitHub keeps the library's version aside. TestEditStateUnknownForAnUnreadableCopy covers editState. docs/subsystems/library.md keeps both new rules. Run: - go test -tags nogui ./internal/library/ and ./... (see the PR), go vet for darwin, linux with nogui, and windows, and gofmt. - With changedAt ignoring walk errors again, the four ScanError and EditState tests go red. - With editState ignoring the error, the new test goes red (edited true, known true). - Checked with Unix permissions on macOS only, not as root and not on Windows. |
||
|
|
a7e7fe2b0f |
library: switching a group of skills on or off no longer reads every copy every agent has (#1031, mintonight: 开关一整个技能组时很卡,要10多秒才能完成)
The page already sends one request for a group (agents-some), but its one
change ran a sync that, for every skill given as a copy (every WSL agent,
Windows without the right to link, agents set to copies), hashed the copy
and the library's skill twice, in every agent, on every change, and the
page's read hashed the copies once more. Over a WSL distro's share that is
every file of every skill read through 9P each click.
A copy's mark now keeps the hash of what was copied (markCopy). A copy
whose mark says the library skill's current hash, with nothing in it newer
than the mark, is current without its files being read (copyIsFresh);
takeEdits' walk of a copy is not done a second time in the same sync, and
each library skill is hashed once per change (libHash). Copies with an old
mark, or edited since, are hashed as before. Claude Desktop's copies and
project copies use the same check.
Measured in a sandbox (55 skills x 31 files, copies for 10 agents, a
5-skill group switched on for an 11th): the change went from 1.54s to
0.31s and the page's read from 0.66s to 0.25s on a local SSD; the copies
not touched are no longer read at all, which is the cost over WSL.
TestSyncDoesNotReadUnchangedCopies fails without the change ("codex's
copy of pdf was read and made again"): an unreadable file in an unchanged
copy is left alone now. TestCopyFreshByMark checks a changed library skill
is still copied again, an old mark without a hash still works, and an edit
in a copy is still taken. go test -race ./internal/library ./internal/gui
pass, the new tests pass -race -count=10; vet, gofmt, darwin/linux/windows
builds pass. Not run on Windows or WSL.
|
||
|
|
ce9fc6758a | library: on Windows without the right to make symlinks, skills are linked with junctions (#973) — with Developer Mode off and magpie not elevated, os.Symlink fails with "A required privilege is not held by the client": a skill installed from a folder became a detached copy, and bringing in a skill from ~/.agents/skills failed outright. The library's folder links (an agent's link to the library's skill, a folder source, a skill brought in from a link or the shared folder, a carried skill's folder, relink) now go through dirLink, which on that error makes a directory junction instead: one every user may make, followed by every program as a symlink to a folder is, made natively (FSCTL_SET_REPARSE_POINT, no mklink). A target a junction can't reach (a network share) still gets the old copy. Go reports a junction as irregular, not a symlink, so ours, unlink, carry's clearing of the library, a project's place and the CC Switch update now tell a link by linkEntry (symlink or junction) and take it away with os.Remove, leaving what it points at, even when where it points can't be read. On the Windows box with every privilege stripped from the token (CreateRestrictedToken DISABLE_MAX_PRIVILEGE, whoami /priv shows SeChangeNotify only) and an explicit sandbox environment, the library's tests went from 16 failures to none (TestSkillHow, TestProjectSkillsLinked, TestCarry, TestSkillCopyEditReachesTheOthers, TestImportSharedSkillForKimi …); with the privilege they pass too. TestJunctionIsALink (Windows: magpie's own, read through, unlinked without its target, none to a share) is new; the folder fixtures that ignored a failed os.Symlink now use dirLink, and the tests' link checks accept a junction. go test -race ./internal/library/ on the Mac, go vet, windows/linux(nogui) builds pass. | ||
|
|
3b3f5fa726 | library: ZCode and Pi get a project's MCP servers too, and a project can be removed keeping what magpie wrote into it (#514, follow-up to #500: zcode支持项目级mcp添加 / pi也支持项目级mcp / 删除项目但保留mcp/skill) — a project's servers went only to Claude Code, Codex, Gemini CLI, Cursor and OpenCode, and Remove took every skill and server magpie had put in the folder away, so a project given some once had to stay in magpie for good. ZCode's project file is <project>/.zcode/config.json, servers under mcp.servers as in its user-wide ~/.zcode/cli/config.json (zcode.z.ai/en/docs/mcp-services, "Configuration Files and Default Load Paths": workspace scope, read before the user's, "enable": false the user's to set), written with fmtZCode (type, command/args/env or url/headers); Pi's is <project>/.pi/mcp.json, mcpServers as Pi's own MCP reads them once the project is trusted (pi.dev/docs/latest/mcp, "Configure servers"), written with fmtPiNative (command/args/env, url/headers, no type; SSE refused, as Pi refuses it), whatever extension the user's own Pi file is written for. Both are merged as the other agents' are: the user's keys, servers and comments stay, a server of the same name that isn't magpie's is left alone and said, a file magpie made (.pi/mcp.json) goes in the .gitignore and goes again once empty, and ZCode's user-wide file isn't touched. The page learns a project file's own SSE limit (projectNoSSE), so Pi's chip is greyed for an SSE server in a project even when its user-wide file (pi-mcp-adapter's) takes SSE; the trust note now names Pi beside Codex. The Remove dialog of a project magpie put anything in has "Keep its skills and MCP servers" / 保留项目里的技能和 MCP 服务器 (a checkbox row in the library's pick style, no coloured left border): checked, the text says what stays and Remove posts projects/remove with keep, and RemoveProject(dir, keep) only takes the project off the list — skills (links still following the library's), servers in the agents' files and magpie's .gitignore lines stay as they are, and nothing magpie does later (a sync, the server removed from the library) touches them; unchecked it removes as before. A one-off add without a project first (pick a folder from a server or skill) is not in this change. TestProjectServersZCodePi (ZCode's file with the user's model, server, enable:false and key kept beside magpie's three; Pi's file made in its shape, the SSE server refused with its reason, listed in .gitignore; ZCode's user-wide file unchanged; removing takes out only magpie's and the file it made) and TestRemoveProjectKeep (every file byte for byte after the removal, after a sync and after the server leaves the library) fail without the change, as does project-remove-keep.test.cjs (WebKit, and Chromium through a temp copy on plain chromium.launch(); en and zh: the box unchecked, its text, no stripe, pressing it scrolls nothing and swaps the text, Remove posts keep: true and says they were kept; a project with nothing written has no box and posts as before) against HEAD's assets. project-servers, click-scroll, library-items, library-all pass; menu-scroll and old-webkit fail the same on HEAD. No live config was read or written. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... (under a temp HOME) pass (TestFXInState failed on a TempDir cleanup race twice in the full gui run, passes alone and on the rerun; untouched). | ||
|
|
22358d5d6e | library: a project gets its own MCP servers, agent by agent (#500) — the library's servers could only be given to agents user-wide, while its skills could already go into a project. The MCP tab now lists the same projects as Skills under "In projects" (add one by its folder, or the folder picker in the app), and a project's card opens to each server with chips for the agents that read a project's own servers: Claude Code .mcp.json, Codex .codex/config.toml, Gemini CLI .gemini/settings.json, Cursor .cursor/mcp.json, OpenCode opencode.json (opencode.jsonc when that is the project's file), each as its docs give it. Other agents have no chip and are named under the card; the project files of Copilot, Crush, Droid, Kimi and the rest weren't confirmed, so none is written. The server is written with the same encoders and edit helpers as the user-wide files, so the rest of a file (its comments, other keys, the team's own servers) is kept; magpie records what it wrote in the project (Project.Servers, Wrote, MadeFiles) and only ever takes that away again, a same-named server that isn't magpie's is left as it is and named as a problem, as is an SSE server for Codex. A file magpie made is listed in the project's .gitignore between magpie's lines (a server's env and headers can hold keys) and removed with its folders once nothing of magpie's is left in it, unless the user wrote something else into it; a file that was there already is never ignored or removed. Renaming a library server renames it in its projects, removing it takes it out of them, and removing a project takes out its servers as well as its skills. A project whose MCP file is an agent's user-wide file (the home folder) is refused, as for skills. The chips of a project row (servers and skills) now light at once and send one write at a time, the last click winning: two quick clicks posted the first's stale list before. Claude Code still asks before it starts a project's servers and Codex reads .codex/config.toml only in a trusted project; the card says so. library-all.test.cjs gets a 800px-high window: the MCP tab's new "In projects" made it overflow 700 by a pixel, and Chromium's scroll anchoring then moved it when the problems card came in above. TestProjectServers (merge into a user's .mcp.json keeping its comment, key and server; Codex TOML; .gitignore; rename; removal down to the made folders; RemoveProject keeping the user's own), TestProjectServerNotOurs, TestProjectServerFileKept, TestProjectServerChecks and TestProjectServerOpenCodeJSONC run in a temp HOME; project-servers.test.cjs (en, zh; chromium and webkit) checks the chips, the greyed Codex chip for SSE, two clicks before magpie answers, and that nothing scrolls. No real agent was started on a written project. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass; the library's Playwright tests pass in webkit, and in chromium except list-sort, shared-skills and import-all-skills, which fail the same way at HEAD. | ||
|
|
b03967bb79 | library: agents in a running WSL distro take skills, MCP servers and instructions (#331) — the Library knew only this machine's agent ids, so codex@wsl:Ubuntu and the like were never offered, and the id's colon was refused as an agent's name and can't be in a Windows file name. Claude Code, Codex, Pi and OmO in a distro now get them at their default places under the distro's $HOME through \\wsl.localhost, only while it runs (opening a stopped one's files starts it; its state is kept and asking for it says to start it). Skills go in as copies, made beside and renamed into place and made again when the library's changes, since a Linux agent can't follow a link to a Windows folder (project skills share the same copy code); an MCP server that runs a Windows program (C:\…, *.exe/.cmd/.bat/.ps1) is refused for them with a message; Pi there gets no MCP servers, where its version decides the file. The id's colon is a dot in file and folder names, and setup export/import turns it back. TestWSLTargets, TestWSLSkillsCopied, TestWSLServers and TestWSLInstructions (a fake distro) fail without the change. go vet (and GOOS=windows for agent, library), go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. Not run against a real distro. | ||
|
|
c9d9652380 | library: an agent whose folder is a file isn't written, and skills reach 13 more agents with one link in ~/.agents/skills for those that share it (neiko on Discord: with DeepSeek Harness not installed the Library kept failing on "open ~/.dsh/AGENTS.md: not a directory" and ~/.dsh/config.yaml; inaction: the skills list is short of the Agents page, Kimi Code has none). An agent counted as there when its folder path existed or its command was on PATH, never asking whether the path was a folder — a file at ~/.dsh, or another dsh, made DeepSeek Harness look installed. Now an agent whose folder is a file (or under one) isn't detected (agent.Taken; Goose's, Cindy's and Claude Desktop's own checks want a folder too), a Library target leaves out each place a file stands in the way of, one with none left isn't listed, and an agent given no MCP server with none of magpie's isn't read. Skills: Kimi Code, Goose and Cindy get ~/.agents/skills (Kimi's ~/.config/agents/skills when there, as Kimi reads it first; never ~/.kimi/skills, which would hide Claude Code's from it); Command Code, Devin, Hermes, Droid, Cline, Qoder, Qoder CN, Grok, WorkBuddy, Hanako and fx their own skills folder; Kimi, Goose and Grok a project's .agents/skills. The shared folder is filled first, and an agent that reads ~/.agents/skills besides its own (Codex, Gemini CLI, OpenCode, Crush, DeepSeek Harness and those above) gets no second link to a skill already there. Tested with new taken_test.go (neiko's two errors without the change) and agent_skills_test.go (skills folders, written once, a shared skill imported for Kimi), in sandbox HOMEs; library-items and shared-skills 24/24 in Chromium and WebKit; go vet, go build (-tags nogui, GOOS=linux, GOOS=windows), go test -tags nogui ./... pass. Not tried with real Kimi Code, Goose or Cindy. | ||
|
|
98d1674a52 |
library: Antigravity is a Library target — rules, MCP servers and skills reach agy and the Antigravity app alike (#277) — both read their user-wide customizations from ~/.gemini/config: GEMINI.md there, mcp_config.json (a remote server written as agy's own mcp add writes it, its serverUrl, "type": "sse" only for an SSE one so magpie reads it back as one; a url agy read in place of serverUrl is read too; the user's own servers and anything they added to an entry, disabled included, are kept) and skills; a project's skills go in the shared .agents/skills. The rules card says Antigravity also reads Gemini CLI's ~/.gemini/GEMINI.md, so text given to both is read twice. RTK is left out: rtk 0.50 has no user-wide hook for Antigravity. Tested with antigravity_test.go in a sandbox home (target paths and the antigravity-cli alias; stdio, http and sse servers written and read back, user keys and servers kept); library-items.test.cjs 18/18; go vet, go build (GUI, -tags nogui, GOOS=linux, GOOS=windows), go test -tags nogui ./... pass.
|
||
|
|
e02d3f28d7 | library: a project's agents can have some of the library's skills as the project's own — under Skills, In projects takes a folder (the system's picker in the app, a typed path anywhere) and each of its skills gets agents' chips; magpie links the skill into <project>/.claude/skills for Claude Code and <project>/.agents/skills for Codex, Gemini CLI, OpenCode, Pi, Cursor and Copilot (the agents documented to read it; MiMo Code, Crush, ZCode, DeepSeek Harness and oh-my-pi aren't, so they're left out), or copies it when the project asks for copies, a copy made again whenever the library's skill changes (updates included). What it places is listed between magpie's marks in the project's .gitignore, made if there was none; taking a skill or the project away removes only what magpie placed, its lines and the folders it made once empty, and a folder of the same name that isn't magpie's is left as it is and said so. The home folder, or one whose project skills folder is an agent's own, can't be added |