Documentation
¶
Index ¶
- func AgentTools() []string
- func AllTools() []string
- func AssertContains(t *testing.T, str, substr string)
- func AssertFileContent(t *testing.T, path, expectedContent string)
- func AssertFileExists(t *testing.T, path string)
- func AssertFileNotExists(t *testing.T, path string)
- func AssertToolError(t *testing.T, result map[string]any) string
- func AssertToolSuccess(t *testing.T, result map[string]any) map[string]any
- func BenchmarkTool(b *testing.B, tool tools.Tool, input map[string]any)
- func CreateTestFiles(th *TestHelper) map[string]string
- func ExecuteToolWithInput(t *testing.T, tool tools.Tool, input map[string]any) map[string]any
- func ExecuteToolWithRealFS(t *testing.T, tool tools.Tool, input map[string]any) map[string]any
- func ExecuteToolWithWorkDir(t *testing.T, tool tools.Tool, input map[string]any, workDir string) map[string]any
- func ExecuteToolWithoutContext(t *testing.T, tool tools.Tool, input map[string]any) map[string]any
- func ExecutionTools() []string
- func FileSystemTools() []string
- func GetBoolParam(input map[string]any, key string, defaultValue bool) bool
- func GetIntParam(input map[string]any, key string, defaultValue int) int
- func GetStringParam(input map[string]any, key string, defaultValue string) string
- func GetStringSlice(input map[string]any, key string) []string
- func GetStringSliceParam(input map[string]any, key string) []string
- func InteractionTools() []string
- func McpTools() []string
- func NetworkTools() []string
- func NewAskUserQuestionTool(config map[string]any) (tools.Tool, error)
- func NewBashOutputTool(config map[string]any) (tools.Tool, error)
- func NewBashTool(config map[string]any) (tools.Tool, error)
- func NewClaudeErrorResponse(err error, recommendations ...string) map[string]any
- func NewCodeExecuteTool(config map[string]any) (tools.Tool, error)
- func NewEditTool(config map[string]any) (tools.Tool, error)
- func NewEnterPlanModeTool(config map[string]any) (tools.Tool, error)
- func NewExitPlanModeTool(config map[string]any) (tools.Tool, error)
- func NewGlobTool(config map[string]any) (tools.Tool, error)
- func NewGrepTool(config map[string]any) (tools.Tool, error)
- func NewKillShellTool(config map[string]any) (tools.Tool, error)
- func NewListMcpResourcesTool(config map[string]any) (tools.Tool, error)
- func NewMockToolContext() sandbox.Sandbox
- func NewRAGSearchTool(config map[string]any) (tools.Tool, error)
- func NewReadMcpResourceTool(config map[string]any) (tools.Tool, error)
- func NewReadTool(config map[string]any) (tools.Tool, error)
- func NewSemanticSearchTool(config map[string]any) (tools.Tool, error)
- func NewSkillTool(config map[string]any) (tools.Tool, error)
- func NewTaskTool(config map[string]any) (tools.Tool, error)
- func NewTodoWriteTool(config map[string]any) (tools.Tool, error)
- func NewToolSearchTool(config map[string]any) (tools.Tool, error)
- func NewWebFetchTool(config map[string]any) (tools.Tool, error)
- func NewWebSearchTool(config map[string]any) (tools.Tool, error)
- func NewWriteTool(config map[string]any) (tools.Tool, error)
- func PlanningTools() []string
- func RegisterAll(registry *tools.Registry)
- func ResetGlobalManagers()
- func RespondToAskUser(requestID string, answers map[string]any) error
- func SetFactoryFromAgent(factory SubAgentExecutorFactory)
- func SetGlobalGitSafetyLevel(level GitSafetyLevel)
- func SetGlobalTaskExecutorFactory(factory SubAgentExecutorFactory)
- func SkillTools() []string
- func SkipIfShort(t *testing.T)
- func ValidateRequired(input map[string]any, required []string) error
- type AskUserQuestionTool
- func (t *AskUserQuestionTool) Description() string
- func (t *AskUserQuestionTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *AskUserQuestionTool) InputSchema() map[string]any
- func (t *AskUserQuestionTool) Name() string
- func (t *AskUserQuestionTool) Prompt() string
- func (t *AskUserQuestionTool) ReceiveAnswer(requestID string, answers map[string]any) error
- type BashOutputTool
- func (t *BashOutputTool) Description() string
- func (t *BashOutputTool) Examples() []tools.ToolExample
- func (t *BashOutputTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *BashOutputTool) InputSchema() map[string]any
- func (t *BashOutputTool) Name() string
- func (t *BashOutputTool) Prompt() string
- type BashTool
- func (t *BashTool) Annotations() *tools.ToolAnnotations
- func (t *BashTool) Description() string
- func (t *BashTool) Examples() []tools.ToolExample
- func (t *BashTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *BashTool) InputSchema() map[string]any
- func (t *BashTool) Name() string
- func (t *BashTool) Prompt() string
- type CodeExecuteTool
- func (t *CodeExecuteTool) AvailableLanguages() []string
- func (t *CodeExecuteTool) Description() string
- func (t *CodeExecuteTool) Examples() []tools.ToolExample
- func (t *CodeExecuteTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *CodeExecuteTool) InputSchema() map[string]any
- func (t *CodeExecuteTool) Name() string
- func (t *CodeExecuteTool) Prompt() string
- func (t *CodeExecuteTool) SetBridgeURL(url string)
- type ConcurrentTestResult
- type CustomWorkDirSandbox
- func (cs *CustomWorkDirSandbox) Dispose() error
- func (cs *CustomWorkDirSandbox) Exec(ctx context.Context, cmd string, opts *sandbox.ExecOptions) (*sandbox.ExecResult, error)
- func (cs *CustomWorkDirSandbox) FS() sandbox.SandboxFS
- func (cs *CustomWorkDirSandbox) Kind() string
- func (cs *CustomWorkDirSandbox) Unwatch(watchID string) error
- func (cs *CustomWorkDirSandbox) Watch(paths []string, listener sandbox.FileChangeListener) (string, error)
- func (cs *CustomWorkDirSandbox) WorkDir() string
- type EditTool
- func (t *EditTool) Description() string
- func (t *EditTool) Examples() []tools.ToolExample
- func (t *EditTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *EditTool) InputSchema() map[string]any
- func (t *EditTool) Name() string
- func (t *EditTool) Prompt() string
- type EnterPlanModeResult
- type EnterPlanModeTool
- func (t *EnterPlanModeTool) Description() string
- func (t *EnterPlanModeTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *EnterPlanModeTool) InputSchema() map[string]any
- func (t *EnterPlanModeTool) Name() string
- func (t *EnterPlanModeTool) Prompt() string
- type ExitPlanModeTool
- func (t *ExitPlanModeTool) Description() string
- func (t *ExitPlanModeTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *ExitPlanModeTool) InputSchema() map[string]any
- func (t *ExitPlanModeTool) Name() string
- func (t *ExitPlanModeTool) Prompt() string
- type FileCount
- type FilePlanManager
- func (fpm *FilePlanManager) DeletePlan(planID string) error
- func (fpm *FilePlanManager) GetPlansByStatus(status string) ([]*PlanRecord, error)
- func (fpm *FilePlanManager) ListPlans() ([]*PlanRecord, error)
- func (fpm *FilePlanManager) LoadPlan(planID string) (*PlanRecord, error)
- func (fpm *FilePlanManager) StorePlan(plan *PlanRecord) error
- func (fpm *FilePlanManager) UpdatePlanStatus(planID string, status string) error
- type FileStorageManager
- func (fsm *FileStorageManager) Backup(backupPath string) error
- func (fsm *FileStorageManager) DeleteData(key string) error
- func (fsm *FileStorageManager) Exists(key string) bool
- func (fsm *FileStorageManager) ListKeys(prefix string) ([]string, error)
- func (fsm *FileStorageManager) LoadData(key string, target any) error
- func (fsm *FileStorageManager) Restore(backupPath string) error
- func (fsm *FileStorageManager) StoreData(key string, data any) error
- type FileSubagentManager
- func (sm *FileSubagentManager) CleanupSubagent(taskID string) error
- func (sm *FileSubagentManager) GetSubagent(taskID string) (*SubagentInstance, error)
- func (sm *FileSubagentManager) GetSubagentOutput(taskID string) (string, error)
- func (sm *FileSubagentManager) ListSubagents() ([]*SubagentInstance, error)
- func (sm *FileSubagentManager) ResumeSubagent(taskID string) (*SubagentInstance, error)
- func (sm *FileSubagentManager) StartSubagent(ctx context.Context, config *SubagentConfig) (*SubagentInstance, error)
- func (sm *FileSubagentManager) StopSubagent(taskID string) error
- type FileTaskManager
- func (tm *FileTaskManager) CleanupTask(taskID string) error
- func (tm *FileTaskManager) GetTask(taskID string) (*TaskInfo, error)
- func (tm *FileTaskManager) GetTaskOutput(taskID string, filter string, lines int) (string, string, error)
- func (tm *FileTaskManager) GetTaskStatus(taskID string) (string, error)
- func (tm *FileTaskManager) KillTask(taskID string, signal string, timeout int) error
- func (tm *FileTaskManager) ListTasks() ([]*TaskInfo, error)
- func (tm *FileTaskManager) StartTask(ctx context.Context, cmd string, opts *TaskOptions) (*TaskInfo, error)
- type FileTodoManager
- func (ftm *FileTodoManager) BackupTodoLists() (map[string]*TodoList, error)
- func (ftm *FileTodoManager) DeleteTodoList(listName string) error
- func (ftm *FileTodoManager) ListTodoLists() ([]string, error)
- func (ftm *FileTodoManager) LoadTodoList(listName string) (*TodoList, error)
- func (ftm *FileTodoManager) RestoreTodoLists(backup map[string]*TodoList) error
- func (ftm *FileTodoManager) StoreTodoList(list *TodoList) error
- type GitCommandRisk
- type GitSafetyCheck
- type GitSafetyLevel
- type GitSafetyValidator
- type GlobTool
- func (t *GlobTool) Annotations() *tools.ToolAnnotations
- func (t *GlobTool) Description() string
- func (t *GlobTool) Examples() []tools.ToolExample
- func (t *GlobTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *GlobTool) InputSchema() map[string]any
- func (t *GlobTool) Name() string
- func (t *GlobTool) Prompt() string
- type GrepMatch
- type GrepResult
- type GrepTool
- func (t *GrepTool) Annotations() *tools.ToolAnnotations
- func (t *GrepTool) Description() string
- func (t *GrepTool) Examples() []tools.ToolExample
- func (t *GrepTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *GrepTool) InputSchema() map[string]any
- func (t *GrepTool) Name() string
- func (t *GrepTool) Prompt() string
- type KillShellTool
- func (t *KillShellTool) Description() string
- func (t *KillShellTool) Examples() []tools.ToolExample
- func (t *KillShellTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *KillShellTool) InputSchema() map[string]any
- func (t *KillShellTool) Name() string
- func (t *KillShellTool) Prompt() string
- type ListMcpResourcesTool
- func (t *ListMcpResourcesTool) Description() string
- func (t *ListMcpResourcesTool) Examples() []tools.ToolExample
- func (t *ListMcpResourcesTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *ListMcpResourcesTool) InputSchema() map[string]any
- func (t *ListMcpResourcesTool) Name() string
- func (t *ListMcpResourcesTool) Prompt() string
- type MCPResource
- type MCPResourceContent
- type MockSandbox
- type PlanFileManager
- func (m *PlanFileManager) Delete(path string) error
- func (m *PlanFileManager) EnsureDir() error
- func (m *PlanFileManager) Exists(path string) bool
- func (m *PlanFileManager) GenerateID() string
- func (m *PlanFileManager) GeneratePath() string
- func (m *PlanFileManager) GetBasePath() string
- func (m *PlanFileManager) List() ([]PlanFileMetadata, error)
- func (m *PlanFileManager) Load(path string) (string, error)
- func (m *PlanFileManager) Save(path, content string) error
- type PlanFileMetadata
- type PlanManager
- type PlanModeManagerInterface
- type PlanRecord
- type RAGSearchTool
- func (t *RAGSearchTool) Description() string
- func (t *RAGSearchTool) Examples() []tools.ToolExample
- func (t *RAGSearchTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *RAGSearchTool) InputSchema() map[string]any
- func (t *RAGSearchTool) Name() string
- func (t *RAGSearchTool) Prompt() string
- type ReadMcpResourceTool
- func (t *ReadMcpResourceTool) Description() string
- func (t *ReadMcpResourceTool) Examples() []tools.ToolExample
- func (t *ReadMcpResourceTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *ReadMcpResourceTool) InputSchema() map[string]any
- func (t *ReadMcpResourceTool) Name() string
- func (t *ReadMcpResourceTool) Prompt() string
- type ReadTool
- func (t *ReadTool) Annotations() *tools.ToolAnnotations
- func (t *ReadTool) Description() string
- func (t *ReadTool) Examples() []tools.ToolExample
- func (t *ReadTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *ReadTool) InputSchema() map[string]any
- func (t *ReadTool) Name() string
- func (t *ReadTool) Prompt() string
- type RealFS
- func (rfs *RealFS) Glob(ctx context.Context, pattern string, opts *sandbox.GlobOptions) ([]string, error)
- func (rfs *RealFS) IsInside(path string) bool
- func (rfs *RealFS) Read(ctx context.Context, path string) (string, error)
- func (rfs *RealFS) Resolve(path string) string
- func (rfs *RealFS) Stat(ctx context.Context, path string) (sandbox.FileInfo, error)
- func (rfs *RealFS) Temp(name string) string
- func (rfs *RealFS) Write(ctx context.Context, path string, content string) error
- type RealSandbox
- func (rs *RealSandbox) Dispose() error
- func (rs *RealSandbox) Exec(ctx context.Context, cmd string, opts *sandbox.ExecOptions) (*sandbox.ExecResult, error)
- func (rs *RealSandbox) FS() sandbox.SandboxFS
- func (rs *RealSandbox) Kind() string
- func (rs *RealSandbox) Unwatch(watchID string) error
- func (rs *RealSandbox) Watch(paths []string, listener sandbox.FileChangeListener) (string, error)
- func (rs *RealSandbox) WorkDir() string
- type ResourceUsage
- type SemanticSearchTool
- func (t *SemanticSearchTool) Description() string
- func (t *SemanticSearchTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *SemanticSearchTool) InputSchema() map[string]any
- func (t *SemanticSearchTool) Name() string
- func (t *SemanticSearchTool) Prompt() string
- type SkillTool
- type StorageManager
- type SubAgentExecutorFactory
- type SubagentConfig
- type SubagentInstance
- type SubagentManager
- type SubagentResourceUsage
- type TaskDefinition
- type TaskExecuteOptions
- type TaskExecution
- type TaskExecutionHandle
- type TaskExecutor
- func (te *TaskExecutor) Execute(ctx context.Context, agentType, prompt string, opts *TaskExecuteOptions) (*TaskExecution, error)
- func (te *TaskExecutor) ExecuteAsync(ctx context.Context, agentType, prompt string, opts *TaskExecuteOptions) (*TaskExecutionHandle, error)
- func (te *TaskExecutor) GetTask(taskID string) (*TaskExecution, error)
- func (te *TaskExecutor) ListTasks() []*TaskExecution
- func (te *TaskExecutor) SetExecutorFactory(factory SubAgentExecutorFactory)
- type TaskInfo
- type TaskManager
- type TaskOptions
- type TaskTool
- func (t *TaskTool) Description() string
- func (t *TaskTool) Examples() []tools.ToolExample
- func (t *TaskTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *TaskTool) InputSchema() map[string]any
- func (t *TaskTool) Name() string
- func (t *TaskTool) Prompt() string
- type TestHelper
- func (th *TestHelper) AddCleanup(cleanup func())
- func (th *TestHelper) CleanupAll()
- func (th *TestHelper) CreateTempDir(name string) string
- func (th *TestHelper) CreateTempFile(name, content string) string
- func (th *TestHelper) FileExists(path string) bool
- func (th *TestHelper) GetTestDataPath(name string) string
- func (th *TestHelper) ReadFile(path string) string
- type TodoItem
- type TodoList
- type TodoManager
- type TodoWriteTool
- func (t *TodoWriteTool) Description() string
- func (t *TodoWriteTool) Examples() []tools.ToolExample
- func (t *TodoWriteTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *TodoWriteTool) InputSchema() map[string]any
- func (t *TodoWriteTool) Name() string
- func (t *TodoWriteTool) Prompt() string
- type ToolSearchTool
- func (t *ToolSearchTool) Description() string
- func (t *ToolSearchTool) Examples() []tools.ToolExample
- func (t *ToolSearchTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *ToolSearchTool) GetIndex() *search.ToolIndex
- func (t *ToolSearchTool) InputSchema() map[string]any
- func (t *ToolSearchTool) Name() string
- func (t *ToolSearchTool) Prompt() string
- func (t *ToolSearchTool) SetIndex(index *search.ToolIndex)
- type WebFetchTool
- func (t *WebFetchTool) Annotations() *tools.ToolAnnotations
- func (t *WebFetchTool) Description() string
- func (t *WebFetchTool) Examples() []tools.ToolExample
- func (t *WebFetchTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *WebFetchTool) InputSchema() map[string]any
- func (t *WebFetchTool) Name() string
- func (t *WebFetchTool) Prompt() string
- type WebSearchTool
- func (t *WebSearchTool) Annotations() *tools.ToolAnnotations
- func (t *WebSearchTool) Description() string
- func (t *WebSearchTool) Examples() []tools.ToolExample
- func (t *WebSearchTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *WebSearchTool) InputSchema() map[string]any
- func (t *WebSearchTool) Name() string
- func (t *WebSearchTool) Prompt() string
- type WriteTool
- func (t *WriteTool) Annotations() *tools.ToolAnnotations
- func (t *WriteTool) Description() string
- func (t *WriteTool) Examples() []tools.ToolExample
- func (t *WriteTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
- func (t *WriteTool) InputSchema() map[string]any
- func (t *WriteTool) Name() string
- func (t *WriteTool) Prompt() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertContains ¶
AssertContains 断言字符串包含子字符串
func AssertFileContent ¶
AssertFileContent 断言文件内容
func AssertFileNotExists ¶
AssertFileNotExists 断言文件不存在
func AssertToolError ¶
AssertToolError 断言工具执行失败
func AssertToolSuccess ¶
AssertToolSuccess 断言工具执行成功
func BenchmarkTool ¶
BenchmarkTool 工具性能基准测试辅助函数
func CreateTestFiles ¶
func CreateTestFiles(th *TestHelper) map[string]string
CreateTestFiles 创建标准测试文件
func ExecuteToolWithInput ¶
ExecuteToolWithInput 使用指定输入执行工具
func ExecuteToolWithRealFS ¶
ExecuteToolWithRealFS 使用真实文件系统执行工具
func ExecuteToolWithWorkDir ¶ added in v0.31.0
func ExecuteToolWithWorkDir(t *testing.T, tool tools.Tool, input map[string]any, workDir string) map[string]any
ExecuteToolWithWorkDir 使用指定工作目录执行工具
func ExecuteToolWithoutContext ¶ added in v0.31.0
ExecuteToolWithoutContext 不使用 ToolContext 执行工具(用于测试不依赖 sandbox 的工具)
func GetBoolParam ¶
GetBoolParam 获取布尔参数的通用函数
func GetIntParam ¶
GetIntParam 获取整数参数的通用函数
func GetStringParam ¶
GetStringParam 获取字符串参数的通用函数
func GetStringSlice ¶ added in v0.17.0
GetStringSlice 获取字符串数组参数(辅助函数)
func GetStringSliceParam ¶
GetStringSliceParam 获取字符串数组参数的通用函数
func InteractionTools ¶ added in v0.18.0
func InteractionTools() []string
InteractionTools 返回用户交互工具列表
func NewAskUserQuestionTool ¶ added in v0.18.0
NewAskUserQuestionTool 创建AskUserQuestion工具
func NewBashOutputTool ¶
NewBashOutputTool 创建BashOutput工具
func NewBashTool ¶
NewBashTool 创建Bash执行工具
func NewClaudeErrorResponse ¶
NewClaudeErrorResponse 创建Claude兼容的错误响应
func NewCodeExecuteTool ¶ added in v0.17.0
NewCodeExecuteTool 创建代码执行工具
func NewEnterPlanModeTool ¶ added in v0.18.0
NewEnterPlanModeTool 创建EnterPlanMode工具
func NewExitPlanModeTool ¶
NewExitPlanModeTool 创建ExitPlanMode工具
func NewKillShellTool ¶
NewKillShellTool 创建KillShell工具
func NewListMcpResourcesTool ¶ added in v0.31.0
NewListMcpResourcesTool 创建 ListMcpResources 工具
func NewRAGSearchTool ¶ added in v0.31.0
NewRAGSearchTool 创建 RAG 检索工具实例
func NewReadMcpResourceTool ¶ added in v0.31.0
NewReadMcpResourceTool 创建 ReadMcpResource 工具
func NewSkillTool ¶
NewSkillTool 创建 SkillTool 实例
func NewTodoWriteTool ¶
NewTodoWriteTool 创建TodoWrite工具
func NewToolSearchTool ¶ added in v0.17.0
NewToolSearchTool 创建工具搜索工具
func NewWebFetchTool ¶ added in v0.25.0
NewWebFetchTool 创建 WebFetch 工具
func NewWebSearchTool ¶
NewWebSearchTool 创建网络搜索工具
func NewWriteTool ¶
NewWriteTool 创建文件写入工具
func RegisterAll ¶
RegisterAll 注册所有内置工具 (重要:克制,未经严格的讨论禁止再增加) 保持精简(约18个工具)
func ResetGlobalManagers ¶ added in v0.18.0
func ResetGlobalManagers()
ResetGlobalManagers 重置全局存储管理器(仅用于测试)
func RespondToAskUser ¶ added in v0.21.1
RespondToAskUser 响应 AskUser 请求(供外部调用)
func SetFactoryFromAgent ¶ added in v0.25.0
func SetFactoryFromAgent(factory SubAgentExecutorFactory)
SetFactoryFromAgent agent 包调用此函数注入工厂 这是 agent.InitializeTaskExecutor 使用的入口点
func SetGlobalGitSafetyLevel ¶ added in v0.18.0
func SetGlobalGitSafetyLevel(level GitSafetyLevel)
SetGlobalGitSafetyLevel 设置全局 Git 安全级别
func SetGlobalTaskExecutorFactory ¶ added in v0.25.0
func SetGlobalTaskExecutorFactory(factory SubAgentExecutorFactory)
SetGlobalTaskExecutorFactory 设置全局任务执行器工厂 应用层在初始化时调用此函数注入 SubAgentManager
Types ¶
type AskUserQuestionTool ¶ added in v0.18.0
type AskUserQuestionTool struct {
// contains filtered or unexported fields
}
AskUserQuestionTool 结构化用户提问工具 用于在执行过程中向用户提出结构化问题并获取回答
func (*AskUserQuestionTool) Description ¶ added in v0.18.0
func (t *AskUserQuestionTool) Description() string
func (*AskUserQuestionTool) Execute ¶ added in v0.18.0
func (t *AskUserQuestionTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*AskUserQuestionTool) InputSchema ¶ added in v0.18.0
func (t *AskUserQuestionTool) InputSchema() map[string]any
func (*AskUserQuestionTool) Name ¶ added in v0.18.0
func (t *AskUserQuestionTool) Name() string
func (*AskUserQuestionTool) Prompt ¶ added in v0.18.0
func (t *AskUserQuestionTool) Prompt() string
func (*AskUserQuestionTool) ReceiveAnswer ¶ added in v0.18.0
func (t *AskUserQuestionTool) ReceiveAnswer(requestID string, answers map[string]any) error
ReceiveAnswer 接收用户回答(供外部调用)
type BashOutputTool ¶
type BashOutputTool struct{}
BashOutputTool 后台shell输出获取工具 支持获取后台运行命令的输出和状态
func (*BashOutputTool) Description ¶
func (t *BashOutputTool) Description() string
func (*BashOutputTool) Examples ¶ added in v0.17.0
func (t *BashOutputTool) Examples() []tools.ToolExample
Examples 返回 BashOutput 工具的使用示例 实现 ExampleableTool 接口,帮助 LLM 更准确地调用工具
func (*BashOutputTool) Execute ¶
func (t *BashOutputTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*BashOutputTool) InputSchema ¶
func (t *BashOutputTool) InputSchema() map[string]any
func (*BashOutputTool) Name ¶
func (t *BashOutputTool) Name() string
func (*BashOutputTool) Prompt ¶
func (t *BashOutputTool) Prompt() string
type BashTool ¶
type BashTool struct {
// contains filtered or unexported fields
}
BashTool 增强的Bash命令执行工具 支持持久化shell会话功能
func (*BashTool) Annotations ¶ added in v0.33.0
func (t *BashTool) Annotations() *tools.ToolAnnotations
Annotations 返回工具安全注解
func (*BashTool) Description ¶
func (*BashTool) Examples ¶ added in v0.17.0
func (t *BashTool) Examples() []tools.ToolExample
Examples 返回 Bash 工具的使用示例 实现 ExampleableTool 接口,帮助 LLM 更准确地调用工具
func (*BashTool) InputSchema ¶
type CodeExecuteTool ¶ added in v0.17.0
type CodeExecuteTool struct {
// contains filtered or unexported fields
}
CodeExecuteTool 代码执行工具 支持 LLM 生成代码并执行,用于程序化工具调用场景
func NewCodeExecuteToolWithBridge ¶ added in v0.17.0
func NewCodeExecuteToolWithBridge(toolBridge *bridge.ToolBridge) *CodeExecuteTool
NewCodeExecuteToolWithBridge 创建带桥接器的代码执行工具
func (*CodeExecuteTool) AvailableLanguages ¶ added in v0.17.0
func (t *CodeExecuteTool) AvailableLanguages() []string
AvailableLanguages 返回可用的语言列表
func (*CodeExecuteTool) Description ¶ added in v0.17.0
func (t *CodeExecuteTool) Description() string
func (*CodeExecuteTool) Examples ¶ added in v0.17.0
func (t *CodeExecuteTool) Examples() []tools.ToolExample
Examples 返回使用示例
func (*CodeExecuteTool) Execute ¶ added in v0.17.0
func (t *CodeExecuteTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*CodeExecuteTool) InputSchema ¶ added in v0.17.0
func (t *CodeExecuteTool) InputSchema() map[string]any
func (*CodeExecuteTool) Name ¶ added in v0.17.0
func (t *CodeExecuteTool) Name() string
func (*CodeExecuteTool) Prompt ¶ added in v0.17.0
func (t *CodeExecuteTool) Prompt() string
func (*CodeExecuteTool) SetBridgeURL ¶ added in v0.20.0
func (t *CodeExecuteTool) SetBridgeURL(url string)
SetBridgeURL 设置 HTTP 桥接服务器地址
type ConcurrentTestResult ¶
type ConcurrentTestResult struct {
SuccessCount int
ErrorCount int
Errors []error
Duration time.Duration
}
ConcurrentTestResult 并发测试结果
func RunConcurrentTest ¶
func RunConcurrentTest(concurrency int, testFunc func() error) *ConcurrentTestResult
RunConcurrentTest 运行并发测试
type CustomWorkDirSandbox ¶ added in v0.31.0
type CustomWorkDirSandbox struct {
// contains filtered or unexported fields
}
CustomWorkDirSandbox 自定义工作目录的沙箱(仅用于测试)
func (*CustomWorkDirSandbox) Dispose ¶ added in v0.31.0
func (cs *CustomWorkDirSandbox) Dispose() error
func (*CustomWorkDirSandbox) Exec ¶ added in v0.31.0
func (cs *CustomWorkDirSandbox) Exec(ctx context.Context, cmd string, opts *sandbox.ExecOptions) (*sandbox.ExecResult, error)
func (*CustomWorkDirSandbox) FS ¶ added in v0.31.0
func (cs *CustomWorkDirSandbox) FS() sandbox.SandboxFS
func (*CustomWorkDirSandbox) Kind ¶ added in v0.31.0
func (cs *CustomWorkDirSandbox) Kind() string
func (*CustomWorkDirSandbox) Unwatch ¶ added in v0.31.0
func (cs *CustomWorkDirSandbox) Unwatch(watchID string) error
func (*CustomWorkDirSandbox) Watch ¶ added in v0.31.0
func (cs *CustomWorkDirSandbox) Watch(paths []string, listener sandbox.FileChangeListener) (string, error)
func (*CustomWorkDirSandbox) WorkDir ¶ added in v0.31.0
func (cs *CustomWorkDirSandbox) WorkDir() string
type EditTool ¶
type EditTool struct{}
EditTool 增强的文件编辑工具 支持精确的字符串替换编辑功能
func (*EditTool) Description ¶
func (*EditTool) Examples ¶ added in v0.17.0
func (t *EditTool) Examples() []tools.ToolExample
Examples 返回 Edit 工具的使用示例 实现 ExampleableTool 接口,帮助 LLM 更准确地调用工具
func (*EditTool) InputSchema ¶
type EnterPlanModeResult ¶ added in v0.18.0
type EnterPlanModeResult struct {
OK bool `json:"ok"`
PlanFilePath string `json:"plan_file_path"`
PlanID string `json:"plan_id"`
AllowedTools []string `json:"allowed_tools"`
Workflow string `json:"workflow"`
Message string `json:"message"`
}
EnterPlanModeResult 进入规划模式的结果
type EnterPlanModeTool ¶ added in v0.18.0
type EnterPlanModeTool struct {
// contains filtered or unexported fields
}
EnterPlanModeTool 进入规划模式工具 用于复杂任务的规划阶段,在此模式下只允许只读操作和计划文件写入
func (*EnterPlanModeTool) Description ¶ added in v0.18.0
func (t *EnterPlanModeTool) Description() string
func (*EnterPlanModeTool) Execute ¶ added in v0.18.0
func (t *EnterPlanModeTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*EnterPlanModeTool) InputSchema ¶ added in v0.18.0
func (t *EnterPlanModeTool) InputSchema() map[string]any
func (*EnterPlanModeTool) Name ¶ added in v0.18.0
func (t *EnterPlanModeTool) Name() string
func (*EnterPlanModeTool) Prompt ¶ added in v0.18.0
func (t *EnterPlanModeTool) Prompt() string
type ExitPlanModeTool ¶
type ExitPlanModeTool struct {
// contains filtered or unexported fields
}
ExitPlanModeTool 规划模式退出工具 支持直接传入计划内容或从文件读取
func (*ExitPlanModeTool) Description ¶
func (t *ExitPlanModeTool) Description() string
func (*ExitPlanModeTool) Execute ¶
func (t *ExitPlanModeTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*ExitPlanModeTool) InputSchema ¶
func (t *ExitPlanModeTool) InputSchema() map[string]any
func (*ExitPlanModeTool) Name ¶
func (t *ExitPlanModeTool) Name() string
func (*ExitPlanModeTool) Prompt ¶
func (t *ExitPlanModeTool) Prompt() string
type FilePlanManager ¶
type FilePlanManager struct {
// contains filtered or unexported fields
}
FilePlanManager 计划管理器实现
func NewFilePlanManager ¶
func NewFilePlanManager(storageMgr StorageManager) *FilePlanManager
NewFilePlanManager 创建计划管理器
func (*FilePlanManager) DeletePlan ¶
func (fpm *FilePlanManager) DeletePlan(planID string) error
DeletePlan 删除计划
func (*FilePlanManager) GetPlansByStatus ¶
func (fpm *FilePlanManager) GetPlansByStatus(status string) ([]*PlanRecord, error)
GetPlansByStatus 按状态获取计划
func (*FilePlanManager) ListPlans ¶
func (fpm *FilePlanManager) ListPlans() ([]*PlanRecord, error)
ListPlans 列出所有计划
func (*FilePlanManager) LoadPlan ¶
func (fpm *FilePlanManager) LoadPlan(planID string) (*PlanRecord, error)
LoadPlan 加载计划
func (*FilePlanManager) StorePlan ¶
func (fpm *FilePlanManager) StorePlan(plan *PlanRecord) error
StorePlan 存储计划
func (*FilePlanManager) UpdatePlanStatus ¶
func (fpm *FilePlanManager) UpdatePlanStatus(planID string, status string) error
UpdatePlanStatus 更新计划状态
type FileStorageManager ¶
type FileStorageManager struct {
// contains filtered or unexported fields
}
FileStorageManager 基于文件的存储管理器实现
func NewFileStorageManager ¶
func NewFileStorageManager() *FileStorageManager
NewFileStorageManager 创建基于文件的存储管理器
func NewFileStorageManagerWithDir ¶ added in v0.18.0
func NewFileStorageManagerWithDir(dataDir string) *FileStorageManager
NewFileStorageManagerWithDir 创建使用指定目录的存储管理器
func (*FileStorageManager) Backup ¶
func (fsm *FileStorageManager) Backup(backupPath string) error
Backup 备份数据
func (*FileStorageManager) DeleteData ¶
func (fsm *FileStorageManager) DeleteData(key string) error
DeleteData 删除数据
func (*FileStorageManager) Exists ¶
func (fsm *FileStorageManager) Exists(key string) bool
Exists 检查数据是否存在
func (*FileStorageManager) ListKeys ¶
func (fsm *FileStorageManager) ListKeys(prefix string) ([]string, error)
ListKeys 列出所有键
func (*FileStorageManager) LoadData ¶
func (fsm *FileStorageManager) LoadData(key string, target any) error
LoadData 加载数据
func (*FileStorageManager) Restore ¶
func (fsm *FileStorageManager) Restore(backupPath string) error
Restore 从备份恢复数据
type FileSubagentManager ¶
type FileSubagentManager struct {
// contains filtered or unexported fields
}
FileSubagentManager 基于文件的子代理管理器实现
func NewFileSubagentManager ¶
func NewFileSubagentManager() *FileSubagentManager
NewFileSubagentManager 创建基于文件的子代理管理器
func (*FileSubagentManager) CleanupSubagent ¶
func (sm *FileSubagentManager) CleanupSubagent(taskID string) error
CleanupSubagent 清理子代理资源
func (*FileSubagentManager) GetSubagent ¶
func (sm *FileSubagentManager) GetSubagent(taskID string) (*SubagentInstance, error)
GetSubagent 获取子代理信息
func (*FileSubagentManager) GetSubagentOutput ¶
func (sm *FileSubagentManager) GetSubagentOutput(taskID string) (string, error)
GetSubagentOutput 获取子代理输出
func (*FileSubagentManager) ListSubagents ¶
func (sm *FileSubagentManager) ListSubagents() ([]*SubagentInstance, error)
ListSubagents 列出所有子代理
func (*FileSubagentManager) ResumeSubagent ¶
func (sm *FileSubagentManager) ResumeSubagent(taskID string) (*SubagentInstance, error)
ResumeSubagent 恢复子代理
func (*FileSubagentManager) StartSubagent ¶
func (sm *FileSubagentManager) StartSubagent(ctx context.Context, config *SubagentConfig) (*SubagentInstance, error)
StartSubagent 启动子代理
func (*FileSubagentManager) StopSubagent ¶
func (sm *FileSubagentManager) StopSubagent(taskID string) error
StopSubagent 停止子代理
type FileTaskManager ¶
type FileTaskManager struct {
// contains filtered or unexported fields
}
FileTaskManager 基于文件系统的任务管理器实现
func NewFileTaskManager ¶
func NewFileTaskManager() *FileTaskManager
NewFileTaskManager 创建基于文件的任务管理器
func (*FileTaskManager) CleanupTask ¶
func (tm *FileTaskManager) CleanupTask(taskID string) error
CleanupTask 清理任务相关文件
func (*FileTaskManager) GetTask ¶
func (tm *FileTaskManager) GetTask(taskID string) (*TaskInfo, error)
GetTask 获取任务信息
func (*FileTaskManager) GetTaskOutput ¶
func (tm *FileTaskManager) GetTaskOutput(taskID string, filter string, lines int) (string, string, error)
GetTaskOutput 获取任务输出
func (*FileTaskManager) GetTaskStatus ¶
func (tm *FileTaskManager) GetTaskStatus(taskID string) (string, error)
GetTaskStatus 获取任务状态
func (*FileTaskManager) KillTask ¶
func (tm *FileTaskManager) KillTask(taskID string, signal string, timeout int) error
KillTask 终止任务
func (*FileTaskManager) ListTasks ¶
func (tm *FileTaskManager) ListTasks() ([]*TaskInfo, error)
ListTasks 列出所有任务
func (*FileTaskManager) StartTask ¶
func (tm *FileTaskManager) StartTask(ctx context.Context, cmd string, opts *TaskOptions) (*TaskInfo, error)
StartTask 启动后台任务
type FileTodoManager ¶
type FileTodoManager struct {
// contains filtered or unexported fields
}
FileTodoManager 任务列表管理器实现
func NewFileTodoManager ¶
func NewFileTodoManager(storageMgr StorageManager) *FileTodoManager
NewFileTodoManager 创建任务列表管理器
func (*FileTodoManager) BackupTodoLists ¶
func (ftm *FileTodoManager) BackupTodoLists() (map[string]*TodoList, error)
BackupTodoLists 备份任务列表
func (*FileTodoManager) DeleteTodoList ¶
func (ftm *FileTodoManager) DeleteTodoList(listName string) error
DeleteTodoList 删除任务列表
func (*FileTodoManager) ListTodoLists ¶
func (ftm *FileTodoManager) ListTodoLists() ([]string, error)
ListTodoLists 列出所有任务列表
func (*FileTodoManager) LoadTodoList ¶
func (ftm *FileTodoManager) LoadTodoList(listName string) (*TodoList, error)
LoadTodoList 加载任务列表
func (*FileTodoManager) RestoreTodoLists ¶
func (ftm *FileTodoManager) RestoreTodoLists(backup map[string]*TodoList) error
RestoreTodoLists 恢复任务列表
func (*FileTodoManager) StoreTodoList ¶
func (ftm *FileTodoManager) StoreTodoList(list *TodoList) error
StoreTodoList 存储任务列表
type GitCommandRisk ¶ added in v0.18.0
type GitCommandRisk int
GitCommandRisk Git 命令风险级别
const ( // GitRiskSafe 安全命令(只读) GitRiskSafe GitCommandRisk = iota // GitRiskLow 低风险命令(本地修改) GitRiskLow // GitRiskMedium 中等风险(远程操作) GitRiskMedium // GitRiskHigh 高风险(可能丢失数据) GitRiskHigh // GitRiskCritical 极高风险(不可逆操作) GitRiskCritical )
type GitSafetyCheck ¶ added in v0.18.0
type GitSafetyCheck struct {
IsGitCommand bool `json:"is_git_command"`
Risk GitCommandRisk `json:"risk"`
RiskName string `json:"risk_name"`
Command string `json:"command"`
RequiresApproval bool `json:"requires_approval"`
Blocked bool `json:"blocked"`
Reason string `json:"reason"`
Warnings []string `json:"warnings"`
Recommendations []string `json:"recommendations"`
}
GitSafetyCheck Git 安全检查结果
func (*GitSafetyCheck) FormatCheckResult ¶ added in v0.18.0
func (c *GitSafetyCheck) FormatCheckResult() string
FormatCheckResult 格式化检查结果为用户可读的消息
type GitSafetyLevel ¶ added in v0.18.0
type GitSafetyLevel int
GitSafetyLevel Git 安全级别
const ( // GitSafetyLevelStrict 严格模式:所有危险命令都需要用户确认 GitSafetyLevelStrict GitSafetyLevel = iota // GitSafetyLevelNormal 正常模式:只有最危险的命令需要确认 GitSafetyLevelNormal // GitSafetyLevelPermissive 宽松模式:仅阻止极端危险的命令 GitSafetyLevelPermissive )
type GitSafetyValidator ¶ added in v0.18.0
type GitSafetyValidator struct {
// contains filtered or unexported fields
}
GitSafetyValidator Git 安全验证器
func GetGlobalGitSafetyValidator ¶ added in v0.18.0
func GetGlobalGitSafetyValidator() *GitSafetyValidator
GetGlobalGitSafetyValidator 获取全局 Git 安全验证器
func NewGitSafetyValidator ¶ added in v0.18.0
func NewGitSafetyValidator(level GitSafetyLevel) *GitSafetyValidator
NewGitSafetyValidator 创建 Git 安全验证器
func (*GitSafetyValidator) Check ¶ added in v0.18.0
func (v *GitSafetyValidator) Check(command string) *GitSafetyCheck
Check 检查 Git 命令的安全性
type GlobTool ¶
type GlobTool struct{}
GlobTool 增强的文件搜索工具 支持模式匹配文件搜索功能
func (*GlobTool) Annotations ¶ added in v0.33.0
func (t *GlobTool) Annotations() *tools.ToolAnnotations
Annotations 返回工具安全注解
func (*GlobTool) Description ¶
func (*GlobTool) Examples ¶ added in v0.17.0
func (t *GlobTool) Examples() []tools.ToolExample
Examples 返回 Glob 工具的使用示例 实现 ExampleableTool 接口,帮助 LLM 更准确地调用工具
func (*GlobTool) InputSchema ¶
type GrepTool ¶
type GrepTool struct{}
GrepTool 增强的内容搜索工具 支持正则表达式内容搜索功能
func (*GrepTool) Annotations ¶ added in v0.33.0
func (t *GrepTool) Annotations() *tools.ToolAnnotations
Annotations 返回工具安全注解
func (*GrepTool) Description ¶
func (*GrepTool) Examples ¶ added in v0.17.0
func (t *GrepTool) Examples() []tools.ToolExample
Examples 返回 Grep 工具的使用示例 实现 ExampleableTool 接口,帮助 LLM 更准确地调用工具
func (*GrepTool) InputSchema ¶
type KillShellTool ¶
type KillShellTool struct{}
KillShellTool 后台shell终止工具 支持终止后台运行的shell进程
func (*KillShellTool) Description ¶
func (t *KillShellTool) Description() string
func (*KillShellTool) Examples ¶ added in v0.17.0
func (t *KillShellTool) Examples() []tools.ToolExample
Examples 返回 KillShell 工具的使用示例 实现 ExampleableTool 接口,帮助 LLM 更准确地调用工具
func (*KillShellTool) Execute ¶
func (t *KillShellTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*KillShellTool) InputSchema ¶
func (t *KillShellTool) InputSchema() map[string]any
func (*KillShellTool) Name ¶
func (t *KillShellTool) Name() string
func (*KillShellTool) Prompt ¶
func (t *KillShellTool) Prompt() string
type ListMcpResourcesTool ¶ added in v0.31.0
type ListMcpResourcesTool struct{}
ListMcpResourcesTool 列出 MCP 资源工具
func (*ListMcpResourcesTool) Description ¶ added in v0.31.0
func (t *ListMcpResourcesTool) Description() string
func (*ListMcpResourcesTool) Examples ¶ added in v0.31.0
func (t *ListMcpResourcesTool) Examples() []tools.ToolExample
Examples 返回 ListMcpResources 工具的使用示例
func (*ListMcpResourcesTool) Execute ¶ added in v0.31.0
func (t *ListMcpResourcesTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*ListMcpResourcesTool) InputSchema ¶ added in v0.31.0
func (t *ListMcpResourcesTool) InputSchema() map[string]any
func (*ListMcpResourcesTool) Name ¶ added in v0.31.0
func (t *ListMcpResourcesTool) Name() string
func (*ListMcpResourcesTool) Prompt ¶ added in v0.31.0
func (t *ListMcpResourcesTool) Prompt() string
type MCPResource ¶ added in v0.31.0
type MCPResource struct {
URI string `json:"uri"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
MimeType string `json:"mimeType,omitempty"`
Server string `json:"server"`
}
MCPResource MCP 资源定义
type MCPResourceContent ¶ added in v0.31.0
type MCPResourceContent struct {
URI string `json:"uri"`
MimeType string `json:"mimeType,omitempty"`
Text string `json:"text,omitempty"`
Blob string `json:"blob,omitempty"`
}
MCPResourceContent MCP 资源内容
type MockSandbox ¶
type MockSandbox struct {
sandbox.MockSandbox
}
MockSandbox 简单的沙箱模拟实现
func (*MockSandbox) SafeExecute ¶
func (m *MockSandbox) SafeExecute(ctx context.Context, cmd string) error
SafeExecute 模拟安全执行
type PlanFileManager ¶ added in v0.18.0
type PlanFileManager struct {
// contains filtered or unexported fields
}
PlanFileManager 计划文件管理器 管理 .aster/plans/ 目录下的计划文件
func GetGlobalPlanFileManager ¶ added in v0.18.0
func GetGlobalPlanFileManager() *PlanFileManager
GetGlobalPlanFileManager 获取全局计划文件管理器
func NewPlanFileManager ¶ added in v0.18.0
func NewPlanFileManager(basePath string) *PlanFileManager
NewPlanFileManager 创建计划文件管理器
func NewPlanFileManagerWithProject ¶ added in v0.25.0
func NewPlanFileManagerWithProject(basePath, projectName string) *PlanFileManager
NewPlanFileManagerWithProject 创建带项目名称的计划文件管理器 basePath: 基础路径,如 "{workDir}/.plans" projectName: 项目名称(可选,用于进一步隔离)
func (*PlanFileManager) Delete ¶ added in v0.18.0
func (m *PlanFileManager) Delete(path string) error
Delete 删除计划文件
func (*PlanFileManager) EnsureDir ¶ added in v0.18.0
func (m *PlanFileManager) EnsureDir() error
EnsureDir 确保目录存在
func (*PlanFileManager) Exists ¶ added in v0.18.0
func (m *PlanFileManager) Exists(path string) bool
Exists 检查计划文件是否存在
func (*PlanFileManager) GenerateID ¶ added in v0.18.0
func (m *PlanFileManager) GenerateID() string
GenerateID 生成计划ID
func (*PlanFileManager) GeneratePath ¶ added in v0.18.0
func (m *PlanFileManager) GeneratePath() string
GeneratePath 生成新的计划文件路径 生成类似: sunny-singing-nygaard.md 的文件名
func (*PlanFileManager) GetBasePath ¶ added in v0.18.0
func (m *PlanFileManager) GetBasePath() string
GetBasePath 获取基础路径
func (*PlanFileManager) List ¶ added in v0.18.0
func (m *PlanFileManager) List() ([]PlanFileMetadata, error)
List 列出所有计划文件
func (*PlanFileManager) Load ¶ added in v0.18.0
func (m *PlanFileManager) Load(path string) (string, error)
Load 加载计划文件内容
func (*PlanFileManager) Save ¶ added in v0.18.0
func (m *PlanFileManager) Save(path, content string) error
Save 保存计划内容到文件
type PlanFileMetadata ¶ added in v0.18.0
type PlanFileMetadata struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Status string `json:"status"` // "active", "completed", "archived"
}
PlanFileMetadata 计划文件元数据
type PlanManager ¶
type PlanManager interface {
// StorePlan 存储计划
StorePlan(plan *PlanRecord) error
// LoadPlan 加载计划
LoadPlan(planID string) (*PlanRecord, error)
// UpdatePlanStatus 更新计划状态
UpdatePlanStatus(planID string, status string) error
// GetPlansByStatus 按状态获取计划
GetPlansByStatus(status string) ([]*PlanRecord, error)
// ListPlans 列出所有计划
ListPlans() ([]*PlanRecord, error)
// DeletePlan 删除计划
DeletePlan(planID string) error
}
PlanManager 计划管理器接口
var GlobalPlanManager PlanManager
type PlanModeManagerInterface ¶ added in v0.25.0
type PlanModeManagerInterface interface {
EnterPlanMode(planID, planFilePath, reason string)
ExitPlanMode()
IsActive() bool
}
PlanModeManagerInterface Plan 模式管理器接口 用于工具与 Agent 的 PlanModeManager 交互
type PlanRecord ¶
type PlanRecord struct {
ID string `json:"id"`
Content string `json:"content"`
FilePath string `json:"file_path,omitempty"`
EstimatedDuration string `json:"estimated_duration,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
Risks []string `json:"risks,omitempty"`
SuccessCriteria []string `json:"success_criteria,omitempty"`
ConfirmationRequired bool `json:"confirmation_required"`
Status string `json:"status"` // "pending_approval", "approved", "rejected", "completed"
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ApprovedAt *time.Time `json:"approved_at,omitempty"`
AgentID string `json:"agent_id"`
SessionID string `json:"session_id"`
Metadata map[string]any `json:"metadata,omitempty"`
}
PlanRecord 计划记录
type RAGSearchTool ¶ added in v0.31.0
type RAGSearchTool struct {
// contains filtered or unexported fields
}
RAGSearchTool 基于 SemanticMemory 的 RAG 检索工具。 与 SemanticSearchTool 不同,此工具返回格式化的 Markdown 上下文, 可直接注入到 Prompt 中用于增强生成。
输入:
{
"query": string,
"top_k": number (可选, 默认使用 SemanticMemoryConfig.TopK),
"metadata": object (可选, 如 {"user_id":"alice","project_id":"demo"})
}
输出:
{
"context": string (格式化的 Markdown 文本),
"count": number (检索到的文档数量)
}
func (*RAGSearchTool) Description ¶ added in v0.31.0
func (t *RAGSearchTool) Description() string
func (*RAGSearchTool) Examples ¶ added in v0.31.0
func (t *RAGSearchTool) Examples() []tools.ToolExample
Examples 返回 RAG Search 工具的使用示例
func (*RAGSearchTool) Execute ¶ added in v0.31.0
func (t *RAGSearchTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*RAGSearchTool) InputSchema ¶ added in v0.31.0
func (t *RAGSearchTool) InputSchema() map[string]any
func (*RAGSearchTool) Name ¶ added in v0.31.0
func (t *RAGSearchTool) Name() string
func (*RAGSearchTool) Prompt ¶ added in v0.31.0
func (t *RAGSearchTool) Prompt() string
type ReadMcpResourceTool ¶ added in v0.31.0
type ReadMcpResourceTool struct{}
ReadMcpResourceTool 读取 MCP 资源工具
func (*ReadMcpResourceTool) Description ¶ added in v0.31.0
func (t *ReadMcpResourceTool) Description() string
func (*ReadMcpResourceTool) Examples ¶ added in v0.31.0
func (t *ReadMcpResourceTool) Examples() []tools.ToolExample
Examples 返回 ReadMcpResource 工具的使用示例
func (*ReadMcpResourceTool) Execute ¶ added in v0.31.0
func (t *ReadMcpResourceTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*ReadMcpResourceTool) InputSchema ¶ added in v0.31.0
func (t *ReadMcpResourceTool) InputSchema() map[string]any
func (*ReadMcpResourceTool) Name ¶ added in v0.31.0
func (t *ReadMcpResourceTool) Name() string
func (*ReadMcpResourceTool) Prompt ¶ added in v0.31.0
func (t *ReadMcpResourceTool) Prompt() string
type ReadTool ¶
type ReadTool struct{}
ReadTool 增强的文件读取工具 兼容标准Read工具功能
func (*ReadTool) Annotations ¶ added in v0.33.0
func (t *ReadTool) Annotations() *tools.ToolAnnotations
Annotations 返回工具安全注解
func (*ReadTool) Description ¶
func (*ReadTool) Examples ¶ added in v0.17.0
func (t *ReadTool) Examples() []tools.ToolExample
Examples 返回 Read 工具的使用示例 实现 ExampleableTool 接口,帮助 LLM 更准确地调用工具
func (*ReadTool) InputSchema ¶
type RealSandbox ¶
type RealSandbox struct{}
RealSandbox 使用真实文件系统的沙箱(仅用于测试)
func (*RealSandbox) Dispose ¶
func (rs *RealSandbox) Dispose() error
func (*RealSandbox) Exec ¶
func (rs *RealSandbox) Exec(ctx context.Context, cmd string, opts *sandbox.ExecOptions) (*sandbox.ExecResult, error)
func (*RealSandbox) FS ¶
func (rs *RealSandbox) FS() sandbox.SandboxFS
func (*RealSandbox) Kind ¶
func (rs *RealSandbox) Kind() string
func (*RealSandbox) Unwatch ¶
func (rs *RealSandbox) Unwatch(watchID string) error
func (*RealSandbox) Watch ¶
func (rs *RealSandbox) Watch(paths []string, listener sandbox.FileChangeListener) (string, error)
func (*RealSandbox) WorkDir ¶
func (rs *RealSandbox) WorkDir() string
type ResourceUsage ¶
type ResourceUsage struct {
CPU float64 `json:"cpu_percent"` // CPU使用率百分比
Memory int64 `json:"memory_bytes"` // 内存使用量(字节)
DiskIO int64 `json:"disk_io_bytes"` // 磁盘IO(字节)
}
ResourceUsage 进程资源使用情况
type SemanticSearchTool ¶
type SemanticSearchTool struct {
// contains filtered or unexported fields
}
SemanticSearchTool 基于 SemanticMemory 的语义检索工具。 输入:
{
"query": string,
"top_k": number (可选, 默认使用 SemanticMemoryConfig.TopK),
"metadata": object (可选, 如 {"user_id":"alice","project_id":"demo"})
}
输出:
[
{"id": "...", "score": 0.87, "metadata": {...}},
...
]
func (*SemanticSearchTool) Description ¶
func (t *SemanticSearchTool) Description() string
func (*SemanticSearchTool) Execute ¶
func (t *SemanticSearchTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*SemanticSearchTool) InputSchema ¶
func (t *SemanticSearchTool) InputSchema() map[string]any
func (*SemanticSearchTool) Name ¶
func (t *SemanticSearchTool) Name() string
func (*SemanticSearchTool) Prompt ¶
func (t *SemanticSearchTool) Prompt() string
type SkillTool ¶
type SkillTool struct{}
SkillTool 通用的 Skill 执行工具
注意:本工具不会自动注册到默认内置工具列表中,需要在 Agent 模板中显式声明, 并在 ToolContext.Services 中注入 *skills.Runtime 实例,键名为 "skills_runtime"。
func (*SkillTool) Description ¶
func (*SkillTool) InputSchema ¶
type StorageManager ¶
type StorageManager interface {
// StoreData 存储数据
StoreData(key string, data any) error
// LoadData 加载数据
LoadData(key string, target any) error
// DeleteData 删除数据
DeleteData(key string) error
// Exists 检查数据是否存在
Exists(key string) bool
// ListKeys 列出所有键
ListKeys(prefix string) ([]string, error)
// Backup 备份数据
Backup(backupPath string) error
// Restore 从备份恢复数据
Restore(backupPath string) error
}
StorageManager 存储管理器接口
var GlobalStorageManager StorageManager
全局存储管理器实例
func GetGlobalStorageManager ¶
func GetGlobalStorageManager() StorageManager
GetGlobalStorageManager 获取全局存储管理器
type SubAgentExecutorFactory ¶ added in v0.25.0
type SubAgentExecutorFactory interface {
// Create 创建指定类型的子 Agent 执行器
Create(agentType string) (types.SubAgentExecutor, error)
// ListTypes 列出支持的子 Agent 类型
ListTypes() []string
}
SubAgentExecutorFactory 子 Agent 执行器工厂接口
type SubagentConfig ¶
type SubagentConfig struct {
ID string `json:"id"`
Type string `json:"type"` // "general-purpose", "Explore", "Plan", "statusline-setup"
Prompt string `json:"prompt"`
ParentContext map[string]any `json:"parent_context,omitempty"`
Model string `json:"model,omitempty"`
WorkDir string `json:"work_dir,omitempty"`
Env map[string]string `json:"env,omitempty"`
Timeout time.Duration `json:"timeout,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
Temperature float64 `json:"temperature,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
SubagentConfig 子代理配置
type SubagentInstance ¶
type SubagentInstance struct {
ID string `json:"id"`
Type string `json:"type"`
Status string `json:"status"` // "starting", "running", "completed", "failed", "stopped"
PID int `json:"pid,omitempty"`
Command string `json:"command"`
Config *SubagentConfig `json:"config"`
StartTime time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time,omitempty"`
Duration time.Duration `json:"duration"`
Output string `json:"output"`
Error string `json:"error,omitempty"`
ExitCode int `json:"exit_code,omitempty"`
LastUpdate time.Time `json:"last_update"`
Metadata map[string]string `json:"metadata,omitempty"`
ResourceUsage *SubagentResourceUsage `json:"resource_usage,omitempty"`
}
SubagentInstance 子代理实例
type SubagentManager ¶
type SubagentManager interface {
// StartSubagent 启动子代理
StartSubagent(ctx context.Context, config *SubagentConfig) (*SubagentInstance, error)
// ResumeSubagent 恢复子代理
ResumeSubagent(taskID string) (*SubagentInstance, error)
// GetSubagent 获取子代理信息
GetSubagent(taskID string) (*SubagentInstance, error)
// StopSubagent 停止子代理
StopSubagent(taskID string) error
// ListSubagents 列出所有子代理
ListSubagents() ([]*SubagentInstance, error)
// GetSubagentOutput 获取子代理输出
GetSubagentOutput(taskID string) (string, error)
// CleanupSubagent 清理子代理资源
CleanupSubagent(taskID string) error
}
SubagentManager 子代理管理器接口
var GlobalSubagentManager SubagentManager
全局子代理管理器实例
func GetGlobalSubagentManager ¶
func GetGlobalSubagentManager() SubagentManager
GetGlobalSubagentManager 获取全局子代理管理器
type SubagentResourceUsage ¶
type SubagentResourceUsage struct {
MemoryMB float64 `json:"memory_mb"`
CPUPercent float64 `json:"cpu_percent"`
DiskMB float64 `json:"disk_mb"`
NetworkMB float64 `json:"network_mb"`
}
SubagentResourceUsage 子代理资源使用情况
type TaskDefinition ¶
type TaskDefinition struct {
ID string `json:"id"`
Description string `json:"description"`
Subagent string `json:"subagent"`
Prompt string `json:"prompt"`
Model string `json:"model,omitempty"`
Resume string `json:"resume,omitempty"`
CreatedAt time.Time `json:"createdAt"`
StartedAt *time.Time `json:"startedAt,omitempty"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
Status string `json:"status"` // "created", "running", "completed", "failed"
Metadata map[string]any `json:"metadata,omitempty"`
}
TaskDefinition 任务定义
type TaskExecuteOptions ¶ added in v0.25.0
type TaskExecuteOptions struct {
Model string
Timeout time.Duration
Context map[string]any
Priority int
Async bool
}
TaskExecuteOptions 任务执行选项
type TaskExecution ¶
type TaskExecution struct {
TaskID string `json:"task_id"`
Subagent string `json:"subagent"`
Model string `json:"model"`
Status string `json:"status"`
Result any `json:"result,omitempty"`
Error string `json:"error,omitempty"`
StartTime time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time,omitempty"`
Duration time.Duration `json:"duration"`
Metadata map[string]any `json:"metadata,omitempty"`
}
TaskExecution 任务执行结果
type TaskExecutionHandle ¶ added in v0.25.0
type TaskExecutionHandle struct {
TaskID string
AgentType string
Status string // "pending", "running", "completed", "failed", "canceled"
StartTime time.Time
EndTime *time.Time
Result *types.SubAgentResult
ProgressChan <-chan *types.SubAgentProgressEvent
CancelFunc context.CancelFunc
}
TaskExecutionHandle 任务执行句柄
type TaskExecutor ¶ added in v0.25.0
type TaskExecutor struct {
// contains filtered or unexported fields
}
TaskExecutor 任务执行器 连接 Task 工具和 SubAgentManager
func GetGlobalTaskExecutor ¶ added in v0.25.0
func GetGlobalTaskExecutor() *TaskExecutor
GetGlobalTaskExecutor 获取全局任务执行器
func NewTaskExecutor ¶ added in v0.25.0
func NewTaskExecutor() *TaskExecutor
NewTaskExecutor 创建任务执行器
func (*TaskExecutor) Execute ¶ added in v0.25.0
func (te *TaskExecutor) Execute(ctx context.Context, agentType, prompt string, opts *TaskExecuteOptions) (*TaskExecution, error)
Execute 执行任务(同步)
func (*TaskExecutor) ExecuteAsync ¶ added in v0.25.0
func (te *TaskExecutor) ExecuteAsync(ctx context.Context, agentType, prompt string, opts *TaskExecuteOptions) (*TaskExecutionHandle, error)
ExecuteAsync 异步执行任务
func (*TaskExecutor) GetTask ¶ added in v0.25.0
func (te *TaskExecutor) GetTask(taskID string) (*TaskExecution, error)
GetTask 获取任务信息
func (*TaskExecutor) ListTasks ¶ added in v0.25.0
func (te *TaskExecutor) ListTasks() []*TaskExecution
ListTasks 列出所有任务
func (*TaskExecutor) SetExecutorFactory ¶ added in v0.25.0
func (te *TaskExecutor) SetExecutorFactory(factory SubAgentExecutorFactory)
SetExecutorFactory 设置执行器工厂
type TaskInfo ¶
type TaskInfo struct {
ID string `json:"id"`
Command string `json:"command"`
PID int `json:"pid"`
Status string `json:"status"` // "running", "completed", "failed", "killed"
ExitCode int `json:"exit_code"`
StartTime time.Time `json:"start_time"`
EndTime *time.Time `json:"end_time,omitempty"`
Duration time.Duration `json:"duration"`
WorkDir string `json:"work_dir"`
Shell string `json:"shell"`
Options *TaskOptions `json:"options"`
Metadata map[string]string `json:"metadata"`
LastUpdate time.Time `json:"last_update"`
}
TaskInfo 任务信息
type TaskManager ¶
type TaskManager interface {
// StartTask 启动后台任务
StartTask(ctx context.Context, cmd string, opts *TaskOptions) (*TaskInfo, error)
// GetTask 获取任务信息
GetTask(taskID string) (*TaskInfo, error)
// GetTaskOutput 获取任务输出
GetTaskOutput(taskID string, filter string, lines int) (string, string, error)
// KillTask 终止任务
KillTask(taskID string, signal string, timeout int) error
// ListTasks 列出所有任务
ListTasks() ([]*TaskInfo, error)
// GetTaskStatus 获取任务状态
GetTaskStatus(taskID string) (string, error)
// CleanupTask 清理任务相关文件
CleanupTask(taskID string) error
}
TaskManager 后台任务管理器接口
var GlobalTaskManager TaskManager
全局任务管理器实例
type TaskOptions ¶
type TaskOptions struct {
WorkDir string `json:"work_dir"`
Env map[string]string `json:"env"`
Timeout time.Duration `json:"timeout"`
Background bool `json:"background"`
Shell string `json:"shell"`
CaptureOutput bool `json:"capture_output"`
OutputDir string `json:"output_dir"`
}
TaskOptions 任务启动选项
type TaskTool ¶
type TaskTool struct{}
TaskTool 专门代理启动工具 支持启动专门的代理来处理复杂的多步骤任务
func (*TaskTool) Description ¶
func (*TaskTool) Examples ¶ added in v0.17.0
func (t *TaskTool) Examples() []tools.ToolExample
Examples 返回 Task 工具的使用示例
func (*TaskTool) InputSchema ¶
type TestHelper ¶
type TestHelper struct {
T *testing.T
TmpDir string
Context context.Context
Cleanup []func() // 清理函数列表
}
TestHelper 测试辅助工具
func (*TestHelper) CreateTempDir ¶
func (th *TestHelper) CreateTempDir(name string) string
CreateTempDir 创建临时目录
func (*TestHelper) CreateTempFile ¶
func (th *TestHelper) CreateTempFile(name, content string) string
CreateTempFile 创建临时文件
func (*TestHelper) FileExists ¶
func (th *TestHelper) FileExists(path string) bool
FileExists 检查文件是否存在
func (*TestHelper) GetTestDataPath ¶
func (th *TestHelper) GetTestDataPath(name string) string
GetTestDataPath 获取测试数据文件路径
type TodoItem ¶
type TodoItem struct {
ID string `json:"id"`
Content string `json:"content"`
Status string `json:"status"` // "pending", "in_progress", "completed"
ActiveForm string `json:"activeForm"`
Priority int `json:"priority,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
CompletedAt *time.Time `json:"completedAt,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
TodoItem 单个任务项
type TodoList ¶
type TodoList struct {
ID string `json:"id"`
Name string `json:"name"`
Todos []TodoItem `json:"todos"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Metadata map[string]any `json:"metadata,omitempty"`
}
TodoList 任务列表
type TodoManager ¶
type TodoManager interface {
// StoreTodoList 存储任务列表
StoreTodoList(list *TodoList) error
// LoadTodoList 加载任务列表
LoadTodoList(listName string) (*TodoList, error)
// ListTodoLists 列出所有任务列表
ListTodoLists() ([]string, error)
// DeleteTodoList 删除任务列表
DeleteTodoList(listName string) error
// BackupTodoLists 备份任务列表
BackupTodoLists() (map[string]*TodoList, error)
// RestoreTodoLists 恢复任务列表
RestoreTodoLists(backup map[string]*TodoList) error
}
TodoManager 任务列表管理器接口
var GlobalTodoManager TodoManager
func GetGlobalTodoManager ¶
func GetGlobalTodoManager() TodoManager
GetGlobalTodoManager 获取全局任务列表管理器
type TodoWriteTool ¶
type TodoWriteTool struct{}
TodoWriteTool 任务管理工具 支持创建和管理结构化任务列表
func (*TodoWriteTool) Description ¶
func (t *TodoWriteTool) Description() string
func (*TodoWriteTool) Examples ¶ added in v0.17.0
func (t *TodoWriteTool) Examples() []tools.ToolExample
Examples 返回 TodoWrite 工具的使用示例 实现 ExampleableTool 接口,帮助 LLM 更准确地调用工具
func (*TodoWriteTool) Execute ¶
func (t *TodoWriteTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*TodoWriteTool) InputSchema ¶
func (t *TodoWriteTool) InputSchema() map[string]any
func (*TodoWriteTool) Name ¶
func (t *TodoWriteTool) Name() string
func (*TodoWriteTool) Prompt ¶
func (t *TodoWriteTool) Prompt() string
type ToolSearchTool ¶ added in v0.17.0
type ToolSearchTool struct {
// contains filtered or unexported fields
}
ToolSearchTool 工具搜索工具 允许 LLM 按需搜索和发现可用的工具 实现 Anthropic 文章中的 Tool Search Tool 概念
func NewToolSearchToolWithIndex ¶ added in v0.17.0
func NewToolSearchToolWithIndex(index *search.ToolIndex) *ToolSearchTool
NewToolSearchToolWithIndex 使用现有索引创建工具搜索工具
func (*ToolSearchTool) Description ¶ added in v0.17.0
func (t *ToolSearchTool) Description() string
func (*ToolSearchTool) Examples ¶ added in v0.17.0
func (t *ToolSearchTool) Examples() []tools.ToolExample
Examples 返回 ToolSearch 工具的使用示例
func (*ToolSearchTool) Execute ¶ added in v0.17.0
func (t *ToolSearchTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*ToolSearchTool) GetIndex ¶ added in v0.17.0
func (t *ToolSearchTool) GetIndex() *search.ToolIndex
GetIndex 获取工具索引
func (*ToolSearchTool) InputSchema ¶ added in v0.17.0
func (t *ToolSearchTool) InputSchema() map[string]any
func (*ToolSearchTool) Name ¶ added in v0.17.0
func (t *ToolSearchTool) Name() string
func (*ToolSearchTool) Prompt ¶ added in v0.17.0
func (t *ToolSearchTool) Prompt() string
func (*ToolSearchTool) SetIndex ¶ added in v0.17.0
func (t *ToolSearchTool) SetIndex(index *search.ToolIndex)
SetIndex 设置工具索引(用于与 Agent 集成)
type WebFetchTool ¶ added in v0.25.0
type WebFetchTool struct {
// contains filtered or unexported fields
}
WebFetchTool 网页获取工具
func (*WebFetchTool) Annotations ¶ added in v0.33.0
func (t *WebFetchTool) Annotations() *tools.ToolAnnotations
Annotations 返回工具安全注解
func (*WebFetchTool) Description ¶ added in v0.25.0
func (t *WebFetchTool) Description() string
func (*WebFetchTool) Examples ¶ added in v0.25.0
func (t *WebFetchTool) Examples() []tools.ToolExample
Examples 返回 WebFetch 工具的使用示例
func (*WebFetchTool) Execute ¶ added in v0.25.0
func (t *WebFetchTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*WebFetchTool) InputSchema ¶ added in v0.25.0
func (t *WebFetchTool) InputSchema() map[string]any
func (*WebFetchTool) Name ¶ added in v0.25.0
func (t *WebFetchTool) Name() string
func (*WebFetchTool) Prompt ¶ added in v0.25.0
func (t *WebFetchTool) Prompt() string
type WebSearchTool ¶
type WebSearchTool struct {
// contains filtered or unexported fields
}
WebSearchTool 网络搜索工具 (使用 Tavily API) 设计参考: DeepAgents deepagents-cli/tools.py:web_search
func (*WebSearchTool) Annotations ¶ added in v0.33.0
func (t *WebSearchTool) Annotations() *tools.ToolAnnotations
Annotations 返回工具安全注解
func (*WebSearchTool) Description ¶
func (t *WebSearchTool) Description() string
func (*WebSearchTool) Examples ¶ added in v0.17.0
func (t *WebSearchTool) Examples() []tools.ToolExample
Examples 返回 WebSearch 工具的使用示例 实现 ExampleableTool 接口,帮助 LLM 更准确地调用工具
func (*WebSearchTool) Execute ¶
func (t *WebSearchTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error)
func (*WebSearchTool) InputSchema ¶
func (t *WebSearchTool) InputSchema() map[string]any
func (*WebSearchTool) Name ¶
func (t *WebSearchTool) Name() string
func (*WebSearchTool) Prompt ¶
func (t *WebSearchTool) Prompt() string
type WriteTool ¶
type WriteTool struct{}
WriteTool 增强的文件写入工具 兼容标准Write工具功能
func (*WriteTool) Annotations ¶ added in v0.33.0
func (t *WriteTool) Annotations() *tools.ToolAnnotations
Annotations 返回工具安全注解
func (*WriteTool) Description ¶
func (*WriteTool) Examples ¶ added in v0.17.0
func (t *WriteTool) Examples() []tools.ToolExample
Examples 返回 Write 工具的使用示例 实现 ExampleableTool 接口,帮助 LLM 更准确地调用工具
func (*WriteTool) InputSchema ¶
Source Files
¶
- ask_user.go
- bash.go
- bashoutput.go
- codeexecute.go
- edit.go
- enterplanmode.go
- exitplanmode.go
- git_safety.go
- glob.go
- grep.go
- killshell.go
- mcp_resources.go
- mocks.go
- plan_file.go
- rag_search.go
- read.go
- registry.go
- semanticmemory.go
- skillcall.go
- storage_manager.go
- subagent_manager.go
- task.go
- task_executor.go
- task_manager.go
- testutils.go
- todowrite.go
- toolsearch.go
- utils.go
- webfetch.go
- websearch.go
- write.go