Skip to content

SDK Reference

NekoPluginBase

All plugins must inherit from NekoPluginBase.

python
from plugin.sdk.base import NekoPluginBase

class MyPlugin(NekoPluginBase):
    def __init__(self, ctx):
        super().__init__(ctx)

Methods

get_input_schema() → dict

Returns the plugin's input JSON Schema. By default reads from the class attribute. Override for dynamic schemas.

report_status(status: dict) → None

Report plugin status to the main process.

python
self.report_status({
    "status": "running",
    "progress": 50,
    "message": "Processing..."
})

collect_entries() → dict

Collect all entry points (methods decorated with @plugin_entry). Called automatically by the system.

PluginContext

The ctx object passed to plugin constructors.

Properties

PropertyTypeDescription
ctx.plugin_idstrPlugin identifier
ctx.config_pathPathPath to plugin.toml
ctx.loggerLoggerLogger instance

Methods

ctx.update_status(status: dict) → None

Update plugin status in the main process.

ctx.push_message(...) → None

Push a message to the main system.

python
ctx.push_message(
    source="my_feature",          # Message source identifier
    message_type="text",          # "text" | "url" | "binary" | "binary_url"
    description="Task complete",  # Human-readable description
    priority=5,                   # 0-10 (0=low, 10=emergency)
    content="Result text",        # For text/url types
    binary_data=b"...",           # For binary type
    binary_url="https://...",     # For binary_url type
    metadata={"key": "value"}    # Additional metadata
)

Message types

TypeUse case
textPlain text messages
urlURL links
binarySmall binary data (transmitted directly)
binary_urlLarge files (referenced by URL)

Priority levels

RangeLevelUse case
0-2LowInformational messages
3-5MediumGeneral notifications
6-8HighImportant notifications
9-10EmergencyNeeds immediate handling

Released under the MIT License.