machineconfig 8.14__py3-none-any.whl → 8.45__py3-none-any.whl

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.

Potentially problematic release.


This version of machineconfig might be problematic. Click here for more details.

Files changed (269) hide show
  1. machineconfig/cluster/remote/run_cluster.py +1 -1
  2. machineconfig/cluster/remote/run_remote.py +1 -1
  3. machineconfig/cluster/sessions_managers/utils/maker.py +10 -8
  4. machineconfig/cluster/sessions_managers/wt_local.py +1 -1
  5. machineconfig/cluster/sessions_managers/wt_local_manager.py +1 -1
  6. machineconfig/cluster/sessions_managers/zellij_local.py +1 -1
  7. machineconfig/cluster/sessions_managers/zellij_local_manager.py +1 -1
  8. machineconfig/jobs/installer/checks/check_installations.py +133 -0
  9. machineconfig/jobs/installer/checks/install_utils.py +132 -0
  10. machineconfig/jobs/installer/checks/report_utils.py +39 -0
  11. machineconfig/jobs/installer/checks/vt_utils.py +89 -0
  12. machineconfig/jobs/installer/installer_data.json +225 -140
  13. machineconfig/jobs/installer/linux_scripts/docker.sh +6 -9
  14. machineconfig/jobs/installer/package_groups.py +10 -9
  15. machineconfig/jobs/installer/python_scripts/boxes.py +1 -2
  16. machineconfig/jobs/installer/python_scripts/code.py +10 -8
  17. machineconfig/jobs/installer/python_scripts/hx.py +30 -13
  18. machineconfig/jobs/installer/python_scripts/nerfont_windows_helper.py +6 -5
  19. machineconfig/jobs/installer/python_scripts/sysabc.py +25 -19
  20. machineconfig/jobs/installer/python_scripts/yazi.py +33 -17
  21. machineconfig/jobs/scripts/powershell_scripts/cmatrix.ps1 +52 -0
  22. machineconfig/jobs/scripts/powershell_scripts/mount_ssh.ps1 +1 -1
  23. machineconfig/jobs/scripts_dynamic/a.py +413 -10
  24. machineconfig/profile/create_links.py +77 -20
  25. machineconfig/profile/create_links_export.py +40 -51
  26. machineconfig/profile/mapper_data.toml +30 -0
  27. machineconfig/profile/mapper_dotfiles.toml +253 -0
  28. machineconfig/scripts/python/agents.py +70 -172
  29. machineconfig/scripts/python/ai/initai.py +3 -1
  30. machineconfig/scripts/python/ai/scripts/__init__.py +1 -0
  31. machineconfig/scripts/python/ai/scripts/lint_and_type_check.ps1 +2 -0
  32. machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +7 -5
  33. machineconfig/scripts/python/ai/solutions/claude/claude.py +1 -1
  34. machineconfig/scripts/python/ai/solutions/cline/cline.py +1 -1
  35. machineconfig/scripts/python/ai/solutions/copilot/github_copilot.py +1 -1
  36. machineconfig/scripts/python/ai/solutions/copilot/instructions/python/dev.instructions.md +29 -0
  37. machineconfig/scripts/python/ai/solutions/crush/crush.py +1 -1
  38. machineconfig/scripts/python/ai/solutions/cursor/cursors.py +1 -1
  39. machineconfig/scripts/python/ai/solutions/gemini/gemini.py +1 -1
  40. machineconfig/scripts/python/ai/solutions/gemini/settings.json +3 -0
  41. machineconfig/scripts/python/ai/{solutions → utils}/generic.py +2 -15
  42. machineconfig/scripts/python/ai/utils/vscode_tasks.py +6 -3
  43. machineconfig/scripts/python/cloud.py +58 -11
  44. machineconfig/scripts/python/croshell.py +4 -156
  45. machineconfig/scripts/python/devops.py +57 -40
  46. machineconfig/scripts/python/devops_navigator.py +17 -3
  47. machineconfig/scripts/python/fire_jobs.py +8 -207
  48. machineconfig/scripts/python/ftpx.py +5 -225
  49. machineconfig/scripts/python/graph/cli_graph.json +8743 -0
  50. machineconfig/scripts/python/{env_manager → helper_env}/path_manager_tui.py +2 -2
  51. machineconfig/scripts/python/{env_manager → helpers/helper_env}/env_manager_tui.py +1 -1
  52. machineconfig/scripts/python/helpers/helper_env/path_manager_tui.py +228 -0
  53. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_crush.py +1 -1
  54. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_cursor_agents.py +1 -1
  55. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_gemini.py +1 -1
  56. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_qwen.py +1 -1
  57. machineconfig/scripts/python/helpers/helpers_agents/agents_impl.py +168 -0
  58. machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_help_launch.py +5 -5
  59. machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_copy.py +6 -6
  60. machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_mount.py +10 -5
  61. machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_sync.py +3 -3
  62. machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/helpers2.py +1 -1
  63. machineconfig/scripts/python/helpers/helpers_croshell/croshell_impl.py +225 -0
  64. machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/scheduler.py +4 -4
  65. machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/start_slidev.py +7 -6
  66. machineconfig/scripts/python/helpers/helpers_devops/backup_config.py +149 -0
  67. machineconfig/scripts/python/helpers/helpers_devops/cli_backup_retrieve.py +267 -0
  68. machineconfig/scripts/python/helpers/helpers_devops/cli_config.py +98 -0
  69. machineconfig/scripts/python/helpers/helpers_devops/cli_config_dotfile.py +274 -0
  70. machineconfig/scripts/python/helpers/helpers_devops/cli_data.py +76 -0
  71. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_nw.py +52 -72
  72. machineconfig/scripts/python/helpers/helpers_devops/cli_repos.py +265 -0
  73. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_self.py +39 -23
  74. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_file.py +44 -30
  75. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_server.py +26 -43
  76. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/cli_share_terminal.py +12 -6
  77. machineconfig/scripts/python/helpers/helpers_devops/cli_ssh.py +167 -0
  78. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/devops_status.py +12 -6
  79. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/devops_update_repos.py +1 -1
  80. machineconfig/scripts/python/{interactive.py → helpers/helpers_devops/interactive.py} +68 -52
  81. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/run_script.py +75 -58
  82. machineconfig/scripts/python/helpers/helpers_devops/themes/choose_starship_theme.ps1 +41 -0
  83. machineconfig/scripts/python/helpers/helpers_devops/themes/choose_starship_theme.sh +48 -0
  84. machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/themes/choose_wezterm_theme.py +3 -3
  85. machineconfig/scripts/python/helpers/helpers_fire_command/fire_jobs_impl.py +233 -0
  86. machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_route_helper.py +3 -3
  87. machineconfig/scripts/python/helpers/helpers_msearch/msearch_impl.py +248 -0
  88. machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/scripts_linux/fzfg +4 -3
  89. machineconfig/scripts/python/helpers/helpers_msearch/scripts_linux/search_with_context.sh +48 -0
  90. machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/scripts_windows/fzfg.ps1 +1 -1
  91. machineconfig/scripts/python/helpers/helpers_navigator/__init__.py +20 -0
  92. machineconfig/scripts/python/helpers/helpers_navigator/cli_graph_loader.py +234 -0
  93. machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/command_builder.py +61 -13
  94. machineconfig/scripts/python/helpers/helpers_navigator/command_detail.py +153 -0
  95. machineconfig/scripts/python/helpers/helpers_navigator/command_tree.py +45 -0
  96. machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/data_models.py +18 -11
  97. machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/main_app.py +5 -5
  98. machineconfig/scripts/python/helpers/helpers_network/__init__.py +0 -0
  99. machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/address.py +15 -17
  100. machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/address_switch.py +1 -1
  101. machineconfig/scripts/python/helpers/helpers_network/ftpx_impl.py +276 -0
  102. machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/mount_ssh.py +2 -2
  103. machineconfig/scripts/python/helpers/helpers_network/ssh_add_identity.py +73 -0
  104. machineconfig/scripts/python/helpers/helpers_network/ssh_add_ssh_key.py +175 -0
  105. machineconfig/scripts/python/helpers/helpers_network/ssh_debug_linux.py +319 -0
  106. machineconfig/scripts/python/helpers/helpers_network/ssh_debug_windows.py +275 -0
  107. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/action.py +3 -3
  108. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/action_helper.py +3 -3
  109. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/cloud_repo_sync.py +116 -33
  110. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/grource.py +3 -2
  111. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/record.py +33 -13
  112. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/repo_analyzer_2.py +63 -19
  113. machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/update.py +0 -6
  114. machineconfig/scripts/python/helpers/helpers_search/script_help.py +81 -0
  115. machineconfig/scripts/python/helpers/helpers_sessions/__init__.py +0 -0
  116. machineconfig/scripts/python/helpers/helpers_sessions/sessions_impl.py +177 -0
  117. machineconfig/scripts/python/{helpers_sessions → helpers/helpers_sessions}/sessions_multiprocess.py +1 -1
  118. machineconfig/scripts/python/helpers/helpers_terminal/__init__.py +0 -0
  119. machineconfig/scripts/python/helpers/helpers_terminal/terminal_impl.py +96 -0
  120. machineconfig/scripts/python/{helpers_utils → helpers/helpers_utils}/download.py +1 -1
  121. machineconfig/scripts/python/{helpers_utils → helpers/helpers_utils}/python.py +46 -26
  122. machineconfig/scripts/python/helpers/helpers_utils/specs.py +246 -0
  123. machineconfig/scripts/python/mcfg_entry.py +133 -48
  124. machineconfig/scripts/python/msearch.py +15 -61
  125. machineconfig/scripts/python/sessions.py +59 -194
  126. machineconfig/scripts/python/terminal.py +18 -96
  127. machineconfig/scripts/python/utils.py +101 -20
  128. machineconfig/settings/atuin/config.toml +294 -0
  129. machineconfig/settings/atuin/themes/catppuccin-mocha-mauve.toml +12 -0
  130. machineconfig/settings/linters/.ruff.toml +1 -0
  131. machineconfig/settings/mprocs/windows/mprocs.yaml +2 -2
  132. machineconfig/settings/shells/bash/init.sh +6 -3
  133. machineconfig/settings/shells/pwsh/init.ps1 +69 -1
  134. machineconfig/settings/shells/pwsh/search_pwsh_history.ps1 +99 -0
  135. machineconfig/settings/shells/wezterm/wezterm.lua +4 -1
  136. machineconfig/settings/shells/wt/settings.json +20 -7
  137. machineconfig/settings/shells/zsh/init.sh +34 -4
  138. machineconfig/settings/television/cable_unix/bash-history.toml +1 -1
  139. machineconfig/settings/television/cable_windows/pwsh-history.toml +1 -1
  140. machineconfig/settings/tv/config.toml +234 -0
  141. machineconfig/settings/tv/themes/catppuccin-mocha-sky.toml +22 -0
  142. machineconfig/settings/wsl/.wslconfig +5 -30
  143. machineconfig/settings/yazi/yazi_linux.toml +18 -8
  144. machineconfig/settings/zellij/layouts/st.kdl +2 -2
  145. machineconfig/settings/zellij/layouts/st2.kdl +1 -1
  146. machineconfig/setup_linux/web_shortcuts/interactive.sh +10 -10
  147. machineconfig/setup_linux/web_shortcuts/live_from_github.sh +3 -0
  148. machineconfig/setup_mac/__init__.py +0 -2
  149. machineconfig/setup_windows/__init__.py +0 -1
  150. machineconfig/setup_windows/web_shortcuts/interactive.ps1 +14 -13
  151. machineconfig/setup_windows/web_shortcuts/live_from_github.ps1 +4 -3
  152. machineconfig/setup_windows/web_shortcuts/quick_init.ps1 +3 -3
  153. machineconfig/type_hinting/sql/__init__.py +1 -0
  154. machineconfig/type_hinting/sql/base.py +216 -0
  155. machineconfig/type_hinting/sql/core_schema.py +64 -0
  156. machineconfig/type_hinting/sql/core_schema_typeddict.py +41 -0
  157. machineconfig/type_hinting/sql/typeddict_codegen.py +222 -0
  158. machineconfig/type_hinting/typedict/__init__.py +1 -0
  159. machineconfig/type_hinting/typedict/ast_utils.py +130 -0
  160. machineconfig/type_hinting/typedict/generator_helpers.py +319 -0
  161. machineconfig/type_hinting/typedict/generators.py +231 -0
  162. machineconfig/type_hinting/typedict/polars_schema.py +24 -0
  163. machineconfig/type_hinting/typedict/polars_schema_typeddict.py +63 -0
  164. machineconfig/utils/accessories.py +24 -0
  165. machineconfig/utils/code.py +41 -13
  166. machineconfig/utils/files/ascii_art.py +10 -14
  167. machineconfig/utils/files/headers.py +3 -5
  168. machineconfig/utils/files/read.py +8 -1
  169. machineconfig/utils/installer_utils/github_release_bulk.py +1 -0
  170. machineconfig/utils/installer_utils/install_from_url.py +1 -1
  171. machineconfig/utils/installer_utils/installer_class.py +12 -4
  172. machineconfig/utils/installer_utils/installer_cli.py +1 -15
  173. machineconfig/utils/installer_utils/installer_helper.py +2 -2
  174. machineconfig/utils/installer_utils/installer_locator_utils.py +13 -13
  175. machineconfig/utils/installer_utils/installer_runner.py +4 -4
  176. machineconfig/utils/meta.py +6 -4
  177. machineconfig/utils/options.py +49 -19
  178. machineconfig/utils/options_utils/__init__.py +0 -0
  179. machineconfig/utils/options_utils/options_tv_linux.py +211 -0
  180. machineconfig/utils/options_utils/options_tv_windows.py +88 -0
  181. machineconfig/utils/options_utils/tv_options.py +37 -0
  182. machineconfig/utils/path_extended.py +6 -6
  183. machineconfig/utils/scheduler.py +8 -2
  184. machineconfig/utils/schemas/fire_agents/fire_agents_input.py +1 -1
  185. machineconfig/utils/source_of_truth.py +6 -1
  186. machineconfig/utils/ssh.py +69 -18
  187. machineconfig/utils/ssh_utils/abc.py +1 -1
  188. machineconfig/utils/ssh_utils/wsl.py +107 -170
  189. machineconfig/utils/ssh_utils/wsl_helper.py +217 -0
  190. machineconfig/utils/upgrade_packages.py +4 -8
  191. {machineconfig-8.14.dist-info → machineconfig-8.45.dist-info}/METADATA +29 -22
  192. {machineconfig-8.14.dist-info → machineconfig-8.45.dist-info}/RECORD +247 -208
  193. machineconfig/jobs/installer/check_installations.py +0 -248
  194. machineconfig/profile/backup.toml +0 -49
  195. machineconfig/profile/mapper.toml +0 -263
  196. machineconfig/scripts/python/helpers_devops/cli_config.py +0 -105
  197. machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py +0 -89
  198. machineconfig/scripts/python/helpers_devops/cli_data.py +0 -25
  199. machineconfig/scripts/python/helpers_devops/cli_repos.py +0 -208
  200. machineconfig/scripts/python/helpers_devops/devops_backup_retrieve.py +0 -80
  201. machineconfig/scripts/python/helpers_devops/themes/choose_starship_theme.bash +0 -3
  202. machineconfig/scripts/python/helpers_navigator/__init__.py +0 -20
  203. machineconfig/scripts/python/helpers_navigator/command_detail.py +0 -44
  204. machineconfig/scripts/python/helpers_navigator/command_tree.py +0 -620
  205. machineconfig/scripts/python/helpers_network/ssh_add_identity.py +0 -116
  206. machineconfig/scripts/python/helpers_network/ssh_add_ssh_key.py +0 -153
  207. machineconfig/scripts/python/helpers_network/ssh_debug_linux.py +0 -391
  208. machineconfig/scripts/python/helpers_network/ssh_debug_windows.py +0 -338
  209. machineconfig/scripts/python/helpers_repos/entrypoint.py +0 -77
  210. machineconfig/setup_mac/ssh/openssh_setup.sh +0 -114
  211. machineconfig/setup_windows/ssh/add-sshkey.ps1 +0 -29
  212. machineconfig/setup_windows/ssh/openssh-server.ps1 +0 -37
  213. machineconfig/utils/options_tv.py +0 -119
  214. machineconfig/utils/tst.py +0 -20
  215. /machineconfig/{scripts/python/helpers_agents → jobs/installer/checks}/__init__.py +0 -0
  216. /machineconfig/scripts/python/ai/{solutions/_shared.py → utils/shared.py} +0 -0
  217. /machineconfig/scripts/python/{helpers_agents/agentic_frameworks → graph}/__init__.py +0 -0
  218. /machineconfig/scripts/python/{helpers_cloud → helpers}/__init__.py +0 -0
  219. /machineconfig/scripts/python/{env_manager → helpers/helper_env}/__init__.py +0 -0
  220. /machineconfig/scripts/python/{env_manager → helpers/helper_env}/path_manager_backend.py +0 -0
  221. /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_agents}/__init__.py +0 -0
  222. /machineconfig/scripts/python/{helpers_devops → helpers/helpers_agents/agentic_frameworks}/__init__.py +0 -0
  223. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/agentic_frameworks/fire_crush.json +0 -0
  224. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_help_search.py +0 -0
  225. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_helper_types.py +0 -0
  226. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/fire_agents_load_balancer.py +0 -0
  227. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/privacy/configs/aichat/config.yaml +0 -0
  228. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/privacy/configs/aider/.aider.conf.yml +0 -0
  229. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/privacy/configs/copilot/config.yml +0 -0
  230. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/privacy/configs/crush/crush.json +0 -0
  231. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/privacy/configs/gemini/settings.json +0 -0
  232. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/privacy/privacy.py +0 -0
  233. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/prompt.txt +0 -0
  234. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/template.ps1 +0 -0
  235. /machineconfig/scripts/python/{helpers_agents → helpers/helpers_agents}/templates/template.sh +0 -0
  236. /machineconfig/scripts/python/{helpers_devops/themes → helpers/helpers_cloud}/__init__.py +0 -0
  237. /machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/cloud_helpers.py +0 -0
  238. /machineconfig/scripts/python/{helpers_cloud → helpers/helpers_cloud}/helpers5.py +0 -0
  239. /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_croshell}/__init__.py +0 -0
  240. /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/crosh.py +0 -0
  241. /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/pomodoro.py +0 -0
  242. /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/viewer.py +0 -0
  243. /machineconfig/scripts/python/{helpers_croshell → helpers/helpers_croshell}/viewer_template.py +0 -0
  244. /machineconfig/scripts/python/{helpers_network → helpers/helpers_devops}/__init__.py +0 -0
  245. /machineconfig/scripts/python/{helpers_sessions → helpers/helpers_devops/themes}/__init__.py +0 -0
  246. /machineconfig/scripts/python/{helpers_devops → helpers/helpers_devops}/themes/choose_pwsh_theme.ps1 +0 -0
  247. /machineconfig/scripts/python/{helpers_devops/themes/choose_starship_theme.ps1 → helpers/helpers_fire_command/__init__.py} +0 -0
  248. /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/cloud_manager.py +0 -0
  249. /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/f.py +0 -0
  250. /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/file_wrangler.py +0 -0
  251. /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_args_helper.py +0 -0
  252. /machineconfig/scripts/python/{helpers_fire_command → helpers/helpers_fire_command}/fire_jobs_streamlit_helper.py +0 -0
  253. /machineconfig/scripts/python/{helpers_msearch → helpers/helpers_msearch}/__init__.py +0 -0
  254. /machineconfig/scripts/python/{helpers_navigator → helpers/helpers_navigator}/search_bar.py +0 -0
  255. /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/mount_nfs.py +0 -0
  256. /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/mount_nw_drive.py +0 -0
  257. /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/onetimeshare.py +0 -0
  258. /machineconfig/scripts/python/{helpers_network → helpers/helpers_network}/wifi_conn.py +0 -0
  259. /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/clone.py +0 -0
  260. /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/repo_analyzer_1.py +0 -0
  261. /machineconfig/scripts/python/{helpers_repos → helpers/helpers_repos}/sync.py +0 -0
  262. /machineconfig/scripts/python/helpers/{ast_search.py → helpers_search/ast_search.py} +0 -0
  263. /machineconfig/scripts/python/helpers/{qr_code.py → helpers_search/qr_code.py} +0 -0
  264. /machineconfig/scripts/python/helpers/{repo_rag.py → helpers_search/repo_rag.py} +0 -0
  265. /machineconfig/scripts/python/helpers/{symantic_search.py → helpers_search/symantic_search.py} +0 -0
  266. /machineconfig/scripts/python/{helpers_utils → helpers/helpers_utils}/pdf.py +0 -0
  267. {machineconfig-8.14.dist-info → machineconfig-8.45.dist-info}/WHEEL +0 -0
  268. {machineconfig-8.14.dist-info → machineconfig-8.45.dist-info}/entry_points.txt +0 -0
  269. {machineconfig-8.14.dist-info → machineconfig-8.45.dist-info}/top_level.txt +0 -0
@@ -1,10 +1,8 @@
1
- """Utilitfrom pathlib import Path
1
+ """Agents management commands - lazy loading subcommands."""
2
2
 
3
- """
4
-
5
- from typing import cast, Optional, get_args, Annotated
3
+ from typing import Optional, get_args, Annotated, Literal
6
4
  import typer
7
- from machineconfig.scripts.python.helpers_agents.fire_agents_helper_types import AGENTS, HOST, PROVIDER
5
+ from machineconfig.scripts.python.helpers.helpers_agents.fire_agents_helper_types import AGENTS, HOST, PROVIDER
8
6
 
9
7
 
10
8
  def agents_create(
@@ -21,169 +19,74 @@ def agents_create(
21
19
  separate: Annotated[bool, typer.Option(..., "--separate", "-S", help="Keep prompt material in separate file to the context.")] = True,
22
20
  output_path: Annotated[Optional[str], typer.Option(..., "--output-path", "-o", help="Path to write the layout.json file")] = None,
23
21
  agents_dir: Annotated[Optional[str], typer.Option(..., "--agents-dir", "-ad", help="Directory to store agent files. If not provided, will be constructed automatically.")] = None,
24
- ):
25
-
26
- from machineconfig.scripts.python.helpers_agents.fire_agents_help_launch import prep_agent_launch, get_agents_launch_layout
27
- from machineconfig.scripts.python.helpers_agents.fire_agents_load_balancer import chunk_prompts
28
- from machineconfig.utils.accessories import get_repo_root, randstr
29
- import json
30
- from pathlib import Path
31
- # validate mutual exclusive
32
- prompt_options = [prompt, prompt_path]
33
- provided_prompt = [opt for opt in prompt_options if opt is not None]
34
- if len(provided_prompt) != 1:
35
- raise typer.BadParameter("Exactly one of --prompt or --prompt-path must be provided")
36
-
37
- repo_root = get_repo_root(Path.cwd())
38
- if repo_root is None:
39
- typer.echo("💥 Could not determine the repository root. Please run this script from within a git repository.")
40
- raise typer.Exit(1)
41
- return
42
- typer.echo(f"Operating @ {repo_root}")
43
-
44
- if context_path is None:
45
- context_path_resolved = Path(repo_root) / ".ai" / "todo"
46
- else: context_path_resolved = Path(context_path).expanduser().resolve()
47
-
48
- if not context_path_resolved.exists():
49
- raise typer.BadParameter(f"Path does not exist: {context_path_resolved}")
50
-
51
- if context_path_resolved.is_file():
52
- prompt_material_re_splitted = chunk_prompts(context_path_resolved, tasks_per_prompt=agent_load, joiner=separator)
53
- elif context_path_resolved.is_dir():
54
- files = [f for f in context_path_resolved.rglob("*") if f.is_file()]
55
- if not files:
56
- raise typer.BadParameter(f"No files found in directory: {context_path_resolved}")
57
- concatenated = separator.join(f.read_text(encoding="utf-8") for f in files)
58
- prompt_material_re_splitted = [concatenated]
59
- else:
60
- raise typer.BadParameter(f"Path is neither file nor directory: {context_path_resolved}")
22
+ ) -> None:
23
+ """Create agents layout file, ready to run."""
24
+ from machineconfig.scripts.python.helpers.helpers_agents.agents_impl import agents_create as impl
25
+ try:
26
+ impl(agent=agent, host=host, model=model, provider=provider, context_path=context_path, separator=separator, agent_load=agent_load, prompt=prompt, prompt_path=prompt_path, job_name=job_name, separate=separate, output_path=output_path, agents_dir=agents_dir)
27
+ except ValueError as e:
28
+ raise typer.BadParameter(str(e)) from e
29
+ except RuntimeError as e:
30
+ typer.echo(str(e))
31
+ raise typer.Exit(1) from e
61
32
 
62
- if prompt_path is not None:
63
- prompt_prefix = Path(prompt_path).read_text(encoding="utf-8")
64
- else:
65
- prompt_prefix = cast(str, prompt)
66
- agent_selected = agent
67
- if agents_dir is None: agents_dir_obj = Path(repo_root) / ".ai" / f"tmp_prompts/{job_name}_{randstr()}"
68
- else:
69
- import shutil
70
- if Path(agents_dir).exists():
71
- shutil.rmtree(agents_dir)
72
- agents_dir_obj = Path(agents_dir)
73
- prep_agent_launch(repo_root=repo_root, agents_dir=agents_dir_obj, prompts_material=prompt_material_re_splitted,
74
- keep_material_in_separate_file=separate,
75
- prompt_prefix=prompt_prefix, machine=host, agent=agent_selected, model=model, provider=provider,
76
- job_name=job_name)
77
- layoutfile = get_agents_launch_layout(session_root=agents_dir_obj)
78
- # regenerate_py_code = f"""
79
- # #!/usr/bin/env uv run --python 3.14 --with machineconfig
80
- # agents create "{context_path_resolved}" \\
81
- # --prompt-path "{prompt_path or ''}" \\
82
- # --agent "{agent_selected}" \\
83
- # --host "{host}" \\
84
- # --job-name "{job_name}" \\
85
- # --agent_load {agent_load} \\
86
- # --separator "{separator}" \\
87
- # {"--separate" if separate else ""}
88
- # """
89
- # (agents_dir_obj / "aa_agents_relaunch.sh").write_text(data=regenerate_py_code, encoding="utf-8")
90
- layout_output_path = Path(output_path) if output_path is not None else agents_dir_obj / "layout.json"
91
- layout_output_path.parent.mkdir(parents=True, exist_ok=True)
92
- layout_output_path.write_text(data=json.dumps(layoutfile, indent=4), encoding="utf-8")
93
- typer.echo(f"Created agents in {agents_dir_obj}")
94
- typer.echo(f"Ceated layout in {layout_output_path}")
95
-
96
-
97
33
  def collect(
98
34
  agent_dir: Annotated[str, typer.Argument(..., help="Path to the agent directory containing the prompts folder")],
99
35
  output_path: Annotated[str, typer.Argument(..., help="Path to write the concatenated material files")],
100
36
  separator: Annotated[str, typer.Option(..., help="Separator to use when concatenating material files")] = "\n",
101
37
  ) -> None:
102
38
  """Collect all material files from an agent directory and concatenate them."""
103
- from pathlib import Path
104
- if not Path(agent_dir).exists() or not Path(agent_dir).is_dir():
105
- raise typer.BadParameter(f"Agent directory does not exist or is not a directory: {agent_dir}")
106
-
107
- prompts_dir = Path(agent_dir) / "prompts"
108
- if not prompts_dir.exists():
109
- raise typer.BadParameter(f"Prompts directory not found: {prompts_dir}")
110
-
111
- material_files = []
112
- for agent_subdir in prompts_dir.iterdir():
113
- if agent_subdir.is_dir() and agent_subdir.name.startswith("agent_"):
114
- material_file = agent_subdir / f"{agent_subdir.name}_material.txt"
115
- if material_file.exists():
116
- material_files.append(material_file)
117
-
118
- if not material_files:
119
- typer.echo("No material files found in the agent directory.")
120
- return
121
-
122
- # Sort by agent index for consistent ordering
123
- material_files.sort(key=lambda x: int(x.parent.name.split("_")[-1]))
124
-
125
- # Read and concatenate all material files
126
- concatenated_content = []
127
- for material_file in material_files:
128
- content = material_file.read_text(encoding="utf-8")
129
- concatenated_content.append(content)
130
-
131
- result = separator.join(concatenated_content)
132
-
133
- # Write to output file
134
- Path(output_path).parent.mkdir(parents=True, exist_ok=True)
135
- Path(output_path).write_text(result, encoding="utf-8")
136
- typer.echo(f"Concatenated material written to {output_path}")
137
-
138
-
139
- def make_agents_command_template():
140
- """Create a template for fire agents"""
141
- from platform import system
142
- import machineconfig.scripts.python.helpers_agents as module
143
- from pathlib import Path
144
-
145
- if system() == "Linux" or system() == "Darwin":
146
- template_path = Path(module.__file__).parent / "templates/template.sh"
147
- elif system() == "Windows":
148
- template_path = Path(module.__file__).parent / "templates/template.ps1"
149
- else:
150
- raise typer.BadParameter(f"Unsupported OS: {system()}")
151
-
152
- from machineconfig.utils.accessories import get_repo_root
153
- repo_root = get_repo_root(Path.cwd())
154
- if repo_root is None:
155
- typer.echo("💥 Could not determine the repository root. Please run this script from within a git repository.")
156
- raise typer.Exit(1)
157
-
158
- save_path_root = repo_root / ".ai" / "agents"
159
-
160
- save_path_root.mkdir(parents=True, exist_ok=True)
161
- save_path_root.joinpath("template_fire_agents.sh").write_text(template_path.read_text(encoding="utf-8"), encoding="utf-8")
162
- typer.echo(f"Template bash script written to {save_path_root}")
163
-
164
- from machineconfig.scripts.python.ai.utils.generate_files import make_todo_files
165
- make_todo_files(
166
- pattern=".py", repo=str(repo_root), strategy="name", output_path=str(save_path_root / "files.md"), split_every=None, split_to=None
167
- )
168
-
169
- prompt_path = Path(module.__file__).parent / "templates/prompt.txt"
170
- save_path_root.joinpath("prompt.txt").write_text(prompt_path.read_text(encoding="utf-8"), encoding="utf-8")
171
- typer.echo(f"Prompt template written to {save_path_root}")
172
-
173
-
174
- def init_config(root: Annotated[Optional[str], typer.Option(..., "--root", "-r", help="Root directory of the repository to initialize AI configs in. Defaults to current directory.")] = None):
175
- """Initialize AI configurations in the current repository"""
176
- from machineconfig.scripts.python.ai.initai import add_ai_configs
177
- from pathlib import Path
178
- if root is None:
179
- repo_root = Path.cwd()
180
- else:
181
- repo_root = Path(root).expanduser().resolve()
182
- add_ai_configs(repo_root=repo_root)
183
-
184
-
185
- def get_app():
186
- agents_app = typer.Typer(help="🤖 AI Agents management subcommands", no_args_is_help=True, add_help_option=False, add_completion=False)
39
+ from machineconfig.scripts.python.helpers.helpers_agents.agents_impl import collect as impl
40
+ try:
41
+ impl(agent_dir=agent_dir, output_path=output_path, separator=separator)
42
+ except ValueError as e:
43
+ raise typer.BadParameter(str(e)) from e
44
+
45
+
46
+ def make_agents_command_template() -> None:
47
+ """Create a template for fire agents."""
48
+ from machineconfig.scripts.python.helpers.helpers_agents.agents_impl import make_agents_command_template as impl
49
+ try:
50
+ impl()
51
+ except ValueError as e:
52
+ raise typer.BadParameter(str(e)) from e
53
+ except RuntimeError as e:
54
+ typer.echo(str(e))
55
+ raise typer.Exit(1) from e
56
+
57
+
58
+ def init_config(root: Annotated[Optional[str], typer.Option(..., "--root", "-r", help="Root directory of the repository to initialize AI configs in. Defaults to current directory.")] = None) -> None:
59
+ """Initialize AI configurations in the current repository."""
60
+ from machineconfig.scripts.python.helpers.helpers_agents.agents_impl import init_config as impl
61
+ impl(root=root)
62
+
63
+
64
+ def make_todo_files(
65
+ pattern: Annotated[str, typer.Argument(help="Pattern or keyword to match files by")] = ".py",
66
+ repo: Annotated[str, typer.Argument(help="Repository path. Can be any directory within a git repository.")] = ".",
67
+ strategy: Annotated[Literal["name", "keywords"], typer.Option("-s", "--strategy", help="Strategy to filter files: 'name' for filename matching, 'keywords' for content matching")] = "name",
68
+ exclude_init: Annotated[bool, typer.Option("-x", "--exclude-init", help="Exclude __init__.py files from the checklist")] = True,
69
+ include_line_count: Annotated[bool, typer.Option("-l", "--line-count", help="Include line count column in the output")] = False,
70
+ output_path: Annotated[str, typer.Option("-o", "--output-path", help="Base path for output files relative to repo root")] = ".ai/todo/files",
71
+ format_type: Annotated[Literal["csv", "md", "txt"], typer.Option("-f", "--format", help="Output format: csv, md (markdown), or txt")] = "md",
72
+ split_every: Annotated[Optional[int], typer.Option("--split-every", "-e", help="Split output into multiple files, each containing at most this many results")] = None,
73
+ split_to: Annotated[Optional[int], typer.Option("--split-to", "-t", help="Split output into exactly this many files")] = None,
74
+ ) -> None:
75
+ """Generate checklist with Python and shell script files in the repository filtered by pattern."""
76
+ from machineconfig.scripts.python.ai.utils.generate_files import make_todo_files as impl
77
+ impl(pattern=pattern, repo=repo, strategy=strategy, exclude_init=exclude_init, include_line_count=include_line_count, output_path=output_path, format_type=format_type, split_every=split_every, split_to=split_to)
78
+
79
+
80
+ def create_symlink_command(
81
+ num: Annotated[int, typer.Argument(help="Number of symlinks to create (1-5).")] = 5,
82
+ ) -> None:
83
+ """Create symlinks to repo_root at ~/code_copies/${repo_name}_copy_{i}."""
84
+ from machineconfig.scripts.python.ai.utils.generate_files import create_symlink_command as impl
85
+ impl(num=num)
86
+
87
+
88
+ def get_app() -> typer.Typer:
89
+ agents_app = typer.Typer(help="🤖 AI Agents management subcommands", no_args_is_help=True, add_help_option=True, add_completion=False)
187
90
  sep = "\n"
188
91
  agents_full_help = f"""
189
92
  [c] Create agents layout file, ready to run.
@@ -201,22 +104,17 @@ AGENT options: {', '.join(get_args(AGENTS))}
201
104
  agents_app.command("t", no_args_is_help=False, help=make_agents_command_template.__doc__, hidden=True)(make_agents_command_template)
202
105
  agents_app.command("make-config", no_args_is_help=False, help=init_config.__doc__, short_help="[g] Initialize AI configurations in the current repository")(init_config)
203
106
  agents_app.command("g", no_args_is_help=False, help=init_config.__doc__, hidden=True)(init_config)
204
- from machineconfig.scripts.python.ai.utils.generate_files import make_todo_files
205
- agents_app.command("make-todo", no_args_is_help=True, help=make_todo_files.__doc__, short_help="[d] Generate a markdown file listing all Python files in the repo")(make_todo_files)
206
- agents_app.command("d", no_args_is_help=True, help=make_todo_files.__doc__, hidden=True)(make_todo_files)
207
- from machineconfig.scripts.python.ai.utils.generate_files import create_symlink_command
208
- agents_app.command(name="make-symlinks", no_args_is_help=True, help=create_symlink_command.__doc__, short_help="[s] Create symlinks to the current repo in ~/code_copies/")(create_symlink_command)
209
- agents_app.command(name="s", no_args_is_help=True, help=create_symlink_command.__doc__, hidden=True)(create_symlink_command)
107
+ agents_app.command("make-todo", no_args_is_help=True, short_help="[d] Generate a markdown file listing all Python files in the repo")(make_todo_files)
108
+ agents_app.command("d", no_args_is_help=True, hidden=True)(make_todo_files)
109
+ agents_app.command(name="make-symlinks", no_args_is_help=True, short_help="[s] Create symlinks to the current repo in ~/code_copies/")(create_symlink_command)
110
+ agents_app.command(name="s", no_args_is_help=True, hidden=True)(create_symlink_command)
210
111
  return agents_app
211
112
 
212
113
 
213
- def main():
114
+ def main() -> None:
214
115
  agents_app = get_app()
215
- # from trogon.typer import init_tui
216
- # agents_app_tui = init_tui(agents_app)
217
116
  agents_app()
218
- # agents_app_tui()
219
117
 
220
118
 
221
- if __name__ == "__main__": # pragma: no cover
119
+ if __name__ == "__main__":
222
120
  pass
@@ -1,6 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
- from machineconfig.scripts.python.ai.solutions import generic
3
+ from machineconfig.scripts.python.ai.utils import generic
4
4
  from machineconfig.scripts.python.ai.solutions.claude import claude
5
5
  from machineconfig.scripts.python.ai.solutions.cline import cline
6
6
  from machineconfig.scripts.python.ai.solutions.copilot import github_copilot
@@ -20,6 +20,8 @@ def add_ai_configs(repo_root: Path) -> None:
20
20
  dot_scripts_dir = repo_root.joinpath(".scripts")
21
21
  dot_scripts_dir.mkdir(parents=True, exist_ok=True)
22
22
  generic.create_dot_scripts(repo_root=repo_root)
23
+ if not repo_root.joinpath(".gitignore").exists():
24
+ repo_root.joinpath(".gitignore").touch()
23
25
  generic.adjust_gitignore(repo_root=repo_root)
24
26
 
25
27
  add_lint_and_type_check_task(repo_root=repo_root)
@@ -52,6 +52,8 @@ uv add --dev pylint --upgrade-package pylint
52
52
  uv add --dev mypy --upgrade-package mypy
53
53
  uv add --dev pyrefly --upgrade-package pyrefly
54
54
  uv add --dev cleanpy --upgrade-package cleanpy
55
+ uv add --dev ruff --upgrade-package ruff
56
+ uv add --dev ty --upgrade-package ty
55
57
 
56
58
  uv add types-requests types-toml types-PyYAML types-pytz types-paramiko types-urllib3 --dev
57
59
  uv add types-mysqlclient types-SQLAlchemy --dev
@@ -56,6 +56,8 @@ uv add --dev pylint --upgrade-package pylint
56
56
  uv add --dev mypy --upgrade-package mypy
57
57
  uv add --dev pyrefly --upgrade-package pyrefly
58
58
  uv add --dev cleanpy --upgrade-package cleanpy
59
+ uv add --dev ruff --upgrade-package ruff
60
+ uv add --dev ty --upgrade-package ty
59
61
 
60
62
  uv add types-requests types-toml types-PyYAML types-pytz types-paramiko types-urllib3 --dev
61
63
  uv add types-mysqlclient types-SQLAlchemy --dev
@@ -81,35 +83,35 @@ draw_box "🔍 TYPE CHECKERS & LINTERS 🔍" "${BOLD}${PURPLE}"
81
83
  ((CURRENT_STEP++))
82
84
  draw_progress $CURRENT_STEP $TOTAL_STEPS "Pyright Type Checker"
83
85
  echo -e "${BLUE}📋 Analyzing types with Pyright...${NC}"
84
- rm ./.ai/linters/issues_pyright.md || true
86
+ rm -f ./.ai/linters/issues_pyright.md || true
85
87
  uv run pyright . > ./.ai/linters/issues_pyright.md
86
88
  echo -e "${GREEN}✅ Results saved to ${UNDERLINE}./.ai/linters/issues_pyright.md${NC}"
87
89
 
88
90
  ((CURRENT_STEP++))
89
91
  draw_progress $CURRENT_STEP $TOTAL_STEPS "MyPy Type Checker"
90
92
  echo -e "${BLUE}📋 Analyzing types with MyPy...${NC}"
91
- rm ./.ai/linters/issues_mypy.md || true
93
+ rm -f ./.ai/linters/issues_mypy.md || true
92
94
  uv run mypy . > ./.ai/linters/issues_mypy.md
93
95
  echo -e "${GREEN}✅ Results saved to ${UNDERLINE}./.ai/linters/issues_mypy.md${NC}"
94
96
 
95
97
  ((CURRENT_STEP++))
96
98
  draw_progress $CURRENT_STEP $TOTAL_STEPS "Pylint Code Analysis"
97
99
  echo -e "${BLUE}📋 Analyzing code quality with Pylint...${NC}"
98
- rm ./.ai/linters/issues_pylint.md || true
100
+ rm -f ./.ai/linters/issues_pylint.md || true
99
101
  uv run pylint --recursive=y . > ./.ai/linters/issues_pylint.md
100
102
  echo -e "${GREEN}✅ Results saved to ${UNDERLINE}./.ai/linters/issues_pylint.md${NC}"
101
103
 
102
104
  ((CURRENT_STEP++))
103
105
  draw_progress $CURRENT_STEP $TOTAL_STEPS "Pyrefly Type Checker"
104
106
  echo -e "${BLUE}📋 Analyzing types with Pyrefly...${NC}"
105
- rm ./.ai/linters/issues_pyrefly.md || true
107
+ rm -f ./.ai/linters/issues_pyrefly.md || true
106
108
  uv run pyrefly check . > ./.ai/linters/issues_pyrefly.md
107
109
  echo -e "${GREEN}✅ Results saved to ${UNDERLINE}./.ai/linters/issues_pyrefly.md${NC}"
108
110
 
109
111
  ((CURRENT_STEP++))
110
112
  draw_progress $CURRENT_STEP $TOTAL_STEPS "Ruff Linter"
111
113
  echo -e "${BLUE}📋 Checking code style with Ruff...${NC}"
112
- rm ./.ai/linters/issues_ruff.md || true
114
+ rm -f ./.ai/linters/issues_ruff.md || true
113
115
  uv run ruff check . > ./.ai/linters/issues_ruff.md
114
116
  echo -e "${GREEN}✅ Results saved to ${UNDERLINE}./.ai/linters/issues_ruff.md${NC}"
115
117
 
@@ -1,6 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
- from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
3
+ from machineconfig.scripts.python.ai.utils.shared import get_generic_instructions_path
4
4
 
5
5
 
6
6
  def build_configuration(repo_root: Path) -> None:
@@ -1,6 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
- from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
3
+ from machineconfig.scripts.python.ai.utils.shared import get_generic_instructions_path
4
4
 
5
5
 
6
6
  def build_configuration(repo_root: Path) -> None:
@@ -1,6 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
- from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
3
+ from machineconfig.scripts.python.ai.utils.shared import get_generic_instructions_path
4
4
  from machineconfig.utils.source_of_truth import LIBRARY_ROOT
5
5
 
6
6
 
@@ -35,6 +35,35 @@ applyTo: "**/*.py"
35
35
  * Please run `uv run -m pyright $file_touched` and address all issues. if `pyright is not there, first run `uv add pyright --dev`.
36
36
  * For all type checkers and linters, like mypy, pyright, pyrefly and pylint, there are config files at different levels of the repo all the way up to home directory level. You don't need to worry about them, just be mindful that they exist. The tools themselves will respect the configs therein.
37
37
  * If you want to run all linters and pycheckers agains the entire project to make sure everything is clean, I prepared a nice shell script, you can run it from the repo root as `./.ai/scripts/lint_and_type_check.sh`. It will produce markdown files that are you are meant to look at @ ./.ai/linters/*.md
38
+ * Rust-inspired style, e.g.
39
+ from typing import Literal, Optional, TypeAlias
40
+ class Success:
41
+ def __init__(self, value: int):
42
+ self.value = value
43
+ FAILURE_REASON: TypeAlias = Literal["cache_missing", "service_history_missing"]
44
+ class Failure:
45
+ def __init__(self, reason: FAILURE_REASON, message: Optional[str] = None):
46
+ self.reason: FAILURE_REASON = reason
47
+ self.message = message
48
+ def fallible_function(a: int, b: int) -> Success | Failure:
49
+ if a > b: return Success(value=a+b)
50
+ else: return Failure(reason="service_history_missing", message="a is not greater than b")
51
+ def example_usage() -> None:
52
+ result = fallible_function(2, 3)
53
+ match result:
54
+ case Success(): # Correct
55
+ print("Addition succeeded.")
56
+ case Failure(): # <--- Looks wrong, because no variable passed, but its correct, it works like this in python3.11+
57
+ # Now this only matches if result IS a Failure instance
58
+ print("Addition failed.")
59
+ print(f"Reason: {result.reason}, Message: {result.message}")
60
+ q = result.reason
61
+ match q:
62
+ case "cache_missing":
63
+ print("Handle cache missing scenario.")
64
+ case "service_history_missing":
65
+ print("Handle service history missing scenario.")
66
+
38
67
 
39
68
  # General Programming Ethos:
40
69
  * Make sure all the code is rigorous, no lazy stuff.
@@ -7,7 +7,7 @@ ref: https://github.com/charmbracelet/crush
7
7
 
8
8
  from pathlib import Path
9
9
  import platform
10
- from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
10
+ from machineconfig.scripts.python.ai.utils.shared import get_generic_instructions_path
11
11
 
12
12
 
13
13
 
@@ -1,6 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
- from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
3
+ from machineconfig.scripts.python.ai.utils.shared import get_generic_instructions_path
4
4
 
5
5
 
6
6
  def build_configuration(repo_root: Path) -> None:
@@ -1,6 +1,6 @@
1
1
  from pathlib import Path
2
2
 
3
- from machineconfig.scripts.python.ai.solutions._shared import get_generic_instructions_path
3
+ from machineconfig.scripts.python.ai.utils.shared import get_generic_instructions_path
4
4
  from machineconfig.utils.source_of_truth import LIBRARY_ROOT
5
5
 
6
6
  def build_configuration(repo_root: Path) -> None:
@@ -1,4 +1,7 @@
1
1
  {
2
+ "general": {
3
+ "previewFeatures": true
4
+ },
2
5
  // Appearance
3
6
  "theme": "Default", // Could also be "GitHub", "Dracula", etc.
4
7
 
@@ -40,21 +40,8 @@ def adjust_gitignore(repo_root: Path) -> None:
40
40
 
41
41
  dot_git_ignore_content = dot_git_ignore_path.read_text(encoding="utf-8")
42
42
  entries_to_add: list[str] = []
43
- required_entries: list[str] = [
44
- ".links",
45
- "notebooks",
46
- ".ai",
47
- "GEMINI.md",
48
- "CLAUDE.md",
49
- "CRUSH.md",
50
- ".cursor",
51
- ".clinerules",
52
- ".github/instructions",
53
- ".github/agents",
54
- ".github/prompts",
55
- ]
56
-
57
- for entry in required_entries:
43
+ from machineconfig.utils.source_of_truth import EXCLUDE_DIRS
44
+ for entry in EXCLUDE_DIRS:
58
45
  if entry not in dot_git_ignore_content:
59
46
  entries_to_add.append(entry)
60
47
 
@@ -27,9 +27,12 @@ def add_lint_and_type_check_task(repo_root: Path) -> None:
27
27
  assert isinstance(tasks_config, dict)
28
28
  if "tasks" not in tasks_config:
29
29
  tasks_config["tasks"] = []
30
- existing_labels = {task.get("label") for task in tasks_config.get("tasks", [])}
31
- if "lintAndTypeCheck" not in existing_labels:
32
- tasks_config["tasks"].append(task_to_add)
30
+
31
+ # Remove any existing entries with the same label to prevent duplicates
32
+ tasks_config["tasks"] = [
33
+ t for t in tasks_config["tasks"] if t.get("label") != task_to_add["label"]
34
+ ]
35
+ tasks_config["tasks"].append(task_to_add)
33
36
  else:
34
37
  tasks_config = {"version": "2.0.0", "tasks": [task_to_add]}
35
38
 
@@ -1,20 +1,67 @@
1
+ """Cloud management commands - lazy loading subcommands."""
1
2
 
2
3
  import typer
3
- from machineconfig.scripts.python.helpers_cloud.cloud_sync import main as sync_main
4
- from machineconfig.scripts.python.helpers_cloud.cloud_copy import main as copy_main
5
- from machineconfig.scripts.python.helpers_cloud.cloud_mount import mount as mount_main
4
+ from typing import Optional, Annotated
6
5
 
7
- def get_app():
8
- app = typer.Typer(add_completion=False, no_args_is_help=True)
9
6
 
10
- app.command(name="sync", no_args_is_help=True, help=sync_main.__doc__, short_help="""🔄 [s] Synchronize files/folders between local and cloud storage.""")(sync_main)
11
- app.command(name="s", no_args_is_help=True, help=sync_main.__doc__, hidden=True)(sync_main) # short alias
7
+ def sync(
8
+ source: Annotated[str, typer.Argument(help="source")],
9
+ target: Annotated[str, typer.Argument(help="target")],
10
+ transfers: Annotated[int, typer.Option("--transfers", "-t", help="Number of threads in syncing.")] = 10,
11
+ root: Annotated[str, typer.Option("--root", "-R", help="Remote root.")] = "myhome",
12
+ key: Annotated[Optional[str], typer.Option("--key", "-k", help="Key for encryption")] = None,
13
+ pwd: Annotated[Optional[str], typer.Option("--pwd", "-P", help="Password for encryption")] = None,
14
+ encrypt: Annotated[bool, typer.Option("--encrypt", "-e", help="Decrypt after receiving.")] = False,
15
+ zip_: Annotated[bool, typer.Option("--zip", "-z", help="unzip after receiving.")] = False,
16
+ bisync: Annotated[bool, typer.Option("--bisync", "-b", help="Bidirectional sync.")] = False,
17
+ delete: Annotated[bool, typer.Option("--delete", "-D", help="Delete files in remote that are not in local.")] = False,
18
+ verbose: Annotated[bool, typer.Option("--verbose", "-v", help="Verbosity of mprocs to show details of syncing.")] = False,
19
+ ) -> None:
20
+ """🔄 Synchronize files/folders between local and cloud storage."""
21
+ from machineconfig.scripts.python.helpers.helpers_cloud.cloud_sync import main as sync_main
22
+ sync_main(source=source, target=target, transfers=transfers, root=root, key=key, pwd=pwd, encrypt=encrypt, zip_=zip_, bisync=bisync, delete=delete, verbose=verbose)
12
23
 
13
- app.command(name="copy", no_args_is_help=True, help=copy_main.__doc__, short_help="""📤 [c] Upload or 📥 Download files/folders to/from cloud storage services like Google Drive, Dropbox, OneDrive, etc.""")(copy_main)
14
- app.command(name="c", no_args_is_help=True, help=copy_main.__doc__, hidden=True)(copy_main) # short alias
15
24
 
16
- app.command(name="mount", no_args_is_help=True, help=mount_main.__doc__, short_help="""🔗 [m] Mount cloud storage services like Google Drive, Dropbox, OneDrive, etc. as local drives.""")(mount_main)
17
- app.command(name="m", no_args_is_help=True, help=mount_main.__doc__, hidden=True)(mount_main) # short alias
25
+ def copy(
26
+ source: Annotated[str, typer.Argument(help="📂 file/folder path to be taken from here.")],
27
+ target: Annotated[str, typer.Argument(help="🎯 file/folder path to be be sent to here.")],
28
+ overwrite: Annotated[bool, typer.Option("--overwrite", "-o", help="✍️ Overwrite existing file.")] = False,
29
+ share: Annotated[bool, typer.Option("--share", "-s", help="🔗 Share file / directory")] = False,
30
+ rel2home: Annotated[bool, typer.Option("--relative2home", "-r", help="🏠 Relative to `myhome` folder")] = False,
31
+ root: Annotated[Optional[str], typer.Option("--root", "-R", help="🌳 Remote root. None is the default, unless rel2home is raied, making the default `myhome`.")] = None,
32
+ key: Annotated[Optional[str], typer.Option("--key", "-k", help="🔑 Key for encryption")] = None,
33
+ pwd: Annotated[Optional[str], typer.Option("--password", "-p", help="🔒 Password for encryption")] = None,
34
+ encrypt: Annotated[bool, typer.Option("--encrypt", "-e", help="🔐 Encrypt before sending.")] = False,
35
+ zip_: Annotated[bool, typer.Option("--zip", "-z", help="📦 unzip after receiving.")] = False,
36
+ os_specific: Annotated[bool, typer.Option("--os-specific", "-O", help="💻 choose path specific for this OS.")] = False,
37
+ config: Annotated[Optional[str], typer.Option("--config", "-c", help="⚙️ path to cloud.json file.")] = None,
38
+ ) -> None:
39
+ """📤 Upload or 📥 Download files/folders to/from cloud storage services."""
40
+ from machineconfig.scripts.python.helpers.helpers_cloud.cloud_copy import main as copy_main
41
+ copy_main(source=source, target=target, overwrite=overwrite, share=share, rel2home=rel2home, root=root, key=key, pwd=pwd, encrypt=encrypt, zip_=zip_, os_specific=os_specific, config=config)
42
+
43
+
44
+ def mount(
45
+ cloud: Annotated[Optional[str], typer.Option(help="cloud to mount")] = None,
46
+ destination: Annotated[Optional[str], typer.Option(help="destination to mount")] = None,
47
+ network: Annotated[Optional[str], typer.Option(help="mount network drive")] = None,
48
+ ) -> None:
49
+ """🔗 Mount cloud storage services as local drives."""
50
+ from machineconfig.scripts.python.helpers.helpers_cloud.cloud_mount import mount as mount_main
51
+ mount_main(cloud=cloud, destination=destination, network=network)
52
+
53
+
54
+ def get_app() -> typer.Typer:
55
+ app = typer.Typer(add_completion=False, no_args_is_help=True, help="☁️ Cloud management commands")
56
+
57
+ app.command(name="sync", no_args_is_help=True, short_help="🔄 [s] Synchronize files/folders between local and cloud storage.")(sync)
58
+ app.command(name="s", no_args_is_help=True, hidden=True)(sync)
59
+
60
+ app.command(name="copy", no_args_is_help=True, short_help="📤 [c] Upload or 📥 Download files/folders to/from cloud storage.")(copy)
61
+ app.command(name="c", no_args_is_help=True, hidden=True)(copy)
62
+
63
+ app.command(name="mount", no_args_is_help=True, short_help="🔗 [m] Mount cloud storage services as local drives.")(mount)
64
+ app.command(name="m", no_args_is_help=True, hidden=True)(mount)
18
65
 
19
66
  return app
20
67