Documentation
¶
Overview ¶
Package runbook provides a loader for customer-provided instructional files ("runbooks") using the trpc-agent-go document reader framework. Runbooks are loaded from configured file paths or directories and their content is injected into the agent's system prompt, giving customers a way to define instructions that Genie must follow (e.g., deployment procedures, coding standards, troubleshooting playbooks).
Without this package, there would be no mechanism for customers to supply structured, multi-format instructions beyond the single Agents.md file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSearchTool ¶
NewSearchTool creates a tool that searches runbook content stored in the vector store. Runbook documents are indexed with metadata type=runbook and source=<filename>, enabling semantic search over customer-provided instructions, deployment guides, and playbooks.
Types ¶
type Config ¶
type Config struct {
// Paths is a list of file paths or directories containing runbook files.
// Both absolute and relative paths are supported. When a directory is
// specified, all supported files within it are loaded (non-recursive).
Paths []string `yaml:"runbook_paths,omitempty" toml:"runbook_paths,omitempty"`
}
Config holds the runbook loader configuration. Customers can specify explicit paths via config files or rely on the convention directory (.genie/runbooks/) in the working directory.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader reads runbook files from the filesystem using the trpc-agent-go document reader registry. It resolves the appropriate reader for each file based on its extension and concatenates the content with per-file headers.
func NewLoader ¶
NewLoader creates a new runbook Loader scoped to the given working directory and configuration. The working directory is used to resolve relative paths and to auto-discover the .genie/runbooks/ convention directory. Without this constructor, callers would need to manually assemble paths and reader selection logic.
func (*Loader) KeepWatching ¶
func (*Loader) Load ¶
Load discovers all runbook files and ingests them into the vector store for semantic search via the search_runbook tool. Returns the number of files successfully ingested.
func (*Loader) LoadFiles ¶
func (l *Loader) LoadFiles(ctx context.Context) []RunbookFile
LoadFiles reads all configured runbook files and returns them as individual RunbookFile entries. Unlike Load(), which concatenates everything into a single string for persona injection, LoadFiles preserves per-file boundaries so callers can ingest each file separately (e.g. into a vector store).
type RunbookFile ¶
type RunbookFile struct {
Name string // base filename, e.g. "deployment-guide.md"
Path string // absolute path to the file
Content string // full text content of the runbook
}
RunbookFile represents a single loaded runbook with its source path and text content. Used by LoadFiles to return individual entries for vector store ingestion.
type ToolProvider ¶
type ToolProvider struct {
// contains filtered or unexported fields
}
ToolProvider wraps a vector IStore and satisfies the tools.ToolProviders interface so the search_runbook tool can be passed directly to tools.NewRegistry.
func NewToolProvider ¶
func NewToolProvider(store vector.IStore) *ToolProvider
NewToolProvider creates a ToolProvider for the runbook search tool.
func (*ToolProvider) GetTools ¶
func (p *ToolProvider) GetTools() []tool.Tool
GetTools returns the search_runbook tool.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher monitors runbook directories for file changes and keeps the vector store in sync. Events are debounced (500ms) and flushed in batch to avoid I/O thrashing on bulk updates.
func NewWatcher ¶
NewWatcher creates a Watcher that monitors the given directories for runbook file changes. The loader is used to read file content and the store is used to add/remove documents.