Documentation
¶
Index ¶
- Variables
- func Account(ctx context.Context) base.Account
- func AttributionData(seed []byte) ([]byte, error)
- func Capability() map[string]string
- func CredentialFile() string
- func Login(method string) (base.LoginFlow, error)
- func MergeLSP(path string, servers map[string]json.RawMessage) error
- func MergeLSPData(seed []byte, servers map[string]json.RawMessage) ([]byte, []string, []string, error)
- func MergeMCP(path string, entries mcp.Entries) error
- func MergeMCPData(data []byte, entries mcp.Entries) ([]byte, []string, []string, error)
- func NativeConfigFingerprint(project, workspace string) (string, error)
- func NativeUserConfigRoots() ([]string, error)
- func New() base.Harness
- func ProbeConfigDir(ctx context.Context, configDir, workspace, sourceID, lockDigest, mode string, ...) (environment.Receipt, error)
- func ReadLimits(ctx context.Context) base.LimitSnapshot
- func Support(event hooks.Event, handler hooks.Handler) hooks.Support
- type HookRenderer
Constants ¶
This section is empty.
Variables ¶
var LoginMethods = []base.LoginMethod{
{ID: "openai", Label: "ChatGPT Plus/Pro"},
{ID: "github-copilot", Label: "GitHub Copilot"},
}
LoginMethods are the subscriptions OpenCode signs in to with a browser link. The first login method each offers is its browser sign-in, so the method menu is answered with Enter.
Functions ¶
func Account ¶ added in v0.14.1
Account lists the providers OpenCode holds credentials for: v2 reports them as JSON, v1 keeps them as the keys of its auth.json.
func AttributionData ¶ added in v0.9.0
func Capability ¶
Capability describes validated OpenCode observation support for this revision.
func CredentialFile ¶ added in v0.14.1
func CredentialFile() string
CredentialFile is OpenCode's provider sign-ins, shared with other machines by the gateway.
func Login ¶ added in v0.14.1
Login runs `opencode auth login` for one provider. OpenAI redirects to localhost, so the landed-on address is pasted (and replayed on the machine); Copilot is a device code for GitHub.com. Anthropic is absent: OpenCode 1.19 takes only an API key for it.
func MergeLSPData ¶ added in v0.9.0
func MergeMCPData ¶ added in v0.9.0
func NativeConfigFingerprint ¶ added in v0.9.6
NativeConfigFingerprint includes substitutions that can change server names without changing the containing config file.
func NativeUserConfigRoots ¶ added in v0.9.6
NativeUserConfigRoots lists the user directories the selected runtime reads.
func ProbeConfigDir ¶
func ProbeConfigDir(ctx context.Context, configDir, workspace, sourceID, lockDigest, mode string, expected ...string) (environment.Receipt, error)
ProbeConfigDir samples which file OpenCode resolves for each packaged skill name in a session started in the checkout. expected names the packaged skills of the plan.
func ReadLimits ¶ added in v0.10.0
func ReadLimits(ctx context.Context) base.LimitSnapshot
ReadLimits reads OpenCode's usage-limit operation from the signed-in local server. It only reads usage and sends no inference turns.
Types ¶
type HookRenderer ¶
type HookRenderer struct{}
func (HookRenderer) Render ¶
func (HookRenderer) Render(bundle hooks.Bundle, context hooks.RenderContext) (hooks.RenderOutput, error)
func (HookRenderer) Target ¶
func (HookRenderer) Target() harness.Target