Files
EugeneTes 199ad47f64 feat(google-calendar): extension project, options and per-chat token store
Adds the GoogleCalendar extension project (Abstractions only, Private=false), GoogleCalendarOptions with
env fallbacks and a secret-free ToString, GoogleCalendarException/Messages, ChatKeys (scope -> safe directory
name), StoredToken and GoogleTokenStore (atomic write, owner-only on Unix, reads never throw), and an empty
GoogleCalendarConnections stub for Task 3. The test project gains the extension reference and
Microsoft.Extensions.TimeProvider.Testing 10.9.0.
2026-09-26 20:01:18 +02:00

16 lines
938 B
C#

namespace Volcanic.AgenticCore.Extensions.GoogleCalendar;
/// <summary>A Google Calendar failure the model or the user can read. <see cref="NotConnected"/> means "run /calendar_connect".</summary>
public sealed class GoogleCalendarException(string message, bool notConnected = false) : Exception(message)
{
public bool NotConnected { get; } = notConnected;
}
internal static class GoogleCalendarMessages
{
public const string PermissionsUrl = "https://myaccount.google.com/permissions";
public const string NotConnected = "Google Calendar is not connected. Ask the user to run /calendar_connect in this chat.";
public const string TokenRejected = "Google rejected the stored calendar token (revoked or expired). Ask the user to run /calendar_connect in this chat.";
public const string NoRefreshToken = "Google returned no refresh token. Remove the app at " + PermissionsUrl + " and run /calendar_connect again.";
}