Documentation
¶
Index ¶
- Constants
- Variables
- func FormatCompactSummary(raw string) string
- func ToolMap(tools []Tool) map[string]Tool
- type Agent
- type CompactionConfig
- type Config
- type Event
- type EventHandler
- type EventType
- type Message
- type Provider
- type Request
- type Response
- type Role
- type Tool
- type ToolCall
- type ToolHandler
- type Usage
Constants ¶
View Source
const CompactionToolName = "compact"
CompactionToolName is the registered tool name for manual compaction (same string used by tools/compact).
View Source
const DefaultMaxToolRounds = 50
Variables ¶
View Source
var ErrMissingProvider = errors.New("enno: missing provider")
Functions ¶
func FormatCompactSummary ¶ added in v0.5.0
FormatCompactSummary strips <analysis>, extracts <summary> body when present, and normalizes whitespace. If no <summary> tag is found, returns the whole string trimmed (backward compatible).
Types ¶
type CompactionConfig ¶ added in v0.5.0
type CompactionConfig struct {
Enabled bool
// TranscriptDir stores JSONL transcripts before summarization. Empty uses
// ~/.enno/transcripts when Enabled (after withDefaults).
TranscriptDir string
// ModelContextTokens, when positive, sets auto-compact threshold to
// ModelContextTokens - AutoCompactBufferTokens (buffer defaults to 13000 in withDefaults).
// Takes precedence over AutoCompactInputTokens when the difference is positive.
ModelContextTokens int64
// AutoCompactBufferTokens is subtracted from ModelContextTokens for the effective threshold.
// Ignored when ModelContextTokens is zero. Zero defaults to 13000 when ModelContextTokens > 0.
AutoCompactBufferTokens int64
// AutoCompactInputTokens triggers summarization when estimated/conservative input tokens
// meet or exceed this value. Zero defaults to 50000 when ModelContextTokens is zero.
AutoCompactInputTokens int64
// KeepRecentToolResults is how many latest eligible RoleTool messages keep full content in Micro.
// Zero defaults to 3.
KeepRecentToolResults int
// MicroCompactMinChars replaces longer RoleTool contents with a placeholder. Zero defaults to 100.
MicroCompactMinChars int
// MicroCompactToolNames, when non-empty, limits Micro compaction to tool results whose tool name
// is in this list. Empty means all RoleTool messages participate (legacy behavior).
MicroCompactToolNames []string
// SkipOnSummarizeError, when true, causes automatic compaction to log an error event and continue
// without replacing history if summarization fails. Manual compact via the compact tool remains strict.
SkipOnSummarizeError bool
}
CompactionConfig enables optional context compaction (micro-trimming of old tool results, automatic summarization when estimated input size exceeds a threshold, and the manual compact tool). Nil in Config means compaction is disabled.
type Config ¶
type Config struct {
Provider Provider
SystemPrompt string
Tools []Tool
MaxToolRounds int
EventHandler EventHandler
Compaction *CompactionConfig
}
type EventHandler ¶ added in v0.3.0
type Tool ¶
type Tool struct {
Name string
Description string
Properties map[string]any
Required []string
Handler ToolHandler
}
type ToolHandler ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
enno
command
|
|
|
examples
|
|
|
anthropic
command
|
|
|
custom_tool
command
|
|
|
loadskill
command
|
|
|
simple_agent
command
|
|
|
subagent
command
|
|
|
internal
|
|
|
tools
|
|
|
glob
Package glob provides a read-only file listing tool backed by ripgrep (rg --files).
|
Package glob provides a read-only file listing tool backed by ripgrep (rg --files). |
|
grep
Package grep provides a read-only content search tool backed by ripgrep (rg).
|
Package grep provides a read-only content search tool backed by ripgrep (rg). |
|
taskgraph
Package taskgraph provides persistent DAG task tools (task_create / task_update / task_list / task_get) backed by JSON files under a configurable directory, aligned with s07-style task systems.
|
Package taskgraph provides persistent DAG task tools (task_create / task_update / task_list / task_get) backed by JSON files under a configurable directory, aligned with s07-style task systems. |
Click to show internal directories.
Click to hide internal directories.