license

package
v0.12.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package license provides feature licensing and validation.

BETA STATUS: All features are currently unlocked during beta. When agnt reaches stable release, premium features will require a license.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFeatureDescription

func GetFeatureDescription(feature Feature) string

GetFeatureDescription returns a human-readable description of a feature.

func HasFeature

func HasFeature(feature Feature) bool

HasFeature checks if the current license has access to a feature.

BETA: Currently always returns true for all features. After beta, this will perform actual license validation.

func IsBeta

func IsBeta() bool

IsBeta returns true if we're in beta mode (all features unlocked).

func IsPremiumFeature

func IsPremiumFeature(feature Feature) bool

IsPremiumFeature returns true if the feature will require a license after beta.

func RequireFeature

func RequireFeature(feature Feature) error

RequireFeature checks if a feature is available, returning an error if not.

BETA: Currently always returns nil. After beta, this will return descriptive errors with upgrade links.

func SetLicense

func SetLicense(lic *License)

SetLicense sets the current license (for testing or future license loading).

Types

type Feature

type Feature string

Feature represents a licensed feature in agnt.

const (
	// Free tier features (always available)
	FeatureBasicProxy            Feature = "basic-proxy"            // Basic reverse proxy
	FeatureProcessManagement     Feature = "process-management"     // Process management
	FeatureBasicAccessibility    Feature = "basic-accessibility"    // Basic a11y audit
	FeatureStandardAccessibility Feature = "standard-accessibility" // Standard a11y audit (axe-core)
	FeatureFastAccessibility     Feature = "fast-accessibility"     // Fast a11y improvements mode
	FeatureScreenshots           Feature = "screenshots"            // Screenshot capture
	FeatureFloatingIndicator     Feature = "floating-indicator"     // Floating indicator panel

	// Premium features (will require license after beta)
	FeatureSketchMode        Feature = "sketch-mode"        // Wireframing/sketch mode
	FeatureDesignMode        Feature = "design-mode"        // AI-assisted design iteration
	FeatureComprehensiveA11y Feature = "comprehensive-a11y" // Comprehensive accessibility audit
	FeatureTunneling         Feature = "tunneling"          // Tunnel integration
	FeatureVisualRegression  Feature = "visual-regression"  // Snapshot/baseline testing
	FeatureChaosProxy        Feature = "chaos-proxy"        // Chaos engineering for proxy
)

type FeatureLockedError

type FeatureLockedError struct {
	Feature    Feature
	Message    string
	UpgradeURL string
}

FeatureLockedError is returned when a feature is not available in the current license.

func (*FeatureLockedError) Error

func (e *FeatureLockedError) Error() string

type License

type License struct {
	// Valid indicates if the license is valid
	Valid bool

	// Email of the license holder
	Email string

	// Features enabled by this license
	Features []Feature

	// ExpiresAt is when the license expires (nil = perpetual)
	ExpiresAt *time.Time

	// BetaMode indicates if we're in beta (all features unlocked)
	BetaMode bool
}

License represents a user's license configuration.

func GetLicense

func GetLicense() *License

GetLicense returns the current license information.

func LoadLicense

func LoadLicense(path string) (*License, error)

LoadLicense loads a license from a file path.

BETA: Not implemented - returns unlocked beta license. TODO: Implement Ed25519 signature verification when licensing is enabled.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL