mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-03-29 17:11:37 +00:00
set up handling of asset files from the plugin directory
This commit is contained in:
parent
4819b933e8
commit
93e0fb4842
@ -61,6 +61,10 @@
|
||||
<ProjectReference Include="..\SourceCodeRules\SourceCodeRules\SourceCodeRules.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Plugins\assistants\assets\" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Read the meta data file -->
|
||||
<Target Name="ReadMetaData" BeforeTargets="BeforeBuild">
|
||||
<Error Text="The ../../metadata.txt file was not found!" Condition="!Exists('../../metadata.txt')" />
|
||||
|
||||
@ -56,6 +56,11 @@ public abstract partial class PluginBase : IPluginMetadata
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsInternal { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The absolute path to the plugin directory (where `plugin.lua` lives).
|
||||
/// </summary>
|
||||
public string PluginPath { get; internal set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The issues that occurred during the initialization of this plugin.
|
||||
@ -494,4 +499,4 @@ public abstract partial class PluginBase : IPluginMetadata
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,6 +95,7 @@ public static partial class PluginFactory
|
||||
|
||||
var code = await File.ReadAllTextAsync(pluginMainFile, Encoding.UTF8, cancellationToken);
|
||||
var plugin = await Load(meta.LocalPath, code, cancellationToken);
|
||||
plugin.PluginPath = meta.LocalPath;
|
||||
if (plugin is NoPlugin noPlugin)
|
||||
{
|
||||
LOG.LogError($"Was not able to start plugin: Id='{meta.Id}', Type='{meta.Type}', Name='{meta.Name}', Version='{meta.Version}'. Reason: {noPlugin.Issues.First()}");
|
||||
@ -119,4 +120,4 @@ public static partial class PluginFactory
|
||||
LOG.LogError($"Was not able to start plugin: Id='{meta.Id}', Type='{meta.Type}', Name='{meta.Name}', Version='{meta.Version}'. Reasons: {string.Join("; ", plugin.Issues)}");
|
||||
return new NoPlugin($"Was not able to start plugin: Id='{meta.Id}', Type='{meta.Type}', Name='{meta.Name}', Version='{meta.Version}'. Reasons: {string.Join("; ", plugin.Issues)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user