Kind: Class
Source: atloria-monorepo/libs/agent-core/src/plugins/plugin-loader.ts
Methods
| Method | Signature | Returns |
|---|---|---|
loadFromDirectory | loadFromDirectory(pluginsDir: string) | Promise<LoadedPlugin[]> |
loadPlugin | loadPlugin(pluginDir: string) | Promise<LoadedPlugin> |
Where it refuses work
PluginLoaderstops the work withErrorwhen!manifest || typeof manifest !== 'object'— “Manifest must be a JSON object”.PluginLoaderstops the work withErrorwhentypeof manifest.name !== 'string' || !manifest.name— “Manifest must have a "name" string field”.PluginLoaderstops the work withErrorwhen!KEBAB_CASE_RE.test(manifest.name).PluginLoaderstops the work withErrorwhentypeof manifest.version !== 'string'— “"version" must be a string”.PluginLoaderstops the work with an early return when!fs.existsSync(pluginsDir).PluginLoaderstops the work with an early return when!fs.existsSync(skillsDir).
When something fails
PluginLoaderhandles failure in 2 places: it logs it and continues in 1, and discards it silently in 1. A failure discarded silently leaves no trace for whoever debugs this later.
Was this page helpful?