Documentation
¶
Overview ¶
Package extensions discovers trusted local CSS/JavaScript web extensions. Reload captures assets in memory so a document never mixes partially edited files.
Index ¶
- Constants
- func ReadSettings(dir string) (data []byte, exists bool, err error)
- func SettingsBytes(previous []byte, ids []string) ([]byte, error)
- func ValidID(id string) bool
- func ValidateEnabled(ids []string) error
- func WriteSettings(dir string, data []byte) error
- type Entry
- type Manager
- type Manifest
- type Settings
- type Snapshot
Constants ¶
View Source
const MaxBytes = 32 << 20
View Source
const MaxFiles = 512
View Source
const SettingsFile = "extensions.yaml"
SettingsFile is deliberately inside the extension directory, not the main term-llm configuration directory. Builders need no credential/config access.
Variables ¶
This section is empty.
Functions ¶
func SettingsBytes ¶
SettingsBytes updates only the enabled list, preserving comments/other YAML presentation without ever loading or rewriting the main config file.
func ValidateEnabled ¶
func WriteSettings ¶
WriteSettings atomically replaces the directory entry via os.Root. In particular, even a racing symlink cannot redirect this write into main config.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
type Snapshot ¶
type Snapshot struct {
Directory string `json:"directory"`
Enabled []string `json:"enabled"`
Entries []Entry `json:"entries"`
Errors []string `json:"errors"`
Generation string `json:"generation"`
Source string `json:"source"`
Disabled bool `json:"disabled"`
ConfigRevision string `json:"config_revision"`
ConfigPath string `json:"config_path"`
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.