BigMarc f5faa27f88 GrammaGem — open-source, on-device macOS writing assistant
Native SwiftUI menu-bar app: global hotkey → capture selected text (AX API /
clipboard fallback) → grammar (Harper) / local AI (MLX) → replace in place.
Free/paid entitlement gate + Lemon Squeezy device-cap licensing, $0 marginal
cost per user. Heavyweight engines behind protocol stubs so it builds out of the box.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 13:56:26 +02:00

33 lines
1.1 KiB
Swift

import Foundation
/// A single value object derived from license tier that every paid path checks.
/// Free is deliberately useful (full Harper grammar, system-wide) while the AI
/// superpowers + multi-device are the upgrade triggers (spec §5).
struct Entitlements: Equatable {
let tier: Tier
/// Layer-1 grammar is ALWAYS free + unlimited (the open-source core).
var unlimitedGrammar: Bool { true }
/// Layer-2 AI actions: unlimited when paid; capped per day on free.
var unlimitedAIActions: Bool { tier.isPaid }
var dailyAIActionCap: Int {
tier.isPaid ? Int.max : AppConfig.Limits.freeDailyAIActions
}
/// Writing Modes: free gets Polish only; paid gets all + custom.
var allModes: Bool { tier.isPaid }
/// Paid-only features.
var appAwareSwitching: Bool { tier.isPaid }
var snippets: Bool { tier.isPaid }
var canUseLargeModel: Bool { tier.isPaid }
/// Personal dictionary: 25 entries free, unlimited paid.
var dictionaryCap: Int {
tier.isPaid ? Int.max : AppConfig.Limits.freeDictionaryCap
}
var deviceCap: Int { tier.deviceCap }
}