Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentTool ¶
type AgentTool struct {
CurrentProvider func() provider.Provider // 动态获取当前 provider
CurrentModel func() string // 动态获取当前 model
Tools *tool.Registry
Permission tool.PermissionChecker
Tracker *cost.Tracker
MaxTokens int
SendMsg func(interface{}) // TUI 通知回调
SubAgentReg *agentPkg.SubAgentRegistry // 子 agent 注册表
}
AgentTool 派生子 Agent 工具 Provider/Model 使用 getter 动态读取当前运行时(/resume 后跟随主 Agent 切换)
func (*AgentTool) Description ¶
func (*AgentTool) InputSchema ¶
func (*AgentTool) IsReadOnly ¶
type AskUserTool ¶
type AskUserTool struct {
// AskFunc 由 TUI 注入的提问回调
// 参数:问题文本,返回:用户回答
AskFunc func(ctx context.Context, question string) (string, error)
}
AskUserTool 向用户提问工具
func (*AskUserTool) Description ¶
func (t *AskUserTool) Description() string
func (*AskUserTool) Execute ¶
func (t *AskUserTool) Execute(ctx context.Context, input json.RawMessage) (*tool.Result, error)
func (*AskUserTool) InputSchema ¶
func (t *AskUserTool) InputSchema() map[string]any
func (*AskUserTool) IsReadOnly ¶
func (t *AskUserTool) IsReadOnly() bool
func (*AskUserTool) Name ¶
func (t *AskUserTool) Name() string
type BashTool ¶
type BashTool struct{}
BashTool Shell 命令执行工具
func (*BashTool) Description ¶
func (*BashTool) InputSchema ¶
func (*BashTool) IsReadOnly ¶
type EditTool ¶
type EditTool struct {
// ConfirmFunc Diff 确认回调,返回 true 则写入,false 则取消
// 为 nil 时直接写入(向后兼容)
ConfirmFunc func(ctx context.Context, path string, diffText string) (bool, error)
}
EditTool 文件编辑工具(字符串替换)
func (*EditTool) Description ¶
func (*EditTool) InputSchema ¶
func (*EditTool) IsReadOnly ¶
type GlobTool ¶
type GlobTool struct{}
GlobTool 文件模式匹配工具
func (*GlobTool) Description ¶
func (*GlobTool) InputSchema ¶
func (*GlobTool) IsReadOnly ¶
type GrepTool ¶
type GrepTool struct{}
GrepTool 文件内容搜索工具
func (*GrepTool) Description ¶
func (*GrepTool) InputSchema ¶
func (*GrepTool) IsReadOnly ¶
type ReadTool ¶
type ReadTool struct{}
ReadTool 文件读取工具
func (*ReadTool) Description ¶
func (*ReadTool) InputSchema ¶
func (*ReadTool) IsReadOnly ¶
type RegisterConfig ¶
type RegisterConfig struct {
AskFunc func(ctx context.Context, question string) (string, error)
ConfirmFunc func(ctx context.Context, path string, diffText string) (bool, error)
// SubAgent 相关依赖(Provider/Model 用 getter 动态读取,/resume 后自动跟随)
CurrentProvider func() provider.Provider
CurrentModel func() string
Permission tool.PermissionChecker
Tracker *cost.Tracker
MaxTokens int
SendMsg func(interface{})
SubAgentReg *agentPkg.SubAgentRegistry
}
RegisterConfig 内置工具注册配置
type SendMessageTool ¶
type SendMessageTool struct {
SubAgentReg *agentPkg.SubAgentRegistry
}
SendMessageTool 向子 Agent 发送消息
func (*SendMessageTool) Description ¶
func (t *SendMessageTool) Description() string
func (*SendMessageTool) Execute ¶
func (t *SendMessageTool) Execute(_ context.Context, input json.RawMessage) (*tool.Result, error)
func (*SendMessageTool) InputSchema ¶
func (t *SendMessageTool) InputSchema() map[string]any
func (*SendMessageTool) IsReadOnly ¶
func (t *SendMessageTool) IsReadOnly() bool
func (*SendMessageTool) Name ¶
func (t *SendMessageTool) Name() string
type Task ¶
type Task struct {
ID int `json:"id"`
Title string `json:"title"`
Status string `json:"status"` // pending / in_progress / completed / stopped
Description string `json:"description,omitempty"`
}
Task 任务数据
type TaskStore ¶
type TaskStore struct {
// contains filtered or unexported fields
}
TaskStore 内存任务存储
type TaskTool ¶
type TaskTool struct{}
TaskTool 任务管理工具
func (*TaskTool) Description ¶
func (*TaskTool) InputSchema ¶
func (*TaskTool) IsReadOnly ¶
type WebFetchTool ¶
type WebFetchTool struct{}
WebFetchTool 网页抓取工具
func (*WebFetchTool) Description ¶
func (t *WebFetchTool) Description() string
func (*WebFetchTool) Execute ¶
func (t *WebFetchTool) Execute(ctx context.Context, input json.RawMessage) (*tool.Result, error)
func (*WebFetchTool) InputSchema ¶
func (t *WebFetchTool) InputSchema() map[string]any
func (*WebFetchTool) IsReadOnly ¶
func (t *WebFetchTool) IsReadOnly() bool
func (*WebFetchTool) Name ¶
func (t *WebFetchTool) Name() string
type WebSearchTool ¶
type WebSearchTool struct{}
WebSearchTool 网页搜索工具(DuckDuckGo HTML)
func (*WebSearchTool) Description ¶
func (t *WebSearchTool) Description() string
func (*WebSearchTool) Execute ¶
func (t *WebSearchTool) Execute(ctx context.Context, input json.RawMessage) (*tool.Result, error)
func (*WebSearchTool) InputSchema ¶
func (t *WebSearchTool) InputSchema() map[string]any
func (*WebSearchTool) IsReadOnly ¶
func (t *WebSearchTool) IsReadOnly() bool
func (*WebSearchTool) Name ¶
func (t *WebSearchTool) Name() string
type WriteTool ¶
type WriteTool struct{}
WriteTool 文件写入工具
func (*WriteTool) Description ¶
func (*WriteTool) InputSchema ¶
func (*WriteTool) IsReadOnly ¶
Click to show internal directories.
Click to hide internal directories.