profiles

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Overview

Package profiles loads and saves the local per-agent profile config (profiles.json). Only the profile name reaches the server; the path is local.

Index

Constants

View Source
const Version = 1

Version is the on-disk schema version of profiles.json.

Variables

This section is empty.

Functions

func Save

func Save(c Config) error

Save atomically writes profiles.json with 0600 permissions.

Types

type Config

type Config struct {
	Version int                  `json:"version"`
	Agents  map[string][]Profile `json:"agents"`
}

Config is the profiles.json document, keyed by agent name.

func Load

func Load() (Config, error)

Load reads profiles.json; a missing file yields an empty config.

func (Config) Find

func (c Config) Find(agent, name string) (Profile, bool)

func (Config) For

func (c Config) For(agent string) []Profile

For returns an agent's configured profiles in name order.

func (*Config) Remove

func (c *Config) Remove(agent, name string) bool

Remove deletes a named profile; returns false when nothing matched.

func (Config) Resolve

func (c Config) Resolve(agent string, imp rooter) []Resolved

Resolve returns an agent's effective profiles: a synthesized "default" (overridable via config) first, then the configured extras by name.

func (*Config) Set

func (c *Config) Set(agent string, p Profile) bool

Set inserts or replaces a profile; returns true when it replaced one.

type Profile

type Profile struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

Profile is one named location for an agent. Path is the agent's home dir (e.g. ~/.codex-work); the importer derives its scan roots from it.

type Resolved

type Resolved struct {
	Name  string
	Path  string
	Roots []string
}

Resolved is one effective profile: a name plus the roots to scan for it.

Jump to

Keyboard shortcuts

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