-
Notifications
You must be signed in to change notification settings - Fork 449
feat: add experimental plugin / extension system #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bunasQ
commented
Jan 19, 2026
@1code pls look at PR, study my codebase, and tell me how does this PR affects codebase, and what's the purpose of it and how is it aligned with existing codebase
Task completed.
Perfect! Now I have a complete understanding of the PR. Let me provide a comprehensive analysis:
Analysis of PR #28: Experimental Plugin System
I've reviewed the PR branch and code changes. Here's what I found:
What This PR Actually Does
The PR adds a minimal, isolated plugin architecture to your codebase. Importantly:
✅ It's non-invasive - The plugin system is completely standalone and not integrated into your existing codebase
✅ No breaking changes - Zero modifications to your core application logic
✅ Pure infrastructure - Just sets up the foundation for future extensibility
Code Added (4 files in src/shared/plugins/)
-
plugin.ts- Core interfaces:OneCodePlugin- Plugin metadata (id, name, version) + activate hookPluginContext- API for plugins to interact with the app (currently onlyregisterCommand)PluginCommand- Simple command interface (id, title, run function)
-
pluginManager.ts- Plugin lifecycle manager:load(plugin)- Activates a plugin and registers its commandsgetCommands()- Returns all registered commands- Uses a Map to store commands by ID
-
samplePlugin.ts- Example plugin:- Registers a "Say Hello" command that logs to console
- Demonstrates the plugin API
-
index.ts- Creates global instance:export const pluginManager = new PluginManager(); pluginManager.load(SamplePlugin);
Current State: Not Integrated
I searched the entire codebase - nothing imports or uses the plugin system yet. It's purely scaffolding for future work. The pluginManager instance is created but never referenced.
Alignment with Your Codebase
Architecture Fit:
- ✅ Follows your patterns - Located in
src/shared/like other cross-cutting code - ✅ TypeScript-first - Strongly typed interfaces
- ✅ Simple & minimal - ~60 lines of code total
- ✅ Extensible design - Easy to add more lifecycle hooks later
Potential Integration Points (not yet implemented):
- Could expose slash commands like
/plan,/agent,/clearas plugin commands - Could integrate with
src/renderer/features/agents/commands/system - Could allow plugins to register tool renderers in
agent-tool-registry.tsx - Could hook into tRPC routers to add custom backend functionality
The Purpose
From the PR description: Enable "community-driven extensions (linters, formatters, AI tools) without modifying core logic."
This is a forward-looking feature that would allow:
- External developers to add functionality via plugins
- Internal experiments without touching core code
- Modular features that can be enabled/disabled
My Assessment
Pros:
- Clean, minimal implementation
- No risk to existing functionality
- Good foundation for future extensibility
- Follows VS Code-style plugin architecture
Cons:
- Dead code currently - Not used anywhere, so it's just adding unused files
- Incomplete - No documentation on how to integrate it
- Missing critical pieces:
- No plugin discovery/loading from external files
- No error handling in plugin activation
- No way to actually execute registered commands in UI
- No lifecycle hooks beyond activation (deactivate, update, etc.)
- No access to app context (workspace, chat, file system, etc.)
Questions Before Merging:
- Do you want to merge this as foundation for future work, or wait until it's actually integrated?
- Should there be a roadmap for how this will be used?
- Do you want plugin discovery (loading from disk) or just hardcoded plugins?
- How should plugins access your Electron APIs, tRPC routers, and file system?
Bottom Line: This PR adds a well-structured but currently unused plugin system. It's safe to merge (no side effects), but it's essentially scaffolding waiting for integration work. Whether to merge depends on if you want to commit to the plugin architecture direction.
Powered by 1Code
Devatva24
commented
Jan 21, 2026
Thanks for the detailed review and questions! Here’s my take:
-
Merge now or wait?
I suggest merging now as a safe foundation. It’s non-invasive and won’t affect existing functionality. We can incrementally integrate plugin execution and discovery in future PRs. -
Roadmap for usage?
Yes, a roadmap would be helpful:- Phase 1: Register and execute basic commands via plugins
- Phase 2: Support plugin discovery from disk/external sources
- Phase 3: Integrate plugins with Electron APIs, tRPC routers, and workspace context
- Phase 4: Extend lifecycle hooks (activate, deactivate, update) and add error handling
-
Plugin discovery: disk or hardcoded?
Start with hardcoded plugins for testing. Later, implement dynamic discovery from aplugins/folder or npm-style packages. -
Access to Electron APIs, tRPC, filesystem?
Expose these safely via thePluginContextinterface. For example, provide controlled methods likeregisterCommand,getWorkspaceFile, orcallTRPCRouterso plugins can interact without direct access to internal objects.
Overall, this PR can serve as a clean, non-breaking foundation for future extensibility.
Summary
Adds a minimal plugin architecture that allows registering commands via plugins.
Details
Motivation
Enables community-driven extensions (linters, formatters, AI tools) without modifying core logic.