prompt

package
v0.31.36 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(opts BuildOptions) string

Build assembles a system prompt by reading workspace bootstrap files.

Types

type BuildOptions

type BuildOptions struct {
	WorkspaceDir string   // path to workspace root
	WorkDirs     []string // additional working directories the session can access
	CurrentDir   string   // session's current working directory (overrides WorkspaceDir for relative paths)
	SubAgent     bool     // if true, only inject AGENTS.md and TOOLS.md
	// PlanClarifyMode is one of "smart" / "auto" / "ask" — controls whether
	// the LLM asks clarifying questions before drafting a plan. Empty
	// defaults to "smart". Ignored for sub-agent prompts.
	PlanClarifyMode      string
	Query                string
	SessionID            string
	MemorySearcher       memory.Searcher
	ForceRelevantMemory  bool
	StaticBudgetTokens   int
	RelevantBudgetTokens int
	TotalBudgetTokens    int
}

BuildOptions configures system prompt generation.

type BuildResult

type BuildResult struct {
	Prompt              string
	StaticTokens        int
	RelevantTokens      int
	RelevantMemoryCount int
	TotalTokens         int
}

BuildResult captures prompt assembly output and budget usage.

func BuildResultFor

func BuildResultFor(opts BuildOptions) BuildResult

BuildResultFor assembles a system prompt and returns budget usage details.

The identity line (\"You are TARS, a personal AI assistant.\") was removed from the hardcoded header in ID-002(a). It now lives in the workspace IDENTITY.md default content, which is loaded as the \"## Identity\" bootstrap section below — that lets users override their assistant’s identity without recompiling. Response Formatting rules and the dynamic \"Current time\" line stay in code: they describe runtime constraints, not user-tunable persona.

Jump to

Keyboard shortcuts

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