Repository navigation
plugins: read plugins in the .claude-plugin layout as incode plugins - #83
Merged
Merged
Conversation
A folder with .claude-plugin/plugin.json and no plugin.toml now installs
and loads as an incode plugin, so its parts serve every agent incode
drives (claude, codex, agy, the API route), not one CLI:
- manifest: name/version/description from plugin.json
- commands/, skills/ as before; agents/ now loaded for every plugin, as
<plugin>:<agent> (subagents::load); `model: inherit` means the parent's
- hooks/hooks.json (or plugin.json `hooks`, a path inside the folder or
the object) translated to incode's events; tool matchers kept, with
mcp__plugin_<p>_<s>__ renamed to incode's mcp__<p>_<s>__; SessionStart
and PreCompact matchers weighed against startup/manual; what incode
cannot run (prompt hooks, unknown events, bad matchers) left out and
listed by `incode plugin list`
- .mcp.json (or plugin.json `mcpServers`), bare map or mcpServers, built
by mcp_config::ServerEntry::to_spec with ${CLAUDE_PLUGIN_ROOT}
hooks::HookCommand replaces the plain command string: an optional
matcher (also accepted in admin.json and incode's own hooks.json as
{"command", "matcher"}), the plugin's folder in CLAUDE_PLUGIN_ROOT and
INCODE_PLUGIN_ROOT, and a posix flag that runs the command in the Bash
tool's Git Bash on Windows instead of cmd.
Tested: 9 new tests; six controls (matcher filter, Git Bash path, cmd
root fill, matcher rename, path-inside check, inherit) each failed its
test on the intended assertion and were restored byte-identical. Lib
2444 + bin 59 pass, clippy -D warnings and fmt clean (Windows).
blockmandev
added a commit
that referenced
this pull request
Nov 15, 2026
…ls and PluginCall (#99) * plugins: the memory engine's plugin tool servers offered as PluginTools and PluginCall The second half of the Claude-plugins work (the first, reading plugins in the .claude-plugin layout, is #83). The owner's decision of 2026-10-30: build the incode side now, tested against a fake engine, and say plainly when a plugin's server answers 401 (blocked on sign-in) instead of failing silently. - The memory engine runs plugin MCP servers for the owner. A session asks it once for the index (incord_describe) and offers two tools: PluginTools (one line per server; a server's tools on request) and PluginCall (run one). An index, not every tool, per the engine owner's decision: every plugin's tools in the context cost 8,029 tokens more. - Both are Reach::Run, like every MCP tool: refused read-only, asked under prompt, refused when the engine cannot decide. - A server a local plugin already runs is left out of the index, so no server is started twice. Plugin skills are read from the engine too. - Not offered when the engine names no servers or does not answer. This was left uncommitted on 2026-10-30 in the claude-plugins worktree; it is ported onto current main (the one conflict was the module list in toolbox/mod.rs after #96). cargo clippy --all-targets: clean. cargo test --lib: 2290 passed, 0 failed, including the 5 engine_plugins tests against a fake engine. The ignored live test against the real engine passed here: it described the inbrowse server's 43 tools. * plugins: engine_plugins_tests formatted with rustfmt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A folder with
.claude-plugin/plugin.jsonand noplugin.tomlnow installs (incode plugin add) and loads as an incode plugin. Its commands, skills, sub-agents, hooks and MCP servers then serve every agent incode drives (claude, codex, agy, the API route), because incode runs them itself.What is read
.claude-plugin/plugin.jsonname/version/descriptioncommands/,skills/agents/*.md<plugin>:<agent>(new for both layouts);model: inherit= parent's modelhooks/hooks.json, orplugin.jsonhooks(path inside the folder, or the object).mcp.json, orplugin.jsonmcpServers(bare map ormcpServers)mcp_config::ServerEntry::to_spec(${VAR},${VAR:-default})${CLAUDE_PLUGIN_ROOT}Hooks
hooks::HookCommandreplaces the plain command string: optionalmatcher(a regex on the whole tool name; also accepted inadmin.json/ incodehooks.jsonas{"command","matcher"}— plain strings still read and written as before), the plugin's folder inCLAUDE_PLUGIN_ROOTandINCODE_PLUGIN_ROOT, and aposixflag that runs the command in the Bash tool's Git Bash on Windows (falls back tocmd /Cwith the folder written into the text when there is none).mcp__plugin_<p>_<s>__renamed to incode'smcp__<p>_<s>__.SessionStart/PreCompactmatchers are weighed against incode'sstartup/manual. Left out and listed byincode plugin list:prompt/agenthooks, events incode has no point for,Notificationhooks with a matcher, bad matchers, andplugin.jsonkeys incode does not read.${INCODE_PLUGIN_ROOT}is now filled in every event's commands (it was pre/post tool only).Not done / limits
timeoutis not read: every hook stays bounded atHOOK_TIMEOUT(10 s).plugin.jsonand marketplaces are not supported.toolsnames a tool incode lacks (e.g.Task) is left out and said by/agents, as for the operator's own.incode plugin approve; a project plugin still gets only tool hooks.Tested (Windows)
plugin.jsonpaths stay inside the folder,plugin.tomlwins, matcher runs only for named tools, plugin folder in the hook environment, POSIX hook runs in Git Bash,admin.jsonround trip, plugin agents named andinherit.inherit) each failed its test on the intended assertion; restore byte-identical.cargo test --lib --bins: 2444 + 59 pass;clippy --all-targets -D warningsandfmt --checkclean.