@elizaos/sweagent-root 2.0.0-alpha

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 (323) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +270 -0
  3. package/package.json +71 -0
  4. package/python/LICENSE +21 -0
  5. package/python/config/README.md +15 -0
  6. package/python/config/bash_only.yaml +222 -0
  7. package/python/config/benchmarks/250212_sweagent_heavy_sbl.yaml +188 -0
  8. package/python/config/benchmarks/250225_anthropic_filemap_simple_review.yaml +75 -0
  9. package/python/config/benchmarks/250522_anthropic_filemap_simple_review.yaml +92 -0
  10. package/python/config/benchmarks/250526_anthropic_filemap_simple_review_sbl.yaml +93 -0
  11. package/python/config/benchmarks/anthropic_filemap_multilingual.yaml +66 -0
  12. package/python/config/coding_challenge.yaml +104 -0
  13. package/python/config/default.yaml +69 -0
  14. package/python/config/default_backticks.yaml +69 -0
  15. package/python/config/default_mm_no_images.yaml +82 -0
  16. package/python/config/default_mm_with_images.yaml +83 -0
  17. package/python/config/demo/default.yaml +80 -0
  18. package/python/config/demo/no_instructions.yaml +69 -0
  19. package/python/config/demo/only_bash.yaml +60 -0
  20. package/python/config/exotic/default_shell.yaml +52 -0
  21. package/python/config/exotic/windowed_replace.yaml +125 -0
  22. package/python/config/exotic/windowed_replace_late_repro.yaml +127 -0
  23. package/python/config/human/human.yaml +24 -0
  24. package/python/config/human/human_demo.yaml +52 -0
  25. package/python/config/sweagent_0_7/07.yaml +101 -0
  26. package/python/config/sweagent_0_7/07_fcalling.yaml +100 -0
  27. package/python/config/sweagent_0_7/07_from_url.yaml +114 -0
  28. package/python/config/sweagent_0_7/07_thought_action.yaml +102 -0
  29. package/python/config/sweagent_0_7/07_thought_action_xml.yaml +96 -0
  30. package/python/mlc_config.json +44 -0
  31. package/python/pyproject.toml +262 -0
  32. package/python/sweagent/__init__.py +114 -0
  33. package/python/sweagent/__main__.py +4 -0
  34. package/python/sweagent/agent/__init__.py +0 -0
  35. package/python/sweagent/agent/action_sampler.py +317 -0
  36. package/python/sweagent/agent/agents.py +1294 -0
  37. package/python/sweagent/agent/extra/shell_agent.py +106 -0
  38. package/python/sweagent/agent/history_processors.py +399 -0
  39. package/python/sweagent/agent/hooks/__init__.py +0 -0
  40. package/python/sweagent/agent/hooks/abstract.py +139 -0
  41. package/python/sweagent/agent/hooks/status.py +34 -0
  42. package/python/sweagent/agent/models.py +896 -0
  43. package/python/sweagent/agent/problem_statement.py +312 -0
  44. package/python/sweagent/agent/reviewer.py +664 -0
  45. package/python/sweagent/environment/__init__.py +0 -0
  46. package/python/sweagent/environment/hooks/__init__.py +0 -0
  47. package/python/sweagent/environment/hooks/abstract.py +60 -0
  48. package/python/sweagent/environment/hooks/status.py +28 -0
  49. package/python/sweagent/environment/repo.py +219 -0
  50. package/python/sweagent/environment/swe_env.py +276 -0
  51. package/python/sweagent/exceptions.py +54 -0
  52. package/python/sweagent/inspector/README.md +6 -0
  53. package/python/sweagent/inspector/__init__.py +0 -0
  54. package/python/sweagent/inspector/favicon.ico +0 -0
  55. package/python/sweagent/inspector/fileViewer.js +354 -0
  56. package/python/sweagent/inspector/icons/computer.png +0 -0
  57. package/python/sweagent/inspector/icons/edit_icon.svg +11 -0
  58. package/python/sweagent/inspector/icons/swe-agent-logo-50.png +0 -0
  59. package/python/sweagent/inspector/icons/swellama_blue.png +0 -0
  60. package/python/sweagent/inspector/icons/swellama_brown.png +0 -0
  61. package/python/sweagent/inspector/icons/swellama_grey.png +0 -0
  62. package/python/sweagent/inspector/icons/swellama_tan.png +0 -0
  63. package/python/sweagent/inspector/index.html +25 -0
  64. package/python/sweagent/inspector/server.py +354 -0
  65. package/python/sweagent/inspector/static.py +169 -0
  66. package/python/sweagent/inspector/style.css +454 -0
  67. package/python/sweagent/run/__init__.py +0 -0
  68. package/python/sweagent/run/_progress.py +158 -0
  69. package/python/sweagent/run/batch_instances.py +419 -0
  70. package/python/sweagent/run/common.py +387 -0
  71. package/python/sweagent/run/compare_runs.py +123 -0
  72. package/python/sweagent/run/extract_pred.py +19 -0
  73. package/python/sweagent/run/hooks/__init__.py +0 -0
  74. package/python/sweagent/run/hooks/abstract.py +67 -0
  75. package/python/sweagent/run/hooks/apply_patch.py +106 -0
  76. package/python/sweagent/run/hooks/open_pr.py +244 -0
  77. package/python/sweagent/run/hooks/swe_bench_evaluate.py +113 -0
  78. package/python/sweagent/run/inspector_cli.py +493 -0
  79. package/python/sweagent/run/merge_predictions.py +64 -0
  80. package/python/sweagent/run/quick_stats.py +96 -0
  81. package/python/sweagent/run/remove_unfinished.py +63 -0
  82. package/python/sweagent/run/rich_test.py +91 -0
  83. package/python/sweagent/run/run.py +147 -0
  84. package/python/sweagent/run/run_batch.py +442 -0
  85. package/python/sweagent/run/run_replay.py +219 -0
  86. package/python/sweagent/run/run_shell.py +155 -0
  87. package/python/sweagent/run/run_single.py +225 -0
  88. package/python/sweagent/run/run_traj_to_demo.py +85 -0
  89. package/python/sweagent/tools/__init__.py +0 -0
  90. package/python/sweagent/tools/bundle.py +57 -0
  91. package/python/sweagent/tools/commands.py +220 -0
  92. package/python/sweagent/tools/parsing.py +619 -0
  93. package/python/sweagent/tools/tools.py +430 -0
  94. package/python/sweagent/tools/utils.py +108 -0
  95. package/python/sweagent/types.py +102 -0
  96. package/python/sweagent/utils/__init__.py +0 -0
  97. package/python/sweagent/utils/config.py +80 -0
  98. package/python/sweagent/utils/files.py +27 -0
  99. package/python/sweagent/utils/github.py +118 -0
  100. package/python/sweagent/utils/jinja_warnings.py +14 -0
  101. package/python/sweagent/utils/log.py +175 -0
  102. package/python/sweagent/utils/patch_formatter.py +152 -0
  103. package/python/sweagent/utils/serialization.py +45 -0
  104. package/python/tests/__init__.py +0 -0
  105. package/python/tests/conftest.py +191 -0
  106. package/python/tests/test_agent.py +258 -0
  107. package/python/tests/test_batch_instance.py +43 -0
  108. package/python/tests/test_commands/_interactive_dummy.py +35 -0
  109. package/python/tests/test_commands/interactive_dummy_wrapper.sh +29 -0
  110. package/python/tests/test_data/config_files/dummy_interactive.yaml +62 -0
  111. package/python/tests/test_data/data_sources/ctf/crypto/Katy/Dockerfile +20 -0
  112. package/python/tests/test_data/data_sources/ctf/crypto/Katy/README.md +13 -0
  113. package/python/tests/test_data/data_sources/ctf/crypto/Katy/challenge.json +12 -0
  114. package/python/tests/test_data/data_sources/ctf/crypto/Katy/customrandom.c +50 -0
  115. package/python/tests/test_data/data_sources/ctf/crypto/Katy/docker-compose.yml +14 -0
  116. package/python/tests/test_data/data_sources/ctf/crypto/Katy/release +0 -0
  117. package/python/tests/test_data/data_sources/ctf/crypto/Katy/server +0 -0
  118. package/python/tests/test_data/data_sources/ctf/crypto/Katy/solver.py +12 -0
  119. package/python/tests/test_data/data_sources/ctf/forensics/flash/README.md +16 -0
  120. package/python/tests/test_data/data_sources/ctf/forensics/flash/challenge.json +9 -0
  121. package/python/tests/test_data/data_sources/ctf/forensics/flash/flash_c8429a430278283c0e571baebca3d139.zip +0 -0
  122. package/python/tests/test_data/data_sources/ctf/misc/networking_1/README.md +15 -0
  123. package/python/tests/test_data/data_sources/ctf/misc/networking_1/challenge.json +10 -0
  124. package/python/tests/test_data/data_sources/ctf/misc/networking_1/networking.pcap +0 -0
  125. package/python/tests/test_data/data_sources/ctf/pwn/warmup/Dockerfile +28 -0
  126. package/python/tests/test_data/data_sources/ctf/pwn/warmup/README.md +14 -0
  127. package/python/tests/test_data/data_sources/ctf/pwn/warmup/challenge.json +14 -0
  128. package/python/tests/test_data/data_sources/ctf/pwn/warmup/docker-compose.yml +14 -0
  129. package/python/tests/test_data/data_sources/ctf/pwn/warmup/flag.txt +1 -0
  130. package/python/tests/test_data/data_sources/ctf/pwn/warmup/warmup +0 -0
  131. package/python/tests/test_data/data_sources/ctf/pwn/warmup/warmup.c +26 -0
  132. package/python/tests/test_data/data_sources/ctf/pwn/warmup/warmup.py +9 -0
  133. package/python/tests/test_data/data_sources/ctf/rev/rock/README.md +14 -0
  134. package/python/tests/test_data/data_sources/ctf/rev/rock/challenge.json +8 -0
  135. package/python/tests/test_data/data_sources/ctf/rev/rock/rock +0 -0
  136. package/python/tests/test_data/data_sources/ctf/rev/rock/rock.cpp +167 -0
  137. package/python/tests/test_data/data_sources/ctf/rev/rock/solution.cpp +24 -0
  138. package/python/tests/test_data/data_sources/ctf/rev/rock/test_solver/solution.py +6 -0
  139. package/python/tests/test_data/data_sources/ctf/rev/rock/test_solver/test.sh +10 -0
  140. package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/000-default.conf +18 -0
  141. package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/Dockerfile +20 -0
  142. package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/cgi/file.pl +38 -0
  143. package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/cgi/forms.pl +40 -0
  144. package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/cgi/hello.pl +11 -0
  145. package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/challenge.json +12 -0
  146. package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/docker-compose.yml +14 -0
  147. package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/flag +1 -0
  148. package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/index.html +11 -0
  149. package/python/tests/test_data/data_sources/ctf/web/i_got_id_demo/solution.txt +1 -0
  150. package/python/tests/test_data/data_sources/debug_20240322.json +1 -0
  151. package/python/tests/test_data/data_sources/expert_instances.yaml +16 -0
  152. package/python/tests/test_data/data_sources/human_eval.json +1 -0
  153. package/python/tests/test_data/data_sources/simple_instances.yaml +3 -0
  154. package/python/tests/test_data/data_sources/simple_instances_long.yaml +30 -0
  155. package/python/tests/test_data/data_sources/swe-bench-dev-easy.json +1 -0
  156. package/python/tests/test_data/data_sources/swe-bench-dev-easy_first_only.json +1 -0
  157. package/python/tests/test_data/data_sources/swe-bench-lite-test.json +1 -0
  158. package/python/tests/test_data/trajectories/gpt4__swe-agent-test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/6e44b9__sweagenttestrepo-1c2844.traj +342 -0
  159. package/python/tests/test_data/trajectories/gpt4__swe-agent-test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/solution_missing_colon.py +15 -0
  160. package/python/tests/test_data/trajectories/gpt4__swe-agent__test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/args.yaml +518 -0
  161. package/python/tests/test_data/trajectories/gpt4__swe-agent__test-repo__default_from_url__t-0.00__p-0.95__c-3.00__install-1/swe-agent__test-repo-i1.traj +124 -0
  162. package/python/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/all_preds.jsonl +1 -0
  163. package/python/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/args.yaml +520 -0
  164. package/python/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/patches/pydicom__pydicom-1458.patch +18 -0
  165. package/python/tests/test_data/trajectories/gpt4__swe-bench-dev-easy_first_only__default__t-0.00__p-0.95__c-3.00__install-1/pydicom__pydicom-1458.traj +257 -0
  166. package/python/tests/test_env.py +66 -0
  167. package/python/tests/test_env_utils.py +129 -0
  168. package/python/tests/test_history_processors.py +40 -0
  169. package/python/tests/test_models.py +23 -0
  170. package/python/tests/test_openai_live.py +164 -0
  171. package/python/tests/test_packaging.py +7 -0
  172. package/python/tests/test_parsing.py +131 -0
  173. package/python/tests/test_problem_statement_multimodal.py +111 -0
  174. package/python/tests/test_quick_stats.py +42 -0
  175. package/python/tests/test_run.py +37 -0
  176. package/python/tests/test_run_batch.py +110 -0
  177. package/python/tests/test_run_hooks.py +114 -0
  178. package/python/tests/test_run_replay.py +33 -0
  179. package/python/tests/test_run_single.py +125 -0
  180. package/python/tests/test_tools_command_parsing.py +193 -0
  181. package/python/tests/test_utils.py +15 -0
  182. package/python/tests/tools/__init__.py +0 -0
  183. package/python/tests/tools/conftest.py +12 -0
  184. package/python/tests/tools/test_default_utils.py +153 -0
  185. package/python/tests/tools/test_edit_replace.py +0 -0
  186. package/python/tests/tools/test_split_string.py +82 -0
  187. package/python/tests/utils.py +29 -0
  188. package/python/tools/diff_state/bin/_state_diff_state +52 -0
  189. package/python/tools/diff_state/config.yaml +2 -0
  190. package/python/tools/edit_anthropic/bin/_state_anthropic +21 -0
  191. package/python/tools/edit_anthropic/bin/str_replace_editor +710 -0
  192. package/python/tools/edit_anthropic/config.yaml +56 -0
  193. package/python/tools/edit_anthropic/install.sh +3 -0
  194. package/python/tools/filemap/bin/filemap +45 -0
  195. package/python/tools/filemap/config.yaml +9 -0
  196. package/python/tools/filemap/install.sh +2 -0
  197. package/python/tools/forfeit/bin/exit_forfeit +5 -0
  198. package/python/tools/forfeit/config.yaml +5 -0
  199. package/python/tools/image_tools/bin/view_image +36 -0
  200. package/python/tools/image_tools/config.yaml +9 -0
  201. package/python/tools/multilingual_setup/bin/do_nothing +2 -0
  202. package/python/tools/multilingual_setup/config.yaml +1 -0
  203. package/python/tools/multilingual_setup/install.sh +45 -0
  204. package/python/tools/registry/bin/_read_env +10 -0
  205. package/python/tools/registry/bin/_write_env +10 -0
  206. package/python/tools/registry/config.yaml +1 -0
  207. package/python/tools/registry/install.sh +6 -0
  208. package/python/tools/registry/lib/__init__.py +0 -0
  209. package/python/tools/registry/lib/registry.py +56 -0
  210. package/python/tools/review_on_submit_m/README.md +6 -0
  211. package/python/tools/review_on_submit_m/bin/submit +54 -0
  212. package/python/tools/review_on_submit_m/config.yaml +6 -0
  213. package/python/tools/review_on_submit_m/install.sh +0 -0
  214. package/python/tools/search/bin/find_file +31 -0
  215. package/python/tools/search/bin/search_dir +39 -0
  216. package/python/tools/search/bin/search_file +55 -0
  217. package/python/tools/search/config.yaml +37 -0
  218. package/python/tools/search/install.sh +3 -0
  219. package/python/tools/submit/bin/submit +17 -0
  220. package/python/tools/submit/config.yaml +5 -0
  221. package/python/tools/web_browser/bin/click_mouse +41 -0
  222. package/python/tools/web_browser/bin/close_site +28 -0
  223. package/python/tools/web_browser/bin/double_click_mouse +37 -0
  224. package/python/tools/web_browser/bin/drag_mouse +46 -0
  225. package/python/tools/web_browser/bin/execute_script_on_page +39 -0
  226. package/python/tools/web_browser/bin/get_console_output +48 -0
  227. package/python/tools/web_browser/bin/move_mouse +35 -0
  228. package/python/tools/web_browser/bin/navigate_back +33 -0
  229. package/python/tools/web_browser/bin/navigate_forward +33 -0
  230. package/python/tools/web_browser/bin/open_site +36 -0
  231. package/python/tools/web_browser/bin/press_keys_on_page +51 -0
  232. package/python/tools/web_browser/bin/reload_page +33 -0
  233. package/python/tools/web_browser/bin/run_web_browser_server +394 -0
  234. package/python/tools/web_browser/bin/screenshot_site +38 -0
  235. package/python/tools/web_browser/bin/scroll_on_page +40 -0
  236. package/python/tools/web_browser/bin/set_browser_window_size +40 -0
  237. package/python/tools/web_browser/bin/type_text +34 -0
  238. package/python/tools/web_browser/bin/wait_time +39 -0
  239. package/python/tools/web_browser/config.yaml +155 -0
  240. package/python/tools/web_browser/install.sh +22 -0
  241. package/python/tools/web_browser/lib/browser_manager.py +404 -0
  242. package/python/tools/web_browser/lib/web_browser_config.py +33 -0
  243. package/python/tools/web_browser/lib/web_browser_utils.py +126 -0
  244. package/python/tools/web_browser/test_console.html +1 -0
  245. package/python/tools/windowed/bin/_state +25 -0
  246. package/python/tools/windowed/bin/create +29 -0
  247. package/python/tools/windowed/bin/goto +37 -0
  248. package/python/tools/windowed/bin/open +49 -0
  249. package/python/tools/windowed/bin/scroll_down +12 -0
  250. package/python/tools/windowed/bin/scroll_up +13 -0
  251. package/python/tools/windowed/config.yaml +38 -0
  252. package/python/tools/windowed/install.sh +15 -0
  253. package/python/tools/windowed/lib/__init__.py +0 -0
  254. package/python/tools/windowed/lib/flake8_utils.py +147 -0
  255. package/python/tools/windowed/lib/windowed_file.py +312 -0
  256. package/python/tools/windowed_edit_linting/bin/edit +128 -0
  257. package/python/tools/windowed_edit_linting/config.yaml +31 -0
  258. package/python/tools/windowed_edit_linting/install.sh +5 -0
  259. package/python/tools/windowed_edit_replace/bin/edit +172 -0
  260. package/python/tools/windowed_edit_replace/bin/insert +77 -0
  261. package/python/tools/windowed_edit_replace/config.yaml +60 -0
  262. package/python/tools/windowed_edit_replace/install.sh +5 -0
  263. package/python/tools/windowed_edit_rewrite/bin/edit +78 -0
  264. package/python/tools/windowed_edit_rewrite/config.yaml +11 -0
  265. package/python/tools/windowed_edit_rewrite/install.sh +5 -0
  266. package/python/trajectories/demonstrations/ctf/crypto/BabyEncryption.traj +318 -0
  267. package/python/trajectories/demonstrations/ctf/crypto/BabyTimeCapsule.traj +197 -0
  268. package/python/trajectories/demonstrations/ctf/crypto/eps.traj +289 -0
  269. package/python/trajectories/demonstrations/ctf/crypto/katy.traj +368 -0
  270. package/python/trajectories/demonstrations/ctf/forensics/flash.traj +102 -0
  271. package/python/trajectories/demonstrations/ctf/misc/networking_1.traj +102 -0
  272. package/python/trajectories/demonstrations/ctf/pwn/warmup.traj +159 -0
  273. package/python/trajectories/demonstrations/ctf/rev/rock.traj +251 -0
  274. package/python/trajectories/demonstrations/ctf/web/i_got_id_demo.traj +422 -0
  275. package/python/trajectories/demonstrations/function_calling_simple.traj +151 -0
  276. package/python/trajectories/demonstrations/human_thought__swe-bench-HumanEvalFix-python__lcb__t-0.00__p-0.95__c-4.00__install-0/humanevalfix-python-0.traj +129 -0
  277. package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default__t-0.20__p-0.95__c-2.00__install-1___install_from_source/marshmallow-code__marshmallow-1867.traj +318 -0
  278. package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default_sys-env_cursors_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj +251 -0
  279. package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default_sys-env_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj +399 -0
  280. package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__function_calling__install-1/marshmallow-code__marshmallow-1867.traj +594 -0
  281. package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__function_calling_replace__install-1/marshmallow-code__marshmallow-1867.traj +592 -0
  282. package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__function_calling_replace_from_source/marshmallow-code__marshmallow-1867.traj +3316 -0
  283. package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__xml_sys-env_cursors_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj +251 -0
  284. package/python/trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__xml_sys-env_window100__t-0.20__p-0.95__c-2.00__install-1/marshmallow-code__marshmallow-1867.traj +399 -0
  285. package/python/trajectories/demonstrations/str_replace_anthropic_demo.yaml +432 -0
  286. package/rust/Cargo.toml +100 -0
  287. package/rust/README.md +49 -0
  288. package/rust/src/agent/action_sampler.rs +130 -0
  289. package/rust/src/agent/agents.rs +1029 -0
  290. package/rust/src/agent/history_processors.rs +277 -0
  291. package/rust/src/agent/hooks/mod.rs +208 -0
  292. package/rust/src/agent/mod.rs +24 -0
  293. package/rust/src/agent/models.rs +837 -0
  294. package/rust/src/agent/problem_statement.rs +355 -0
  295. package/rust/src/agent/reviewer.rs +505 -0
  296. package/rust/src/bin/sweagent.rs +784 -0
  297. package/rust/src/environment/deployment.rs +631 -0
  298. package/rust/src/environment/hooks/mod.rs +114 -0
  299. package/rust/src/environment/mod.rs +16 -0
  300. package/rust/src/environment/repo.rs +265 -0
  301. package/rust/src/environment/runtime.rs +237 -0
  302. package/rust/src/environment/swe_env.rs +248 -0
  303. package/rust/src/exceptions.rs +228 -0
  304. package/rust/src/lib.rs +68 -0
  305. package/rust/src/monitoring.rs +482 -0
  306. package/rust/src/run/hooks/mod.rs +134 -0
  307. package/rust/src/run/mod.rs +12 -0
  308. package/rust/src/run/run_batch.rs +563 -0
  309. package/rust/src/run/run_single.rs +196 -0
  310. package/rust/src/tools/bundle.rs +224 -0
  311. package/rust/src/tools/commands.rs +173 -0
  312. package/rust/src/tools/mod.rs +295 -0
  313. package/rust/src/tools/parsing.rs +354 -0
  314. package/rust/src/tools/registry.rs +143 -0
  315. package/rust/src/types.rs +554 -0
  316. package/rust/src/utils/config.rs +105 -0
  317. package/rust/src/utils/files.rs +137 -0
  318. package/rust/src/utils/github.rs +171 -0
  319. package/rust/src/utils/log.rs +65 -0
  320. package/rust/src/utils/mod.rs +17 -0
  321. package/rust/src/utils/serialization.rs +181 -0
  322. package/rust/src/utils/template.rs +173 -0
  323. package/typescript/README.md +335 -0
@@ -0,0 +1,518 @@
1
+ actions:
2
+ open_pr: false
3
+ push_gh_repo_url: ''
4
+ skip_if_commits_reference_issue: true
5
+ agent:
6
+ config:
7
+ _commands:
8
+ - arguments:
9
+ line_number:
10
+ description: the line number to move the window to (if not provided, the
11
+ window will start at the top of the file)
12
+ required: false
13
+ type: integer
14
+ path:
15
+ description: the path to the file to open
16
+ required: true
17
+ type: string
18
+ code: 'open() { if [ -z "$1" ] then echo "Usage: open <file>" return fi #
19
+ Check if the second argument is provided if [ -n "$2" ]; then #
20
+ Check if the provided argument is a valid number if ! [[ $2 =~ ^[0-9]+$
21
+ ]]; then echo "Usage: open <file> [<line_number>]" echo
22
+ "Error: <line_number> must be a number" return # Exit if the line
23
+ number is not valid fi local max_line=$(awk ''END {print NR}''
24
+ $1) if [ $2 -gt $max_line ]; then echo "Warning: <line_number>
25
+ ($2) is greater than the number of lines in the file ($max_line)" echo
26
+ "Warning: Setting <line_number> to $max_line" local line_number=$(jq
27
+ -n "$max_line") # Set line number to max if greater than max elif
28
+ [ $2 -lt 1 ]; then echo "Warning: <line_number> ($2) is less than
29
+ 1" echo "Warning: Setting <line_number> to 1" local
30
+ line_number=$(jq -n "1") # Set line number to 1 if less than 1 else local
31
+ OFFSET=$(jq -n "$WINDOW/6" | jq ''floor'') local line_number=$(jq
32
+ -n "[$2 + $WINDOW/2 - $OFFSET, 1] | max | floor") fi else local
33
+ line_number=$(jq -n "$WINDOW/2") # Set default line number if not provided fi if
34
+ [ -f "$1" ]; then export CURRENT_FILE=$(realpath $1) export
35
+ CURRENT_LINE=$line_number _constrain_line _print elif [ -d
36
+ "$1" ]; then echo "Error: $1 is a directory. You can only open files.
37
+ Use cd or ls to navigate directories." else echo "File $1 not found" fi}'
38
+ docstring: opens the file at the given path in the editor. If line_number is
39
+ provided, the window will be move to include that line
40
+ end_name: null
41
+ name: open
42
+ signature: open <path> [<line_number>]
43
+ - arguments:
44
+ line_number:
45
+ description: the line number to move the window to
46
+ required: true
47
+ type: integer
48
+ code: 'goto() { if [ $# -gt 1 ]; then echo "goto allows only one line
49
+ number at a time." return fi if [ -z "$CURRENT_FILE" ] then echo
50
+ "No file open. Use the open command first." return fi if [ -z
51
+ "$1" ] then echo "Usage: goto <line>" return fi if
52
+ ! [[ $1 =~ ^[0-9]+$ ]] then echo "Usage: goto <line>" echo
53
+ "Error: <line> must be a number" return fi local max_line=$(awk
54
+ ''END {print NR}'' $CURRENT_FILE) if [ $1 -gt $max_line ] then echo
55
+ "Error: <line> must be less than or equal to $max_line" return fi local
56
+ OFFSET=$(jq -n "$WINDOW/6" | jq ''floor'') export CURRENT_LINE=$(jq -n
57
+ "[$1 + $WINDOW/2 - $OFFSET, 1] | max | floor") _constrain_line _print}'
58
+ docstring: moves the window to show <line_number>
59
+ end_name: null
60
+ name: goto
61
+ signature: goto <line_number>
62
+ - arguments: null
63
+ code: scroll_down() { if [ -z "$CURRENT_FILE" ] then echo "No file
64
+ open. Use the open command first." return fi export CURRENT_LINE=$(jq
65
+ -n "$CURRENT_LINE + $WINDOW - $OVERLAP") _constrain_line _print}
66
+ docstring: moves the window down {WINDOW} lines
67
+ end_name: null
68
+ name: scroll_down
69
+ signature: scroll_down
70
+ - arguments: null
71
+ code: scroll_up() { if [ -z "$CURRENT_FILE" ] then echo "No file
72
+ open. Use the open command first." return fi export CURRENT_LINE=$(jq
73
+ -n "$CURRENT_LINE - $WINDOW + $OVERLAP") _constrain_line _print}
74
+ docstring: moves the window down {WINDOW} lines
75
+ end_name: null
76
+ name: scroll_up
77
+ signature: scroll_down
78
+ - arguments:
79
+ filename:
80
+ description: the name of the file to create
81
+ required: true
82
+ type: string
83
+ code: "create() { if [ -z \"$1\" ]; then echo \"Usage: create <filename>\"\
84
+ \ return fi # Check if the file already exists if [ -e \"\
85
+ $1\" ]; then echo \"Error: File '$1' already exists.\"\t\topen \"$1\"\
86
+ \ return fi # Create the file an empty new line printf \"\\\
87
+ n\" > \"$1\" # Use the existing open command to open the created file \
88
+ \ open \"$1\"}"
89
+ docstring: creates and opens a new file with the given name
90
+ end_name: null
91
+ name: create
92
+ signature: create <filename>
93
+ - arguments: null
94
+ code: 'submit() { cd $ROOT # Check if the patch file exists and is non-empty if
95
+ [ -s "/root/test.patch" ]; then # Apply the patch in reverse git
96
+ apply -R < "/root/test.patch" fi git add -A git diff --cached > model.patch echo
97
+ "<<SUBMISSION||" cat model.patch echo "||SUBMISSION>>"}'
98
+ docstring: submits your current code and terminates the session
99
+ end_name: null
100
+ name: submit
101
+ signature: submit
102
+ - arguments:
103
+ dir:
104
+ description: the directory to search in (if not provided, searches in the
105
+ current directory)
106
+ required: false
107
+ type: string
108
+ search_term:
109
+ description: the term to search for
110
+ required: true
111
+ type: string
112
+ code: 'search_dir() { if [ $# -eq 1 ]; then local search_term="$1" local
113
+ dir="./" elif [ $# -eq 2 ]; then local search_term="$1" if
114
+ [ -d "$2" ]; then local dir="$2" else echo "Directory
115
+ $2 not found" return fi else echo "Usage: search_dir
116
+ <search_term> [<dir>]" return fi dir=$(realpath "$dir") local
117
+ matches=$(find "$dir" -type f ! -path ''*/.*'' -exec grep -nIH -- "$search_term"
118
+ {} + | cut -d: -f1 | sort | uniq -c) # if no matches, return if [ -z
119
+ "$matches" ]; then echo "No matches found for \"$search_term\" in $dir" return fi #
120
+ Calculate total number of matches local num_matches=$(echo "$matches" |
121
+ awk ''{sum+=$1} END {print sum}'') # calculate total number of files matched local
122
+ num_files=$(echo "$matches" | wc -l | awk ''{$1=$1; print $0}'') # if num_files
123
+ is > 100, print an error if [ $num_files -gt 100 ]; then echo "More
124
+ than $num_files files matched for \"$search_term\" in $dir. Please narrow
125
+ your search." return fi echo "Found $num_matches matches
126
+ for \"$search_term\" in $dir:" echo "$matches" | awk ''{$2=$2; gsub(/^\.+\/+/,
127
+ "./", $2); print $2 " ("$1" matches)"}'' echo "End of matches for \"$search_term\"
128
+ in $dir"}'
129
+ docstring: searches for search_term in all files in dir. If dir is not provided,
130
+ searches in the current directory
131
+ end_name: null
132
+ name: search_dir
133
+ signature: search_dir <search_term> [<dir>]
134
+ - arguments:
135
+ file:
136
+ description: the file to search in (if not provided, searches in the current
137
+ open file)
138
+ required: false
139
+ type: string
140
+ search_term:
141
+ description: the term to search for
142
+ required: true
143
+ type: string
144
+ code: 'search_file() { # Check if the first argument is provided if [
145
+ -z "$1" ]; then echo "Usage: search_file <search_term> [<file>]" return fi #
146
+ Check if the second argument is provided if [ -n "$2" ]; then #
147
+ Check if the provided argument is a valid file if [ -f "$2" ]; then local
148
+ file="$2" # Set file if valid else echo "Usage: search_file
149
+ <search_term> [<file>]" echo "Error: File name $2 not found. Please
150
+ provide a valid file name." return # Exit if the file is not valid fi else #
151
+ Check if a file is open if [ -z "$CURRENT_FILE" ]; then echo
152
+ "No file open. Use the open command first." return # Exit if no
153
+ file is open fi local file="$CURRENT_FILE" # Set file to the
154
+ current open file fi local search_term="$1" file=$(realpath "$file") #
155
+ Use grep to directly get the desired formatted output local matches=$(grep
156
+ -nH -- "$search_term" "$file") # Check if no matches were found if [
157
+ -z "$matches" ]; then echo "No matches found for \"$search_term\" in
158
+ $file" return fi # Calculate total number of matches local
159
+ num_matches=$(echo "$matches" | wc -l | awk ''{$1=$1; print $0}'') #
160
+ calculate total number of lines matched local num_lines=$(echo "$matches"
161
+ | cut -d: -f1 | sort | uniq | wc -l | awk ''{$1=$1; print $0}'') # if num_lines
162
+ is > 100, print an error if [ $num_lines -gt 100 ]; then echo "More
163
+ than $num_lines lines matched for \"$search_term\" in $file. Please narrow
164
+ your search." return fi # Print the total number of matches and
165
+ the matches themselves echo "Found $num_matches matches for \"$search_term\"
166
+ in $file:" echo "$matches" | cut -d: -f1-2 | sort -u -t: -k2,2n | while
167
+ IFS=: read -r filename line_number; do echo "Line $line_number:$(sed
168
+ -n "${line_number}p" "$file")" done echo "End of matches for \"$search_term\"
169
+ in $file"}'
170
+ docstring: searches for search_term in file. If file is not provided, searches
171
+ in the current open file
172
+ end_name: null
173
+ name: search_file
174
+ signature: search_file <search_term> [<file>]
175
+ - arguments:
176
+ dir:
177
+ description: the directory to search in (if not provided, searches in the
178
+ current directory)
179
+ required: false
180
+ type: string
181
+ file_name:
182
+ description: the name of the file to search for
183
+ required: true
184
+ type: string
185
+ code: 'find_file() { if [ $# -eq 1 ]; then local file_name="$1" local
186
+ dir="./" elif [ $# -eq 2 ]; then local file_name="$1" if
187
+ [ -d "$2" ]; then local dir="$2" else echo "Directory
188
+ $2 not found" return fi else echo "Usage: find_file
189
+ <file_name> [<dir>]" return fi dir=$(realpath "$dir") local
190
+ matches=$(find "$dir" -type f -name "$file_name") # if no matches, return if
191
+ [ -z "$matches" ]; then echo "No matches found for \"$file_name\" in
192
+ $dir" return fi # Calculate total number of matches local
193
+ num_matches=$(echo "$matches" | wc -l | awk ''{$1=$1; print $0}'') echo
194
+ "Found $num_matches matches for \"$file_name\" in $dir:" echo "$matches"
195
+ | awk ''{print $0}''}'
196
+ docstring: finds all files with the given name in dir. If dir is not provided,
197
+ searches in the current directory
198
+ end_name: null
199
+ name: find_file
200
+ signature: find_file <file_name> [<dir>]
201
+ - arguments:
202
+ end_line:
203
+ description: the line number to end the edit at (inclusive)
204
+ required: true
205
+ type: integer
206
+ replacement_text:
207
+ description: the text to replace the current selection with
208
+ required: true
209
+ type: string
210
+ start_line:
211
+ description: the line number to start the edit at
212
+ required: true
213
+ type: integer
214
+ code: 'edit() { if [ -z "$CURRENT_FILE" ] then echo ''No file open.
215
+ Use the `open` command first.'' return fi local start_line="$(echo
216
+ $1: | cut -d: -f1)" local end_line="$(echo $1: | cut -d: -f2)" if [
217
+ -z "$start_line" ] || [ -z "$end_line" ] then echo "Usage: edit
218
+ <start_line>:<end_line>" return fi local re=''^[0-9]+$'' if
219
+ ! [[ $start_line =~ $re ]]; then echo "Usage: edit <start_line>:<end_line>" echo
220
+ "Error: start_line must be a number" return fi if ! [[ $end_line
221
+ =~ $re ]]; then echo "Usage: edit <start_line>:<end_line>" echo
222
+ "Error: end_line must be a number" return fi # Bash array starts
223
+ at 0, so let''s adjust local start_line=$((start_line - 1)) local end_line=$((end_line)) local
224
+ line_count=0 local replacement=() while IFS= read -r line do replacement+=("$line") ((line_count++)) done #
225
+ Create a backup of the current file cp "$CURRENT_FILE" "/root/$(basename
226
+ "$CURRENT_FILE")_backup" # Read the file line by line into an array mapfile
227
+ -t lines < "$CURRENT_FILE" local new_lines=("${lines[@]:0:$start_line}"
228
+ "${replacement[@]}" "${lines[@]:$((end_line))}") # Write the new stuff
229
+ directly back into the original file printf "%s\n" "${new_lines[@]}" >|
230
+ "$CURRENT_FILE" # Run linter if [[ $CURRENT_FILE == *.py ]]; then lint_output=$(flake8
231
+ --select=F821,F822,F831,E111,E112,E113,E999,E902 "$CURRENT_FILE" 2>&1) else #
232
+ do nothing lint_output="" fi # if there is no output, then the
233
+ file is good if [ -z "$lint_output" ]; then export CURRENT_LINE=$start_line _constrain_line _print echo
234
+ "File updated. Please review the changes and make sure they are correct (correct
235
+ indentation, no duplicate lines, etc). Edit the file again if necessary." else echo
236
+ "Your proposed edit has introduced new syntax error(s). Please understand
237
+ the fixes and retry your edit command." echo "" echo "ERRORS:" _split_string
238
+ "$lint_output" echo "" # Save original values original_current_line=$CURRENT_LINE original_window=$WINDOW #
239
+ Update values export CURRENT_LINE=$(( (line_count / 2) + start_line
240
+ )) # Set to "center" of edit export WINDOW=$((line_count + 10)) # Show
241
+ +/- 5 lines around edit echo "This is how your edit would have looked
242
+ if applied" echo "-------------------------------------------------" _constrain_line _print echo
243
+ "-------------------------------------------------" echo "" #
244
+ Restoring CURRENT_FILE to original contents. cp "/root/$(basename "$CURRENT_FILE")_backup"
245
+ "$CURRENT_FILE" export CURRENT_LINE=$(( ((end_line - start_line + 1)
246
+ / 2) + start_line )) export WINDOW=$((end_line - start_line + 10)) echo
247
+ "This is the original code before your edit" echo "-------------------------------------------------" _constrain_line _print echo
248
+ "-------------------------------------------------" # Restore original
249
+ values export CURRENT_LINE=$original_current_line export WINDOW=$original_window echo
250
+ "Your changes have NOT been applied. Please fix your edit command and try
251
+ again." echo "You either need to 1) Specify the correct start/end line
252
+ arguments or 2) Correct your edit code." echo "DO NOT re-run the same
253
+ failed edit command. Running it again will lead to the same error." fi #
254
+ Remove backup file rm -f "/root/$(basename "$CURRENT_FILE")_backup"}'
255
+ docstring: replaces lines <start_line> through <end_line> (inclusive) with the
256
+ given text in the open file. The replacement text is terminated by a line
257
+ with only end_of_edit on it. All of the <replacement text> will be entered,
258
+ so make sure your indentation is formatted properly. Python files will be
259
+ checked for syntax errors after the edit. If the system detects a syntax error,
260
+ the edit will not be executed. Simply try to edit the file again, but make
261
+ sure to read the error message and modify the edit command you issue accordingly.
262
+ Issuing the same command a second time will just lead to the same error message
263
+ again.
264
+ end_name: end_of_edit
265
+ name: edit
266
+ signature: |-
267
+ edit <start_line>:<end_line>
268
+ <replacement_text>
269
+ end_of_edit
270
+ _subroutines: {}
271
+ blocklist:
272
+ - vim
273
+ - vi
274
+ - emacs
275
+ - nano
276
+ - nohup
277
+ - git
278
+ blocklist_error_template: Interactive operation '{name}' is not supported by this
279
+ environment
280
+ blocklist_standalone:
281
+ - python
282
+ - python3
283
+ - ipython
284
+ - bash
285
+ - sh
286
+ - exit
287
+ - /bin/bash
288
+ - /bin/sh
289
+ - nohup
290
+ - vi
291
+ - vim
292
+ - emacs
293
+ - nano
294
+ command_docs: |+
295
+ open:
296
+ docstring: opens the file at the given path in the editor. If line_number is provided, the window will be move to include that line
297
+ signature: open <path> [<line_number>]
298
+ arguments:
299
+ - path (string) [required]: the path to the file to open
300
+ - line_number (integer) [optional]: the line number to move the window to (if not provided, the window will start at the top of the file)
301
+
302
+ goto:
303
+ docstring: moves the window to show <line_number>
304
+ signature: goto <line_number>
305
+ arguments:
306
+ - line_number (integer) [required]: the line number to move the window to
307
+
308
+ scroll_down:
309
+ docstring: moves the window down {WINDOW} lines
310
+ signature: scroll_down
311
+
312
+ scroll_up:
313
+ docstring: moves the window down {WINDOW} lines
314
+ signature: scroll_down
315
+
316
+ create:
317
+ docstring: creates and opens a new file with the given name
318
+ signature: create <filename>
319
+ arguments:
320
+ - filename (string) [required]: the name of the file to create
321
+
322
+ submit:
323
+ docstring: submits your current code and terminates the session
324
+ signature: submit
325
+
326
+ search_dir:
327
+ docstring: searches for search_term in all files in dir. If dir is not provided, searches in the current directory
328
+ signature: search_dir <search_term> [<dir>]
329
+ arguments:
330
+ - search_term (string) [required]: the term to search for
331
+ - dir (string) [optional]: the directory to search in (if not provided, searches in the current directory)
332
+
333
+ search_file:
334
+ docstring: searches for search_term in file. If file is not provided, searches in the current open file
335
+ signature: search_file <search_term> [<file>]
336
+ arguments:
337
+ - search_term (string) [required]: the term to search for
338
+ - file (string) [optional]: the file to search in (if not provided, searches in the current open file)
339
+
340
+ find_file:
341
+ docstring: finds all files with the given name in dir. If dir is not provided, searches in the current directory
342
+ signature: find_file <file_name> [<dir>]
343
+ arguments:
344
+ - file_name (string) [required]: the name of the file to search for
345
+ - dir (string) [optional]: the directory to search in (if not provided, searches in the current directory)
346
+
347
+ edit:
348
+ docstring: replaces lines <start_line> through <end_line> (inclusive) with the given text in the open file. The replacement text is terminated by a line with only end_of_edit on it. All of the <replacement text> will be entered, so make sure your indentation is formatted properly. Python files will be checked for syntax errors after the edit. If the system detects a syntax error, the edit will not be executed. Simply try to edit the file again, but make sure to read the error message and modify the edit command you issue accordingly. Issuing the same command a second time will just lead to the same error message again.
349
+ signature: edit <start_line>:<end_line>
350
+ <replacement_text>
351
+ end_of_edit
352
+ arguments:
353
+ - start_line (integer) [required]: the line number to start the edit at
354
+ - end_line (integer) [required]: the line number to end the edit at (inclusive)
355
+ - replacement_text (string) [required]: the text to replace the current selection with
356
+
357
+ command_files:
358
+ - config/commands/defaults.sh
359
+ - config/commands/search.sh
360
+ - config/commands/edit_linting.sh
361
+ - config/commands/_split_string.py
362
+ demonstration_template: |
363
+ Here is a demonstration of how to correctly accomplish this task.
364
+ It is included to show you how to correctly use the interface.
365
+ You do not need to follow exactly what is done in the demonstration.
366
+ --- DEMONSTRATION ---
367
+ {demonstration}
368
+ --- END OF DEMONSTRATION ---
369
+ demonstrations:
370
+ - trajectories/demonstrations/replay__marshmallow-code__marshmallow-1867__default__t-0.20__p-0.95__c-2.00__install-1___install_from_source/marshmallow-code__marshmallow-1867.traj
371
+ env_variables:
372
+ CURRENT_FILE: ''
373
+ CURRENT_LINE: '0'
374
+ OVERLAP: '2'
375
+ SEARCH_FILES: ()
376
+ SEARCH_INDEX: '0'
377
+ SEARCH_RESULTS: ()
378
+ WINDOW: '100'
379
+ format_error_template: |
380
+ Your output was not formatted correctly. You must always include one discussion and one command as part of your response. Make sure you do not have multiple discussion/command tags.
381
+ Please make sure your output precisely matches the following format:
382
+ DISCUSSION
383
+ Discuss here with yourself about what your planning and what you're going to do in this step.
384
+
385
+ ```
386
+ command(s) that you're going to run
387
+ ```
388
+ history_processors: []
389
+ instance_template: "We're currently solving the following issue within our repository.\
390
+ \ Here's the issue text:\nISSUE:\n{issue}\n\nINSTRUCTIONS:\nNow, you're going\
391
+ \ to solve this issue on your own. Your terminal session has started and you're\
392
+ \ in the repository's root directory. You can use any bash commands or the special\
393
+ \ interface to help you. Edit all the files you need to and run any checks or\
394
+ \ tests that you want. \nRemember, YOU CAN ONLY ENTER ONE COMMAND AT A TIME.\
395
+ \ You should always wait for feedback after every command. \nWhen you're satisfied\
396
+ \ with all of the changes you've made, you can submit your changes to the code\
397
+ \ base by simply running the submit command.\nNote however that you cannot use\
398
+ \ any interactive session commands (e.g. python, vim) in this environment, but\
399
+ \ you can write scripts and run them. E.g. you can write a python script and\
400
+ \ then run it with `python <script_name>.py`.\n\nNOTE ABOUT THE EDIT COMMAND:\
401
+ \ Indentation really matters! When editing a file, make sure to insert appropriate\
402
+ \ indentation before each line! \n\nIMPORTANT TIPS:\n1. Always start by trying\
403
+ \ to replicate the bug that the issues discusses. \n If the issue includes\
404
+ \ code for reproducing the bug, we recommend that you re-implement that in your\
405
+ \ environment, and run it to make sure you can reproduce the bug.\n Then start\
406
+ \ trying to fix it.\n When you think you've fixed the bug, re-run the bug\
407
+ \ reproduction script to make sure that the bug has indeed been fixed.\n \n\
408
+ \ If the bug reproduction script does not print anything when it successfully\
409
+ \ runs, we recommend adding a print(\"Script completed successfully, no errors.\"\
410
+ ) command at the end of the file,\n so that you can be sure that the script\
411
+ \ indeed ran fine all the way through. \n\n2. If you run a command and it doesn't\
412
+ \ work, try running a different command. A command that did not work once will\
413
+ \ not work the second time unless you modify it!\n\n3. If you open a file and\
414
+ \ need to get to an area around a specific line that is not in the first 100\
415
+ \ lines, say line 583, don't just use the scroll_down command multiple times.\
416
+ \ Instead, use the goto 583 command. It's much quicker. \n \n4. If the bug\
417
+ \ reproduction script requires inputting/reading a specific file, such as buggy-input.png,\
418
+ \ and you'd like to understand how to input that file, conduct a search in the\
419
+ \ existing repo code, to see whether someone else has already done that. Do\
420
+ \ this by running the command: find_file \"buggy-input.png\" If that doensn't\
421
+ \ work, use the linux 'find' command. \n\n5. Always make sure to look at the\
422
+ \ currently open file and the current working directory (which appears right\
423
+ \ after the currently open file). The currently open file might be in a different\
424
+ \ directory than the working directory! Note that some commands, such as 'create',\
425
+ \ open files, so they might change the current open file.\n\n6. When editing\
426
+ \ files, it is easy to accidentally specify a wrong line number or to write\
427
+ \ code with incorrect indentation. Always check the code after you issue an\
428
+ \ edit to make sure that it reflects what you wanted to accomplish. If it didn't,\
429
+ \ issue another command to fix it.\n\n7. It may be necessary to install the\
430
+ \ repository from source before you can run code. Please think about how to\
431
+ \ install the environment from the repository directory if you need to do so.\n\
432
+ \ \n\n(Open file: {open_file})\n(Current directory: {working_dir})\nbash-$"
433
+ next_step_no_output_template: |-
434
+ Your command ran successfully and did not produce any output.
435
+ (Open file: {open_file})
436
+ (Current directory: {working_dir})
437
+ bash-$
438
+ next_step_template: |-
439
+ {observation}
440
+ (Open file: {open_file})
441
+ (Current directory: {working_dir})
442
+ bash-$
443
+ parse_command: {}
444
+ parse_function: {}
445
+ put_demos_in_history: false
446
+ strategy_template: null
447
+ submit_command: submit
448
+ subroutine_types: []
449
+ system_template: "SETTING: You are an autonomous programmer, and you're working\
450
+ \ directly in the command line with a special interface.\n\nThe special interface\
451
+ \ consists of a file editor that shows you {WINDOW} lines of a file at a time.\n\
452
+ In addition to typical bash commands, you can also use the following commands\
453
+ \ to help you navigate and edit files.\n\nCOMMANDS:\n{command_docs}\n\nPlease\
454
+ \ note that THE EDIT COMMAND REQUIRES PROPER INDENTATION. \nIf you'd like to\
455
+ \ add the line ' print(x)' you must fully write that out, with all those\
456
+ \ spaces before the code! Indentation is important and code that is not indented\
457
+ \ correctly will fail and require fixing before it can be run.\n\nRESPONSE FORMAT:\n\
458
+ Your shell prompt is formatted as follows:\n(Open file: <path>) <cwd> $\n\n\
459
+ You need to format your output using two fields; discussion and command.\nYour\
460
+ \ output should always include _one_ discussion and _one_ command field EXACTLY\
461
+ \ as in the following example:\nDISCUSSION\nFirst I'll start by using ls to\
462
+ \ see what files are in the current directory. Then maybe we can look at some\
463
+ \ relevant files to see what they look like.\n```\nls -a\n```\n\nYou should\
464
+ \ only include a *SINGLE* command in the command section and then wait for a\
465
+ \ response from the shell before continuing with more discussion and commands.\
466
+ \ Everything you include in the DISCUSSION section will be saved for future\
467
+ \ reference.\nIf you'd like to issue two commands at once, PLEASE DO NOT DO\
468
+ \ THAT! Please instead first submit just the first command, and then after receiving\
469
+ \ a response you'll be able to issue the second command. \nYou're free to use\
470
+ \ any other bash commands you want (e.g. find, grep, cat, ls, cd) in addition\
471
+ \ to the special commands listed above.\nHowever, the environment does NOT support\
472
+ \ interactive session commands (e.g. python, vim), so please do not invoke them."
473
+ util_functions:
474
+ - arguments: null
475
+ code: '_print() { local total_lines=$(awk ''END {print NR}'' $CURRENT_FILE) echo
476
+ "[File: $(realpath $CURRENT_FILE) ($total_lines lines total)]" lines_above=$(jq
477
+ -n "$CURRENT_LINE - $WINDOW/2" | jq ''[0, .] | max | floor'') lines_below=$(jq
478
+ -n "$total_lines - $CURRENT_LINE - $WINDOW/2" | jq ''[0, .] | max | round'') if
479
+ [ $lines_above -gt 0 ]; then echo "($lines_above more lines above)" fi cat
480
+ $CURRENT_FILE | grep -n $ | head -n $(jq -n "[$CURRENT_LINE + $WINDOW/2, $WINDOW/2]
481
+ | max | floor") | tail -n $(jq -n "$WINDOW") if [ $lines_below -gt 0 ];
482
+ then echo "($lines_below more lines below)" fi}'
483
+ docstring: null
484
+ end_name: null
485
+ name: _print
486
+ signature: _print
487
+ - arguments: null
488
+ code: _constrain_line() { if [ -z "$CURRENT_FILE" ] then echo "No
489
+ file open. Use the open command first." return fi local max_line=$(awk
490
+ 'END {print NR}' $CURRENT_FILE) local half_window=$(jq -n "$WINDOW/2" |
491
+ jq 'floor') export CURRENT_LINE=$(jq -n "[$CURRENT_LINE, $max_line - $half_window]
492
+ | min") export CURRENT_LINE=$(jq -n "[$CURRENT_LINE, $half_window] | max")}
493
+ docstring: null
494
+ end_name: null
495
+ name: _constrain_line
496
+ signature: _constrain_line
497
+ config_file: config/default_from_url.yaml
498
+ model:
499
+ host_url: localhost:11434
500
+ model_name: gpt4
501
+ per_instance_cost_limit: 3.0
502
+ replay_path: null
503
+ temperature: 0.0
504
+ top_p: 0.95
505
+ total_cost_limit: 0.0
506
+ environment:
507
+ base_commit: null
508
+ container_name: null
509
+ data_path: https://github.com/klieret/swe-agent-test-repo/issues/1
510
+ image_name: sweagent/swe-agent:latest
511
+ install_environment: true
512
+ no_mirror: false
513
+ split: dev
514
+ timeout: 35
515
+ verbose: true
516
+ instance_filter: .*
517
+ skip_existing: false
518
+ suffix: ''