Ship Assistent 0.11.9: esbuild bundle and patch-keys manifest.
Replace split Assets JS with a built bundle and aligned C#/config so SwarmUI loads one script and patch apply stays consistent; drop legacy terse persona and memory seed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+24
-19
@@ -13,6 +13,8 @@ namespace Mrleo1nid.SwarmAssistent;
|
||||
/// <summary>Queue of models the assistant wants downloaded (merged into gpu-rent models.yaml on next up/capture).</summary>
|
||||
public partial class SwarmAssistentExtension
|
||||
{
|
||||
static readonly object WantedFileLock = new();
|
||||
|
||||
string WantedModelsPath() => Path.Combine(DataRoot(), ".gpu-rent-wanted-models.yaml");
|
||||
|
||||
string WantedCardsDir() => Path.Combine(DataRoot(), ".gpu-rent-wanted-cards");
|
||||
@@ -45,36 +47,39 @@ public partial class SwarmAssistentExtension
|
||||
|
||||
string path = WantedModelsPath();
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(path) ?? DataRoot());
|
||||
Dictionary<string, List<WantedEntry>> sections = LoadWantedYaml(File.Exists(path) ? File.ReadAllText(path, Encoding.UTF8) : "");
|
||||
|
||||
if (version_id > 0)
|
||||
lock (WantedFileLock)
|
||||
{
|
||||
foreach (List<WantedEntry> list in sections.Values)
|
||||
Dictionary<string, List<WantedEntry>> sections = LoadWantedYaml(File.Exists(path) ? File.ReadAllText(path, Encoding.UTF8) : "");
|
||||
|
||||
if (version_id > 0)
|
||||
{
|
||||
if (list.Any(e => e.VersionId == version_id))
|
||||
foreach (List<WantedEntry> list in sections.Values)
|
||||
{
|
||||
return new JObject { ["success"] = true, ["already"] = true, ["path"] = path, ["version_id"] = version_id };
|
||||
if (list.Any(e => e.VersionId == version_id))
|
||||
{
|
||||
return new JObject { ["success"] = true, ["already"] = true, ["path"] = path, ["version_id"] = version_id };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (List<WantedEntry> list in sections.Values)
|
||||
else
|
||||
{
|
||||
if (list.Any(e => string.Equals(e.Url, url, StringComparison.OrdinalIgnoreCase)))
|
||||
foreach (List<WantedEntry> list in sections.Values)
|
||||
{
|
||||
return new JObject { ["success"] = true, ["already"] = true, ["path"] = path };
|
||||
if (list.Any(e => string.Equals(e.Url, url, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
return new JObject { ["success"] = true, ["already"] = true, ["path"] = path };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!sections.TryGetValue(kind, out List<WantedEntry> bucket))
|
||||
{
|
||||
bucket = [];
|
||||
sections[kind] = bucket;
|
||||
if (!sections.TryGetValue(kind, out List<WantedEntry> bucket))
|
||||
{
|
||||
bucket = [];
|
||||
sections[kind] = bucket;
|
||||
}
|
||||
bucket.Add(new WantedEntry { Url = url, Title = title, VersionId = version_id });
|
||||
File.WriteAllText(path, WriteWantedYaml(sections), Encoding.UTF8);
|
||||
}
|
||||
bucket.Add(new WantedEntry { Url = url, Title = title, VersionId = version_id });
|
||||
File.WriteAllText(path, WriteWantedYaml(sections), Encoding.UTF8);
|
||||
|
||||
if (card is not null && version_id > 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user