library: Claude Magpie is an agent of its own (xMopf7RF on X)

xMopf7RF asked for Claude Magpie, the separate Claude Desktop, to show
on its own in the Library's instructions, skills and MCP, like an
independent agent. Before, Claude Desktop's target wrote its servers
(DesktopConfigs3p) and Cowork skills (desktopdir.Everywhere) into
Claude-Magpie-3p too, and the twin's Code tab folder
~/.claude-magpie-desktop (a claude# row) got nothing from the Library.

- agent.DesktopTwinApp: claude-desktop#magpie, "Claude Magpie", an app
  target while the Separate app is on and its folder is there (macOS).
  MCP to Claude-Magpie-3p's claude_desktop_config.json, Cowork skills to
  its skills-plugin. No instructions file: noPlace points to its Code
  tab's row.
- Claude Desktop's target leaves Claude-Magpie-3p out (DesktopConfigs3p,
  desktopSkillRoots).
- Every claude#<name> row takes CLAUDE.md, skills/ and .claude.json in
  its folder (~/.claude.json for ~/.claude itself). settings.json
  features (hooks, env, tools off) stay keyed on claude.
- Old data: carryTwin, on load and only while nothing is recorded for
  the twin, ticks for Claude Magpie each server and skill magpie gave
  Claude Desktop that is in Claude-Magpie-3p already, so an update takes
  nothing away. library.json syncs, so another Mac's twin sees the same
  ticks. Unticked later, it stays unticked.
- Not changed: desktopCarryMCP still copies the user's own Desktop
  servers into the twin when it is wired.

Run (mote, sandbox HOME in the tests):
- go test -tags nogui ./internal/library ./internal/agent
  ./internal/desktopiso ./internal/desktopdir: ok (167s, 251s).
  GOOS=linux and GOOS=windows go vet of library and agent ok; gofmt clean.
- TestClaudeMagpieIsItsOwnLibraryAgent: InstallSkills, SaveServer and
  SaveInstructions write only Claude-Magpie-3p and
  ~/.claude-magpie-desktop; Claude Desktop's config and manifest,
  ~/.claude/settings.json unchanged; ~/.claude.json, ~/.claude/CLAUDE.md
  and ~/.claude/skills/pdf not written. TestClaudeMagpieKeepsWhatDesktopWasGiven.
- GUI, both engines: library-*.test.cjs (76 files), by-agent,
  every-skill, group-skill-chips, pick-skills, project-*, skill-*,
  i18n-keys and the new library-desktop-twin.test.cjs (separate chips
  for Claude Magpie and Claude Code · Claude Magpie, lit only for what
  they were given, a click on Claude Desktop's asks for it alone; en,
  zh, zh-TW, ja, de at 980 and 420px). 1850 of 1878 the first run, with
  a library.css hand change since dropped; the 28 reds were all in
  library-new-skill, library-subagents, library-wsl-asleep and
  skill-where, and those four files plus the twin test, run again
  without it: 174 of 174.

Broken by hand, each red then restored: carryTwin off (fs/pdf not
ticked, nothing recorded); Desktop's skill roots with the twin's folder
(target reaches Claude Magpie's folder); the claude# branch off (Code
tab target nil); DesktopConfigs3p with the isolated config again
(library and agent tests red).

Filed: #6558, a row's chips reach past its edge at 420px (ja with four
agents, before this too with six); the twin test skips that check for ja
at 420px until it is fixed.
Not tried: a real Claude Magpie.app on a desktop reading the new files.
This commit is contained in:
yetone
2026-11-14 00:01:24 +08:00
parent d0fb3c0084
commit 1730c75b97
11 changed files with 459 additions and 12 deletions
+1 -1
View File
@@ -196,7 +196,7 @@ something else shows up as drift.
- Claude Desktop's sessions (Code and Cowork, `claude-code-sessions` and `local-agent-mode-sessions`) are kept in the userData Desktop runs in, keyed by account and organization (the claude.ai login signed in; in 3p the install id in `ant-did` and the profile's organization, both stable). So on magpie, in `Claude-3p`, the sessions made signed in with Anthropic are out of sight but untouched in `Claude`, and they show again when Desktop is switched back (lambdua on X: "切换账号,对话都不见"); claude.ai chats live on Anthropic's servers and 3p never shows them as they are. magpie never writes or removes a session. Desktop imports them itself (Settings → Import: the signed-in userData, `~/.claude/projects`, other `Claude*` folders, and Claude.ai's own chats and projects, through a Claude.ai sign-in in the importer (`arm: "direct"`, `remotePull` in 4.16336's `getImportCapabilities`) or its data export zip), copying under new ids that go on on the gateway and leaving the originals, but in 3p only when the profile's policy `claudeAiImport.enabled` is true (off by default, 3p only, from 1.28929.0). magpie's profile gets `"claudeAiImport":{"enabled":true,"bannerBehavior":"detect"}` once per folder set (`desktopSeedImport`, marked in the stash as `claude-desktop.import`): on the switch on and, for a Desktop already on magpie, from `Sync` at magpie's start. A `claudeAiImport` already there is kept, and one the user removes is not written again (`TestClaudeDesktopOffersItsSessionImport`). The opened row and the notice after On point there (`noticeClaudedesktop5`; Jacky_yyyyyyyy on X asked to go on with the earlier chats on magpie).
- Claude Desktop's 3p mode reads its MCP servers (Settings → Developer, its connector list) from `Claude-3p/claude_desktop_config.json`, a file of its own, so on magpie the servers the user added signed in with Anthropic, in `Claude/claude_desktop_config.json`, were gone from the list (aa86222 on Discord: connectors didn't sync). Turning Desktop onto magpie copies each of those `mcpServers` entries that `Claude-3p` has none of the same name for (`desktopCarryMCP` in [`claudedesktop.go`](../../internal/agent/claudedesktop.go)); one of that name already there, the user's or the Library's (which writes both files), stays. `Sync` does it once for a Desktop already on magpie (`claude-desktop.mcp-seen`), so a server the user takes out in 3p isn't brought back. What was copied is stashed (`claude-desktop.mcp`), and off takes back each one still as copied; one the user changed since stays (`TestClaudeDesktopCarriesTheMCPServers`, `TestClaudeDesktopMCPKeepsThe3pServers`, `TestClaudeDesktopSyncCarriesTheMCPServersOnce`). Claude's file is never written. A claude.ai account's connectors can't come along: Desktop calls them through claude.ai with that account (`/api/organizations/<org>/mcp/servers/<id>/tools/call`, refused with `no_active_org` without one, Desktop 2.7032), and 3p mode has no account; Anthropic's docs say "Made by Anthropic" connectors are only in standard Desktop, and others reach 3p through `managedMcpServers` or plugins (claude.com/docs/third-party/claude-desktop/extensions).
- On a Mac, Claude Desktop on magpie can run beside the user's own Claude Desktop signed in with Anthropic (#5671, baranwang on X): off by default (`settings.DesktopIsolated`); turned on by the "Separate app" switch in Claude Desktop's opened row (`POST /api/settings/desktop-isolated`) or `magpie claude-desktop launcher add`, both `SetDesktopIsolated` in [`claudedesktop_isolated.go`](../../internal/agent/claudedesktop_isolated.go). It makes `~/Applications/Claude Magpie.app` ([`desktopiso`](../../internal/desktopiso/desktopiso.go): Claude's own icon with a magpie badge, an `sh` executable that runs Claude.app's executable with `--user-data-dir=~/Library/Application Support/Claude-Magpie-3p` and opens no second one while it runs) and moves a Desktop on magpie there: the usual sets are put back as before magpie (`desktopOff`) and the isolated set (`desktopIsolatedSet`, stash key `.isolated`, MCP servers and language read from the user's own Desktop) gets the 3p mode. Turned off, the app goes and Claude-Magpie-3p goes off magpie; the wiring goes back to the usual sets only when it came from them (stash `claude-desktop.isolated-from-own`), so a twin made beside a Desktop not on magpie never puts the user's own Desktop on magpie (xMopf7RF on X). One turned on before that mark existed leaves the user's own Desktop off magpie too. While on, `desktopSets` is that set alone; the row's file stays the user's own. The folder ends in `-3p` because Desktop (`GY()` in 4.4212's app.asar) adds `-3p` to a userData that doesn't, and `CLAUDE_USER_DATA_DIR` is dropped by the packaged app, so only the flag works. Windows hardcodes `%LOCALAPPDATA%\Claude-3p`, so it is macOS only (`desktopdir.Isolated` is "" elsewhere). Two Claude.app processes then run: `desktopInstance` (`restartable.macCmd`) keeps Restart and "running on the old settings" on the wired one, and Restart quits the isolated one by `pkill -TERM` on its command line (`desktopIsoQuit`) and opens the app again. The gateway's model selector reads Claude-Magpie-3p first (`desktopSelectorRoots`). Not done: the Dock shows Claude's own icon for the running isolated Desktop, and Desktop turns its Chrome pairing off in a moved userData.
- Claude Magpie's Code tab can have a Claude Code folder of its own (#6459, xMopf7RF on X): `settings.DesktopIsolatedClaude`, on for a Claude Magpie made new and off for one made before. Made new is the app off and no Claude-Magpie-3p folder yet, and the user never set it (`DesktopIsolatedClaudeChosen`, which the fold and the CLI set): then `desktopIsoClaudeDefault` turns it on before the app is made, so the twin's Code tab writes nothing of `~/.claude`, like a phone's app clone. One with chats in Claude-Magpie-3p already, or one the user turned off, keeps `~/.claude`. Set under the Separate app's Advanced fold (`POST /api/settings/desktop-isolated-claude`, drawn by `claudemagpie.js`) or `magpie claude-desktop launcher claude-dir on|off`, both `SetDesktopIsolatedClaude`. While on, and the Separate app is on, the app's script exports `CLAUDE_CONFIG_DIR=~/.claude-magpie-desktop` (`desktopiso.Script`'s `claudeDir`), which Desktop passes to its bundled Claude Code, and `desktopOn` in [`claude.go`](../../internal/agent/claude.go) writes Desktop's model windows, caps and explore entries into that folder's `settings.json` instead of `~/.claude`'s (`desktopCodeDir`, `desktopClaudeSync`); off moves them back. The folder stays when it is turned off, and it is a `claude#` row named "Claude Code · Claude Magpie" (`claudeDirAgents`). A change remakes the app; a running Claude Magpie keeps the old environment until it is quit and opened again. Its Library has no targets yet. The "Use Claude Magpie" button, beside Claude Desktop's switch while it isn't on magpie (its own button there, not words in the status line, so it reads as a way that doesn't connect the user's own Desktop), turns the Separate app on and then connects Desktop (`desktopTwinBtn`, also `claudemagpie.js`), so only Claude-Magpie-3p is wired and the user's own Desktop is left as it was. `TestClaudeDesktopIsolatedClaudeDir`, `TestClaudeMagpieTwinLeavesTheOriginal`, `TestClaudeMagpieOwnFolderKeepsWhatWasSet`, `TestScriptClaudeConfigDir`, `desktop-isolated-claude.test.cjs`, `desktop-twin.test.cjs`.
- Claude Magpie's Code tab can have a Claude Code folder of its own (#6459, xMopf7RF on X): `settings.DesktopIsolatedClaude`, on for a Claude Magpie made new and off for one made before. Made new is the app off and no Claude-Magpie-3p folder yet, and the user never set it (`DesktopIsolatedClaudeChosen`, which the fold and the CLI set): then `desktopIsoClaudeDefault` turns it on before the app is made, so the twin's Code tab writes nothing of `~/.claude`, like a phone's app clone. One with chats in Claude-Magpie-3p already, or one the user turned off, keeps `~/.claude`. Set under the Separate app's Advanced fold (`POST /api/settings/desktop-isolated-claude`, drawn by `claudemagpie.js`) or `magpie claude-desktop launcher claude-dir on|off`, both `SetDesktopIsolatedClaude`. While on, and the Separate app is on, the app's script exports `CLAUDE_CONFIG_DIR=~/.claude-magpie-desktop` (`desktopiso.Script`'s `claudeDir`), which Desktop passes to its bundled Claude Code, and `desktopOn` in [`claude.go`](../../internal/agent/claude.go) writes Desktop's model windows, caps and explore entries into that folder's `settings.json` instead of `~/.claude`'s (`desktopCodeDir`, `desktopClaudeSync`); off moves them back. The folder stays when it is turned off, and it is a `claude#` row named "Claude Code · Claude Magpie" (`claudeDirAgents`). A change remakes the app; a running Claude Magpie keeps the old environment until it is quit and opened again. In the Library it is an agent of its own (see [library](library.md), Claude Magpie): `DesktopTwinApp` (`claude-desktop#magpie`) takes MCP servers and Cowork skills in Claude-Magpie-3p, and the `claude#magpie-desktop` row takes instructions, skills and servers in `~/.claude-magpie-desktop`; `DesktopConfigs3p` no longer includes Claude-Magpie-3p's config. The "Use Claude Magpie" button, beside Claude Desktop's switch while it isn't on magpie (its own button there, not words in the status line, so it reads as a way that doesn't connect the user's own Desktop), turns the Separate app on and then connects Desktop (`desktopTwinBtn`, also `claudemagpie.js`), so only Claude-Magpie-3p is wired and the user's own Desktop is left as it was. `TestClaudeDesktopIsolatedClaudeDir`, `TestClaudeMagpieTwinLeavesTheOriginal`, `TestClaudeMagpieOwnFolderKeepsWhatWasSet`, `TestScriptClaudeConfigDir`, `desktop-isolated-claude.test.cjs`, `desktop-twin.test.cjs`.
- Claude Desktop names a Claude model with reasoning levels after its own catalog ("Opus 5.5"), not by the `display_name` magpie lists, because magpie lists it as `magpie-<number>.anthropic.<model>` to keep its effort picker (`claudeLooking` in [`desktop.go`](../../internal/gateway/desktop.go)). Desktop 4.4212 labels a picker row by its catalog's name before `display_name` (only an admin's `inferenceModels` list carries the `labelOverride` that beats it; magpie writes one, with each row's `display_name`, only while a tier is picked), so two providers' rows of one model read alike and Desktop adds the tail of the id, "Opus 5.5 (…7922287072.anthropic.claude-opus-5-5)". Desktop shows the gateway's `description` under the name, before the catalog's, so such a row's description names its provider when the Provider in model names setting puts it after the name (`desktopSaidBy`: on, every one; off, only two of one name), and a 1M row listed by its `[1m]` id says "1M context window · <provider>" (4 v5 on Discord, `TestClaudeDesktopCatalogNamedSaysProvider`). The id stays as it was. The provider editor shows the number too on the model's chip (`gateway.DesktopNumber`, `desktopNumbers` in [`providers.go`](../../internal/gui/providers.go), #2578). The chip shows it only while Claude Desktop is installed and is shown that model. Every other model Desktop is shown carries no number on the chip: Desktop names it by `display_name`, which already says the provider, or by its own id.
- Codex's `spawn_agent` tool names only the first five models of its catalog to the lead (codex-rs `MAX_SPAWN_AGENT_MODEL_OVERRIDES` in `child_config.rs`, `spawn_agent_models_description`), Codex's own ahead of magpie's, though it takes any catalog model by name (`find_spawn_agent_model_name`). So a lead could put its subagents on none of magpie's models (Gearclickist on Discord). The gateway adds the rest of the catalog Codex was handed to that tool's description, after Codex's own list, at most 200 (`spawnAgentModels` in [`codex_spawn_models.go`](../../internal/gateway/codex_spawn_models.go)). A model that can search tools (`supports_search_tool`) isn't handed it in the request's tools: Codex defers its multi-agent V1 tools behind `tool_search` (codex-rs `core/src/tools/spec_plan.rs`), and the lead gets `spawn_agent` in the `tool_search_output` Codex puts in the conversation and sends again every turn, so that one is widened too. That text goes upstream with the prompt, to OpenAI too for a ChatGPT lead, so its header (`spawnMore`) stays neutral: it names neither magpie nor Codex's limit. At `CodexPath` that is Codex's own listed models less the hidden ones, then `CodexListed` unless Codex is held to its own. At `/v1` it is `CodexCatalog` under the key's allowance. A lead the ChatGPT backend answers in multi-agent V2 seals its subagents' tasks for a ChatGPT account (#619), so it gets Codex's own only. The model catalog Codex puts in context under `model_catalog_in_context` (under development, off by default) is capped at five too, and isn't widened.
- Snow CLI runs on one profile at a time (`profiles/<name>.json` in `~/.snow` or `$SNOW_CONFIG_DIR`, named in `active-profile.json`) and copies the active one over `config.json` at every start, `snow --ask` too ([`snow.go`](../../internal/agent/snow.go)). magpie writes a `magpie` profile, makes it the active one, and copies it to `config.json` itself, so a Snow already running and Snow App's "Sync Snow CLI API config" see the same. It is made from the profile the user was on, their settings kept and its OAuth sign-in left out. A vision model of that profile comes along only with an endpoint and key of its own (`snowOwnVision`), since one on the profile's would now go to the gateway. `maxContextTokens`, `maxTokens` and `supportsVision` follow the model from the catalog (`snowSynced`; `supportsVision` as every agent is told, true while magpie's Vision describes images); what magpie last wrote of them is stashed, and one the user changed since in Snow's own settings is kept through later picks and syncs. The small field is magpie's profile's `basicModel`, Snow's light model for summaries, compaction and file search: empty while it follows the main model, a model through magpie of its own kept through new main models and syncs; on a profile of the user's it offers nothing and is hidden. The thinking field is magpie's profile's `chatThinking` (`{enabled: true, reasoning_effort}`), the only thinking setting Snow reads on the chat protocol; empty deletes it, Snow's default, which sends thinking disabled. A chatThinking the user brought from their profile is shown, not written over. The profile they were on (or that there was no `active-profile.json`) and a `magpie.json` of their own are stashed and put back by Disconnect. A Snow from before profiles (`config.json` alone) gets the `default.json` Snow itself would have made of it, so its next start doesn't take magpie's for the user's. Picking a model of another of the user's profiles switches Snow to that profile. On magpie's profile, a value that is neither a model through magpie nor the model of one of the user's profiles is refused and changes nothing (#1457: `magpie snow --help` used to take magpie out and write `--help` as the model of the profile it went back to). Gemini CLI's auth field refuses an auth it doesn't know before it unroutes, for the same reason. On the CLI, `-h`/`--help` after any command or agent only prints its usage, before `run` reads or moves anything, and any other flag given to `magpie <agent> …` is refused (`help_cli.go`; `TestHelpOnEveryCommandDoesNothing` walks `run`'s switch and every agent).
+1
View File
@@ -98,6 +98,7 @@ Pi's extensions and packages.
- Alma's servers go in `~/.config/alma/mcp.json` on every system (its home, not its data folder), as its own MCP settings write them: `command`/`args`/`env`, or `url`/`headers` with `transport: "sse"` only for SSE (#1292). Alma reads the file as it starts and when its MCP settings refresh, so a server given to it while it runs reaches it after one of those.
- Grok App's independent home (Use on a custom provider, `GROK_HOME` at `agent-home` under its data folder) gets instructions in `AGENTS.md`, MCP servers in `[mcp_servers]` of the same `config.toml` magpie's channel is in, skills in `skills/`, and hooks as `[[hooks.<Event>]]` tables in that config, and it also reads `~/.agents/skills`. Shared mode stays on Grok Build's `~/.grok` row. RTK lists Grok App, and Grok Build, with the switch off: `rtk init` has no Grok agent.
- Zed's servers go in `context_servers` of the settings.json magpie sets its model in (`agent.zed`: `~/.config/zed` on macOS, `$XDG_CONFIG_HOME/zed` on Linux, `%APPDATA%\Zed` on Windows, or `$MAGPIE_ZED_CONFIG_DIR`), as `command`/`args`/`env` or `url`/`headers` (`ContextServerSettingsContent`, zed-industries/zed 2c99f547). The file is JSONC: it is edited in place, so the user's comments, other settings and own servers stay, and `enabled`, `remote`, `timeout` and `oauth` in magpie's entry are the user's. Zed speaks streamable HTTP only (its `http.rs` only POSTs), so no SSE. An entry Zed's extensions configure (`settings` and no command or url) is never written over: a server by that name is refused for Zed (`mcpFile.foreign`), and asks for another name. Zed reloads the file as it changes.
- Claude Magpie, the separate Claude Desktop (agent-wiring's Separate app), is an agent of its own (xMopf7RF on X: it should be like an independent agent). `agent.DesktopTwinApp` is an app target, `claude-desktop#magpie` named "Claude Magpie", while the Separate app is on and Claude-Magpie-3p is there (macOS only): MCP servers go to that folder's `claude_desktop_config.json` and Cowork skills to its skills-plugin (`desktopSkillRootsIn`). Claude Desktop's target no longer reaches either: `DesktopConfigs3p` and `desktopSkillRoots` leave Claude-Magpie-3p out. It keeps no instructions file of its own, so `noPlace` points to its Code tab's row. Every `claude#<name>` row (`~/.claude-magpie-desktop` is `claude#magpie-desktop`, "Claude Code · Claude Magpie") takes `CLAUDE.md`, `skills/` and the `.claude.json` in its folder (`~/.claude.json` for `~/.claude` itself); its settings.json features (hooks, env, tools off) stay with `claude`. Before, both shared Claude Desktop's writes or got nothing. What magpie gave Claude Desktop that is in Claude-Magpie-3p already is ticked for Claude Magpie once, on load, while nothing is recorded for it (`carryTwin`), so an update takes nothing away; library.json syncs, so another Mac's twin sees the same ticks. `desktopCarryMCP` still copies the user's own Desktop servers into the twin when it is wired. `TestClaudeMagpieIsItsOwnLibraryAgent`, `TestClaudeMagpieKeepsWhatDesktopWasGiven`, `library-desktop-twin.test.cjs`.
- An agent with no place for an item is refused by `Takes`, never recorded as given it. The refusal lists the agents here that take that item (`takenBy`), and says where it goes instead (`noPlace`): OpenChamber reads OpenCode's global AGENTS.md, skills folder and opencode.json (its server's `shared.js`), so it gets them from OpenCode; Claude Desktop's chat keeps its instructions in its own settings, with the Claude account, and its Code tab reads Claude Code's. A plugin's agent is refused an item its `agent.library` names no place for, and the refusal names the key its plugin would set.
- Removing RTK never uses `rtk init --uninstall`. That command deletes Gemini's `GEMINI.md` whole and removes Claude Code, OpenCode and Cursor together.
- A hook is recorded entry by entry, as written (`Applied.Hooks`, compared as canonical JSON). magpie takes out only an entry still exactly as it wrote it; one the user edited is theirs from then on, and the user's own hooks beside it stay. A hooks file that doesn't parse is a problem and is never written. Codex keeps each hook's trust in config.toml as `[hooks.state."<path>:<event>:<group>:<handler>"]`, keyed by position, so when magpie takes a group out `codexRekey` moves the user's trust for the groups after it to their new place.
+3 -6
View File
@@ -120,17 +120,14 @@ func desktopUsualSets(goos, home string, getenv func(string) string) []desktopPa
// DesktopConfigs3p are the claude_desktop_config.json files Claude Desktop
// reads in its 3p mode: there its whole userData is Claude-3p, its MCP
// servers too (%LOCALAPPDATA%\Claude-3p on Windows, and the MSIX package's;
// Claude-3p beside Claude elsewhere), and the isolated Desktop's
// Claude-Magpie-3p on a Mac, whose only file it is (the library gives it
// the servers where that folder is).
// Claude-3p beside Claude elsewhere). The isolated Desktop's
// Claude-Magpie-3p is not one of them: the library gives it servers of
// its own (DesktopTwinApp).
func DesktopConfigs3p(home string) []string {
var out []string
for _, p := range desktopUsualSets(desktopdir.OS, home, os.Getenv) {
out = append(out, p.config3p)
}
if p, ok := desktopIsolatedSet(desktopdir.OS, home, os.Getenv); ok {
out = append(out, p.config3p)
}
return out
}
+22
View File
@@ -399,3 +399,25 @@ func reopenIsolated(ctx context.Context, a *Agent, r restartable, exe string) er
}
return nil
}
// DesktopTwinID is the id the library knows Claude Magpie, the isolated
// Desktop, by.
const DesktopTwinID = "claude-desktop#magpie"
// DesktopTwinApp is Claude Magpie, the isolated Desktop (desktopiso), as
// an app of its own to the library, as an Android app's twin is (xMopf7RF
// on X): its MCP servers in Claude-Magpie-3p's claude_desktop_config.json,
// the only file it reads them from, and its Cowork skills in that folder's
// skills-plugin, neither shared with the user's own Desktop. nil where it
// can't be (only on a Mac); here only while it is on and its folder there.
func DesktopTwinApp(home string) *Agent {
p, ok := desktopIsolatedSet(desktopdir.OS, home, os.Getenv)
if !ok {
return nil
}
return &Agent{
ID: DesktopTwinID, Name: desktopiso.Name, Icon: "claude-color",
Dir: p.dir3p, Path: p.config3p,
detect: func() bool { return desktopIsolatedOn() && isDir(p.dir3p) },
}
}
@@ -114,8 +114,15 @@ func TestClaudeDesktopIsolatedMovesThere(t *testing.T) {
if a.Notice() != noticeClaudedesktopIsolated.String() {
t.Errorf("notice %q", a.Notice())
}
if got := DesktopConfigs3p(home); got[len(got)-1] != iso.config3p {
t.Errorf("3p configs %v miss %s", got, iso.config3p)
// the library gives the twin servers of its own, not the user's
// Desktop's (xMopf7RF on X)
for _, p := range DesktopConfigs3p(home) {
if p == iso.config3p {
t.Errorf("3p configs %v have the twin's %s", DesktopConfigs3p(home), iso.config3p)
}
}
if tw := DesktopTwinApp(home); tw == nil || tw.Path != iso.config3p || tw.Dir != iso.dir3p || !tw.Detected() {
t.Errorf("the twin's app %+v, want %s, here", tw, iso.config3p)
}
// off magpie and on again, while isolated: only Claude-Magpie-3p
if err := a.Field("provider").Set(""); err != nil {
@@ -0,0 +1,133 @@
// Run with Node's test runner and Playwright on the module path; see README.md.
// xMopf7RF on X: Claude Magpie, the separate Claude Desktop, is an agent of
// its own in the Library. Its Desktop (claude-desktop#magpie) and its Code
// tab's Claude Code (claude#magpie-desktop) each have a chip of their own
// beside Claude Desktop's and Claude Code's, named for them, lit only for
// what was given to them; a click on Claude Desktop's chip asks for Claude
// Desktop alone. MCP and skills, 980px and 420px, every language, both
// engines. No backend: the API is faked here.
const assert = require("node:assert/strict");
const fs = require("node:fs/promises");
const path = require("node:path");
const { test } = require("node:test");
const { chromium, webkit } = require("playwright");
const { strings } = require("./strings.cjs");
const assets = path.resolve(__dirname, "../assets");
const HOME = "/Users/mo";
const AS = `${HOME}/Library/Application Support`;
const TWIN = "claude-desktop#magpie", CODE = "claude#magpie-desktop";
const NAMES = { [TWIN]: "Claude Magpie", [CODE]: "Claude Code · Claude Magpie", "claude-desktop": "Claude Desktop", claude: "Claude Code" };
const fixture = () => ({
dir: `${HOME}/.magpie/library`, backups: `${HOME}/.magpie/backups`, home: HOME,
agents: [
{ id: "claude", name: NAMES.claude, icon: "claudecode-color", skills: `${HOME}/.claude/skills`, mcp: `${HOME}/.claude.json` },
{ id: CODE, name: NAMES[CODE], icon: "claudecode-color", skills: `${HOME}/.claude-magpie-desktop/skills`, mcp: `${HOME}/.claude-magpie-desktop/.claude.json` },
{ id: "claude-desktop", name: NAMES["claude-desktop"], icon: "claude-color", mcp: `${AS}/Claude/claude_desktop_config.json`, skills: `${AS}/Claude-3p/local-agent-mode-sessions/skills-plugin/o/a/skills` },
{ id: TWIN, name: NAMES[TWIN], icon: "claude-color", mcp: `${AS}/Claude-Magpie-3p/claude_desktop_config.json`, skills: `${AS}/Claude-Magpie-3p/local-agent-mode-sessions/skills-plugin/o/a/skills` },
],
instructions: { agents: [], sets: [] }, foundSkills: [], problems: [], foundServers: [], projects: [],
servers: [{ name: "fs", transport: "stdio", command: "npx", args: ["-y", "fs"], agents: [TWIN] }],
skills: [{ name: "pdf", kind: "folder", description: "Read PDFs", source: `${HOME}/skills/pdf`, agents: [CODE] }],
});
let I18N;
function tr(lang, key, vars = {}) {
let s = key;
if (lang !== "en") {
assert.equal(typeof I18N[lang][key], "string", `${lang} has no ${JSON.stringify(key)}`);
s = I18N[lang][key];
}
return s.replace(/\{(\w+)\}/g, (m, k) => (k in vars ? String(vars[k]) : m));
}
function server(lang, posts) {
return async (route) => {
const req = route.request(), url = new URL(req.url());
const json = (data) => route.fulfill({ json: data });
if (url.pathname === "/boot.js") return route.fulfill({ contentType: "text/javascript", body: `window.bootPrefs = {lang:${JSON.stringify(lang)},theme:"light",web:true};` });
if (url.pathname === "/wails/runtime.js") return route.fulfill({ contentType: "text/javascript", body: "export const Window = {};" });
if (url.pathname === "/api/state") return json({ agents: [], profiles: [], settings: { lang, theme: "light" } });
if (url.pathname === "/api/plugins") return json({ plugins: [] });
if (url.pathname === "/api/library") return json(fixture());
if ((url.pathname === "/api/library/servers/agents" || url.pathname === "/api/library/skills/agents") && req.method() === "POST") {
posts.push({ path: url.pathname, ...req.postDataJSON() });
return json({ ...fixture(), result: { problems: [] } });
}
if (url.pathname === "/api/library/mcp/check") return json({ servers: {} });
if (url.pathname.startsWith("/api/library/market/")) return json({ items: [] });
if (url.pathname === "/api/usage/quotas") return json([]);
if (url.pathname === "/api/groups") return json({ groups: [] });
if (url.pathname === "/api/providers") return json({ providers: [], gateway: { running: true } });
if (url.pathname.startsWith("/api/")) return json({});
if (url.host !== "magpie.test") return route.fulfill({ status: 404, body: "" });
const file = path.join(assets, url.pathname === "/" ? "index.html" : url.pathname);
const contentType = { ".html": "text/html", ".js": "text/javascript", ".css": "text/css", ".svg": "image/svg+xml", ".png": "image/png" }[path.extname(file)];
const body = await fs.readFile(file).catch(() => null);
await (body ? route.fulfill({ body, contentType }) : route.fulfill({ status: 404, body: "" }));
};
}
const sideways = (page) => page.evaluate(() => {
const w = document.documentElement.clientWidth;
const over = [];
if (document.documentElement.scrollWidth > w) over.push("page " + document.documentElement.scrollWidth);
for (const e of document.querySelectorAll("#view-library .lib-row, #view-library .lib-agents")) {
const r = e.getBoundingClientRect();
if (r.width && (r.right > w + 0.5 || r.left < -0.5)) over.push(e.className + " " + Math.round(r.left) + "–" + Math.round(r.right));
}
return over;
});
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
test(engine + ": Claude Magpie is an agent of its own in the Library", async (t) => {
assert(["chromium", "webkit"].includes(engine), "BROWSER must be chromium or webkit");
I18N = strings().I18N;
const browser = await (engine === "webkit" ? webkit.launch() : chromium.launch({ channel: process.env.PLAYWRIGHT_CHANNEL || "chromium" }));
t.after(() => browser.close());
for (const width of [980, 420]) for (const lang of ["en", "zh", "zh-TW", "ja", "de"]) for (const tab of ["mcp", "skills"]) {
await t.test(`${lang} ${width}px ${tab}`, async () => {
const errors = [], posts = [];
const ctx = await browser.newContext({ viewport: { width, height: 900 }, reducedMotion: "reduce" });
await ctx.addInitScript((x) => { try { localStorage.setItem("magpie.libTab", x); } catch {} }, tab);
const page = await ctx.newPage();
page.setDefaultTimeout(5000);
page.setDefaultNavigationTimeout(60000);
page.on("pageerror", (e) => errors.push(e.message));
await page.route("**/*", server(lang, posts));
await page.goto("http://magpie.test/");
await page.locator('button[data-view="library"]').click();
const v = page.locator("#view-library");
const row = tab === "mcp" ? v.locator('.lib-server[data-server="fs"]') : v.locator(".lib-row", { hasText: "Read PDFs" }).first();
await row.locator(".lib-agents").waitFor();
const given = tab === "mcp" ? TWIN : CODE;
// one chip each, none folded into Claude Desktop's or Claude Code's
for (const id of Object.keys(NAMES)) {
const chip = row.locator(`.lib-ag[data-agent="${id}"]`);
assert.equal(await chip.count(), 1, `${tab}: no chip of its own for ${id}`);
const on = id === given;
assert.equal(await chip.getAttribute("aria-pressed"), on ? "true" : "false", `${tab}: ${id}`);
const tip = on ? tr(lang, "{agent} has it — click to take it away", { agent: NAMES[id] }) : tr(lang, "Give it to {agent}", { agent: NAMES[id] });
assert.equal((await chip.getAttribute("title")).split("\n")[0], tip);
}
assert.equal(await row.locator(".lib-ag[data-members]").count(), 0, "folded into a menu");
// the page never scrolls sideways; a row's hand of four or more
// chips can reach past its edge at 420px in ja, before Claude
// Magpie too (six agents do it in en), #6558
assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= document.documentElement.clientWidth), true, "sideways scroll");
if (!(width < 800 && lang === "ja")) assert.deepEqual(await sideways(page), [], "past the row's edge");
// given to Claude Desktop, Claude Magpie's keeps what it had
const sent = page.waitForResponse((r) => /\/api\/library\/(servers|skills)\/agents$/.test(new URL(r.url()).pathname) && r.request().method() === "POST");
await row.locator('.lib-ag[data-agent="claude-desktop"]').click();
await sent;
assert.equal(posts.length, 1, "nothing posted");
assert.equal(posts[0].path, tab === "mcp" ? "/api/library/servers/agents" : "/api/library/skills/agents");
assert.deepEqual([...posts[0].agents].sort(), [given, "claude-desktop"].sort());
assert.deepEqual(errors, []);
await ctx.close();
});
}
});
}
+17 -2
View File
@@ -39,9 +39,24 @@ const desktopManifest = "manifest.json"
// desktopSkillRoots are the skills-plugin folders of every account Claude
// Desktop has, in its own folder and Claude-3p's alike: each one with a
// manifest.json or the plugin's plugin.json.
// manifest.json or the plugin's plugin.json. Claude Magpie's folder, the
// isolated Desktop's, is not one of them: that app is given skills of its
// own (agent.DesktopTwinApp, xMopf7RF on X).
func desktopSkillRoots(desktopDir string) []string {
dirs := append([]string{desktopDir}, desktopdir.Everywhere()...)
home, _ := os.UserHomeDir()
twin := desktopdir.Isolated(desktopdir.OS, home)
var dirs []string
for _, d := range append([]string{desktopDir}, desktopdir.Everywhere()...) {
if twin == "" || filepath.Clean(d) != filepath.Clean(twin) {
dirs = append(dirs, d)
}
}
return desktopSkillRootsIn(dirs)
}
// desktopSkillRootsIn are the skills-plugin folders of every account in
// dirs, Desktop's userData folders.
func desktopSkillRootsIn(dirs []string) []string {
var out []string
seen := map[string]bool{}
for _, d := range dirs {
+58
View File
@@ -0,0 +1,58 @@
package library
// Claude Magpie, the isolated Desktop, is an app of its own to the library
// (agent.DesktopTwinApp, xMopf7RF on X). Before, Claude Desktop's servers
// and Cowork skills were written into its folder too, as Claude Desktop's:
// carryTwin records each of those still there as given to Claude Magpie,
// ticked for it, so it keeps what it has and each can then be taken from
// one app and not the other.
import (
"os"
"path/filepath"
"slices"
"github.com/tidwall/gjson"
"github.com/yetone/magpie/internal/agent"
)
// carryTwin ticks for Claude Magpie each server and skill magpie gave
// Claude Desktop that is in Claude Magpie's folder, while nothing is
// recorded for Claude Magpie yet: once, as what magpie wrote is recorded
// from then on.
func (l *Library) carryTwin() {
desk := l.Applied["claude-desktop"]
if desk == nil || len(desk.MCP) == 0 && len(desk.Skills) == 0 || l.Applied[agent.DesktopTwinID] != nil {
return
}
tw := agent.DesktopTwinApp(home())
if tw == nil || !isDir(tw.Dir) {
return
}
got := &Applied{}
if b, err := os.ReadFile(tw.Path); err == nil {
servers := gjson.GetBytes(b, "mcpServers")
for _, name := range desk.MCP {
if servers.IsObject() && servers.Get(gjson.Escape(name)).Exists() {
got.MCP = append(got.MCP, name)
if s := l.server(name); s != nil && !slices.Contains(s.Agents, tw.ID) {
s.Agents = append(s.Agents, tw.ID)
}
}
}
}
roots := desktopSkillRootsIn([]string{tw.Dir})
for _, name := range desk.Skills {
if !slices.ContainsFunc(roots, func(r string) bool { return isDir(filepath.Join(r, "skills", name)) }) {
continue
}
got.Skills = append(got.Skills, name)
if s := l.skill(name); s != nil && !slices.Contains(s.Agents, tw.ID) {
s.Agents = append(s.Agents, tw.ID)
}
}
if !got.empty() {
l.Applied[tw.ID] = got
}
}
+178
View File
@@ -0,0 +1,178 @@
package library
import (
"os"
"path/filepath"
"slices"
"strings"
"testing"
"github.com/yetone/magpie/internal/agent"
"github.com/yetone/magpie/internal/desktopdir"
"github.com/yetone/magpie/internal/settings"
)
// twinSandbox is the sandbox with Claude Desktop and Claude Magpie, the
// isolated Desktop, on: its folder Claude-Magpie-3p and its Code tab's
// Claude Code folder ~/.claude-magpie-desktop there. Only on a Mac.
func twinSandbox(t *testing.T) (h, desk, twinDir string) {
t.Helper()
if desktopdir.OS != "darwin" {
t.Skip("Claude Magpie is only on a Mac")
}
h = sandbox(t)
desk, _ = desktopFiles(t, h)
write(t, desk, `{}`)
twinDir = desktopdir.Isolated(desktopdir.OS, h)
write(t, filepath.Join(twinDir, "claude_desktop_config.json"), `{"deploymentMode": "3p"}`)
write(t, filepath.Join(h, ".claude-magpie-desktop", "settings.json"), `{}`)
s, err := settings.LoadChecked()
if err != nil {
t.Fatal(err)
}
s.DesktopIsolated, s.DesktopIsolatedClaude = true, true
if err := settings.Save(s); err != nil {
t.Fatal(err)
}
return h, desk, twinDir
}
// xMopf7RF on X: Claude Magpie is an agent of its own in the library. Its
// Desktop takes MCP servers and Cowork skills in its own folder, its Code
// tab's Claude Code (claude#magpie-desktop) instructions, skills and
// servers in ~/.claude-magpie-desktop; what is given to one reaches none
// of Claude Desktop's or ~/.claude's files, and the other way round.
func TestClaudeMagpieIsItsOwnLibraryAgent(t *testing.T) {
h, desk, twinDir := twinSandbox(t)
twinCfg := filepath.Join(twinDir, "claude_desktop_config.json")
code := filepath.Join(h, ".claude-magpie-desktop")
deskRoot := desktopAccount(t, filepath.Dir(desk), "org", "acct", `{"skills":[]}`)
twinRoot := desktopAccount(t, twinDir, "org2", "acct2", `{"skills":[]}`)
tw := targetByID(agent.DesktopTwinID)
if tw == nil || tw.MCP == nil || tw.MCP.Path != twinCfg || len(tw.MCP.Also) != 0 || !slices.Equal(tw.Desktop, []string{twinRoot}) || tw.Instructions != "" {
t.Fatalf("Claude Magpie's target: %+v", tw)
}
if tw.Agent.Name != "Claude Magpie" {
t.Errorf("named %q", tw.Agent.Name)
}
cd := targetByID("claude-desktop")
if cd == nil || slices.Contains(cd.MCP.files(), twinCfg) || slices.Contains(cd.Desktop, twinRoot) {
t.Fatalf("Claude Desktop's target reaches Claude Magpie's folder: %+v %v", cd.MCP, cd.Desktop)
}
cc := targetByID("claude#magpie-desktop")
if cc == nil || cc.Instructions != filepath.Join(code, "CLAUDE.md") || cc.Skills != filepath.Join(code, "skills") || cc.MCP == nil || cc.MCP.Path != filepath.Join(code, ".claude.json") {
t.Fatalf("its Code tab's target: %+v", cc)
}
keep := map[string]string{}
for _, p := range []string{desk, filepath.Join(deskRoot, desktopManifest), filepath.Join(h, ".claude", "settings.json")} {
keep[p] = read(t, p)
}
src := filepath.Join(h, "src/skills")
skill(t, filepath.Join(src, "pdf"), "pdf", "Read PDFs")
ok(t)(InstallSkills(src, []string{"pdf"}, []string{agent.DesktopTwinID, "claude#magpie-desktop"}))
ok(t)(SaveServer("", Server{Name: "fs", Transport: "stdio", Command: "npx", Args: []string{"-y", "fs"}, Agents: []string{agent.DesktopTwinID, "claude#magpie-desktop"}}))
brief := "Be brief."
ok(t)(SaveInstructions(InstructionsChange{Shared: &brief, Agents: []string{"claude#magpie-desktop"}}))
if s := desktopServers(t, twinCfg)["fs"]; s["command"] != "npx" {
t.Errorf("Claude Magpie's servers: %v", desktopServers(t, twinCfg))
}
if _, err := os.Stat(filepath.Join(twinRoot, "skills", "pdf", "SKILL.md")); err != nil {
t.Errorf("Claude Magpie's Cowork skill: %v", err)
}
if _, has := desktopEntries(t, twinRoot)["pdf"]; !has {
t.Errorf("Claude Magpie's manifest: %s", read(t, filepath.Join(twinRoot, desktopManifest)))
}
if got := read(t, filepath.Join(code, ".claude.json")); !strings.Contains(got, `"fs"`) {
t.Errorf("its Code tab's .claude.json: %s", got)
}
if _, err := os.Stat(filepath.Join(code, "skills", "pdf", "SKILL.md")); err != nil {
t.Errorf("its Code tab's skill: %v", err)
}
if got := read(t, filepath.Join(code, "CLAUDE.md")); !strings.Contains(got, brief) {
t.Errorf("its Code tab's CLAUDE.md: %q", got)
}
// none of the user's own Desktop, ~/.claude or ~/.claude.json
for p, was := range keep {
if got := read(t, p); got != was {
t.Errorf("%s changed:\n%s\nwas:\n%s", p, got, was)
}
}
for _, p := range []string{filepath.Join(h, ".claude.json"), filepath.Join(h, ".claude", "CLAUDE.md"), filepath.Join(h, ".claude", "skills", "pdf"), filepath.Join(deskRoot, "skills", "pdf")} {
if _, err := os.Lstat(p); err == nil {
t.Errorf("%s written", p)
}
}
// given to Claude Desktop alone, Claude Magpie's file keeps what it had
ok(t)(SaveServer("", Server{Name: "gh", Transport: "stdio", Command: "gh", Agents: []string{"claude-desktop"}}))
if s := desktopServers(t, desk); s["gh"] == nil || s["fs"] != nil {
t.Errorf("Claude Desktop's servers: %v", s)
}
if s := desktopServers(t, twinCfg); s["gh"] != nil || s["fs"] == nil {
t.Errorf("Claude Magpie's servers: %v", s)
}
// and taken from Claude Magpie, it goes from there alone
ok(t)(SaveServer("fs", Server{Name: "fs", Transport: "stdio", Command: "npx", Args: []string{"-y", "fs"}, Agents: []string{"claude#magpie-desktop"}}))
if s := desktopServers(t, twinCfg); s["fs"] != nil {
t.Errorf("fs still in Claude Magpie's: %v", s)
}
if got := read(t, filepath.Join(code, ".claude.json")); !strings.Contains(got, `"fs"`) {
t.Errorf("fs gone from its Code tab's too: %s", got)
}
}
// What the library gave Claude Desktop before Claude Magpie was an app of
// its own was written into Claude Magpie's folder too: it stays there,
// now ticked for Claude Magpie, so the user loses nothing and can take it
// from either app alone.
func TestClaudeMagpieKeepsWhatDesktopWasGiven(t *testing.T) {
_, desk, twinDir := twinSandbox(t)
twinCfg := filepath.Join(twinDir, "claude_desktop_config.json")
twinRoot := desktopAccount(t, twinDir, "org2", "acct2", `{"skills":[]}`)
// as the release before wrote it: Claude Desktop's server and skill in
// both folders, recorded for claude-desktop alone
write(t, desk, `{"mcpServers": {"fs": {"command": "npx"}}}`)
write(t, twinCfg, `{"deploymentMode": "3p", "mcpServers": {"fs": {"command": "npx"}, "mine": {"command": "x"}}}`)
skill(t, filepath.Join(twinRoot, "skills", "pdf"), "pdf", "Read PDFs")
skill(t, filepath.Join(Dir(), "skills", "pdf"), "pdf", "Read PDFs")
l := &Library{
MCP: []*Server{{Name: "fs", Transport: "stdio", Command: "npx", Agents: []string{"claude-desktop"}}, {Name: "other", Transport: "stdio", Command: "o", Agents: []string{"claude-desktop"}}},
Skills: []*Skill{{Name: "pdf", Agents: []string{"claude-desktop"}}},
Applied: map[string]*Applied{"claude-desktop": {MCP: []string{"fs", "other"}, Skills: []string{"pdf"}}},
}
if err := l.save(); err != nil {
t.Fatal(err)
}
l, err := load()
if err != nil {
t.Fatal(err)
}
if got := l.server("fs").Agents; !slices.Equal(got, []string{"claude-desktop", agent.DesktopTwinID}) {
t.Errorf("fs for %v", got)
}
// one that never reached Claude Magpie's file isn't ticked for it
if got := l.server("other").Agents; !slices.Equal(got, []string{"claude-desktop"}) {
t.Errorf("other for %v", got)
}
if got := l.skill("pdf").Agents; !slices.Equal(got, []string{"claude-desktop", agent.DesktopTwinID}) {
t.Errorf("pdf for %v", got)
}
if a := l.Applied[agent.DesktopTwinID]; a == nil || !slices.Equal(a.MCP, []string{"fs"}) || !slices.Equal(a.Skills, []string{"pdf"}) {
t.Errorf("recorded for Claude Magpie: %+v", a)
}
// once: unticked for Claude Magpie, it stays unticked
if err := l.save(); err != nil {
t.Fatal(err)
}
l.server("fs").Agents = []string{"claude-desktop"}
l.Applied[agent.DesktopTwinID].MCP = []string{"fs"}
if err := l.save(); err != nil {
t.Fatal(err)
}
if l, _ = load(); !slices.Equal(l.server("fs").Agents, []string{"claude-desktop"}) {
t.Errorf("ticked again: %v", l.server("fs").Agents)
}
}
+2 -1
View File
@@ -215,7 +215,8 @@ func load() (*Library, error) {
if l.Applied == nil {
l.Applied = map[string]*Applied{}
}
l.heal() // magpie's own servers run this computer's magpie (self_here.go)
l.heal() // magpie's own servers run this computer's magpie (self_here.go)
l.carryTwin() // Claude Magpie keeps what it was given as Claude Desktop (desktop_twin.go)
return l, nil
}
+35
View File
@@ -154,6 +154,21 @@ func targetOf(a *agent.Agent) *Target {
t.Skills = filepath.Join(a.Dir, "skills")
return t
}
if strings.HasPrefix(a.ID, "claude#") {
// another Claude Code config folder (agent.claudeDirAgents), the
// isolated Desktop's Code tab's among them (xMopf7RF on X): Claude
// Code run with CLAUDE_CONFIG_DIR there reads CLAUDE.md and skills
// in it, and its MCP servers from the .claude.json in it; the
// default ~/.claude's are in ~/.claude.json beside it
t.Instructions = filepath.Join(a.Dir, "CLAUDE.md")
t.Skills = filepath.Join(a.Dir, "skills")
mcp := filepath.Join(a.Dir, ".claude.json")
if filepath.Clean(a.Dir) == filepath.Join(h, ".claude") {
mcp = filepath.Join(h, ".claude.json")
}
t.MCP = &mcpFile{Path: mcp, Format: fmtClaude}
return t
}
if n := a.SharedName(); n != a.Name {
// the files are another app's too (the Cursor editor's ~/.cursor):
// named for both, not for the CLI alone
@@ -605,6 +620,14 @@ func targetOf(a *agent.Agent) *Target {
if t.Desktop = desktopSkillRoots(a.Dir); len(t.Desktop) > 0 {
t.Skills = filepath.Join(t.Desktop[0], "skills")
}
case agent.DesktopTwinID:
// Claude Magpie, the isolated Desktop: its servers in the one file
// it reads, its Cowork skills in its own skills-plugin, neither
// the user's own Desktop's (xMopf7RF on X)
t.MCP = &mcpFile{Path: a.Path, Format: fmtDesktop}
if t.Desktop = desktopSkillRootsIn([]string{a.Dir}); len(t.Desktop) > 0 {
t.Skills = filepath.Join(t.Desktop[0], "skills")
}
default:
if a.Plugin != "" {
return pluginTarget(a)
@@ -909,6 +932,10 @@ func apps() []*agent.Agent {
out := []*agent.Agent{
agent.DesktopApp(home, dir, filepath.Join(dir, "claude_desktop_config.json")),
}
// Claude Magpie, the isolated Desktop, an app of its own (xMopf7RF on X)
if tw := agent.DesktopTwinApp(home); tw != nil {
out = append(out, tw)
}
// Kiro CLI (#4769) is no agent magpie wires a model into, but the
// library can give it skills, MCP servers and instructions. It is
// found by the kiro-cli program alone — PATH, ~/.local/bin, Kiro
@@ -1187,6 +1214,14 @@ func noPlace(a *agent.Agent, kind, what string) string {
// with the Claude account, not in a file; its Code tab is Claude
// Code, which reads Claude Code's CLAUDE.md
return "Claude Desktop keeps its instructions in its own settings, with your Claude account, not in a file magpie can write; its Code tab runs Claude Code, which reads Claude Code's · give them to claude"
case a.ID == agent.DesktopTwinID && kind == "instructions":
// as Claude Desktop, and its Code tab is Claude Code on the
// folder Claude Magpie.app names: its own, or ~/.claude
to := "claude"
if iso, ok := agent.DesktopIsolatedHere(); ok && iso.Claude {
to = "claude#" + strings.TrimPrefix(filepath.Base(iso.ClaudeDir), ".claude-")
}
return fmt.Sprintf("%s keeps its instructions in its own settings, not in a file magpie can write; its Code tab runs Claude Code, which reads that Claude Code's · give them to %s", a.Name, to)
case a.Plugin != "":
return fmt.Sprintf("%s's plugin (%s) says no place for %s: its agent.library.%s names none", a.Name, plugin.Name(a.Plugin), what, kind)
}