Skip to content

Plugin System

The xcore framework is designed around a powerful, modular plugin system. Plugins allow you to extend the core functionality of your application without modifying the kernel.

Architecture

Plugins in xcore are self-contained modules located in the directory specified in integration.yaml (usually ./plugins/).

Types of Plugins

  1. Trusted Plugins:
  2. Have full access to the system.
  3. Typically developed internally.
  4. Must be signed if strict_trusted is enabled.

  5. Sandboxed Plugins:

  6. Run in an isolated environment.
  7. Restricted by an AST-based whitelist for imports.
  8. Limited resource consumption (CPU, Memory, Disk).

Directory Structure

A typical plugin looks like this:

1
2
3
4
5
6
7
plugins/
└── my-plugin/
    ├── src/
    │   └── main.py      # Entry point
    ├── plugin.yaml      # Metadata & Resources
    ├── plugin.sig       # Security signature
    └── requirements.txt # Dependencies

Lifecycle Management

xcorecli provides a comprehensive suite of commands to manage the entire plugin lifecycle:

Top-level Commands

In addition to sub-apps, the plugin group provides several direct commands:

  • xcli plugin info <name>: Show detailed manifest and permissions for an installed plugin.
  • xcli plugin health: Perform a global health check (signatures, AST, manifests) on all installed plugins.
  • xcli plugin remove <name>: Uninstall a plugin and delete its files.

IPC (Inter-Plugin Communication)

Plugins can communicate with each other using the built-in IPC mechanism, which is enforced by the core ServiceContainer.