feat(plugins): entry-point plugin architecture for tasks and agents (#59)#84
feat(plugins): entry-point plugin architecture for tasks and agents (#59)#84trixy-the-ai-bot wants to merge 3 commits into
Conversation
…ts (#59) Replaces hard-coded TASK_CLASSES and agents lists with a dynamic plugin discovery system using importlib.metadata entry points. New modules: - loony_dev/plugins/base.py: TaskPlugin and AgentPlugin ABCs, PluginConflictError - loony_dev/plugins/loader.py: entry-point discovery with per-plugin failure isolation and loud conflict detection (name clashes, duplicate task_type) - loony_dev/tasks/plugins.py: GithubTaskPlugin wrapping all six built-in task classes - loony_dev/agents/plugins.py: ClaudeAgentPlugin wrapping NullAgent, CodingAgent, PlanningAgent Modified: - orchestrator.py: accepts injected task_classes list; removed hard-coded TASK_CLASSES - cli.py: calls load_task_plugins() / load_agent_plugins() instead of hard-coded lists - pyproject.toml: registers loony_dev.task_plugins and loony_dev.agent_plugins entry point groups Third-party plugin authors can now add tasks and agents by declaring entry points in their own pyproject.toml and running pip install -e . For local development without reinstalling, set LOONY_DEV_EXTRA_PLUGINS=module:Class. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Merge conflicts resolved. A merge conflict in |
|
Merge conflicts resolved. The merge conflict in |
Summary
Implements the plugin architecture described in #59 using Python's
importlib.metadataentry points.loony_dev/plugins/base.py—TaskPluginandAgentPluginABCs plusPluginConflictErrorloony_dev/plugins/loader.py— discovers plugins from entry point groupsloony_dev.task_pluginsandloony_dev.agent_plugins; isolates per-plugin load failures; raises loudly on name or task-type conflictsloony_dev/tasks/plugins.py—GithubTaskPluginwrapping all six built-in task classesloony_dev/agents/plugins.py—ClaudeAgentPluginwrappingNullAgent,CodingAgent,PlanningAgentorchestrator.py—Orchestratornow accepts an injectedtask_classeslist; hard-codedTASK_CLASSESremovedcli.py—workercommand callsload_task_plugins()/load_agent_plugins()instead of hard-coded listspyproject.toml— registers built-ingithubandclaudeplugins under the new entry point groupsPlugin authoring workflow
pyproject.tomldeclaring the entry point groupTask/Agentfromloony_devTaskPluginorAgentPluginuv pip install -e .— theloony-dev workercommand auto-discovers itFor iteration without reinstalling: set
LOONY_DEV_EXTRA_PLUGINS=module:ClassName.Test plan
load_task_plugins()returns all six built-in task classes in priority orderload_agent_plugins()returnsNullAgent,CodingAgent,PlanningAgentTaskPluginandAgentPluginABCs enforcenameand primary method as abstractPluginConflictErroris anExceptionsubclassuv pip install -e .registers entry points; verified with liveimportlib.metadata.entry_points()Closes #59
🤖 Generated with Claude Code