Ship Assistent disk persist, park LLM, and memory UI cleanup.

Split the extension into partials, persist chats on the data volume, park/warm the chat model around Generate, and drop dual raw/persona dump paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-22 01:03:40 +03:00
co-authored by Cursor
parent 880e2dbea2
commit 8702b64e12
12 changed files with 1192 additions and 114 deletions
+61 -2
View File
@@ -19,6 +19,7 @@ public partial class SwarmAssistentExtension
"snapshot_generate", "select_slot", "aspect", "images", "batch", "vary", "lock_seed",
"creativity", "intensity", "complexity", "movement",
"clear_prompt_images", "slot_to_prompt_image", "pack", "memories", "memory",
"memory_query", "memory_kind", "tag_query",
];
static bool HasValue(JObject obj, string key)
@@ -91,8 +92,66 @@ public partial class SwarmAssistentExtension
return string.IsNullOrWhiteSpace(q) ? null : q;
}
static bool WantsCivitaiSearch(JObject patch)
static bool ActionsContain(JObject patch, string action)
{
return !string.IsNullOrWhiteSpace(ExtractSearchQuery(patch));
if (patch?["actions"] is not JArray acts)
{
return false;
}
foreach (JToken a in acts)
{
if (string.Equals(a?.ToString(), action, StringComparison.OrdinalIgnoreCase))
{
return true;
}
}
return false;
}
static string ExtractMemoryQuery(JObject patch)
{
string q = patch?["memory_query"]?.ToString()?.Trim();
if (!string.IsNullOrWhiteSpace(q))
{
return q;
}
return ActionsContain(patch, "memory_search") ? ExtractSearchQuery(patch) : null;
}
static string ExtractTagQuery(JObject patch)
{
string q = patch?["tag_query"]?.ToString()?.Trim();
if (!string.IsNullOrWhiteSpace(q))
{
return q;
}
return ActionsContain(patch, "lookup_tags") ? ExtractSearchQuery(patch) : null;
}
static string NextToolHop(JObject patch)
{
if (patch is null)
{
return null;
}
if (ActionsContain(patch, "memory_get"))
{
return "memory_get";
}
if (ActionsContain(patch, "memory_search") || !string.IsNullOrWhiteSpace(patch["memory_query"]?.ToString()))
{
return "memory_search";
}
if (ActionsContain(patch, "lookup_tags") || !string.IsNullOrWhiteSpace(patch["tag_query"]?.ToString()))
{
return "lookup_tags";
}
if (ActionsContain(patch, "search_civitai") || !string.IsNullOrWhiteSpace(ExtractSearchQuery(patch)))
{
return "civitai";
}
return null;
}
static bool WantsCivitaiSearch(JObject patch) => NextToolHop(patch) == "civitai";
}