mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 02:27:21 +00:00
Generated the JSON contracts of visual briefings and model answers at compile time (#1151)
This commit is contained in:
1 parent
24e3c22db3
commit
770c16e20a
101 files changed
+2333
-392
No files matched your search
+5
-6
@@ -382,16 +382,15 @@ public partial class VisualBriefingAssistant
|
||||
/// The fingerprint is serialized from exactly the values that SaveCurrentAsync
|
||||
/// hands to the store. That is deliberate: a handwritten field list would silently stop
|
||||
/// auto-saving whenever a new setting is added and someone forgets to list it here. Sources are
|
||||
/// projected into a named shape because <c>System.Text.Json</c> ignores tuple fields and would
|
||||
/// projected into a named record because <c>System.Text.Json</c> ignores tuple fields and would
|
||||
/// otherwise serialize every source list into the same empty object.
|
||||
/// </remarks>
|
||||
/// <returns>The fingerprint of the current editor state.</returns>
|
||||
private string BuildPersistenceFingerprint() => JsonSerializer.Serialize(
|
||||
new
|
||||
{
|
||||
new VisualBriefingPersistenceFingerprint(
|
||||
this.editor.Name,
|
||||
this.editor.Author,
|
||||
Settings = this.editor.ToSettings(),
|
||||
Sources = this.editor.ToSources().Select(source => new { source.Path, source.Kind }).ToArray(),
|
||||
}, VisualBriefingJson.Canonical);
|
||||
this.editor.ToSettings(),
|
||||
[.. this.editor.ToSources().Select(source => new VisualBriefingSourceFingerprint(source.Path, source.Kind))]),
|
||||
VisualBriefingJson.Canonical);
|
||||
}
|
||||
Reference in new issue
Block a user