setup

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package setup installs Volcano agent skills/plugins into the coding-agent harnesses present on the machine. With no targeting flags it autodetects the installed harnesses, installs into each, and returns a per-harness report; when none are detected it falls back to a manual install under ~/.volcano.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderReport

func RenderReport(w io.Writer, r Report)

RenderReport writes a human-readable per-harness summary to w. The footer is derived from the actual result statuses, so a dry run says "would install" and only a genuine no-detection fallback claims none was detected.

Types

type CommandRunner

type CommandRunner interface {
	Run(ctx context.Context, name string, args ...string) ([]byte, error)
}

CommandRunner runs an external command (used for marketplace-based installs). Production uses the package's execRunner; tests inject a fake. runtime.Deps has no general-purpose runner to reuse (only Local/Update/Git), so setup owns its default rather than wiring one through the CLI.

type HTTPDoer

type HTTPDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPDoer is the subset of *http.Client used to fetch skill content. It is satisfied by both http.DefaultClient and apiclient.HttpRequestDoer.

type Options

type Options struct {
	HTTPDoer      HTTPDoer                     // skills fetch; default http.DefaultClient
	CommandRunner CommandRunner                // marketplace shell-out; default os/exec
	WebURL        string                       // default $VOLCANO_WEB_URL or https://volcano.dev
	HomeDir       string                       // default os.UserHomeDir()
	Getenv        func(string) string          // default os.Getenv
	LookPath      func(string) (string, error) // default exec.LookPath
	Only          []string                     // explicit --harness targets (bypasses autodetect)
	Manual        bool                         // force the ~/.volcano fallback
	DryRun        bool                         // report the plan without writing
}

Options configures Run. Zero-value fields default to real implementations, so production callers can pass an empty Options; tests inject fakes.

type Report

type Report struct {
	Results []Result
	// ManualFallback is true only when no harness was detected and setup fell
	// back to ~/.volcano. An explicit --manual (or --harness manual) produces a
	// "manual" result but leaves this false: it was requested, not a fallback.
	ManualFallback bool
}

Report is the full setup outcome.

func Run

func Run(ctx context.Context, opts Options) (Report, error)

Run detects/targets harnesses and installs Volcano into each. It returns an error only for setup-wide problems (e.g. an unknown --harness); an individual harness failure is recorded in the report — inspect Report.Failed.

func (Report) Failed

func (r Report) Failed() bool

Failed reports whether any targeted harness failed to install.

type Result

type Result struct {
	Harness string
	Status  Status
	Detail  string
}

Result is one harness's outcome.

type Status

type Status string

Status is the outcome for one harness.

const (
	// StatusInstalled means the harness was set up successfully.
	StatusInstalled Status = "installed"
	// StatusSkipped means the harness was not detected on this machine.
	StatusSkipped Status = "skipped"
	// StatusFailed means the harness was targeted but its install failed.
	StatusFailed Status = "failed"
	// StatusPlanned is a dry-run entry: what would be installed.
	StatusPlanned Status = "planned"
)

Jump to

Keyboard shortcuts

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