Ship Assistent 0.10: settings panel and UserPrefs with prompt weight.
Separate About-the-user memory (global + per-persona) from craft RAG, add tabbed settings with persona export/import and craft clear APIs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -242,6 +242,39 @@ public partial class SwarmAssistentExtension
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<JObject> AssistentClearMemory(Session session, string scope = null, string kind = null, string persona = null)
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
if (Memory is null)
|
||||
{
|
||||
return new JObject { ["error"] = "memory not ready" };
|
||||
}
|
||||
try
|
||||
{
|
||||
string targetPersona = persona;
|
||||
string wantScope = (scope ?? "").Trim().ToLowerInvariant();
|
||||
if (wantScope is "personal" && string.IsNullOrWhiteSpace(targetPersona))
|
||||
{
|
||||
targetPersona = Config?.DefaultPersonaId() ?? "neutral";
|
||||
}
|
||||
int n = Memory.ClearCraftMemory(scope, kind, targetPersona);
|
||||
return new JObject
|
||||
{
|
||||
["success"] = true,
|
||||
["deleted"] = n,
|
||||
["scope"] = scope ?? "all",
|
||||
["kind"] = kind ?? "all",
|
||||
["persona"] = AssistentMemory.IsShared(AssistentMemory.NormalizePersona(targetPersona))
|
||||
? "shared"
|
||||
: AssistentMemory.NormalizePersona(targetPersona),
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new JObject { ["error"] = $"memory clear: {ex.Message}" };
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The gpu-rent wanted queue (models pending the next <c>up</c>) — count + entries.</summary>
|
||||
public async Task<JObject> AssistentListWanted(Session session)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user