profile

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package profile is part of the GoFastr harness.

See docs/harness-architecture.md for the architecture this package implements.

Package profile loads and validates harness profile TOML files. Per § Profiles, a profile is config not code; new profiles ship as new .toml files without touching the engine.

We use a minimal stdlib-only TOML reader covering exactly the subset the v0.1 schema requires:

  • top-level scalars: schema_version, name, default_model, prompt_header, permissions, allow_project_hooks
  • top-level string arrays: context_sources, skill_packs, tool_packs
  • inline tables in an array: mcp_servers = [{...}, {...}]

More complex TOML (deeply nested tables, table arrays with multiple lines, datetime types) is intentionally rejected — keep the surface tight, fail loudly on overreach.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MCPServerSpec

type MCPServerSpec struct {
	Name      string
	Cmd       string
	Args      []string
	SHA256    string // required when loaded from project scope
	Discovery string // "eager" | "lazy"
}

MCPServerSpec describes one MCP server the profile auto-starts.

type Profile

type Profile struct {
	SchemaVersion     int
	Name              string
	DefaultModel      string
	PromptHeader      string
	ContextSources    []string
	SkillPacks        []string
	MCPServers        []MCPServerSpec
	ToolPacks         []string
	PermissionsPreset string
	AllowProjectHooks bool
}

Profile is the parsed schema.

func Embedded added in v0.3.1

func Embedded(name string) (*Profile, error)

Embedded returns a built-in profile by name ("default" or "framework"). It is the fallback used when no on-disk profile is found. Unknown names return an error.

func Load

func Load(path string) (*Profile, error)

Load reads and parses a profile from disk.

func Parse

func Parse(r io.Reader) (*Profile, error)

Parse reads a profile from any io.Reader.

func (*Profile) Validate

func (p *Profile) Validate() error

Validate checks invariants the loader enforces beyond syntax.

Jump to

Keyboard shortcuts

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