auto-use 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 (373) hide show
  1. auto_use-0.1.0/Auto_Use/__init__.py +315 -0
  2. auto_use-0.1.0/Auto_Use/agent_conversation/__init__.py +14 -0
  3. auto_use-0.1.0/Auto_Use/agent_conversation/service.py +946 -0
  4. auto_use-0.1.0/Auto_Use/agent_launcher.py +632 -0
  5. auto_use-0.1.0/Auto_Use/default_skills/ios/instagram.md +150 -0
  6. auto_use-0.1.0/Auto_Use/default_skills/ios/skills.json +7 -0
  7. auto_use-0.1.0/Auto_Use/default_skills/mac/browser.md +93 -0
  8. auto_use-0.1.0/Auto_Use/default_skills/mac/google_colab.md +56 -0
  9. auto_use-0.1.0/Auto_Use/default_skills/mac/google_services.md +45 -0
  10. auto_use-0.1.0/Auto_Use/default_skills/mac/libreoffice_calc.md +22 -0
  11. auto_use-0.1.0/Auto_Use/default_skills/mac/maps.md +15 -0
  12. auto_use-0.1.0/Auto_Use/default_skills/mac/microsoft_services.md +54 -0
  13. auto_use-0.1.0/Auto_Use/default_skills/mac/skills.json +54 -0
  14. auto_use-0.1.0/Auto_Use/default_skills/mac/skyscanner.md +11 -0
  15. auto_use-0.1.0/Auto_Use/default_skills/mac/wikipedia.md +16 -0
  16. auto_use-0.1.0/Auto_Use/default_skills/windows/browser.md +101 -0
  17. auto_use-0.1.0/Auto_Use/default_skills/windows/google_colab.md +56 -0
  18. auto_use-0.1.0/Auto_Use/default_skills/windows/google_services.md +45 -0
  19. auto_use-0.1.0/Auto_Use/default_skills/windows/libreoffice_calc.md +22 -0
  20. auto_use-0.1.0/Auto_Use/default_skills/windows/microsoft_services.md +54 -0
  21. auto_use-0.1.0/Auto_Use/default_skills/windows/skills.json +51 -0
  22. auto_use-0.1.0/Auto_Use/default_skills/windows/skyscanner.md +11 -0
  23. auto_use-0.1.0/Auto_Use/default_skills/windows/wikipedia.md +16 -0
  24. auto_use-0.1.0/Auto_Use/frontend/__init__.py +6 -0
  25. auto_use-0.1.0/Auto_Use/frontend/agent_mode/agent_mode.css +349 -0
  26. auto_use-0.1.0/Auto_Use/frontend/agent_mode/agent_mode.html +89 -0
  27. auto_use-0.1.0/Auto_Use/frontend/agent_mode/agent_mode.js +199 -0
  28. auto_use-0.1.0/Auto_Use/frontend/agent_mode/ios_session.js +189 -0
  29. auto_use-0.1.0/Auto_Use/frontend/chat/chat.css +173 -0
  30. auto_use-0.1.0/Auto_Use/frontend/chat/chat.html +10 -0
  31. auto_use-0.1.0/Auto_Use/frontend/chat/chat.js +305 -0
  32. auto_use-0.1.0/Auto_Use/frontend/chat_input/chat_input.css +1051 -0
  33. auto_use-0.1.0/Auto_Use/frontend/chat_input/chat_input.html +89 -0
  34. auto_use-0.1.0/Auto_Use/frontend/chat_input/chat_input.js +296 -0
  35. auto_use-0.1.0/Auto_Use/frontend/chat_input/pc_button.html +295 -0
  36. auto_use-0.1.0/Auto_Use/frontend/chat_input/send_button.html +268 -0
  37. auto_use-0.1.0/Auto_Use/frontend/cli/cli.html +305 -0
  38. auto_use-0.1.0/Auto_Use/frontend/cli/cli_container/coder_card.css +704 -0
  39. auto_use-0.1.0/Auto_Use/frontend/cli/cli_container/coder_card.js +1177 -0
  40. auto_use-0.1.0/Auto_Use/frontend/cli/cli_container/tool_icons.js +750 -0
  41. auto_use-0.1.0/Auto_Use/frontend/cli/cli_stage.css +54 -0
  42. auto_use-0.1.0/Auto_Use/frontend/cli/cli_stage.js +562 -0
  43. auto_use-0.1.0/Auto_Use/frontend/container/big_center_container/big_center_container.css +28 -0
  44. auto_use-0.1.0/Auto_Use/frontend/container/big_center_container/big_center_container.html +7 -0
  45. auto_use-0.1.0/Auto_Use/frontend/container/big_center_container/big_center_container.js +37 -0
  46. auto_use-0.1.0/Auto_Use/frontend/container/bottom_left/bottom_left.css +151 -0
  47. auto_use-0.1.0/Auto_Use/frontend/container/bottom_left/bottom_left.html +12 -0
  48. auto_use-0.1.0/Auto_Use/frontend/container/bottom_left/bottom_left.js +1341 -0
  49. auto_use-0.1.0/Auto_Use/frontend/container/bottom_right/bottom_right.css +199 -0
  50. auto_use-0.1.0/Auto_Use/frontend/container/bottom_right/bottom_right.html +14 -0
  51. auto_use-0.1.0/Auto_Use/frontend/container/bottom_right/bottom_right.js +153 -0
  52. auto_use-0.1.0/Auto_Use/frontend/container/top_left/globe_shell.css +130 -0
  53. auto_use-0.1.0/Auto_Use/frontend/container/top_left/globe_shell.js +171 -0
  54. auto_use-0.1.0/Auto_Use/frontend/container/top_left/top_left.css +56 -0
  55. auto_use-0.1.0/Auto_Use/frontend/container/top_left/top_left.html +34 -0
  56. auto_use-0.1.0/Auto_Use/frontend/container/top_left/top_left.js +28 -0
  57. auto_use-0.1.0/Auto_Use/frontend/container/top_right/top_right.css +191 -0
  58. auto_use-0.1.0/Auto_Use/frontend/container/top_right/top_right.html +14 -0
  59. auto_use-0.1.0/Auto_Use/frontend/container/top_right/top_right.js +150 -0
  60. auto_use-0.1.0/Auto_Use/frontend/css/style.css +1847 -0
  61. auto_use-0.1.0/Auto_Use/frontend/device_connect/device_connect.css +334 -0
  62. auto_use-0.1.0/Auto_Use/frontend/device_connect/device_connect.js +417 -0
  63. auto_use-0.1.0/Auto_Use/frontend/index.html +496 -0
  64. auto_use-0.1.0/Auto_Use/frontend/intro_animation.html +560 -0
  65. auto_use-0.1.0/Auto_Use/frontend/left_bar/left_bar.css +157 -0
  66. auto_use-0.1.0/Auto_Use/frontend/left_bar/left_bar.html +31 -0
  67. auto_use-0.1.0/Auto_Use/frontend/left_bar/left_bar.js +75 -0
  68. auto_use-0.1.0/Auto_Use/frontend/markdown.py +414 -0
  69. auto_use-0.1.0/Auto_Use/frontend/memory_bar/memory_bar.css +116 -0
  70. auto_use-0.1.0/Auto_Use/frontend/memory_bar/memory_bar.html +27 -0
  71. auto_use-0.1.0/Auto_Use/frontend/memory_bar/memory_bar.js +72 -0
  72. auto_use-0.1.0/Auto_Use/frontend/notes_stage/notes_stage.css +209 -0
  73. auto_use-0.1.0/Auto_Use/frontend/notes_stage/notes_stage.html +14 -0
  74. auto_use-0.1.0/Auto_Use/frontend/notes_stage/notes_stage.js +171 -0
  75. auto_use-0.1.0/Auto_Use/frontend/script.js +2091 -0
  76. auto_use-0.1.0/Auto_Use/frontend/service.py +3648 -0
  77. auto_use-0.1.0/Auto_Use/frontend/settings/settings.css +55 -0
  78. auto_use-0.1.0/Auto_Use/frontend/settings/settings.html +14 -0
  79. auto_use-0.1.0/Auto_Use/frontend/settings/settings.js +42 -0
  80. auto_use-0.1.0/Auto_Use/frontend/setup/setup.css +319 -0
  81. auto_use-0.1.0/Auto_Use/frontend/setup/setup.html +75 -0
  82. auto_use-0.1.0/Auto_Use/frontend/setup/setup.js +350 -0
  83. auto_use-0.1.0/Auto_Use/frontend/skills/skills.css +518 -0
  84. auto_use-0.1.0/Auto_Use/frontend/skills/skills.html +35 -0
  85. auto_use-0.1.0/Auto_Use/frontend/skills/skills.js +522 -0
  86. auto_use-0.1.0/Auto_Use/frontend/skills/skills_stage.html +100 -0
  87. auto_use-0.1.0/Auto_Use/ios/__init__.py +1 -0
  88. auto_use-0.1.0/Auto_Use/ios/agent/__init__.py +7 -0
  89. auto_use-0.1.0/Auto_Use/ios/agent/__main__.py +99 -0
  90. auto_use-0.1.0/Auto_Use/ios/agent/main_driver/__init__.py +7 -0
  91. auto_use-0.1.0/Auto_Use/ios/agent/main_driver/fast_system_prompt.md +167 -0
  92. auto_use-0.1.0/Auto_Use/ios/agent/main_driver/service.py +1149 -0
  93. auto_use-0.1.0/Auto_Use/ios/agent/main_driver/system_prompt.md +207 -0
  94. auto_use-0.1.0/Auto_Use/ios/agent/main_driver/view.py +368 -0
  95. auto_use-0.1.0/Auto_Use/ios/agent/skills/__init__.py +5 -0
  96. auto_use-0.1.0/Auto_Use/ios/agent/skills/service.py +118 -0
  97. auto_use-0.1.0/Auto_Use/ios/controller/__init__.py +10 -0
  98. auto_use-0.1.0/Auto_Use/ios/controller/scratchpad/__init__.py +5 -0
  99. auto_use-0.1.0/Auto_Use/ios/controller/scratchpad/service.py +76 -0
  100. auto_use-0.1.0/Auto_Use/ios/controller/service.py +255 -0
  101. auto_use-0.1.0/Auto_Use/ios/controller/task_tracker/__init__.py +6 -0
  102. auto_use-0.1.0/Auto_Use/ios/controller/task_tracker/service.py +118 -0
  103. auto_use-0.1.0/Auto_Use/ios/controller/tool/__init__.py +8 -0
  104. auto_use-0.1.0/Auto_Use/ios/controller/tool/open_app.py +397 -0
  105. auto_use-0.1.0/Auto_Use/ios/controller/tool/shell.py +206 -0
  106. auto_use-0.1.0/Auto_Use/ios/controller/tool/videoplayer.py +415 -0
  107. auto_use-0.1.0/Auto_Use/ios/controller/tool/web/anthropic.py +53 -0
  108. auto_use-0.1.0/Auto_Use/ios/controller/tool/web/chatgpt.py +67 -0
  109. auto_use-0.1.0/Auto_Use/ios/controller/tool/web/google_search.py +60 -0
  110. auto_use-0.1.0/Auto_Use/ios/controller/tool/web/groq_search.py +54 -0
  111. auto_use-0.1.0/Auto_Use/ios/controller/tool/web/openrouter.py +66 -0
  112. auto_use-0.1.0/Auto_Use/ios/controller/tool/web/perplexity_search.py +60 -0
  113. auto_use-0.1.0/Auto_Use/ios/controller/tool/web/service.py +90 -0
  114. auto_use-0.1.0/Auto_Use/ios/controller/tool/web/web.md +24 -0
  115. auto_use-0.1.0/Auto_Use/ios/controller/tool/web/web_agent.py +201 -0
  116. auto_use-0.1.0/Auto_Use/ios/controller/view.py +449 -0
  117. auto_use-0.1.0/Auto_Use/ios/llm_provider/__init__.py +19 -0
  118. auto_use-0.1.0/Auto_Use/ios/llm_provider/anthropic/__init__.py +6 -0
  119. auto_use-0.1.0/Auto_Use/ios/llm_provider/anthropic/service.py +273 -0
  120. auto_use-0.1.0/Auto_Use/ios/llm_provider/anthropic/view.py +108 -0
  121. auto_use-0.1.0/Auto_Use/ios/llm_provider/google/__init__.py +6 -0
  122. auto_use-0.1.0/Auto_Use/ios/llm_provider/google/service.py +286 -0
  123. auto_use-0.1.0/Auto_Use/ios/llm_provider/google/view.py +101 -0
  124. auto_use-0.1.0/Auto_Use/ios/llm_provider/groq/__init__.py +6 -0
  125. auto_use-0.1.0/Auto_Use/ios/llm_provider/groq/service.py +106 -0
  126. auto_use-0.1.0/Auto_Use/ios/llm_provider/groq/view.py +38 -0
  127. auto_use-0.1.0/Auto_Use/ios/llm_provider/llm_manager.py +679 -0
  128. auto_use-0.1.0/Auto_Use/ios/llm_provider/openai/__init__.py +6 -0
  129. auto_use-0.1.0/Auto_Use/ios/llm_provider/openai/service.py +108 -0
  130. auto_use-0.1.0/Auto_Use/ios/llm_provider/openai/view.py +79 -0
  131. auto_use-0.1.0/Auto_Use/ios/llm_provider/openrouter/__init__.py +6 -0
  132. auto_use-0.1.0/Auto_Use/ios/llm_provider/openrouter/service.py +199 -0
  133. auto_use-0.1.0/Auto_Use/ios/llm_provider/openrouter/view.py +157 -0
  134. auto_use-0.1.0/Auto_Use/ios/llm_provider/perplexity/__init__.py +1 -0
  135. auto_use-0.1.0/Auto_Use/ios/llm_provider/perplexity/service.py +166 -0
  136. auto_use-0.1.0/Auto_Use/ios/llm_provider/perplexity/view.py +132 -0
  137. auto_use-0.1.0/Auto_Use/ios/llm_provider/together/__init__.py +6 -0
  138. auto_use-0.1.0/Auto_Use/ios/llm_provider/together/service.py +123 -0
  139. auto_use-0.1.0/Auto_Use/ios/llm_provider/together/view.py +40 -0
  140. auto_use-0.1.0/Auto_Use/ios/sandbox/__init__.py +12 -0
  141. auto_use-0.1.0/Auto_Use/ios/sandbox/service.py +397 -0
  142. auto_use-0.1.0/Auto_Use/ios/tree/__init__.py +6 -0
  143. auto_use-0.1.0/Auto_Use/ios/tree/element.py +804 -0
  144. auto_use-0.1.0/Auto_Use/ios_connector/__init__.py +5 -0
  145. auto_use-0.1.0/Auto_Use/ios_connector/build_paths.py +28 -0
  146. auto_use-0.1.0/Auto_Use/ios_connector/index.html +635 -0
  147. auto_use-0.1.0/Auto_Use/ios_connector/session.py +337 -0
  148. auto_use-0.1.0/Auto_Use/ios_connector/setup.py +976 -0
  149. auto_use-0.1.0/Auto_Use/ios_connector/setup_server.py +72 -0
  150. auto_use-0.1.0/Auto_Use/ios_connector/sim_session.py +855 -0
  151. auto_use-0.1.0/Auto_Use/linux/tree/element.py +2822 -0
  152. auto_use-0.1.0/Auto_Use/logo/logo.html +105 -0
  153. auto_use-0.1.0/Auto_Use/logo/logo.png +0 -0
  154. auto_use-0.1.0/Auto_Use/mac/__init__.py +1 -0
  155. auto_use-0.1.0/Auto_Use/mac/agent/__init__.py +7 -0
  156. auto_use-0.1.0/Auto_Use/mac/agent/coder/__init__.py +6 -0
  157. auto_use-0.1.0/Auto_Use/mac/agent/coder/__main__.py +152 -0
  158. auto_use-0.1.0/Auto_Use/mac/agent/coder/service.py +1019 -0
  159. auto_use-0.1.0/Auto_Use/mac/agent/coder/system_prompt.md +154 -0
  160. auto_use-0.1.0/Auto_Use/mac/agent/coder/view.py +421 -0
  161. auto_use-0.1.0/Auto_Use/mac/agent/main_driver/__init__.py +7 -0
  162. auto_use-0.1.0/Auto_Use/mac/agent/main_driver/fast_system_prompt.md +189 -0
  163. auto_use-0.1.0/Auto_Use/mac/agent/main_driver/service.py +1232 -0
  164. auto_use-0.1.0/Auto_Use/mac/agent/main_driver/system_prompt.md +229 -0
  165. auto_use-0.1.0/Auto_Use/mac/agent/main_driver/view.py +352 -0
  166. auto_use-0.1.0/Auto_Use/mac/agent/minions/__init__.py +13 -0
  167. auto_use-0.1.0/Auto_Use/mac/agent/minions/__main__.py +109 -0
  168. auto_use-0.1.0/Auto_Use/mac/agent/minions/service.py +507 -0
  169. auto_use-0.1.0/Auto_Use/mac/agent/minions/system_prompt.md +184 -0
  170. auto_use-0.1.0/Auto_Use/mac/agent/minions/view.py +127 -0
  171. auto_use-0.1.0/Auto_Use/mac/agent/skills/__init__.py +6 -0
  172. auto_use-0.1.0/Auto_Use/mac/agent/skills/service.py +228 -0
  173. auto_use-0.1.0/Auto_Use/mac/controller/__init__.py +11 -0
  174. auto_use-0.1.0/Auto_Use/mac/controller/cli/__init__.py +6 -0
  175. auto_use-0.1.0/Auto_Use/mac/controller/cli/service.py +1025 -0
  176. auto_use-0.1.0/Auto_Use/mac/controller/hotkey/__init__.py +6 -0
  177. auto_use-0.1.0/Auto_Use/mac/controller/hotkey/service.py +140 -0
  178. auto_use-0.1.0/Auto_Use/mac/controller/scratchpad/__init__.py +5 -0
  179. auto_use-0.1.0/Auto_Use/mac/controller/scratchpad/service.py +90 -0
  180. auto_use-0.1.0/Auto_Use/mac/controller/service.py +684 -0
  181. auto_use-0.1.0/Auto_Use/mac/controller/task_tracker/__init__.py +6 -0
  182. auto_use-0.1.0/Auto_Use/mac/controller/task_tracker/service.py +131 -0
  183. auto_use-0.1.0/Auto_Use/mac/controller/tool/__init__.py +8 -0
  184. auto_use-0.1.0/Auto_Use/mac/controller/tool/applescript.py +228 -0
  185. auto_use-0.1.0/Auto_Use/mac/controller/tool/open_app.py +264 -0
  186. auto_use-0.1.0/Auto_Use/mac/controller/tool/plan.py +182 -0
  187. auto_use-0.1.0/Auto_Use/mac/controller/tool/screenshot.py +98 -0
  188. auto_use-0.1.0/Auto_Use/mac/controller/tool/shell.py +116 -0
  189. auto_use-0.1.0/Auto_Use/mac/controller/tool/web/anthropic.py +53 -0
  190. auto_use-0.1.0/Auto_Use/mac/controller/tool/web/chatgpt.py +67 -0
  191. auto_use-0.1.0/Auto_Use/mac/controller/tool/web/google_search.py +60 -0
  192. auto_use-0.1.0/Auto_Use/mac/controller/tool/web/groq_search.py +54 -0
  193. auto_use-0.1.0/Auto_Use/mac/controller/tool/web/openrouter.py +66 -0
  194. auto_use-0.1.0/Auto_Use/mac/controller/tool/web/perplexity_search.py +60 -0
  195. auto_use-0.1.0/Auto_Use/mac/controller/tool/web/service.py +90 -0
  196. auto_use-0.1.0/Auto_Use/mac/controller/tool/web/web.md +24 -0
  197. auto_use-0.1.0/Auto_Use/mac/controller/tool/web/web_agent.py +201 -0
  198. auto_use-0.1.0/Auto_Use/mac/controller/view.py +1398 -0
  199. auto_use-0.1.0/Auto_Use/mac/llm_provider/__init__.py +19 -0
  200. auto_use-0.1.0/Auto_Use/mac/llm_provider/anthropic/__init__.py +6 -0
  201. auto_use-0.1.0/Auto_Use/mac/llm_provider/anthropic/service.py +273 -0
  202. auto_use-0.1.0/Auto_Use/mac/llm_provider/anthropic/view.py +108 -0
  203. auto_use-0.1.0/Auto_Use/mac/llm_provider/google/__init__.py +6 -0
  204. auto_use-0.1.0/Auto_Use/mac/llm_provider/google/service.py +286 -0
  205. auto_use-0.1.0/Auto_Use/mac/llm_provider/google/view.py +101 -0
  206. auto_use-0.1.0/Auto_Use/mac/llm_provider/groq/__init__.py +6 -0
  207. auto_use-0.1.0/Auto_Use/mac/llm_provider/groq/service.py +106 -0
  208. auto_use-0.1.0/Auto_Use/mac/llm_provider/groq/view.py +38 -0
  209. auto_use-0.1.0/Auto_Use/mac/llm_provider/llm_manager.py +1054 -0
  210. auto_use-0.1.0/Auto_Use/mac/llm_provider/openai/__init__.py +6 -0
  211. auto_use-0.1.0/Auto_Use/mac/llm_provider/openai/service.py +110 -0
  212. auto_use-0.1.0/Auto_Use/mac/llm_provider/openai/view.py +79 -0
  213. auto_use-0.1.0/Auto_Use/mac/llm_provider/openrouter/__init__.py +6 -0
  214. auto_use-0.1.0/Auto_Use/mac/llm_provider/openrouter/service.py +217 -0
  215. auto_use-0.1.0/Auto_Use/mac/llm_provider/openrouter/view.py +157 -0
  216. auto_use-0.1.0/Auto_Use/mac/llm_provider/perplexity/__init__.py +1 -0
  217. auto_use-0.1.0/Auto_Use/mac/llm_provider/perplexity/service.py +166 -0
  218. auto_use-0.1.0/Auto_Use/mac/llm_provider/perplexity/view.py +132 -0
  219. auto_use-0.1.0/Auto_Use/mac/llm_provider/together/__init__.py +6 -0
  220. auto_use-0.1.0/Auto_Use/mac/llm_provider/together/service.py +123 -0
  221. auto_use-0.1.0/Auto_Use/mac/llm_provider/together/view.py +40 -0
  222. auto_use-0.1.0/Auto_Use/mac/remote_connection/banner.py +2107 -0
  223. auto_use-0.1.0/Auto_Use/mac/remote_connection/telegram/service.py +1060 -0
  224. auto_use-0.1.0/Auto_Use/mac/remote_connection/telegram/setup.py +137 -0
  225. auto_use-0.1.0/Auto_Use/mac/remote_connection/telegram/telergam_animation.html +308 -0
  226. auto_use-0.1.0/Auto_Use/mac/remote_connection/telegram/view.py +140 -0
  227. auto_use-0.1.0/Auto_Use/mac/sandbox/__init__.py +12 -0
  228. auto_use-0.1.0/Auto_Use/mac/sandbox/service.py +397 -0
  229. auto_use-0.1.0/Auto_Use/mac/tree/__init__.py +6 -0
  230. auto_use-0.1.0/Auto_Use/mac/tree/element.py +2660 -0
  231. auto_use-0.1.0/Auto_Use/mac/tree/ocr.py +161 -0
  232. auto_use-0.1.0/Auto_Use/memory_compression/__init__.py +15 -0
  233. auto_use-0.1.0/Auto_Use/memory_compression/agent/__init__.py +5 -0
  234. auto_use-0.1.0/Auto_Use/memory_compression/agent/service.py +146 -0
  235. auto_use-0.1.0/Auto_Use/memory_compression/agent/system_prompt.md +104 -0
  236. auto_use-0.1.0/Auto_Use/memory_compression/controller.py +173 -0
  237. auto_use-0.1.0/Auto_Use/memory_compression/memory_tracker.py +68 -0
  238. auto_use-0.1.0/Auto_Use/vault/__init__.py +7 -0
  239. auto_use-0.1.0/Auto_Use/vault/service.py +159 -0
  240. auto_use-0.1.0/Auto_Use/web/Cargo.lock +1438 -0
  241. auto_use-0.1.0/Auto_Use/web/Cargo.toml +69 -0
  242. auto_use-0.1.0/Auto_Use/web/__init__.py +1 -0
  243. auto_use-0.1.0/Auto_Use/web/agent/__init__.py +120 -0
  244. auto_use-0.1.0/Auto_Use/web/agent/__main__.py +86 -0
  245. auto_use-0.1.0/Auto_Use/web/agent/main_driver/mod.rs +6 -0
  246. auto_use-0.1.0/Auto_Use/web/agent/main_driver/service.rs +1551 -0
  247. auto_use-0.1.0/Auto_Use/web/agent/main_driver/system_prompt.md +229 -0
  248. auto_use-0.1.0/Auto_Use/web/agent/main_driver/view.rs +787 -0
  249. auto_use-0.1.0/Auto_Use/web/browser/browser.rs +2757 -0
  250. auto_use-0.1.0/Auto_Use/web/browser/glow/glow.css +189 -0
  251. auto_use-0.1.0/Auto_Use/web/browser/glow/glow.html +78 -0
  252. auto_use-0.1.0/Auto_Use/web/browser/glow/glow.js +342 -0
  253. auto_use-0.1.0/Auto_Use/web/build.rs +7 -0
  254. auto_use-0.1.0/Auto_Use/web/controller/click/service.rs +148 -0
  255. auto_use-0.1.0/Auto_Use/web/controller/done/service.rs +30 -0
  256. auto_use-0.1.0/Auto_Use/web/controller/input/service.rs +126 -0
  257. auto_use-0.1.0/Auto_Use/web/controller/keyboard/service.rs +280 -0
  258. auto_use-0.1.0/Auto_Use/web/controller/mod.rs +48 -0
  259. auto_use-0.1.0/Auto_Use/web/controller/run_script/service.rs +282 -0
  260. auto_use-0.1.0/Auto_Use/web/controller/scratchpad/service.rs +58 -0
  261. auto_use-0.1.0/Auto_Use/web/controller/scroll/service.rs +190 -0
  262. auto_use-0.1.0/Auto_Use/web/controller/service.rs +249 -0
  263. auto_use-0.1.0/Auto_Use/web/controller/tab/service.rs +341 -0
  264. auto_use-0.1.0/Auto_Use/web/controller/todo_tracker/service.rs +75 -0
  265. auto_use-0.1.0/Auto_Use/web/controller/view.rs +356 -0
  266. auto_use-0.1.0/Auto_Use/web/controller/wait/service.rs +34 -0
  267. auto_use-0.1.0/Auto_Use/web/lib.rs +117 -0
  268. auto_use-0.1.0/Auto_Use/web/llm_provider/anthropic/service.rs +308 -0
  269. auto_use-0.1.0/Auto_Use/web/llm_provider/anthropic/view.rs +96 -0
  270. auto_use-0.1.0/Auto_Use/web/llm_provider/google/service.rs +410 -0
  271. auto_use-0.1.0/Auto_Use/web/llm_provider/google/view.rs +94 -0
  272. auto_use-0.1.0/Auto_Use/web/llm_provider/groq/service.rs +92 -0
  273. auto_use-0.1.0/Auto_Use/web/llm_provider/groq/view.rs +36 -0
  274. auto_use-0.1.0/Auto_Use/web/llm_provider/llm_manager.rs +1233 -0
  275. auto_use-0.1.0/Auto_Use/web/llm_provider/mod.rs +202 -0
  276. auto_use-0.1.0/Auto_Use/web/llm_provider/openai/service.rs +123 -0
  277. auto_use-0.1.0/Auto_Use/web/llm_provider/openai/view.rs +67 -0
  278. auto_use-0.1.0/Auto_Use/web/llm_provider/openrouter/service.rs +190 -0
  279. auto_use-0.1.0/Auto_Use/web/llm_provider/openrouter/view.rs +134 -0
  280. auto_use-0.1.0/Auto_Use/web/llm_provider/perplexity/service.rs +201 -0
  281. auto_use-0.1.0/Auto_Use/web/llm_provider/perplexity/view.rs +106 -0
  282. auto_use-0.1.0/Auto_Use/web/llm_provider/together/service.rs +116 -0
  283. auto_use-0.1.0/Auto_Use/web/llm_provider/together/view.rs +46 -0
  284. auto_use-0.1.0/Auto_Use/web/tree/element.config.json +80 -0
  285. auto_use-0.1.0/Auto_Use/web/tree/element.rs +1934 -0
  286. auto_use-0.1.0/Auto_Use/windows/agent/Planner/system_prompt.md +1 -0
  287. auto_use-0.1.0/Auto_Use/windows/agent/__init__.py +6 -0
  288. auto_use-0.1.0/Auto_Use/windows/agent/automation_engineer/system_prompt.md +1 -0
  289. auto_use-0.1.0/Auto_Use/windows/agent/coder/__init__.py +6 -0
  290. auto_use-0.1.0/Auto_Use/windows/agent/coder/__main__.py +153 -0
  291. auto_use-0.1.0/Auto_Use/windows/agent/coder/service.py +1025 -0
  292. auto_use-0.1.0/Auto_Use/windows/agent/coder/system_prompt.md +155 -0
  293. auto_use-0.1.0/Auto_Use/windows/agent/coder/view.py +589 -0
  294. auto_use-0.1.0/Auto_Use/windows/agent/main_driver/__init__.py +7 -0
  295. auto_use-0.1.0/Auto_Use/windows/agent/main_driver/fast_system_prompt.md +178 -0
  296. auto_use-0.1.0/Auto_Use/windows/agent/main_driver/service.py +1193 -0
  297. auto_use-0.1.0/Auto_Use/windows/agent/main_driver/system_prompt.md +226 -0
  298. auto_use-0.1.0/Auto_Use/windows/agent/main_driver/view.py +352 -0
  299. auto_use-0.1.0/Auto_Use/windows/agent/minions/__init__.py +13 -0
  300. auto_use-0.1.0/Auto_Use/windows/agent/minions/__main__.py +134 -0
  301. auto_use-0.1.0/Auto_Use/windows/agent/minions/service.py +519 -0
  302. auto_use-0.1.0/Auto_Use/windows/agent/minions/system_prompt.md +184 -0
  303. auto_use-0.1.0/Auto_Use/windows/agent/minions/view.py +127 -0
  304. auto_use-0.1.0/Auto_Use/windows/agent/skills/__init__.py +6 -0
  305. auto_use-0.1.0/Auto_Use/windows/agent/skills/service.py +209 -0
  306. auto_use-0.1.0/Auto_Use/windows/controller/__init__.py +9 -0
  307. auto_use-0.1.0/Auto_Use/windows/controller/cli/__init__.py +6 -0
  308. auto_use-0.1.0/Auto_Use/windows/controller/cli/service.py +817 -0
  309. auto_use-0.1.0/Auto_Use/windows/controller/hotkey/__init__.py +6 -0
  310. auto_use-0.1.0/Auto_Use/windows/controller/hotkey/service.py +184 -0
  311. auto_use-0.1.0/Auto_Use/windows/controller/scratchpad/__init__.py +5 -0
  312. auto_use-0.1.0/Auto_Use/windows/controller/scratchpad/service.py +90 -0
  313. auto_use-0.1.0/Auto_Use/windows/controller/service.py +1148 -0
  314. auto_use-0.1.0/Auto_Use/windows/controller/task_tracker/__init__.py +6 -0
  315. auto_use-0.1.0/Auto_Use/windows/controller/task_tracker/service.py +131 -0
  316. auto_use-0.1.0/Auto_Use/windows/controller/tool/__init__.py +7 -0
  317. auto_use-0.1.0/Auto_Use/windows/controller/tool/interception_toggle.ps1 +143 -0
  318. auto_use-0.1.0/Auto_Use/windows/controller/tool/kernel_input.py +315 -0
  319. auto_use-0.1.0/Auto_Use/windows/controller/tool/open_app.py +411 -0
  320. auto_use-0.1.0/Auto_Use/windows/controller/tool/plan.py +182 -0
  321. auto_use-0.1.0/Auto_Use/windows/controller/tool/screenshot.py +364 -0
  322. auto_use-0.1.0/Auto_Use/windows/controller/tool/shell.py +117 -0
  323. auto_use-0.1.0/Auto_Use/windows/controller/tool/web/anthropic.py +53 -0
  324. auto_use-0.1.0/Auto_Use/windows/controller/tool/web/chatgpt.py +67 -0
  325. auto_use-0.1.0/Auto_Use/windows/controller/tool/web/google_search.py +60 -0
  326. auto_use-0.1.0/Auto_Use/windows/controller/tool/web/groq_search.py +54 -0
  327. auto_use-0.1.0/Auto_Use/windows/controller/tool/web/openrouter.py +66 -0
  328. auto_use-0.1.0/Auto_Use/windows/controller/tool/web/perplexity_search.py +61 -0
  329. auto_use-0.1.0/Auto_Use/windows/controller/tool/web/service.py +90 -0
  330. auto_use-0.1.0/Auto_Use/windows/controller/tool/web/web.md +24 -0
  331. auto_use-0.1.0/Auto_Use/windows/controller/tool/web/web_agent.py +201 -0
  332. auto_use-0.1.0/Auto_Use/windows/controller/view.py +1330 -0
  333. auto_use-0.1.0/Auto_Use/windows/llm_provider/__init__.py +19 -0
  334. auto_use-0.1.0/Auto_Use/windows/llm_provider/anthropic/__init__.py +6 -0
  335. auto_use-0.1.0/Auto_Use/windows/llm_provider/anthropic/service.py +270 -0
  336. auto_use-0.1.0/Auto_Use/windows/llm_provider/anthropic/view.py +108 -0
  337. auto_use-0.1.0/Auto_Use/windows/llm_provider/google/__init__.py +6 -0
  338. auto_use-0.1.0/Auto_Use/windows/llm_provider/google/service.py +283 -0
  339. auto_use-0.1.0/Auto_Use/windows/llm_provider/google/view.py +101 -0
  340. auto_use-0.1.0/Auto_Use/windows/llm_provider/groq/__init__.py +6 -0
  341. auto_use-0.1.0/Auto_Use/windows/llm_provider/groq/service.py +107 -0
  342. auto_use-0.1.0/Auto_Use/windows/llm_provider/groq/view.py +38 -0
  343. auto_use-0.1.0/Auto_Use/windows/llm_provider/llm_manager.py +1112 -0
  344. auto_use-0.1.0/Auto_Use/windows/llm_provider/openai/__init__.py +6 -0
  345. auto_use-0.1.0/Auto_Use/windows/llm_provider/openai/service.py +110 -0
  346. auto_use-0.1.0/Auto_Use/windows/llm_provider/openai/view.py +79 -0
  347. auto_use-0.1.0/Auto_Use/windows/llm_provider/openrouter/__init__.py +6 -0
  348. auto_use-0.1.0/Auto_Use/windows/llm_provider/openrouter/service.py +218 -0
  349. auto_use-0.1.0/Auto_Use/windows/llm_provider/openrouter/view.py +157 -0
  350. auto_use-0.1.0/Auto_Use/windows/llm_provider/perplexity/__init__.py +1 -0
  351. auto_use-0.1.0/Auto_Use/windows/llm_provider/perplexity/service.py +165 -0
  352. auto_use-0.1.0/Auto_Use/windows/llm_provider/perplexity/view.py +132 -0
  353. auto_use-0.1.0/Auto_Use/windows/llm_provider/together/__init__.py +6 -0
  354. auto_use-0.1.0/Auto_Use/windows/llm_provider/together/service.py +123 -0
  355. auto_use-0.1.0/Auto_Use/windows/llm_provider/together/view.py +40 -0
  356. auto_use-0.1.0/Auto_Use/windows/remote_connection/banner.py +2417 -0
  357. auto_use-0.1.0/Auto_Use/windows/remote_connection/discord/service.py +3 -0
  358. auto_use-0.1.0/Auto_Use/windows/remote_connection/telegram/__init__.py +1 -0
  359. auto_use-0.1.0/Auto_Use/windows/remote_connection/telegram/service.py +1125 -0
  360. auto_use-0.1.0/Auto_Use/windows/remote_connection/telegram/setup.py +186 -0
  361. auto_use-0.1.0/Auto_Use/windows/remote_connection/telegram/telergam_animation.html +308 -0
  362. auto_use-0.1.0/Auto_Use/windows/remote_connection/telegram/view.py +140 -0
  363. auto_use-0.1.0/Auto_Use/windows/remote_connection/whatsapp/service.py +3 -0
  364. auto_use-0.1.0/Auto_Use/windows/sandbox/__init__.py +12 -0
  365. auto_use-0.1.0/Auto_Use/windows/sandbox/service.py +436 -0
  366. auto_use-0.1.0/Auto_Use/windows/tree/__init__.py +6 -0
  367. auto_use-0.1.0/Auto_Use/windows/tree/element.py +3405 -0
  368. auto_use-0.1.0/Auto_Use/windows/tree/ocr_detection.py +85 -0
  369. auto_use-0.1.0/LICENSE +21 -0
  370. auto_use-0.1.0/PKG-INFO +814 -0
  371. auto_use-0.1.0/README.md +757 -0
  372. auto_use-0.1.0/THIRD_PARTY_NOTICES.md +101 -0
  373. auto_use-0.1.0/pyproject.toml +113 -0
@@ -0,0 +1,315 @@
1
+ # Copyright 2026 Cursortouch — Auto-Use
2
+
3
+ """Auto Use package root — and the single source of truth for WHERE the user's
4
+ data lives.
5
+
6
+ User data must NOT sit inside the install folder: the Windows installer
7
+ uninstalls with `[UninstallDelete] Type: filesandordirs; Name: "{app}"`, i.e. it
8
+ deletes the WHOLE install directory, so anything written next to AutoUse.exe
9
+ (chats, API keys) died with the uninstall. Everything the user creates goes in
10
+ one folder no installer owns:
11
+
12
+ <base>/autouse_data/
13
+ agent_conversation/ chats: index.json, settings.json, chat_*/
14
+ api_key/api_key.txt provider keys + Telegram token + Vertex config
15
+
16
+ base = Path.home() packaged build -> C:/Users/<u>/autouse_data
17
+ -> /Users/<u>/autouse_data on macOS
18
+ base = <repo root> `python main.py` -> <repo>/autouse_data
19
+ base = cwd pip install -> <where you ran main.py>/autouse_data
20
+ (created the first time anything
21
+ asks for it)
22
+
23
+ This lives in the package root rather than in any one sub-package because six
24
+ modules across windows, mac and ios need the same answer, and two
25
+ definitions of "where is autouse_data" that drift apart would silently put user
26
+ data back inside the install folder — the exact bug this exists to fix.
27
+
28
+ RULES for the code below:
29
+ * stdlib ONLY, and no filesystem side effects at import time. Every
30
+ `import Auto_Use.anything` executes this module first.
31
+ * NEVER print(). AutoUse re-execs itself as --banner-mode, which speaks a
32
+ JSON-per-line protocol on stdout, and sys.stdout can be None at import time
33
+ in the Windows GUI-subsystem binary. Log to `logger` (stderr) instead.
34
+ * Never use the builtin open() on a path under autouse_data: compiled builds
35
+ monkey-patch builtins.open to resolve embedded resources by path suffix
36
+ (frontend/service.py setup_embedded_resources), and a matching write is
37
+ silently swallowed into a StringIO. Use Path.read_bytes / write_bytes /
38
+ os.replace here.
39
+ """
40
+
41
+ import os
42
+ import sys
43
+ import logging
44
+ import threading
45
+ from pathlib import Path
46
+
47
+ logger = logging.getLogger("autouse.paths")
48
+
49
+ DATA_DIR_NAME = "autouse_data"
50
+
51
+ # Absolute-path override; wins over the rules below. The --cli-mode /
52
+ # --minion-mode / --banner-mode children are spawned with os.environ.copy(), so
53
+ # they inherit it and parent + children can never disagree on the data root.
54
+ ENV_DATA_DIR = "AUTOUSE_DATA_DIR"
55
+
56
+ # Compiled (Nuitka) binary vs dev run — mirrors the detection in app.py.
57
+ IS_COMPILED = bool(getattr(sys, "frozen", False)) or ("__compiled__" in globals())
58
+
59
+ # <repo>/Auto_Use/__init__.py -> <repo>. __file__-based, NEVER cwd-based: the
60
+ # cli / minion children are spawned as `python -m ...` with no explicit cwd.
61
+ _REPO_ROOT = Path(__file__).resolve().parent.parent
62
+
63
+
64
+ def _home_dir() -> Path:
65
+ """The user's home. Path.home() honours USERPROFILE on Windows."""
66
+ try:
67
+ return Path.home()
68
+ except Exception:
69
+ return Path(os.path.expanduser("~"))
70
+
71
+
72
+ def _base_dir() -> Path:
73
+ """Parent folder that holds autouse_data/ (not created here)."""
74
+ if IS_COMPILED:
75
+ return _home_dir()
76
+ # Dev = the checkout this file lives in (main.py beside the package).
77
+ if (_REPO_ROOT / "main.py").is_file():
78
+ return _REPO_ROOT
79
+ # pip install: the package sits in site-packages, so the data goes next to
80
+ # whatever main.py the user ran — the working directory. data_root()
81
+ # creates the folder the first time it is asked for.
82
+ return Path.cwd()
83
+
84
+
85
+ def _ensure(p: Path) -> Path:
86
+ """mkdir -p, best effort. Callers already guard their own reads and writes,
87
+ so a read-only or full disk degrades to 'no data' rather than crashing the
88
+ GUI on startup."""
89
+ try:
90
+ p.mkdir(parents=True, exist_ok=True)
91
+ except Exception:
92
+ logger.exception("mkdir %s", p)
93
+ return p
94
+
95
+
96
+ def data_root() -> Path:
97
+ """<home>/autouse_data (packaged) or <repo>/autouse_data (dev)."""
98
+ # A blank/whitespace override must read as UNSET: Path("") resolves to ".",
99
+ # and callers rmtree/overwrite paths under this root.
100
+ override = (os.environ.get(ENV_DATA_DIR) or "").strip()
101
+ root = Path(override).expanduser() if override else _base_dir() / DATA_DIR_NAME
102
+ if not override:
103
+ # Pin it for every child (cli / minion / parallel tasks are spawned
104
+ # with os.environ.copy()), so a child started with another cwd can
105
+ # never end up with its own autouse_data.
106
+ os.environ[ENV_DATA_DIR] = str(root.resolve())
107
+ return _ensure(root)
108
+
109
+
110
+ BROWSER_PROFILES_DIR = "browser_profiles"
111
+ DEFAULT_BROWSER_PROFILE = "default"
112
+
113
+
114
+ def normalize_profile_name(name) -> str:
115
+ """A browser profile name, or ValueError.
116
+
117
+ The name becomes a path segment under `data_root()`, which is a tree this
118
+ codebase deletes from — so this REJECTS rather than sanitizes. Quietly
119
+ mapping "../../etc" to "etc" would be worse than an error: it would delete
120
+ or overwrite something the caller never named.
121
+ """
122
+ text = str(name or "").strip().lower()
123
+ if not text:
124
+ return DEFAULT_BROWSER_PROFILE
125
+ if len(text) > 64 or text.startswith("."):
126
+ raise ValueError(f"browser profile name {text!r} must be 1-64 chars and not start with '.'")
127
+ if any(c not in "abcdefghijklmnopqrstuvwxyz0123456789._-" for c in text):
128
+ raise ValueError(
129
+ f"browser profile name {text!r} may only contain letters, digits, '.', '_' and '-'"
130
+ )
131
+ if text in ("_tmp", ".", ".."):
132
+ raise ValueError(f"browser profile name {text!r} is reserved")
133
+ return text
134
+
135
+
136
+ def browser_profile_dir(name=None) -> Path:
137
+ """The Chrome user-data-dir for a named browser profile, created if absent.
138
+
139
+ <data_root>/browser_profiles/<name>/chrome
140
+
141
+ Chrome owns and litters its user-data-dir, so it is nested one level down:
142
+ that leaves room beside it for our own files, and makes "reset this
143
+ profile" a delete of `chrome/` rather than of the profile's identity.
144
+
145
+ This is what makes the agent arrive already logged in. Cookies,
146
+ localStorage and IndexedDB live in here and survive between runs, so a site
147
+ the agent signed into once does not have to be signed into again — which
148
+ matters far more than any fingerprint tuning, because a login wall is where
149
+ a web agent usually stops.
150
+ """
151
+ root = data_root() / BROWSER_PROFILES_DIR / normalize_profile_name(name)
152
+ _ensure(root)
153
+ return _ensure(root / "chrome")
154
+
155
+
156
+ def install_dir() -> Path:
157
+ """Where the app's own code sits — the folder the uninstaller deletes. Used
158
+ only to find data left behind by a pre-autouse_data build."""
159
+ return Path(sys.executable).resolve().parent if IS_COMPILED else _REPO_ROOT
160
+
161
+
162
+ # =============================================================================
163
+ # skills — the .md knowledge files
164
+ # =============================================================================
165
+ # Two folders, same layout (skills.json + *.md), read together by every
166
+ # DomainKnowledgeService:
167
+ # Auto_Use/default_skills/<windows|mac|ios>/ the defaults shipped with the
168
+ # package (read-only, tracked)
169
+ # autouse_data/skills/<windows|mac|ios>/ the user's own skills, added
170
+ # from the UI or by hand
171
+ # Nothing is ever copied from one to the other. A name is loaded once: the
172
+ # default first, then the user folder; a file missing from both is ignored.
173
+ # NOTE: `plat` IS the package name (Auto_Use/{mac,windows,ios}), so no map.
174
+
175
+ DEFAULT_SKILLS_DIR = "default_skills"
176
+
177
+
178
+ def skills_platform(value=None) -> str:
179
+ """'windows' | 'mac' | 'ios'. Accepts sys.platform or a package name.
180
+ iOS is driven from a Mac, so it is never the host default - only an
181
+ explicit "ios" selects its folder."""
182
+ key = str(sys.platform if value is None else value).lower()
183
+ if key == "ios":
184
+ return "ios"
185
+ return "mac" if ("darwin" in key or "mac" in key) else "windows"
186
+
187
+
188
+ def _skills_from_dir(src: Path) -> dict:
189
+ out = {}
190
+ if src.is_dir():
191
+ for p in sorted(src.iterdir()):
192
+ if p.is_file() and (p.suffix.lower() == ".md" or p.name == "skills.json"):
193
+ try:
194
+ out[p.name] = p.read_text(encoding="utf-8")
195
+ except Exception:
196
+ logger.warning("unreadable default skill %s", p)
197
+ return out
198
+
199
+
200
+ def _skills_from_resources(prefix: str) -> dict:
201
+ """Pull skill files out of the binary's embedded-resource blobs. Keys are
202
+ repo-root-relative with forward slashes, e.g.
203
+ 'Auto_Use/default_skills/windows/browser.md'."""
204
+ out = {}
205
+ try:
206
+ import base64
207
+ from _embedded_resources import RESOURCES # generated by the binary build
208
+ except Exception:
209
+ return out
210
+ for key, blob in RESOURCES.items():
211
+ k = str(key).replace("\\", "/")
212
+ i = k.find(prefix)
213
+ name = k[i + len(prefix):] if i >= 0 else ""
214
+ if name and "/" not in name and (name.endswith(".md") or name == "skills.json"):
215
+ try:
216
+ out[name] = base64.b64decode(blob).decode("utf-8")
217
+ except Exception:
218
+ logger.warning("undecodable embedded skill %s", key)
219
+ return out
220
+
221
+
222
+ def default_skills_dir(platform=None) -> Path:
223
+ """Auto_Use/default_skills/<windows|mac|ios> — the shipped defaults.
224
+ Read-only; may not exist on disk in a compiled build (see default_skills)."""
225
+ return Path(__file__).resolve().parent / DEFAULT_SKILLS_DIR / skills_platform(platform)
226
+
227
+
228
+ def default_skills(platform=None) -> dict:
229
+ """{filename: text} of the shipped default skills for the platform
230
+ (skills.json + *.md). In a compiled build they arrive as embedded blobs;
231
+ otherwise they are read straight off the package directory."""
232
+ plat = skills_platform(platform)
233
+ return (_skills_from_resources("Auto_Use/%s/%s/" % (DEFAULT_SKILLS_DIR, plat))
234
+ or _skills_from_dir(default_skills_dir(plat)))
235
+
236
+
237
+ def skills_dir(platform=None) -> Path:
238
+ """autouse_data/skills/<windows|mac|ios> — the user's own skills, created
239
+ empty on first use. The defaults are never copied here."""
240
+ return _ensure(data_root() / "skills" / skills_platform(platform))
241
+
242
+
243
+ def vault_file() -> Path:
244
+ """autouse_data/vault/credentials.json — the app's saved credentials.
245
+
246
+ Created empty ({}) if absent, so the folder is discoverable and the user has
247
+ an obvious file to fill in. Lives outside the install folder like everything
248
+ else here, so an uninstall can't take the credentials with it."""
249
+ p = _ensure(data_root() / "vault") / "credentials.json"
250
+ if not p.exists():
251
+ try:
252
+ # write_text -> io.open, so the compiled build's builtins.open patch
253
+ # can't swallow the write into a throwaway buffer.
254
+ p.write_text("{}", encoding="utf-8")
255
+ except Exception:
256
+ logger.exception("create %s", p)
257
+ return p
258
+
259
+
260
+ # =============================================================================
261
+ # api_key.txt — provider keys, the Telegram bot token, and Vertex config
262
+ # =============================================================================
263
+ # Every consumer must agree on this ONE path, or the Settings panel writes a key
264
+ # the agent can't read. Before this moved there were three different answers in
265
+ # the tree: frontend/service.py and windows/llm_provider walked up to
266
+ # Auto_Use/api_key/ (right), while mac and ios llm_provider stopped one
267
+ # level short at <pkg>/api_key/ (a folder that never existed, so Vertex config
268
+ # silently read back empty on those platforms). One function, one answer.
269
+ _api_key_migrated = False
270
+ _api_key_lock = threading.Lock()
271
+
272
+
273
+ def api_key_file() -> Path:
274
+ """autouse_data/api_key/api_key.txt, migrating a pre-autouse_data copy on
275
+ the first call in each process. Idempotent and never raises."""
276
+ path = _ensure(data_root() / "api_key") / "api_key.txt"
277
+ _migrate_legacy_api_key(path)
278
+ return path
279
+
280
+
281
+ def _migrate_legacy_api_key(dest: Path) -> None:
282
+ """Move Auto_Use/api_key/api_key.txt out of the install folder, once.
283
+
284
+ Crash-safe by construction: the copy is staged as '<dest>.part' and renamed
285
+ into place (atomic within the folder), and the legacy file is unlinked only
286
+ after the rename succeeds. Skip-if-destination-exists makes a re-run a no-op
287
+ and means the newer file always wins, so a downgrade/upgrade round trip can
288
+ never overwrite live keys with stale ones."""
289
+ global _api_key_migrated
290
+ if _api_key_migrated or dest.exists():
291
+ return
292
+ with _api_key_lock:
293
+ if _api_key_migrated or dest.exists():
294
+ return
295
+ try:
296
+ legacy = install_dir() / "Auto_Use" / "api_key" / "api_key.txt"
297
+ if not legacy.is_file() or legacy.resolve() == dest.resolve():
298
+ return
299
+ # Path.read_bytes/write_bytes go through io.open, which the compiled
300
+ # build's builtins.open patch does NOT replace.
301
+ part = dest.with_name(dest.name + ".part")
302
+ part.write_bytes(legacy.read_bytes())
303
+ os.replace(str(part), str(dest))
304
+ try:
305
+ legacy.unlink()
306
+ legacy.parent.rmdir() # only succeeds if now empty
307
+ except OSError:
308
+ pass
309
+ logger.info("migrated api_key.txt: %s -> %s", legacy, dest)
310
+ except Exception:
311
+ logger.exception("migrate legacy api_key.txt")
312
+ finally:
313
+ # Set even on failure so we don't re-scan on every call; the next
314
+ # app start retries from scratch.
315
+ _api_key_migrated = True
@@ -0,0 +1,14 @@
1
+ # Copyright 2026 Cursortouch — Auto-Use
2
+
3
+ """Permanent (resumable) chat memory for the UI path.
4
+
5
+ All conversation-memory management lives in this package — saving, loading and
6
+ optimizing a session's conversation, and the on-disk session folders + index.
7
+ The agent stays a thin one-shot loop; app.py talks ONLY to ConversationService
8
+ (load a session -> trigger the main agent -> save the run). main.py / cli.py
9
+ never import this package, so they remain direct one-shot entry points.
10
+ """
11
+
12
+ from .service import ConversationService, conversation
13
+
14
+ __all__ = ["ConversationService", "conversation"]