Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
func NewFactory(cfg Config) sandboxpkg.Factory
NewFactory returns a Factory backed by a Docker container-per-session strategy.
func Preflight ¶
func Preflight(ctx context.Context, cfg PreflightConfig) error
Preflight checks daemon reachability and image availability. A missing image is pulled automatically; the caller is expected to have built or published the image ahead of time for dev builds (the pull will fail with a registry error in that case).
Types ¶
type Config ¶
type Config struct {
// Image is the container image to use. Required.
Image string
// ContainerPathPrefix / HostPathPrefix enable path alignment when anna
// runs inside a container and talks to the daemon on the host (DooD).
// Both fields are filled by applyDooDDefaults in the runner; callers
// outside that path should leave them empty.
ContainerPathPrefix string
HostPathPrefix string
// UserToolBinaries are manifest-declared, user-configured CLIs that are not
// baked into the versioned sandbox image. They are installed in a Linux
// helper container and exposed to sessions through a Docker-managed tool
// cache, never through host $ANNA_HOME/bin.
UserToolBinaries []ToolBinary
}
Config configures the docker sandbox factory. All fields are populated by the runner glue layer — there are no user-facing knobs. The image is version-locked to the anna binary (via internal/config.SandboxDockerImage) and the path-prefix fields are auto-derived from ANNA_HOME_HOST when anna runs inside a container (see internal/agent/sandbox_dood.go).
func (Config) TranslateToDaemonPath ¶
TranslateToDaemonPath rewrites an anna-view absolute path into the path the daemon will use as a bind-mount source. When prefix translation is not configured, the input is returned unchanged.
type PreflightConfig ¶
PreflightConfig configures a Preflight check.
type ToolBinary ¶ added in v0.17.0
type ToolBinary struct {
Name string
Tool string // mise tool key: github:owner/repo, pipx:pkg, npm:pkg, http:name
URL string // required for http backend
Version string
// Shared asset options (github + http)
StripComponents int
BinPath string
Bin string
RenameExe string
Checksum string
// GitHub-only
AssetPattern string
VersionPrefix string
NoApp bool
FilterBins string
Prerelease bool
APIURL string
// HTTP-only
Size string
Format string
VersionListURL string
VersionRegex string
VersionJSONPath string
VersionExpr string
// Pipx-only
Extras string
PipxArgs string
UVX bool
UVXArgs string
}
ToolBinary describes a user-configured CLI that must be installed in a Linux container context before docker sandbox sessions can execute it. Fields mirror manifestplugins.ManifestBinary 1:1; keep them in sync.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dockerclient wraps the moby Go SDK (github.com/moby/moby/client) to manage sandbox containers for the docker sandbox backend.
|
Package dockerclient wraps the moby Go SDK (github.com/moby/moby/client) to manage sandbox containers for the docker sandbox backend. |