codex-autorunner 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 (222) hide show
  1. codex_autorunner-0.1.0/LICENSE +21 -0
  2. codex_autorunner-0.1.0/PKG-INFO +240 -0
  3. codex_autorunner-0.1.0/README.md +179 -0
  4. codex_autorunner-0.1.0/pyproject.toml +105 -0
  5. codex_autorunner-0.1.0/setup.cfg +4 -0
  6. codex_autorunner-0.1.0/src/codex_autorunner/__init__.py +3 -0
  7. codex_autorunner-0.1.0/src/codex_autorunner/bootstrap.py +151 -0
  8. codex_autorunner-0.1.0/src/codex_autorunner/cli.py +886 -0
  9. codex_autorunner-0.1.0/src/codex_autorunner/codex_cli.py +79 -0
  10. codex_autorunner-0.1.0/src/codex_autorunner/codex_runner.py +17 -0
  11. codex_autorunner-0.1.0/src/codex_autorunner/core/__init__.py +1 -0
  12. codex_autorunner-0.1.0/src/codex_autorunner/core/about_car.py +125 -0
  13. codex_autorunner-0.1.0/src/codex_autorunner/core/codex_runner.py +100 -0
  14. codex_autorunner-0.1.0/src/codex_autorunner/core/config.py +1465 -0
  15. codex_autorunner-0.1.0/src/codex_autorunner/core/doc_chat.py +547 -0
  16. codex_autorunner-0.1.0/src/codex_autorunner/core/docs.py +37 -0
  17. codex_autorunner-0.1.0/src/codex_autorunner/core/engine.py +720 -0
  18. codex_autorunner-0.1.0/src/codex_autorunner/core/git_utils.py +206 -0
  19. codex_autorunner-0.1.0/src/codex_autorunner/core/hub.py +756 -0
  20. codex_autorunner-0.1.0/src/codex_autorunner/core/injected_context.py +9 -0
  21. codex_autorunner-0.1.0/src/codex_autorunner/core/locks.py +57 -0
  22. codex_autorunner-0.1.0/src/codex_autorunner/core/logging_utils.py +158 -0
  23. codex_autorunner-0.1.0/src/codex_autorunner/core/notifications.py +465 -0
  24. codex_autorunner-0.1.0/src/codex_autorunner/core/optional_dependencies.py +41 -0
  25. codex_autorunner-0.1.0/src/codex_autorunner/core/prompt.py +107 -0
  26. codex_autorunner-0.1.0/src/codex_autorunner/core/prompts.py +275 -0
  27. codex_autorunner-0.1.0/src/codex_autorunner/core/request_context.py +21 -0
  28. codex_autorunner-0.1.0/src/codex_autorunner/core/runner_controller.py +116 -0
  29. codex_autorunner-0.1.0/src/codex_autorunner/core/runner_process.py +29 -0
  30. codex_autorunner-0.1.0/src/codex_autorunner/core/snapshot.py +576 -0
  31. codex_autorunner-0.1.0/src/codex_autorunner/core/state.py +156 -0
  32. codex_autorunner-0.1.0/src/codex_autorunner/core/update.py +567 -0
  33. codex_autorunner-0.1.0/src/codex_autorunner/core/update_runner.py +44 -0
  34. codex_autorunner-0.1.0/src/codex_autorunner/core/usage.py +1221 -0
  35. codex_autorunner-0.1.0/src/codex_autorunner/core/utils.py +108 -0
  36. codex_autorunner-0.1.0/src/codex_autorunner/discovery.py +102 -0
  37. codex_autorunner-0.1.0/src/codex_autorunner/housekeeping.py +423 -0
  38. codex_autorunner-0.1.0/src/codex_autorunner/integrations/__init__.py +1 -0
  39. codex_autorunner-0.1.0/src/codex_autorunner/integrations/app_server/__init__.py +6 -0
  40. codex_autorunner-0.1.0/src/codex_autorunner/integrations/app_server/client.py +1386 -0
  41. codex_autorunner-0.1.0/src/codex_autorunner/integrations/app_server/supervisor.py +206 -0
  42. codex_autorunner-0.1.0/src/codex_autorunner/integrations/github/__init__.py +10 -0
  43. codex_autorunner-0.1.0/src/codex_autorunner/integrations/github/service.py +889 -0
  44. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/__init__.py +1 -0
  45. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/adapter.py +1401 -0
  46. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/commands_registry.py +104 -0
  47. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/config.py +450 -0
  48. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/constants.py +154 -0
  49. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/dispatch.py +162 -0
  50. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/handlers/__init__.py +0 -0
  51. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/handlers/approvals.py +241 -0
  52. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/handlers/callbacks.py +72 -0
  53. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/handlers/commands.py +160 -0
  54. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/handlers/commands_runtime.py +5262 -0
  55. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/handlers/messages.py +477 -0
  56. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/handlers/selections.py +545 -0
  57. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/helpers.py +2084 -0
  58. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/notifications.py +164 -0
  59. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/outbox.py +174 -0
  60. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/rendering.py +102 -0
  61. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/retry.py +37 -0
  62. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/runtime.py +270 -0
  63. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/service.py +921 -0
  64. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/state.py +1223 -0
  65. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/transport.py +318 -0
  66. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/types.py +57 -0
  67. codex_autorunner-0.1.0/src/codex_autorunner/integrations/telegram/voice.py +413 -0
  68. codex_autorunner-0.1.0/src/codex_autorunner/manifest.py +150 -0
  69. codex_autorunner-0.1.0/src/codex_autorunner/routes/__init__.py +53 -0
  70. codex_autorunner-0.1.0/src/codex_autorunner/routes/base.py +470 -0
  71. codex_autorunner-0.1.0/src/codex_autorunner/routes/docs.py +275 -0
  72. codex_autorunner-0.1.0/src/codex_autorunner/routes/github.py +197 -0
  73. codex_autorunner-0.1.0/src/codex_autorunner/routes/repos.py +121 -0
  74. codex_autorunner-0.1.0/src/codex_autorunner/routes/sessions.py +137 -0
  75. codex_autorunner-0.1.0/src/codex_autorunner/routes/shared.py +137 -0
  76. codex_autorunner-0.1.0/src/codex_autorunner/routes/system.py +175 -0
  77. codex_autorunner-0.1.0/src/codex_autorunner/routes/terminal_images.py +107 -0
  78. codex_autorunner-0.1.0/src/codex_autorunner/routes/voice.py +128 -0
  79. codex_autorunner-0.1.0/src/codex_autorunner/server.py +23 -0
  80. codex_autorunner-0.1.0/src/codex_autorunner/spec_ingest.py +113 -0
  81. codex_autorunner-0.1.0/src/codex_autorunner/static/app.js +95 -0
  82. codex_autorunner-0.1.0/src/codex_autorunner/static/autoRefresh.js +209 -0
  83. codex_autorunner-0.1.0/src/codex_autorunner/static/bootstrap.js +105 -0
  84. codex_autorunner-0.1.0/src/codex_autorunner/static/bus.js +23 -0
  85. codex_autorunner-0.1.0/src/codex_autorunner/static/cache.js +52 -0
  86. codex_autorunner-0.1.0/src/codex_autorunner/static/constants.js +48 -0
  87. codex_autorunner-0.1.0/src/codex_autorunner/static/dashboard.js +795 -0
  88. codex_autorunner-0.1.0/src/codex_autorunner/static/docs.js +1514 -0
  89. codex_autorunner-0.1.0/src/codex_autorunner/static/env.js +99 -0
  90. codex_autorunner-0.1.0/src/codex_autorunner/static/github.js +168 -0
  91. codex_autorunner-0.1.0/src/codex_autorunner/static/hub.js +1511 -0
  92. codex_autorunner-0.1.0/src/codex_autorunner/static/index.html +622 -0
  93. codex_autorunner-0.1.0/src/codex_autorunner/static/loader.js +28 -0
  94. codex_autorunner-0.1.0/src/codex_autorunner/static/logs.js +690 -0
  95. codex_autorunner-0.1.0/src/codex_autorunner/static/mobileCompact.js +300 -0
  96. codex_autorunner-0.1.0/src/codex_autorunner/static/snapshot.js +116 -0
  97. codex_autorunner-0.1.0/src/codex_autorunner/static/state.js +87 -0
  98. codex_autorunner-0.1.0/src/codex_autorunner/static/styles.css +4966 -0
  99. codex_autorunner-0.1.0/src/codex_autorunner/static/tabs.js +50 -0
  100. codex_autorunner-0.1.0/src/codex_autorunner/static/terminal.js +21 -0
  101. codex_autorunner-0.1.0/src/codex_autorunner/static/terminalManager.js +3535 -0
  102. codex_autorunner-0.1.0/src/codex_autorunner/static/todoPreview.js +25 -0
  103. codex_autorunner-0.1.0/src/codex_autorunner/static/types.d.ts +8 -0
  104. codex_autorunner-0.1.0/src/codex_autorunner/static/utils.js +597 -0
  105. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/LICENSE.xterm +24 -0
  106. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-400-cyrillic-ext.woff2 +0 -0
  107. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-400-cyrillic.woff2 +0 -0
  108. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-400-greek.woff2 +0 -0
  109. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-400-latin-ext.woff2 +0 -0
  110. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-400-latin.woff2 +0 -0
  111. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-400-vietnamese.woff2 +0 -0
  112. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-500-cyrillic-ext.woff2 +0 -0
  113. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-500-cyrillic.woff2 +0 -0
  114. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-500-greek.woff2 +0 -0
  115. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-500-latin-ext.woff2 +0 -0
  116. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-500-latin.woff2 +0 -0
  117. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-500-vietnamese.woff2 +0 -0
  118. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-600-cyrillic-ext.woff2 +0 -0
  119. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-600-cyrillic.woff2 +0 -0
  120. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-600-greek.woff2 +0 -0
  121. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-600-latin-ext.woff2 +0 -0
  122. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-600-latin.woff2 +0 -0
  123. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/JetBrainsMono-600-vietnamese.woff2 +0 -0
  124. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/fonts/jetbrains-mono/OFL.txt +93 -0
  125. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/xterm-addon-fit.js +2 -0
  126. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/xterm.css +209 -0
  127. codex_autorunner-0.1.0/src/codex_autorunner/static/vendor/xterm.js +2 -0
  128. codex_autorunner-0.1.0/src/codex_autorunner/static/voice.js +591 -0
  129. codex_autorunner-0.1.0/src/codex_autorunner/voice/__init__.py +39 -0
  130. codex_autorunner-0.1.0/src/codex_autorunner/voice/capture.py +349 -0
  131. codex_autorunner-0.1.0/src/codex_autorunner/voice/config.py +167 -0
  132. codex_autorunner-0.1.0/src/codex_autorunner/voice/provider.py +66 -0
  133. codex_autorunner-0.1.0/src/codex_autorunner/voice/providers/__init__.py +7 -0
  134. codex_autorunner-0.1.0/src/codex_autorunner/voice/providers/openai_whisper.py +345 -0
  135. codex_autorunner-0.1.0/src/codex_autorunner/voice/resolver.py +36 -0
  136. codex_autorunner-0.1.0/src/codex_autorunner/voice/service.py +210 -0
  137. codex_autorunner-0.1.0/src/codex_autorunner/web/__init__.py +1 -0
  138. codex_autorunner-0.1.0/src/codex_autorunner/web/app.py +1037 -0
  139. codex_autorunner-0.1.0/src/codex_autorunner/web/hub_jobs.py +181 -0
  140. codex_autorunner-0.1.0/src/codex_autorunner/web/middleware.py +552 -0
  141. codex_autorunner-0.1.0/src/codex_autorunner/web/pty_session.py +357 -0
  142. codex_autorunner-0.1.0/src/codex_autorunner/web/runner_manager.py +25 -0
  143. codex_autorunner-0.1.0/src/codex_autorunner/web/schemas.py +253 -0
  144. codex_autorunner-0.1.0/src/codex_autorunner/web/static_assets.py +430 -0
  145. codex_autorunner-0.1.0/src/codex_autorunner/web/terminal_sessions.py +78 -0
  146. codex_autorunner-0.1.0/src/codex_autorunner/workspace.py +16 -0
  147. codex_autorunner-0.1.0/src/codex_autorunner.egg-info/PKG-INFO +240 -0
  148. codex_autorunner-0.1.0/src/codex_autorunner.egg-info/SOURCES.txt +220 -0
  149. codex_autorunner-0.1.0/src/codex_autorunner.egg-info/dependency_links.txt +1 -0
  150. codex_autorunner-0.1.0/src/codex_autorunner.egg-info/entry_points.txt +3 -0
  151. codex_autorunner-0.1.0/src/codex_autorunner.egg-info/requires.txt +25 -0
  152. codex_autorunner-0.1.0/src/codex_autorunner.egg-info/top_level.txt +1 -0
  153. codex_autorunner-0.1.0/tests/test_about_car_terminal_context.py +35 -0
  154. codex_autorunner-0.1.0/tests/test_api_contract.py +37 -0
  155. codex_autorunner-0.1.0/tests/test_app_server_client.py +226 -0
  156. codex_autorunner-0.1.0/tests/test_auth_middleware.py +73 -0
  157. codex_autorunner-0.1.0/tests/test_base_path.py +140 -0
  158. codex_autorunner-0.1.0/tests/test_base_path_static.py +50 -0
  159. codex_autorunner-0.1.0/tests/test_cli_init.py +72 -0
  160. codex_autorunner-0.1.0/tests/test_cli_snapshot.py +34 -0
  161. codex_autorunner-0.1.0/tests/test_codex_runner.py +32 -0
  162. codex_autorunner-0.1.0/tests/test_config_resolution.py +57 -0
  163. codex_autorunner-0.1.0/tests/test_doc_chat.py +224 -0
  164. codex_autorunner-0.1.0/tests/test_doc_chat_ui.py +171 -0
  165. codex_autorunner-0.1.0/tests/test_docs_todos.py +15 -0
  166. codex_autorunner-0.1.0/tests/test_engine_logs.py +19 -0
  167. codex_autorunner-0.1.0/tests/test_github_context_hook.py +154 -0
  168. codex_autorunner-0.1.0/tests/test_github_service.py +24 -0
  169. codex_autorunner-0.1.0/tests/test_github_sync_pr_agentic.py +212 -0
  170. codex_autorunner-0.1.0/tests/test_housekeeping.py +165 -0
  171. codex_autorunner-0.1.0/tests/test_hub_create.py +49 -0
  172. codex_autorunner-0.1.0/tests/test_hub_foundation.py +80 -0
  173. codex_autorunner-0.1.0/tests/test_hub_supervisor.py +256 -0
  174. codex_autorunner-0.1.0/tests/test_hub_terminal_sessions.py +113 -0
  175. codex_autorunner-0.1.0/tests/test_hub_ui_escape.py +136 -0
  176. codex_autorunner-0.1.0/tests/test_lock_utils.py +20 -0
  177. codex_autorunner-0.1.0/tests/test_logging_utils.py +94 -0
  178. codex_autorunner-0.1.0/tests/test_notifications.py +92 -0
  179. codex_autorunner-0.1.0/tests/test_optional_dependencies.py +34 -0
  180. codex_autorunner-0.1.0/tests/test_origin_middleware.py +125 -0
  181. codex_autorunner-0.1.0/tests/test_prompt.py +37 -0
  182. codex_autorunner-0.1.0/tests/test_request_logging.py +66 -0
  183. codex_autorunner-0.1.0/tests/test_runner_controller.py +46 -0
  184. codex_autorunner-0.1.0/tests/test_snapshot_api.py +63 -0
  185. codex_autorunner-0.1.0/tests/test_snapshot_core.py +51 -0
  186. codex_autorunner-0.1.0/tests/test_snapshot_incremental.py +118 -0
  187. codex_autorunner-0.1.0/tests/test_spec_ingest.py +41 -0
  188. codex_autorunner-0.1.0/tests/test_sse_streams.py +26 -0
  189. codex_autorunner-0.1.0/tests/test_state_lock.py +26 -0
  190. codex_autorunner-0.1.0/tests/test_state_sessions.py +32 -0
  191. codex_autorunner-0.1.0/tests/test_static.py +62 -0
  192. codex_autorunner-0.1.0/tests/test_static_asset_cache.py +145 -0
  193. codex_autorunner-0.1.0/tests/test_system_update_check.py +38 -0
  194. codex_autorunner-0.1.0/tests/test_system_update_worker.py +106 -0
  195. codex_autorunner-0.1.0/tests/test_telegram_adapter.py +441 -0
  196. codex_autorunner-0.1.0/tests/test_telegram_bot_config.py +150 -0
  197. codex_autorunner-0.1.0/tests/test_telegram_bot_integration.py +611 -0
  198. codex_autorunner-0.1.0/tests/test_telegram_bot_lock.py +91 -0
  199. codex_autorunner-0.1.0/tests/test_telegram_cache_cleanup.py +47 -0
  200. codex_autorunner-0.1.0/tests/test_telegram_command_registry.py +56 -0
  201. codex_autorunner-0.1.0/tests/test_telegram_handlers_callbacks.py +139 -0
  202. codex_autorunner-0.1.0/tests/test_telegram_handlers_messages.py +169 -0
  203. codex_autorunner-0.1.0/tests/test_telegram_interrupt_status.py +17 -0
  204. codex_autorunner-0.1.0/tests/test_telegram_outbox.py +64 -0
  205. codex_autorunner-0.1.0/tests/test_telegram_paths_compatible.py +30 -0
  206. codex_autorunner-0.1.0/tests/test_telegram_state.py +11 -0
  207. codex_autorunner-0.1.0/tests/test_telegram_task_tracking.py +30 -0
  208. codex_autorunner-0.1.0/tests/test_telegram_thread_paths.py +16 -0
  209. codex_autorunner-0.1.0/tests/test_telegram_transport.py +65 -0
  210. codex_autorunner-0.1.0/tests/test_telegram_update_dedupe.py +83 -0
  211. codex_autorunner-0.1.0/tests/test_telegram_whisper_disclaimer.py +81 -0
  212. codex_autorunner-0.1.0/tests/test_terminal_idle_timeout.py +44 -0
  213. codex_autorunner-0.1.0/tests/test_terminal_input_dedupe.py +135 -0
  214. codex_autorunner-0.1.0/tests/test_usage.py +472 -0
  215. codex_autorunner-0.1.0/tests/test_voice_capture.py +136 -0
  216. codex_autorunner-0.1.0/tests/test_voice_config.py +111 -0
  217. codex_autorunner-0.1.0/tests/test_voice_service.py +75 -0
  218. codex_autorunner-0.1.0/tests/test_voice_transcribe_endpoint.py +28 -0
  219. codex_autorunner-0.1.0/tests/test_voice_ui.py +227 -0
  220. codex_autorunner-0.1.0/tests/test_voice_whisper_mime_types.py +20 -0
  221. codex_autorunner-0.1.0/tests/test_voice_whisper_provider.py +127 -0
  222. codex_autorunner-0.1.0/tests/test_workspace_helpers.py +20 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 David Zhang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,240 @@
1
+ Metadata-Version: 2.4
2
+ Name: codex-autorunner
3
+ Version: 0.1.0
4
+ Summary: Codex autorunner CLI per DESIGN-V1
5
+ Author: Codex
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 David Zhang
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/Git-on-my-level/codex-autorunner
29
+ Project-URL: Repository, https://github.com/Git-on-my-level/codex-autorunner
30
+ Project-URL: Issues, https://github.com/Git-on-my-level/codex-autorunner/issues
31
+ Keywords: codex,automation,agent,cli,fastapi
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Programming Language :: Python :: 3
34
+ Classifier: Programming Language :: Python :: 3 :: Only
35
+ Classifier: Operating System :: OS Independent
36
+ Requires-Python: >=3.9
37
+ Description-Content-Type: text/markdown
38
+ License-File: LICENSE
39
+ Requires-Dist: typer>=0.9
40
+ Requires-Dist: click<8.2
41
+ Requires-Dist: pyyaml>=6.0
42
+ Requires-Dist: fastapi>=0.111
43
+ Requires-Dist: uvicorn[standard]>=0.30
44
+ Requires-Dist: ptyprocess>=0.7
45
+ Requires-Dist: python-multipart>=0.0.9
46
+ Requires-Dist: python-dotenv>=1.0
47
+ Requires-Dist: httpx>=0.27
48
+ Provides-Extra: dev
49
+ Requires-Dist: black>=23.0; extra == "dev"
50
+ Requires-Dist: mypy>=1.10; extra == "dev"
51
+ Requires-Dist: pytest>=7.0; extra == "dev"
52
+ Requires-Dist: ruff>=0.5.0; extra == "dev"
53
+ Requires-Dist: types-PyYAML; extra == "dev"
54
+ Provides-Extra: telegram
55
+ Requires-Dist: httpx>=0.27; extra == "telegram"
56
+ Provides-Extra: voice
57
+ Requires-Dist: httpx>=0.27; extra == "voice"
58
+ Requires-Dist: python-multipart>=0.0.9; extra == "voice"
59
+ Provides-Extra: github
60
+ Dynamic: license-file
61
+
62
+ # codex-autorunner
63
+
64
+ An opinionated autorunner that uses the Codex CLI to work on large tasks via a simple loop. On each loop we feed the Codex instance the last one's final output along with core documents.
65
+ 1. TODO - Tracks long-horizon tasks
66
+ 2. PROGRESS - High level overview of what's been done already that may be relevant for future agents
67
+ 3. OPINIONS - Guidelines for how we should approach implementation
68
+ 4. SPEC - Source-of-truth requirements and scope for large features/projects
69
+
70
+ ## Sneak Peak
71
+ Run multiple agents on many repositories, with git worktree support
72
+ ![Desktop hub](docs/screenshots/car-desktop-hub.png)
73
+
74
+ See the progress of your long running tasks with a high level overview
75
+ ![Desktop repo dashboard](docs/screenshots/car-desktop-repo-dashboard.png)
76
+
77
+ Dive deep into specific agent execution with a rich but readable log
78
+ ![Desktop logs](docs/screenshots/car-desktop-logs.png)
79
+
80
+ All memory and opinions are markdown files! Edit them directly or chat with the document!
81
+ ![Desktop TODO](docs/screenshots/car-desktop-todo.png)
82
+
83
+ Use codex CLI directly for multi-shot problem solving or `/review`
84
+ ![Desktop terminal](docs/screenshots/car-desktop-terminal.png)
85
+
86
+ Mobile-first experience, code on the go with Whisper support (BYOK)
87
+ ![Mobile terminal](docs/screenshots/car-mobile-terminal.png)
88
+
89
+ ## What it does
90
+ - Initializes a repo with Codex-friendly docs and config.
91
+ - Runs Codex in a loop against the repo, streaming logs.
92
+ - Tracks state, logs, and config under `.codex-autorunner/`.
93
+ - Exposes a power-user HTTP API and web UI for docs, logs, runner control, and a Codex TUI terminal.
94
+ - Optionally runs a Telegram bot for interactive, user-in-the-loop Codex sessions.
95
+ - Generates a pasteable repo snapshot (`.codex-autorunner/SNAPSHOT.md`) for sharing with other LLM chats.
96
+
97
+ CLI commands are available as `codex-autorunner` or the shorter `car`.
98
+
99
+ ## Install
100
+ PyPI (pipx):
101
+ ```
102
+ pipx install codex-autorunner
103
+ ```
104
+
105
+ GitHub (pipx, dev):
106
+ ```
107
+ pipx install git+https://github.com/Git-on-my-level/codex-autorunner.git
108
+ ```
109
+
110
+ From source (editable):
111
+ ```
112
+ git clone https://github.com/Git-on-my-level/codex-autorunner.git
113
+ cd codex-autorunner
114
+ pip install -e .
115
+ ```
116
+
117
+ ### Optional extras
118
+ - Telegram bot support: `pip install codex-autorunner[telegram]`
119
+ - Voice transcription support: `pip install codex-autorunner[voice]`
120
+ - Dev tools (lint/test): `pip install codex-autorunner[dev]`
121
+ - Local dev alternative: `pip install -e .[extra]`
122
+
123
+ ## Dev setup
124
+ - `make setup` creates `.venv`, installs `.[dev]`, runs `npm install`, and sets `core.hooksPath` to `.githooks`.
125
+
126
+ ### Opinionated setup (macOS headless hub at `~/car-workspace`)
127
+ - One-shot setup (user scope): `scripts/install-local-mac-hub.sh`. It pipx-installs this repo, creates/initializes `~/car-workspace` as a hub, writes a launchd agent plist, and loads it. Defaults: host `127.0.0.1`, port `4173`, label `com.codex.autorunner`. Override via env (`WORKSPACE`, `HOST`, `PORT`, `LABEL`, `PLIST_PATH`, `PACKAGE_SRC`). For remote access, prefer a VPN like Tailscale and keep the hub bound to loopback; if you bind to a non-loopback host, the script configures `server.auth_token_env` + a token in `.codex-autorunner/.env`.
128
+ - Create/update the launchd agent plist and (re)load it: `scripts/launchd-hub.sh` (or `make launchd-hub`).
129
+ - Linux users: see `docs/ops/systemd.md` for systemd hub/Telegram setup.
130
+ - Manual path if you prefer:
131
+ - `pipx install .`
132
+ - `car init --mode hub --path ~/car-workspace`
133
+ - Copy `docs/ops/launchd-hub-example.plist` to `~/Library/LaunchAgents/com.codex.autorunner.plist`, replace `/Users/you` with your home, adjust host/port if desired, then `launchctl load -w ~/Library/LaunchAgents/com.codex.autorunner.plist`.
134
+ - The hub serves the UI/API from `http://<host>:<port>` and writes logs to `~/car-workspace/.codex-autorunner/codex-autorunner-hub.log`. Each repo under `~/car-workspace` should be a git repo with its own `.codex-autorunner/` (run `car init` in each).
135
+
136
+ #### Refresh a launchd hub to the current branch
137
+ When you change code in this repo and want the launchd-managed hub to run it:
138
+ 1) Recommended: run the safe refresher, which installs into a new venv, flips `~/.local/pipx/venvs/codex-autorunner.current`, restarts launchd, health-checks, and auto-rolls back on failure:
139
+ ```
140
+ make refresh-launchd
141
+ ```
142
+
143
+ Important: avoid in-place pip/pipx installs against the live venv. During uninstall/reinstall, packaged static assets disappear and the UI can break while the server keeps running. Use the safe refresher or stop the service before manual installs.
144
+
145
+ 2) Manual path (offline only; no rollback): stop launchd first, then reinstall into the launchd venv (pipx default paths shown; adjust if your label/paths differ):
146
+ ```
147
+ $HOME/.local/pipx/venvs/codex-autorunner/bin/python -m pip install --force-reinstall /path/to/your/codex-autorunner
148
+ ```
149
+ 3) Restart the agent so it picks up the new bits (default label is `com.codex.autorunner`; default plist `~/Library/LaunchAgents/com.codex.autorunner.plist`):
150
+ ```
151
+ launchctl unload ~/Library/LaunchAgents/com.codex.autorunner.plist 2>/dev/null || true
152
+ launchctl load -w ~/Library/LaunchAgents/com.codex.autorunner.plist
153
+ launchctl kickstart -k gui/$(id -u)/com.codex.autorunner
154
+ ```
155
+ 4) Tail the hub log to confirm it booted: `tail -n 50 ~/car-workspace/.codex-autorunner/codex-autorunner-hub.log`.
156
+
157
+ #### Health checks (recommended)
158
+ - `GET /health` returns 200 (verifies static assets are present).
159
+ - `GET /static/app.js` returns 200.
160
+ - Optional: `GET /` returns HTML (not a JSON error).
161
+ If you set a base path, prefix all checks with it.
162
+
163
+ ## Quick start
164
+ 1) Install (editable): `pip install -e .`
165
+ 2) Initialize (per repo): `codex-autorunner init --git-init` (or `car init --git-init` if you prefer short). This creates `.codex-autorunner/config.yml`, state/log files, and the docs under `.codex-autorunner/`.
166
+ 3) Run once: `codex-autorunner once` / `car once`
167
+ 4) Continuous loop: `codex-autorunner run` / `car run`
168
+ 5) If stuck: `codex-autorunner kill` then `codex-autorunner resume` (or the `car` equivalents)
169
+ 6) Check status/logs: `codex-autorunner status`, `codex-autorunner log --tail 200` (or `car ...`)
170
+
171
+ ## Configuration
172
+ - Root defaults live in `codex-autorunner.yml` (committed). These defaults are used when CAR generates `.codex-autorunner/config.yml`.
173
+ - Local overrides live in `codex-autorunner.override.yml` (gitignored). Use it for machine-specific tweaks; keep secrets in env vars.
174
+ - Repo config lives at `.codex-autorunner/config.yml` (generated). Edit it for repo-specific changes.
175
+
176
+ ## Interfaces
177
+
178
+ CAR supports two interfaces with the same core engine. The web UI is the power
179
+ user control plane for multi-repo visibility and system control. The Telegram
180
+ bot is optimized for interactive back-and-forth, mirroring the Codex TUI
181
+ experience inside Telegram with user-in-the-loop approvals.
182
+
183
+ ### Web UI (control plane)
184
+ 1) Ensure the repo is initialized (`codex-autorunner init`) so `.codex-autorunner/config.yml` exists.
185
+ 2) Start the API/UI backend: `codex-autorunner serve` (or `car serve`) — defaults to `127.0.0.1:4173`; override via `server.host`/`server.port` in `.codex-autorunner/config.yml`.
186
+ 3) Open `http://127.0.0.1:4173` to use the UI, or call the FastAPI endpoints under `/api/*`.
187
+ - The Terminal tab launches the configured Codex binary inside a PTY via websocket; it uses `codex.terminal_args` (defaults empty, so it runs `codex` bare unless you override). xterm.js assets are vendored under `static/vendor`.
188
+ - If you need to serve under a proxy prefix (e.g., `/car`), set `server.base_path` in `.codex-autorunner/config.yml` or pass `--base-path` to `car serve/hub serve`; all HTTP/WS endpoints will be reachable under that prefix. Proxy must forward that prefix (e.g., Caddy `handle /car/* { reverse_proxy ... }` with a 404 fallback for everything else).
189
+ - Chat composer shortcuts: desktop uses Cmd+Enter (or Ctrl+Enter) to send and Shift+Enter for newline; mobile uses Enter to send and Shift+Enter for newline.
190
+
191
+ ### Telegram bot (interactive sessions)
192
+ - The interactive Telegram bot is separate from `notifications.telegram` (which is one-way notifications).
193
+ - Each operator should create their own Telegram bot token. Multi-user use requires explicit allowlists.
194
+ - Quickstart:
195
+ 1) Set env vars: `CAR_TELEGRAM_BOT_TOKEN` (and optionally `CAR_TELEGRAM_CHAT_ID`).
196
+ 2) In config, set `telegram_bot.enabled: true` and fill `allowed_user_ids` + `allowed_chat_ids`.
197
+ 3) Run `car telegram start --path <repo_or_hub>`.
198
+ 4) Use `/bind` (hub mode) and `/new` or `/resume` in Telegram.
199
+ - How it works (high level):
200
+ - The bot polls the Telegram Bot API, allowlists chat/user IDs, and routes each topic to a workspace + Codex thread.
201
+ - Messages and media are forwarded to the Codex app-server, streaming responses back to Telegram.
202
+ - Approvals can be requested inline, giving a hands-on, TUI-like workflow without leaving Telegram.
203
+ - Details: `docs/telegram/architecture.md`, `docs/ops/telegram-bot-runbook.md`, and `docs/telegram/security.md`.
204
+
205
+ ## Security and remote access
206
+ - The UI/API are effectively privileged access and can execute code on your machine (terminal + runner).
207
+ - Keep the server bound to `127.0.0.1` and use Tailscale (or another VPN) for remote access.
208
+ - If you must expose it, set `server.auth_token_env` and also put it behind an auth-enforcing reverse proxy (basic auth/SSO).
209
+ - Do not expose it publicly without protections. See `docs/web/security.md` for details.
210
+
211
+ ### Auth token (optional)
212
+ If you set `server.auth_token_env`, the API requires `Authorization: Bearer <token>` on every request.
213
+ - Set the config: `server.auth_token_env: CAR_SERVER_TOKEN`.
214
+ - Export the token before starting the server: `export CAR_SERVER_TOKEN="..."`.
215
+ - Browser UI: visit `http://host:port/?token=...` once. The UI stores it in `sessionStorage` and removes it from the URL; WebSocket connections send the token via `Sec-WebSocket-Protocol: car-token-b64.<base64url(token)>`.
216
+ - CLI: requests automatically attach the token from `server.auth_token_env`; if the env var is missing, CLI commands will error.
217
+
218
+ ## Git hooks
219
+ - Install dev tools: `pip install -e .[dev]`
220
+ - Point Git to the repo hooks: `git config core.hooksPath .githooks`
221
+ - The `pre-commit` hook runs `scripts/check.sh` (Black formatting check + pytest). Run it manually with `./scripts/check.sh` before committing or in CI.
222
+
223
+ ## Commands (CLI)
224
+ - `init` — seed config/state/docs.
225
+ - `run` / `once` — run the loop (continuous or single iteration).
226
+ - `resume` — clear stale lock/state and restart; `--once` for a single run.
227
+ - `kill` — SIGTERM the running loop and mark state error.
228
+ - `status` — show current state and outstanding TODO count.
229
+ - `sessions` — list terminal sessions (server-backed when available).
230
+ - `stop-session` — stop a terminal session by repo (`--repo`) or id (`--session`).
231
+ - `log` — view logs (tail or specific run).
232
+ - `edit` — open TODO/PROGRESS/OPINIONS/SPEC in `$EDITOR`.
233
+ - `ingest-spec` — generate TODO/PROGRESS/OPINIONS from SPEC using Codex (use `--force` to overwrite).
234
+ - `clear-docs` — reset TODO/PROGRESS/OPINIONS to empty templates (type CLEAR to confirm).
235
+ - `snapshot` — generate/update `.codex-autorunner/SNAPSHOT.md` (incremental by default when one exists; use `--from-scratch` to regenerate).
236
+ - `serve` — start the HTTP API (FastAPI) on host/port from config (defaults 127.0.0.1:4173).
237
+
238
+ ## Snapshot (repo briefing)
239
+ - Web UI: open the Snapshot tab. If no snapshot exists, you’ll see “Generate snapshot”; otherwise you’ll see “Update snapshot (incremental)” and “Regenerate snapshot (from scratch)”, plus “Copy to clipboard”.
240
+ - CLI: `codex-autorunner snapshot` (or `car snapshot`) writes `.codex-autorunner/SNAPSHOT.md` and `.codex-autorunner/snapshot_state.json`.
@@ -0,0 +1,179 @@
1
+ # codex-autorunner
2
+
3
+ An opinionated autorunner that uses the Codex CLI to work on large tasks via a simple loop. On each loop we feed the Codex instance the last one's final output along with core documents.
4
+ 1. TODO - Tracks long-horizon tasks
5
+ 2. PROGRESS - High level overview of what's been done already that may be relevant for future agents
6
+ 3. OPINIONS - Guidelines for how we should approach implementation
7
+ 4. SPEC - Source-of-truth requirements and scope for large features/projects
8
+
9
+ ## Sneak Peak
10
+ Run multiple agents on many repositories, with git worktree support
11
+ ![Desktop hub](docs/screenshots/car-desktop-hub.png)
12
+
13
+ See the progress of your long running tasks with a high level overview
14
+ ![Desktop repo dashboard](docs/screenshots/car-desktop-repo-dashboard.png)
15
+
16
+ Dive deep into specific agent execution with a rich but readable log
17
+ ![Desktop logs](docs/screenshots/car-desktop-logs.png)
18
+
19
+ All memory and opinions are markdown files! Edit them directly or chat with the document!
20
+ ![Desktop TODO](docs/screenshots/car-desktop-todo.png)
21
+
22
+ Use codex CLI directly for multi-shot problem solving or `/review`
23
+ ![Desktop terminal](docs/screenshots/car-desktop-terminal.png)
24
+
25
+ Mobile-first experience, code on the go with Whisper support (BYOK)
26
+ ![Mobile terminal](docs/screenshots/car-mobile-terminal.png)
27
+
28
+ ## What it does
29
+ - Initializes a repo with Codex-friendly docs and config.
30
+ - Runs Codex in a loop against the repo, streaming logs.
31
+ - Tracks state, logs, and config under `.codex-autorunner/`.
32
+ - Exposes a power-user HTTP API and web UI for docs, logs, runner control, and a Codex TUI terminal.
33
+ - Optionally runs a Telegram bot for interactive, user-in-the-loop Codex sessions.
34
+ - Generates a pasteable repo snapshot (`.codex-autorunner/SNAPSHOT.md`) for sharing with other LLM chats.
35
+
36
+ CLI commands are available as `codex-autorunner` or the shorter `car`.
37
+
38
+ ## Install
39
+ PyPI (pipx):
40
+ ```
41
+ pipx install codex-autorunner
42
+ ```
43
+
44
+ GitHub (pipx, dev):
45
+ ```
46
+ pipx install git+https://github.com/Git-on-my-level/codex-autorunner.git
47
+ ```
48
+
49
+ From source (editable):
50
+ ```
51
+ git clone https://github.com/Git-on-my-level/codex-autorunner.git
52
+ cd codex-autorunner
53
+ pip install -e .
54
+ ```
55
+
56
+ ### Optional extras
57
+ - Telegram bot support: `pip install codex-autorunner[telegram]`
58
+ - Voice transcription support: `pip install codex-autorunner[voice]`
59
+ - Dev tools (lint/test): `pip install codex-autorunner[dev]`
60
+ - Local dev alternative: `pip install -e .[extra]`
61
+
62
+ ## Dev setup
63
+ - `make setup` creates `.venv`, installs `.[dev]`, runs `npm install`, and sets `core.hooksPath` to `.githooks`.
64
+
65
+ ### Opinionated setup (macOS headless hub at `~/car-workspace`)
66
+ - One-shot setup (user scope): `scripts/install-local-mac-hub.sh`. It pipx-installs this repo, creates/initializes `~/car-workspace` as a hub, writes a launchd agent plist, and loads it. Defaults: host `127.0.0.1`, port `4173`, label `com.codex.autorunner`. Override via env (`WORKSPACE`, `HOST`, `PORT`, `LABEL`, `PLIST_PATH`, `PACKAGE_SRC`). For remote access, prefer a VPN like Tailscale and keep the hub bound to loopback; if you bind to a non-loopback host, the script configures `server.auth_token_env` + a token in `.codex-autorunner/.env`.
67
+ - Create/update the launchd agent plist and (re)load it: `scripts/launchd-hub.sh` (or `make launchd-hub`).
68
+ - Linux users: see `docs/ops/systemd.md` for systemd hub/Telegram setup.
69
+ - Manual path if you prefer:
70
+ - `pipx install .`
71
+ - `car init --mode hub --path ~/car-workspace`
72
+ - Copy `docs/ops/launchd-hub-example.plist` to `~/Library/LaunchAgents/com.codex.autorunner.plist`, replace `/Users/you` with your home, adjust host/port if desired, then `launchctl load -w ~/Library/LaunchAgents/com.codex.autorunner.plist`.
73
+ - The hub serves the UI/API from `http://<host>:<port>` and writes logs to `~/car-workspace/.codex-autorunner/codex-autorunner-hub.log`. Each repo under `~/car-workspace` should be a git repo with its own `.codex-autorunner/` (run `car init` in each).
74
+
75
+ #### Refresh a launchd hub to the current branch
76
+ When you change code in this repo and want the launchd-managed hub to run it:
77
+ 1) Recommended: run the safe refresher, which installs into a new venv, flips `~/.local/pipx/venvs/codex-autorunner.current`, restarts launchd, health-checks, and auto-rolls back on failure:
78
+ ```
79
+ make refresh-launchd
80
+ ```
81
+
82
+ Important: avoid in-place pip/pipx installs against the live venv. During uninstall/reinstall, packaged static assets disappear and the UI can break while the server keeps running. Use the safe refresher or stop the service before manual installs.
83
+
84
+ 2) Manual path (offline only; no rollback): stop launchd first, then reinstall into the launchd venv (pipx default paths shown; adjust if your label/paths differ):
85
+ ```
86
+ $HOME/.local/pipx/venvs/codex-autorunner/bin/python -m pip install --force-reinstall /path/to/your/codex-autorunner
87
+ ```
88
+ 3) Restart the agent so it picks up the new bits (default label is `com.codex.autorunner`; default plist `~/Library/LaunchAgents/com.codex.autorunner.plist`):
89
+ ```
90
+ launchctl unload ~/Library/LaunchAgents/com.codex.autorunner.plist 2>/dev/null || true
91
+ launchctl load -w ~/Library/LaunchAgents/com.codex.autorunner.plist
92
+ launchctl kickstart -k gui/$(id -u)/com.codex.autorunner
93
+ ```
94
+ 4) Tail the hub log to confirm it booted: `tail -n 50 ~/car-workspace/.codex-autorunner/codex-autorunner-hub.log`.
95
+
96
+ #### Health checks (recommended)
97
+ - `GET /health` returns 200 (verifies static assets are present).
98
+ - `GET /static/app.js` returns 200.
99
+ - Optional: `GET /` returns HTML (not a JSON error).
100
+ If you set a base path, prefix all checks with it.
101
+
102
+ ## Quick start
103
+ 1) Install (editable): `pip install -e .`
104
+ 2) Initialize (per repo): `codex-autorunner init --git-init` (or `car init --git-init` if you prefer short). This creates `.codex-autorunner/config.yml`, state/log files, and the docs under `.codex-autorunner/`.
105
+ 3) Run once: `codex-autorunner once` / `car once`
106
+ 4) Continuous loop: `codex-autorunner run` / `car run`
107
+ 5) If stuck: `codex-autorunner kill` then `codex-autorunner resume` (or the `car` equivalents)
108
+ 6) Check status/logs: `codex-autorunner status`, `codex-autorunner log --tail 200` (or `car ...`)
109
+
110
+ ## Configuration
111
+ - Root defaults live in `codex-autorunner.yml` (committed). These defaults are used when CAR generates `.codex-autorunner/config.yml`.
112
+ - Local overrides live in `codex-autorunner.override.yml` (gitignored). Use it for machine-specific tweaks; keep secrets in env vars.
113
+ - Repo config lives at `.codex-autorunner/config.yml` (generated). Edit it for repo-specific changes.
114
+
115
+ ## Interfaces
116
+
117
+ CAR supports two interfaces with the same core engine. The web UI is the power
118
+ user control plane for multi-repo visibility and system control. The Telegram
119
+ bot is optimized for interactive back-and-forth, mirroring the Codex TUI
120
+ experience inside Telegram with user-in-the-loop approvals.
121
+
122
+ ### Web UI (control plane)
123
+ 1) Ensure the repo is initialized (`codex-autorunner init`) so `.codex-autorunner/config.yml` exists.
124
+ 2) Start the API/UI backend: `codex-autorunner serve` (or `car serve`) — defaults to `127.0.0.1:4173`; override via `server.host`/`server.port` in `.codex-autorunner/config.yml`.
125
+ 3) Open `http://127.0.0.1:4173` to use the UI, or call the FastAPI endpoints under `/api/*`.
126
+ - The Terminal tab launches the configured Codex binary inside a PTY via websocket; it uses `codex.terminal_args` (defaults empty, so it runs `codex` bare unless you override). xterm.js assets are vendored under `static/vendor`.
127
+ - If you need to serve under a proxy prefix (e.g., `/car`), set `server.base_path` in `.codex-autorunner/config.yml` or pass `--base-path` to `car serve/hub serve`; all HTTP/WS endpoints will be reachable under that prefix. Proxy must forward that prefix (e.g., Caddy `handle /car/* { reverse_proxy ... }` with a 404 fallback for everything else).
128
+ - Chat composer shortcuts: desktop uses Cmd+Enter (or Ctrl+Enter) to send and Shift+Enter for newline; mobile uses Enter to send and Shift+Enter for newline.
129
+
130
+ ### Telegram bot (interactive sessions)
131
+ - The interactive Telegram bot is separate from `notifications.telegram` (which is one-way notifications).
132
+ - Each operator should create their own Telegram bot token. Multi-user use requires explicit allowlists.
133
+ - Quickstart:
134
+ 1) Set env vars: `CAR_TELEGRAM_BOT_TOKEN` (and optionally `CAR_TELEGRAM_CHAT_ID`).
135
+ 2) In config, set `telegram_bot.enabled: true` and fill `allowed_user_ids` + `allowed_chat_ids`.
136
+ 3) Run `car telegram start --path <repo_or_hub>`.
137
+ 4) Use `/bind` (hub mode) and `/new` or `/resume` in Telegram.
138
+ - How it works (high level):
139
+ - The bot polls the Telegram Bot API, allowlists chat/user IDs, and routes each topic to a workspace + Codex thread.
140
+ - Messages and media are forwarded to the Codex app-server, streaming responses back to Telegram.
141
+ - Approvals can be requested inline, giving a hands-on, TUI-like workflow without leaving Telegram.
142
+ - Details: `docs/telegram/architecture.md`, `docs/ops/telegram-bot-runbook.md`, and `docs/telegram/security.md`.
143
+
144
+ ## Security and remote access
145
+ - The UI/API are effectively privileged access and can execute code on your machine (terminal + runner).
146
+ - Keep the server bound to `127.0.0.1` and use Tailscale (or another VPN) for remote access.
147
+ - If you must expose it, set `server.auth_token_env` and also put it behind an auth-enforcing reverse proxy (basic auth/SSO).
148
+ - Do not expose it publicly without protections. See `docs/web/security.md` for details.
149
+
150
+ ### Auth token (optional)
151
+ If you set `server.auth_token_env`, the API requires `Authorization: Bearer <token>` on every request.
152
+ - Set the config: `server.auth_token_env: CAR_SERVER_TOKEN`.
153
+ - Export the token before starting the server: `export CAR_SERVER_TOKEN="..."`.
154
+ - Browser UI: visit `http://host:port/?token=...` once. The UI stores it in `sessionStorage` and removes it from the URL; WebSocket connections send the token via `Sec-WebSocket-Protocol: car-token-b64.<base64url(token)>`.
155
+ - CLI: requests automatically attach the token from `server.auth_token_env`; if the env var is missing, CLI commands will error.
156
+
157
+ ## Git hooks
158
+ - Install dev tools: `pip install -e .[dev]`
159
+ - Point Git to the repo hooks: `git config core.hooksPath .githooks`
160
+ - The `pre-commit` hook runs `scripts/check.sh` (Black formatting check + pytest). Run it manually with `./scripts/check.sh` before committing or in CI.
161
+
162
+ ## Commands (CLI)
163
+ - `init` — seed config/state/docs.
164
+ - `run` / `once` — run the loop (continuous or single iteration).
165
+ - `resume` — clear stale lock/state and restart; `--once` for a single run.
166
+ - `kill` — SIGTERM the running loop and mark state error.
167
+ - `status` — show current state and outstanding TODO count.
168
+ - `sessions` — list terminal sessions (server-backed when available).
169
+ - `stop-session` — stop a terminal session by repo (`--repo`) or id (`--session`).
170
+ - `log` — view logs (tail or specific run).
171
+ - `edit` — open TODO/PROGRESS/OPINIONS/SPEC in `$EDITOR`.
172
+ - `ingest-spec` — generate TODO/PROGRESS/OPINIONS from SPEC using Codex (use `--force` to overwrite).
173
+ - `clear-docs` — reset TODO/PROGRESS/OPINIONS to empty templates (type CLEAR to confirm).
174
+ - `snapshot` — generate/update `.codex-autorunner/SNAPSHOT.md` (incremental by default when one exists; use `--from-scratch` to regenerate).
175
+ - `serve` — start the HTTP API (FastAPI) on host/port from config (defaults 127.0.0.1:4173).
176
+
177
+ ## Snapshot (repo briefing)
178
+ - Web UI: open the Snapshot tab. If no snapshot exists, you’ll see “Generate snapshot”; otherwise you’ll see “Update snapshot (incremental)” and “Regenerate snapshot (from scratch)”, plus “Copy to clipboard”.
179
+ - CLI: `codex-autorunner snapshot` (or `car snapshot`) writes `.codex-autorunner/SNAPSHOT.md` and `.codex-autorunner/snapshot_state.json`.
@@ -0,0 +1,105 @@
1
+ [project]
2
+ name = "codex-autorunner"
3
+ version = "0.1.0"
4
+ description = "Codex autorunner CLI per DESIGN-V1"
5
+ readme = "README.md"
6
+ license = {file = "LICENSE"}
7
+ authors = [{name = "Codex"}]
8
+ requires-python = ">=3.9"
9
+ dependencies = [
10
+ "typer>=0.9",
11
+ "click<8.2",
12
+ "pyyaml>=6.0",
13
+ "fastapi>=0.111",
14
+ "uvicorn[standard]>=0.30",
15
+ "ptyprocess>=0.7",
16
+ "python-multipart>=0.0.9",
17
+ "python-dotenv>=1.0",
18
+ "httpx>=0.27",
19
+ ]
20
+ classifiers = [
21
+ "License :: OSI Approved :: MIT License",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3 :: Only",
24
+ "Operating System :: OS Independent",
25
+ ]
26
+ keywords = ["codex", "automation", "agent", "cli", "fastapi"]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/Git-on-my-level/codex-autorunner"
30
+ Repository = "https://github.com/Git-on-my-level/codex-autorunner"
31
+ Issues = "https://github.com/Git-on-my-level/codex-autorunner/issues"
32
+
33
+ [project.optional-dependencies]
34
+ dev = [
35
+ "black>=23.0",
36
+ "mypy>=1.10",
37
+ "pytest>=7.0",
38
+ "ruff>=0.5.0",
39
+ "types-PyYAML",
40
+ ]
41
+ telegram = [
42
+ "httpx>=0.27",
43
+ ]
44
+ voice = [
45
+ "httpx>=0.27",
46
+ "python-multipart>=0.0.9",
47
+ ]
48
+ github = []
49
+
50
+ [project.scripts]
51
+ codex-autorunner = "codex_autorunner.cli:app"
52
+ car = "codex_autorunner.cli:app"
53
+
54
+ [build-system]
55
+ requires = ["setuptools", "wheel"]
56
+ build-backend = "setuptools.build_meta"
57
+
58
+ [tool.setuptools.packages.find]
59
+ where = ["src"]
60
+
61
+ [tool.setuptools]
62
+ include-package-data = true
63
+
64
+ [tool.setuptools.package-data]
65
+ codex_autorunner = ["static/*", "static/**/*"]
66
+
67
+ [tool.typer]
68
+ completions = true
69
+
70
+ [tool.ruff]
71
+ line-length = 88
72
+ target-version = "py39"
73
+
74
+ [tool.ruff.lint]
75
+ select = ["E", "F", "W", "I", "B"]
76
+ ignore = ["E501"]
77
+
78
+ [tool.ruff.lint.per-file-ignores]
79
+ "src/codex_autorunner/logging_utils.py" = ["F403"]
80
+ "src/codex_autorunner/pty_session.py" = ["F403"]
81
+ "src/codex_autorunner/static_assets.py" = ["F403"]
82
+ "src/codex_autorunner/cli.py" = ["B008"]
83
+ "src/codex_autorunner/routes/terminal_images.py" = ["B008"]
84
+ "src/codex_autorunner/routes/voice.py" = ["B008"]
85
+
86
+ [tool.mypy]
87
+ python_version = "3.9"
88
+ warn_return_any = true
89
+ no_implicit_optional = true
90
+ ignore_missing_imports = true
91
+ warn_unused_ignores = true
92
+ files = [
93
+ "src/codex_autorunner",
94
+ ]
95
+
96
+ [[tool.mypy.overrides]]
97
+ module = ["codex_autorunner.core", "codex_autorunner.core.*"]
98
+ ignore_errors = false
99
+
100
+ [[tool.mypy.overrides]]
101
+ module = [
102
+ "codex_autorunner.integrations.app_server",
103
+ "codex_autorunner.integrations.app_server.*",
104
+ ]
105
+ ignore_errors = false
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """Codex autorunner package."""
2
+
3
+ __all__ = ["cli", "core", "integrations", "routes", "server", "voice", "web"]