contextpack

package
v2.3.9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(pack *Pack, format string) (string, error)

Render formats the pack according to the requested format ("markdown", "xml", "json").

func RenderJSON

func RenderJSON(pack *Pack) (string, error)

RenderJSON serializes the Pack into indented JSON.

func RenderMarkdown

func RenderMarkdown(pack *Pack) string

RenderMarkdown produces human-and-agent readable Markdown.

func RenderXML

func RenderXML(pack *Pack) string

RenderXML produces compact XML suitable for system prompt injections.

Types

type Options

type Options struct {
	Project        string
	Format         string // "markdown", "xml", "json" (default "markdown")
	MaxDecisions   int    // default 5
	MaxBugfixes    int    // default 5
	MaxGodNodes    int    // default 5
	IncludeRules   bool   // default true
	IncludeRepoMap bool   // default false
	RepoMapBudget  int    // default 1024
}

Options specifies criteria for building an agent context pack.

type Pack

type Pack struct {
	Project   string                `json:"project"`
	Rules     []*domain.Observation `json:"rules,omitempty"`
	Decisions []*domain.Observation `json:"decisions,omitempty"`
	Bugfixes  []*domain.Observation `json:"bugfixes,omitempty"`
	GodNodes  []code.GodNode        `json:"god_nodes,omitempty"`
	RepoMap   string                `json:"repo_map,omitempty"`
}

Pack represents the assembled intelligence packet for an AI agent.

func BuildPack

func BuildPack(
	project string,
	allObs []*domain.Observation,
	codeGraph *code.CodeGraph,
	opts Options,
) *Pack

BuildPack filters and extracts context items into a unified Pack.

Jump to

Keyboard shortcuts

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