feat(ui): add TokenTracker status, refresh and install to the worker client
This commit is contained in:
@@ -207,4 +207,7 @@ public interface IWorkerClient : INotifyPropertyChanged
|
||||
Task<UsageSnapshotDto?> RefreshUsageAsync();
|
||||
Task<IReadOnlyList<ModelUsageRowDto>> GetModelUsageAsync(DateOnly from, DateOnly to);
|
||||
Task<IReadOnlyList<TaskUsageRowDto>> GetTaskUsageAsync(DateOnly from, DateOnly to);
|
||||
Task<TokenTrackerStatusDto?> GetTokenTrackerStatusAsync();
|
||||
Task<TokenTrackerStatusDto?> RefreshTokenTrackerAsync();
|
||||
Task<TokenTrackerStatusDto?> InstallTokenTrackerAsync();
|
||||
}
|
||||
|
||||
@@ -689,6 +689,15 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
public async Task<IReadOnlyList<TaskUsageRowDto>> GetTaskUsageAsync(DateOnly from, DateOnly to)
|
||||
=> await TryInvokeAsync<List<TaskUsageRowDto>>("GetTaskUsage", from, to) ?? [];
|
||||
|
||||
public Task<TokenTrackerStatusDto?> GetTokenTrackerStatusAsync()
|
||||
=> TryInvokeAsync<TokenTrackerStatusDto>("GetTokenTrackerStatus");
|
||||
|
||||
public Task<TokenTrackerStatusDto?> RefreshTokenTrackerAsync()
|
||||
=> TryInvokeAsync<TokenTrackerStatusDto>("RefreshTokenTracker");
|
||||
|
||||
public Task<TokenTrackerStatusDto?> InstallTokenTrackerAsync()
|
||||
=> TryInvokeAsync<TokenTrackerStatusDto>("InstallTokenTracker");
|
||||
|
||||
// IWorkerClient explicit implementations (drop typed return values)
|
||||
async Task IWorkerClient.StartPlanningSessionAsync(string taskId, CancellationToken ct)
|
||||
=> await StartPlanningSessionAsync(taskId, ct);
|
||||
@@ -846,7 +855,8 @@ public sealed record ModelUsageRowDto(
|
||||
long OutputTokens,
|
||||
long CacheReadTokens,
|
||||
long CacheCreationTokens,
|
||||
int Messages);
|
||||
int Messages,
|
||||
double? CostUsd = null);
|
||||
|
||||
public sealed record TaskUsageRowDto(
|
||||
string TaskId,
|
||||
@@ -856,4 +866,18 @@ public sealed record TaskUsageRowDto(
|
||||
string? Model,
|
||||
int Runs,
|
||||
long TokensIn,
|
||||
long TokensOut);
|
||||
long TokensOut,
|
||||
double? CostUsd = null,
|
||||
int? Retries = null,
|
||||
bool? Productive = null,
|
||||
bool? OneShot = null);
|
||||
|
||||
public sealed record TokenTrackerStatusDto(
|
||||
bool Installed,
|
||||
string? Version,
|
||||
bool NodeOk,
|
||||
string? NodeVersion,
|
||||
DateTime? LastFetchedUtc,
|
||||
string? LastError,
|
||||
int? FormatVersion,
|
||||
int SessionCount);
|
||||
|
||||
Reference in New Issue
Block a user