fileconfig

package
v0.0.75 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package fileconfig provides file-backed SDK host configuration.

The loader accepts CRD-shaped ModeTemplate YAML and plain mode specs, while exposing only SDK-native types to clients. Built-in "chat" and "plan" modes are always available and can be overridden by files of the same name.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildModeDirective

func BuildModeDirective(spec *sdkmode.TemplateSpec) string

func BuiltinModes added in v0.0.36

func BuiltinModes() []sdkmode.TemplateSpec

BuiltinModes returns the built-in mode templates shipped with the SDK. "chat" is the interactive default; "plan" is a read-only planning preset. Files in the modes directory override built-ins of the same name.

func DefaultRootDir

func DefaultRootDir() string

func LoadRoleCatalog

func LoadRoleCatalog(dir string) (agentsdk.RoleCatalog, error)

Types

type Option

type Option func(*Source)

func WithActiveMode

func WithActiveMode(name string) Option

type Source

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

Source loads modes, roles, and host configuration from a config directory.

Directory layout:

~/.gratefulagents/
  modes/*.yaml
  agents/*.md

func New

func New(rootDir, workDir string, opts ...Option) *Source

func (*Source) AgentDir

func (s *Source) AgentDir() string

func (*Source) GetMode

func (s *Source) GetMode(ctx context.Context, name string) (*sdkmode.TemplateSpec, error)

func (*Source) GuardrailRules

func (s *Source) GuardrailRules(context.Context) ([]agentsdk.GuardrailRule, error)

func (*Source) HandoffHistory

func (s *Source) HandoffHistory(context.Context) ([]agentsdk.RunItem, error)

func (*Source) ListModes

func (s *Source) ListModes(ctx context.Context) ([]sdkmode.TemplateSpec, error)

func (*Source) ModeDir

func (s *Source) ModeDir() string

func (*Source) ModeDirective added in v0.0.36

func (s *Source) ModeDirective(ctx context.Context) (string, error)

func (*Source) ModeSnapshot

func (s *Source) ModeSnapshot(ctx context.Context) (*sdkmode.TemplateSpec, error)

func (*Source) PermissionMode

func (s *Source) PermissionMode(ctx context.Context) (agentsdk.PermissionMode, error)

func (*Source) RoleCatalog

func (s *Source) RoleCatalog(ctx context.Context) (agentsdk.RoleCatalog, error)

func (*Source) RootDir

func (s *Source) RootDir() string

Jump to

Keyboard shortcuts

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