Parent: #66 Phase 5 - Custom Layers & Plugin System
What
Let users drop .py files into /data/plugins/ that subclass ProcessingLayer. Auto-discovered on restart.
Plugin Structure
/data/plugins/
hardcover_lookup/
manifest.json # metadata, config schema, permissions
layer.py # class extending ProcessingLayer
manifest.json
{
"id": "hardcover-lookup",
"name": "Hardcover.app Lookup",
"version": "1.0.0",
"type": "layer",
"entry_point": "layer.py",
"permissions": {
"network": ["api.hardcover.app"],
"database": "read",
"filesystem": "none"
},
"config_schema": {
"properties": {
"api_key": { "type": "string", "x-input-type": "password" },
"timeout": { "type": "integer", "default": 30 }
}
}
}
Implementation
Safety
- Verified vs unverified distinction
- Auto-disable after 5 consecutive failures
- Timeout cap (30s default)
- Data isolation via deep copy
Depends on
- Template HTTP layers (for the CustomApiLayer pattern to follow)
Part of
#66 Phase 5, Tier 3
Parent: #66 Phase 5 - Custom Layers & Plugin System
What
Let users drop .py files into
/data/plugins/that subclass ProcessingLayer. Auto-discovered on restart.Plugin Structure
manifest.json
{ "id": "hardcover-lookup", "name": "Hardcover.app Lookup", "version": "1.0.0", "type": "layer", "entry_point": "layer.py", "permissions": { "network": ["api.hardcover.app"], "database": "read", "filesystem": "none" }, "config_schema": { "properties": { "api_key": { "type": "string", "x-input-type": "password" }, "timeout": { "type": "integer", "default": 30 } } } }Implementation
library_manager/plugin_loader.py- directory scanner + module importerimportlib.util.spec_from_file_locationconfig_schema(JSON Schema → HTML)config.jsonunderplugin_configs, secrets insecrets.jsonSafety
Depends on
Part of
#66 Phase 5, Tier 3