forked from neurodock/NeuroDock
feat(plugin): scaffold RPCP plugin loading core
- Add JarFile-based plugin.json manifest reading and validation - Implement reflection-based plugin class instantiation (Data or no-arg constructor) - Wrap Tool objects into OllamaFunctionTool with basic parameter/response handling - Implement ToolArguments storage and ToolResponse record - Extract RPCP_SOURCE constant; add plugin name validation - Update Data interface: getLoadedPlugins() returns LoadedPlugin[] - Fix launcher package references (me.zacharias.chat → me.neurodock) TODO: Extract FileSystem from JAR, populate PluginMetadata, complete OllamaFunctionArgument↔ToolArguments wrapping, invoke plugin lifecycle hooks Signed-off-by: zacharias <alienfromdia@proton.me>
This commit is contained in:
@@ -9,6 +9,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Entry point for the plugin, this is required for the plugin to work, and you MUST annotate it with {@link PluginEntryPoint}
|
||||
*/
|
||||
public abstract class Plugin {
|
||||
/**
|
||||
* This is a magic constant plugin name used for when a plugin's name cant be loaded
|
||||
*/
|
||||
public static final String UNKNOWN_PLUGIN = "UNKNOWN PLUGIN";
|
||||
|
||||
/**
|
||||
* This shuld be used if {@link PluginEntryPoint#requireData()} is false (default)
|
||||
@@ -29,12 +33,12 @@ public abstract class Plugin {
|
||||
public void onInit(){}
|
||||
|
||||
/**
|
||||
* This will be called if the core gets a "fetal" exception or fails to fetch certain info
|
||||
* This will be called if the core gets a "fetal" exception or fails to fetch certain info AND the plugin was able to be loaded.
|
||||
*/
|
||||
public void onDisable(){}
|
||||
|
||||
/**
|
||||
* This will be called after all plugins have been initialised; here it is safe to perform potential stuff where you load data from optional dependencies, or similar things
|
||||
* This will be called after all plugins have been initialized; here it is safe to perform potential stuff where you load data from optional dependencies, or similar things
|
||||
*/
|
||||
public void onEnable(){}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user