agsekit 1.7.4__tar.gz → 1.7.6__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 (195) hide show
  1. {agsekit-1.7.4/agsekit.egg-info → agsekit-1.7.6}/PKG-INFO +1 -1
  2. {agsekit-1.7.4 → agsekit-1.7.6/agsekit.egg-info}/PKG-INFO +1 -1
  3. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit.egg-info/SOURCES.txt +1 -0
  4. agsekit-1.7.6/agsekit_cli/agent_scripts/codex.sh +34 -0
  5. agsekit-1.7.6/agsekit_cli/agents_modules/codex.py +16 -0
  6. agsekit-1.7.6/agsekit_cli/ansible/agents/codex.yml +94 -0
  7. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/addmount.py +24 -13
  8. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/config_gen.py +34 -7
  9. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/config.py +38 -5
  10. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/locales/en.json +4 -0
  11. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/locales/ru.json +4 -0
  12. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/mounts.py +40 -0
  13. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/run_with_http_proxy.sh +44 -4
  14. {agsekit-1.7.4 → agsekit-1.7.6}/config-example.yaml +3 -0
  15. {agsekit-1.7.4 → agsekit-1.7.6}/pyproject.toml +1 -1
  16. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_addmount_command.py +103 -0
  17. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_agent_latest_versions.py +1 -1
  18. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_agents_modules.py +1 -1
  19. agsekit-1.7.6/tests/test_codex_standalone_installer.py +112 -0
  20. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_config_gen_command.py +40 -22
  21. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_config_main.py +9 -0
  22. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_config_mounts.py +44 -0
  23. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_config_vms.py +70 -0
  24. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_install_agents_command.py +5 -5
  25. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_mounts.py +29 -6
  26. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_node_agent_installers.py +0 -2
  27. agsekit-1.7.4/agsekit_cli/agent_scripts/codex.sh +0 -99
  28. agsekit-1.7.4/agsekit_cli/agents_modules/codex.py +0 -14
  29. agsekit-1.7.4/agsekit_cli/ansible/agents/codex.yml +0 -133
  30. {agsekit-1.7.4 → agsekit-1.7.6}/LICENSE +0 -0
  31. {agsekit-1.7.4 → agsekit-1.7.6}/MANIFEST.in +0 -0
  32. {agsekit-1.7.4 → agsekit-1.7.6}/README.md +0 -0
  33. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit.egg-info/dependency_links.txt +0 -0
  34. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit.egg-info/entry_points.txt +0 -0
  35. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit.egg-info/requires.txt +0 -0
  36. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit.egg-info/top_level.txt +0 -0
  37. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/__init__.py +0 -0
  38. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agent_scripts/claude-code.sh +0 -0
  39. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agent_scripts/codex-glibc.sh +0 -0
  40. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agent_scripts/proxychains_common.sh +0 -0
  41. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agent_scripts/qwen.sh +0 -0
  42. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agent_version_sources.py +0 -0
  43. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents.py +0 -0
  44. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents_modules/__init__.py +0 -0
  45. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents_modules/aider.py +0 -0
  46. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents_modules/base.py +0 -0
  47. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents_modules/claude.py +0 -0
  48. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents_modules/cline.py +0 -0
  49. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents_modules/codex_glibc.py +0 -0
  50. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents_modules/codex_glibc_prebuilt.py +0 -0
  51. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents_modules/forgecode.py +0 -0
  52. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents_modules/opencode.py +0 -0
  53. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/agents_modules/qwen.py +0 -0
  54. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/aider.yml +0 -0
  55. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/claude.yml +0 -0
  56. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/cline.yml +0 -0
  57. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/codex-glibc-prebuilt.yml +0 -0
  58. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/codex-glibc.yml +0 -0
  59. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/codex_code_mode_host.yml +0 -0
  60. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/codex_logrotate.yml +0 -0
  61. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/forgecode.yml +0 -0
  62. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/opencode.yml +0 -0
  63. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/proxychains.yml +0 -0
  64. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/agents/qwen.yml +0 -0
  65. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/bundles/docker.yml +0 -0
  66. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/bundles/golang.yml +0 -0
  67. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/bundles/nodejs.yml +0 -0
  68. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/bundles/nvm.yml +0 -0
  69. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/bundles/pyenv.yml +0 -0
  70. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/bundles/python.yml +0 -0
  71. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/bundles/rust.yml +0 -0
  72. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/callback_plugins/agsekit_progress.py +0 -0
  73. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/callback_plugins/agsekit_rich.py +0 -0
  74. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/connection_plugins/agsekit_multipass.py +0 -0
  75. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/vm_packages.yml +0 -0
  76. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible/vm_ssh.yml +0 -0
  77. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible_runners.py +0 -0
  78. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/ansible_utils.py +0 -0
  79. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/backup.py +0 -0
  80. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/cli.py +0 -0
  81. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/cli_entry.py +0 -0
  82. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/codex_rust_toolchain_version.txt +0 -0
  83. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/__init__.py +0 -0
  84. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/backup_clean.py +0 -0
  85. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/backup_once.py +0 -0
  86. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/backup_repeated.py +0 -0
  87. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/check_new_version.py +0 -0
  88. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/config_example.py +0 -0
  89. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/create_vm.py +0 -0
  90. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/daemon.py +0 -0
  91. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/destroy_vm.py +0 -0
  92. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/doctor.py +0 -0
  93. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/down.py +0 -0
  94. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/install_agents.py +0 -0
  95. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/list_bundles.py +0 -0
  96. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/mounts.py +0 -0
  97. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/pip_upgrade.py +0 -0
  98. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/portforward.py +0 -0
  99. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/prepare.py +0 -0
  100. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/removemount.py +0 -0
  101. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/restart_vm.py +0 -0
  102. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/run.py +0 -0
  103. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/shell.py +0 -0
  104. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/ssh.py +0 -0
  105. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/start_vm.py +0 -0
  106. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/status.py +0 -0
  107. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/stop.py +0 -0
  108. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/systemd.py +0 -0
  109. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/up.py +0 -0
  110. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/commands/version.py +0 -0
  111. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/daemon_backends.py +0 -0
  112. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/debug.py +0 -0
  113. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/host_tools.py +0 -0
  114. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/i18n.py +0 -0
  115. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/interactive.py +0 -0
  116. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/prebuilt.py +0 -0
  117. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/prepare_strategies.py +0 -0
  118. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/progress.py +0 -0
  119. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/provision_handlers.py +0 -0
  120. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/run_agent.sh +0 -0
  121. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/run_with_proxychains.sh +0 -0
  122. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/state.py +0 -0
  123. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/systemd/agsekit-portforward.service +0 -0
  124. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/systemd_backend.py +0 -0
  125. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/tui_prompts.py +0 -0
  126. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/versioning.py +0 -0
  127. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm.py +0 -0
  128. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_bundle_definitions.py +0 -0
  129. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_bundles.py +0 -0
  130. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_installers/docker.sh +0 -0
  131. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_installers/golang.sh +0 -0
  132. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_installers/nodejs.sh +0 -0
  133. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_installers/nvm.sh +0 -0
  134. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_installers/pyenv.sh +0 -0
  135. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_installers/python.sh +0 -0
  136. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_installers/rust.sh +0 -0
  137. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_local_control_node.py +0 -0
  138. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_prepare.py +0 -0
  139. {agsekit-1.7.4 → agsekit-1.7.6}/agsekit_cli/vm_ssh_bootstrap.py +0 -0
  140. {agsekit-1.7.4 → agsekit-1.7.6}/prebuilt-agents/codex-glibc/.dockerignore +0 -0
  141. {agsekit-1.7.4 → agsekit-1.7.6}/prebuilt-agents/codex-glibc/Dockerfile +0 -0
  142. {agsekit-1.7.4 → agsekit-1.7.6}/prebuilt-agents/codex-glibc/build-codex-glibc.sh +0 -0
  143. {agsekit-1.7.4 → agsekit-1.7.6}/prebuilt-agents/codex-glibc/build.sh +0 -0
  144. {agsekit-1.7.4 → agsekit-1.7.6}/setup.cfg +0 -0
  145. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_agents.py +0 -0
  146. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_ansible_agent_proxychains.py +0 -0
  147. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_ansible_multipass_connection.py +0 -0
  148. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_ansible_utils.py +0 -0
  149. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_ansible_vm_bundles.py +0 -0
  150. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_backup_clean_command.py +0 -0
  151. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_backup_lock.py +0 -0
  152. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_backup_progress.py +0 -0
  153. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_backup_repeated.py +0 -0
  154. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_backup_repeated_commands.py +0 -0
  155. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_build_backfill_github_releases.py +0 -0
  156. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_build_check_pypi_version.py +0 -0
  157. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_build_extract_changelog.py +0 -0
  158. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_check_new_version_command.py +0 -0
  159. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_codex_logrotate_installers.py +0 -0
  160. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_config_agents.py +0 -0
  161. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_create_vm_command.py +0 -0
  162. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_daemon_command.py +0 -0
  163. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_debug.py +0 -0
  164. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_doctor_command.py +0 -0
  165. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_down_command.py +0 -0
  166. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_host_tools.py +0 -0
  167. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_i18n.py +0 -0
  168. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_install_script.py +0 -0
  169. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_interactive_mode.py +0 -0
  170. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_launchd_backend.py +0 -0
  171. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_make_single_backup.py +0 -0
  172. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_mount_commands.py +0 -0
  173. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_pip_upgrade_command.py +0 -0
  174. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_portforward.py +0 -0
  175. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_portforward_command.py +0 -0
  176. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_prebuilt.py +0 -0
  177. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_prepare_command.py +0 -0
  178. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_progress.py +0 -0
  179. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_provision_handlers.py +0 -0
  180. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_removemount_command.py +0 -0
  181. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_restart_vm_command.py +0 -0
  182. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_run_command.py +0 -0
  183. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_shell_command.py +0 -0
  184. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_ssh_command.py +0 -0
  185. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_start_vm_command.py +0 -0
  186. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_state.py +0 -0
  187. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_status_command.py +0 -0
  188. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_stop_vm_command.py +0 -0
  189. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_systemd_command.py +0 -0
  190. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_up_command.py +0 -0
  191. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_version_command.py +0 -0
  192. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_vm_compare.py +0 -0
  193. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_vm_launch.py +0 -0
  194. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_vm_local_control_node.py +0 -0
  195. {agsekit-1.7.4 → agsekit-1.7.6}/tests/test_vm_proxychains.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agsekit
3
- Version: 1.7.4
3
+ Version: 1.7.6
4
4
  Summary: Agent Safety Kit command-line utilities
5
5
  Author-email: Mihanentalpo <mihanentalpo@yandex.ru>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agsekit
3
- Version: 1.7.4
3
+ Version: 1.7.6
4
4
  Summary: Agent Safety Kit command-line utilities
5
5
  Author-email: Mihanentalpo <mihanentalpo@yandex.ru>
6
6
  License: MIT License
@@ -144,6 +144,7 @@ tests/test_build_check_pypi_version.py
144
144
  tests/test_build_extract_changelog.py
145
145
  tests/test_check_new_version_command.py
146
146
  tests/test_codex_logrotate_installers.py
147
+ tests/test_codex_standalone_installer.py
147
148
  tests/test_config_agents.py
148
149
  tests/test_config_gen_command.py
149
150
  tests/test_config_main.py
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5
+ # shellcheck disable=SC1091
6
+ . "$SCRIPT_DIR/proxychains_common.sh"
7
+
8
+ PROXYCHAINS_PROXY="${AGSEKIT_PROXYCHAINS_PROXY:-}"
9
+ CODEX_RELEASE="${AGSEKIT_AGENT_VERSION:-latest}"
10
+ INSTALL_SCRIPT="$(mktemp /tmp/agsekit-codex-install-XXXXXX.sh)"
11
+
12
+ cleanup() {
13
+ rm -f "$INSTALL_SCRIPT"
14
+ }
15
+ trap cleanup EXIT INT TERM
16
+
17
+ echo "Installing official Codex standalone package..."
18
+ run_with_proxychains curl -fsSL https://chatgpt.com/codex/install.sh -o "$INSTALL_SCRIPT"
19
+ run_with_proxychains env CODEX_NON_INTERACTIVE=1 CODEX_RELEASE="$CODEX_RELEASE" sh "$INSTALL_SCRIPT"
20
+
21
+ CODEX_PACKAGE_ROOT="$HOME/.codex/packages/standalone/current"
22
+ for required_path in \
23
+ "$CODEX_PACKAGE_ROOT/codex-package.json" \
24
+ "$CODEX_PACKAGE_ROOT/bin/codex" \
25
+ "$CODEX_PACKAGE_ROOT/bin/codex-code-mode-host" \
26
+ "$CODEX_PACKAGE_ROOT/codex-path/rg" \
27
+ "$CODEX_PACKAGE_ROOT/codex-resources/bwrap"; do
28
+ if [ ! -e "$required_path" ]; then
29
+ echo "Official Codex standalone package is incomplete: $required_path is missing" >&2
30
+ exit 1
31
+ fi
32
+ done
33
+
34
+ "$HOME/.local/bin/codex" --version
@@ -0,0 +1,16 @@
1
+ from .base import BaseAgent
2
+ from ..agent_version_sources import latest_github_release_version
3
+
4
+
5
+ class CodexAgent(BaseAgent):
6
+ type_name = "codex"
7
+ runtime_binary = "codex"
8
+ default_version = "0.166.0"
9
+ _needs_nvm = False
10
+
11
+ @classmethod
12
+ def check_latest_version(cls, *, architecture=None, timeout=30.0):
13
+ del architecture
14
+ return cls.normalize_version(
15
+ latest_github_release_version("openai/codex", tag_prefix="rust-v", timeout=timeout)
16
+ )
@@ -0,0 +1,94 @@
1
+ ---
2
+ - name: Install Codex
3
+ hosts: localhost
4
+ connection: local
5
+ gather_facts: false
6
+ tasks:
7
+ - name: Register Multipass VM
8
+ ansible.builtin.add_host:
9
+ name: "{{ vm_name }}"
10
+ ansible_host: "{{ vm_name }}"
11
+ ansible_connection: agsekit_multipass
12
+ ansible_python_interpreter: /usr/bin/python3
13
+
14
+ - name: Install official standalone Codex package
15
+ hosts: "{{ vm_name }}"
16
+ gather_facts: true
17
+ vars:
18
+ requested_agent_version: "{{ agent_version }}"
19
+ codex_install_script: /tmp/agsekit-codex-install.sh
20
+ codex_user_path: "{{ ansible_env.HOME }}/.local/bin/codex"
21
+ codex_package_root: "{{ ansible_env.HOME }}/.codex/packages/standalone/current"
22
+ tasks:
23
+ - name: Configure proxychains
24
+ ansible.builtin.include_tasks: "{{ playbook_dir }}/proxychains.yml"
25
+
26
+ - name: Configure Codex logrotate
27
+ ansible.builtin.include_tasks: "{{ playbook_dir }}/codex_logrotate.yml"
28
+
29
+ - name: Install Codex dependencies
30
+ ansible.builtin.apt:
31
+ update_cache: true
32
+ name:
33
+ - bubblewrap
34
+ - ca-certificates
35
+ - curl
36
+ - gzip
37
+ - tar
38
+ become: true
39
+
40
+ - name: Remove legacy npm-managed Codex when present
41
+ ansible.builtin.shell: |
42
+ set -euo pipefail
43
+ nvm_dir="{{ ansible_env.HOME }}/.nvm"
44
+ if [ -s "$nvm_dir/nvm.sh" ]; then
45
+ . "$nvm_dir/nvm.sh"
46
+ nvm use --silent default >/dev/null 2>&1 || true
47
+ fi
48
+ if command -v npm >/dev/null 2>&1; then
49
+ npm uninstall -g @openai/codex >/dev/null 2>&1 || true
50
+ fi
51
+ args:
52
+ executable: /bin/bash
53
+ changed_when: false
54
+
55
+ - name: Download official Codex standalone installer
56
+ ansible.builtin.command: >-
57
+ {{ proxychains_prefix }}curl -fsSL https://chatgpt.com/codex/install.sh
58
+ -o {{ codex_install_script }}
59
+ changed_when: true
60
+
61
+ - name: Install official Codex standalone package
62
+ ansible.builtin.command: >-
63
+ {{ proxychains_prefix }}env
64
+ CODEX_NON_INTERACTIVE=1
65
+ CODEX_RELEASE={{ requested_agent_version or 'latest' }}
66
+ sh {{ codex_install_script }}
67
+ changed_when: true
68
+
69
+ - name: Verify official Codex standalone package files
70
+ ansible.builtin.stat:
71
+ path: "{{ item }}"
72
+ loop:
73
+ - "{{ codex_package_root }}/codex-package.json"
74
+ - "{{ codex_package_root }}/bin/codex"
75
+ - "{{ codex_package_root }}/bin/codex-code-mode-host"
76
+ - "{{ codex_package_root }}/codex-path/rg"
77
+ - "{{ codex_package_root }}/codex-resources/bwrap"
78
+ register: codex_package_files
79
+
80
+ - name: Fail when the Codex standalone package is incomplete
81
+ ansible.builtin.assert:
82
+ that:
83
+ - item.stat.exists
84
+ fail_msg: "Official Codex standalone package is incomplete: {{ item.item }} is missing"
85
+ loop: "{{ codex_package_files.results }}"
86
+
87
+ - name: Verify Codex CLI after installation
88
+ ansible.builtin.command: "{{ codex_user_path }} --version"
89
+ changed_when: false
90
+
91
+ - name: Remove Codex installer
92
+ ansible.builtin.file:
93
+ path: "{{ codex_install_script }}"
94
+ state: absent
@@ -18,6 +18,7 @@ from ..config import (
18
18
  default_mount_backup,
19
19
  default_mount_target,
20
20
  load_agents_config,
21
+ load_global_config,
21
22
  load_mounts_config,
22
23
  load_vms_config,
23
24
  resolve_config_path,
@@ -200,8 +201,16 @@ def _resolve_target_and_vm(
200
201
  can_retry_vm = interactive and raw_vm_name is None and len(vm_names) > 1
201
202
 
202
203
  while True:
204
+ if chosen_vm is None:
205
+ chosen_vm = _resolve_vm_name(None, vms, interactive)
206
+
203
207
  if chosen_target is None:
204
- default_target = default_mount_target(source_dir)
208
+ use_old_default = bool(getattr(vms[chosen_vm], "old_default_mounts", False))
209
+ default_target = (
210
+ default_mount_target(source_dir)
211
+ if not interactive or use_old_default
212
+ else source_dir
213
+ )
205
214
  if interactive:
206
215
  target_prompt = ask_text(
207
216
  tr("addmount.target_prompt"),
@@ -214,15 +223,14 @@ def _resolve_target_and_vm(
214
223
  else:
215
224
  chosen_target = chosen_target.expanduser().resolve()
216
225
 
217
- if chosen_vm is None:
218
- chosen_vm = _resolve_vm_name(None, vms, interactive)
219
-
220
226
  if _has_source_conflict(existing_mounts, source_dir, chosen_vm):
221
227
  message = tr("addmount.mount_exists", source=source_dir, vm_name=chosen_vm)
222
228
  if not can_retry_vm:
223
229
  raise click.ClickException(message)
224
230
  click.echo(message)
225
231
  chosen_vm = None
232
+ if can_retry_target:
233
+ chosen_target = None
226
234
  continue
227
235
 
228
236
  if _has_target_conflict(existing_mounts, chosen_target, chosen_vm):
@@ -344,6 +352,7 @@ def addmount_command(
344
352
 
345
353
  try:
346
354
  vms = load_vms_config(config_data)
355
+ global_config = load_global_config(config_data)
347
356
  except ConfigError as exc:
348
357
  raise click.ClickException(str(exc))
349
358
 
@@ -368,15 +377,6 @@ def addmount_command(
368
377
 
369
378
  source_dir = normalize_path(source_dir)
370
379
 
371
- if backup_dir is None:
372
- default_backup = default_mount_backup(source_dir)
373
- if interactive:
374
- backup_prompt = ask_path(tr("addmount.backup_prompt"), default=str(default_backup))
375
- backup_dir = Path(backup_prompt).expanduser()
376
- else:
377
- backup_dir = default_backup
378
-
379
- backup_dir = backup_dir.expanduser().resolve()
380
380
  target_dir, selected_vm = _resolve_target_and_vm(
381
381
  source_dir=source_dir,
382
382
  target_dir=target_dir,
@@ -386,6 +386,17 @@ def addmount_command(
386
386
  existing_mounts=existing_mounts,
387
387
  )
388
388
 
389
+ if backup_dir is None:
390
+ backups_root_folder = vms[selected_vm].backups_root_folder or global_config.backups_root_folder
391
+ default_backup = default_mount_backup(source_dir, backups_root_folder)
392
+ if interactive:
393
+ backup_prompt = ask_path(tr("addmount.backup_prompt"), default=str(default_backup))
394
+ backup_dir = Path(backup_prompt).expanduser()
395
+ else:
396
+ backup_dir = default_backup
397
+
398
+ backup_dir = backup_dir.expanduser().resolve()
399
+
389
400
  if interval is None and interactive:
390
401
  interval_minutes = _prompt_positive_int(
391
402
  tr("addmount.interval_prompt"),
@@ -201,6 +201,8 @@ def _prompt_vms() -> Dict[str, Dict[str, object]]:
201
201
  install = _prompt_bundle_selection()
202
202
  proxychains = _prompt_optional_proxy(tr("config_gen.vm_proxychains"))
203
203
  http_proxy = _prompt_optional_proxy(tr("config_gen.vm_http_proxy"))
204
+ old_default_mounts = ask_confirm(tr("config_gen.vm_old_default_mounts"), default=False)
205
+ backups_root_folder = _prompt_optional_path(tr("config_gen.vm_backups_root_folder"))
204
206
  port_forwarding = _prompt_port_forwarding()
205
207
 
206
208
  vm_entry: Dict[str, object] = {
@@ -214,6 +216,10 @@ def _prompt_vms() -> Dict[str, Dict[str, object]]:
214
216
  vm_entry["proxychains"] = proxychains
215
217
  if http_proxy:
216
218
  vm_entry["http_proxy"] = http_proxy
219
+ if old_default_mounts:
220
+ vm_entry["old_default_mounts"] = True
221
+ if backups_root_folder:
222
+ vm_entry["backups_root_folder"] = backups_root_folder
217
223
  if port_forwarding:
218
224
  vm_entry["port-forwarding"] = port_forwarding
219
225
  vms[name] = vm_entry
@@ -378,23 +384,41 @@ def _prompt_mount_allowed_agents(agent_names: List[str]) -> Optional[List[str]]:
378
384
  return [str(item) for item in selected]
379
385
 
380
386
 
381
- def _prompt_mounts(vm_names: List[str], agent_names: List[str]) -> List[Dict[str, object]]:
387
+ def _prompt_mounts(
388
+ vms: Dict[str, Dict[str, object]],
389
+ agent_names: List[str],
390
+ global_config: Dict[str, object],
391
+ ) -> List[Dict[str, object]]:
382
392
  mounts: List[Dict[str, object]] = []
383
393
  if not ask_confirm(tr("config_gen.mounts_enable"), default=False):
384
394
  return mounts
385
395
 
386
396
  while True:
387
397
  source_raw = ask_path(tr("config_gen.mount_source"), default="", validate=_validate_non_empty)
388
- source = Path(source_raw).expanduser()
398
+ source = Path(source_raw).expanduser().resolve()
389
399
  mount_name = _default_mount_name(source)
390
- target = ask_text(tr("config_gen.mount_target"), default=f"/home/ubuntu/{mount_name}", validate=_validate_non_empty)
391
- default_backup = source.parent / f"backups-{mount_name}"
392
- backup = ask_path(tr("config_gen.mount_backup"), default=str(default_backup))
393
400
 
401
+ vm_names = list(vms.keys())
394
402
  vm_name = vm_names[0]
395
403
  if len(vm_names) > 1:
396
404
  vm_name = ask_choice(tr("config_gen.mount_vm"), choices=vm_names, default=vm_names[0])
397
405
 
406
+ if bool(vms[vm_name].get("old_default_mounts", False)):
407
+ default_target = f"/home/ubuntu/{mount_name}"
408
+ else:
409
+ default_target = str(source)
410
+ target = ask_text(tr("config_gen.mount_target"), default=default_target, validate=_validate_non_empty)
411
+ backups_root_folder = vms[vm_name].get("backups_root_folder") or global_config.get(
412
+ "backups_root_folder"
413
+ )
414
+ backup_parent = (
415
+ Path(str(backups_root_folder)).expanduser().resolve()
416
+ if backups_root_folder
417
+ else source.parent
418
+ )
419
+ default_backup = backup_parent / f"backups-{mount_name}"
420
+ backup = ask_path(tr("config_gen.mount_backup"), default=str(default_backup))
421
+
398
422
  allowed_agents = _prompt_mount_allowed_agents(agent_names)
399
423
 
400
424
  if ask_confirm(tr("config_gen.mount_backupignore_create"), default=True):
@@ -426,12 +450,15 @@ def _prompt_global() -> Dict[str, object]:
426
450
  tr("config_gen.global_state_file"),
427
451
  default=str(DEFAULT_STATE_FILE_PATH),
428
452
  )
453
+ backups_root_folder = _prompt_optional_path(tr("config_gen.global_backups_root_folder"))
429
454
  if ssh_keys_folder:
430
455
  global_config["ssh_keys_folder"] = ssh_keys_folder
431
456
  if systemd_env_folder:
432
457
  global_config["systemd_env_folder"] = systemd_env_folder
433
458
  if state_file and Path(state_file).expanduser() != DEFAULT_STATE_FILE_PATH:
434
459
  global_config["state_file"] = state_file
460
+ if backups_root_folder:
461
+ global_config["backups_root_folder"] = backups_root_folder
435
462
 
436
463
  global_config["portforward_config_check_interval_sec"] = _prompt_positive_int(
437
464
  tr("config_gen.global_portforward_interval"),
@@ -503,10 +530,10 @@ def config_gen_command(config_path: Optional[str], overwrite: bool, non_interact
503
530
  vms = _prompt_vms()
504
531
  agents = _prompt_agents(list(vms.keys()))
505
532
  _apply_vm_allowed_agents(vms, agents)
506
- mounts = _prompt_mounts(list(vms.keys()), list(agents.keys()))
507
- global_config: Optional[Dict[str, object]] = None
533
+ global_config: Dict[str, object] = {}
508
534
  if ask_confirm(tr("config_gen.global_customize"), default=False):
509
535
  global_config = _prompt_global()
536
+ mounts = _prompt_mounts(vms, list(agents.keys()), global_config)
510
537
 
511
538
  destination = Path(ask_path(tr("config_gen.destination_prompt"), default=str(resolved_default_path))).expanduser()
512
539
  if destination.exists() and not overwrite:
@@ -66,6 +66,8 @@ class VmConfig:
66
66
  http_proxy: Optional["HttpProxyConfig"] = None
67
67
  allowed_agents: Optional[List[str]] = None
68
68
  install: List[str] = field(default_factory=list)
69
+ old_default_mounts: bool = False
70
+ backups_root_folder: Optional[Path] = None
69
71
 
70
72
 
71
73
  @dataclass
@@ -112,6 +114,7 @@ class GlobalConfig:
112
114
  check_new_version: bool = DEFAULT_VERSION_CHECK_ENABLED
113
115
  check_new_version_interval_sec: int = DEFAULT_VERSION_CHECK_INTERVAL_SEC
114
116
  http_proxy_port_pool: HttpProxyPortPoolConfig = HttpProxyPortPoolConfig()
117
+ backups_root_folder: Optional[Path] = None
115
118
 
116
119
 
117
120
  class ConfigError(RuntimeError):
@@ -266,6 +269,7 @@ def load_global_config(config: Dict[str, Any]) -> GlobalConfig:
266
269
  check_new_version_raw = raw_global.get("check_new_version")
267
270
  check_new_version_interval_raw = raw_global.get("check_new_version_interval_sec")
268
271
  http_proxy_port_pool_raw = raw_global.get("http_proxy_port_pool")
272
+ backups_root_folder_raw = raw_global.get("backups_root_folder")
269
273
 
270
274
  ssh_keys_folder = (
271
275
  DEFAULT_SSH_KEYS_DIR
@@ -307,6 +311,11 @@ def load_global_config(config: Dict[str, Any]) -> GlobalConfig:
307
311
  http_proxy_port_pool_raw,
308
312
  "global.http_proxy_port_pool",
309
313
  )
314
+ backups_root_folder = (
315
+ None
316
+ if backups_root_folder_raw is None
317
+ else _ensure_path(backups_root_folder_raw, "global.backups_root_folder")
318
+ )
310
319
 
311
320
  return GlobalConfig(
312
321
  ssh_keys_folder=ssh_keys_folder,
@@ -316,6 +325,7 @@ def load_global_config(config: Dict[str, Any]) -> GlobalConfig:
316
325
  check_new_version=check_new_version,
317
326
  check_new_version_interval_sec=check_new_version_interval_sec,
318
327
  http_proxy_port_pool=http_proxy_port_pool,
328
+ backups_root_folder=backups_root_folder,
319
329
  )
320
330
 
321
331
 
@@ -596,6 +606,18 @@ def load_vms_config(config: Dict[str, Any]) -> Dict[str, VmConfig]:
596
606
  http_proxy=_normalize_http_proxy(raw_entry.get("http_proxy"), "vms.{vm_name}.http_proxy".format(vm_name=vm_name)),
597
607
  allowed_agents=allowed_agents,
598
608
  install=install_bundles,
609
+ old_default_mounts=_require_bool(
610
+ raw_entry.get("old_default_mounts", False),
611
+ f"vms.{vm_name}.old_default_mounts",
612
+ ),
613
+ backups_root_folder=(
614
+ None
615
+ if raw_entry.get("backups_root_folder") is None
616
+ else _ensure_path(
617
+ raw_entry.get("backups_root_folder"),
618
+ f"vms.{vm_name}.backups_root_folder",
619
+ )
620
+ ),
599
621
  )
600
622
  except ValueError as exc:
601
623
  _raise_with_context(
@@ -631,16 +653,17 @@ def _default_target(source: Path) -> Path:
631
653
  return Path("/home/ubuntu") / source.name
632
654
 
633
655
 
634
- def _default_backup(source: Path) -> Path:
635
- return source.parent / f"backups-{source.name}"
656
+ def _default_backup(source: Path, backups_root_folder: Optional[Path] = None) -> Path:
657
+ root = backups_root_folder if backups_root_folder is not None else source.parent
658
+ return root / f"backups-{source.name}"
636
659
 
637
660
 
638
661
  def default_mount_target(source: Path) -> Path:
639
662
  return _default_target(source)
640
663
 
641
664
 
642
- def default_mount_backup(source: Path) -> Path:
643
- return _default_backup(source)
665
+ def default_mount_backup(source: Path, backups_root_folder: Optional[Path] = None) -> Path:
666
+ return _default_backup(source, backups_root_folder)
644
667
 
645
668
 
646
669
  def _default_vm_name(config: Dict[str, Any]) -> Optional[str]:
@@ -994,6 +1017,8 @@ def load_mounts_config(config: Dict[str, Any]) -> List[MountConfig]:
994
1017
 
995
1018
  raw_agents = config.get("agents")
996
1019
  known_agents = {str(name) for name in raw_agents.keys()} if isinstance(raw_agents, dict) else set()
1020
+ global_config = load_global_config(config)
1021
+ vm_configs = load_vms_config(config)
997
1022
 
998
1023
  mounts: List[MountConfig] = []
999
1024
  for index, entry in enumerate(raw_mounts):
@@ -1012,7 +1037,15 @@ def load_mounts_config(config: Dict[str, Any]) -> List[MountConfig]:
1012
1037
  raise ConfigError(tr("config.mount_entry_missing_vm", index=index + 1))
1013
1038
 
1014
1039
  target = _ensure_path(target_raw, f"mounts[{index}].target") if target_raw else _default_target(source)
1015
- backup = _ensure_path(backup_raw, f"mounts[{index}].backup") if backup_raw else _default_backup(source)
1040
+ vm_config = vm_configs.get(str(vm_name))
1041
+ if vm_config is None:
1042
+ raise ConfigError(tr("config.mount_entry_missing_vm", index=index + 1))
1043
+ backups_root_folder = vm_config.backups_root_folder or global_config.backups_root_folder
1044
+ backup = (
1045
+ _ensure_path(backup_raw, f"mounts[{index}].backup")
1046
+ if backup_raw
1047
+ else _default_backup(source, backups_root_folder)
1048
+ )
1016
1049
  interval_minutes = _normalize_interval(entry.get("interval"))
1017
1050
  max_backups = _normalize_max_backups(entry.get("max_backups"), index + 1)
1018
1051
  backup_clean_method = _normalize_backup_clean_method(entry.get("backup_clean_method"), index + 1)
@@ -234,6 +234,7 @@
234
234
  "config_gen.global_check_new_version_interval": "How often should agsekit check for new versions (seconds)?",
235
235
  "config_gen.global_customize": "Customize global agsekit settings?",
236
236
  "config_gen.global_intro": "Let's configure global agsekit settings.",
237
+ "config_gen.global_backups_root_folder": "Default backups root folder (leave empty to place backups next to the source)",
237
238
  "config_gen.global_portforward_interval": "How often should portforward reload the config (seconds)?",
238
239
  "config_gen.global_state_file": "State file override (leave the default to use ~/.config/agsekit/state.yaml)",
239
240
  "config_gen.global_ssh_keys_folder": "SSH keys folder override (leave empty to use the default ~/.config/agsekit/ssh)",
@@ -275,6 +276,8 @@
275
276
  "config_gen.vm_cpu": "How many vCPUs to allocate for {vm_name}?",
276
277
  "config_gen.vm_disk": "Disk size (e.g., 20G)",
277
278
  "config_gen.vm_name": "VM name",
279
+ "config_gen.vm_old_default_mounts": "Use legacy /home/ubuntu/<folder> defaults for mounts in this VM?",
280
+ "config_gen.vm_backups_root_folder": "Backups root folder for this VM (leave empty to inherit the global setting)",
278
281
  "config_gen.vm_port_forwarding_enable": "Configure port-forwarding for this VM?",
279
282
  "config_gen.vm_port_forwarding_add_more": "Add another port-forwarding rule?",
280
283
  "config_gen.vm_port_forwarding_host_addr": "Host address for port-forwarding (host:port)",
@@ -507,6 +510,7 @@
507
510
  "mounts.info_failed": "Failed to read Multipass VM details.",
508
511
  "mounts.info_parse_failed": "Failed to parse multipass info output.",
509
512
  "mounts.mount_failed": "Failed to mount {source} into {vm_name}:{target}",
513
+ "mounts.target_prepare_failed": "Failed to prepare mount directory {vm_name}:{target}",
510
514
  "mounts.mounted": "Mounted {source} in {vm_name}:{target}.",
511
515
  "mounts.mounting_requested": "Mounting requested directories via multipass...",
512
516
  "mounts.none_configured": "No mounts found in the configuration.",
@@ -234,6 +234,7 @@
234
234
  "config_gen.global_check_new_version_interval": "Как часто agsekit должен проверять новые версии (в секундах)?",
235
235
  "config_gen.global_customize": "Изменить глобальные настройки agsekit?",
236
236
  "config_gen.global_intro": "Настроим глобальные параметры agsekit.",
237
+ "config_gen.global_backups_root_folder": "Корневая папка бэкапов по умолчанию (оставьте пустой для папки рядом с source)",
237
238
  "config_gen.global_portforward_interval": "Как часто portforward должен перечитывать конфиг (в секундах)?",
238
239
  "config_gen.global_state_file": "Переопределение файла состояния (оставьте значение по умолчанию для ~/.config/agsekit/state.yaml)",
239
240
  "config_gen.global_ssh_keys_folder": "Переопределение папки SSH-ключей (оставьте пустым для ~/.config/agsekit/ssh)",
@@ -275,6 +276,8 @@
275
276
  "config_gen.vm_cpu": "Сколько vCPU выделить для {vm_name}?",
276
277
  "config_gen.vm_disk": "Размер диска (например, 20G)",
277
278
  "config_gen.vm_name": "Имя ВМ",
279
+ "config_gen.vm_old_default_mounts": "Использовать для mount'ов этой VM старые default-пути /home/ubuntu/<папка>?",
280
+ "config_gen.vm_backups_root_folder": "Корневая папка бэкапов для этой VM (оставьте пустой для глобальной настройки)",
278
281
  "config_gen.vm_port_forwarding_enable": "Настроить port-forwarding для этой ВМ?",
279
282
  "config_gen.vm_port_forwarding_add_more": "Добавить ещё одно правило port-forwarding?",
280
283
  "config_gen.vm_port_forwarding_host_addr": "Адрес на хосте для port-forwarding (host:port)",
@@ -507,6 +510,7 @@
507
510
  "mounts.info_failed": "Не удалось получить детали ВМ из Multipass.",
508
511
  "mounts.info_parse_failed": "Не удалось разобрать вывод multipass info.",
509
512
  "mounts.mount_failed": "Не удалось смонтировать {source} в {vm_name}:{target}",
513
+ "mounts.target_prepare_failed": "Не удалось подготовить директорию монтирования {vm_name}:{target}",
510
514
  "mounts.mounted": "Смонтировано {source} в {vm_name}:{target}.",
511
515
  "mounts.mounting_requested": "Смонтируем выбранные директории через multipass...",
512
516
  "mounts.none_configured": "В конфигурации не найдено монтирований.",
@@ -23,6 +23,28 @@ RegisteredMount = Tuple[Optional[Path], Optional[Path]]
23
23
  # across Multipass versions and output shapes.
24
24
  _MOUNT_SOURCE_KEYS = ("source", "source_path", "source path", "host_path", "host path", "local_path", "local path")
25
25
  _MOUNT_TARGET_KEYS = ("mount_path", "mount path", "target", "target_path", "target path", "destination", "path")
26
+ _PREPARE_MOUNT_TARGET_SCRIPT = r"""
27
+ set -e
28
+ target=$1
29
+ case "$target" in
30
+ /*) ;;
31
+ *) printf 'Mount target must be an absolute path: %s\n' "$target" >&2; exit 2 ;;
32
+ esac
33
+
34
+ current=
35
+ while IFS= read -r component; do
36
+ [ -n "$component" ] || continue
37
+ current="$current/$component"
38
+ if [ -e "$current" ]; then
39
+ if [ ! -d "$current" ]; then
40
+ printf 'Mount target component is not a directory: %s\n' "$current" >&2
41
+ exit 2
42
+ fi
43
+ else
44
+ sudo install -d -m 0755 -o ubuntu -g ubuntu -- "$current"
45
+ fi
46
+ done < <(printf '%s\n' "${target#/}" | tr '/' '\n')
47
+ """.strip()
26
48
 
27
49
 
28
50
  def normalize_path(path: Path) -> Path:
@@ -217,7 +239,25 @@ def _run_multipass(command: list[str], error_message: str, *, allow_already_moun
217
239
  raise MultipassError(stderr or error_message)
218
240
 
219
241
 
242
+ def ensure_guest_mount_target(mount: MountConfig) -> None:
243
+ _run_multipass(
244
+ [
245
+ multipass_command(),
246
+ "exec",
247
+ mount.vm_name,
248
+ "--",
249
+ "bash",
250
+ "-lc",
251
+ _PREPARE_MOUNT_TARGET_SCRIPT,
252
+ "agsekit-prepare-mount-target",
253
+ str(mount.target),
254
+ ],
255
+ tr("mounts.target_prepare_failed", vm_name=mount.vm_name, target=mount.target),
256
+ )
257
+
258
+
220
259
  def mount_directory(mount: MountConfig) -> None:
260
+ ensure_guest_mount_target(mount)
221
261
  _run_multipass(
222
262
  [multipass_command(), "mount", str(mount.source), f"{mount.vm_name}:{mount.target}"],
223
263
  tr("mounts.mount_failed", source=mount.source, vm_name=mount.vm_name, target=mount.target),
@@ -78,8 +78,39 @@ fi
78
78
  temp_dir=""
79
79
  privoxy_pid=""
80
80
  privoxy_config_path=""
81
+ managed_codex_command=""
82
+
83
+ export_proxy_environment() {
84
+ local proxy_url="$1"
85
+ local loopback_no_proxy="localhost,127.0.0.1,::1"
86
+
87
+ export HTTP_PROXY="$proxy_url"
88
+ export http_proxy="$proxy_url"
89
+ export HTTPS_PROXY="$proxy_url"
90
+ export https_proxy="$proxy_url"
91
+ export ALL_PROXY="$proxy_url"
92
+ export all_proxy="$proxy_url"
93
+ export WS_PROXY="$proxy_url"
94
+ export ws_proxy="$proxy_url"
95
+ export WSS_PROXY="$proxy_url"
96
+ export wss_proxy="$proxy_url"
97
+
98
+ if [[ -n "${NO_PROXY:-}" ]]; then
99
+ export NO_PROXY="$loopback_no_proxy,$NO_PROXY"
100
+ else
101
+ export NO_PROXY="$loopback_no_proxy"
102
+ fi
103
+ if [[ -n "${no_proxy:-}" ]]; then
104
+ export no_proxy="$loopback_no_proxy,$no_proxy"
105
+ else
106
+ export no_proxy="$loopback_no_proxy"
107
+ fi
108
+ }
81
109
 
82
110
  cleanup() {
111
+ if [[ -n "$managed_codex_command" ]]; then
112
+ "$managed_codex_command" app-server daemon stop >/dev/null 2>&1 || true
113
+ fi
83
114
  if [[ -n "$privoxy_pid" ]] && kill -0 "$privoxy_pid" >/dev/null 2>&1; then
84
115
  kill "$privoxy_pid" >/dev/null 2>&1 || true
85
116
  wait "$privoxy_pid" >/dev/null 2>&1 || true
@@ -93,11 +124,20 @@ cleanup() {
93
124
  fi
94
125
  }
95
126
 
127
+ prepare_managed_daemon() {
128
+ local command_path="$1"
129
+
130
+ if [[ "$(basename -- "$command_path")" == "codex" ]]; then
131
+ "$command_path" app-server daemon restart >/dev/null
132
+ managed_codex_command="$command_path"
133
+ fi
134
+ }
135
+
96
136
  trap cleanup EXIT INT TERM
97
137
 
98
138
  if [[ -n "$direct_url" ]]; then
99
- export HTTP_PROXY="$direct_url"
100
- export http_proxy="$direct_url"
139
+ export_proxy_environment "$direct_url"
140
+ prepare_managed_daemon "$1"
101
141
  "$@"
102
142
  exit $?
103
143
  fi
@@ -302,8 +342,8 @@ if ! wait_for_port "$listen_addr"; then
302
342
  exit 1
303
343
  fi
304
344
 
305
- export HTTP_PROXY="http://$client_host:$listen_port"
306
- export http_proxy="http://$client_host:$listen_port"
345
+ export_proxy_environment "http://$client_host:$listen_port"
307
346
 
347
+ prepare_managed_daemon "$1"
308
348
  "$@"
309
349
  exit $?
@@ -2,6 +2,7 @@ global: # global agsekit settings
2
2
  ssh_keys_folder: null # if set, overrides the folder with SSH keys used to connect to VMs; default: ~/.config/agsekit/ssh
3
3
  systemd_env_folder: null # if set, overrides the folder where agsekit writes systemd.env; default: ~/.config/agsekit
4
4
  state_file: null # if set, overrides the agsekit internal state file path; default: ~/.config/agsekit/state.yaml
5
+ backups_root_folder: null # default parent for backups-<folder>; null keeps backups next to the source
5
6
  portforward_config_check_interval_sec: 10 # how often portforward reloads the config and reconciles tunnels
6
7
  check_new_version: true # whether agsekit should periodically check PyPI for a newer version
7
8
  check_new_version_interval_sec: 600 # how often agsekit should check PyPI for a newer version
@@ -13,6 +14,8 @@ vms: # virtual machine settings (you can define multiple VMs)
13
14
  cpu: 2 # number of vCPUs
14
15
  ram: 4G # amount of RAM
15
16
  disk: 20G # disk size
17
+ old_default_mounts: false # true restores /home/ubuntu/<folder> suggestions during interactive mount creation
18
+ backups_root_folder: null # overrides global.backups_root_folder for mounts assigned to this VM
16
19
  allowed_agents: aider, qwen, forgecode, codex, opencode, claude, cline # optional: also accepts a list like [qwen, codex]; if omitted, all agents are allowed for this VM
17
20
  proxychains: "" # set a proxy URL (scheme://host:port); agsekit will generate a temporary proxychains.conf and wrap Multipass commands
18
21
  http_proxy: "" # optional shorthand for VM-local privoxy upstream (for example socks5://127.0.0.1:8181); for direct mode use a mapping with url: