mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 10:58:00 +00:00
Added the visual briefing assistant (#893)
Build and Release / Determine run mode (push) Has been cancelled
Build and Release / Read metadata (push) Has been cancelled
Build and Release / Sync Flatpak repo (push) Has been cancelled
Build and Release / Collect Flatpak artifacts (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Has been cancelled
Build and Release / Prepare & create release (push) Has been cancelled
Build and Release / Publish release (push) Has been cancelled
Build and Release / Determine run mode (push) Has been cancelled
Build and Release / Read metadata (push) Has been cancelled
Build and Release / Sync Flatpak repo (push) Has been cancelled
Build and Release / Collect Flatpak artifacts (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-apple-darwin, osx-arm64, macos-latest, aarch64-apple-darwin, dmg,app,updater, dmg) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-pc-windows-msvc.exe, win-arm64, windows-latest, aarch64-pc-windows-msvc, nsis,updater, nsis) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-aarch64-unknown-linux-gnu, linux-arm64, ubuntu-22.04-arm, aarch64-unknown-linux-gnu, appimage,updater, appimage) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-apple-darwin, osx-x64, macos-latest, x86_64-apple-darwin, dmg,app,updater, dmg) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-pc-windows-msvc.exe, win-x64, windows-latest, x86_64-pc-windows-msvc, nsis,updater, nsis) (push) Has been cancelled
Build and Release / Build app (${{ matrix.dotnet_runtime }}) (-x86_64-unknown-linux-gnu, linux-x64, ubuntu-22.04, x86_64-unknown-linux-gnu, appimage,updater, appimage) (push) Has been cancelled
Build and Release / Prepare & create release (push) Has been cancelled
Build and Release / Publish release (push) Has been cancelled
This commit is contained in:
1 parent
df4663fff4
commit
58cc811a58
214 files changed
+18943
-353
No files matched your search
+136
@@ -0,0 +1,136 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace AIStudio.Assistants.VisualBriefing;
|
||||
|
||||
/// <summary>
|
||||
/// Contains user-safe technical details for the most recent operation.
|
||||
/// </summary>
|
||||
public sealed class VisualBriefingOperationDiagnostics
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the operation identifier.
|
||||
/// </summary>
|
||||
public Guid OperationId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the build identifier.
|
||||
/// </summary>
|
||||
public Guid BuildId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current or failed stage.
|
||||
/// </summary>
|
||||
public VisualBriefingBuildStage Stage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the failure code.
|
||||
/// </summary>
|
||||
public VisualBriefingFailureCode FailureCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the stable validation rule.
|
||||
/// </summary>
|
||||
public VisualBriefingValidationRule ValidationRule { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the AI Studio artifact version.
|
||||
/// </summary>
|
||||
public int ArtifactVersion { get; set; } = VisualBriefingVersions.ARTIFACT;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the data schema version.
|
||||
/// </summary>
|
||||
public int SchemaVersion { get; set; } = VisualBriefingVersions.SCHEMA;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the runtime version.
|
||||
/// </summary>
|
||||
public int RuntimeVersion { get; set; } = VisualBriefingVersions.RUNTIME;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the provider family.
|
||||
/// </summary>
|
||||
public string ProviderFamily { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the selected model.
|
||||
/// </summary>
|
||||
public string Model { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the safe structured-response diagnostic.
|
||||
/// </summary>
|
||||
public VisualBriefingStructuredResponseDiagnostic? StructuredResponse { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the operation start time.
|
||||
/// </summary>
|
||||
public DateTimeOffset StartedAtUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the operation finish time.
|
||||
/// </summary>
|
||||
public DateTimeOffset? FinishedAtUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets safe content hashes used for support diagnostics.
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ContentHashes { get; set; } = new(StringComparer.Ordinal);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets safe intermediate artifact identifiers for support diagnostics.
|
||||
/// </summary>
|
||||
public Dictionary<string, Guid> ArtifactIds { get; set; } = new(StringComparer.Ordinal);
|
||||
|
||||
/// <summary>
|
||||
/// Reconstructs clipboard-safe diagnostics from a persistent build record.
|
||||
/// </summary>
|
||||
/// <param name="build">The persistent build record.</param>
|
||||
/// <returns>The reconstructed diagnostics.</returns>
|
||||
public static VisualBriefingOperationDiagnostics FromBuildRecord(VisualBriefingBuildRecord build)
|
||||
{
|
||||
var latestStage = build.Failure?.Stage ??
|
||||
build.Stages
|
||||
.Where(stage => stage.Status is not VisualBriefingBuildStageStatus.NOT_STARTED)
|
||||
.OrderByDescending(stage => stage.Stage)
|
||||
.FirstOrDefault()?.Stage ??
|
||||
VisualBriefingBuildStage.SOURCE_PREPARATION;
|
||||
return new()
|
||||
{
|
||||
OperationId = build.OperationId,
|
||||
BuildId = build.BuildId,
|
||||
Stage = latestStage,
|
||||
FailureCode = build.Failure?.Code ?? VisualBriefingFailureCode.NONE,
|
||||
ValidationRule = build.Failure?.ValidationRule ?? VisualBriefingValidationRule.NONE,
|
||||
StructuredResponse = build.Failure?.StructuredResponse,
|
||||
ProviderFamily = build.ProviderFamily,
|
||||
Model = build.Model,
|
||||
StartedAtUtc = build.CreatedAtUtc,
|
||||
FinishedAtUtc = build.Status is VisualBriefingBuildStatus.ACTIVE
|
||||
? null
|
||||
: build.UpdatedAtUtc,
|
||||
ContentHashes = build.Stages
|
||||
.Where(stage => !string.IsNullOrWhiteSpace(stage.OutputHash))
|
||||
.GroupBy(stage => stage.Stage)
|
||||
.ToDictionary(
|
||||
group => group.Key.ToString(),
|
||||
group => group.Last().OutputHash,
|
||||
StringComparer.Ordinal),
|
||||
ArtifactIds = new Dictionary<string, Guid>(StringComparer.Ordinal)
|
||||
{
|
||||
["evidence"] = build.EvidenceArtifactId ?? Guid.Empty,
|
||||
["plan"] = build.PlanArtifactId ?? Guid.Empty,
|
||||
["content"] = build.ContentArtifactId ?? Guid.Empty,
|
||||
["design"] = build.PresentationArtifactId ?? Guid.Empty,
|
||||
}
|
||||
.Where(item => item.Value != Guid.Empty)
|
||||
.ToDictionary(item => item.Key, item => item.Value, StringComparer.Ordinal),
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serializes the diagnostics without user content.
|
||||
/// </summary>
|
||||
/// <returns>A compact JSON document suitable for the clipboard.</returns>
|
||||
public string ToClipboardText() => JsonSerializer.Serialize(this, VisualBriefingJson.Persistence);
|
||||
}
|
||||
Reference in new issue
Block a user