mdruntime

package
v0.11.6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableRuntimeNames added in v0.11.0

func AvailableRuntimeNames() []string

AvailableRuntimeNames returns installed container runtime names in preference order.

func InstancesFromMD

func InstancesFromMD(ctx context.Context, mdContainers []*md.Container) []runtime.Instance

InstancesFromMD converts md container handles to runtime-neutral instances.

func New

func New(ctx context.Context, log *slog.Logger, tailscaleAPIKey, githubToken, runtimeName string) (*md.Client, error)

New creates an md.Client for the md runtime adapter. runtimeName selects the container runtime ("docker" or "podman"); empty means auto-detect.

Types

type Backend

type Backend struct {
	Provider   genai.Provider      // nil if LLM not configured
	HarnessEnv map[string][]string // per-harness KEY=VALUE env vars from config
	// contains filtered or unexported fields
}

Backend adapts *md.Client to runtime.Lifecycle.

func NewBackend

func NewBackend(log *slog.Logger, client *md.Client) *Backend

NewBackend creates a Backend wrapping the given md client.

func (*Backend) Connect

Connect implements runtime.Lifecycle.

func (*Backend) Diff

func (b *Backend) Diff(ctx context.Context, id runtime.ID, repoIdx int, args ...string) (string, error)

Diff implements runtime.Lifecycle.

func (*Backend) Fetch

func (b *Backend) Fetch(ctx context.Context, id runtime.ID) error

Fetch implements runtime.Lifecycle.

func (*Backend) Fork

Fork implements runtime.Lifecycle.

func (*Backend) Inspect added in v0.11.0

func (b *Backend) Inspect(ctx context.Context, id runtime.ID) (*runtime.InstanceInspect, error)

Inspect returns observed runtime configuration for a runtime instance.

func (*Backend) Launch

func (b *Backend) Launch(ctx context.Context, repos []runtime.Repo, opts *runtime.StartOptions) (runtime.ID, error)

Launch implements runtime.Lifecycle.

func (*Backend) List added in v0.11.0

func (b *Backend) List(ctx context.Context) ([]runtime.Instance, error)

List returns known runtime instances.

func (*Backend) Metadata added in v0.11.0

func (b *Backend) Metadata(ctx context.Context, id runtime.ID, key runtime.MetadataKey) (string, error)

Metadata reads a single runtime instance metadata value, returning "" when unset.

func (*Backend) Name added in v0.11.0

func (b *Backend) Name() runtime.Name

Name returns the runtime backend name.

func (*Backend) Processes

func (b *Backend) Processes(ctx context.Context, id runtime.ID) ([]runtime.ProcessInfo, error)

Processes returns the process list inside the runtime instance.

func (*Backend) Purge

func (b *Backend) Purge(ctx context.Context, id runtime.ID) error

Purge implements runtime.Lifecycle.

func (*Backend) Revive

func (b *Backend) Revive(ctx context.Context, id runtime.ID) error

Revive implements runtime.Lifecycle.

func (*Backend) Signal

func (b *Backend) Signal(ctx context.Context, id runtime.ID, pid int, sig string) error

Signal sends a signal to a process inside the runtime instance.

func (*Backend) Stop

func (b *Backend) Stop(ctx context.Context, id runtime.ID) error

Stop implements runtime.Lifecycle.

func (*Backend) SudoPassword added in v0.11.0

func (b *Backend) SudoPassword(ctx context.Context, id runtime.ID) (string, error)

SudoPassword fetches the sudo password for a runtime instance over SSH.

func (*Backend) VNCPort

func (b *Backend) VNCPort(ctx context.Context, id runtime.ID) int

VNCPort implements runtime.Lifecycle.

func (*Backend) WatchEvents added in v0.11.0

func (b *Backend) WatchEvents(ctx context.Context, filter runtime.EventFilter) (<-chan runtime.Event, error)

WatchEvents streams lifecycle events for instances matching filter.

func (*Backend) WatchStats added in v0.11.0

func (b *Backend) WatchStats(ctx context.Context, ids []runtime.ID) (iter.Seq2[runtime.StatsSample, error], error)

WatchStats streams resource stats for the named runtime instances.

type SlogWriter

type SlogWriter struct {
	Context context.Context
	Logger  *slog.Logger
	// Phase labels the log entries (e.g. "launch", "warmup").
	Phase string
	// contains filtered or unexported fields
}

SlogWriter is an io.Writer that logs each complete line via slog.Repository. Use it instead of io.Discard so md output is captured in structured logs.

func (*SlogWriter) Write

func (w *SlogWriter) Write(p []byte) (int, error)

Write logs complete non-empty lines from p and buffers incomplete tails.

Jump to

Keyboard shortcuts

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