refactor(agents): replace built-in LangGraph agent with OpenCode binary + add plugin system#121
Open
refactor(agents): replace built-in LangGraph agent with OpenCode binary + add plugin system#121
Conversation
Add a complete plugin system that enables skill sharing via plugins: - Plugin discovery, loading, and registry (PluginRegistry, PluginLoader) - Marketplace integration with Anthropic's claude-plugins-official repo - Plugin CLI commands: list, install, uninstall, update, search, info - Skill discovery from plugins with namespaced pattern support (/plugin:skill) - Compatible with Claude Code's .claude-plugin/plugin.json format The plugin system allows users to: - Search and install plugins from the official Anthropic marketplace - Discover skills from installed plugins automatically - Use namespaced skill invocation (e.g., /example-plugin:example-skill) - Manage plugins via `codemie plugin` CLI commands Generated with AI Co-Authored-By: AI/Run CodeMie <noreply@codemieai.com>
fc53203 to
b99a4ca
Compare
…mprovements - Add path traversal protection via validatePluginName and isPathWithinDirectory checks - Replace silent catch blocks with logger.debug() for consistent error diagnostics - Migrate console.error to logger.error in MarketplaceClient - Fix broken dynamic import of exec.js with static import from processes.ts - Improve type safety by replacing `as any` with proper ReadableStream type - Add null check for response.body before Readable.fromWeb - Parallelize dev plugin discovery with Promise.all instead of sequential await Generated with AI Co-Authored-By: AI/Run CodeMie <noreply@codemieai.com>
…binary wrapper codemie-code now wraps the @codemieai/codemie-opencode binary via BaseAgentAdapter instead of using the built-in LangGraph ReAct agent. Reuses lifecycle hooks from CodemieOpenCodePluginMetadata (beforeRun, enrichArgs) with agent-specific onSessionEnd for metrics (clientType: 'codemie-code'). Updates CLI --task shortcut to use registry dispatch and removes init command guard for the built-in agent. Generated with AI Co-Authored-By: AI/Run CodeMie <codemie.ai@gmail.com>
Cover plugin validation, binary resolution, registry singleton, plugin classes, and lifecycle hooks (beforeRun, enrichArgs, onSessionEnd) with 95 tests across 6 new test files. Generated with AI Co-Authored-By: AI/Run CodeMie <codemie.ai@gmail.com>
Generated with AI Co-Authored-By: AI/Run CodeMie <codemie.ai@gmail.com>
Resolved conflict in src/cli/commands/hook.ts: kept both the config parameter addition to sendSessionStartMetrics (from main) and the syncSkillsToClaude call + function (from this branch). Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
Normalize path separators in isPathWithinDirectory mocks instead of using naive startsWith comparison, which fails on Windows where path.join() produces backslash paths. Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
DRY up duplicated path normalization logic into a single mockIsPathWithin constant reused by both vi.mock factory and beforeEach. Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
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.
Summary
@codemieai/codemie-opencodebinary viaBaseAgentAdapter, reusing lifecycle hooks (beforeRun,enrichArgs,onSessionEnd) with agent-specific metrics (clientType: 'codemie-code')Key Changes
OpenCode Integration
codemie-codenow delegates to@codemieai/codemie-opencode(v0.0.41) instead of running its own LangGraph agentcodemie-opencode.plugin.tswith binary resolution, lifecycle hooks, and session metrics--taskshortcut updated to use registry dispatchinitcommand guard for the built-in agentPlugin System
PluginRegistry,PluginLoader,PluginDiscovery,PluginManifestParserfor discovering/loading plugins from~/.codemie/plugins/MarketplaceClient,MarketplaceRegistry,PluginInstallerfor GitHub-based plugin marketplaces (default:anthropics/claude-plugins-official)codemie plugincommands —list,install,uninstall,update,search,infoSkillDiscoveryto load skills from installed plugins with namespaced/plugin:skillpatternTesting
Test plan
codemieCLI launches the OpenCode binary instead of the old LangGraph agentcodemie plugin list/install/searchcommands work/plugin:skill) resolves correctlynpm test— all unit tests pass