opencode

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package opencode reads the project-scoped OpenCode V2 model catalog.

Index

Constants

View Source
const (
	Executable           = "opencode2"
	RuntimeVersionPrefix = Executable + " v0.0.0-beta-"
	MinimumBetaBuild     = 18314
	MinimumVersion       = RuntimeVersionPrefix + "18314"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	Models []Model
}

Catalog is the currently enabled, agent-capable model catalog for one repository.

func ReadCatalog

func ReadCatalog(ctx context.Context, runner execx.Runner, directory string) (Catalog, error)

ReadCatalog returns enabled models that accept text, emit text, and support tools. It verifies that OpenCode answered for directory and never includes raw command output in an error.

type LoadedSkill added in v0.10.0

type LoadedSkill struct {
	ID      string
	Content string
}

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

type Model struct {
	ID       string
	Variants []string
}

Model is the safe subset of an available OpenCode model. Provider settings, headers, credentials, account identifiers, and request bodies are never retained.

type SelectionCheck

type SelectionCheck struct {
	Role string
	Err  error
}

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.

Jump to

Keyboard shortcuts

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