Skip to content
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
49f7d8e
feat(sdk): support prefixed skill sources
johannes117 Jul 9, 2026
e7be26d
feat(code): add plugin marketplace support
johannes117 Jul 9, 2026
9205999
fix(sdk): expose `SkillSource` through agent APIs
johannes117 Jul 9, 2026
c730c04
Merge branch 'johannes117/sdk/prefixed-skill-sources' into johannes11…
johannes117 Jul 9, 2026
58e53b1
fix(sdk): preserve string-only skill source lists
johannes117 Jul 9, 2026
855853e
Merge branch 'johannes117/sdk/prefixed-skill-sources' into johannes11…
johannes117 Jul 9, 2026
137ffad
feat(sdk): reload skills when sources change
johannes117 Jul 9, 2026
04d7dca
Merge branch 'johannes117/sdk/skill-source-version' into johannes117/…
johannes117 Jul 9, 2026
7a8c156
feat(code): add marketplace removal flow
johannes117 Jul 9, 2026
bc791f4
fix(code): harden marketplace removal cleanup
johannes117 Jul 9, 2026
e04b3eb
Update libs/code/COMMANDS.md
johannes117 Jul 9, 2026
c27640c
cr
johannes117 Jul 10, 2026
8d50443
refactor(code): narrow plugin marketplace scope
johannes117 Jul 10, 2026
658f32d
cr
open-swe Jul 11, 2026
9678a70
fix(code): require HTTPS for marketplace sources
open-swe Jul 11, 2026
645be7b
chore(repo): merge main into plugin branch
johannes117 Jul 13, 2026
1222a02
chore(repo): merge main into plugin branch
johannes117 Jul 13, 2026
5e13e5b
cr
johannes117 Jul 13, 2026
9f6c217
refactor(code): adopt plugin manager UI structure
johannes117 Jul 14, 2026
7611cf8
refactor(code): namespace plugin skills without SDK changes
johannes117 Jul 14, 2026
20107f2
feat(code): namespace nested plugin skills and separate display names
johannes117 Jul 14, 2026
a023233
chore(code): merge main into plugin branch
johannes117 Jul 14, 2026
49b9ab0
docs(code): clarify plugin skill naming
johannes117 Jul 14, 2026
2f167d6
fix(code): load plugin MCP configs across runtimes
johannes117 Jul 14, 2026
8cf1530
fix(code): keep plugin MCP support scoped to dcode
johannes117 Jul 14, 2026
a85729c
cr
johannes117 Jul 14, 2026
deb3fa5
chore(code): merge main into plugin-management
johannes117 Jul 14, 2026
6c66ebe
fix(code): drop plugin manager `d` binding and load state async
johannes117 Jul 14, 2026
d1a9a54
Merge branch 'main' into johannes117/code/plugin-management
mdrxy Jul 14, 2026
df80b00
fix os.mkdir blocking bug
johannes117 Jul 14, 2026
841de5c
Merge branch 'johannes117/code/plugin-management' of https://github.c…
johannes117 Jul 14, 2026
f40c437
fix(code): annotate plugin MCP discovery mock return type
johannes117 Jul 14, 2026
b94e4a2
fix(code): harden plugin marketplace handling
johannes117 Jul 14, 2026
852afd8
Update libs/code/deepagents_code/plugins/discovery.py
johannes117 Jul 14, 2026
4d686e2
fix(code): route Shift+Tab to plugin manager previous tab
johannes117 Jul 14, 2026
1a3869e
fix(code): restore set_installed_plugin_enabled after bad suggestion
johannes117 Jul 14, 2026
3e7f4a2
fix(code): restyle add-marketplace prompt with example list
johannes117 Jul 14, 2026
4456b02
fix(code): let plugins modal overlay underlying content
johannes117 Jul 14, 2026
888b6a7
refactor(code): fold plugin reload into `/reload`
johannes117 Jul 15, 2026
de185c6
nit
mdrxy Jul 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libs/code/COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Regenerate this file with `make commands-catalog` after changing command names,
aliases, descriptions, visibility, or hidden-command metadata.


## Public (33)
## Public (35)

| Command | Aliases | Description |
| --- | --- | --- |
Expand All @@ -30,8 +30,10 @@ aliases, descriptions, visibility, or hidden-command metadata.
| `/model` | | Switch models or edit model settings |
| `/notifications` | | Configure startup warnings |
| `/offload` | `/compact` | Summarize and offload older messages to free context |
| `/plugins` | | Manage plugins (experimental; requires DEEPAGENTS_CODE_EXPERIMENTAL=1) |
| `/quit` | `/q` | Exit app |
| `/reload` | | Reload environment and config |
| `/reload-plugins` | | Reload installed plugins (experimental; requires DEEPAGENTS_CODE_EXPERIMENTAL=1) |
| `/remember` | | Save useful context to memory or skills |
| `/restart` | | Restart the agent server |
| `/rubric` | `/criteria` | Set explicit acceptance criteria for rubric grading |
Expand Down
9 changes: 9 additions & 0 deletions libs/code/deepagents_code/_env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@
flow. Parsed by `is_env_truthy`: accepts `1`, `true`, `yes`, `on` as enabled.
"""

PLUGIN_CACHE_DIR = "DEEPAGENTS_CODE_PLUGIN_CACHE_DIR"
"""Override the plugin install/marketplace cache root.

When unset, plugins are stored under `DEFAULT_CONFIG_DIR / "plugins"`.
"""

RESTARTED_AFTER_UPDATE = "DEEPAGENTS_CODE_RESTARTED_AFTER_UPDATE"
"""Internal sentinel recording the target version immediately before the
startup auto-update re-execs the process.
Expand Down Expand Up @@ -385,3 +391,6 @@ def is_env_truthy(name: str, *, default: bool = False) -> bool:
return default
classified = classify_env_bool(raw)
return default if classified is None else classified


EXPERIMENTAL_HINT = f"This feature is experimental. Set {EXPERIMENTAL}=1 to enable."
64 changes: 33 additions & 31 deletions libs/code/deepagents_code/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,9 @@
GRADER_SYSTEM_PROMPT,
FilesystemMiddleware,
MemoryMiddleware,
SkillsMiddleware,
SkillsMiddleware, # noqa: F401
)

# Backwards-compat flag: SDKs before 0.5.4 accept only `list[str]` for
# `SkillsMiddleware.sources`; newer SDKs expose the `SkillSource` alias
# that permits `(path, label)` tuples. The `skills` module is already
# loaded by the `SkillsMiddleware` import above, so the extra lookup
# here adds no startup cost.
try:
from deepagents.middleware.skills import SkillSource as _SkillSource # noqa: F401
except ImportError:
_SUPPORTS_SKILL_SOURCE_TUPLES = False
else:
_SUPPORTS_SKILL_SOURCE_TUPLES = True

if TYPE_CHECKING:
from collections.abc import Awaitable, Callable, Sequence

Expand All @@ -55,6 +43,7 @@

from deepagents_code.mcp_tools import MCPServerInfo
from deepagents_code.output import OutputFormat
from deepagents_code.plugins.adapters.skills import CodeSkillSource

from langchain.agents.middleware import TodoListMiddleware
from langchain.agents.middleware.types import AgentMiddleware
Expand Down Expand Up @@ -88,6 +77,7 @@
)
from deepagents_code.offload import _offload_fallback_root
from deepagents_code.offload_middleware import _create_cli_compaction_middleware
from deepagents_code.plugins.adapters.skills_middleware import PluginSkillsMiddleware
from deepagents_code.project_utils import ProjectContext, get_server_project_context
from deepagents_code.reliable_rubric import ReliableRubricMiddleware
from deepagents_code.subagents import list_subagents
Expand Down Expand Up @@ -1746,17 +1736,35 @@ def _subagent_cli_middleware(*, has_explicit_model: bool) -> list[AgentMiddlewar
# Add skills middleware
if enable_skills:
# Lowest to highest precedence:
# built-in -> user .deepagents -> user .agents
# built-in -> plugins -> user .deepagents -> user .agents
# -> project .deepagents -> project .agents
# -> user .claude (experimental) -> project .claude (experimental)
# Labels disambiguate user- vs project-scoped sources that share a
# `.../skills` leaf; the middleware would otherwise derive identical
# labels from the parent directory name.
sources: list[tuple[str, str]] = [
# Plugin skills are namespaced as `{plugin_id}:{skill_name}` to avoid
# collisions between plugins and user/project skills.
sources: list[CodeSkillSource] = [
(str(settings.get_built_in_skills_dir()), "Built-in"),
(str(skills_dir), "User Deepagents"),
(str(user_agent_skills_dir), "User Agents"),
]
try:
Comment thread
johannes117 marked this conversation as resolved.
Resolved
if is_env_truthy(EXPERIMENTAL):
from deepagents_code.plugins import discover_plugins
from deepagents_code.plugins.adapters.skills import (
plugin_skill_sources,
)

plugin_result = discover_plugins()
if plugin_result.warnings:
logger.warning(
"Plugin discovery warnings: %s", plugin_result.warnings
)
sources.extend(plugin_skill_sources(plugin_result.plugins))
except Exception:
logger.warning("Could not discover plugin skills", exc_info=True)
sources.extend(
[
(str(skills_dir), "User Deepagents"),
(str(user_agent_skills_dir), "User Agents"),
]
)
if project_skills_dir:
sources.append((str(project_skills_dir), "Project Deepagents"))
if project_agent_skills_dir:
Expand All @@ -1770,19 +1778,13 @@ def _subagent_cli_middleware(*, has_explicit_model: bool) -> list[AgentMiddlewar
if project_claude_skills_dir:
sources.append((str(project_claude_skills_dir), "Project Claude"))

# Backwards-compat: strip labels when the installed SDK is too old
# to accept `(path, label)` tuples. Label-based disambiguation
# regresses to the pre-alias behavior (user- and project-scoped
# `.claude/skills` collapse to the same label), but functionality
# is preserved.
middleware_sources: Sequence[str | tuple[str, str]] = (
sources if _SUPPORTS_SKILL_SOURCE_TUPLES else [path for path, _ in sources]
)

# `PluginSkillsMiddleware` namespaces plugin skills before dedup while
# behaving like the SDK middleware when no plugin namespaces are
# present, so it is safe to use for all skill sources.
agent_middleware.append(
SkillsMiddleware(
PluginSkillsMiddleware(
backend=FilesystemBackend(virtual_mode=False),
sources=middleware_sources,
sources=sources,
)
)

Expand Down
135 changes: 121 additions & 14 deletions libs/code/deepagents_code/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3364,12 +3364,12 @@ async def on_mount(self) -> None:
# Apply any skill commands discovered before the widget was mounted
if self._discovered_skills:
from deepagents_code.command_registry import (
SLASH_COMMANDS,
build_skill_commands,
get_slash_commands,
)

cmds = build_skill_commands(self._discovered_skills)
merged = list(SLASH_COMMANDS) + cmds
merged = list(get_slash_commands()) + cmds
self._chat_input.update_slash_commands(merged)

# Set initial auto-approve state
Expand Down Expand Up @@ -3993,8 +3993,8 @@ async def _discover_skills(self) -> bool:
simply ignore the result.
"""
from deepagents_code.command_registry import (
SLASH_COMMANDS,
build_skill_commands,
get_slash_commands,
)

try:
Expand Down Expand Up @@ -4035,7 +4035,7 @@ async def _discover_skills(self) -> bool:
if skills:
skill_commands = build_skill_commands(skills)
if self._chat_input:
merged = list(SLASH_COMMANDS) + skill_commands
merged = list(get_slash_commands()) + skill_commands
self._chat_input.update_slash_commands(merged)
else:
logger.debug(
Expand All @@ -4057,10 +4057,20 @@ def _discover_skills_and_roots(
Returns:
Tuple of `(skill metadata list, pre-resolved containment roots)`.
"""
from deepagents_code.plugins.adapters.skills import (
discover_plugin_skill_sources_and_roots,
)
from deepagents_code.skills.invocation import discover_skills_and_roots

assistant_id = self._assistant_id or DEFAULT_ASSISTANT_ID
return discover_skills_and_roots(assistant_id)
plugin_skill_sources, plugin_skill_roots = (
discover_plugin_skill_sources_and_roots()
)
return discover_skills_and_roots(
assistant_id,
plugin_skill_sources=plugin_skill_sources,
plugin_skill_roots=plugin_skill_roots,
)

def _discover_skills_and_roots_with_import_lock(
self,
Expand Down Expand Up @@ -10776,16 +10786,14 @@ async def _handle_command(self, command: str) -> None:
self.exit()
elif cmd == "/help":
await self._mount_message(UserMessage(command))
from deepagents_code.command_registry import get_slash_commands

command_names = ", ".join(
f"{entry.name} {entry.argument_hint}".rstrip()
for entry in get_slash_commands()
)
help_body = (
"Commands: /quit, /agents, /auth, /clear, /force-clear, "
"/copy, /goal, /offload, /editor, /effort, "
"/mcp, /model [--model-params JSON] [--default], "
"/notifications, /reload, /restart, /rubric, "
"/skill:<name>, /remember, "
"/skill-creator, /theme, /scrollbar, /timestamps, /tokens, "
"/tools, /threads, /trace, "
"/update, /auto-update, /install, /changelog, /docs, "
"/feedback, /help\n\n"
f"Commands: {command_names}, /skill:<name>\n\n"
Comment thread
johannes117 marked this conversation as resolved.
Resolved
"Interactive Features:\n"
" Enter Submit your message\n"
f" {newline_shortcut():<15} Insert newline\n"
Expand Down Expand Up @@ -11051,6 +11059,30 @@ async def _handle_command(self, command: str) -> None:
args = command.strip()[len("/mcp ") :].strip()
await self._mount_message(UserMessage(command))
await self._handle_mcp_subcommand(args)
elif cmd == "/plugins":
Comment thread
johannes117 marked this conversation as resolved.
Resolved
await self._mount_message(UserMessage(command))
from deepagents_code._env_vars import (
EXPERIMENTAL,
EXPERIMENTAL_HINT,
is_env_truthy,
)

if not is_env_truthy(EXPERIMENTAL):
await self._mount_message(AppMessage(EXPERIMENTAL_HINT))
return
await self._show_plugin_manager()
elif cmd == "/reload-plugins":
from deepagents_code._env_vars import (
EXPERIMENTAL,
EXPERIMENTAL_HINT,
is_env_truthy,
)

if not is_env_truthy(EXPERIMENTAL):
await self._mount_message(UserMessage(command))
await self._mount_message(AppMessage(EXPERIMENTAL_HINT))
return
await self._handle_reload_plugins_command(command)
elif cmd in {"/auth", "/connect"}:
await self._show_auth_manager()
elif cmd == "/theme":
Expand Down Expand Up @@ -16811,6 +16843,81 @@ async def _run_debug_update_install(
markup=False,
)

async def _handle_reload_plugins_command(self, command: str) -> None:
"""Reload plugin skills and rebuild the agent for plugin MCP.

Args:
command: Raw command string for echoing back to chat.
"""
await self._mount_message(UserMessage(command))

from deepagents_code.plugins import discover_plugins
from deepagents_code.plugins.adapters.mcp import plugin_mcp_configs

old_skill_names = {s["name"] for s in self._discovered_skills}
plugin_result = discover_plugins()
plugin_count = len(plugin_result.plugins)
mcp_configs = plugin_mcp_configs(plugin_result.plugins)
mcp_count = sum(
len(servers)
for config in mcp_configs
if isinstance((servers := config.get("mcpServers")), dict)
)

skill_worker = self.run_worker(
self._discover_skills(),
exclusive=True,
group="startup-skill-discovery",
)
await skill_worker.wait()
discovery_ok = skill_worker.result is True
new_skill_names = {s["name"] for s in self._discovered_skills}
plugin_skill_names = sorted(name for name in new_skill_names if ":" in name)
added_skills = sorted(new_skill_names - old_skill_names)
removed_skills = sorted(old_skill_names - new_skill_names)

restarted = False
if self._server_proc is not None and self._server_kwargs is not None:
if self._agent_running and self._agent_worker:
self._cancel_worker(self._agent_worker)
self._agent_running = False
else:
self._discard_queue()
if await self._reload_configuration_for_restart():
restarted = await self._restart_server_manual()

skill_count = len(plugin_skill_names)
parts = [
f"{plugin_count} plugin{'s' if plugin_count != 1 else ''}",
f"{skill_count} skill{'s' if skill_count != 1 else ''}",
f"{mcp_count} plugin MCP server{'s' if mcp_count != 1 else ''}",
]
report = f"Reloaded: {' · '.join(parts)}"
if not discovery_ok:
report += "\nSkill re-discovery failed; existing /skill: list left as-is."
elif added_skills or removed_skills:
skill_lines = []
if added_skills:
skill_lines.append(f" - Added: {', '.join(added_skills)}")
if removed_skills:
skill_lines.append(f" - Removed: {', '.join(removed_skills)}")
report += "\nSkills updated:\n" + "\n".join(skill_lines)
if plugin_result.warnings:
report += f"\n{len(plugin_result.warnings)} warning(s) during load."
if self._server_proc is not None and not restarted:
report += "\nAgent server was not restarted; MCP may be stale."
await self._mount_message(AppMessage(report))

async def _show_plugin_manager(self) -> None:
"""Open the interactive plugin manager."""
from deepagents_code.tui.modals.plugin_manager import PluginManagerScreen

self.push_screen(
PluginManagerScreen(
mcp_server_info=self._mcp_server_info or [],
)
)

async def _handle_mcp_subcommand(self, args: str) -> None:
"""Dispatch `/mcp <subcommand>` strings.

Expand Down
20 changes: 17 additions & 3 deletions libs/code/deepagents_code/client/non_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@

if TYPE_CHECKING:
from asyncio.subprocess import Process
from pathlib import Path

from langchain_core.runnables import RunnableConfig

Expand Down Expand Up @@ -1450,16 +1451,29 @@ async def run_non_interactive(
build_skill_invocation_envelope,
discover_skills_and_roots,
)
from deepagents_code.skills.load import load_skill_content
from deepagents_code.skills.load import (
ExtendedSkillMetadata,
load_skill_content,
)

normalized_skill = initial_skill.strip().lower()
try:
# Offloaded to a thread: discovery does blocking filesystem I/O
# (a JSON trust-store read plus `Path.resolve()` calls) that must
# not block the event loop.
skills, allowed_roots = await asyncio.to_thread(
discover_skills_and_roots, assistant_id
from deepagents_code.plugins.adapters.skills import (
discover_plugin_skill_sources_and_roots,
)

def discover_all_skills() -> tuple[list[ExtendedSkillMetadata], list[Path]]:
plugin_sources, plugin_roots = discover_plugin_skill_sources_and_roots()
return discover_skills_and_roots(
assistant_id,
plugin_skill_sources=plugin_sources,
plugin_skill_roots=plugin_roots,
)

skills, allowed_roots = await asyncio.to_thread(discover_all_skills)
skill = next((s for s in skills if s["name"] == normalized_skill), None)
except OSError as e:
console.print(
Expand Down
Loading