okami.mom/albedo

git clone https://git.nkp.pet/okami.mom/albedo

Aly Raffauffix: make daemon the sole config writer1a349dd

main
622 B20 linesraw
1package config
2
3// CapabilityPrefs holds per-item defaults and per-session overrides. An absent
4// value is enabled. Keys are skill names, instruction IDs, or MCP server names.
5type CapabilityPrefs struct {
6	Global   map[string]map[string]bool            `json:"global,omitempty"`
7	Sessions map[string]map[string]map[string]bool `json:"sessions,omitempty"`
8}
9
10func (p CapabilityPrefs) Enabled(session, kind, name string) bool {
11	if groups := p.Sessions[session]; groups != nil {
12		if state, ok := groups[kind][name]; ok {
13			return state
14		}
15	}
16	if state, ok := p.Global[kind][name]; ok {
17		return state
18	}
19	return true
20}