Class ToolAssemblyScanner
- Namespace
- JD.AI.Core.Infrastructure
- Assembly
- JD.AI.Core.dll
Scans assemblies for ToolPluginAttribute classes and builds
registration manifests and safety tier maps at startup. Replaces manual
AddFromType calls and the hardcoded tier dictionary.
public static class ToolAssemblyScanner
- Inheritance
-
ToolAssemblyScanner
- Inherited Members
Methods
BuildSafetyTierMap(params Assembly[])
Builds a safety tier dictionary from ToolSafetyTierAttribute annotations
on [KernelFunction] methods across the given assemblies.
public static IReadOnlyDictionary<string, SafetyTier> BuildSafetyTierMap(params Assembly[] assemblies)
Parameters
assembliesAssembly[]Assemblies to scan.
Returns
- IReadOnlyDictionary<string, SafetyTier>
Dictionary mapping tool function names to their safety tiers.
DiscoverPlugins(params Assembly[])
Discovers all types decorated with ToolPluginAttribute in the given assemblies.
public static IReadOnlyList<ToolAssemblyScanner.ToolPluginDescriptor> DiscoverPlugins(params Assembly[] assemblies)
Parameters
assembliesAssembly[]Assemblies to scan. If empty, scans the calling assembly.
Returns
- IReadOnlyList<ToolAssemblyScanner.ToolPluginDescriptor>
Ordered list of plugin descriptors.
GetToolManifest(params Assembly[])
Gets a summary of all discovered tools with their safety tiers. Useful for diagnostics and documentation generation.
public static IReadOnlyList<(string PluginName, string FunctionName, SafetyTier Tier)> GetToolManifest(params Assembly[] assemblies)
Parameters
assembliesAssembly[]
Returns
RegisterStaticPlugins(Kernel, params Assembly[])
Registers all discovered tool plugins that don't require constructor injection. Returns the list of plugins that need manual registration.
public static IReadOnlyList<ToolAssemblyScanner.ToolPluginDescriptor> RegisterStaticPlugins(Kernel kernel, params Assembly[] assemblies)
Parameters
kernelKernelThe kernel to register plugins on.
assembliesAssembly[]Assemblies to scan.
Returns
- IReadOnlyList<ToolAssemblyScanner.ToolPluginDescriptor>
Plugins that require manual injection-based registration.