Documentation
¶
Index ¶
- Constants
- func ActivationMessage(skill Skill, args []string) (string, error)
- func SaveSkillsConfig(cfg SkillsConfig) error
- func ToCoreMessages(messages []Message) []core.Message
- func ToCoreTurnMemory(memory *TurnMemory) *core.TurnMemory
- func ToToolDiffLines(lines []EditDiffLine) []tools.EditDiffLine
- type AgentCore
- type AskUserQuestion
- type AskUserRequest
- type AskUserRequester
- type AskUserResult
- type AutoCompactionEvent
- type ContextBreakdown
- type DiffEmitter
- type EditDiffLine
- type EditDiffLineKind
- type HistoricalToolActivity
- type Message
- type Mode
- type PermissionRequester
- type Role
- type Skill
- type SkillStatus
- type SkillsConfig
- type SkillsDiscovery
- type StreamEvent
- type StreamEventType
- type SubagentProfile
- type SubagentsDiscovery
- type TokenUsage
- type ToolActivity
- type ToolCall
- type TurnMemory
Constants ¶
View Source
const ( ToolNameAskUser = tools.AskUserToolName ToolNameBash = tools.BashToolName ToolNameCallMCP = tools.CallMCPToolName ToolNameDelegate = tools.DelegateToolName ToolNameEditFile = tools.EditFileToolName ToolNameGlob = tools.GlobToolName ToolNameGrep = tools.GrepToolName ToolNameReadFile = tools.ReadFileToolName ToolNameTodoWrite = tools.TodoWriteToolName ToolNameWebFetch = tools.WebFetchToolName ToolNameWriteFile = tools.WriteFileToolName )
Variables ¶
This section is empty.
Functions ¶
func SaveSkillsConfig ¶
func SaveSkillsConfig(cfg SkillsConfig) error
func ToCoreMessages ¶
func ToCoreTurnMemory ¶
func ToCoreTurnMemory(memory *TurnMemory) *core.TurnMemory
func ToToolDiffLines ¶
func ToToolDiffLines(lines []EditDiffLine) []tools.EditDiffLine
Types ¶
type AgentCore ¶
type AgentCore interface {
IsReady() bool
UpdateClient() error
ClearClient()
IsAdversaryReady() bool
SetAdversaryClient() error
ResetClientState()
Mode() Mode
SetMode(Mode)
FormatUserMessage(content string) string
AppendMessage(message Message)
GetMessages() []Message
GetMessageText() []Message
ClearMessages()
ReplaceMessages(messages []Message)
ApplyCompaction(summary string) error
ClearContextMetrics()
WithoutSystemMessages(messages []Message) []Message
Submit(ctx context.Context, sessionID string, input string) (<-chan StreamEvent, error)
Compact(ctx context.Context, sessionID string, hint string) (<-chan StreamEvent, error)
Btw(ctx context.Context, question string) (<-chan StreamEvent, error)
Adversary(ctx context.Context, focus string) (<-chan StreamEvent, error)
GetContextBreakdown() ContextBreakdown
GetLastUsage() *TokenUsage
SetLastUsage(usage *TokenUsage)
ReloadSkills() SkillsDiscovery
GetSkills() SkillsDiscovery
GetSkillsConfig() SkillsConfig
SetSkillStatus(name string, status SkillStatus) error
RemoveSkillStatus(name string) error
FindEnabledSkill(name string) (Skill, bool)
SkillSuggestions() []Skill
SkillsCatalog() string
ReloadSubagents() SubagentsDiscovery
GetSubagents() SubagentsDiscovery
SubagentsCatalog() string
WorkingDir() string
RegisteredToolNames() []string
Config() *config.ResolvedConfig
SetConfig(cfg *config.ResolvedConfig)
GlobalConfig() *config.GlobalConfig
SetGlobalConfig(cfg *config.GlobalConfig)
SetupTools(
ctx context.Context,
permissionRequester PermissionRequester,
diffEmitter DiffEmitter,
askUserRequester AskUserRequester,
mcpRuntime keenmcp.Runtime,
forwardActivity bool,
usageSink chan<- usage.Record,
) <-chan ToolActivity
}
AgentCore is the UI-facing boundary to the backend agent.
func New ¶
func New(client llm.LLMClient, workingDir string, cfg *config.ResolvedConfig, globalCfg *config.GlobalConfig) AgentCore
type AskUserQuestion ¶
type AskUserRequest ¶
type AskUserRequest struct {
Questions []AskUserQuestion `json:"questions"`
}
type AskUserRequester ¶
type AskUserRequester interface {
RequestUser(ctx context.Context, questionnaire AskUserRequest) (AskUserResult, error)
}
type AskUserResult ¶
type AutoCompactionEvent ¶
type AutoCompactionEvent struct {
Cancel func()
Replacement []Message
Usage *TokenUsage
Error error
}
type ContextBreakdown ¶
type DiffEmitter ¶
type DiffEmitter interface {
EmitDiff(lines []EditDiffLine)
}
type EditDiffLine ¶
type EditDiffLine struct {
Kind EditDiffLineKind
OldLineNum int
NewLineNum int
Content string
}
func FromToolDiffLines ¶
func FromToolDiffLines(lines []tools.EditDiffLine) []EditDiffLine
type EditDiffLineKind ¶
type EditDiffLineKind int
const ( EditDiffLineContext EditDiffLineKind = iota EditDiffLineAdded EditDiffLineRemoved EditDiffLineHunk )
type HistoricalToolActivity ¶
type HistoricalToolActivity struct {
TextOffset int `json:"text_offset"`
Tool string `json:"tool"`
Input map[string]any `json:"input,omitempty"`
Status string `json:"status"`
ExitCode *int `json:"exit_code,omitempty"`
HasRawOutput bool `json:"-"`
RawOutput any `json:"-"`
RetainedOutput any `json:"retained_output,omitempty"`
}
type Message ¶
type Message struct {
Role Role
Content string
TurnMemory *TurnMemory
}
func FromCoreMessages ¶
type PermissionRequester ¶
type SkillStatus ¶
type SkillStatus bool
const ( SkillStatusDisabled SkillStatus = false SkillStatusEnabled SkillStatus = true )
type SkillsConfig ¶
func LoadSkillsConfig ¶
func LoadSkillsConfig() SkillsConfig
func (SkillsConfig) Enabled ¶
func (c SkillsConfig) Enabled(name string) bool
type SkillsDiscovery ¶
type StreamEvent ¶
type StreamEvent struct {
Type StreamEventType
Content string
Error error
ToolCall *ToolCall
Usage *TokenUsage
Attempt int
AutoCompaction *AutoCompactionEvent
}
type StreamEventType ¶
type StreamEventType string
const ( StreamEventTypeChunk StreamEventType = "chunk" StreamEventTypeReasoningChunk StreamEventType = "reasoning_chunk" StreamEventTypeDone StreamEventType = "done" StreamEventTypeError StreamEventType = "error" StreamEventTypeToolStart StreamEventType = "tool_start" StreamEventTypeToolEnd StreamEventType = "tool_end" StreamEventTypeUsage StreamEventType = "usage" StreamEventTypeRetry StreamEventType = "retry" StreamEventTypeIncomplete StreamEventType = "incomplete" StreamEventTypeAutoCompactionStarted StreamEventType = "auto_compaction_started" StreamEventTypeAutoCompactionApplied StreamEventType = "auto_compaction_applied" StreamEventTypeAutoCompactionCancelled StreamEventType = "auto_compaction_cancelled" StreamEventTypeAutoCompactionFailed StreamEventType = "auto_compaction_failed" )
type SubagentProfile ¶
type SubagentsDiscovery ¶
type SubagentsDiscovery struct {
Profiles []SubagentProfile
Warnings []string
}
type TokenUsage ¶
type ToolActivity ¶
type ToolActivity struct {
RunID string
CallID string
Agent string
Event StreamEvent
}
func ConvertToolActivity ¶
func ConvertToolActivity(activity subagents.ToolActivity) ToolActivity
type TurnMemory ¶
type TurnMemory struct {
ToolActivity []HistoricalToolActivity `json:"tool_activity,omitempty"`
}
func CloneTurnMemory ¶
func CloneTurnMemory(memory *TurnMemory) *TurnMemory
func (*TurnMemory) IsEmpty ¶
func (m *TurnMemory) IsEmpty() bool
Click to show internal directories.
Click to hide internal directories.