patch-chat 0.1.0__tar.gz

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 (309) hide show
  1. patch_chat-0.1.0/.agents/resume +5 -0
  2. patch_chat-0.1.0/.agents/setup +35 -0
  3. patch_chat-0.1.0/.dockerignore +11 -0
  4. patch_chat-0.1.0/.flake8 +3 -0
  5. patch_chat-0.1.0/.github/ISSUE_TEMPLATE/issue.yml +21 -0
  6. patch_chat-0.1.0/.github/workflows/pre-commit.yml +48 -0
  7. patch_chat-0.1.0/.github/workflows/ubuntu-tests.yml +52 -0
  8. patch_chat-0.1.0/.github/workflows/windows-tests.yml +48 -0
  9. patch_chat-0.1.0/.gitignore +22 -0
  10. patch_chat-0.1.0/.pre-commit-config.yaml +27 -0
  11. patch_chat-0.1.0/AGENTS.md +92 -0
  12. patch_chat-0.1.0/AUDIT_REPORT.md +1133 -0
  13. patch_chat-0.1.0/CHANGELOG.md +178 -0
  14. patch_chat-0.1.0/CONTRIBUTING.md +226 -0
  15. patch_chat-0.1.0/LICENSE.txt +202 -0
  16. patch_chat-0.1.0/MANIFEST.in +1 -0
  17. patch_chat-0.1.0/PKG-INFO +375 -0
  18. patch_chat-0.1.0/README.md +113 -0
  19. patch_chat-0.1.0/benchmark/Dockerfile +64 -0
  20. patch_chat-0.1.0/benchmark/README.md +138 -0
  21. patch_chat-0.1.0/benchmark/__init__.py +0 -0
  22. patch_chat-0.1.0/benchmark/benchmark.py +1059 -0
  23. patch_chat-0.1.0/benchmark/clone-exercism.sh +20 -0
  24. patch_chat-0.1.0/benchmark/cpp-test.sh +11 -0
  25. patch_chat-0.1.0/benchmark/docker.sh +19 -0
  26. patch_chat-0.1.0/benchmark/docker_build.sh +8 -0
  27. patch_chat-0.1.0/benchmark/install-docker-ubuntu.sh +63 -0
  28. patch_chat-0.1.0/benchmark/npm-test.sh +13 -0
  29. patch_chat-0.1.0/benchmark/plot.sh +29 -0
  30. patch_chat-0.1.0/benchmark/plots.py +417 -0
  31. patch_chat-0.1.0/benchmark/prompts.py +16 -0
  32. patch_chat-0.1.0/benchmark/refactor_tools.py +209 -0
  33. patch_chat-0.1.0/benchmark/rsync.sh +45 -0
  34. patch_chat-0.1.0/benchmark/rungrid.py +61 -0
  35. patch_chat-0.1.0/benchmark/swe-bench-lite.txt +7 -0
  36. patch_chat-0.1.0/benchmark/swe-bench.txt +7 -0
  37. patch_chat-0.1.0/benchmark/swe_bench.py +131 -0
  38. patch_chat-0.1.0/benchmark/test_benchmark.py +47 -0
  39. patch_chat-0.1.0/docker/Dockerfile +74 -0
  40. patch_chat-0.1.0/patch/__init__.py +20 -0
  41. patch_chat-0.1.0/patch/__main__.py +4 -0
  42. patch_chat-0.1.0/patch/_version.py +24 -0
  43. patch_chat-0.1.0/patch/analytics.py +260 -0
  44. patch_chat-0.1.0/patch/args.py +955 -0
  45. patch_chat-0.1.0/patch/args_formatter.py +228 -0
  46. patch_chat-0.1.0/patch/coders/__init__.py +32 -0
  47. patch_chat-0.1.0/patch/coders/architect_coder.py +47 -0
  48. patch_chat-0.1.0/patch/coders/architect_prompts.py +40 -0
  49. patch_chat-0.1.0/patch/coders/ask_coder.py +9 -0
  50. patch_chat-0.1.0/patch/coders/ask_prompts.py +41 -0
  51. patch_chat-0.1.0/patch/coders/base_coder.py +2548 -0
  52. patch_chat-0.1.0/patch/coders/base_prompts.py +60 -0
  53. patch_chat-0.1.0/patch/coders/chat_chunks.py +64 -0
  54. patch_chat-0.1.0/patch/coders/context_coder.py +53 -0
  55. patch_chat-0.1.0/patch/coders/context_prompts.py +75 -0
  56. patch_chat-0.1.0/patch/coders/edit_apply.py +6 -0
  57. patch_chat-0.1.0/patch/coders/editblock_coder.py +620 -0
  58. patch_chat-0.1.0/patch/coders/editblock_fenced_coder.py +10 -0
  59. patch_chat-0.1.0/patch/coders/editblock_fenced_prompts.py +143 -0
  60. patch_chat-0.1.0/patch/coders/editblock_func_coder.py +141 -0
  61. patch_chat-0.1.0/patch/coders/editblock_func_prompts.py +27 -0
  62. patch_chat-0.1.0/patch/coders/editblock_prompts.py +172 -0
  63. patch_chat-0.1.0/patch/coders/editor_diff_fenced_coder.py +9 -0
  64. patch_chat-0.1.0/patch/coders/editor_diff_fenced_prompts.py +11 -0
  65. patch_chat-0.1.0/patch/coders/editor_editblock_coder.py +8 -0
  66. patch_chat-0.1.0/patch/coders/editor_editblock_prompts.py +18 -0
  67. patch_chat-0.1.0/patch/coders/editor_whole_coder.py +8 -0
  68. patch_chat-0.1.0/patch/coders/editor_whole_prompts.py +10 -0
  69. patch_chat-0.1.0/patch/coders/patch_coder.py +731 -0
  70. patch_chat-0.1.0/patch/coders/patch_prompts.py +159 -0
  71. patch_chat-0.1.0/patch/coders/search_replace.py +757 -0
  72. patch_chat-0.1.0/patch/coders/shell.py +37 -0
  73. patch_chat-0.1.0/patch/coders/single_wholefile_func_coder.py +102 -0
  74. patch_chat-0.1.0/patch/coders/single_wholefile_func_prompts.py +27 -0
  75. patch_chat-0.1.0/patch/coders/udiff_coder.py +419 -0
  76. patch_chat-0.1.0/patch/coders/udiff_prompts.py +113 -0
  77. patch_chat-0.1.0/patch/coders/udiff_simple.py +14 -0
  78. patch_chat-0.1.0/patch/coders/udiff_simple_prompts.py +25 -0
  79. patch_chat-0.1.0/patch/coders/wholefile_coder.py +144 -0
  80. patch_chat-0.1.0/patch/coders/wholefile_func_coder.py +134 -0
  81. patch_chat-0.1.0/patch/coders/wholefile_func_prompts.py +27 -0
  82. patch_chat-0.1.0/patch/coders/wholefile_prompts.py +64 -0
  83. patch_chat-0.1.0/patch/commands.py +1668 -0
  84. patch_chat-0.1.0/patch/copypaste.py +70 -0
  85. patch_chat-0.1.0/patch/deprecated.py +126 -0
  86. patch_chat-0.1.0/patch/diffs.py +128 -0
  87. patch_chat-0.1.0/patch/dump.py +29 -0
  88. patch_chat-0.1.0/patch/editor.py +147 -0
  89. patch_chat-0.1.0/patch/exceptions.py +113 -0
  90. patch_chat-0.1.0/patch/format_settings.py +47 -0
  91. patch_chat-0.1.0/patch/gui.py +545 -0
  92. patch_chat-0.1.0/patch/history.py +143 -0
  93. patch_chat-0.1.0/patch/io.py +1209 -0
  94. patch_chat-0.1.0/patch/linter.py +304 -0
  95. patch_chat-0.1.0/patch/llm.py +47 -0
  96. patch_chat-0.1.0/patch/main.py +1466 -0
  97. patch_chat-0.1.0/patch/mdstream.py +243 -0
  98. patch_chat-0.1.0/patch/models.py +1342 -0
  99. patch_chat-0.1.0/patch/onboarding.py +428 -0
  100. patch_chat-0.1.0/patch/openrouter.py +128 -0
  101. patch_chat-0.1.0/patch/prompts.py +61 -0
  102. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/README.md +7 -0
  103. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/arduino-tags.scm +5 -0
  104. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/bash-tags.scm +8 -0
  105. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/c-tags.scm +9 -0
  106. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/chatito-tags.scm +16 -0
  107. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/clojure-tags.scm +7 -0
  108. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/commonlisp-tags.scm +122 -0
  109. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/cpp-tags.scm +15 -0
  110. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/csharp-tags.scm +26 -0
  111. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/d-tags.scm +26 -0
  112. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/dart-tags.scm +92 -0
  113. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/elisp-tags.scm +5 -0
  114. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/elixir-tags.scm +54 -0
  115. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/elm-tags.scm +19 -0
  116. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/gleam-tags.scm +41 -0
  117. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/go-tags.scm +42 -0
  118. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/java-tags.scm +20 -0
  119. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/javascript-tags.scm +88 -0
  120. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/lua-tags.scm +34 -0
  121. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/matlab-tags.scm +10 -0
  122. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/ocaml-tags.scm +115 -0
  123. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/ocaml_interface-tags.scm +98 -0
  124. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/pony-tags.scm +39 -0
  125. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/properties-tags.scm +5 -0
  126. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/python-tags.scm +14 -0
  127. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/r-tags.scm +21 -0
  128. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/racket-tags.scm +12 -0
  129. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/ruby-tags.scm +64 -0
  130. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/rust-tags.scm +60 -0
  131. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/solidity-tags.scm +43 -0
  132. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/swift-tags.scm +51 -0
  133. patch_chat-0.1.0/patch/queries/tree-sitter-language-pack/udev-tags.scm +20 -0
  134. patch_chat-0.1.0/patch/queries/tree-sitter-languages/README.md +24 -0
  135. patch_chat-0.1.0/patch/queries/tree-sitter-languages/bash-tags.scm +8 -0
  136. patch_chat-0.1.0/patch/queries/tree-sitter-languages/c-tags.scm +9 -0
  137. patch_chat-0.1.0/patch/queries/tree-sitter-languages/c_sharp-tags.scm +46 -0
  138. patch_chat-0.1.0/patch/queries/tree-sitter-languages/cpp-tags.scm +15 -0
  139. patch_chat-0.1.0/patch/queries/tree-sitter-languages/dart-tags.scm +91 -0
  140. patch_chat-0.1.0/patch/queries/tree-sitter-languages/elisp-tags.scm +8 -0
  141. patch_chat-0.1.0/patch/queries/tree-sitter-languages/elixir-tags.scm +54 -0
  142. patch_chat-0.1.0/patch/queries/tree-sitter-languages/elm-tags.scm +19 -0
  143. patch_chat-0.1.0/patch/queries/tree-sitter-languages/fortran-tags.scm +15 -0
  144. patch_chat-0.1.0/patch/queries/tree-sitter-languages/go-tags.scm +30 -0
  145. patch_chat-0.1.0/patch/queries/tree-sitter-languages/haskell-tags.scm +3 -0
  146. patch_chat-0.1.0/patch/queries/tree-sitter-languages/hcl-tags.scm +77 -0
  147. patch_chat-0.1.0/patch/queries/tree-sitter-languages/java-tags.scm +20 -0
  148. patch_chat-0.1.0/patch/queries/tree-sitter-languages/javascript-tags.scm +88 -0
  149. patch_chat-0.1.0/patch/queries/tree-sitter-languages/julia-tags.scm +60 -0
  150. patch_chat-0.1.0/patch/queries/tree-sitter-languages/kotlin-tags.scm +27 -0
  151. patch_chat-0.1.0/patch/queries/tree-sitter-languages/matlab-tags.scm +10 -0
  152. patch_chat-0.1.0/patch/queries/tree-sitter-languages/ocaml-tags.scm +115 -0
  153. patch_chat-0.1.0/patch/queries/tree-sitter-languages/ocaml_interface-tags.scm +98 -0
  154. patch_chat-0.1.0/patch/queries/tree-sitter-languages/php-tags.scm +26 -0
  155. patch_chat-0.1.0/patch/queries/tree-sitter-languages/python-tags.scm +12 -0
  156. patch_chat-0.1.0/patch/queries/tree-sitter-languages/ql-tags.scm +26 -0
  157. patch_chat-0.1.0/patch/queries/tree-sitter-languages/ruby-tags.scm +64 -0
  158. patch_chat-0.1.0/patch/queries/tree-sitter-languages/rust-tags.scm +60 -0
  159. patch_chat-0.1.0/patch/queries/tree-sitter-languages/scala-tags.scm +65 -0
  160. patch_chat-0.1.0/patch/queries/tree-sitter-languages/typescript-tags.scm +41 -0
  161. patch_chat-0.1.0/patch/queries/tree-sitter-languages/zig-tags.scm +3 -0
  162. patch_chat-0.1.0/patch/reasoning_tags.py +82 -0
  163. patch_chat-0.1.0/patch/repo.py +612 -0
  164. patch_chat-0.1.0/patch/repomap.py +859 -0
  165. patch_chat-0.1.0/patch/report.py +200 -0
  166. patch_chat-0.1.0/patch/resources/__init__.py +3 -0
  167. patch_chat-0.1.0/patch/resources/model-metadata.json +715 -0
  168. patch_chat-0.1.0/patch/resources/model-settings.yml +3128 -0
  169. patch_chat-0.1.0/patch/run_cmd.py +146 -0
  170. patch_chat-0.1.0/patch/scrape.py +316 -0
  171. patch_chat-0.1.0/patch/sendchat.py +61 -0
  172. patch_chat-0.1.0/patch/special.py +203 -0
  173. patch_chat-0.1.0/patch/urls.py +17 -0
  174. patch_chat-0.1.0/patch/utils.py +365 -0
  175. patch_chat-0.1.0/patch/versioncheck.py +113 -0
  176. patch_chat-0.1.0/patch/voice.py +200 -0
  177. patch_chat-0.1.0/patch/waiting.py +222 -0
  178. patch_chat-0.1.0/patch/watch.py +318 -0
  179. patch_chat-0.1.0/patch/watch_prompts.py +12 -0
  180. patch_chat-0.1.0/patch_chat.egg-info/PKG-INFO +375 -0
  181. patch_chat-0.1.0/patch_chat.egg-info/SOURCES.txt +307 -0
  182. patch_chat-0.1.0/patch_chat.egg-info/dependency_links.txt +1 -0
  183. patch_chat-0.1.0/patch_chat.egg-info/entry_points.txt +2 -0
  184. patch_chat-0.1.0/patch_chat.egg-info/requires.txt +277 -0
  185. patch_chat-0.1.0/patch_chat.egg-info/scm_file_list.json +302 -0
  186. patch_chat-0.1.0/patch_chat.egg-info/scm_version.json +8 -0
  187. patch_chat-0.1.0/patch_chat.egg-info/top_level.txt +1 -0
  188. patch_chat-0.1.0/pyproject.toml +74 -0
  189. patch_chat-0.1.0/pytest.ini +10 -0
  190. patch_chat-0.1.0/requirements/common-constraints.txt +535 -0
  191. patch_chat-0.1.0/requirements/pydub.in +2 -0
  192. patch_chat-0.1.0/requirements/python-compat.in +11 -0
  193. patch_chat-0.1.0/requirements/requirements-browser.in +1 -0
  194. patch_chat-0.1.0/requirements/requirements-browser.txt +169 -0
  195. patch_chat-0.1.0/requirements/requirements-dev.in +21 -0
  196. patch_chat-0.1.0/requirements/requirements-dev.txt +398 -0
  197. patch_chat-0.1.0/requirements/requirements-playwright.in +1 -0
  198. patch_chat-0.1.0/requirements/requirements-playwright.txt +18 -0
  199. patch_chat-0.1.0/requirements/requirements.in +53 -0
  200. patch_chat-0.1.0/requirements/tree-sitter.in +3 -0
  201. patch_chat-0.1.0/requirements.txt +477 -0
  202. patch_chat-0.1.0/scripts/__init__.py +0 -0
  203. patch_chat-0.1.0/scripts/blame.py +281 -0
  204. patch_chat-0.1.0/scripts/clean_metadata.py +258 -0
  205. patch_chat-0.1.0/scripts/issues.py +458 -0
  206. patch_chat-0.1.0/scripts/my_models.py +98 -0
  207. patch_chat-0.1.0/scripts/pip-compile.sh +46 -0
  208. patch_chat-0.1.0/scripts/redact-cast.py +62 -0
  209. patch_chat-0.1.0/scripts/tmux_record.sh +18 -0
  210. patch_chat-0.1.0/scripts/tsl_pack_langs.py +145 -0
  211. patch_chat-0.1.0/scripts/versionbump.py +175 -0
  212. patch_chat-0.1.0/scripts/yank-old-versions.py +51 -0
  213. patch_chat-0.1.0/setup.cfg +4 -0
  214. patch_chat-0.1.0/tests/__init__.py +0 -0
  215. patch_chat-0.1.0/tests/basic/__init__.py +0 -0
  216. patch_chat-0.1.0/tests/basic/test_analytics.py +152 -0
  217. patch_chat-0.1.0/tests/basic/test_aws_credentials.py +169 -0
  218. patch_chat-0.1.0/tests/basic/test_coder.py +1573 -0
  219. patch_chat-0.1.0/tests/basic/test_commands.py +2226 -0
  220. patch_chat-0.1.0/tests/basic/test_copypaste.py +33 -0
  221. patch_chat-0.1.0/tests/basic/test_deprecated.py +140 -0
  222. patch_chat-0.1.0/tests/basic/test_edit_apply.py +7 -0
  223. patch_chat-0.1.0/tests/basic/test_editblock.py +642 -0
  224. patch_chat-0.1.0/tests/basic/test_editor.py +174 -0
  225. patch_chat-0.1.0/tests/basic/test_exceptions.py +104 -0
  226. patch_chat-0.1.0/tests/basic/test_find_or_blocks.py +115 -0
  227. patch_chat-0.1.0/tests/basic/test_format_settings.py +48 -0
  228. patch_chat-0.1.0/tests/basic/test_history.py +120 -0
  229. patch_chat-0.1.0/tests/basic/test_io.py +635 -0
  230. patch_chat-0.1.0/tests/basic/test_linter.py +84 -0
  231. patch_chat-0.1.0/tests/basic/test_main.py +1510 -0
  232. patch_chat-0.1.0/tests/basic/test_model_info_manager.py +80 -0
  233. patch_chat-0.1.0/tests/basic/test_models.py +668 -0
  234. patch_chat-0.1.0/tests/basic/test_onboarding.py +437 -0
  235. patch_chat-0.1.0/tests/basic/test_openrouter.py +73 -0
  236. patch_chat-0.1.0/tests/basic/test_patch_coder.py +28 -0
  237. patch_chat-0.1.0/tests/basic/test_path_containment.py +286 -0
  238. patch_chat-0.1.0/tests/basic/test_reasoning.py +609 -0
  239. patch_chat-0.1.0/tests/basic/test_repo.py +716 -0
  240. patch_chat-0.1.0/tests/basic/test_repo_config_trust.py +216 -0
  241. patch_chat-0.1.0/tests/basic/test_repomap.py +559 -0
  242. patch_chat-0.1.0/tests/basic/test_report.py +20 -0
  243. patch_chat-0.1.0/tests/basic/test_run_cmd.py +45 -0
  244. patch_chat-0.1.0/tests/basic/test_sanity_check_repo.py +184 -0
  245. patch_chat-0.1.0/tests/basic/test_scripting.py +39 -0
  246. patch_chat-0.1.0/tests/basic/test_sendchat.py +172 -0
  247. patch_chat-0.1.0/tests/basic/test_special.py +76 -0
  248. patch_chat-0.1.0/tests/basic/test_ssl_verification.py +84 -0
  249. patch_chat-0.1.0/tests/basic/test_udiff.py +167 -0
  250. patch_chat-0.1.0/tests/basic/test_urls.py +18 -0
  251. patch_chat-0.1.0/tests/basic/test_utils.py +22 -0
  252. patch_chat-0.1.0/tests/basic/test_versioncheck.py +17 -0
  253. patch_chat-0.1.0/tests/basic/test_voice.py +166 -0
  254. patch_chat-0.1.0/tests/basic/test_waiting.py +43 -0
  255. patch_chat-0.1.0/tests/basic/test_watch.py +166 -0
  256. patch_chat-0.1.0/tests/basic/test_wholefile.py +359 -0
  257. patch_chat-0.1.0/tests/browser/test_browser.py +36 -0
  258. patch_chat-0.1.0/tests/conftest.py +59 -0
  259. patch_chat-0.1.0/tests/fixtures/chat-history-search-replace-gold.txt +27810 -0
  260. patch_chat-0.1.0/tests/fixtures/chat-history.md +99961 -0
  261. patch_chat-0.1.0/tests/fixtures/languages/arduino/test.ino +21 -0
  262. patch_chat-0.1.0/tests/fixtures/languages/bash/test.sh +19 -0
  263. patch_chat-0.1.0/tests/fixtures/languages/c/test.c +21 -0
  264. patch_chat-0.1.0/tests/fixtures/languages/chatito/test.chatito +20 -0
  265. patch_chat-0.1.0/tests/fixtures/languages/clojure/test.clj +6 -0
  266. patch_chat-0.1.0/tests/fixtures/languages/commonlisp/test.lisp +17 -0
  267. patch_chat-0.1.0/tests/fixtures/languages/cpp/test.cpp +6 -0
  268. patch_chat-0.1.0/tests/fixtures/languages/csharp/test.cs +39 -0
  269. patch_chat-0.1.0/tests/fixtures/languages/d/test.d +26 -0
  270. patch_chat-0.1.0/tests/fixtures/languages/dart/test.dart +21 -0
  271. patch_chat-0.1.0/tests/fixtures/languages/elisp/test.el +25 -0
  272. patch_chat-0.1.0/tests/fixtures/languages/elixir/test.ex +5 -0
  273. patch_chat-0.1.0/tests/fixtures/languages/elm/test.elm +59 -0
  274. patch_chat-0.1.0/tests/fixtures/languages/gleam/test.gleam +10 -0
  275. patch_chat-0.1.0/tests/fixtures/languages/go/test.go +42 -0
  276. patch_chat-0.1.0/tests/fixtures/languages/haskell/test.hs +7 -0
  277. patch_chat-0.1.0/tests/fixtures/languages/hcl/test.tf +52 -0
  278. patch_chat-0.1.0/tests/fixtures/languages/java/test.java +16 -0
  279. patch_chat-0.1.0/tests/fixtures/languages/javascript/test.js +26 -0
  280. patch_chat-0.1.0/tests/fixtures/languages/kotlin/test.kt +16 -0
  281. patch_chat-0.1.0/tests/fixtures/languages/lua/test.lua +25 -0
  282. patch_chat-0.1.0/tests/fixtures/languages/matlab/test.m +42 -0
  283. patch_chat-0.1.0/tests/fixtures/languages/ocaml/test.ml +19 -0
  284. patch_chat-0.1.0/tests/fixtures/languages/ocaml_interface/test.mli +14 -0
  285. patch_chat-0.1.0/tests/fixtures/languages/php/test.php +5 -0
  286. patch_chat-0.1.0/tests/fixtures/languages/pony/test.pony +8 -0
  287. patch_chat-0.1.0/tests/fixtures/languages/properties/test.properties +14 -0
  288. patch_chat-0.1.0/tests/fixtures/languages/python/test.py +28 -0
  289. patch_chat-0.1.0/tests/fixtures/languages/ql/test.ql +3 -0
  290. patch_chat-0.1.0/tests/fixtures/languages/r/test.r +17 -0
  291. patch_chat-0.1.0/tests/fixtures/languages/racket/test.rkt +8 -0
  292. patch_chat-0.1.0/tests/fixtures/languages/ruby/test.rb +3 -0
  293. patch_chat-0.1.0/tests/fixtures/languages/rust/test.rs +33 -0
  294. patch_chat-0.1.0/tests/fixtures/languages/scala/test.scala +61 -0
  295. patch_chat-0.1.0/tests/fixtures/languages/solidity/test.sol +21 -0
  296. patch_chat-0.1.0/tests/fixtures/languages/swift/test.swift +18 -0
  297. patch_chat-0.1.0/tests/fixtures/languages/tsx/test.tsx +30 -0
  298. patch_chat-0.1.0/tests/fixtures/languages/typescript/test.ts +3 -0
  299. patch_chat-0.1.0/tests/fixtures/languages/udev/test.rules +22 -0
  300. patch_chat-0.1.0/tests/fixtures/languages/zig/test.zig +10 -0
  301. patch_chat-0.1.0/tests/fixtures/sample-code-base/sample.js +50 -0
  302. patch_chat-0.1.0/tests/fixtures/sample-code-base/sample.py +68 -0
  303. patch_chat-0.1.0/tests/fixtures/sample-code-base-repo-map.txt +55 -0
  304. patch_chat-0.1.0/tests/fixtures/watch.js +38 -0
  305. patch_chat-0.1.0/tests/fixtures/watch.lisp +19 -0
  306. patch_chat-0.1.0/tests/fixtures/watch.py +21 -0
  307. patch_chat-0.1.0/tests/fixtures/watch_question.js +11 -0
  308. patch_chat-0.1.0/tests/scrape/test_playwright_disable.py +139 -0
  309. patch_chat-0.1.0/tests/scrape/test_scrape.py +187 -0
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # This repository has no services or authentication that need repair after an orb wakes.
5
+ echo "No orb resume steps required."
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ step() {
5
+ printf '\n[%(%H:%M:%S)T] %s\n' -1 "$1"
6
+ }
7
+
8
+ step "Installing system dependencies"
9
+ packages=(libportaudio2 pandoc)
10
+ missing_packages=()
11
+ for package in "${packages[@]}"; do
12
+ if ! dpkg-query -W -f='${Status}' "$package" 2>/dev/null | grep -q "install ok installed"; then
13
+ missing_packages+=("$package")
14
+ fi
15
+ done
16
+
17
+ if ((${#missing_packages[@]})); then
18
+ sudo apt-get update
19
+ sudo apt-get install -y --no-install-recommends "${missing_packages[@]}"
20
+ fi
21
+
22
+ step "Installing Python project and development dependencies"
23
+ python3 -m pip install --editable . \
24
+ --extra-index-url https://download.pytorch.org/whl/cpu \
25
+ --requirement requirements/requirements-dev.txt \
26
+ --requirement requirements/requirements-browser.txt \
27
+ --requirement requirements/requirements-playwright.txt
28
+
29
+ step "Installing the Playwright Chromium browser"
30
+ python3 -m playwright install chromium
31
+
32
+ step "Preparing pre-commit environments"
33
+ pre-commit install-hooks
34
+
35
+ step "Orb setup complete"
@@ -0,0 +1,11 @@
1
+ .BC.*
2
+ tmp*
3
+ *~
4
+ OLD*
5
+ *.pyc
6
+ .DS_Store
7
+ .env
8
+ .venv
9
+ .git
10
+ .patch.*
11
+ build
@@ -0,0 +1,3 @@
1
+ [flake8]
2
+ ignore = E203,W503
3
+ max-line-length = 100
@@ -0,0 +1,21 @@
1
+ name: Question or bug report
2
+ description: Submit a question or bug report to help us improve Patch
3
+ labels: []
4
+ body:
5
+ - type: textarea
6
+ attributes:
7
+ label: Issue
8
+ description: Please describe your problem or question.
9
+ validations:
10
+ required: true
11
+ - type: textarea
12
+ attributes:
13
+ label: Version and model info
14
+ description: Please include Patch version, model being used (`gpt-4-xxx`, etc) and any other switches or config settings that are active.
15
+ placeholder: |
16
+ Patch v0.XX.Y
17
+ Model: gpt-N-... using ???? edit format
18
+ Git repo: .git with ### files
19
+ Repo-map: using #### tokens
20
+ validations:
21
+ required: false
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: pre-commit
3
+ on:
4
+ pull_request:
5
+ push:
6
+ workflow_dispatch:
7
+ jobs:
8
+ pre-commit:
9
+ runs-on: ubuntu-latest
10
+ env:
11
+ RAW_LOG: pre-commit.log
12
+ CS_XML: pre-commit.xml
13
+ steps:
14
+ - run: sudo apt-get update && sudo apt-get install cppcheck uncrustify
15
+ if: false
16
+ - uses: actions/checkout@v4
17
+ - run: python -m pip install pre-commit
18
+ - uses: actions/cache/restore@v4
19
+ with:
20
+ path: ~/.cache/pre-commit/
21
+ key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
22
+ - name: Run pre-commit hooks
23
+ env:
24
+ SKIP: no-commit-to-branch
25
+ run: |
26
+ set -o pipefail
27
+ pre-commit gc
28
+ pre-commit run --show-diff-on-failure --color=always --all-files | tee ${RAW_LOG}
29
+ - name: Convert Raw Log to Checkstyle format (launch action)
30
+ uses: mdeweerd/logToCheckStyle@v2025.1.1
31
+ if: ${{ failure() }}
32
+ with:
33
+ in: ${{ env.RAW_LOG }}
34
+ # out: ${{ env.CS_XML }}
35
+ - uses: actions/cache/save@v4
36
+ if: ${{ ! cancelled() }}
37
+ with:
38
+ path: ~/.cache/pre-commit/
39
+ key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
40
+ - name: Provide log as artifact
41
+ uses: actions/upload-artifact@v4
42
+ if: ${{ ! cancelled() }}
43
+ with:
44
+ name: precommit-logs
45
+ path: |
46
+ ${{ env.RAW_LOG }}
47
+ ${{ env.CS_XML }}
48
+ retention-days: 2
@@ -0,0 +1,52 @@
1
+ name: Ubuntu Python Tests
2
+
3
+ on:
4
+ push:
5
+ paths-ignore:
6
+ - 'README.md'
7
+ branches:
8
+ - main
9
+ pull_request:
10
+ paths-ignore:
11
+ - 'README.md'
12
+ branches:
13
+ - main
14
+
15
+ jobs:
16
+ build:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
21
+
22
+ steps:
23
+ - name: Check out repository
24
+ uses: actions/checkout@v4
25
+ with:
26
+ fetch-depth: 0
27
+
28
+ - name: Set up Python ${{ matrix.python-version }}
29
+ uses: actions/setup-python@v5
30
+ with:
31
+ python-version: ${{ matrix.python-version }}
32
+ cache: pip
33
+ cache-dependency-path: |
34
+ requirements.txt
35
+ requirements/requirements-dev.txt
36
+
37
+ - name: Install system dependencies
38
+ run: |
39
+ sudo apt-get update
40
+ sudo apt-get install -y libportaudio2
41
+
42
+ - name: Install dependencies
43
+ run: |
44
+ python -m pip install --upgrade pip
45
+ pip install pytest pytest-env
46
+ pip install .
47
+
48
+ - name: Run tests
49
+ env:
50
+ PATCH_ANALYTICS: false
51
+ run: |
52
+ pytest
@@ -0,0 +1,48 @@
1
+ name: Windows Python Tests
2
+
3
+ on:
4
+ push:
5
+ paths-ignore:
6
+ - 'README.md'
7
+ branches:
8
+ - main
9
+ pull_request:
10
+ paths-ignore:
11
+ - 'README.md'
12
+ branches:
13
+ - main
14
+
15
+ jobs:
16
+ build:
17
+ runs-on: windows-latest
18
+ strategy:
19
+ matrix:
20
+ python-version: ["3.10", "3.13"]
21
+
22
+ steps:
23
+ - name: Check out repository
24
+ uses: actions/checkout@v4
25
+ with:
26
+ fetch-depth: 0
27
+
28
+ - name: Set up Python ${{ matrix.python-version }}
29
+ uses: actions/setup-python@v5
30
+ with:
31
+ python-version: ${{ matrix.python-version }}
32
+ cache: pip
33
+ cache-dependency-path: |
34
+ requirements.txt
35
+ requirements/requirements-dev.txt
36
+
37
+ - name: Install dependencies
38
+ run: |
39
+ python -m pip install --upgrade pip
40
+ pip install pytest pytest-env
41
+ pip install .
42
+
43
+ - name: Run tests
44
+ env:
45
+ PATCH_ANALYTICS: false
46
+ run: |
47
+ pytest
48
+
@@ -0,0 +1,22 @@
1
+ .DS_Store
2
+ .vscode/
3
+ patch.code-workspace
4
+ *.pyc
5
+ .patch*
6
+ .aider*
7
+ patch_chat.egg-info/
8
+ aider_chat.egg-info/
9
+ build
10
+ dist/
11
+ Gemfile.lock
12
+ _site
13
+ .jekyll-cache/
14
+ .jekyll-metadata
15
+ patch/__version__.py
16
+ patch/_version.py
17
+ .venv/
18
+ .#*
19
+ .gitattributes
20
+ tmp.benchmarks/
21
+ .docker_bash_history
22
+ .amp/portals/*
@@ -0,0 +1,27 @@
1
+ repos:
2
+ - repo: https://github.com/PyCQA/isort
3
+ rev: 5.12.0
4
+ hooks:
5
+ - id: isort
6
+ args: ["--profile", "black"]
7
+ - repo: https://github.com/psf/black
8
+ rev: 23.3.0
9
+ hooks:
10
+ - id: black
11
+ args: ["--line-length", "100", "--preview"]
12
+ - repo: https://github.com/pycqa/flake8
13
+ rev: 7.1.0
14
+ hooks:
15
+ - id: flake8
16
+ args: ["--show-source"]
17
+ - repo: https://github.com/pre-commit/mirrors-mypy
18
+ rev: v2.3.1
19
+ hooks:
20
+ - id: mypy
21
+ pass_filenames: false
22
+ - repo: https://github.com/codespell-project/codespell
23
+ rev: v2.2.6
24
+ hooks:
25
+ - id: codespell
26
+ additional_dependencies:
27
+ - tomli
@@ -0,0 +1,92 @@
1
+ # AGENTS.md
2
+
3
+ Guidance for AI coding agents working in this repository.
4
+
5
+ ## What this project is
6
+
7
+ Patch is an AI pair-programming tool that runs in the terminal. The Python distribution is
8
+ `patch-chat`, the module is `patch/`, and the CLI entry point is `patch` (`patch.main:main`).
9
+ Release history lives in [CHANGELOG.md](CHANGELOG.md).
10
+
11
+ ## Setup
12
+
13
+ Python 3.10 through 3.14 (`requires-python = ">=3.10,<3.15"`).
14
+
15
+ ```
16
+ pip install -e .
17
+ pip install -r requirements.txt
18
+ pip install -r requirements/requirements-dev.txt
19
+ ```
20
+
21
+ ## Testing
22
+
23
+ ```
24
+ pytest # full suite
25
+ pytest tests/basic/test_coder.py # one file
26
+ pytest -k test_repomap # one pattern
27
+ ```
28
+
29
+ `pytest.ini` sets `testpaths` to `tests/basic`, `tests/browser` and `tests/scrape`, and forces
30
+ `PATCH_ANALYTICS=false`. The bulk of the suite is
31
+ the 30+ files in `tests/basic/`. `benchmark/` is excluded from collection and is
32
+ not part of normal development.
33
+
34
+ ## Linting and formatting
35
+
36
+ The project uses pre-commit. Run it before finishing any code change:
37
+
38
+ ```
39
+ pre-commit run --all-files
40
+ ```
41
+
42
+ Five hooks, all of which CI enforces:
43
+
44
+ - **black**, line length 100, with `--preview`
45
+ - **isort**, black profile
46
+ - **flake8**, max line length 100, ignoring `E203` and `W503`
47
+ - **mypy**, over the configured high-value module boundaries
48
+ - **codespell**
49
+
50
+ The line length is 100, not black's default 88. Match it.
51
+
52
+ ## Repository layout
53
+
54
+ - `patch/coders/` — the heart of the project. Each edit format is a
55
+ `*_coder.py` paired with a `*_prompts.py` holding its system prompts.
56
+ `base_coder.py` (~2.5k lines) is the shared chat loop that all of them
57
+ subclass. New edit formats are registered in `patch/coders/__init__.py`.
58
+ - `patch/main.py` — CLI entry, argument wiring, startup.
59
+ - `patch/models.py` — model definitions, aliases, and metadata. Adding support
60
+ for a new LLM usually means editing this file and nothing else.
61
+ - `patch/commands.py` — the in-chat `/slash` commands.
62
+ - `patch/repo.py`, `patch/repomap.py` — git integration and the tree-sitter
63
+ repository map.
64
+ - `tests/` — mirrors the module layout under `tests/basic/`.
65
+
66
+ ## Things not to edit
67
+
68
+ - `patch/_version.py` — generated by setuptools_scm, gitignored.
69
+ - `requirements/*.txt` — compiled from the matching `.in` files by
70
+ `./scripts/pip-compile.sh`. Edit the `.in` file and re-run the script; never
71
+ hand-edit the `.txt`.
72
+
73
+ ## CI
74
+
75
+ Three workflows, all in `.github/workflows/`:
76
+
77
+ - `ubuntu-tests.yml` — pytest on Python 3.10 through 3.14
78
+ - `windows-tests.yml` — pytest on Python 3.10, 3.13
79
+ - `pre-commit.yml` — the hooks above
80
+
81
+ Publishing and deployment workflows are intentionally absent. Do not add them without the
82
+ required Patch-owned registries, infrastructure and secrets.
83
+
84
+ ## Conventions
85
+
86
+ - Match the surrounding style rather than importing a new one. The codebase is
87
+ plain Python with light comments and no type annotations in most modules.
88
+ - Tests are a mix of `unittest.TestCase` classes (about half the files in
89
+ `tests/basic/`) and plain pytest functions. Follow whichever style the file
90
+ you are editing already uses.
91
+ - Commits follow Conventional Commits (`feat:`, `fix:`, `docs:`, `chore:`), as
92
+ seen in recent history.