Update source code and remove runtime data from tracking

Add gitignore rules for browser session data, SQLite databases,
media downloads, and build artifacts. Remove previously tracked
runtime files from the repository.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jjbruntonandClaude Opus 4.6 committed 2026-05-20 18:54:07 +01:00
1 parent e90213d1ff
commit dfa0580859
23 files changed
+5324 -347

No files matched your search

+41
View File
@@ -70,4 +70,45 @@ export class RateLimiter {
minutesSinceLastMessage: Math.round((Date.now() - this.lastMessageTime) / 60000),
};
}
/**
* Get active timer information for the dashboard
*/
getTimers(): {
nextMessageAvailableAt: number | null;
hourlyResetAt: number;
isHourlyLimitReached: boolean;
messagesRemaining: number;
} {
const now = Date.now();
const minDelay = this.config.rateLimit.minDelayBetweenMessagesMs;
const maxMessages = this.config.rateLimit.maxMessagesPerHour;
// Calculate when the next message can be sent based on min delay
let nextMessageAvailableAt: number | null = null;
if (this.lastMessageTime > 0) {
const nextAvailable = this.lastMessageTime + minDelay;
if (nextAvailable > now) {
nextMessageAvailableAt = nextAvailable;
}
}
// Calculate when the hourly counter resets
const hourlyResetAt = this.hourStartTime + 3600000;
// Check if hourly limit is reached
const isHourlyLimitReached = this.messagesThisHour >= maxMessages;
// If hourly limit is reached, next message is available when the hour resets
if (isHourlyLimitReached) {
nextMessageAvailableAt = hourlyResetAt;
}
return {
nextMessageAvailableAt,
hourlyResetAt,
isHourlyLimitReached,
messagesRemaining: Math.max(0, maxMessages - this.messagesThisHour),
};
}
}