Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/parser-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions docs/parser-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
- CheckRepo():检查用户仓库情况,根据各语言规范额处理工具链等问题,并返回默认打开的第一个文件(用于触发 LSP server),以及等候 sever 初始化完成的时间(根据仓库大小来决定)
- **LanguageSpec interface**: 核心模块,用于处理非 LSP 通用的语法信息、比如判断一个 token 是否是标准库的符号、函数签名解析等:

### LaunguageSpec
### LanguageSpec

用于在 LSP 符号收集过程中转换为 UniAST 所需信息,并且这些信息非 LSP 通用定义

Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions docs/uniast-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -632,7 +632,7 @@ const (
FUNC
// Struct、TypeAlias、Enum...
TYPE
// Global Varable or Global Const
// Global Variable or Global Const
VAR
)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/uniast-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 回写
Expand Down Expand Up @@ -633,7 +633,7 @@ const (
FUNC
// Struct、TypeAlias、Enum...
TYPE
// Global Varable or Global Const
// Global Variable or Global Const
VAR
)
```
Expand Down
2 changes: 1 addition & 1 deletion llm/prompt/analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions llm/tool/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

type MCPConfig struct {
Type MCPType
Comand string
Command string
Args []string
Envs []string
SSEURL string
Expand All @@ -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
}
Expand Down Expand Up @@ -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",
Expand All @@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion llm/tool/mcp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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)
}

Expand All @@ -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)
}

Expand Down Expand Up @@ -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]
Expand Down
Loading