Documentation
¶
Overview ¶
Package runctx provides runtime context types and rendering for agent instruction files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Render ¶
func Render(rc *RuntimeContext) string
Render produces a markdown document describing the runtime context. Sections for optional fields (Grants, Services, etc.) are only included when their corresponding slice is non-empty or pointer is non-nil.
Types ¶
type AllowedHost ¶ added in v0.4.0
type AllowedHost struct {
Host string
Rules []string // human-readable rule summaries, e.g. "allow GET /repos/*"
}
AllowedHost describes a host that the run is allowed to access, optionally with per-path rules that restrict specific methods/paths.
type BuildOptions ¶ added in v0.7.0
type BuildOptions struct {
// WorkspaceMode is the resolved workspace mode ("bind"/"volume"). Empty is
// treated as bind. Sourced from the resolved run options, not cfg, because a
// --workspace-mode CLI flag can override the moat.yaml value.
WorkspaceMode config.WorkspaceMode
// DockerMode is the resolved Docker mode ("host"/"dind"). Empty means Docker
// is not enabled for this run.
DockerMode deps.DockerMode
}
BuildOptions carries resolved run facts that are not derivable from the moat.yaml Config alone — they come from CLI overrides or runtime resolution at container-creation time.
type Docker ¶ added in v0.7.0
type Docker struct {
Mode string // "dind" (Docker-in-Docker) or "host" (mounted host socket)
}
Docker describes Docker access available inside the container.
type NetworkPolicy ¶
type NetworkPolicy struct {
Policy string
AllowedHosts []AllowedHost
}
NetworkPolicy describes the network access policy for the run.
type RuntimeContext ¶
type RuntimeContext struct {
RunID string
Agent string
Workspace string
WorkspaceMode string // "bind" or "volume"; empty is treated as bind
Grants []Grant
Services []Service
Tools []string // installed non-service, non-docker dependencies
Docker *Docker // non-nil when Docker access is available
Ports []Port
NetworkPolicy *NetworkPolicy
MCPServers []MCPServer
HasDependencies bool // true when the config declares any dependencies
}
RuntimeContext holds the information about a moat run that is rendered into agent instruction files (CLAUDE.md, AGENTS.md, etc.).
func BuildFromConfig ¶
func BuildFromConfig(cfg *config.Config, runID string, opts BuildOptions) *RuntimeContext
BuildFromConfig constructs a RuntimeContext from a moat config, run ID, and resolved run options.