aider-ce 0.88.20__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 (279) hide show
  1. aider/__init__.py +20 -0
  2. aider/__main__.py +4 -0
  3. aider/_version.py +34 -0
  4. aider/analytics.py +258 -0
  5. aider/args.py +1056 -0
  6. aider/args_formatter.py +228 -0
  7. aider/change_tracker.py +133 -0
  8. aider/coders/__init__.py +36 -0
  9. aider/coders/agent_coder.py +2166 -0
  10. aider/coders/agent_prompts.py +104 -0
  11. aider/coders/architect_coder.py +48 -0
  12. aider/coders/architect_prompts.py +40 -0
  13. aider/coders/ask_coder.py +9 -0
  14. aider/coders/ask_prompts.py +35 -0
  15. aider/coders/base_coder.py +3613 -0
  16. aider/coders/base_prompts.py +87 -0
  17. aider/coders/chat_chunks.py +64 -0
  18. aider/coders/context_coder.py +53 -0
  19. aider/coders/context_prompts.py +75 -0
  20. aider/coders/editblock_coder.py +657 -0
  21. aider/coders/editblock_fenced_coder.py +10 -0
  22. aider/coders/editblock_fenced_prompts.py +143 -0
  23. aider/coders/editblock_func_coder.py +141 -0
  24. aider/coders/editblock_func_prompts.py +27 -0
  25. aider/coders/editblock_prompts.py +175 -0
  26. aider/coders/editor_diff_fenced_coder.py +9 -0
  27. aider/coders/editor_diff_fenced_prompts.py +11 -0
  28. aider/coders/editor_editblock_coder.py +9 -0
  29. aider/coders/editor_editblock_prompts.py +21 -0
  30. aider/coders/editor_whole_coder.py +9 -0
  31. aider/coders/editor_whole_prompts.py +12 -0
  32. aider/coders/help_coder.py +16 -0
  33. aider/coders/help_prompts.py +46 -0
  34. aider/coders/patch_coder.py +706 -0
  35. aider/coders/patch_prompts.py +159 -0
  36. aider/coders/search_replace.py +757 -0
  37. aider/coders/shell.py +37 -0
  38. aider/coders/single_wholefile_func_coder.py +102 -0
  39. aider/coders/single_wholefile_func_prompts.py +27 -0
  40. aider/coders/udiff_coder.py +429 -0
  41. aider/coders/udiff_prompts.py +115 -0
  42. aider/coders/udiff_simple.py +14 -0
  43. aider/coders/udiff_simple_prompts.py +25 -0
  44. aider/coders/wholefile_coder.py +144 -0
  45. aider/coders/wholefile_func_coder.py +134 -0
  46. aider/coders/wholefile_func_prompts.py +27 -0
  47. aider/coders/wholefile_prompts.py +65 -0
  48. aider/commands.py +2173 -0
  49. aider/copypaste.py +72 -0
  50. aider/deprecated.py +126 -0
  51. aider/diffs.py +128 -0
  52. aider/dump.py +29 -0
  53. aider/editor.py +147 -0
  54. aider/exceptions.py +115 -0
  55. aider/format_settings.py +26 -0
  56. aider/gui.py +545 -0
  57. aider/help.py +163 -0
  58. aider/help_pats.py +19 -0
  59. aider/helpers/__init__.py +9 -0
  60. aider/helpers/similarity.py +98 -0
  61. aider/history.py +180 -0
  62. aider/io.py +1608 -0
  63. aider/linter.py +304 -0
  64. aider/llm.py +55 -0
  65. aider/main.py +1415 -0
  66. aider/mcp/__init__.py +174 -0
  67. aider/mcp/server.py +149 -0
  68. aider/mdstream.py +243 -0
  69. aider/models.py +1313 -0
  70. aider/onboarding.py +429 -0
  71. aider/openrouter.py +129 -0
  72. aider/prompts.py +56 -0
  73. aider/queries/tree-sitter-language-pack/README.md +7 -0
  74. aider/queries/tree-sitter-language-pack/arduino-tags.scm +5 -0
  75. aider/queries/tree-sitter-language-pack/c-tags.scm +9 -0
  76. aider/queries/tree-sitter-language-pack/chatito-tags.scm +16 -0
  77. aider/queries/tree-sitter-language-pack/clojure-tags.scm +7 -0
  78. aider/queries/tree-sitter-language-pack/commonlisp-tags.scm +122 -0
  79. aider/queries/tree-sitter-language-pack/cpp-tags.scm +15 -0
  80. aider/queries/tree-sitter-language-pack/csharp-tags.scm +26 -0
  81. aider/queries/tree-sitter-language-pack/d-tags.scm +26 -0
  82. aider/queries/tree-sitter-language-pack/dart-tags.scm +92 -0
  83. aider/queries/tree-sitter-language-pack/elisp-tags.scm +5 -0
  84. aider/queries/tree-sitter-language-pack/elixir-tags.scm +54 -0
  85. aider/queries/tree-sitter-language-pack/elm-tags.scm +19 -0
  86. aider/queries/tree-sitter-language-pack/gleam-tags.scm +41 -0
  87. aider/queries/tree-sitter-language-pack/go-tags.scm +42 -0
  88. aider/queries/tree-sitter-language-pack/java-tags.scm +20 -0
  89. aider/queries/tree-sitter-language-pack/javascript-tags.scm +88 -0
  90. aider/queries/tree-sitter-language-pack/lua-tags.scm +34 -0
  91. aider/queries/tree-sitter-language-pack/matlab-tags.scm +10 -0
  92. aider/queries/tree-sitter-language-pack/ocaml-tags.scm +115 -0
  93. aider/queries/tree-sitter-language-pack/ocaml_interface-tags.scm +98 -0
  94. aider/queries/tree-sitter-language-pack/pony-tags.scm +39 -0
  95. aider/queries/tree-sitter-language-pack/properties-tags.scm +5 -0
  96. aider/queries/tree-sitter-language-pack/python-tags.scm +14 -0
  97. aider/queries/tree-sitter-language-pack/r-tags.scm +21 -0
  98. aider/queries/tree-sitter-language-pack/racket-tags.scm +12 -0
  99. aider/queries/tree-sitter-language-pack/ruby-tags.scm +64 -0
  100. aider/queries/tree-sitter-language-pack/rust-tags.scm +60 -0
  101. aider/queries/tree-sitter-language-pack/solidity-tags.scm +43 -0
  102. aider/queries/tree-sitter-language-pack/swift-tags.scm +51 -0
  103. aider/queries/tree-sitter-language-pack/udev-tags.scm +20 -0
  104. aider/queries/tree-sitter-languages/README.md +24 -0
  105. aider/queries/tree-sitter-languages/c-tags.scm +9 -0
  106. aider/queries/tree-sitter-languages/c_sharp-tags.scm +46 -0
  107. aider/queries/tree-sitter-languages/cpp-tags.scm +15 -0
  108. aider/queries/tree-sitter-languages/dart-tags.scm +91 -0
  109. aider/queries/tree-sitter-languages/elisp-tags.scm +8 -0
  110. aider/queries/tree-sitter-languages/elixir-tags.scm +54 -0
  111. aider/queries/tree-sitter-languages/elm-tags.scm +19 -0
  112. aider/queries/tree-sitter-languages/fortran-tags.scm +15 -0
  113. aider/queries/tree-sitter-languages/go-tags.scm +30 -0
  114. aider/queries/tree-sitter-languages/haskell-tags.scm +3 -0
  115. aider/queries/tree-sitter-languages/hcl-tags.scm +77 -0
  116. aider/queries/tree-sitter-languages/java-tags.scm +20 -0
  117. aider/queries/tree-sitter-languages/javascript-tags.scm +88 -0
  118. aider/queries/tree-sitter-languages/julia-tags.scm +60 -0
  119. aider/queries/tree-sitter-languages/kotlin-tags.scm +27 -0
  120. aider/queries/tree-sitter-languages/matlab-tags.scm +10 -0
  121. aider/queries/tree-sitter-languages/ocaml-tags.scm +115 -0
  122. aider/queries/tree-sitter-languages/ocaml_interface-tags.scm +98 -0
  123. aider/queries/tree-sitter-languages/php-tags.scm +26 -0
  124. aider/queries/tree-sitter-languages/python-tags.scm +12 -0
  125. aider/queries/tree-sitter-languages/ql-tags.scm +26 -0
  126. aider/queries/tree-sitter-languages/ruby-tags.scm +64 -0
  127. aider/queries/tree-sitter-languages/rust-tags.scm +60 -0
  128. aider/queries/tree-sitter-languages/scala-tags.scm +65 -0
  129. aider/queries/tree-sitter-languages/typescript-tags.scm +41 -0
  130. aider/queries/tree-sitter-languages/zig-tags.scm +3 -0
  131. aider/reasoning_tags.py +82 -0
  132. aider/repo.py +621 -0
  133. aider/repomap.py +1174 -0
  134. aider/report.py +260 -0
  135. aider/resources/__init__.py +3 -0
  136. aider/resources/model-metadata.json +776 -0
  137. aider/resources/model-settings.yml +2068 -0
  138. aider/run_cmd.py +133 -0
  139. aider/scrape.py +293 -0
  140. aider/sendchat.py +242 -0
  141. aider/sessions.py +256 -0
  142. aider/special.py +203 -0
  143. aider/tools/__init__.py +72 -0
  144. aider/tools/command.py +105 -0
  145. aider/tools/command_interactive.py +122 -0
  146. aider/tools/delete_block.py +182 -0
  147. aider/tools/delete_line.py +155 -0
  148. aider/tools/delete_lines.py +184 -0
  149. aider/tools/extract_lines.py +341 -0
  150. aider/tools/finished.py +48 -0
  151. aider/tools/git_branch.py +129 -0
  152. aider/tools/git_diff.py +60 -0
  153. aider/tools/git_log.py +57 -0
  154. aider/tools/git_remote.py +53 -0
  155. aider/tools/git_show.py +51 -0
  156. aider/tools/git_status.py +46 -0
  157. aider/tools/grep.py +256 -0
  158. aider/tools/indent_lines.py +221 -0
  159. aider/tools/insert_block.py +288 -0
  160. aider/tools/list_changes.py +86 -0
  161. aider/tools/ls.py +93 -0
  162. aider/tools/make_editable.py +85 -0
  163. aider/tools/make_readonly.py +69 -0
  164. aider/tools/remove.py +91 -0
  165. aider/tools/replace_all.py +126 -0
  166. aider/tools/replace_line.py +173 -0
  167. aider/tools/replace_lines.py +217 -0
  168. aider/tools/replace_text.py +187 -0
  169. aider/tools/show_numbered_context.py +147 -0
  170. aider/tools/tool_utils.py +313 -0
  171. aider/tools/undo_change.py +95 -0
  172. aider/tools/update_todo_list.py +156 -0
  173. aider/tools/view.py +57 -0
  174. aider/tools/view_files_matching.py +141 -0
  175. aider/tools/view_files_with_symbol.py +129 -0
  176. aider/urls.py +17 -0
  177. aider/utils.py +456 -0
  178. aider/versioncheck.py +113 -0
  179. aider/voice.py +205 -0
  180. aider/waiting.py +38 -0
  181. aider/watch.py +318 -0
  182. aider/watch_prompts.py +12 -0
  183. aider/website/Gemfile +8 -0
  184. aider/website/_includes/blame.md +162 -0
  185. aider/website/_includes/get-started.md +22 -0
  186. aider/website/_includes/help-tip.md +5 -0
  187. aider/website/_includes/help.md +24 -0
  188. aider/website/_includes/install.md +5 -0
  189. aider/website/_includes/keys.md +4 -0
  190. aider/website/_includes/model-warnings.md +67 -0
  191. aider/website/_includes/multi-line.md +22 -0
  192. aider/website/_includes/python-m-aider.md +5 -0
  193. aider/website/_includes/recording.css +228 -0
  194. aider/website/_includes/recording.md +34 -0
  195. aider/website/_includes/replit-pipx.md +9 -0
  196. aider/website/_includes/works-best.md +1 -0
  197. aider/website/_sass/custom/custom.scss +103 -0
  198. aider/website/docs/config/adv-model-settings.md +2261 -0
  199. aider/website/docs/config/agent-mode.md +194 -0
  200. aider/website/docs/config/aider_conf.md +548 -0
  201. aider/website/docs/config/api-keys.md +90 -0
  202. aider/website/docs/config/dotenv.md +493 -0
  203. aider/website/docs/config/editor.md +127 -0
  204. aider/website/docs/config/mcp.md +95 -0
  205. aider/website/docs/config/model-aliases.md +104 -0
  206. aider/website/docs/config/options.md +890 -0
  207. aider/website/docs/config/reasoning.md +210 -0
  208. aider/website/docs/config.md +44 -0
  209. aider/website/docs/faq.md +384 -0
  210. aider/website/docs/git.md +76 -0
  211. aider/website/docs/index.md +47 -0
  212. aider/website/docs/install/codespaces.md +39 -0
  213. aider/website/docs/install/docker.md +57 -0
  214. aider/website/docs/install/optional.md +100 -0
  215. aider/website/docs/install/replit.md +8 -0
  216. aider/website/docs/install.md +115 -0
  217. aider/website/docs/languages.md +264 -0
  218. aider/website/docs/legal/contributor-agreement.md +111 -0
  219. aider/website/docs/legal/privacy.md +104 -0
  220. aider/website/docs/llms/anthropic.md +77 -0
  221. aider/website/docs/llms/azure.md +48 -0
  222. aider/website/docs/llms/bedrock.md +132 -0
  223. aider/website/docs/llms/cohere.md +34 -0
  224. aider/website/docs/llms/deepseek.md +32 -0
  225. aider/website/docs/llms/gemini.md +49 -0
  226. aider/website/docs/llms/github.md +111 -0
  227. aider/website/docs/llms/groq.md +36 -0
  228. aider/website/docs/llms/lm-studio.md +39 -0
  229. aider/website/docs/llms/ollama.md +75 -0
  230. aider/website/docs/llms/openai-compat.md +39 -0
  231. aider/website/docs/llms/openai.md +58 -0
  232. aider/website/docs/llms/openrouter.md +78 -0
  233. aider/website/docs/llms/other.md +117 -0
  234. aider/website/docs/llms/vertex.md +50 -0
  235. aider/website/docs/llms/warnings.md +10 -0
  236. aider/website/docs/llms/xai.md +53 -0
  237. aider/website/docs/llms.md +54 -0
  238. aider/website/docs/more/analytics.md +127 -0
  239. aider/website/docs/more/edit-formats.md +116 -0
  240. aider/website/docs/more/infinite-output.md +165 -0
  241. aider/website/docs/more-info.md +8 -0
  242. aider/website/docs/recordings/auto-accept-architect.md +31 -0
  243. aider/website/docs/recordings/dont-drop-original-read-files.md +35 -0
  244. aider/website/docs/recordings/index.md +21 -0
  245. aider/website/docs/recordings/model-accepts-settings.md +69 -0
  246. aider/website/docs/recordings/tree-sitter-language-pack.md +80 -0
  247. aider/website/docs/repomap.md +112 -0
  248. aider/website/docs/scripting.md +100 -0
  249. aider/website/docs/sessions.md +203 -0
  250. aider/website/docs/troubleshooting/aider-not-found.md +24 -0
  251. aider/website/docs/troubleshooting/edit-errors.md +76 -0
  252. aider/website/docs/troubleshooting/imports.md +62 -0
  253. aider/website/docs/troubleshooting/models-and-keys.md +54 -0
  254. aider/website/docs/troubleshooting/support.md +79 -0
  255. aider/website/docs/troubleshooting/token-limits.md +96 -0
  256. aider/website/docs/troubleshooting/warnings.md +12 -0
  257. aider/website/docs/troubleshooting.md +11 -0
  258. aider/website/docs/usage/browser.md +57 -0
  259. aider/website/docs/usage/caching.md +49 -0
  260. aider/website/docs/usage/commands.md +133 -0
  261. aider/website/docs/usage/conventions.md +119 -0
  262. aider/website/docs/usage/copypaste.md +121 -0
  263. aider/website/docs/usage/images-urls.md +48 -0
  264. aider/website/docs/usage/lint-test.md +118 -0
  265. aider/website/docs/usage/modes.md +211 -0
  266. aider/website/docs/usage/not-code.md +179 -0
  267. aider/website/docs/usage/notifications.md +87 -0
  268. aider/website/docs/usage/tips.md +79 -0
  269. aider/website/docs/usage/tutorials.md +30 -0
  270. aider/website/docs/usage/voice.md +121 -0
  271. aider/website/docs/usage/watch.md +294 -0
  272. aider/website/docs/usage.md +102 -0
  273. aider/website/share/index.md +101 -0
  274. aider_ce-0.88.20.dist-info/METADATA +187 -0
  275. aider_ce-0.88.20.dist-info/RECORD +279 -0
  276. aider_ce-0.88.20.dist-info/WHEEL +5 -0
  277. aider_ce-0.88.20.dist-info/entry_points.txt +2 -0
  278. aider_ce-0.88.20.dist-info/licenses/LICENSE.txt +202 -0
  279. aider_ce-0.88.20.dist-info/top_level.txt +1 -0
aider/report.py ADDED
@@ -0,0 +1,260 @@
1
+ import os
2
+ import platform
3
+ import subprocess
4
+ import sys
5
+ import traceback
6
+ import urllib.parse
7
+ import webbrowser
8
+
9
+ from aider import __version__
10
+ from aider.urls import github_issues
11
+ from aider.versioncheck import VERSION_CHECK_FNAME
12
+
13
+ # Global variable to store resolved args data for error reporting
14
+ resolved_args_data = None
15
+
16
+ FENCE = "`" * 3
17
+
18
+
19
+ def get_python_info():
20
+ implementation = platform.python_implementation()
21
+ is_venv = sys.prefix != sys.base_prefix
22
+ return (
23
+ f"Python implementation: {implementation}\nVirtual environment:"
24
+ f" {'Yes' if is_venv else 'No'}"
25
+ )
26
+
27
+
28
+ def get_os_info():
29
+ return f"OS: {platform.system()} {platform.release()} ({platform.architecture()[0]})"
30
+
31
+
32
+ def get_git_info():
33
+ try:
34
+ git_version = subprocess.check_output(["git", "--version"]).decode().strip()
35
+ return f"Git version: {git_version}"
36
+ except Exception:
37
+ return "Git information unavailable"
38
+
39
+
40
+ def format_args_for_reporting(args):
41
+ """
42
+ Format args data for error reporting, removing sensitive keys and collapsing MCP servers.
43
+ """
44
+ if not args:
45
+ return "No args data available"
46
+
47
+ # Create a copy of the args namespace as a dictionary
48
+ args_dict = vars(args).copy()
49
+
50
+ # Remove any keys containing "key" (case insensitive)
51
+ keys_to_remove = [key for key in args_dict.keys() if "key" in key.lower()]
52
+ for key in keys_to_remove:
53
+ args_dict.pop(key, None)
54
+
55
+ # Handle mcp_servers - collapse into just a list of server names
56
+ if "mcp_servers" in args_dict:
57
+ mcp_servers = args_dict["mcp_servers"]
58
+ if isinstance(mcp_servers, str):
59
+ try:
60
+ import json
61
+
62
+ config = json.loads(mcp_servers)
63
+ if "mcpServers" in config:
64
+ server_names = list(config["mcpServers"].keys())
65
+ args_dict["mcp_servers"] = server_names
66
+ except (json.JSONDecodeError, AttributeError):
67
+ # If parsing fails, keep the original value
68
+ pass
69
+
70
+ # Format the output line by line
71
+ lines = ["Configuration:"]
72
+ for key, value in sorted(args_dict.items()):
73
+ lines.append(f"{key}: {value}")
74
+
75
+ return "\n".join(lines)
76
+
77
+
78
+ def get_args_error_data():
79
+ global resolved_args_data
80
+ return resolved_args_data
81
+
82
+
83
+ def set_args_error_data(args):
84
+ global resolved_args_data
85
+ resolved_args_data = args
86
+
87
+
88
+ def report_github_issue(issue_text, title=None, confirm=True):
89
+ """
90
+ Compose a URL to open a new GitHub issue with the given text prefilled,
91
+ and attempt to launch it in the default web browser.
92
+
93
+ :param issue_text: The text of the issue to file
94
+ :param title: The title of the issue (optional)
95
+ :param confirm: Whether to ask for confirmation before opening the browser (default: True)
96
+ :return: None
97
+ """
98
+ version_info = f"Aider version: {__version__}\n"
99
+ python_version = f"Python version: {sys.version.split()[0]}\n"
100
+ platform_info = f"Platform: {platform.platform()}\n"
101
+ python_info = get_python_info() + "\n"
102
+ os_info = get_os_info() + "\n"
103
+ git_info = get_git_info() + "\n"
104
+ args_info = format_args_for_reporting(get_args_error_data()) + "\n"
105
+
106
+ system_info = (
107
+ version_info
108
+ + python_version
109
+ + platform_info
110
+ + python_info
111
+ + os_info
112
+ + git_info
113
+ + "\n"
114
+ + args_info
115
+ + "\n"
116
+ )
117
+
118
+ issue_text = system_info + issue_text
119
+ params = {"body": issue_text}
120
+ if title is None:
121
+ title = "Bug report"
122
+ params["title"] = title
123
+ issue_url = f"{github_issues}?{urllib.parse.urlencode(params)}"
124
+
125
+ if confirm:
126
+ print(f"\n# {title}\n")
127
+ print(issue_text.strip())
128
+ print()
129
+ print("Please consider reporting this bug to help improve aider!")
130
+ prompt = "Open a GitHub Issue pre-filled with the above error in your browser? (Y/n) "
131
+ confirmation = input(prompt).strip().lower()
132
+
133
+ yes = not confirmation or confirmation.startswith("y")
134
+ if not yes:
135
+ return
136
+
137
+ print("Attempting to open the issue URL in your default web browser...")
138
+ try:
139
+ if webbrowser.open(issue_url):
140
+ print("Browser window should be opened.")
141
+ except Exception:
142
+ pass
143
+
144
+ if confirm:
145
+ print()
146
+ print()
147
+ print("You can also use this URL to file the GitHub Issue:")
148
+ print()
149
+ print(issue_url)
150
+ print()
151
+ print()
152
+
153
+
154
+ def exception_handler(exc_type, exc_value, exc_traceback):
155
+ # If it's a KeyboardInterrupt, just call the default handler
156
+ if issubclass(exc_type, KeyboardInterrupt):
157
+ return sys.__excepthook__(exc_type, exc_value, exc_traceback)
158
+
159
+ # We don't want any more exceptions
160
+ sys.excepthook = None
161
+
162
+ # Check if VERSION_CHECK_FNAME exists and delete it if so
163
+ try:
164
+ if VERSION_CHECK_FNAME.exists():
165
+ VERSION_CHECK_FNAME.unlink()
166
+ except Exception:
167
+ pass # Swallow any errors
168
+
169
+ # Format the traceback
170
+ tb_lines = traceback.format_exception(exc_type, exc_value, exc_traceback)
171
+
172
+ # Replace full paths with basenames in the traceback
173
+ tb_lines_with_basenames = []
174
+ for line in tb_lines:
175
+ try:
176
+ if "File " in line:
177
+ parts = line.split('"')
178
+ if len(parts) > 1:
179
+ full_path = parts[1]
180
+ basename = os.path.basename(full_path)
181
+ line = line.replace(full_path, basename)
182
+ except Exception:
183
+ pass
184
+ tb_lines_with_basenames.append(line)
185
+
186
+ tb_text = "".join(tb_lines_with_basenames)
187
+
188
+ # Find the innermost frame
189
+ innermost_tb = exc_traceback
190
+ while innermost_tb.tb_next:
191
+ innermost_tb = innermost_tb.tb_next
192
+
193
+ # Get the filename and line number from the innermost frame
194
+ filename = innermost_tb.tb_frame.f_code.co_filename
195
+ line_number = innermost_tb.tb_lineno
196
+ try:
197
+ basename = os.path.basename(filename)
198
+ except Exception:
199
+ basename = filename
200
+
201
+ # Get the exception type name
202
+ exception_type = exc_type.__name__
203
+
204
+ # Prepare the issue text
205
+ issue_text = f"An uncaught exception occurred:\n\n{FENCE}\n{tb_text}\n{FENCE}"
206
+
207
+ # Prepare the title
208
+ title = f"Uncaught {exception_type} in {basename} line {line_number}"
209
+
210
+ # Report the issue
211
+ report_github_issue(issue_text, title=title)
212
+
213
+ # Call the default exception handler
214
+ sys.__excepthook__(exc_type, exc_value, exc_traceback)
215
+
216
+
217
+ def report_uncaught_exceptions():
218
+ """
219
+ Set up the global exception handler to report uncaught exceptions.
220
+ """
221
+ sys.excepthook = exception_handler
222
+
223
+
224
+ def dummy_function1():
225
+ def dummy_function2():
226
+ def dummy_function3():
227
+ raise ValueError("boo")
228
+
229
+ dummy_function3()
230
+
231
+ dummy_function2()
232
+
233
+
234
+ def main():
235
+ report_uncaught_exceptions()
236
+
237
+ dummy_function1()
238
+
239
+ title = None
240
+ if len(sys.argv) > 2:
241
+ # Use the first command-line argument as the title and the second as the issue text
242
+ title = sys.argv[1]
243
+ issue_text = sys.argv[2]
244
+ elif len(sys.argv) > 1:
245
+ # Use the first command-line argument as the issue text
246
+ issue_text = sys.argv[1]
247
+ else:
248
+ # Read from stdin if no argument is provided
249
+ print("Enter the issue title (optional, press Enter to skip):")
250
+ title = input().strip()
251
+ if not title:
252
+ title = None
253
+ print("Enter the issue text (Ctrl+D to finish):")
254
+ issue_text = sys.stdin.read().strip()
255
+
256
+ report_github_issue(issue_text, title)
257
+
258
+
259
+ if __name__ == "__main__":
260
+ main()
@@ -0,0 +1,3 @@
1
+ # This ensures that importlib_resources.files("aider.resources")
2
+ # doesn't raise ImportError, even if there are no other files in this
3
+ # dir.