Skip to content

Conversation

@hl4b-hal
Copy link
Collaborator

@hl4b-hal hl4b-hal commented Feb 4, 2026

This PR implements the new plugin architecture v2 with ZIP-based distribution, hook system, and automated build tooling.

Changes

New Features

Manifest System

  • Added manifest/manifest.go - Package for parsing and validating manifest.json files
  • Support for plugin metadata, hooks, components, and permissions
  • Validation helpers (HasHook, HasComponent, HasPermission)

Extended Plugin Interface

  • Added Hooks field to Plugin struct for hook handlers
  • Added Permissions field for permission management
  • Added HookHandler type: func(ctx context.Context, args map[string]interface{}) error
  • Added HookRegistry with:
    • RegisterHook(pluginID, hookName, priority, handler)
    • UnregisterHooks(pluginID)
    • GetHooks(hookName) - returns sorted by priority
    • ExecuteHooks(hookName, args) - executes all handlers

Component Enhancements

  • Added Slug field to Component for unique identification
  • Added Properties field for configurable component properties
  • Added PropertyType constants (String, Int, Bool, List)

Build System

  • Added Makefile with targets:
    • make test - Runs all tests (required before build)
    • make build - Compiles and packages plugin
    • make checksum - Generates SHA-256 checksum
    • make sign - Generates GPG signature (optional)
    • make clean - Removes build artifacts

CI/CD

  • Added .github/workflows/ci.yml - Runs tests on push/PR
  • Added .github/workflows/release.yml - Builds and releases on tag creation
  • Both workflows enforce test pass before build

Documentation

  • Complete rewrite of README.md with:
    • New plugin creation guide
    • Manifest.json schema reference
    • Hook system documentation
    • Build and verification instructions
    • API reference

Files Added

  • manifest/manifest.go - Manifest parsing package
  • Makefile - Build automation
  • .github/workflows/ci.yml - CI pipeline
  • .github/workflows/release.yml - Release pipeline

Files Modified

  • components/model.go - Added Slug and Properties fields
  • plugins/general.go - Extended Plugin struct, added HookRegistry
  • README.md - Comprehensive documentation

Backward Compatibility

This is a breaking change for the plugin architecture. Existing plugins will need to be updated to:

  • Add manifest.json to their package
  • Export GetPlugins() function
  • Use the new Plugin struct format

Testing

All tests must pass before building:

make test  # or `make all` to run tests + build

Verification

Users can verify plugin integrity:

sha256sum -c my-plugin-1.0.0.zip.sha256
gpg --verify my-plugin-1.0.0.zip.asc my-plugin-1.0.0.zip

Related Issues


Contributors: @hl4b-hal

@InvertedBit
Copy link
Owner

This still needs some work. See that all unit tests pass.
Also, I realized that we need a way for GMS to register and forward specific REST requests to the Plugins/Components.

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.

2 participants