aider-ce 0.88.20__py3-none-any.whl → 0.88.38__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aider/__init__.py +1 -1
- aider/_version.py +2 -2
- aider/args.py +63 -43
- aider/coders/agent_coder.py +331 -79
- aider/coders/agent_prompts.py +3 -15
- aider/coders/architect_coder.py +21 -5
- aider/coders/base_coder.py +661 -413
- aider/coders/base_prompts.py +6 -3
- aider/coders/chat_chunks.py +39 -17
- aider/commands.py +79 -15
- aider/diffs.py +10 -9
- aider/exceptions.py +1 -1
- aider/helpers/coroutines.py +8 -0
- aider/helpers/requests.py +45 -0
- aider/history.py +5 -0
- aider/io.py +179 -25
- aider/main.py +86 -35
- aider/models.py +16 -8
- aider/queries/tree-sitter-language-pack/c-tags.scm +3 -0
- aider/queries/tree-sitter-language-pack/clojure-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/commonlisp-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/cpp-tags.scm +3 -0
- aider/queries/tree-sitter-language-pack/csharp-tags.scm +6 -0
- aider/queries/tree-sitter-language-pack/dart-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/elixir-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/elm-tags.scm +3 -0
- aider/queries/tree-sitter-language-pack/go-tags.scm +7 -0
- aider/queries/tree-sitter-language-pack/java-tags.scm +6 -0
- aider/queries/tree-sitter-language-pack/javascript-tags.scm +8 -0
- aider/queries/tree-sitter-language-pack/lua-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/ocaml_interface-tags.scm +3 -0
- aider/queries/tree-sitter-language-pack/python-tags.scm +10 -0
- aider/queries/tree-sitter-language-pack/r-tags.scm +6 -0
- aider/queries/tree-sitter-language-pack/ruby-tags.scm +5 -0
- aider/queries/tree-sitter-language-pack/rust-tags.scm +3 -0
- aider/queries/tree-sitter-language-pack/solidity-tags.scm +1 -1
- aider/queries/tree-sitter-language-pack/swift-tags.scm +4 -1
- aider/queries/tree-sitter-languages/c-tags.scm +3 -0
- aider/queries/tree-sitter-languages/c_sharp-tags.scm +6 -0
- aider/queries/tree-sitter-languages/cpp-tags.scm +3 -0
- aider/queries/tree-sitter-languages/dart-tags.scm +2 -1
- aider/queries/tree-sitter-languages/elixir-tags.scm +5 -0
- aider/queries/tree-sitter-languages/elm-tags.scm +3 -0
- aider/queries/tree-sitter-languages/fortran-tags.scm +3 -0
- aider/queries/tree-sitter-languages/go-tags.scm +6 -0
- aider/queries/tree-sitter-languages/haskell-tags.scm +2 -0
- aider/queries/tree-sitter-languages/java-tags.scm +6 -0
- aider/queries/tree-sitter-languages/javascript-tags.scm +8 -0
- aider/queries/tree-sitter-languages/julia-tags.scm +2 -2
- aider/queries/tree-sitter-languages/kotlin-tags.scm +3 -0
- aider/queries/tree-sitter-languages/ocaml_interface-tags.scm +6 -0
- aider/queries/tree-sitter-languages/php-tags.scm +6 -0
- aider/queries/tree-sitter-languages/python-tags.scm +10 -0
- aider/queries/tree-sitter-languages/ruby-tags.scm +5 -0
- aider/queries/tree-sitter-languages/rust-tags.scm +3 -0
- aider/queries/tree-sitter-languages/scala-tags.scm +2 -3
- aider/queries/tree-sitter-languages/typescript-tags.scm +3 -0
- aider/queries/tree-sitter-languages/zig-tags.scm +20 -3
- aider/repomap.py +71 -11
- aider/resources/model-metadata.json +27335 -635
- aider/resources/model-settings.yml +190 -0
- aider/scrape.py +2 -0
- aider/tools/__init__.py +2 -0
- aider/tools/command.py +84 -94
- aider/tools/command_interactive.py +95 -110
- aider/tools/delete_block.py +131 -159
- aider/tools/delete_line.py +97 -132
- aider/tools/delete_lines.py +120 -160
- aider/tools/extract_lines.py +288 -312
- aider/tools/finished.py +30 -43
- aider/tools/git_branch.py +107 -109
- aider/tools/git_diff.py +44 -56
- aider/tools/git_log.py +39 -53
- aider/tools/git_remote.py +37 -51
- aider/tools/git_show.py +33 -47
- aider/tools/git_status.py +30 -44
- aider/tools/grep.py +214 -242
- aider/tools/indent_lines.py +175 -201
- aider/tools/insert_block.py +220 -253
- aider/tools/list_changes.py +65 -80
- aider/tools/ls.py +64 -80
- aider/tools/make_editable.py +57 -73
- aider/tools/make_readonly.py +50 -66
- aider/tools/remove.py +64 -80
- aider/tools/replace_all.py +96 -109
- aider/tools/replace_line.py +118 -156
- aider/tools/replace_lines.py +160 -197
- aider/tools/replace_text.py +159 -160
- aider/tools/show_numbered_context.py +115 -141
- aider/tools/thinking.py +52 -0
- aider/tools/undo_change.py +78 -91
- aider/tools/update_todo_list.py +130 -138
- aider/tools/utils/base_tool.py +64 -0
- aider/tools/utils/output.py +118 -0
- aider/tools/view.py +38 -54
- aider/tools/view_files_matching.py +131 -134
- aider/tools/view_files_with_symbol.py +108 -120
- aider/urls.py +1 -1
- aider/versioncheck.py +4 -3
- aider/website/docs/config/adv-model-settings.md +237 -0
- aider/website/docs/config/agent-mode.md +36 -3
- aider/website/docs/config/model-aliases.md +2 -1
- aider/website/docs/faq.md +6 -11
- aider/website/docs/languages.md +2 -2
- aider/website/docs/more/infinite-output.md +27 -0
- {aider_ce-0.88.20.dist-info → aider_ce-0.88.38.dist-info}/METADATA +112 -70
- {aider_ce-0.88.20.dist-info → aider_ce-0.88.38.dist-info}/RECORD +112 -107
- aider_ce-0.88.38.dist-info/entry_points.txt +6 -0
- aider_ce-0.88.20.dist-info/entry_points.txt +0 -2
- /aider/tools/{tool_utils.py → utils/helpers.py} +0 -0
- {aider_ce-0.88.20.dist-info → aider_ce-0.88.38.dist-info}/WHEEL +0 -0
- {aider_ce-0.88.20.dist-info → aider_ce-0.88.38.dist-info}/licenses/LICENSE.txt +0 -0
- {aider_ce-0.88.20.dist-info → aider_ce-0.88.38.dist-info}/top_level.txt +0 -0
aider/tools/finished.py
CHANGED
|
@@ -1,48 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
1
|
+
from aider.tools.utils.base_tool import BaseTool
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class Tool(BaseTool):
|
|
5
|
+
NORM_NAME = "finished"
|
|
6
|
+
SCHEMA = {
|
|
7
|
+
"type": "function",
|
|
8
|
+
"function": {
|
|
9
|
+
"name": "Finished",
|
|
10
|
+
"description": (
|
|
11
|
+
"Declare that we are done with every single sub goal and no further work is needed."
|
|
12
|
+
),
|
|
13
|
+
"parameters": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"properties": {},
|
|
16
|
+
"required": [],
|
|
17
|
+
},
|
|
12
18
|
},
|
|
13
|
-
}
|
|
14
|
-
}
|
|
19
|
+
}
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
@classmethod
|
|
22
|
+
def execute(cls, coder):
|
|
23
|
+
"""
|
|
24
|
+
Mark that the current generation task needs no further effort.
|
|
18
25
|
|
|
26
|
+
This gives the LLM explicit control over when it can stop looping
|
|
27
|
+
"""
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
if coder:
|
|
30
|
+
coder.agent_finished = True
|
|
31
|
+
# coder.io.tool_output("Task Finished!")
|
|
32
|
+
return "Task Finished!"
|
|
23
33
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if coder:
|
|
28
|
-
coder.agent_finished = True
|
|
29
|
-
# coder.io.tool_output("Task Finished!")
|
|
30
|
-
return "Task Finished!"
|
|
31
|
-
|
|
32
|
-
# coder.io.tool_Error("Error: Could not mark agent task as finished")
|
|
33
|
-
return "Error: Could not mark agent task as finished"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
def process_response(coder, params):
|
|
37
|
-
"""
|
|
38
|
-
Process the Finished tool response.
|
|
39
|
-
|
|
40
|
-
Args:
|
|
41
|
-
coder: The Coder instance
|
|
42
|
-
params: Dictionary of parameters (should be empty for Finished)
|
|
43
|
-
|
|
44
|
-
Returns:
|
|
45
|
-
str: Result message
|
|
46
|
-
"""
|
|
47
|
-
# Finished tool has no parameters to validate
|
|
48
|
-
return _execute_finished(coder)
|
|
34
|
+
# coder.io.tool_Error("Error: Could not mark agent task as finished")
|
|
35
|
+
return "Error: Could not mark agent task as finished"
|
aider/tools/git_branch.py
CHANGED
|
@@ -1,129 +1,127 @@
|
|
|
1
1
|
from aider.repo import ANY_GIT_ERROR
|
|
2
|
+
from aider.tools.utils.base_tool import BaseTool
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
4
|
+
|
|
5
|
+
class Tool(BaseTool):
|
|
6
|
+
NORM_NAME = "gitbranch"
|
|
7
|
+
SCHEMA = {
|
|
8
|
+
"type": "function",
|
|
9
|
+
"function": {
|
|
10
|
+
"name": "GitBranch",
|
|
11
|
+
"description": (
|
|
12
|
+
"List branches in the repository with various filtering and formatting options."
|
|
13
|
+
),
|
|
14
|
+
"parameters": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"remotes": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "List remote-tracking branches (-r/--remotes flag)",
|
|
20
|
+
},
|
|
21
|
+
"all": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "List both local and remote branches (-a/--all flag)",
|
|
24
|
+
},
|
|
25
|
+
"verbose": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"description": (
|
|
28
|
+
"Show verbose information including commit hash and subject (-v flag)"
|
|
29
|
+
),
|
|
30
|
+
},
|
|
31
|
+
"very_verbose": {
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"description": (
|
|
34
|
+
"Show very verbose information including upstream branch (-vv flag)"
|
|
35
|
+
),
|
|
36
|
+
},
|
|
37
|
+
"merged": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Show branches merged into specified commit (--merged flag)",
|
|
40
|
+
},
|
|
41
|
+
"no_merged": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": (
|
|
44
|
+
"Show branches not merged into specified commit (--no-merged flag)"
|
|
45
|
+
),
|
|
46
|
+
},
|
|
47
|
+
"sort": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": (
|
|
50
|
+
"Sort branches by key (committerdate, authordate, refname, etc.)"
|
|
51
|
+
" (--sort flag)"
|
|
52
|
+
),
|
|
53
|
+
},
|
|
54
|
+
"format": {
|
|
55
|
+
"type": "string",
|
|
56
|
+
"description": "Custom output format using placeholders (--format flag)",
|
|
57
|
+
},
|
|
58
|
+
"show_current": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"description": "Show only current branch name (--show-current flag)",
|
|
61
|
+
},
|
|
57
62
|
},
|
|
63
|
+
"required": [],
|
|
58
64
|
},
|
|
59
|
-
"required": [],
|
|
60
65
|
},
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
# Normalized tool name for lookup
|
|
65
|
-
NORM_NAME = "gitbranch"
|
|
66
|
+
}
|
|
66
67
|
|
|
68
|
+
@classmethod
|
|
69
|
+
def execute(
|
|
70
|
+
cls,
|
|
71
|
+
coder,
|
|
72
|
+
remotes=False,
|
|
73
|
+
all=False,
|
|
74
|
+
verbose=False,
|
|
75
|
+
very_verbose=False,
|
|
76
|
+
merged=None,
|
|
77
|
+
no_merged=None,
|
|
78
|
+
sort=None,
|
|
79
|
+
format=None,
|
|
80
|
+
show_current=False,
|
|
81
|
+
):
|
|
82
|
+
"""
|
|
83
|
+
List branches in the repository with various filtering and formatting options.
|
|
84
|
+
"""
|
|
85
|
+
if not coder.repo:
|
|
86
|
+
return "Not in a git repository."
|
|
67
87
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"""
|
|
72
|
-
if not coder.repo:
|
|
73
|
-
return "Not in a git repository."
|
|
88
|
+
try:
|
|
89
|
+
# Build git command arguments
|
|
90
|
+
args = []
|
|
74
91
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
args = []
|
|
78
|
-
|
|
79
|
-
# Handle boolean flags
|
|
80
|
-
if params:
|
|
81
|
-
if params.get("remotes"):
|
|
92
|
+
# Handle boolean flags
|
|
93
|
+
if remotes:
|
|
82
94
|
args.append("--remotes")
|
|
83
|
-
if
|
|
95
|
+
if all:
|
|
84
96
|
args.append("--all")
|
|
85
|
-
if
|
|
97
|
+
if verbose:
|
|
86
98
|
args.append("--verbose")
|
|
87
|
-
if
|
|
99
|
+
if very_verbose:
|
|
88
100
|
args.append("--verbose")
|
|
89
101
|
args.append("--verbose")
|
|
90
|
-
if
|
|
102
|
+
if show_current:
|
|
91
103
|
args.append("--show-current")
|
|
92
104
|
|
|
93
105
|
# Handle string parameters
|
|
94
|
-
if
|
|
95
|
-
args.extend(["--merged",
|
|
96
|
-
if
|
|
97
|
-
args.extend(["--no-merged",
|
|
98
|
-
if
|
|
99
|
-
args.extend(["--sort",
|
|
100
|
-
if
|
|
101
|
-
args.extend(["--format",
|
|
102
|
-
|
|
103
|
-
# Execute git command
|
|
104
|
-
result = coder.repo.repo.git.branch(*args)
|
|
105
|
-
|
|
106
|
-
# If no result and show_current was used, get current branch directly
|
|
107
|
-
if not result and params and params.get("show_current"):
|
|
108
|
-
current_branch = coder.repo.repo.active_branch.name
|
|
109
|
-
return current_branch
|
|
110
|
-
|
|
111
|
-
return result if result else "No branches found matching the criteria."
|
|
112
|
-
|
|
113
|
-
except ANY_GIT_ERROR as e:
|
|
114
|
-
coder.io.tool_error(f"Error running git branch: {e}")
|
|
115
|
-
return f"Error running git branch: {e}"
|
|
106
|
+
if merged:
|
|
107
|
+
args.extend(["--merged", merged])
|
|
108
|
+
if no_merged:
|
|
109
|
+
args.extend(["--no-merged", no_merged])
|
|
110
|
+
if sort:
|
|
111
|
+
args.extend(["--sort", sort])
|
|
112
|
+
if format:
|
|
113
|
+
args.extend(["--format", format])
|
|
116
114
|
|
|
115
|
+
# Execute git command
|
|
116
|
+
result = coder.repo.repo.git.branch(*args)
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
# If no result and show_current was used, get current branch directly
|
|
119
|
+
if not result and show_current:
|
|
120
|
+
current_branch = coder.repo.repo.active_branch.name
|
|
121
|
+
return current_branch
|
|
121
122
|
|
|
122
|
-
|
|
123
|
-
coder: The Coder instance
|
|
124
|
-
params: Dictionary of parameters for GitBranch
|
|
123
|
+
return result if result else "No branches found matching the criteria."
|
|
125
124
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return _execute_git_branch(coder, params)
|
|
125
|
+
except ANY_GIT_ERROR as e:
|
|
126
|
+
coder.io.tool_error(f"Error running git branch: {e}")
|
|
127
|
+
return f"Error running git branch: {e}"
|
aider/tools/git_diff.py
CHANGED
|
@@ -1,60 +1,48 @@
|
|
|
1
1
|
from aider.repo import ANY_GIT_ERROR
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
from aider.tools.utils.base_tool import BaseTool
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Tool(BaseTool):
|
|
6
|
+
NORM_NAME = "gitdiff"
|
|
7
|
+
SCHEMA = {
|
|
8
|
+
"type": "function",
|
|
9
|
+
"function": {
|
|
10
|
+
"name": "GitDiff",
|
|
11
|
+
"description": (
|
|
12
|
+
"Show the diff between the current working directory and a git branch or commit."
|
|
13
|
+
),
|
|
14
|
+
"parameters": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"branch": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": (
|
|
20
|
+
"The branch or commit hash to diff against. Defaults to HEAD."
|
|
21
|
+
),
|
|
22
|
+
},
|
|
16
23
|
},
|
|
24
|
+
"required": [],
|
|
17
25
|
},
|
|
18
|
-
"required": [],
|
|
19
26
|
},
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
diff
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return "
|
|
42
|
-
return diff
|
|
43
|
-
except ANY_GIT_ERROR as e:
|
|
44
|
-
coder.io.tool_error(f"Error running git diff: {e}")
|
|
45
|
-
return f"Error running git diff: {e}"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def process_response(coder, params):
|
|
49
|
-
"""
|
|
50
|
-
Process the GitDiff tool response.
|
|
51
|
-
|
|
52
|
-
Args:
|
|
53
|
-
coder: The Coder instance
|
|
54
|
-
params: Dictionary of parameters
|
|
55
|
-
|
|
56
|
-
Returns:
|
|
57
|
-
str: Result message
|
|
58
|
-
"""
|
|
59
|
-
branch = params.get("branch")
|
|
60
|
-
return _execute_git_diff(coder, branch)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def execute(cls, coder, branch=None):
|
|
31
|
+
"""
|
|
32
|
+
Show the diff between the current working directory and a git branch or commit.
|
|
33
|
+
"""
|
|
34
|
+
if not coder.repo:
|
|
35
|
+
return "Not in a git repository."
|
|
36
|
+
|
|
37
|
+
try:
|
|
38
|
+
if branch:
|
|
39
|
+
diff = coder.repo.diff_commits(False, branch, "HEAD")
|
|
40
|
+
else:
|
|
41
|
+
diff = coder.repo.diff_commits(False, "HEAD", None)
|
|
42
|
+
|
|
43
|
+
if not diff:
|
|
44
|
+
return "No differences found."
|
|
45
|
+
return diff
|
|
46
|
+
except ANY_GIT_ERROR as e:
|
|
47
|
+
coder.io.tool_error(f"Error running git diff: {e}")
|
|
48
|
+
return f"Error running git diff: {e}"
|
aider/tools/git_log.py
CHANGED
|
@@ -1,57 +1,43 @@
|
|
|
1
1
|
from aider.repo import ANY_GIT_ERROR
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
from aider.tools.utils.base_tool import BaseTool
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Tool(BaseTool):
|
|
6
|
+
NORM_NAME = "gitlog"
|
|
7
|
+
SCHEMA = {
|
|
8
|
+
"type": "function",
|
|
9
|
+
"function": {
|
|
10
|
+
"name": "GitLog",
|
|
11
|
+
"description": "Show the git log.",
|
|
12
|
+
"parameters": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"limit": {
|
|
16
|
+
"type": "integer",
|
|
17
|
+
"description": "The maximum number of commits to show. Defaults to 10.",
|
|
18
|
+
},
|
|
14
19
|
},
|
|
20
|
+
"required": [],
|
|
15
21
|
},
|
|
16
|
-
"required": [],
|
|
17
22
|
},
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return "\n".join(log_output)
|
|
40
|
-
except ANY_GIT_ERROR as e:
|
|
41
|
-
coder.io.tool_error(f"Error running git log: {e}")
|
|
42
|
-
return f"Error running git log: {e}"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def process_response(coder, params):
|
|
46
|
-
"""
|
|
47
|
-
Process the GitLog tool response.
|
|
48
|
-
|
|
49
|
-
Args:
|
|
50
|
-
coder: The Coder instance
|
|
51
|
-
params: Dictionary of parameters
|
|
52
|
-
|
|
53
|
-
Returns:
|
|
54
|
-
str: Result message
|
|
55
|
-
"""
|
|
56
|
-
limit = params.get("limit", 10)
|
|
57
|
-
return _execute_git_log(coder, limit)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@classmethod
|
|
26
|
+
def execute(cls, coder, limit=10):
|
|
27
|
+
"""
|
|
28
|
+
Show the git log.
|
|
29
|
+
"""
|
|
30
|
+
if not coder.repo:
|
|
31
|
+
return "Not in a git repository."
|
|
32
|
+
|
|
33
|
+
try:
|
|
34
|
+
commits = list(coder.repo.repo.iter_commits(max_count=limit))
|
|
35
|
+
log_output = []
|
|
36
|
+
for commit in commits:
|
|
37
|
+
short_hash = commit.hexsha[:8]
|
|
38
|
+
message = commit.message.strip().split("\n")[0]
|
|
39
|
+
log_output.append(f"{short_hash} {message}")
|
|
40
|
+
return "\n".join(log_output)
|
|
41
|
+
except ANY_GIT_ERROR as e:
|
|
42
|
+
coder.io.tool_error(f"Error running git log: {e}")
|
|
43
|
+
return f"Error running git log: {e}"
|
aider/tools/git_remote.py
CHANGED
|
@@ -1,53 +1,39 @@
|
|
|
1
1
|
from aider.repo import ANY_GIT_ERROR
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
2
|
+
from aider.tools.utils.base_tool import BaseTool
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Tool(BaseTool):
|
|
6
|
+
NORM_NAME = "gitremote"
|
|
7
|
+
SCHEMA = {
|
|
8
|
+
"type": "function",
|
|
9
|
+
"function": {
|
|
10
|
+
"name": "GitRemote",
|
|
11
|
+
"description": "List remote repositories.",
|
|
12
|
+
"parameters": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {},
|
|
15
|
+
"required": [],
|
|
16
|
+
},
|
|
12
17
|
},
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return "\n".join(result)
|
|
36
|
-
except ANY_GIT_ERROR as e:
|
|
37
|
-
coder.io.tool_error(f"Error running git remote: {e}")
|
|
38
|
-
return f"Error running git remote: {e}"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def process_response(coder, params):
|
|
42
|
-
"""
|
|
43
|
-
Process the GitRemote tool response.
|
|
44
|
-
|
|
45
|
-
Args:
|
|
46
|
-
coder: The Coder instance
|
|
47
|
-
params: Dictionary of parameters (should be empty for GitRemote)
|
|
48
|
-
|
|
49
|
-
Returns:
|
|
50
|
-
str: Result message
|
|
51
|
-
"""
|
|
52
|
-
# GitRemote tool has no parameters to validate
|
|
53
|
-
return _execute_git_remote(coder)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@classmethod
|
|
21
|
+
def execute(cls, coder):
|
|
22
|
+
"""
|
|
23
|
+
List remote repositories.
|
|
24
|
+
"""
|
|
25
|
+
if not coder.repo:
|
|
26
|
+
return "Not in a git repository."
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
remotes = coder.repo.repo.remotes
|
|
30
|
+
if not remotes:
|
|
31
|
+
return "No remotes configured."
|
|
32
|
+
|
|
33
|
+
result = []
|
|
34
|
+
for remote in remotes:
|
|
35
|
+
result.append(f"{remote.name}\t{remote.url}")
|
|
36
|
+
return "\n".join(result)
|
|
37
|
+
except ANY_GIT_ERROR as e:
|
|
38
|
+
coder.io.tool_error(f"Error running git remote: {e}")
|
|
39
|
+
return f"Error running git remote: {e}"
|