fixos 2.2.55__tar.gz → 2.2.56__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 (237) hide show
  1. {fixos-2.2.55 → fixos-2.2.56}/PKG-INFO +1 -1
  2. fixos-2.2.56/VERSION +1 -0
  3. {fixos-2.2.55 → fixos-2.2.56}/fixos/agent/autonomous.py +6 -0
  4. {fixos-2.2.55 → fixos-2.2.56}/fixos/agent/autonomous_session.py +204 -4
  5. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/_cleanup_space.py +229 -7
  6. fixos-2.2.56/fixos/cli/fix_cmd.py +926 -0
  7. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/main.py +3 -0
  8. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/orchestrate_cmd.py +16 -5
  9. {fixos-2.2.55 → fixos-2.2.56}/fixos/orchestrator/graph.py +13 -0
  10. {fixos-2.2.55 → fixos-2.2.56}/fixos/orchestrator/orchestrator.py +89 -5
  11. {fixos-2.2.55 → fixos-2.2.56}/fixos.egg-info/PKG-INFO +1 -1
  12. {fixos-2.2.55 → fixos-2.2.56}/fixos.egg-info/SOURCES.txt +1 -0
  13. {fixos-2.2.55 → fixos-2.2.56}/pyproject.toml +1 -1
  14. fixos-2.2.56/tests/unit/test_auto_no_llm.py +234 -0
  15. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_quick_snapshot.py +2 -2
  16. fixos-2.2.55/VERSION +0 -1
  17. fixos-2.2.55/fixos/cli/fix_cmd.py +0 -416
  18. {fixos-2.2.55 → fixos-2.2.56}/.env.example +0 -0
  19. {fixos-2.2.55 → fixos-2.2.56}/CHANGELOG.md +0 -0
  20. {fixos-2.2.55 → fixos-2.2.56}/LICENSE +0 -0
  21. {fixos-2.2.55 → fixos-2.2.56}/MANIFEST.in +0 -0
  22. {fixos-2.2.55 → fixos-2.2.56}/README.md +0 -0
  23. {fixos-2.2.55 → fixos-2.2.56}/docker/README.md +0 -0
  24. {fixos-2.2.55 → fixos-2.2.56}/docker/TEST_RESULTS.md +0 -0
  25. {fixos-2.2.55 → fixos-2.2.56}/docker/TEST_RESULTS_V2.md +0 -0
  26. {fixos-2.2.55 → fixos-2.2.56}/docker/alpine/Dockerfile +0 -0
  27. {fixos-2.2.55 → fixos-2.2.56}/docker/arch/Dockerfile +0 -0
  28. {fixos-2.2.55 → fixos-2.2.56}/docker/base/Dockerfile +0 -0
  29. {fixos-2.2.55 → fixos-2.2.56}/docker/broken-audio/Dockerfile +0 -0
  30. {fixos-2.2.55 → fixos-2.2.56}/docker/broken-full/Dockerfile +0 -0
  31. {fixos-2.2.55 → fixos-2.2.56}/docker/broken-network/Dockerfile +0 -0
  32. {fixos-2.2.55 → fixos-2.2.56}/docker/broken-thumbnails/Dockerfile +0 -0
  33. {fixos-2.2.55 → fixos-2.2.56}/docker/debian/Dockerfile +0 -0
  34. {fixos-2.2.55 → fixos-2.2.56}/docker/docker-compose.multi-system.yml +0 -0
  35. {fixos-2.2.55 → fixos-2.2.56}/docker/docker-compose.yml +0 -0
  36. {fixos-2.2.55 → fixos-2.2.56}/docker/fedora/Dockerfile +0 -0
  37. {fixos-2.2.55 → fixos-2.2.56}/docker/test-multi-system.sh +0 -0
  38. {fixos-2.2.55 → fixos-2.2.56}/docker/test-scenarios.sh +0 -0
  39. {fixos-2.2.55 → fixos-2.2.56}/docker/ubuntu/Dockerfile +0 -0
  40. {fixos-2.2.55 → fixos-2.2.56}/docker/validate-scenario.py +0 -0
  41. {fixos-2.2.55 → fixos-2.2.56}/docs/examples/advanced_usage.py +0 -0
  42. {fixos-2.2.55 → fixos-2.2.56}/docs/examples/quickstart.py +0 -0
  43. {fixos-2.2.55 → fixos-2.2.56}/fixos/__init__.py +0 -0
  44. {fixos-2.2.55 → fixos-2.2.56}/fixos/__main__.py +0 -0
  45. {fixos-2.2.55 → fixos-2.2.56}/fixos/agent/__init__.py +0 -0
  46. {fixos-2.2.55 → fixos-2.2.56}/fixos/agent/hitl.py +0 -0
  47. {fixos-2.2.55 → fixos-2.2.56}/fixos/agent/hitl_session.py +0 -0
  48. {fixos-2.2.55 → fixos-2.2.56}/fixos/agent/session_core.py +0 -0
  49. {fixos-2.2.55 → fixos-2.2.56}/fixos/agent/session_handlers.py +0 -0
  50. {fixos-2.2.55 → fixos-2.2.56}/fixos/agent/session_io.py +0 -0
  51. {fixos-2.2.55 → fixos-2.2.56}/fixos/anonymizer.py +0 -0
  52. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/__init__.py +0 -0
  53. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/__main__.py +0 -0
  54. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/_cleanup_docker_volumes.py +0 -0
  55. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/_cleanup_flatpak.py +0 -0
  56. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/_cleanup_home.py +0 -0
  57. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/_cleanup_snap.py +0 -0
  58. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/_cleanup_system.py +0 -0
  59. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/_cleanup_utils.py +0 -0
  60. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/_cleanup_venvs.py +0 -0
  61. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/ask_cmd.py +0 -0
  62. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/cleanup_cmd.py +0 -0
  63. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/config_cmd.py +0 -0
  64. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/dashboard.py +0 -0
  65. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/features_cmd.py +0 -0
  66. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/history_cmd.py +0 -0
  67. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/jetbrains_cmd.py +0 -0
  68. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/output_formatter.py +0 -0
  69. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/profile_cmd.py +0 -0
  70. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/projects_cmd.py +0 -0
  71. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/provider_cmd.py +0 -0
  72. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/quick_cmd.py +0 -0
  73. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/quickfix_cmd.py +0 -0
  74. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/report_cmd.py +0 -0
  75. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/rollback_cmd.py +0 -0
  76. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/scan_cmd.py +0 -0
  77. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/shared.py +0 -0
  78. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/shell_cmd.py +0 -0
  79. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/token_cmd.py +0 -0
  80. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli/watch_cmd.py +0 -0
  81. {fixos-2.2.55 → fixos-2.2.56}/fixos/cli.py +0 -0
  82. {fixos-2.2.55 → fixos-2.2.56}/fixos/config.py +0 -0
  83. {fixos-2.2.55 → fixos-2.2.56}/fixos/config_interactive.py +0 -0
  84. {fixos-2.2.55 → fixos-2.2.56}/fixos/constants.py +0 -0
  85. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/__init__.py +0 -0
  86. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/_flatpak_analysis_mixin.py +0 -0
  87. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/_flatpak_execution_mixin.py +0 -0
  88. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/_flatpak_recommendations_mixin.py +0 -0
  89. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/_storage_container_mixin.py +0 -0
  90. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/_storage_system_mixin.py +0 -0
  91. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/_storage_user_mixin.py +0 -0
  92. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/cache_discovery.py +0 -0
  93. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/__init__.py +0 -0
  94. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/_shared.py +0 -0
  95. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/audio.py +0 -0
  96. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/file_analysis.py +0 -0
  97. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/hardware.py +0 -0
  98. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/packages.py +0 -0
  99. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/resources.py +0 -0
  100. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/security.py +0 -0
  101. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/storage_optimization.py +0 -0
  102. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/system_core.py +0 -0
  103. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/checks/thumbnails.py +0 -0
  104. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/dev_project_analyzer.py +0 -0
  105. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/disk_analyzer.py +0 -0
  106. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/docker_network_cleanup.py +0 -0
  107. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/docker_startup_optimizer.py +0 -0
  108. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/flatpak_analyzer.py +0 -0
  109. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/jetbrains_ai.py +0 -0
  110. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/jetbrains_recovery.py +0 -0
  111. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/native_scan.py +0 -0
  112. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/orphaned_workloads.py +0 -0
  113. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/process_chains.py +0 -0
  114. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/project_scanner.py +0 -0
  115. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/quick_snapshot.py +0 -0
  116. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/service_cleanup.py +0 -0
  117. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/service_details.py +0 -0
  118. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/service_scanner.py +0 -0
  119. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/storage_analyzer.py +0 -0
  120. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/system_checks.py +0 -0
  121. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/utils.py +0 -0
  122. {fixos-2.2.55 → fixos-2.2.56}/fixos/diagnostics/venv_cleanup.py +0 -0
  123. {fixos-2.2.55 → fixos-2.2.56}/fixos/endpoint_refresh.py +0 -0
  124. {fixos-2.2.55 → fixos-2.2.56}/fixos/features/__init__.py +0 -0
  125. {fixos-2.2.55 → fixos-2.2.56}/fixos/features/auditor.py +0 -0
  126. {fixos-2.2.55 → fixos-2.2.56}/fixos/features/catalog.py +0 -0
  127. {fixos-2.2.55 → fixos-2.2.56}/fixos/features/data/packages.yaml +0 -0
  128. {fixos-2.2.55 → fixos-2.2.56}/fixos/features/data/profiles/developer.yaml +0 -0
  129. {fixos-2.2.55 → fixos-2.2.56}/fixos/features/data/profiles/office.yaml +0 -0
  130. {fixos-2.2.55 → fixos-2.2.56}/fixos/features/data/profiles/sysadmin.yaml +0 -0
  131. {fixos-2.2.55 → fixos-2.2.56}/fixos/features/installer.py +0 -0
  132. {fixos-2.2.55 → fixos-2.2.56}/fixos/features/profiles.py +0 -0
  133. {fixos-2.2.55 → fixos-2.2.56}/fixos/features/renderer.py +0 -0
  134. {fixos-2.2.55 → fixos-2.2.56}/fixos/fixes/__init__.py +0 -0
  135. {fixos-2.2.55 → fixos-2.2.56}/fixos/interactive/__init__.py +0 -0
  136. {fixos-2.2.55 → fixos-2.2.56}/fixos/interactive/cleanup_planner.py +0 -0
  137. {fixos-2.2.55 → fixos-2.2.56}/fixos/llm_shell.py +0 -0
  138. {fixos-2.2.55 → fixos-2.2.56}/fixos/orchestrator/__init__.py +0 -0
  139. {fixos-2.2.55 → fixos-2.2.56}/fixos/orchestrator/executor.py +0 -0
  140. {fixos-2.2.55 → fixos-2.2.56}/fixos/orchestrator/rollback.py +0 -0
  141. {fixos-2.2.55 → fixos-2.2.56}/fixos/orphan_pins.py +0 -0
  142. {fixos-2.2.55 → fixos-2.2.56}/fixos/platform_utils.py +0 -0
  143. {fixos-2.2.55 → fixos-2.2.56}/fixos/plugins/__init__.py +0 -0
  144. {fixos-2.2.55 → fixos-2.2.56}/fixos/plugins/base.py +0 -0
  145. {fixos-2.2.55 → fixos-2.2.56}/fixos/plugins/builtin/__init__.py +0 -0
  146. {fixos-2.2.55 → fixos-2.2.56}/fixos/plugins/builtin/audio.py +0 -0
  147. {fixos-2.2.55 → fixos-2.2.56}/fixos/plugins/builtin/disk.py +0 -0
  148. {fixos-2.2.55 → fixos-2.2.56}/fixos/plugins/builtin/hardware.py +0 -0
  149. {fixos-2.2.55 → fixos-2.2.56}/fixos/plugins/builtin/resources.py +0 -0
  150. {fixos-2.2.55 → fixos-2.2.56}/fixos/plugins/builtin/security.py +0 -0
  151. {fixos-2.2.55 → fixos-2.2.56}/fixos/plugins/builtin/thumbnails.py +0 -0
  152. {fixos-2.2.55 → fixos-2.2.56}/fixos/plugins/registry.py +0 -0
  153. {fixos-2.2.55 → fixos-2.2.56}/fixos/profiles/__init__.py +0 -0
  154. {fixos-2.2.55 → fixos-2.2.56}/fixos/profiles/desktop.yaml +0 -0
  155. {fixos-2.2.55 → fixos-2.2.56}/fixos/profiles/developer.yaml +0 -0
  156. {fixos-2.2.55 → fixos-2.2.56}/fixos/profiles/minimal.yaml +0 -0
  157. {fixos-2.2.55 → fixos-2.2.56}/fixos/profiles/server.yaml +0 -0
  158. {fixos-2.2.55 → fixos-2.2.56}/fixos/providers/__init__.py +0 -0
  159. {fixos-2.2.55 → fixos-2.2.56}/fixos/providers/gemini_native.py +0 -0
  160. {fixos-2.2.55 → fixos-2.2.56}/fixos/providers/llm.py +0 -0
  161. {fixos-2.2.55 → fixos-2.2.56}/fixos/providers/llm_analyzer.py +0 -0
  162. {fixos-2.2.55 → fixos-2.2.56}/fixos/providers/schemas.py +0 -0
  163. {fixos-2.2.55 → fixos-2.2.56}/fixos/system_checks.py +0 -0
  164. {fixos-2.2.55 → fixos-2.2.56}/fixos/utils/__init__.py +0 -0
  165. {fixos-2.2.55 → fixos-2.2.56}/fixos/utils/anonymizer.py +0 -0
  166. {fixos-2.2.55 → fixos-2.2.56}/fixos/utils/terminal.py +0 -0
  167. {fixos-2.2.55 → fixos-2.2.56}/fixos/utils/timeout.py +0 -0
  168. {fixos-2.2.55 → fixos-2.2.56}/fixos/utils/web_search.py +0 -0
  169. {fixos-2.2.55 → fixos-2.2.56}/fixos/watch.py +0 -0
  170. {fixos-2.2.55 → fixos-2.2.56}/fixos.egg-info/dependency_links.txt +0 -0
  171. {fixos-2.2.55 → fixos-2.2.56}/fixos.egg-info/entry_points.txt +0 -0
  172. {fixos-2.2.55 → fixos-2.2.56}/fixos.egg-info/requires.txt +0 -0
  173. {fixos-2.2.55 → fixos-2.2.56}/fixos.egg-info/top_level.txt +0 -0
  174. {fixos-2.2.55 → fixos-2.2.56}/pytest.ini +0 -0
  175. {fixos-2.2.55 → fixos-2.2.56}/requirements-dev.txt +0 -0
  176. {fixos-2.2.55 → fixos-2.2.56}/requirements.txt +0 -0
  177. {fixos-2.2.55 → fixos-2.2.56}/scripts/pyqual-calibrate.py +0 -0
  178. {fixos-2.2.55 → fixos-2.2.56}/setup.cfg +0 -0
  179. {fixos-2.2.55 → fixos-2.2.56}/setup.py +0 -0
  180. {fixos-2.2.55 → fixos-2.2.56}/tests/__init__.py +0 -0
  181. {fixos-2.2.55 → fixos-2.2.56}/tests/conftest.py +0 -0
  182. {fixos-2.2.55 → fixos-2.2.56}/tests/e2e/__init__.py +0 -0
  183. {fixos-2.2.55 → fixos-2.2.56}/tests/e2e/test_anonymization_layers.py +0 -0
  184. {fixos-2.2.55 → fixos-2.2.56}/tests/e2e/test_audio_broken.py +0 -0
  185. {fixos-2.2.55 → fixos-2.2.56}/tests/e2e/test_cli.py +0 -0
  186. {fixos-2.2.55 → fixos-2.2.56}/tests/e2e/test_diagnostics_integration.py +0 -0
  187. {fixos-2.2.55 → fixos-2.2.56}/tests/e2e/test_executor.py +0 -0
  188. {fixos-2.2.55 → fixos-2.2.56}/tests/e2e/test_multi_system.py +0 -0
  189. {fixos-2.2.55 → fixos-2.2.56}/tests/e2e/test_network_broken.py +0 -0
  190. {fixos-2.2.55 → fixos-2.2.56}/tests/e2e/test_thumbnails_broken.py +0 -0
  191. {fixos-2.2.55 → fixos-2.2.56}/tests/test_fixos.py +0 -0
  192. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/__init__.py +0 -0
  193. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_anonymizer.py +0 -0
  194. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_ask_and_nl_group.py +0 -0
  195. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cache_discovery.py +0 -0
  196. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cleanup_cmd.py +0 -0
  197. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cleanup_docker_volumes.py +0 -0
  198. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cleanup_effectiveness.py +0 -0
  199. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cleanup_planner.py +0 -0
  200. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cleanup_retention.py +0 -0
  201. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cleanup_safety.py +0 -0
  202. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cleanup_space.py +0 -0
  203. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cleanup_tmp.py +0 -0
  204. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cleanup_utils.py +0 -0
  205. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_cli_main.py +0 -0
  206. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_core.py +0 -0
  207. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_dashboard.py +0 -0
  208. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_dev_project_analyzer.py +0 -0
  209. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_disk_analyzer.py +0 -0
  210. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_docker_network_cleanup.py +0 -0
  211. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_docker_startup_optimizer.py +0 -0
  212. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_endpoint_refresh.py +0 -0
  213. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_executor.py +0 -0
  214. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_gemini_native_client.py +0 -0
  215. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_jetbrains_cmd.py +0 -0
  216. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_jetbrains_recovery.py +0 -0
  217. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_llm_auth_stop.py +0 -0
  218. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_llm_provider.py +0 -0
  219. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_native_scan.py +0 -0
  220. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_ollama_endpoint.py +0 -0
  221. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_orchestrator.py +0 -0
  222. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_orphan_pins.py +0 -0
  223. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_orphaned_workloads.py +0 -0
  224. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_packaging_data.py +0 -0
  225. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_process_chains.py +0 -0
  226. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_project_scanner.py +0 -0
  227. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_projects_cmd.py +0 -0
  228. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_quick_cmd.py +0 -0
  229. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_resources_quick.py +0 -0
  230. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_security_quick.py +0 -0
  231. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_service_cleanup.py +0 -0
  232. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_service_scanner.py +0 -0
  233. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_shell_ux.py +0 -0
  234. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_storage_analyzer.py +0 -0
  235. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_system_checks_parallel.py +0 -0
  236. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_venv_cleanup.py +0 -0
  237. {fixos-2.2.55 → fixos-2.2.56}/tests/unit/test_version_parity.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fixos
3
- Version: 2.2.55
3
+ Version: 2.2.56
4
4
  Summary: AI-powered Linux/Windows diagnostics and repair – audio, hardware, system issues
5
5
  Home-page: https://github.com/wronai/fixos
6
6
  Author: fixos contributors
fixos-2.2.56/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.2.56
@@ -33,6 +33,9 @@ def run_autonomous_session(
33
33
  config,
34
34
  show_data: bool = True,
35
35
  max_fixes: int = 10,
36
+ auto_confirm: bool = False,
37
+ use_llm: bool | None = None,
38
+ dry_run: bool = False,
36
39
  ) -> AgentReport:
37
40
  """
38
41
  Uruchamia autonomiczny tryb agenta.
@@ -45,5 +48,8 @@ def run_autonomous_session(
45
48
  config=config,
46
49
  show_data=show_data,
47
50
  max_fixes=max_fixes,
51
+ auto_confirm=auto_confirm,
52
+ use_llm=use_llm,
53
+ dry_run=dry_run,
48
54
  )
49
55
  return session.run()
@@ -120,11 +120,18 @@ class AutonomousSession:
120
120
  config: FixOsConfig,
121
121
  show_data: bool = True,
122
122
  max_fixes: int = 10,
123
+ auto_confirm: bool = False,
124
+ use_llm: bool | None = None,
125
+ dry_run: bool = False,
123
126
  ):
124
127
  self.diagnostics = diagnostics
125
128
  self.config = config
126
129
  self.show_data = show_data
127
130
  self.max_fixes = max_fixes
131
+ self.auto_confirm = auto_confirm
132
+ self.use_llm = use_llm
133
+ self.dry_run = dry_run
134
+ self._heuristic_queue: list[dict[str, Any]] | None = None
128
135
  self.llm = LLMClient(config)
129
136
  self.report = AgentReport()
130
137
  self.fix_count = 0
@@ -133,6 +140,22 @@ class AutonomousSession:
133
140
  self.start_time = time.time()
134
141
  self._setup_timeout()
135
142
 
143
+ def _is_llm_active(self) -> bool:
144
+ """Return True if LLM calls should be used, False for LLM-free heuristic mode."""
145
+ if getattr(self, "use_llm", None) is False:
146
+ return False
147
+ if getattr(self, "use_llm", None) is True:
148
+ return True
149
+ llm_obj = getattr(self, "llm", None)
150
+ if llm_obj is not None and not isinstance(llm_obj, LLMClient):
151
+ return True
152
+ cfg = getattr(self, "config", None)
153
+ if cfg is None:
154
+ return False
155
+ if hasattr(cfg, "validate") and callable(cfg.validate):
156
+ return len(cfg.validate()) == 0
157
+ return bool(getattr(cfg, "api_key", None))
158
+
136
159
  def _setup_timeout(self) -> None:
137
160
  """Setup session timeout handler."""
138
161
 
@@ -148,17 +171,34 @@ class AutonomousSession:
148
171
 
149
172
  def _confirm_start(self) -> bool:
150
173
  """Ask user for confirmation before starting autonomous mode."""
174
+ import sys
175
+
176
+ llm_active = self._is_llm_active()
177
+ model_label = (
178
+ getattr(self.config, "model", "unknown")
179
+ if llm_active
180
+ else "heurystyki lokalne (bez LLM)"
181
+ )
151
182
  print(f"\n{'═' * UI_BORDER_WIDTH}")
152
183
  print(" ⚠️ TRYB AUTONOMICZNY – agent sam wykonuje komendy!")
153
184
  print(" Naciśnij Ctrl+C w dowolnym momencie aby przerwać.")
154
185
  print("═" * UI_BORDER_WIDTH)
155
186
  print(f"\n Max napraw: {self.max_fixes}")
156
187
  print(f" Timeout sesji: {self.config.session_timeout}s")
157
- print(f" Model: {self.config.model}")
188
+ print(f" Model: {model_label}")
189
+
190
+ if getattr(self, "auto_confirm", False):
191
+ print(" Potwierdzenie: automatyczne (--yes / fixos auto)")
192
+ return True
158
193
 
159
- confirm = input(
160
- "\n Czy na pewno chcesz uruchomić tryb autonomiczny? (yes/N): "
161
- ).strip()
194
+ try:
195
+ confirm = input(
196
+ "\n Czy na pewno chcesz uruchomić tryb autonomiczny? (yes/N): "
197
+ ).strip()
198
+ except EOFError:
199
+ if not (hasattr(sys.stdin, "isatty") and sys.stdin.isatty()):
200
+ print(" Brak interaktywnego terminala — anulowano (użyj --yes lub fixos auto).")
201
+ return False
162
202
  if confirm.lower() not in ("yes", "tak"):
163
203
  print(" Anulowano. Użyj --mode hitl dla trybu z potwierdzeniem.")
164
204
  return False
@@ -166,6 +206,8 @@ class AutonomousSession:
166
206
 
167
207
  def _initialize_messages(self) -> None:
168
208
  """Initialize LLM message history with system prompt and diagnostics."""
209
+ if not self._is_llm_active():
210
+ return
169
211
  anon_str, anon_report = anonymize(str(self.diagnostics))
170
212
  if self.show_data:
171
213
  display_anonymized_preview(anon_str, anon_report)
@@ -181,6 +223,155 @@ class AutonomousSession:
181
223
  },
182
224
  ]
183
225
 
226
+ @staticmethod
227
+ def _is_command_applicable_on_host(cmd: str) -> bool:
228
+ """Check whether a heuristic repair command targets tools/units present on this host."""
229
+ import shlex
230
+ import shutil
231
+ from pathlib import Path
232
+
233
+ try:
234
+ tokens = shlex.split(cmd)
235
+ except ValueError:
236
+ tokens = cmd.split()
237
+ idx = 0
238
+ while idx < len(tokens) and (
239
+ tokens[idx] in ("sudo", "env", "nohup") or "=" in tokens[idx] or tokens[idx].startswith("-")
240
+ ):
241
+ idx += 1
242
+ if idx >= len(tokens):
243
+ return False
244
+ prog = tokens[idx]
245
+ if prog in ("dnf", "yum", "pacman", "zypper", "apk", "ufw", "firewall-cmd"):
246
+ if shutil.which(prog) is None:
247
+ return False
248
+ if prog == "systemctl" and "firewalld" in tokens:
249
+ if (
250
+ shutil.which("firewall-cmd") is None
251
+ and not Path("/lib/systemd/system/firewalld.service").exists()
252
+ and not Path("/usr/lib/systemd/system/firewalld.service").exists()
253
+ ):
254
+ return False
255
+ return True
256
+
257
+ def _build_heuristic_actions(self) -> list[dict[str, Any]]:
258
+ """Build deterministic repair and safe cleanup actions without LLM."""
259
+ from .session_core import package_cleanup_guard
260
+
261
+ actions: list[dict[str, Any]] = []
262
+ seen_commands: set[str] = set()
263
+
264
+ def _add_candidate(cmd: str, reason: str, severity: str = "warning") -> None:
265
+ cmd_clean = (cmd or "").strip()
266
+ if not cmd_clean or cmd_clean in seen_commands:
267
+ return
268
+ if self._is_forbidden(cmd_clean) or package_cleanup_guard(cmd_clean):
269
+ return
270
+ if not self._is_command_applicable_on_host(cmd_clean):
271
+ return
272
+ seen_commands.add(cmd_clean)
273
+ if reason and reason not in self.report.problems_found:
274
+ self.report.problems_found.append(reason)
275
+ actions.append(
276
+ {
277
+ "action": "EXEC",
278
+ "command": cmd_clean,
279
+ "reason": reason or "Naprawa heurystyczna (bez LLM)",
280
+ "analysis": f"[{severity}] {reason or cmd_clean}",
281
+ "severity": severity,
282
+ }
283
+ )
284
+
285
+ diag = self.diagnostics if isinstance(self.diagnostics, dict) else {}
286
+
287
+ # 1. Inspect findings already present in diagnostics dict
288
+ for key, val in diag.items():
289
+ if isinstance(val, dict):
290
+ for item in val.get("findings", []) or val.get("problems", []) or []:
291
+ if isinstance(item, dict) and item.get("command"):
292
+ sev = str(item.get("severity", "warning")).lower()
293
+ if sev in ("critical", "warning", "high", "error"):
294
+ _add_candidate(
295
+ str(item["command"]),
296
+ str(item.get("title") or item.get("description") or key),
297
+ sev,
298
+ )
299
+
300
+ # 2. Run offline diagnostic plugins if no findings were pre-populated
301
+ if not actions and diag.get("_run_plugins", True) is not False:
302
+ try:
303
+ from ..plugins.base import Severity
304
+ from ..plugins.registry import PluginRegistry
305
+
306
+ registry = PluginRegistry()
307
+ registry.discover()
308
+ for res in registry.run():
309
+ for finding in res.findings:
310
+ if finding.command and finding.severity in (
311
+ Severity.CRITICAL,
312
+ Severity.WARNING,
313
+ ):
314
+ _add_candidate(
315
+ finding.command,
316
+ f"{finding.title}: {finding.description}",
317
+ finding.severity.value,
318
+ )
319
+ except Exception: # noqa: BLE001
320
+ pass
321
+
322
+ # 3. Extract safe disk cleanup suggestions if disk_analysis is present
323
+ disk_analysis = diag.get("disk_analysis")
324
+ if isinstance(disk_analysis, dict):
325
+ suggestions = disk_analysis.get("suggestions", [])
326
+ if suggestions:
327
+ try:
328
+ from ..interactive.cleanup_planner import CleanupPlanner
329
+
330
+ plan = CleanupPlanner().create_cleanup_plan(suggestions)
331
+ for item in plan.get("prioritized_actions", []):
332
+ if item.get("safe") and item.get("command"):
333
+ _add_candidate(
334
+ str(item["command"]),
335
+ str(item.get("description") or "Bezpieczne czyszczenie dysku"),
336
+ str(item.get("priority") or "medium"),
337
+ )
338
+ except Exception: # noqa: BLE001
339
+ pass
340
+
341
+ return actions
342
+
343
+ def _process_heuristic_turn(self) -> bool:
344
+ """Execute one deterministic turn without calling an LLM."""
345
+ self._check_timeout()
346
+ if self._heuristic_queue is None:
347
+ self._heuristic_queue = self._build_heuristic_actions()
348
+
349
+ if not self._heuristic_queue:
350
+ self._handle_done()
351
+ return False
352
+
353
+ remaining = self._get_remaining_time()
354
+ print(
355
+ f" ⟳ Tura {self.fix_count + 1}/{self.max_fixes} | ⏰ {remaining}s pozostało (tryb bez LLM)"
356
+ )
357
+ action_data = self._heuristic_queue.pop(0)
358
+ analysis = action_data.get("analysis", "")
359
+ reason = action_data.get("reason", "")
360
+ cmd = action_data.get("command", "")
361
+ print(f"\n 📋 Analiza: {analysis}")
362
+ print(f" 🎯 Akcja: EXEC – {reason}")
363
+
364
+ if getattr(self, "dry_run", False):
365
+ print(f" [DRY-RUN] Pominięto wykonanie: {cmd}")
366
+ self.report.fixes_applied.append(
367
+ FixAction(command=cmd, reason=reason, result="[DRY-RUN]", success=True)
368
+ )
369
+ self.fix_count += 1
370
+ return True
371
+
372
+ self._handle_exec(action_data)
373
+ return True
374
+
184
375
  def _get_remaining_time(self) -> int:
185
376
  """Get remaining session time in seconds."""
186
377
  from . import get_remaining_time
@@ -376,6 +567,9 @@ class AutonomousSession:
376
567
 
377
568
  Returns False if session should end, True to continue.
378
569
  """
570
+ if not self._is_llm_active():
571
+ return self._process_heuristic_turn()
572
+
379
573
  self._check_timeout()
380
574
  remaining = self._get_remaining_time()
381
575
  print(
@@ -468,6 +662,9 @@ def run_autonomous_session(
468
662
  config: FixOsConfig,
469
663
  show_data: bool = True,
470
664
  max_fixes: int = 10,
665
+ auto_confirm: bool = False,
666
+ use_llm: bool | None = None,
667
+ dry_run: bool = False,
471
668
  ) -> AgentReport:
472
669
  """Run autonomous session (backward compatible wrapper)."""
473
670
  session = AutonomousSession(
@@ -475,5 +672,8 @@ def run_autonomous_session(
475
672
  config=config,
476
673
  show_data=show_data,
477
674
  max_fixes=max_fixes,
675
+ auto_confirm=auto_confirm,
676
+ use_llm=use_llm,
677
+ dry_run=dry_run,
478
678
  )
479
679
  return session.run()
@@ -144,13 +144,24 @@ def _remove_path(path: Path) -> tuple[bool, str]:
144
144
  else:
145
145
  shutil.rmtree(path)
146
146
  return True, "usunięto"
147
+ except PermissionError as exc:
148
+ return False, f"PERMISSION_DENIED:{exc}"
147
149
  except OSError as exc:
150
+ if path.is_dir() and not path.is_symlink():
151
+ shutil.rmtree(path, ignore_errors=True)
152
+ if not path.exists():
153
+ return True, "usunięto"
154
+ return True, "oczyszczono zawartość"
148
155
  return False, str(exc)
149
156
 
150
157
 
158
+ _MAX_DISPLAY_CANDIDATES = 50
159
+
160
+
151
161
  def _display_candidates(title: str, candidates: list[dict]) -> None:
152
162
  click.echo(f"\n{click.style(title, fg='magenta', bold=True)}")
153
- for index, item in enumerate(candidates, 1):
163
+ shown = candidates[:_MAX_DISPLAY_CANDIDATES]
164
+ for index, item in enumerate(shown, 1):
154
165
  size = _format_bytes(item.get("size_bytes", 0))
155
166
  detail = item.get("note", "")
156
167
  suffix = f" — {detail}" if detail else ""
@@ -158,23 +169,104 @@ def _display_candidates(title: str, candidates: list[dict]) -> None:
158
169
  f" [{index:3d}] {click.style(item['description'], fg='yellow')}: "
159
170
  f"{size}{suffix}"
160
171
  )
161
- click.echo(f"\n Kandydatów: {len(candidates)}")
172
+ if len(candidates) > _MAX_DISPLAY_CANDIDATES:
173
+ hidden = candidates[_MAX_DISPLAY_CANDIDATES:]
174
+ hidden_bytes = sum(item.get("size_bytes", 0) for item in hidden)
175
+ click.echo(
176
+ f" ... i {len(hidden)} pozostałych pozycji "
177
+ f"({_format_bytes(hidden_bytes)})"
178
+ )
179
+ total_bytes = sum(item.get("size_bytes", 0) for item in candidates)
180
+ click.echo(
181
+ f"\n Kandydatów: {len(candidates)} (łącznie {_format_bytes(total_bytes)})"
182
+ )
183
+
184
+
185
+ def _batch_sudo_remove_tmp(items: list[dict], path_key: str = "path") -> tuple[int, int]:
186
+ """Remove root-owned /tmp items in batches using non-interactive sudo if available."""
187
+ if not items or shutil.which("sudo") is None:
188
+ return 0, 0
189
+ safe_items = []
190
+ for item in items:
191
+ p = Path(item[path_key])
192
+ if p.parent == Path("/tmp") and not any(
193
+ p.name.startswith(pref) for pref in _EXCLUDED_TMP_PREFIXES
194
+ ):
195
+ safe_items.append(item)
196
+ if not safe_items:
197
+ return 0, 0
198
+ removed = 0
199
+ freed = 0
200
+ chunk_size = 500
201
+ for start in range(0, len(safe_items), chunk_size):
202
+ chunk = safe_items[start : start + chunk_size]
203
+ cmd = ["sudo", "-n", "rm", "-rf", "--", *[str(it[path_key]) for it in chunk]]
204
+ try:
205
+ res = _run_cmd(cmd, timeout=60)
206
+ if res.returncode == 0:
207
+ removed += len(chunk)
208
+ freed += sum(int(it.get("size_bytes", 0) or 0) for it in chunk)
209
+ except (OSError, subprocess.TimeoutExpired):
210
+ break
211
+ return removed, freed
162
212
 
163
213
 
164
214
  def _remove_selected(
165
215
  candidates: list[dict], selected: list[int], path_key: str = "path"
166
216
  ) -> None:
217
+ verbose = len(selected) <= _MAX_DISPLAY_CANDIDATES
218
+ removed_count = 0
219
+ failed_count = 0
220
+ freed_bytes = 0
221
+ perm_denied_items: list[dict] = []
167
222
  for index in selected:
168
223
  item = candidates[index]
169
224
  ok, detail = _remove_path(item[path_key])
170
- style = "green" if ok else "red"
171
- click.echo(click.style(f" {item['description']}: {detail}", fg=style))
225
+ if ok:
226
+ removed_count += 1
227
+ freed_bytes += int(item.get("size_bytes", 0) or 0)
228
+ elif detail.startswith("PERMISSION_DENIED:"):
229
+ perm_denied_items.append(item)
230
+ detail = detail.removeprefix("PERMISSION_DENIED:")
231
+ failed_count += 1
232
+ else:
233
+ failed_count += 1
234
+ if verbose:
235
+ style = "green" if ok else "red"
236
+ click.echo(click.style(f" {item['description']}: {detail}", fg=style))
237
+ if perm_denied_items:
238
+ sudo_removed, sudo_freed = _batch_sudo_remove_tmp(perm_denied_items, path_key=path_key)
239
+ if sudo_removed > 0:
240
+ removed_count += sudo_removed
241
+ freed_bytes += sudo_freed
242
+ failed_count = max(0, failed_count - sudo_removed)
243
+ if verbose:
244
+ click.echo(
245
+ click.style(
246
+ f" Usunięto przez sudo (/tmp): {sudo_removed} pozycji ({_format_bytes(sudo_freed)})",
247
+ fg="green",
248
+ )
249
+ )
250
+ if not verbose:
251
+ click.echo(
252
+ click.style(
253
+ f" Usunięto {removed_count}/{len(selected)} pozycji "
254
+ f"(zwolniono {_format_bytes(freed_bytes)})",
255
+ fg="green" if failed_count == 0 else "yellow",
256
+ )
257
+ )
258
+ if failed_count:
259
+ click.echo(
260
+ click.style(f" Nie udało się usunąć: {failed_count} pozycji", fg="red")
261
+ )
172
262
 
173
263
 
174
264
  def _show_dry_run_commands(commands: list[list[str]]) -> None:
175
265
  click.echo(click.style("[TRYB DRY-RUN] - brak faktycznych zmian", fg="cyan"))
176
- for command in commands:
266
+ for command in commands[:_MAX_DISPLAY_CANDIDATES]:
177
267
  click.echo(f" $ {' '.join(command)}")
268
+ if len(commands) > _MAX_DISPLAY_CANDIDATES:
269
+ click.echo(f" ... i {len(commands) - _MAX_DISPLAY_CANDIDATES} pozostałych komend")
178
270
 
179
271
 
180
272
  # ── snap revisions ───────────────────────────────────────────────────────
@@ -194,11 +286,16 @@ def _snap_disabled_revisions() -> list[dict] | None:
194
286
  if len(parts) < 3 or "disabled" not in line.lower():
195
287
  continue
196
288
  name, version, rev = parts[0], parts[1], parts[2]
289
+ snap_file = Path(f"/var/lib/snapd/snaps/{name}_{rev}.snap")
290
+ try:
291
+ size_bytes = snap_file.stat().st_size if snap_file.is_file() else 0
292
+ except OSError:
293
+ size_bytes = 0
197
294
  candidates.append(
198
295
  {
199
296
  "description": f"{name} (rewizja {rev})",
200
297
  "note": f"v{version}",
201
- "size_bytes": 0,
298
+ "size_bytes": size_bytes,
202
299
  "command": ["sudo", "snap", "remove", name, "--revision", rev],
203
300
  }
204
301
  )
@@ -604,6 +701,21 @@ def _gitive_container_names() -> set[str] | None:
604
701
  return {name for name in result.stdout.split() if name}
605
702
 
606
703
 
704
+ def _discover_gitive_rootfs_dirs(root: Path) -> list[Path]:
705
+ """Find workspace `rootfs` directories under `root` without descending into `rootfs`."""
706
+ import os
707
+
708
+ found: list[Path] = []
709
+ for dirpath, dirnames, _filenames in os.walk(root):
710
+ if "rootfs" in dirnames:
711
+ rootfs_path = Path(dirpath) / "rootfs"
712
+ if rootfs_path.is_dir():
713
+ found.append(rootfs_path)
714
+ dirnames.remove("rootfs")
715
+ found.sort()
716
+ return found
717
+
718
+
607
719
  def _cleanup_gitive(
608
720
  json_output: bool, dry_run: bool, list_only: bool, yes: bool
609
721
  ) -> None:
@@ -615,7 +727,7 @@ def _cleanup_gitive(
615
727
  if names is None:
616
728
  error = "Nie udało się zweryfikować powiązania z kontenerami (docker niedostępny)"
617
729
  elif root.is_dir():
618
- for rootfs in sorted(root.rglob("rootfs")):
730
+ for rootfs in _discover_gitive_rootfs_dirs(root):
619
731
  workspace = rootfs.parent
620
732
  if not rootfs.is_dir() or workspace.is_symlink():
621
733
  continue
@@ -1593,3 +1705,113 @@ def _display_cleanup_policies(json_output: bool = False) -> None:
1593
1705
  click.echo(" fixos cleanup --policy # wyświetla tę tabelę polityk i retencji\n")
1594
1706
 
1595
1707
 
1708
+ def _cleanup_build_caches(
1709
+ json_output: bool,
1710
+ dry_run: bool,
1711
+ list_only: bool,
1712
+ yes: bool,
1713
+ home_dir: Path | None = None,
1714
+ ) -> None:
1715
+ """Clean safe regenerable build/package caches (Cargo target/debug, ~/.npm/_cacache, conda tarballs)."""
1716
+ home = home_dir or Path.home()
1717
+ dirs_to_size: list[Path] = []
1718
+ seen_resolved: set[Path] = set()
1719
+ file_candidates: list[dict] = []
1720
+
1721
+ github_root = home / "github"
1722
+ if github_root.is_dir():
1723
+ for pat in ("*/*/target/debug", "*/*/packages/*/target/debug"):
1724
+ for dbg in sorted(github_root.glob(pat)):
1725
+ if dbg.is_dir() and not dbg.is_symlink():
1726
+ try:
1727
+ real = dbg.resolve()
1728
+ except OSError:
1729
+ real = dbg
1730
+ if real not in seen_resolved:
1731
+ seen_resolved.add(real)
1732
+ dirs_to_size.append(dbg)
1733
+
1734
+ npm_cache = home / ".npm" / "_cacache"
1735
+ if npm_cache.is_dir() and not npm_cache.is_symlink():
1736
+ dirs_to_size.append(npm_cache)
1737
+
1738
+ conda_pkgs = home / "miniconda3" / "pkgs"
1739
+ if conda_pkgs.is_dir():
1740
+ for ext in ("*.tar.bz2", "*.conda"):
1741
+ for archive in sorted(conda_pkgs.glob(ext)):
1742
+ try:
1743
+ if archive.is_file() and not archive.is_symlink():
1744
+ file_candidates.append(
1745
+ {
1746
+ "description": f"miniconda3/pkgs/{archive.name}",
1747
+ "path": archive,
1748
+ "size_bytes": archive.stat().st_size,
1749
+ "note": "archiwum pakietu conda",
1750
+ }
1751
+ )
1752
+ except OSError:
1753
+ continue
1754
+
1755
+ sizes = _dir_sizes(dirs_to_size) if dirs_to_size else {}
1756
+ candidates: list[dict] = []
1757
+ for d in dirs_to_size:
1758
+ sz = sizes.get(str(d))
1759
+ if sz is None:
1760
+ sz = _dir_size(d)
1761
+ if sz <= 0:
1762
+ continue
1763
+ try:
1764
+ rel = str(d.relative_to(home))
1765
+ except ValueError:
1766
+ rel = str(d)
1767
+ candidates.append(
1768
+ {
1769
+ "description": f"~/{rel}",
1770
+ "path": d,
1771
+ "size_bytes": sz,
1772
+ "note": "regenerowalny cache kompilacji/pakietów",
1773
+ }
1774
+ )
1775
+ candidates.extend(file_candidates)
1776
+ candidates.sort(key=lambda item: (-item.get("size_bytes", 0), item["description"]))
1777
+
1778
+ if json_output:
1779
+ _echo_json(
1780
+ {
1781
+ "candidates": [
1782
+ {
1783
+ "description": c["description"],
1784
+ "path": str(c["path"]),
1785
+ "size_bytes": c["size_bytes"],
1786
+ "note": c["note"],
1787
+ }
1788
+ for c in candidates
1789
+ ],
1790
+ "total_bytes": sum(c["size_bytes"] for c in candidates),
1791
+ }
1792
+ )
1793
+ return
1794
+
1795
+ if not candidates:
1796
+ click.echo(click.style("Brak cache kompilacji/pakietów do wyczyszczenia.", fg="green"))
1797
+ return
1798
+
1799
+ _display_candidates("CACHE KOMPILACJI I PAKIETÓW (target/debug, npm, conda):", candidates)
1800
+ if list_only:
1801
+ return
1802
+
1803
+ selected = (
1804
+ list(range(len(candidates)))
1805
+ if yes
1806
+ else _choose(candidates, "Numery pozycji do usunięcia (np. 1,2, all)")
1807
+ )
1808
+ if not selected:
1809
+ click.echo("Pominięto.")
1810
+ return
1811
+ if dry_run:
1812
+ _show_dry_run_commands([["rm", "-rf", str(candidates[i]["path"])] for i in selected])
1813
+ return
1814
+ if not yes and not _confirm_remove():
1815
+ click.echo("Anulowano.")
1816
+ return
1817
+ _remove_selected(candidates, selected)