Adds a local execution history (C1 from docs/Extra.md Part 2). - Domain ExecutionRecord; Application IExecutionHistoryService port + pure ExecutionHistory helper (newest-first, cap 200, no de-dupe). - Infrastructure JsonExecutionHistoryService -> %AppData%\CommandForge\ history.json (source-gen context, schema version, corrupt-file fallback). No telemetry. - ExecutionViewModel exposes LastResult; MainViewModel records each finished, non-cancelled run via IClock + the history service. - New History shell section (sidebar button + View menu) with HistoryViewModel/HistoryView: per-run time/status/duration, "Run again" (re-runs through the normal confirm/elevation flow) and "Clear history". Runs of commands removed from the catalog show their id and cannot be re-run. - EN/VI .resx keys; tests for the cap helper and JSON round-trip / fallbacks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
26 lines
973 B
C#
26 lines
973 B
C#
namespace CommandForge.Domain;
|
|
|
|
/// <summary>
|
|
/// A record of one finished command execution, persisted for the execution-history view.
|
|
/// </summary>
|
|
public sealed record ExecutionRecord
|
|
{
|
|
/// <summary>The catalog id of the command that ran.</summary>
|
|
public required string CommandId { get; init; }
|
|
|
|
/// <summary>When the run finished (clock instant, with offset).</summary>
|
|
public required DateTimeOffset Timestamp { get; init; }
|
|
|
|
/// <summary>The process exit code.</summary>
|
|
public required int ExitCode { get; init; }
|
|
|
|
/// <summary>Whether the run was considered successful (exit 0 or the reboot-required code).</summary>
|
|
public required bool Success { get; init; }
|
|
|
|
/// <summary>Wall-clock duration in milliseconds.</summary>
|
|
public required long DurationMs { get; init; }
|
|
|
|
/// <summary>Whether the run signalled that a restart is required (e.g. exit code 3010).</summary>
|
|
public bool RequiresRestart { get; init; }
|
|
}
|