config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package config owns Plasmid's versioned configuration, defaults, discovery, path normalization, validation, repair, and config warnings.

Index

Constants

View Source
const CurrentVersion = 1

Variables

View Source
var (
	ErrConfigNotFound     = errors.New("config file not found")
	ErrInvalidConfig      = errors.New("invalid config")
	ErrUnsupportedVersion = errors.New("unsupported config version")
)

Functions

This section is empty.

Types

type Compaction

type Compaction struct {
	ContextTokens        int
	TriggerFraction      float64
	TargetFraction       float64
	KeepRecentContents   int
	MinimumElisionTokens int
	PreserveToolNames    []string
	Calibration          bool
}

type Config

type Config struct {
	Version    int
	WorkingDir string
	SessionDir string
	AppName    string
	UserID     string
	LSP        LSP
	MCP        MCP
	Skills     Skills
	Foreign    Foreign
	Syntax     Syntax
	Context    Context
	Tools      Tools
	Compaction Compaction
}

Config is the complete validated configuration consumed by Plasmid subsystems. Runtime paths and identity are included here but are not JSON config keys.

func (Config) Clone

func (value Config) Clone() Config

Clone returns a deep copy of the configuration's mutable collections.

type Context

type Context struct {
	MaxFileBytes       int
	MaxBytes           int
	MaxImportDepth     int
	ImportRoots        []string
	TouchesPerToolCall int
}

type Foreign

type Foreign struct {
	Enabled      bool
	Claude       bool
	Codex        bool
	Copilot      bool
	TrustedRoots []string
}

type LSP

type LSP struct {
	Mode                  LSPMode
	SettleTimeout         time.Duration
	InitializeTimeout     time.Duration
	RequestTimeout        time.Duration
	FailureThreshold      int
	MaxDiagnosticsPerFile int
	Servers               []LSPServer
}

type LSPMode

type LSPMode string
const (
	LSPAuto LSPMode = "auto"
	LSPOff  LSPMode = "off"
)

type LSPServer

type LSPServer struct {
	ID          string
	Command     string
	Args        []string
	Extensions  []string
	RootMarkers []string
	Disabled    bool
}

type MCP

type MCP struct {
	InheritForeign bool
	AllowForeign   []string
	Servers        []MCPServer
}

type MCPServer

type MCPServer struct {
	ID        string
	Transport MCPTransport
	Command   string
	Args      []string
	Env       map[string]string
	URL       string
	Headers   map[string]string
}

type MCPTransport

type MCPTransport string
const (
	MCPStdio MCPTransport = "stdio"
	MCPHTTP  MCPTransport = "http"
)

type Options

type Options struct {
	ConfigPath       string
	WorkingDir       string
	SessionDir       string
	UserID           string
	AppName          *string
	LSPMode          *LSPMode
	Foreign          *Foreign
	ToolConfirmation *bool
}

Options contains the configuration overrides accumulated by the root Harness's public functional options.

type PromptCommandMode

type PromptCommandMode string
const (
	PromptCommandsOff     PromptCommandMode = "off"
	PromptCommandsTrusted PromptCommandMode = "trusted"
	PromptCommandsOn      PromptCommandMode = "on"
)

type Result

type Result struct {
	Config     Config
	SourcePath string
	Warnings   []warning.Warning
}

Result includes the resolved source path and all non-fatal repair warnings. SourcePath is empty when discovery found no file.

func Load

func Load(ctx context.Context, options Options) (Result, error)

Load discovers, reads, repairs, and validates one config file. Options are applied after the file and therefore represent Harness functional-option precedence.

type Skills

type Skills struct {
	Roots []string
}

type Syntax

type Syntax struct {
	PromptCommands      PromptCommandMode
	CommandTimeout      time.Duration
	DocumentTimeout     time.Duration
	CommandOutputBytes  int
	DocumentOutputBytes int
}

type Tools

type Tools struct {
	CallOutputBytes    int
	SessionOutputBytes int
	BashTimeout        time.Duration
	BashMaxTimeout     time.Duration
	Confirmation       bool
}

Jump to

Keyboard shortcuts

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