agents

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultProfiles

func DefaultProfiles() map[string]AgentProfile

DefaultProfiles returns the built-in agent profiles.

func Load

func Load(cwd, home string) (map[string]AgentDef, error)

Load scans cwd/.deepseek/agent and home/.deepseek/agent for *.md files and returns a name→AgentDef map. Same-name agents: cwd wins. Missing directories are silently skipped.

Types

type AgentDef

type AgentDef struct {
	Name              string   // relative path minus .md (filled by Load)
	Description       string   // frontmatter "description"
	Mode              string   // frontmatter "mode": "subagent" (default) or "plan"
	Model             string   // frontmatter "model" (empty = inherit parent)
	Tools             []string // frontmatter "tools": comma-separated whitelist; nil = inherit parent full set
	Worktree          bool     // frontmatter "worktree": true|false — isolate in git worktree
	Prompt            string   // body after frontmatter (trimmed)
	Path              string   // absolute path (filled by Load)
	Hidden            bool
	MaxSteps          int
	PermissionRuleset string
	Temperature       *float64
	TopP              *float64
	DefaultAgent      string

	// OmitProjectContext drops the parent's per-turn project context block
	// (cwd/date/git status/diff) from the system prompt the child inherits.
	// It saves a potentially large git diff on every request to a read-only or
	// explore subagent that does not need it. It only affects a child that
	// inherits the parent prompt (no own `prompt:`); a def with its own prompt
	// never carried project context, so the flag is a no-op there. Named for
	// exactly what it omits — the project *context* block, not skills or memory.
	OmitProjectContext bool
}

AgentDef is a sub-agent definition loaded from .deepseek/agent/<name>.md.

func ParseAgent

func ParseAgent(content string) (AgentDef, error)

ParseAgent parses a .md file into an AgentDef. If the content starts with "---\n", the block between the first and second "---" is parsed as frontmatter; otherwise the entire content becomes Prompt.

type AgentProfile

type AgentProfile struct {
	Name             string
	Model            string
	ReasoningEffort  string
	SystemOverlay    string
	ToolTiers        []string // "core", "profile", "lazy"
	AllowedTools     []string // explicit tool whitelist; nil = all from tiers
	PermissionPolicy string
	ContextPolicy    string
	CompactionPolicy string
	SubagentPolicy   string
	CachePolicy      string
}

AgentProfile is a first-class runtime unit that governs tool tiers, permissions, and context policies for an agent session.

Jump to

Keyboard shortcuts

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