Documentation
¶
Overview ¶
Package skills contains the embedded skill definitions for tfctl.
Index ¶
Constants ¶
const ( // TFCTLSkillPath is the path to the embedded SKILL.md file within the binary. TFCTLSkillPath = "tfctl/SKILL.md" // TFCTLKnownHashesPath is the path to the embedded hashes file within the binary. TFCTLKnownHashesPath = "tfctl/known_release_hashes" )
Variables ¶
var ( // AgentNames is a list of the names of all supported agents. AgentNames []string )
var FS embed.FS
FS is the embedded filesystem containing the skill definitions for tfctl.
Functions ¶
func EmbeddedSkillHash ¶ added in v0.4.0
func EmbeddedSkillHash() string
EmbeddedSkillHash returns the SHA256 hash of the embedded SKILL.md file.
Types ¶
type AgentSpec ¶
type AgentSpec struct {
Name string
DisplayName string
SkillsDir string
GlobalSkillsDir func() string
DetectInstalled func() bool
DetectParentProcess func() bool
}
AgentSpec defines the necessary information to install a skill for a coding agent.
func DetectAgent ¶
DetectAgent returns the first AgentSpec for any agent detected on the current system.
func DetectAgents ¶ added in v0.4.0
func DetectAgents() []AgentSpec
DetectAgents returns a list of AgentSpecs for agents detected on the current system.
func GetAgent ¶
GetAgent returns the AgentSpec for a given agent name, along with a boolean indicating whether the agent was found.
func (*AgentSpec) DetectGloballyInstalledSkill ¶ added in v0.4.0
func (a *AgentSpec) DetectGloballyInstalledSkill() *InstalledSkill
DetectGloballyInstalledSkill checks if the tfctl skill already exists for the agent in the global config directory, and returns an InstalledSkill if found.
func (*AgentSpec) DetectLocallyInstalledSkill ¶ added in v0.4.0
func (a *AgentSpec) DetectLocallyInstalledSkill() *InstalledSkill
DetectLocallyInstalledSkill checks if the tfctl skill already exists for the agent in the local project directory, and returns an InstalledSkill if found.
func (AgentSpec) InstallSkill ¶
InstallSkill installs the tfctl skill for the agent, either to the project directory or the global config directory based on the value of the global parameter.
func (*AgentSpec) InstalledSkills ¶ added in v0.4.0
func (a *AgentSpec) InstalledSkills() iter.Seq[*InstalledSkill]
InstalledSkills returns a sequence of both/either/neither installed skills for the agent. First local, then global.
type InstalledSkill ¶ added in v0.4.0
type InstalledSkill struct {
// contains filtered or unexported fields
}
InstalledSkill represents a skill that is already installed on the system.
func DetectAnyExistingSkill ¶ added in v0.4.0
func DetectAnyExistingSkill() *InstalledSkill
DetectAnyExistingSkill checks returns the first existing skill it finds from any known agent, starting with locally install skills, or nil if none are found.
func (*InstalledSkill) MatchesKnownVersion ¶ added in v0.4.0
func (e *InstalledSkill) MatchesKnownVersion() (*KnownSkillMatch, bool)
MatchesKnownVersion checks if the existing skill is from a known version.
func (*InstalledSkill) Path ¶ added in v0.4.0
func (e *InstalledSkill) Path() string
Path returns the original path of the installed skill file.
func (*InstalledSkill) ReinstallCommand ¶ added in v0.4.0
func (e *InstalledSkill) ReinstallCommand() string
ReinstallCommand returns the command to reinstall the existing skill.
func (*InstalledSkill) ResolvePath ¶ added in v0.4.0
func (e *InstalledSkill) ResolvePath() (string, error)
ResolvePath follows any symlinks and returns the absolute path of the ultimate target file.
type KnownSkillMatch ¶ added in v0.4.0
KnownSkillMatch contains information about a known version of an installed skill.
type Migration ¶ added in v0.4.0
type Migration struct {
// contains filtered or unexported fields
}
Migration represents an ongoing migration process, including a channel to signal completion and a slice to store results.
func StartMigration ¶ added in v0.4.0
StartMigration will attempt to migrate all installed skills for all agents to the latest known version. Call this function only once per execution.
type MigrationResult ¶ added in v0.4.0
MigrationResult is the result of attempting to migrate an installed skill, including any potential failure reason, and the previous version if successful.