spec

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaVersion = "2026-03-27"
	SettingsFile  = "settings.json"
)
View Source
const (
	ThemeNameSystem = "system"
	ThemeNameLight  = "applight"
	ThemeNameDark   = "appdark"
)

Variables

View Source
var (
	ErrInvalidArgument        = errors.New("invalid argument")
	ErrInvalidTheme           = errors.New("invalid app theme")
	ErrInvalidAuthKey         = errors.New("invalid auth key")
	ErrInvalidDebugSettings   = errors.New("invalid debug settings")
	ErrAuthKeyNotFound        = errors.New("auth key not found")
	ErrBuiltInAuthKeyReadOnly = errors.New("built-in auth key is read-only")
)

Functions

This section is empty.

Types

type AppTheme

type AppTheme struct {
	Type ThemeType `json:"type"`
	Name string    `json:"name"`
}

type AuthKey

type AuthKey struct {
	Secret   string `json:"secret"` // encrypted on disk
	SHA256   string `json:"sha256"` // plain text
	NonEmpty bool   `json:"nonEmpty"`
}

AuthKey holds an encrypted secret plus its SHA-256 hash.

type AuthKeyMeta

type AuthKeyMeta struct {
	Type     AuthKeyType `json:"type"`
	KeyName  AuthKeyName `json:"keyName"`
	SHA256   string      `json:"sha256"`
	NonEmpty bool        `json:"nonEmpty"`
}

AuthKeyMeta is the public view of one stored key (no secret, only SHA).

type AuthKeyName

type AuthKeyName string

AuthKeyName is the unique key within its type.

type AuthKeyType

type AuthKeyType string

AuthKeyType groups keys (e.g. "provider", "github").

const (
	AuthKeyTypeProvider AuthKeyType = "provider"
	// AuthKeyTypeMCP is the dedicated namespace for MCP-related secrets.
	// Use this for MCP transport auth tokens, headers, and env wiring.
	AuthKeyTypeMCP AuthKeyType = "mcp"
)

type AuthKeysSchema

type AuthKeysSchema map[AuthKeyType]map[AuthKeyName]AuthKey

type DebugLogLevel added in v0.0.91

type DebugLogLevel string
const (
	DebugLogLevelDebug DebugLogLevel = "debug"
	DebugLogLevelInfo  DebugLogLevel = "info"
	DebugLogLevelWarn  DebugLogLevel = "warn"
	DebugLogLevelError DebugLogLevel = "error"
)

type DebugSettings added in v0.0.91

type DebugSettings struct {
	LogLLMReqResp           bool          `json:"logLLMReqResp"`
	DisableContentStripping bool          `json:"disableContentStripping"`
	LogLevel                DebugLogLevel `json:"logLevel"`
}

type DeleteAuthKeyRequest

type DeleteAuthKeyRequest struct {
	Type    AuthKeyType `path:"type"`
	KeyName AuthKeyName `path:"keyName"`
}

DeleteAuthKeyRequest removes a key (if not built-in).

type DeleteAuthKeyResponse

type DeleteAuthKeyResponse struct{}

type GetAuthKeyRequest

type GetAuthKeyRequest struct {
	Type    AuthKeyType `path:"type"`
	KeyName AuthKeyName `path:"keyName"`
}

GetAuthKeyRequest fetches one decrypted secret.

type GetAuthKeyResponse

type GetAuthKeyResponse struct {
	Body *GetAuthKeyResponseBody
}

type GetAuthKeyResponseBody

type GetAuthKeyResponseBody struct {
	Secret   string `json:"secret"`
	SHA256   string `json:"sha256"`
	NonEmpty bool   `json:"nonEmpty"`
}

type GetSettingsRequest

type GetSettingsRequest struct {
	ForceFetch bool `query:"forceFetch" doc:"Refresh from disk before reading." required:"false"`
}

GetSettingsRequest fetches everything (theme + debug + keys). Secrets are omitted.

type GetSettingsResponse

type GetSettingsResponse struct {
	Body *GetSettingsResponseBody
}

GetSettingsResponse returns the current settings without secrets.

type GetSettingsResponseBody

type GetSettingsResponseBody struct {
	AppTheme AppTheme      `json:"appTheme"`
	Debug    DebugSettings `json:"debug"`
	AuthKeys []AuthKeyMeta `json:"authKeys"`
}

type SetAppThemeRequest

type SetAppThemeRequest struct {
	Body *SetAppThemeRequestBody
}

type SetAppThemeRequestBody

type SetAppThemeRequestBody struct {
	Type ThemeType `json:"type" required:"true"`
	Name string    `json:"name" required:"true"`
}

type SetAppThemeResponse

type SetAppThemeResponse struct{}

type SetAuthKeyRequest

type SetAuthKeyRequest struct {
	Type    AuthKeyType `path:"type"`
	KeyName AuthKeyName `path:"keyName"`
	Body    *SetAuthKeyRequestBody
}

SetAuthKeyRequest creates or updates a key (idempotent).

type SetAuthKeyRequestBody

type SetAuthKeyRequestBody struct {
	Secret string `json:"secret" required:"true"`
}

type SetAuthKeyResponse

type SetAuthKeyResponse struct{}

type SetDebugSettingsRequest added in v0.0.91

type SetDebugSettingsRequest struct {
	Body *SetDebugSettingsRequestBody
}

type SetDebugSettingsRequestBody added in v0.0.91

type SetDebugSettingsRequestBody struct {
	LogLLMReqResp           bool          `json:"logLLMReqResp"           required:"true"`
	DisableContentStripping bool          `json:"disableContentStripping" required:"true"`
	LogLevel                DebugLogLevel `json:"logLevel"                required:"true"`
}

type SetDebugSettingsResponse added in v0.0.91

type SetDebugSettingsResponse struct{}

type SettingsSchema

type SettingsSchema struct {
	SchemaVersion string         `json:"schemaVersion"`
	AppTheme      AppTheme       `json:"appTheme"`
	Debug         DebugSettings  `json:"debug"`
	AuthKeys      AuthKeysSchema `json:"authKeys"`
}

type ThemeType

type ThemeType string
const (
	ThemeSystem ThemeType = "system"
	ThemeLight  ThemeType = "light"
	ThemeDark   ThemeType = "dark"
	ThemeOther  ThemeType = "other"
)

Jump to

Keyboard shortcuts

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