diff --git a/Argcfile.sh b/Argcfile.sh index bf4e616..386a725 100644 --- a/Argcfile.sh +++ b/Argcfile.sh @@ -170,7 +170,7 @@ build-declarations@tool() { if [[ -n "$build_failed_tools" ]]; then _die "error: invalid tools: ${build_failed_tools[*]}" fi - json_data="$(echo "["$(IFS=,; echo "${json_list[*]}")"]" | jq '.')" + json_data="$(echo "${json_list[@]}" | jq -s '.')" if [[ "$argc_declarations_file" == "-" ]]; then echo "$json_data" else diff --git a/agents/coder/README.md b/agents/coder/README.md index 851b390..8473974 100644 --- a/agents/coder/README.md +++ b/agents/coder/README.md @@ -1,6 +1,6 @@ # Coder -A AI agent that assists your coding tasks. +An AI agent that assists your coding tasks. ## Features @@ -9,15 +9,12 @@ A AI agent that assists your coding tasks. - 📁 Comprehensive file system operations (create folders, files, read/write files) - 🧐 Advanced code analysis and improvement suggestions - 📊 Precise diff-based file editing for controlled code modifications -- 🔍 Web search capabilities for up-to-date information ## Examples -![image](https://github.com/user-attachments/assets/ad9c9d94-5248-46ba-be30-cc885bda9333) +![image](https://github.com/user-attachments/assets/97324fa9-f5ea-44cd-8aea-024d1442ca81) -https://github.com/user-attachments/assets/0851b9e7-3ac5-4ec1-ab8b-d845c460446b - -https://github.com/user-attachments/assets/df459938-3abf-442b-bc51-42bdb9c72c43 +https://github.com/user-attachments/assets/9363990f-15a9-48c6-b227-8900cfbe0a18 ## Similar Projects diff --git a/agents/coder/index.yaml b/agents/coder/index.yaml index 08bb2f8..5efe05e 100644 --- a/agents/coder/index.yaml +++ b/agents/coder/index.yaml @@ -1,5 +1,5 @@ name: Coder -description: A AI agent that assists your coding tasks +description: An AI agent that assists your coding tasks version: 0.1.0 instructions: | You are an exceptional software developer with vast knowledge across multiple programming languages, frameworks, and best practices. Your capabilities include: @@ -18,14 +18,12 @@ instructions: | 3. fs_patch: Examine and modify existing files. 4. fs_cat: View the contents of existing files without making changes. 5. fs_ls: Understand the current project structure or locate specific files. - 6. web_search: Obtain current information on technologies, libraries, or best practices. - 7. Analyzing images provided by the user + 6. Analyzing images provided by the user Tool Usage Guidelines: - Always use the most appropriate tool for the task at hand. - For file modifications, use fs_edit. Read the file first, then apply changes if needed. - After making changes, always review the diff output to ensure accuracy. - - Proactively use web_search when you need up-to-date information or context. Error Handling and Recovery: - If a tool operation fails, analyze the error message and attempt to resolve the issue. @@ -43,7 +41,7 @@ instructions: | 3. Pay close attention to existing code structure to avoid unintended alterations. 4. Review changes thoroughly after each modification. - Always strive for accuracy, clarity, and efficiency in your responses and actions. If uncertain, use the web_search tool or admit your limitations. + Always strive for accuracy, clarity, and efficiency in your responses and actions. Answer the user's request using relevant tools (if they are available). Before calling a tool, do some analysis within tags. First, think about which of the provided tools is the relevant tool to answer the user's request. Second, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool call. BUT, if one of the values for a required parameter is missing, DO NOT invoke the function (not even with fillers for the missing params) and instead, ask the user to provide the missing parameters. DO NOT ask for more information on optional parameters if it is not provided. diff --git a/agents/coder/tools.txt b/agents/coder/tools.txt index f4f352a..973aba3 100644 --- a/agents/coder/tools.txt +++ b/agents/coder/tools.txt @@ -1,5 +1,4 @@ fs_mkdir.sh fs_ls.sh fs_patch.sh -fs_cat.sh -web_search.sh \ No newline at end of file +fs_cat.sh \ No newline at end of file diff --git a/utils/patch.awk b/utils/patch.awk index b651fb2..79deec2 100755 --- a/utils/patch.awk +++ b/utils/patch.awk @@ -35,7 +35,7 @@ END { } if (mode == "hunk") { - while (patchLineIndex <= totalPatchLines && line ~ /^[-+ ]/ && line !~ /^--- /) { + while (patchLineIndex <= totalPatchLines && line ~ /^[-+ ]|^\s*$/ && line !~ /^--- /) { sanitizedLine = substr(line, 2) if (line !~ /^\+/) { hunkTotalOriginalLines[hunkIndex]++; @@ -68,7 +68,7 @@ END { line = lines[lineIndex] nextLineIndex = 0 - if (line == hunkOriginalLines[hunkIndex,1]) { + if (hunkIndex <= totalHunks && line == hunkOriginalLines[hunkIndex,1]) { nextLineIndex = lineIndex + 1 for (i = 2; i <= hunkTotalOriginalLines[hunkIndex]; i++) { if (lines[nextLineIndex] != hunkOriginalLines[hunkIndex,i]) { @@ -83,7 +83,7 @@ END { print hunkUpdatedLines[hunkIndex,i] } hunkIndex++ - lineIndex = nextLineIndex -1; + lineIndex = nextLineIndex - 1; } else { print line }