Skip to main content

Plugin infrastructure for Kollabor

Project description

kollabor-plugins

kollabor-plugins is the plugin framework for Kollabor.

It provides plugin discovery, safe instantiation, lifecycle management, status collection, the base plugin class, and SDK helpers. Concrete plugins live in the repo-level plugins/ directory or installed package plugin locations.

Current Role

  • Discover plugin classes from development and installed plugin directories.
  • Instantiate plugins with shared dependencies such as event bus, config, and services.
  • Provide a stable BasePlugin lifecycle for initialization, hook registration, status, config widgets, and shutdown.
  • Collect plugin startup/status information without crashing the host app.
  • Provide utility helpers for safe optional-method calls.

Architecture

Module Responsibility
base.py BasePlugin lifecycle and default methods
discovery.py plugin class discovery
factory.py dependency-aware plugin construction
registry.py plugin registration and lifecycle registry
collector.py status/startup info collection
plugin_sdk.py helper API for plugin authors
plugin_utils.py safe calls, metadata, interface validation

Plugin Shape

from kollabor_plugins import BasePlugin


class MyPlugin(BasePlugin):
    name = "my_plugin"
    version = "1.0.0"
    description = "Adds one useful thing"

    async def initialize(self, args=None, **kwargs):
        return None

    async def register_hooks(self):
        return None

    async def shutdown(self):
        return None

Discovery order:

  1. ./plugins/
  2. Installed package plugin locations.

Lifecycle:

  1. Discover plugin classes.
  2. Instantiate with dependencies.
  3. Call initialize().
  4. Call register_hooks().
  5. Call shutdown() on app exit.

Known Gaps

  • Plugin metadata and config schemas are partly convention-based; stronger typed metadata would help UI and docs generation.
  • Discovery order and dependency injection behavior should be covered by more integration tests across local and installed plugin layouts.
  • Plugin shutdown must remain best-effort and non-blocking; long-running plugin tasks need clearer ownership and cancellation guidance.

Roadmap

Phase 1: Authoring clarity

  • Add a plugin author guide generated from real BasePlugin methods.
  • Document config widget and status-line conventions.
  • Add examples for hook-only, command, fullscreen, and background-task plugins.

Phase 2: Lifecycle hardening

  • Add tests for plugin discovery, instantiation failures, and shutdown failures.
  • Track plugin-owned tasks/resources explicitly.
  • Make startup/status collection easier to inspect from CLI and engine surfaces.

Phase 3: Packaging and marketplace readiness

  • Normalize plugin metadata fields for installed packages.
  • Document compatibility/version expectations for plugins.
  • Prepare a stable manifest format if plugins move toward external distribution.

Development

Targeted validation examples:

python -m py_compile packages/kollabor-plugins/src/kollabor_plugins/*.py
python -m pytest tests/unit/commands/test_all_command_handlers.py -q

Dependencies

  • kollabor-events

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kollabor_plugins-1.0.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kollabor_plugins-1.0.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file kollabor_plugins-1.0.0.tar.gz.

File metadata

  • Download URL: kollabor_plugins-1.0.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kollabor_plugins-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1b95e49ce8c95822c5e2c4e844034c81d4ebaa1173cf4690f4187e6a75f9e8d7
MD5 d5de438fda3c92df13550c67a659b18b
BLAKE2b-256 9582e39d9aadf05e1c82c0baecf7c2796a0371169b3c204f43bb3cbb7c6691b6

See more details on using hashes here.

File details

Details for the file kollabor_plugins-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for kollabor_plugins-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61adaaa61880dbcb4f317659533827798a50e7330aee3bbdf6702330caf10e18
MD5 4537b8df2cb546238b366a6c7ab2ae1a
BLAKE2b-256 02f432d515baac00a6ca031a04af2e43cfc20d7cb9918b914cde8628a3856c57

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page