Skip to content

feat: plugin manager#12

Open
midweste wants to merge 2 commits intogiancarloerra:mainfrom
midweste:midweste-pluginmanager
Open

feat: plugin manager#12
midweste wants to merge 2 commits intogiancarloerra:mainfrom
midweste:midweste-pluginmanager

Conversation

@midweste
Copy link

Summary

Adds a PluginManager class that enables SocratiCode to be extended via self-contained plugins without modifying core code. Plugins are auto-discovered from src/plugins/*/index.ts at startup and receive lifecycle hooks. All plugin errors are non-fatal — a failing plugin never affects the indexer.

SocratiCode gives AI agents context about what code does and how it's structured. Plugins extend that context with knowledge that can't be extracted from source files alone — things like why code was written a certain way, which parts of the codebase are most volatile, or what implicit dependencies exist between components. This additional context is stored alongside the existing index and surfaced automatically during search, giving AI agents a deeper understanding of the project without any changes to the core.

Changes

  • [NEW] src/services/plugin.ts — PluginManager class with auto-discovery, registration, lifecycle dispatch, and non-fatal error isolation
  • [NEW] src/plugins/README.md — Plugin convention docs: folder structure, interface, and how to create a plugin
  • [NEW] tests/unit/plugin.test.ts — 12 tests covering registration, hook dispatch, error isolation, and shutdown

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Test coverage improvement

Testing

  • Unit tests pass (npm run test:unit)
  • Integration tests pass (npm run test:integration) — if applicable
  • TypeScript compiles cleanly (npx tsc --noEmit)
  • New tests added for new/changed functionality

12 tests covering: plugin registration, hook dispatch order, non-fatal error isolation, onProgress forwarding, shutdown resilience, and test reset. No plugins directory = gracefully skipped.

Checklist

  • My code follows the existing code style and conventions
  • I have added/updated JSDoc comments where appropriate
  • I have updated documentation (README.md / DEVELOPER.md) if needed
  • I have read the Contributing Guide
  • I agree to the Contributor License Agreement

Related issues

None

@midweste midweste changed the title Midweste pluginmanager Plugin Manager Mar 17, 2026
@midweste midweste changed the title Plugin Manager feat: plugin manager Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant