e4e9eb0928becfa4e48484dde85ef5032671d582
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b1f044fc1e |
library: a Claude plugin goes to another computer whole, its hooks naming that computer's folder (#6685)
A plugin installed from Library > Claude plugins didn't reach the other
computer by sync: the bundle carried its parts as plain items, with
${CLAUDE_PLUGIN_ROOT} already resolved to the first computer's
<library>/plugins/<name>, and neither the plugin record nor its folder.
Hooks there pointed at a path that doesn't exist, Windows' too.
Now Bundle.Plugins carries each plugin's record (name, version, source,
pick, agents, Off, parts taken out by hand) and never its parts:
- A GitHub or git link goes as its source. The receiving computer
installs it from there, as UpdatePlugin does, after the library's lock
is let go. Re-installing from the source was chosen because the files
stay the vendor's and an update keeps working there; a fetch that
fails keeps the plugin Pending (shown on its row, "Update tries again")
with a problem, and the next sync or Update tries again.
- A plugin from a local folder, or from a link holding a token (whose
link must not be synced), goes with its files on the skills' budget,
executables kept executable, and is installed from them.
- Either way the parts are read again there, so every hook, server and
skill names that computer's own plugin folder. A plugin the bundle no
longer has is removed with its folder; Off spreads.
- A bundle from an older magpie has no plugins list: this computer's
plugins keep their parts over the same-named items it carries.
- An empty list hashes as before, so computers without plugins don't
see a change; the preview names each plugin, its files as one digest.
- Sibling: a plugin installed from a marketplace under a name other
than its manifest's named the manifest's folder in its parts.
- The sync settings' text says Claude plugins go with the Library (en,
zh, zh-TW, ja, de); "Claude plugins" moved into the core i18n.js since
the core now says it.
Run at this head (54e682dc5's tree on
|
||
|
|
da29171a4e |
library: a plugin hook that reads CLAUDE_PLUGIN_ROOT itself gets the folder
@AXmake110 on X: with the Claude Code plugin ponytail installed for an
agent, every start of the agent printed a red error. ponytail's hooks
read the folder in Node, not through the shell:
node -e "require(require('path').join(process.env.CLAUDE_PLUGIN_ROOT.split(String.fromCharCode(92)).join('/'), 'hooks/ponytail-activate.js'))"
magpie replaced only ${CLAUDE_PLUGIN_ROOT} and $CLAUDE_PLUGIN_ROOT, so
the command went into Claude Code's settings.json (and, for the
UserPromptSubmit hook, Codex's hooks.json) as written. Outside Claude
Code's plugin runtime nothing sets the variable, and Node threw
"Cannot read properties of undefined (reading 'split')".
Fixed for the class (plugin_env.go):
- a hook program's own read of CLAUDE_PLUGIN_ROOT or CLAUDE_PLUGIN_DATA
becomes a quoted string literal of the folder, with forward slashes:
process.env.X, process.env['X'], Bun.env, Deno.env.get, Python's
os.environ[...]/.get/os.getenv, Ruby's ENV[...]/ENV.fetch. The quote
is chosen so it doesn't end the sh quoting around it. PowerShell's
$env:X / ${env:X} and cmd's %X% become the folder.
- a plugin's command MCP server gets both variables in its env, as
Claude Code gives them, unless the plugin set them.
- ${CLAUDE_PLUGIN_ROOT}/DATA in a subagent's prompt and in a copied
SKILL.md are resolved, as Claude Code resolves them in Markdown.
- every agent gets the same text: the parts are library items, so
Claude Code, Codex, Gemini, Cursor and Grok are all written from them.
- existing installs: load() heals the hooks, servers and subagent
prompts of an installed plugin that still name the variables, and the
next sync (the app's startup sync) writes them out again; the old
entry is replaced, not duplicated. A SKILL.md copied before is fixed
by the plugin's Update or a reinstall.
Not carried yet, filed as #6682: exec-form hooks (command + args, whose
args are dropped today) and CLAUDE_PLUGIN_OPTION_<KEY>.
The fixture is ponytail's published hooks files, byte for byte
(DietrichGebert/ponytail 96608e07, testdata/ponytail/README.md).
Run (mote; full suite at 901b56c80 on origin/main
|
||
|
|
4e770f733a |
library: subagents imported from a repository
CHENGJIAHEGOXIS on X asked for an easy way to install a repository of
subagents such as msitarzewski/agency-agents. Library → Subagents now
has a find line. It takes what the skill installer takes: owner/repo, a
GitHub or GitLab link to a repository, folder or file, any git address,
or a folder on this computer. It lists the subagents found, lets the
user tick all or some, and imports them as Library subagents for the
agents ticked.
- Fetching is the skill importer's: resolvePluginRoot's source handling
moved into fetchSourceRoot, which both use. tooBig still refuses a
whole repository that is too big and asks for the folder's link.
- A subagent is a Markdown file whose front matter has a description.
- Its name is the slug of `name`. In an `agents` or `droids` folder
with no `name`, it is the file's own name.
- The description is folded to one line of at most 1000 characters.
- The body is the prompt.
- Dropped: every other front-matter key (agency-agents' color, emoji
and vibe, and tools, model, author or anything else). A Codex TOML
role is not read. A skill's folder (one with SKILL.md) and .git,
.github and node_modules are skipped.
- Two files with one name: the shallower is taken, and the other is
listed as left out, with why. So is a file Subagent.check refuses.
- An imported subagent records its source and file (From) and a hash
of its description and prompt as imported (FromHash). Imported again,
a subagent from the same file is:
- have, when it is unchanged;
- update, when upstream changed and the library's copy still matches
FromHash (description and prompt replaced; agents, skills, servers
and model kept);
- edited, when the user changed it in magpie (left as it is).
- A name the library already uses for another subagent is never written
over: the import takes the next free name-N.
- A carried library carries From.
- The page has Select all, a filter past eight, a tag per state, the
files left out, and a summary of what was imported and updated.
i18n: zh, zh-TW, ja, de.
- The fixture is agency-agents' own files in
internal/library/testdata/agency-agents. No test reaches the network.
Run on 80ae5ba24, which is this change on
|
||
|
|
a68f114d9e |
lazyre: the plugin name and export file name regexps compile on first use (#6020)
|
||
|
|
6af54dc9a9 |
library: Claude Code plugins kept as one item, with a Claude plugins tab (FakeshadowzZ on X)
A Claude Code plugin (.claude-plugin/plugin.json, skills/, agents/, hooks/hooks.json, .mcp.json) can be installed into the Library from a folder, a git address or a marketplace.json, and is one row: turned on, off or removed as a whole, and given to the agents picked with the chips every tab has. Its skills, MCP servers, hooks and subagents are ordinary library items tagged Bundle: <plugin>, so each agent gets them through the code of its kind and the Skills, MCP servers, Hooks and Subagents tabs go on working. Off clears every part's agents and keeps them for on; Remove removes the parts. A part whose name the library has gets the plugin's name as a prefix, never over the user's own. Claude hook events and matchers map to the portable ones; others become claude:<Event>, for Claude Code only. Slash commands, LSP servers and non-command hooks are listed as not carried, not dropped. internal/library/plugin.go, POST /api/library/plugins/*, the Claude plugins tab in plugins/library/client.js (en, zh, zh-TW, ja, de), docs/subsystems/library.md. Run (mote): go test -tags nogui ./internal/library ./internal/gui ./internal/backup ./internal/davsync ok; gofmt clean; go vet darwin, linux (-tags nogui) and windows clean. GUI, chromium and webkit, en zh zh-TW ja de at 420 and 1100: library-plugins (new), library-hooks, library-subagents, i18n-keys, i18n-en-no-cjk, click-scroll all pass. Whole GUI suite started and cut short at ~460 of its tests: failing only account-dragging and accounts-sheet (routing, untouched by this), not compared on origin/main. Broken by hand: dropping the Off handling in givePlugin and the hookTakes filter each turned the new Go tests red. Not tried: a real Claude Code plugin from a marketplace, a git source (tests use folders), WSL, Windows. Not carried yet: commands/*.md, LSP servers, a plugin's folder across computers (a backup carries the parts, not the plugin record). |