Documentation
¶
Overview ¶
Package opencode reads the project-scoped OpenCode V2 model catalog.
Index ¶
- Constants
- type Catalog
- type LoadedSkill
- type Model
- type Runtime
- func (runtime Runtime) CheckPlugin(ctx context.Context, runner execx.Runner, directory, id string) error
- func (runtime Runtime) ReadCatalog(ctx context.Context, runner execx.Runner, directory string) (Catalog, error)
- func (runtime Runtime) ReadSkillCatalog(ctx context.Context, runner execx.Runner, directory string) (SkillCatalog, error)
- type SelectionCheck
- type SkillCatalog
Constants ¶
const ( Executable = "opencode2" RuntimeVersionPrefix = Executable + " v0.0.0-beta-" MinimumBetaBuild = 18314 MinimumVersion = RuntimeVersionPrefix + "18314" StableFloor = "2.0.0" VerifiedStable = "2.2.6" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoadedSkill ¶ added in v0.10.0
LoadedSkill is the safe subset of one live OpenCode skill. Its source location is deliberately not retained: compatibility depends on content, not where OpenCode loaded it from.
type Model ¶
Model is the safe subset of an available OpenCode model. Provider settings, headers, credentials, account identifiers, and request bodies are never retained.
type Runtime ¶ added in v0.16.0
Runtime binds a catalog read to the V2 command whose version was checked.
func Resolve ¶ added in v0.16.0
Resolve prefers opencode2, but also supports V2 installed as opencode. Raw process output is never included in errors because it may contain credentials.
func (Runtime) CheckPlugin ¶ added in v0.16.0
func (runtime Runtime) CheckPlugin(ctx context.Context, runner execx.Runner, directory, id string) error
CheckPlugin requires a live server component in the intended project scope.
func (Runtime) ReadCatalog ¶ added in v0.16.0
func (Runtime) ReadSkillCatalog ¶ added in v0.16.0
type SelectionCheck ¶
SelectionCheck reports whether one configured OpenCode role is present in the project-scoped live catalog.
func CheckSelections ¶
func CheckSelections(roles config.Roles, catalog Catalog) []SelectionCheck
CheckSelections checks all six configured roles in configuration order. It never includes other catalog entries in diagnostics.
type SkillCatalog ¶ added in v0.10.0
type SkillCatalog struct {
Skills []LoadedSkill
}
SkillCatalog is OpenCode's winning live skill set for one repository.
func ReadSkillCatalog ¶ added in v0.10.0
func ReadSkillCatalog(ctx context.Context, runner execx.Runner, directory string) (SkillCatalog, error)
ReadSkillCatalog returns the repository-scoped live OpenCode skill catalog. It verifies that OpenCode answered for directory and never includes command output or loaded skill content in an error.