fix: probe Claude from the GUI app and close integration gaps
- A GUI-subsystem host has no console code page, so .NET decoded the probes' UTF-8 output with code page 0 and Claude's /usage separators never matched: Claude showed as unavailable in the app but not in the CLI. Probe output is now decoded as UTF-8 and every probe gets valid standard handles, with stdin closed unless it is the Codex RPC. A GUI-subsystem test host reproduces it. - The /usage parser stops at the contributing section and only reports lines that start like a limit line. - snapshot.json no longer defaults appPath to the reader's own path. The app passes its path to the engine and a CLI refresh keeps it, so a Stream Deck key always starts the app (D9, D10). - The CLI is finaltoken-cli on every platform: FinalToken.exe and finaltoken.exe cannot share a folder on Windows. - Day series follow the local calendar day, as Today does. - The dev-only migration from the first store format is gone. - README.md is a short user guide. Refs #1
This commit is contained in:
@@ -12,6 +12,7 @@ public sealed class RefreshEngine : IAsyncDisposable
|
||||
private readonly SemaphoreSlim lifecycleGate = new(1, 1);
|
||||
private readonly string directory;
|
||||
private readonly TimeProvider clock;
|
||||
private readonly string? appPath;
|
||||
private readonly IncrementalScanner scanner;
|
||||
private readonly LimitProbe probe;
|
||||
private readonly Func<Provider, string?, CliDiscoveryResult> discover;
|
||||
@@ -30,7 +31,7 @@ public sealed class RefreshEngine : IAsyncDisposable
|
||||
|
||||
public RefreshEngine(string? dataDirectory = null, TimeProvider? timeProvider = null, IProcessRunner? processRunner = null,
|
||||
string? claudeDirectory = null, string? codexDirectory = null,
|
||||
Func<Provider, string?, CliDiscoveryResult>? cliDiscovery = null)
|
||||
Func<Provider, string?, CliDiscoveryResult>? cliDiscovery = null, string? appPath = null)
|
||||
{
|
||||
directory = dataDirectory ?? DataPaths.DataDirectory;
|
||||
Directory.CreateDirectory(directory);
|
||||
@@ -44,6 +45,7 @@ public sealed class RefreshEngine : IAsyncDisposable
|
||||
probe = new(processRunner ?? new ProcessRunner(clock), Diagnostics, directory);
|
||||
discover = cliDiscovery ?? ((provider, path) => CliDiscovery.Find(provider, path));
|
||||
current = SnapshotFile.Read(directory, clock.GetUtcNow()).Snapshot;
|
||||
this.appPath = appPath ?? current?.AppPath;
|
||||
activation = ActivationFile.ReadRequest(directory);
|
||||
}
|
||||
public string DataDirectory => directory;
|
||||
@@ -203,7 +205,8 @@ public sealed class RefreshEngine : IAsyncDisposable
|
||||
if (state.Status == ProviderStatus.Available && popups.Observe(window.Window, window.Pace, config) is { } alert)
|
||||
alerts.Add(alert);
|
||||
}
|
||||
var snapshot = new Snapshot { MadeAt = clock.GetUtcNow(), RefreshInterval = config.RefreshInterval, Providers = providers };
|
||||
var snapshot = new Snapshot { MadeAt = clock.GetUtcNow(), RefreshInterval = config.RefreshInterval,
|
||||
Providers = providers, AppPath = appPath };
|
||||
await History.SaveAsync(token);
|
||||
await SnapshotFile.WriteAsync(directory, snapshot, token);
|
||||
Volatile.Write(ref current, snapshot);
|
||||
|
||||
Reference in New Issue
Block a user