prompt

package
v0.3.63 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgentsMD

func NewAgentsMD(cfg AgentsMDConfig, deps AgentsMDDeps) (agentkit.SectionProvider, error)

NewAgentsMD registers prompt/section/agents-md: an alias of prompt/section/file preconfigured to walk up the workspace directory hierarchy looking for instruction files (AGENTS.md / CLAUDE.md).

func NewFile added in v0.3.60

func NewFile(cfg FileConfig, deps FileDeps) (agentkit.SectionProvider, error)

NewFile registers prompt/section/file: inject file contents discovered from the workspace directory into the system prompt.

func NewMemoryMD added in v0.1.10

func NewMemoryMD(cfg MemoryMDConfig, deps MemoryMDDeps) (agentkit.SectionProvider, error)

NewMemoryMD registers prompt/section/memory: inject global + tenant-local memory.md.

func NewSkillsSection

NewSkillsSection registers prompt/section/skills: Inject a catalog of available skills so the model knows what it can load.

func NewStatic

func NewStatic(cfg StaticConfig) (agentkit.SectionProvider, error)

func NewSubagentsSection

NewSubagentsSection registers prompt/section/subagents: Inject the catalog of delegatable subagents so the model knows who it can hand work to.

Best practices:

  • Mount this wherever tool/subagent is mounted: the delegate tool's description is static, so without this section the model has no list of valid agent names.
  • deps.llm is optional; when the main model is text-only, this section adds delegation hints for image attachments.

Types

type AgentsMDConfig

type AgentsMDConfig struct {
	// Root is directory to start the upward search from.
	Root string `json:"root"`
	// Filenames overrides the default instruction files to search in each directory.
	// Example for Automon runtimes: ["Automon.md", "AUTOMON.md"].
	Filenames []string `json:"filenames"`
}

func (*AgentsMDConfig) SetDefaults added in v0.3.48

func (c *AgentsMDConfig) SetDefaults()

SetDefaults implements pluginkit.Defaulter.

type AgentsMDDeps

type AgentsMDDeps = FileDeps

AgentsMDDeps is an alias of FileDeps, kept for backward compatibility.

type FileConfig added in v0.3.60

type FileConfig struct {
	// Name is the section label, used for ordering and debugging.
	Name string `json:"name"`
	// Root is the workspace-relative directory to start reading from.
	Root string `json:"root"`
	// Filenames are candidate files (names or relative paths) read in each
	// visited directory; missing or empty files are silently skipped.
	Filenames []string `json:"filenames"`
	// WalkUp continues the search in parent directories up to the filesystem
	// root. Wire an unrestricted filesystem/local instance: the upward walk
	// passes absolute host paths; non-local backends simply miss every
	// candidate and inject nothing.
	WalkUp bool `json:"walkUp"`
}

FileConfig configures prompt/section/file: inject the contents of one or more workspace files into the system prompt.

func (*FileConfig) SetDefaults added in v0.3.60

func (c *FileConfig) SetDefaults()

SetDefaults implements pluginkit.Defaulter.

type FileDeps added in v0.3.60

type FileDeps struct {
	Workspace workspace.Service `json:"workspace"`
	// FS reads candidate files; see FileConfig.WalkUp for why an unrestricted
	// filesystem/local instance is recommended.
	FS filesystem.Service `json:"fs"`
}

FileDeps are the dependencies of prompt/section/file.

type MemoryMDConfig added in v0.1.10

type MemoryMDConfig struct {
	// Root is deprecated (ignored). Use memory.default PromptBody.
	Root string `json:"root"`
	// Filenames is deprecated (ignored).
	Filenames []string `json:"filenames"`
}

type MemoryMDDeps added in v0.1.10

type MemoryMDDeps struct {
	Memory capmemory.Reader `json:"memory"`
}

type SkillsSectionConfig

type SkillsSectionConfig struct{}

type SkillsSectionDeps

type SkillsSectionDeps struct {
	Skills skill.Registry `json:"skills"`
}

type StaticConfig

type StaticConfig struct {
	// Name is section label, used for ordering and debugging.
	Name string `json:"name"`
	// Content is the prompt text.
	Content string `json:"content"`
}

func (*StaticConfig) SetDefaults added in v0.3.48

func (c *StaticConfig) SetDefaults()

NewStatic registers prompt/section/static: Inject a fixed block of system prompt text from config. SetDefaults implements pluginkit.Defaulter.

type SubagentsSectionConfig

type SubagentsSectionConfig struct{}

type SubagentsSectionDeps

type SubagentsSectionDeps struct {
	Subagent subagent.Spawner     `json:"subagent"`
	LLM      agentkit.LLMProvider `json:"llm,omitempty"`
}

Jump to

Keyboard shortcuts

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