renderer

package
v0.2.28 Latest Latest
Warning

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

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

Documentation

Overview

Package renderer generates the configuration files that are mounted into the klaus container. It mirrors the Helm chart's ConfigMap rendering: SKILL.md files, settings.json, .mcp.json, agent files, and hook scripts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasExtensions

func HasExtensions(cfg *config.Config) bool

HasExtensions returns true if there are skills or agent files that need to be mounted as an extensions directory.

Types

type ContainerClaudeConfig added in v0.0.34

type ContainerClaudeConfig struct {
	Model                  string   `yaml:"model,omitempty"`
	SystemPrompt           string   `yaml:"systemPrompt,omitempty"`
	AppendSystemPrompt     string   `yaml:"appendSystemPrompt,omitempty"`
	MaxTurns               int      `yaml:"maxTurns,omitempty"`
	PermissionMode         string   `yaml:"permissionMode,omitempty"`
	MaxBudgetUSD           float64  `yaml:"maxBudgetUsd,omitempty"`
	Effort                 string   `yaml:"effort,omitempty"`
	FallbackModel          string   `yaml:"fallbackModel,omitempty"`
	Tools                  []string `yaml:"tools,omitempty"`
	AllowedTools           []string `yaml:"allowedTools,omitempty"`
	DisallowedTools        []string `yaml:"disallowedTools,omitempty"`
	StrictMcpConfig        bool     `yaml:"strictMcpConfig,omitempty"`
	McpTimeout             int      `yaml:"mcpTimeout,omitempty"`
	MaxMcpOutputTokens     int      `yaml:"maxMcpOutputTokens,omitempty"`
	ActiveAgent            string   `yaml:"activeAgent,omitempty"`
	Mode                   string   `yaml:"mode,omitempty"`
	IncludePartialMessages bool     `yaml:"includePartialMessages,omitempty"`
	JsonSchema             string   `yaml:"jsonSchema,omitempty"`
	SettingSources         string   `yaml:"settingSources,omitempty"`
}

ContainerClaudeConfig contains the Claude Code settings that the container process needs. This is an explicit projection of config.ClaudeConfig that excludes host-side orchestration fields (SettingsFile, AddDirs, PluginDirs, LoadAdditionalDirsMemory) which are handled by the orchestrator via volume mounts and env vars.

type ContainerConfig added in v0.0.34

type ContainerConfig struct {
	Workspace string                        `yaml:"workspace"`
	Port      int                           `yaml:"port"`
	Claude    ContainerClaudeConfig         `yaml:"claude,omitempty"`
	Git       ContainerGitConfig            `yaml:"git,omitempty"`
	Agents    map[string]config.AgentConfig `yaml:"agents,omitempty"`
}

ContainerConfig is the YAML configuration rendered for the klaus container. It contains only the fields that the container process needs, replacing 30+ individual environment variables with a single structured file. Fields that drive host-side orchestration (volume mounts, env var assembly) are excluded.

func BuildContainerConfig added in v0.0.34

func BuildContainerConfig(cfg *config.Config) *ContainerConfig

BuildContainerConfig constructs the container-side config from the full klausctl Config. Workspace is always "/workspace" and Port is always 8080 because these are the fixed container-internal values regardless of the host-side configuration.

type ContainerGitConfig added in v0.0.34

type ContainerGitConfig struct {
	AuthorName  string `yaml:"authorName,omitempty"`
	AuthorEmail string `yaml:"authorEmail,omitempty"`
}

ContainerGitConfig contains the git identity settings for the container. Host-side fields (CredentialHelper, HTTPSInsteadOfSSH) are excluded because the orchestrator handles them via a generated gitconfig volume mount.

type Renderer

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

Renderer generates configuration files for the klaus container.

func New

func New(paths *config.Paths) *Renderer

New creates a renderer that writes to the given paths.

func (*Renderer) Render

func (r *Renderer) Render(cfg *config.Config) error

Render generates all configuration files from the config. It cleans the rendered directory first to ensure a fresh state.

Jump to

Keyboard shortcuts

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