scenariofile

package
v0.67.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package scenariofile parses graith scenario TOML files. It is shared by the CLI (gr scenario start) and the daemon (scenario trigger action) so both build a protocol.ScenarioStartMsg from the same code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SessionInputs

func SessionInputs(sf *File) ([]protocol.ScenarioSessionInput, error)

SessionInputs maps a parsed File's sessions to protocol.ScenarioSessionInput. agent_hooks defaults to true when unset.

Types

type File

type File struct {
	Version  int       `toml:"version"`
	Scenario Meta      `toml:"scenario"`
	Sessions []Session `toml:"sessions"`
}

File is the on-disk scenario definition.

func Parse

func Parse(data []byte) (*File, error)

Parse decodes and validates a scenario TOML document. Unknown fields are rejected so typos surface as errors.

type Meta

type Meta struct {
	Name string `toml:"name"`
	Goal string `toml:"goal"`
}

Meta is the [scenario] block.

type Session

type Session struct {
	Name       string `toml:"name"`
	Repo       string `toml:"repo"`
	Agent      string `toml:"agent"`
	Model      string `toml:"model"`
	Base       string `toml:"base"`
	Role       string `toml:"role"`
	Task       string `toml:"task"`
	AgentHooks *bool  `toml:"agent_hooks"`
	Shared     bool   `toml:"shared"`
}

Session is one [[sessions]] entry.

Jump to

Keyboard shortcuts

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