diff --git a/README.md b/README.md index 867c06ef..74d573f1 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ see [UniAST Specification](docs/uniast-zh.md) - You can add more repo ASTs into the AST directory without restarting abcoder MCP server. -- Try to use [the recommened prompt](llm/prompt/analyzer.md) and combine planning/memory tools like [sequential-thinking](https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking) in your AI agent. +- Try to use [the recommended prompt](llm/prompt/analyzer.md) and combine planning/memory tools like [sequential-thinking](https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking) in your AI agent. ## Use ABCoder as an Agent (WIP) diff --git a/docs/parser-en.md b/docs/parser-en.md index 3b5e7e96..7f87c190 100644 --- a/docs/parser-en.md +++ b/docs/parser-en.md @@ -38,7 +38,7 @@ type LanguageSpec interface { WorkSpace(root string) (map[string]string, error) // give an absolute file path and returns its module name and package path - // external path should alse be supported + // external path should also be supported // FIXEM: some language (like rust) may have sub-mods inside a file, but we still consider it as a unity mod here NameSpace(path string) (string, string, error) diff --git a/docs/parser-zh.md b/docs/parser-zh.md index 53b002e0..a29bb07b 100644 --- a/docs/parser-zh.md +++ b/docs/parser-zh.md @@ -29,7 +29,7 @@ - CheckRepo():检查用户仓库情况,根据各语言规范额处理工具链等问题,并返回默认打开的第一个文件(用于触发 LSP server),以及等候 sever 初始化完成的时间(根据仓库大小来决定) - **LanguageSpec interface**: 核心模块,用于处理非 LSP 通用的语法信息、比如判断一个 token 是否是标准库的符号、函数签名解析等: -### LaunguageSpec +### LanguageSpec 用于在 LSP 符号收集过程中转换为 UniAST 所需信息,并且这些信息非 LSP 通用定义 @@ -40,7 +40,7 @@ type LanguageSpec interface { WorkSpace(root string) (map[string]string, error) // give an absolute file path and returns its module name and package path - // external path should alse be supported + // external path should also be supported // FIXEM: some language (like rust) may have sub-mods inside a file, but we still consider it as a unity mod here NameSpace(path string) (string, string, error) diff --git a/docs/uniast-en.md b/docs/uniast-en.md index 48ff999a..e260e9cc 100644 --- a/docs/uniast-en.md +++ b/docs/uniast-en.md @@ -148,7 +148,7 @@ An independent code compilation unit, corresponding to ModPath in Identity, cont - Dependencies: Dictionary of third-party dependency modules for module building {ModName}: {ModPath} -- Packages: Contains subpackages, {PkgPath}: {Pacakge AST} dictionary +- Packages: Contains subpackages, {PkgPath}: {Package AST} dictionary - Files: Module file information, where the key is the **path relative to the repo**. It is recommended to include all repository files here to facilitate writer rewriting @@ -632,7 +632,7 @@ const ( FUNC // Struct、TypeAlias、Enum... TYPE - // Global Varable or Global Const + // Global Variable or Global Const VAR ) ``` diff --git a/docs/uniast-zh.md b/docs/uniast-zh.md index 2a7d6448..371bec23 100644 --- a/docs/uniast-zh.md +++ b/docs/uniast-zh.md @@ -149,7 +149,7 @@ Universal Abstract-Syntax-Tree 是 ABCoder 建立的一种 LLM 亲和、语言 - Dependencies: 模块构建的第三方依赖模块字典 {ModName}: {ModPath} -- Packages: 包含的子包,{PkgPath}: {Pacakge AST} 字典 +- Packages: 包含的子包,{PkgPath}: {Package AST} 字典 - Files: 模块文件信息,key 为**相对 repo 的路径。**这里建议包括仓库所有文件,方便 writer 回写 @@ -633,7 +633,7 @@ const ( FUNC // Struct、TypeAlias、Enum... TYPE - // Global Varable or Global Const + // Global Variable or Global Const VAR ) ``` diff --git a/llm/prompt/analyzer.md b/llm/prompt/analyzer.md index 71d304dc..5fc91f1a 100644 --- a/llm/prompt/analyzer.md +++ b/llm/prompt/analyzer.md @@ -2,7 +2,7 @@ You are a code-analysis expert. Based on the Abstract-Syntax-Tree (AST) of a specific code repository and using relevant tools, you will answer user questions. # Available Tools -- `list_repos`: check the avaliable repos and their correct name +- `list_repos`: check the available repos and their correct name - `get_repo_structure`: Retrieve the structural information of a specified code repository, including lists of modules and packages. - `get_package_structure`: Obtain the structural information of a specified package, including lists of files and node names. - `get_ast_node`: Fetch the complete AST node information of a specified node, including its type, code, location, and related dependency (dependencies), reference (references), inheritance (inherits), implementation (implements), and grouping (groups) node IDs. diff --git a/llm/tool/mcp.go b/llm/tool/mcp.go index 904b3e52..d4f506b6 100644 --- a/llm/tool/mcp.go +++ b/llm/tool/mcp.go @@ -28,7 +28,7 @@ import ( type MCPConfig struct { Type MCPType - Comand string + Command string Args []string Envs []string SSEURL string @@ -50,10 +50,10 @@ func NewMCPClient(opts MCPConfig) (*MCPClient, error) { var err error switch opts.Type { case MCPTypeStdio: - if opts.Comand == "" { - return nil, errors.New("comand is empty") + if opts.Command == "" { + return nil, errors.New("command is empty") } - cli, err = client.NewStdioMCPClient(opts.Comand, opts.Envs, opts.Args...) + cli, err = client.NewStdioMCPClient(opts.Command, opts.Envs, opts.Args...) if err != nil { return nil, err } @@ -112,7 +112,7 @@ func GetSequentialThinkingTools(ctx context.Context) ([]Tool, error) { sync.OnceFunc(func() { cli, err := NewMCPClient(MCPConfig{ Type: MCPTypeStdio, - Comand: "npx", + Command: "npx", Args: []string{ "-y", "@modelcontextprotocol/server-sequential-thinking", @@ -136,7 +136,7 @@ func GetGitTools(ctx context.Context) ([]Tool, error) { sync.OnceFunc(func() { cli, err := NewMCPClient(MCPConfig{ Type: MCPTypeStdio, - Comand: "uvx", + Command: "uvx", Args: []string{ "mcp-server-git", }, diff --git a/llm/tool/mcp_test.go b/llm/tool/mcp_test.go index a554672a..8e7b3c90 100644 --- a/llm/tool/mcp_test.go +++ b/llm/tool/mcp_test.go @@ -26,7 +26,7 @@ import ( func TestMCPClient(t *testing.T) { cli, err := NewMCPClient(MCPConfig{ Type: MCPTypeStdio, - Comand: "npx", + Command: "npx", Args: []string{ "-y", "@modelcontextprotocol/server-sequential-thinking", diff --git a/main.go b/main.go index 83885554..45a80f01 100644 --- a/main.go +++ b/main.go @@ -151,7 +151,7 @@ func main() { case "write": _, uri := parseArgsAndFlags(flags, false, flagHelp, flagVerbose) if uri == "" { - log.Error("Arguement Path is required\n") + log.Error("Argument Path is required\n") os.Exit(1) } @@ -175,7 +175,7 @@ func main() { case "mcp": _, uri := parseArgsAndFlags(flags, false, flagHelp, flagVerbose) if uri == "" { - log.Error("Arguement Path is required\n") + log.Error("Argument Path is required\n") os.Exit(1) } @@ -195,7 +195,7 @@ func main() { case "agent": _, uri := parseArgsAndFlags(flags, false, flagHelp, flagVerbose) if uri == "" { - log.Error("Arguement Path is required\n") + log.Error("Argument Path is required\n") os.Exit(1) } @@ -236,7 +236,7 @@ func parseArgsAndFlags(flags *flag.FlagSet, needLang bool, flagHelp *bool, flagV os.Exit(1) } if len(os.Args) < 4 { - fmt.Fprintf(os.Stderr, "arguement Path is required\n") + fmt.Fprintf(os.Stderr, "argument Path is required\n") os.Exit(1) } uri = os.Args[3]