assetconfig

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CategoryNames = map[string]string{
	"inspector":     "Inspector",
	"validation":    "Validation",
	"serialization": "Serialization",
	"animation":     "Animation",
}

CategoryNames maps a machine category key to its human-readable label.

View Source
var CategoryOrder = []string{"inspector", "validation", "serialization", "animation"}

CategoryOrder defines the stable display order for asset categories.

Functions

func ConfigFilePath

func ConfigFilePath() string

ConfigFilePath returns the full path to asset-config.json under the user's home directory. Initialised once on first call.

func IsEnabled

func IsEnabled(id string) (bool, error)

IsEnabled checks if a specific asset is enabled.

func LoadGameFeelModeNoCreate added in v0.0.37

func LoadGameFeelModeNoCreate() bool

LoadGameFeelModeNoCreate reads only the Game Feel Mode (Beta) flag for agent-rules generation. Missing or unreadable config reads as off without writing a config file.

func LoadUISlopModeNoCreate added in v0.0.41

func LoadUISlopModeNoCreate() bool

LoadUISlopModeNoCreate reads only the Unity De-slop Mode (Beta) flag for agent-rules generation. Missing or unreadable config reads as off without writing a config file.

func Save

func Save(cfg *AssetConfig) error

Save writes the asset config to disk.

Types

type AssetConfig

type AssetConfig struct {
	Version             string              `json:"version"`
	Assets              []AssetEntry        `json:"assets"`
	LoopEngineeringMode LoopEngineeringMode `json:"loopEngineeringMode"`
	UISystem            UISystem            `json:"ui_system"`

	// GameFeelUIMode mirrors game_feel_ui_mode in the shared asset-config.json.
	// When on, the connector's manage_ui attaches Game Feel & Juice Bible + UI
	// Feedback Design Guide juice guidance to its create responses. The Hera
	// Settings window is the primary editor. (Persisted under the old
	// `ui_juicy_mode` key before the Game Feel UI Mode rename; Load migrates
	// that key transparently.)
	GameFeelUIMode bool `json:"game_feel_ui_mode"`

	// GameFeelMode mirrors game_feel_mode — the gameplay-wide Game Feel Mode
	// (Beta). When on, `doctor --agent-rules` and connector tool responses point
	// agents at the bundled game_feel knowledge base (Game Feel & Juice Bible +
	// Ethical Engagement Framework).
	GameFeelMode bool `json:"game_feel_mode"`

	// UISlopMode mirrors ui_slop_mode — the Unity De-slop Mode (Beta). When on,
	// `doctor --agent-rules` injects the unity-deslop discipline and connector
	// tool responses point agents at the bundled ui_slop taxonomy (static visual
	// slop: layout, spacing, typography, color) via agent_hint.
	UISlopMode bool `json:"ui_slop_mode"`

	// DefaultCscPath/DefaultDotnetPath are written by the Hera Settings window.
	// The CLI doesn't edit them, but it must round-trip them so a CLI-side Save
	// (e.g. toggling an asset or Game Feel UI Mode) doesn't drop a user's compiler paths.
	DefaultCscPath    string `json:"defaultCscPath,omitempty"`
	DefaultDotnetPath string `json:"defaultDotnetPath,omitempty"`
	// contains filtered or unexported fields
}

AssetConfig holds the full configuration.

func Load

func Load() (*AssetConfig, error)

Load reads the asset config from disk. Returns defaults if file doesn't exist.

func SetAssetEnabled

func SetAssetEnabled(id string, enabled bool) (*AssetConfig, error)

SetAssetEnabled sets the enabled state of an asset by ID.

func SetGameFeelMode added in v0.0.37

func SetGameFeelMode(enabled bool) (*AssetConfig, error)

SetGameFeelMode sets the Game Feel Mode (Beta) flag and persists it.

func SetGameFeelUIMode added in v0.0.37

func SetGameFeelUIMode(enabled bool) (*AssetConfig, error)

SetGameFeelUIMode sets the Game Feel UI Mode (Beta) flag and persists it.

func SetLoopEngineeringMode added in v0.0.30

func SetLoopEngineeringMode(mode LoopEngineeringMode) (*AssetConfig, error)

SetLoopEngineeringMode sets the Ultra Hera verification mode and persists it.

func SetUISlopMode added in v0.0.41

func SetUISlopMode(enabled bool) (*AssetConfig, error)

SetUISlopMode sets the Unity De-slop Mode (Beta) flag and persists it.

func SetUISystem added in v0.0.40

func SetUISystem(system UISystem) (*AssetConfig, error)

SetUISystem sets the UI authoring backend and persists it.

func ToggleAsset

func ToggleAsset(id string) (*AssetConfig, error)

ToggleAsset flips the enabled state of an asset by ID.

func (AssetConfig) MarshalJSON added in v0.0.40

func (cfg AssetConfig) MarshalJSON() ([]byte, error)

func (*AssetConfig) UnmarshalJSON added in v0.0.40

func (cfg *AssetConfig) UnmarshalJSON(data []byte) error

type AssetEntry

type AssetEntry struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	Enabled       bool   `json:"enabled"`
	Installed     bool   `json:"installed"`
	Category      string `json:"category"`
	Description   string `json:"description"`
	DocURL        string `json:"doc_url,omitempty"`
	ReferencePath string `json:"reference_path,omitempty"`
	// contains filtered or unexported fields
}

AssetEntry represents a single asset plugin entry.

func DefaultAssets

func DefaultAssets() []AssetEntry

DefaultAssets returns the built-in list of known asset plugins.

func GetEnabledAssets

func GetEnabledAssets() ([]AssetEntry, error)

GetEnabledAssets returns all enabled asset entries.

func (AssetEntry) MarshalJSON added in v0.0.40

func (entry AssetEntry) MarshalJSON() ([]byte, error)

func (*AssetEntry) UnmarshalJSON added in v0.0.40

func (entry *AssetEntry) UnmarshalJSON(data []byte) error

type LoopEngineeringMode added in v0.0.30

type LoopEngineeringMode string

LoopEngineeringMode controls the Ultra Hera agent verification guidance.

const (
	LoopEngineeringOff   LoopEngineeringMode = "off"
	LoopEngineeringLight LoopEngineeringMode = "light"
	LoopEngineeringUltra LoopEngineeringMode = "ultra"
)

func LoadLoopEngineeringModeNoCreate added in v0.0.30

func LoadLoopEngineeringModeNoCreate() LoopEngineeringMode

LoadLoopEngineeringModeNoCreate reads only Ultra Hera mode for agent-rules generation. Missing or unreadable config returns the default without writing.

func NormalizeLoopEngineeringMode added in v0.0.30

func NormalizeLoopEngineeringMode(mode string) LoopEngineeringMode

NormalizeLoopEngineeringMode accepts persisted/user-provided mode text and falls back to Light, the product default.

type UISystem added in v0.0.40

type UISystem string

UISystem selects the UI authoring backend used by ui_doc and manage_ui. UGUI remains the default so existing UI workflows keep their behavior.

const (
	UISystemUGUI UISystem = "ugui"
	UISystemUITK UISystem = "uitk"
)

func NormalizeUISystem added in v0.0.40

func NormalizeUISystem(value string) UISystem

NormalizeUISystem accepts persisted UI-system text and falls back to uGUI, preserving all existing UI behavior when the key is missing or malformed.

func ParseUISystem added in v0.0.40

func ParseUISystem(value string) (UISystem, error)

ParseUISystem validates a user-provided UI backend value.

Jump to

Keyboard shortcuts

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