model

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// Description is parsed from top-level frontmatter key "description".
	// Agent-specific descriptions override this during formatting if present.
	Description string `yaml:"-"`
	// Raw contains the full frontmatter as a generic map. Agent-specific
	// keys like "claude", "roo", "cline", "copilot" remain here.
	Raw map[string]any `yaml:"-"`
	// Content is the markdown body after frontmatter.
	Content string `yaml:"-"`
	// Path is the original file path (not in frontmatter)
	Path string `yaml:"-"`
}

Command represents a command definition in an agent-agnostic way. Frontmatter keys are preserved in Raw. Description is a common, top-level field used as a fallback by agents.

func ParseCommand

func ParseCommand(path string, content []byte) (*Command, error)

ParseCommand parses a command definition from file content into an agent-agnostic Command.

func (*Command) UnmarshalSection added in v0.0.4

func (c *Command) UnmarshalSection(key string, out interface{}) error

UnmarshalSection marshals a sub-map from c.Raw[key] to YAML and unmarshals into out. This mirrors model.Mode.UnmarshalSection and centralizes section extraction for all agents.

type Mode added in v0.0.4

type Mode struct {
	// Description is parsed from top-level frontmatter key "description".
	// Agent-specific descriptions override this during formatting if present.
	Description string `yaml:"-"`
	// Raw contains the full frontmatter as a generic map. Agent-specific
	// keys like "claude", "roo", "cline", "copilot" remain here.
	Raw map[string]any `yaml:"-"`
	// Content is the markdown body after frontmatter.
	Content string
}

Mode represents a subagent definition in an agent-agnostic way. Frontmatter keys are preserved in Raw. Description is a common, top-level field used as a fallback by agents.

func ParseMode added in v0.0.4

func ParseMode(path string, content []byte) (*Mode, error)

ParseMode parses a mode definition from file content into an agent-agnostic Mode. It mirrors ParseCommand behavior for frontmatter handling, but preserves body content exactly (no trimming) to maintain compatibility with existing tests.

func (*Mode) UnmarshalSection added in v0.0.4

func (m *Mode) UnmarshalSection(key string, out interface{}) error

UnmarshalSection marshals a sub-map from m.Raw[key] to YAML and unmarshals into out. This centralizes section extraction for all agents (claude, roo, etc). Note: Go methods cannot be generic, so out is an interface{}.

Jump to

Keyboard shortcuts

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