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:
@@ -0,0 +1,23 @@
|
||||
namespace FinalToken.Core;
|
||||
|
||||
/// <summary>Local calendar boundaries, including 23/25-hour days. Midnight overlaps choose
|
||||
/// the earlier instant; midnight gaps start at the first valid local minute.</summary>
|
||||
public static class CalendarDays
|
||||
{
|
||||
public static DateTimeOffset Start(DateTimeOffset instant, TimeZoneInfo? zone = null)
|
||||
{
|
||||
zone ??= TimeZoneInfo.Local;
|
||||
return AtStart(TimeZoneInfo.ConvertTime(instant, zone).Date, zone);
|
||||
}
|
||||
public static DateTimeOffset NextStart(DateTimeOffset instant, TimeZoneInfo? zone = null)
|
||||
{
|
||||
zone ??= TimeZoneInfo.Local;
|
||||
return AtStart(TimeZoneInfo.ConvertTime(instant, zone).Date.AddDays(1), zone);
|
||||
}
|
||||
private static DateTimeOffset AtStart(DateTime date, TimeZoneInfo zone)
|
||||
{
|
||||
while (zone.IsInvalidTime(date)) date = date.AddMinutes(1);
|
||||
var offset = zone.IsAmbiguousTime(date) ? zone.GetAmbiguousTimeOffsets(date).Max() : zone.GetUtcOffset(date);
|
||||
return new(date, offset);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user