Documentation
¶
Index ¶
- func BaseDir(homeDir string) string
- func ClearInstallStatus(homeDir string) error
- func CommunitySkillsDir(homeDir string) string
- func EnsureDir(homeDir string) error
- func InstallStatusPath(homeDir string) string
- func ListCommunitySkills(homeDir string) []string
- func LoadOpenCodeModels(homeDir string) (model.OpenCodeModelAssignments, error)
- func LoadProfiles(homeDir string) ([]model.Profile, error)
- func LockPath(homeDir string) string
- func ProfilesPath(homeDir string) string
- func Save(homeDir string, s State) error
- func SaveInstallStatus(homeDir string, status InstallStatus) error
- func SaveLock(homeDir string, lock Lockfile) error
- func SaveOpenCodeModels(homeDir string, assignments model.OpenCodeModelAssignments) error
- func SaveProfiles(homeDir string, profiles []model.Profile) error
- func SharedPromptsDir(homeDir string) string
- func SharedSkillsDir(homeDir string) string
- func StatePath(homeDir string) string
- type InstallStatus
- type Lockfile
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseDir ¶ added in v0.0.12
BaseDir returns the path to the cortex-ia home directory (~/.cortex-ia/).
func ClearInstallStatus ¶ added in v0.0.18
ClearInstallStatus removes the install status file, indicating a clean state.
func CommunitySkillsDir ¶ added in v0.0.18
CommunitySkillsDir returns the path to community skills.
func EnsureDir ¶ added in v0.0.12
EnsureDir creates the cortex-ia base directory and its core subdirectories (skills, prompts) if they do not already exist.
func InstallStatusPath ¶ added in v0.0.18
InstallStatusPath returns the path to the install status file.
func ListCommunitySkills ¶ added in v0.0.18
ListCommunitySkills returns the names of installed community skills. A directory is considered a skill if it contains a SKILL.md file.
func LoadOpenCodeModels ¶ added in v0.3.0
func LoadOpenCodeModels(homeDir string) (model.OpenCodeModelAssignments, error)
LoadOpenCodeModels reads OpenCode model assignments from ~/.cortex-ia/opencode-models.json.
func LoadProfiles ¶ added in v0.0.18
LoadProfiles reads saved profiles from disk. Returns nil, nil when the file does not exist yet.
func ProfilesPath ¶ added in v0.0.18
ProfilesPath returns the path to the profiles file.
func SaveInstallStatus ¶ added in v0.0.18
func SaveInstallStatus(homeDir string, status InstallStatus) error
SaveInstallStatus writes the install status file.
func SaveOpenCodeModels ¶ added in v0.3.0
func SaveOpenCodeModels(homeDir string, assignments model.OpenCodeModelAssignments) error
SaveOpenCodeModels writes OpenCode model assignments to ~/.cortex-ia/opencode-models.json.
func SaveProfiles ¶ added in v0.0.18
SaveProfiles writes profiles to disk, creating the directory if needed.
func SharedPromptsDir ¶ added in v0.0.5
SharedPromptsDir returns the shared prompts directory (~/.cortex-ia/prompts/).
func SharedSkillsDir ¶ added in v0.0.5
SharedSkillsDir returns the shared skills directory for all agents (~/.cortex-ia/skills/).
Types ¶
type InstallStatus ¶ added in v0.0.18
type InstallStatus struct {
Status string `json:"status"` // "in-progress" or "complete"
StartedAt string `json:"started_at"` // RFC3339 timestamp
BackupID string `json:"backup_id,omitempty"` // backup created before this install
}
InstallStatus tracks whether an installation completed cleanly. If the process crashes or a component fails mid-way, the status remains "in-progress" so that doctor/repair can detect it.
func LoadInstallStatus ¶ added in v0.0.18
func LoadInstallStatus(homeDir string) (*InstallStatus, error)
LoadInstallStatus reads the install status file. Returns nil if the file does not exist (meaning no install is in progress and none was left dirty).
type Lockfile ¶ added in v0.0.5
type Lockfile struct {
InstalledAgents []model.AgentID `json:"installed_agents"`
Preset model.PresetID `json:"preset,omitempty"`
Components []model.ComponentID `json:"components,omitempty"`
Files []string `json:"files,omitempty"`
GeneratedAt time.Time `json:"generated_at"`
LastBackupID string `json:"last_backup_id,omitempty"`
Version string `json:"version,omitempty"`
}
Lockfile captures the concrete installed artifact set for verification and repair.
type State ¶
type State struct {
InstalledAgents []model.AgentID `json:"installed_agents"`
Preset model.PresetID `json:"preset,omitempty"`
Components []model.ComponentID `json:"components,omitempty"`
LastInstall time.Time `json:"last_install"`
LastBackupID string `json:"last_backup_id,omitempty"`
Version string `json:"version,omitempty"`
LastProfile string `json:"last_profile,omitempty"`
StrictTDD bool `json:"strict_tdd,omitempty"`
}
State tracks what cortex-ia has installed.