strategy

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap(projectDir string) error

Bootstrap creates .agentops/ with default files. Idempotent: does not overwrite existing files.

Types

type HooksConfig

type HooksConfig struct {
	PreDispatch []string `yaml:"pre_dispatch"`
	PostClose   []string `yaml:"post_close"`
}

HooksConfig defines pre/post lifecycle hooks.

type StorageConfig

type StorageConfig struct {
	Backend      string `yaml:"backend"`        // "separate-repo" or "in-repo"
	CaseRepoPath string `yaml:"case_repo_path"` // relative path to case repo
}

StorageConfig controls where case records are stored.

type Strategy

type Strategy struct {
	Root           string // absolute path to project root (parent of .agentops/)
	Storage        StorageConfig
	Transitions    TransitionsConfig
	Risk           map[string]any
	Routing        map[string]any
	Budget         map[string]any
	Hooks          HooksConfig
	SchemaTemplate string // raw content of schema.md
}

Strategy holds the fully loaded .agentops/ configuration.

func Discover

func Discover(startDir string) (*Strategy, error)

Discover walks up from startDir looking for .agentops/ and loads the strategy.

type TransitionDef

type TransitionDef struct {
	From any    `yaml:"from"` // string or []string
	To   string `yaml:"to"`
}

TransitionDef describes one allowed state transition.

func (TransitionDef) FromStates

func (t TransitionDef) FromStates() []string

FromStates returns the from states as a string slice.

type TransitionsConfig

type TransitionsConfig struct {
	Categories  map[string][]string      `yaml:"categories"`
	Initial     string                   `yaml:"initial"`
	Transitions map[string]TransitionDef `yaml:"transitions"`
}

TransitionsConfig defines the state machine for case lifecycle.

Jump to

Keyboard shortcuts

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