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