opencode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 21 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetFixturesDir

func SetFixturesDir(dir string)

SetFixturesDir overrides the directory from which fixtures are loaded.

Types

type AppError

type AppError struct {
	Op      string
	Message string
	OC      *OCError
	Err     error
}

func (*AppError) Error

func (e *AppError) Error() string

func (*AppError) Render

func (e *AppError) Render() string

func (*AppError) Unwrap

func (e *AppError) Unwrap() error

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseURL, repoDir, agent string) *Client

func (*Client) CreateSession

func (c *Client) CreateSession(ctx context.Context, agentName string) (string, error)

func (*Client) DeleteSession

func (c *Client) DeleteSession(ctx context.Context, sessionID string) error

func (*Client) GenerateMessages

func (c *Client) GenerateMessages(ctx context.Context, sessionID string, params GenerateParams) ([]CommitMessage, error)

type CommitMessage

type CommitMessage = generation.Message

type GenerateParams

type GenerateParams = generation.Request

type Generator added in v0.1.0

type Generator struct {
	// contains filtered or unexported fields
}

func NewGenerator added in v0.1.0

func NewGenerator(config GeneratorConfig) *Generator

func (*Generator) Generate added in v0.1.0

func (g *Generator) Generate(ctx context.Context, request generation.Request, report generation.Reporter) (result generation.Result, err error)

func (*Generator) Steps added in v0.1.0

func (g *Generator) Steps() []string

type GeneratorConfig added in v0.1.0

type GeneratorConfig struct {
	Executable           string
	RepoDir              string
	Agent                string
	InstallAgent         string
	SessionDeleteTimeout time.Duration
}

type OCError

type OCError struct {
	Kind        OCErrorKind
	RequestType string
	SessionID   string
	Agent       string
	Code        string
	Message     string
	Status      int
	RawJSON     string
}

func (*OCError) ErrorText

func (e *OCError) ErrorText() string

func (*OCError) RenderDetails

func (e *OCError) RenderDetails() string

type OCErrorKind

type OCErrorKind string
const (
	OCErrAPI                OCErrorKind = "api_error"
	OCErrHTTP               OCErrorKind = "http_error"
	OCErrNoStructuredOutput OCErrorKind = "no_structured_output"
	OCErrNoSubjects         OCErrorKind = "no_subjects"
)

Jump to

Keyboard shortcuts

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