machineconfig 5.15__py3-none-any.whl → 7.66__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.
- machineconfig/__init__.py +0 -28
- machineconfig/cluster/remote/distribute.py +0 -1
- machineconfig/cluster/remote/file_manager.py +0 -2
- machineconfig/cluster/remote/script_execution.py +0 -1
- machineconfig/cluster/sessions_managers/{utils → helpers}/enhanced_command_runner.py +4 -6
- machineconfig/cluster/sessions_managers/utils/load_balancer.py +1 -1
- machineconfig/cluster/sessions_managers/utils/maker.py +69 -0
- machineconfig/cluster/sessions_managers/wt_local.py +114 -289
- machineconfig/cluster/sessions_managers/wt_local_manager.py +50 -193
- machineconfig/cluster/sessions_managers/wt_remote.py +51 -43
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +49 -197
- machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +6 -19
- machineconfig/cluster/sessions_managers/wt_utils/manager_persistence.py +52 -0
- machineconfig/cluster/sessions_managers/wt_utils/monitoring_helpers.py +50 -0
- machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +4 -2
- machineconfig/cluster/sessions_managers/wt_utils/status_reporting.py +76 -0
- machineconfig/cluster/sessions_managers/wt_utils/wt_helpers.py +199 -0
- machineconfig/cluster/sessions_managers/zellij_local.py +81 -375
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +22 -169
- machineconfig/cluster/sessions_managers/zellij_remote.py +40 -41
- machineconfig/cluster/sessions_managers/zellij_remote_manager.py +13 -10
- machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +4 -8
- machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +5 -20
- machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +3 -9
- machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +3 -1
- machineconfig/cluster/sessions_managers/zellij_utils/zellij_local_helper.py +298 -0
- machineconfig/cluster/sessions_managers/zellij_utils/zellij_local_helper_restart.py +77 -0
- machineconfig/cluster/sessions_managers/zellij_utils/zellij_local_helper_with_panes.py +228 -0
- machineconfig/cluster/sessions_managers/zellij_utils/zellij_local_manager_helper.py +165 -0
- machineconfig/jobs/{python → installer}/check_installations.py +2 -3
- machineconfig/jobs/installer/custom/boxes.py +61 -0
- machineconfig/jobs/installer/custom/hx.py +76 -19
- machineconfig/jobs/installer/custom_dev/alacritty.py +4 -4
- machineconfig/jobs/installer/custom_dev/brave.py +1 -7
- machineconfig/jobs/installer/custom_dev/cloudflare_warp_cli.py +23 -0
- machineconfig/jobs/installer/custom_dev/code.py +4 -1
- machineconfig/jobs/installer/custom_dev/dubdb_adbc.py +30 -0
- machineconfig/jobs/installer/custom_dev/nerfont_windows_helper.py +9 -18
- machineconfig/jobs/installer/custom_dev/sysabc.py +119 -0
- machineconfig/jobs/installer/custom_dev/wezterm.py +2 -19
- machineconfig/jobs/installer/installer_data.json +1101 -115
- machineconfig/jobs/installer/linux_scripts/brave.sh +4 -14
- machineconfig/jobs/installer/linux_scripts/{warp-cli.sh → cloudflare_warp_cli.sh} +5 -17
- machineconfig/jobs/installer/linux_scripts/docker.sh +5 -17
- machineconfig/jobs/installer/linux_scripts/docker_start.sh +6 -14
- machineconfig/jobs/installer/linux_scripts/edge.sh +3 -11
- machineconfig/jobs/{linux/msc → installer/linux_scripts}/lid.sh +2 -8
- machineconfig/jobs/installer/linux_scripts/nerdfont.sh +5 -17
- machineconfig/jobs/{linux/msc → installer/linux_scripts}/network.sh +2 -8
- machineconfig/jobs/installer/linux_scripts/q.sh +1 -0
- machineconfig/jobs/installer/linux_scripts/redis.sh +6 -17
- machineconfig/jobs/installer/linux_scripts/vscode.sh +5 -17
- machineconfig/jobs/installer/linux_scripts/wezterm.sh +4 -12
- machineconfig/jobs/installer/package_groups.py +108 -180
- machineconfig/logger.py +0 -1
- machineconfig/profile/backup.toml +49 -0
- machineconfig/profile/bash_shell_profiles.md +11 -0
- machineconfig/profile/create_helper.py +74 -0
- machineconfig/profile/create_links.py +288 -0
- machineconfig/profile/create_links_export.py +100 -0
- machineconfig/profile/create_shell_profile.py +136 -0
- machineconfig/profile/mapper.toml +258 -0
- machineconfig/scripts/Restore-ThunderbirdProfile.ps1 +92 -0
- machineconfig/scripts/__init__.py +0 -4
- machineconfig/scripts/linux/{share_cloud.sh → other/share_cloud.sh} +14 -25
- machineconfig/scripts/linux/wrap_mcfg +47 -0
- machineconfig/scripts/nu/wrap_mcfg.nu +69 -0
- machineconfig/scripts/python/agents.py +92 -103
- machineconfig/scripts/python/ai/command_runner/command_runner.sh +9 -0
- machineconfig/scripts/python/ai/command_runner/prompt.txt +9 -0
- machineconfig/scripts/python/ai/generate_files.py +307 -42
- machineconfig/scripts/python/ai/initai.py +3 -28
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.ps1 +17 -18
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +17 -18
- machineconfig/scripts/python/ai/solutions/_shared.py +9 -1
- machineconfig/scripts/python/ai/solutions/copilot/instructions/python/dev.instructions.md +1 -1
- machineconfig/scripts/python/ai/solutions/copilot/prompts/pyright_fix.md +16 -0
- machineconfig/scripts/python/ai/solutions/generic.py +27 -4
- machineconfig/scripts/python/ai/vscode_tasks.py +37 -0
- machineconfig/scripts/python/cloud.py +29 -0
- machineconfig/scripts/python/croshell.py +111 -114
- machineconfig/scripts/python/define.py +31 -0
- machineconfig/scripts/python/devops.py +44 -103
- machineconfig/scripts/python/devops_navigator.py +10 -0
- machineconfig/scripts/python/env_manager/__init__.py +1 -0
- machineconfig/scripts/python/env_manager/path_manager_backend.py +47 -0
- machineconfig/scripts/python/env_manager/path_manager_tui.py +228 -0
- machineconfig/scripts/python/explore.py +49 -0
- machineconfig/scripts/python/fire_jobs.py +115 -152
- machineconfig/scripts/python/ftpx.py +29 -24
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.json +14 -0
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_crush.py +37 -0
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_cursor_agents.py +22 -0
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_gemini.py +42 -0
- machineconfig/scripts/python/helpers_agents/agentic_frameworks/fire_qwen.py +30 -0
- machineconfig/scripts/python/{fire_agents_help_launch.py → helpers_agents/fire_agents_help_launch.py} +34 -44
- machineconfig/scripts/python/helpers_agents/fire_agents_helper_types.py +34 -0
- machineconfig/scripts/python/helpers_agents/templates/prompt.txt +6 -0
- machineconfig/scripts/python/helpers_agents/templates/template.ps1 +14 -0
- machineconfig/scripts/python/helpers_agents/templates/template.sh +24 -0
- machineconfig/scripts/python/{cloud_copy.py → helpers_cloud/cloud_copy.py} +30 -23
- machineconfig/scripts/python/{cloud_mount.py → helpers_cloud/cloud_mount.py} +10 -18
- machineconfig/scripts/python/{cloud_sync.py → helpers_cloud/cloud_sync.py} +12 -18
- machineconfig/scripts/python/{helpers → helpers_cloud}/helpers2.py +1 -1
- machineconfig/scripts/python/helpers_croshell/crosh.py +39 -0
- machineconfig/scripts/python/{start_slidev.py → helpers_croshell/start_slidev.py} +2 -2
- machineconfig/scripts/python/helpers_devops/cli_config.py +95 -0
- machineconfig/scripts/python/helpers_devops/cli_config_dotfile.py +89 -0
- machineconfig/scripts/python/helpers_devops/cli_data.py +25 -0
- machineconfig/scripts/python/helpers_devops/cli_nw.py +134 -0
- machineconfig/scripts/python/helpers_devops/cli_repos.py +182 -0
- machineconfig/scripts/python/helpers_devops/cli_self.py +134 -0
- machineconfig/scripts/python/helpers_devops/cli_share_file.py +137 -0
- machineconfig/scripts/python/helpers_devops/cli_share_server.py +141 -0
- machineconfig/scripts/python/{share_terminal.py → helpers_devops/cli_terminal.py} +35 -23
- machineconfig/scripts/python/helpers_devops/cli_utils.py +96 -0
- machineconfig/scripts/python/{devops_backup_retrieve.py → helpers_devops/devops_backup_retrieve.py} +7 -10
- machineconfig/scripts/python/helpers_devops/devops_status.py +511 -0
- machineconfig/scripts/python/{devops_update_repos.py → helpers_devops/devops_update_repos.py} +68 -49
- machineconfig/scripts/python/helpers_devops/themes/choose_pwsh_theme.ps1 +81 -0
- machineconfig/scripts/python/helpers_devops/themes/choose_starship_theme.bash +3 -0
- machineconfig/scripts/python/{choose_wezterm_theme.py → helpers_devops/themes/choose_wezterm_theme.py} +2 -2
- machineconfig/scripts/python/helpers_fire_command/__init__.py +0 -0
- machineconfig/scripts/python/{helpers/helpers4.py → helpers_fire_command/file_wrangler.py} +56 -20
- machineconfig/scripts/python/{fire_jobs_args_helper.py → helpers_fire_command/fire_jobs_args_helper.py} +5 -1
- machineconfig/scripts/python/{fire_jobs_route_helper.py → helpers_fire_command/fire_jobs_route_helper.py} +47 -2
- machineconfig/scripts/python/helpers_fire_command/fire_jobs_streamlit_helper.py +0 -0
- machineconfig/scripts/python/helpers_msearch/__init__.py +5 -0
- machineconfig/scripts/{linux → python/helpers_msearch/scripts_linux}/fzfag +1 -1
- machineconfig/scripts/{linux → python/helpers_msearch/scripts_linux}/fzfg +1 -1
- machineconfig/scripts/{linux → python/helpers_msearch/scripts_linux}/fzfrga +1 -1
- machineconfig/scripts/python/helpers_navigator/__init__.py +20 -0
- machineconfig/scripts/python/helpers_navigator/command_builder.py +111 -0
- machineconfig/scripts/python/helpers_navigator/command_detail.py +44 -0
- machineconfig/scripts/python/helpers_navigator/command_tree.py +588 -0
- machineconfig/scripts/python/helpers_navigator/data_models.py +28 -0
- machineconfig/scripts/python/helpers_navigator/main_app.py +272 -0
- machineconfig/scripts/python/helpers_navigator/search_bar.py +15 -0
- machineconfig/scripts/python/helpers_repos/action.py +209 -0
- machineconfig/scripts/python/helpers_repos/action_helper.py +150 -0
- machineconfig/scripts/python/{repos_helper_clone.py → helpers_repos/clone.py} +2 -3
- machineconfig/scripts/python/helpers_repos/cloud_repo_sync.py +218 -0
- machineconfig/scripts/python/{count_lines.py → helpers_repos/count_lines.py} +10 -10
- machineconfig/scripts/python/helpers_repos/count_lines_frontend.py +17 -0
- machineconfig/scripts/python/{repos_helper.py → helpers_repos/entrypoint.py} +9 -17
- machineconfig/scripts/python/helpers_repos/grource.py +340 -0
- machineconfig/scripts/python/{repos_helper_record.py → helpers_repos/record.py} +4 -3
- machineconfig/scripts/python/helpers_repos/sync.py +66 -0
- machineconfig/scripts/python/{repos_helper_update.py → helpers_repos/update.py} +3 -3
- machineconfig/scripts/python/helpers_sessions/__init__.py +0 -0
- machineconfig/scripts/python/helpers_sessions/sessions_multiprocess.py +58 -0
- machineconfig/scripts/python/helpers_utils/download.py +152 -0
- machineconfig/scripts/python/helpers_utils/path.py +108 -0
- machineconfig/scripts/python/interactive.py +64 -84
- machineconfig/scripts/python/machineconfig.py +63 -0
- machineconfig/scripts/python/msearch.py +21 -0
- machineconfig/scripts/python/nw/__init__.py +0 -0
- machineconfig/scripts/python/{devops_add_identity.py → nw/devops_add_identity.py} +0 -2
- machineconfig/scripts/python/{devops_add_ssh_key.py → nw/devops_add_ssh_key.py} +73 -43
- machineconfig/scripts/{linux → python/nw}/mount_nfs +1 -1
- machineconfig/scripts/python/{mount_nfs.py → nw/mount_nfs.py} +3 -3
- machineconfig/scripts/{linux → python/nw}/mount_nw_drive +1 -2
- machineconfig/scripts/python/{mount_ssh.py → nw/mount_ssh.py} +3 -3
- machineconfig/scripts/python/{onetimeshare.py → nw/onetimeshare.py} +0 -1
- machineconfig/scripts/python/nw/ssh_debug_linux.py +391 -0
- machineconfig/scripts/python/nw/ssh_debug_windows.py +338 -0
- machineconfig/scripts/python/{wifi_conn.py → nw/wifi_conn.py} +1 -53
- machineconfig/scripts/python/{wsl_windows_transfer.py → nw/wsl_windows_transfer.py} +5 -4
- machineconfig/scripts/python/sessions.py +64 -44
- machineconfig/scripts/python/terminal.py +127 -0
- machineconfig/scripts/python/utils.py +66 -0
- machineconfig/scripts/windows/{mount_nfs.ps1 → mounts/mount_nfs.ps1} +1 -3
- machineconfig/scripts/windows/{mount_ssh.ps1 → mounts/mount_ssh.ps1} +1 -1
- machineconfig/scripts/windows/{share_smb.ps1 → mounts/share_smb.ps1} +0 -6
- machineconfig/scripts/windows/wrap_mcfg.ps1 +60 -0
- machineconfig/settings/broot/br.sh +0 -4
- machineconfig/settings/broot/conf.toml +1 -1
- machineconfig/settings/helix/config.toml +16 -0
- machineconfig/settings/helix/languages.toml +13 -4
- machineconfig/settings/helix/yazi-picker.sh +12 -0
- machineconfig/settings/lf/linux/exe/lfcd.sh +1 -0
- machineconfig/settings/lf/linux/exe/previewer.sh +9 -3
- machineconfig/settings/lf/linux/lfrc +10 -12
- machineconfig/settings/lf/windows/fzf_edit.ps1 +2 -2
- machineconfig/settings/lf/windows/lfrc +18 -38
- machineconfig/settings/lf/windows/mkfile.ps1 +1 -1
- machineconfig/settings/linters/.ruff.toml +1 -1
- machineconfig/settings/lvim/windows/archive/config_additional.lua +0 -6
- machineconfig/settings/marimo/marimo.toml +80 -0
- machineconfig/settings/marimo/snippets/globalize.py +34 -0
- machineconfig/settings/pistol/pistol.conf +1 -1
- machineconfig/settings/shells/bash/init.sh +55 -31
- machineconfig/settings/shells/nushell/config.nu +1 -34
- machineconfig/settings/shells/nushell/init.nu +127 -0
- machineconfig/settings/shells/pwsh/init.ps1 +60 -43
- machineconfig/settings/shells/starship/starship.toml +16 -0
- machineconfig/settings/shells/wezterm/wezterm.lua +2 -0
- machineconfig/settings/shells/wt/settings.json +32 -17
- machineconfig/settings/shells/zsh/init.sh +89 -0
- machineconfig/settings/svim/linux/init.toml +0 -4
- machineconfig/settings/svim/windows/init.toml +0 -3
- machineconfig/settings/yazi/init.lua +57 -0
- machineconfig/settings/yazi/keymap_linux.toml +79 -0
- machineconfig/settings/yazi/keymap_windows.toml +78 -0
- machineconfig/settings/yazi/shell/yazi_cd.ps1 +33 -0
- machineconfig/settings/yazi/shell/yazi_cd.sh +8 -0
- machineconfig/settings/yazi/yazi.toml +13 -0
- machineconfig/setup_linux/__init__.py +10 -0
- machineconfig/setup_linux/apps_desktop.sh +89 -0
- machineconfig/setup_linux/apps_gui.sh +64 -0
- machineconfig/setup_linux/{nix → others}/cli_installation.sh +9 -29
- machineconfig/setup_linux/ssh/openssh_all.sh +25 -0
- machineconfig/setup_linux/ssh/openssh_wsl.sh +38 -0
- machineconfig/setup_linux/uv.sh +15 -0
- machineconfig/setup_linux/web_shortcuts/interactive.sh +26 -6
- machineconfig/setup_mac/__init__.py +16 -0
- machineconfig/setup_mac/apps_gui.sh +248 -0
- machineconfig/setup_mac/ssh/openssh_setup.sh +114 -0
- machineconfig/setup_mac/uv.sh +36 -0
- machineconfig/setup_windows/__init__.py +8 -0
- machineconfig/setup_windows/others/power_options.ps1 +7 -0
- machineconfig/setup_windows/ssh/add-sshkey.ps1 +29 -0
- machineconfig/setup_windows/ssh/add_identity.ps1 +11 -0
- machineconfig/setup_windows/ssh/openssh-server.ps1 +37 -0
- machineconfig/setup_windows/uv.ps1 +10 -0
- machineconfig/setup_windows/web_shortcuts/interactive.ps1 +27 -10
- machineconfig/setup_windows/web_shortcuts/quick_init.ps1 +16 -0
- machineconfig/utils/accessories.py +7 -5
- machineconfig/utils/cloud/onedrive/README.md +139 -0
- machineconfig/utils/code.py +133 -106
- machineconfig/utils/files/art/fat_croco.txt +10 -0
- machineconfig/utils/files/art/halfwit_croco.txt +9 -0
- machineconfig/utils/files/art/happy_croco.txt +22 -0
- machineconfig/utils/files/art/water_croco.txt +11 -0
- machineconfig/utils/files/ascii_art.py +1 -1
- machineconfig/utils/files/dbms.py +257 -0
- machineconfig/utils/files/headers.py +11 -14
- machineconfig/utils/files/ouch/__init__.py +0 -0
- machineconfig/utils/files/ouch/decompress.py +45 -0
- machineconfig/utils/files/read.py +10 -18
- machineconfig/utils/installer_utils/installer_class.py +68 -126
- machineconfig/utils/installer_utils/{installer.py → installer_cli.py} +109 -117
- machineconfig/utils/installer_utils/{installer_abc.py → installer_locator_utils.py} +31 -81
- machineconfig/utils/{installer.py → installer_utils/installer_runner.py} +44 -74
- machineconfig/utils/io.py +77 -23
- machineconfig/utils/links.py +254 -162
- machineconfig/utils/meta.py +255 -0
- machineconfig/utils/notifications.py +1 -1
- machineconfig/utils/options.py +13 -3
- machineconfig/utils/path_extended.py +46 -100
- machineconfig/utils/path_helper.py +75 -22
- machineconfig/utils/procs.py +50 -70
- machineconfig/utils/scheduler.py +94 -97
- machineconfig/utils/scheduling.py +0 -3
- machineconfig/utils/schemas/fire_agents/fire_agents_input.py +1 -1
- machineconfig/utils/schemas/layouts/layout_types.py +1 -1
- machineconfig/utils/source_of_truth.py +3 -6
- machineconfig/utils/ssh.py +742 -264
- machineconfig/utils/ssh_utils/utils.py +0 -0
- machineconfig/utils/terminal.py +2 -113
- machineconfig/utils/tst.py +20 -0
- machineconfig/utils/upgrade_packages.py +109 -28
- machineconfig/utils/ve.py +11 -4
- machineconfig-7.66.dist-info/METADATA +124 -0
- machineconfig-7.66.dist-info/RECORD +451 -0
- machineconfig-7.66.dist-info/entry_points.txt +15 -0
- machineconfig/cluster/sessions_managers/ffile.py +0 -4
- machineconfig/jobs/installer/linux_scripts/pgsql.sh +0 -49
- machineconfig/jobs/installer/linux_scripts/timescaledb.sh +0 -85
- machineconfig/jobs/linux/msc/cli_agents.sh +0 -16
- machineconfig/jobs/python/python_ve_symlink.py +0 -37
- machineconfig/jobs/python/vscode/api.py +0 -57
- machineconfig/jobs/python/vscode/sync_code.py +0 -73
- machineconfig/jobs/windows/archive/archive_pygraphviz.ps1 +0 -14
- machineconfig/jobs/windows/start_terminal.ps1 +0 -6
- machineconfig/jobs/windows/startup_file.cmd +0 -2
- machineconfig/profile/create.py +0 -303
- machineconfig/profile/shell.py +0 -176
- machineconfig/scripts/cloud/init.sh +0 -119
- machineconfig/scripts/linux/agents +0 -2
- machineconfig/scripts/linux/choose_wezterm_theme +0 -3
- machineconfig/scripts/linux/cloud_copy +0 -2
- machineconfig/scripts/linux/cloud_mount +0 -2
- machineconfig/scripts/linux/cloud_repo_sync +0 -2
- machineconfig/scripts/linux/cloud_sync +0 -2
- machineconfig/scripts/linux/croshell +0 -3
- machineconfig/scripts/linux/devops +0 -2
- machineconfig/scripts/linux/fire +0 -2
- machineconfig/scripts/linux/ftpx +0 -2
- machineconfig/scripts/linux/fzf2g +0 -21
- machineconfig/scripts/linux/fzffg +0 -25
- machineconfig/scripts/linux/gh_models +0 -2
- machineconfig/scripts/linux/initai +0 -2
- machineconfig/scripts/linux/kill_process +0 -2
- machineconfig/scripts/linux/scheduler +0 -2
- machineconfig/scripts/linux/sessions +0 -2
- machineconfig/scripts/linux/share_smb +0 -1
- machineconfig/scripts/linux/start_slidev +0 -2
- machineconfig/scripts/linux/start_terminals +0 -3
- machineconfig/scripts/linux/warp-cli.sh +0 -122
- machineconfig/scripts/linux/wifi_conn +0 -2
- machineconfig/scripts/linux/z_ls +0 -104
- machineconfig/scripts/python/ai/solutions/copilot/prompts/allLintersAndTypeCheckers.prompt.md +0 -5
- machineconfig/scripts/python/cloud_repo_sync.py +0 -190
- machineconfig/scripts/python/count_lines_frontend.py +0 -16
- machineconfig/scripts/python/dotfile.py +0 -78
- machineconfig/scripts/python/fire_agents_helper_types.py +0 -12
- machineconfig/scripts/python/get_zellij_cmd.py +0 -15
- machineconfig/scripts/python/gh_models.py +0 -104
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +0 -116
- machineconfig/scripts/python/repos.py +0 -132
- machineconfig/scripts/python/repos_helper_action.py +0 -378
- machineconfig/scripts/python/snapshot.py +0 -25
- machineconfig/scripts/python/start_terminals.py +0 -121
- machineconfig/scripts/python/t4.py +0 -17
- machineconfig/scripts/windows/agents.ps1 +0 -1
- machineconfig/scripts/windows/choose_wezterm_theme.ps1 +0 -1
- machineconfig/scripts/windows/cloud_copy.ps1 +0 -1
- machineconfig/scripts/windows/cloud_mount.ps1 +0 -1
- machineconfig/scripts/windows/cloud_repo_sync.ps1 +0 -1
- machineconfig/scripts/windows/cloud_sync.ps1 +0 -1
- machineconfig/scripts/windows/croshell.ps1 +0 -1
- machineconfig/scripts/windows/devops.ps1 +0 -1
- machineconfig/scripts/windows/dotfile.ps1 +0 -1
- machineconfig/scripts/windows/fire.ps1 +0 -1
- machineconfig/scripts/windows/ftpx.ps1 +0 -1
- machineconfig/scripts/windows/gpt.ps1 +0 -1
- machineconfig/scripts/windows/grep.ps1 +0 -2
- machineconfig/scripts/windows/initai.ps1 +0 -1
- machineconfig/scripts/windows/kill_process.ps1 +0 -1
- machineconfig/scripts/windows/nano.ps1 +0 -3
- machineconfig/scripts/windows/pomodoro.ps1 +0 -1
- machineconfig/scripts/windows/reload_path.ps1 +0 -3
- machineconfig/scripts/windows/scheduler.ps1 +0 -1
- machineconfig/scripts/windows/sessions.ps1 +0 -1
- machineconfig/scripts/windows/snapshot.ps1 +0 -1
- machineconfig/scripts/windows/start_slidev.ps1 +0 -1
- machineconfig/scripts/windows/start_terminals.ps1 +0 -1
- machineconfig/scripts/windows/wifi_conn.ps1 +0 -2
- machineconfig/scripts/windows/wsl_rdp_windows_port_forwarding.ps1 +0 -46
- machineconfig/scripts/windows/wsl_ssh_windows_port_forwarding.ps1 +0 -76
- machineconfig/settings/lf/linux/exe/fzf_nano.sh +0 -16
- machineconfig/setup_linux/others/openssh-server_add_pub_key.sh +0 -57
- machineconfig/setup_linux/web_shortcuts/croshell.sh +0 -11
- machineconfig/setup_linux/web_shortcuts/ssh.sh +0 -52
- machineconfig/setup_windows/web_shortcuts/all.ps1 +0 -18
- machineconfig/setup_windows/web_shortcuts/ascii_art.ps1 +0 -36
- machineconfig/setup_windows/web_shortcuts/croshell.ps1 +0 -16
- machineconfig/setup_windows/web_shortcuts/ssh.ps1 +0 -11
- machineconfig/utils/ai/generate_file_checklist.py +0 -68
- machineconfig-5.15.dist-info/METADATA +0 -188
- machineconfig-5.15.dist-info/RECORD +0 -415
- machineconfig-5.15.dist-info/entry_points.txt +0 -18
- machineconfig/cluster/sessions_managers/{utils → helpers}/load_balancer_helper.py +0 -0
- machineconfig/scripts/linux/{share_nfs → other/share_nfs} +0 -0
- machineconfig/scripts/linux/{start_docker → other/start_docker} +0 -0
- machineconfig/scripts/linux/{switch_ip → other/switch_ip} +0 -0
- machineconfig/{jobs/python → scripts/python/helpers_agents}/__init__.py +0 -0
- machineconfig/scripts/python/{helpers → helpers_agents/agentic_frameworks}/__init__.py +0 -0
- machineconfig/scripts/python/{fire_agents_help_search.py → helpers_agents/fire_agents_help_search.py} +0 -0
- machineconfig/scripts/python/{fire_agents_load_balancer.py → helpers_agents/fire_agents_load_balancer.py} +0 -0
- machineconfig/{jobs/windows/msc/cli_agents.bat → scripts/python/helpers_cloud/__init__.py} +0 -0
- machineconfig/scripts/python/{helpers → helpers_cloud}/cloud_helpers.py +1 -1
- /machineconfig/scripts/python/{helpers → helpers_cloud}/helpers5.py +0 -0
- /machineconfig/{jobs/windows/msc/cli_agents.ps1 → scripts/python/helpers_croshell/__init__.py} +0 -0
- /machineconfig/scripts/python/{pomodoro.py → helpers_croshell/pomodoro.py} +0 -0
- /machineconfig/scripts/python/{scheduler.py → helpers_croshell/scheduler.py} +0 -0
- /machineconfig/scripts/python/{viewer.py → helpers_croshell/viewer.py} +0 -0
- /machineconfig/scripts/python/{viewer_template.py → helpers_croshell/viewer_template.py} +0 -0
- /machineconfig/scripts/python/{fire_jobs_streamlit_helper.py → helpers_devops/__init__.py} +0 -0
- /machineconfig/scripts/{windows/share_nfs.ps1 → python/helpers_devops/themes/__init__.py} +0 -0
- /machineconfig/{settings/yazi/keymap.toml → scripts/python/helpers_devops/themes/choose_starship_theme.ps1} +0 -0
- /machineconfig/scripts/python/{cloud_manager.py → helpers_fire_command/cloud_manager.py} +0 -0
- /machineconfig/scripts/{linux → python/helpers_msearch/scripts_linux}/skrg +0 -0
- /machineconfig/scripts/{windows → python/helpers_msearch/scripts_windows}/fzfb.ps1 +0 -0
- /machineconfig/scripts/{windows → python/helpers_msearch/scripts_windows}/fzfg.ps1 +0 -0
- /machineconfig/scripts/{windows → python/helpers_msearch/scripts_windows}/fzfrga.bat +0 -0
- /machineconfig/scripts/{linux → python/nw}/mount_drive +0 -0
- /machineconfig/scripts/python/{mount_nw_drive.py → nw/mount_nw_drive.py} +0 -0
- /machineconfig/scripts/{linux → python/nw}/mount_smb +0 -0
- /machineconfig/scripts/windows/{mount_nw.ps1 → mounts/mount_nw.ps1} +0 -0
- /machineconfig/scripts/windows/{mount_smb.ps1 → mounts/mount_smb.ps1} +0 -0
- /machineconfig/scripts/windows/{share_cloud.cmd → mounts/share_cloud.cmd} +0 -0
- /machineconfig/scripts/windows/{unlock_bitlocker.ps1 → mounts/unlock_bitlocker.ps1} +0 -0
- /machineconfig/setup_linux/{web_shortcuts → others}/android.sh +0 -0
- /machineconfig/{jobs/windows/archive → setup_windows/ssh}/openssh-server_add_key.ps1 +0 -0
- /machineconfig/{jobs/windows/archive → setup_windows/ssh}/openssh-server_copy-ssh-id.ps1 +0 -0
- {machineconfig-5.15.dist-info → machineconfig-7.66.dist-info}/WHEEL +0 -0
- {machineconfig-5.15.dist-info → machineconfig-7.66.dist-info}/top_level.txt +0 -0
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
import json
|
|
3
|
-
import uuid
|
|
4
2
|
import logging
|
|
5
3
|
from pathlib import Path
|
|
6
4
|
from typing import Optional, Any
|
|
5
|
+
from rich.console import Console
|
|
7
6
|
from machineconfig.utils.scheduler import Scheduler
|
|
8
7
|
from machineconfig.cluster.sessions_managers.wt_local import run_command_in_wt_tab
|
|
9
8
|
from machineconfig.cluster.sessions_managers.wt_remote import WTRemoteLayoutGenerator
|
|
10
|
-
from machineconfig.
|
|
9
|
+
from machineconfig.cluster.sessions_managers.wt_utils.wt_helpers import generate_random_suffix
|
|
10
|
+
from machineconfig.utils.schemas.layouts.layout_types import TabConfig, LayoutConfig
|
|
11
|
+
from machineconfig.cluster.sessions_managers.wt_utils.manager_persistence import (
|
|
12
|
+
generate_session_id, save_json_file, load_json_file, list_saved_sessions_in_dir, delete_session_dir, ensure_session_dir_exists
|
|
13
|
+
)
|
|
14
|
+
from machineconfig.cluster.sessions_managers.wt_utils.status_reporting import (
|
|
15
|
+
print_global_summary, print_session_health_status, print_commands_status, calculate_session_summary, calculate_global_summary_from_status
|
|
16
|
+
)
|
|
17
|
+
from machineconfig.cluster.sessions_managers.wt_utils.monitoring_helpers import (
|
|
18
|
+
collect_status_data_from_managers, flatten_status_data, check_if_all_stopped, print_status_table, collect_session_statuses, print_session_statuses
|
|
19
|
+
)
|
|
11
20
|
|
|
12
|
-
TMP_SERIALIZATION_DIR = Path.home().joinpath("tmp_results", "session_manager", "wt", "remote_manager")
|
|
13
21
|
|
|
14
22
|
# Module-level logger to be used throughout this module
|
|
15
23
|
logger = logging.getLogger(__name__)
|
|
24
|
+
console = Console()
|
|
25
|
+
TMP_SERIALIZATION_DIR = Path.home() / "tmp_results" / "wt_sessions" / "serialized"
|
|
16
26
|
|
|
17
27
|
|
|
18
28
|
class WTSessionManager:
|
|
@@ -21,10 +31,12 @@ class WTSessionManager:
|
|
|
21
31
|
self.machine2wt_tabs = machine2wt_tabs # Store the original config
|
|
22
32
|
self.managers: list[WTRemoteLayoutGenerator] = []
|
|
23
33
|
for machine, tab_config in machine2wt_tabs.items():
|
|
24
|
-
|
|
25
|
-
# Convert legacy dict[str, tuple[str,str]] to List[TabConfig]
|
|
34
|
+
# Convert legacy dict[str, tuple[str,str]] to LayoutConfig
|
|
26
35
|
tabs: list[TabConfig] = [{"tabName": name, "startDir": cwd, "command": cmd} for name, (cwd, cmd) in tab_config.items()]
|
|
27
|
-
|
|
36
|
+
layout_config: LayoutConfig = {"layoutName": f"{session_name_prefix}_{machine}", "layoutTabs": tabs}
|
|
37
|
+
session_name = f"{session_name_prefix}_{generate_random_suffix(8)}"
|
|
38
|
+
an_m = WTRemoteLayoutGenerator(layout_config=layout_config, remote_name=machine, session_name=session_name)
|
|
39
|
+
an_m.create_layout_file()
|
|
28
40
|
self.managers.append(an_m)
|
|
29
41
|
|
|
30
42
|
def ssh_to_all_machines(self) -> str:
|
|
@@ -48,102 +60,47 @@ class WTSessionManager:
|
|
|
48
60
|
def run_monitoring_routine(self, wait_ms: int = 60000) -> None:
|
|
49
61
|
def routine(scheduler: Scheduler):
|
|
50
62
|
if scheduler.cycle % 2 == 0:
|
|
51
|
-
statuses =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
for item in statuses:
|
|
57
|
-
keys.extend(item.keys())
|
|
58
|
-
values = []
|
|
59
|
-
for item in statuses:
|
|
60
|
-
values.extend(item.values())
|
|
61
|
-
# Create list of dictionaries instead of DataFrame
|
|
62
|
-
status_data = []
|
|
63
|
-
for i, key in enumerate(keys):
|
|
64
|
-
if i < len(values):
|
|
65
|
-
status_data.append({"tabName": key, "status": values[i]})
|
|
66
|
-
|
|
67
|
-
# Check if all stopped
|
|
68
|
-
running_count = sum(1 for item in status_data if item.get("status", {}).get("running", False))
|
|
69
|
-
if running_count == 0: # they all stopped
|
|
70
|
-
scheduler.max_cycles = scheduler.cycle # stop the scheduler from calling this routine again
|
|
71
|
-
|
|
72
|
-
# Print status
|
|
73
|
-
for item in status_data:
|
|
74
|
-
print(f"Tab: {item['tabName']}, Status: {item['status']}")
|
|
63
|
+
statuses = collect_status_data_from_managers(self.managers)
|
|
64
|
+
status_data = flatten_status_data(statuses)
|
|
65
|
+
if check_if_all_stopped(status_data):
|
|
66
|
+
scheduler.max_cycles = scheduler.cycle
|
|
67
|
+
print_status_table(status_data)
|
|
75
68
|
else:
|
|
76
|
-
statuses =
|
|
77
|
-
|
|
78
|
-
a_status = an_m.session_manager.check_wt_session_status()
|
|
79
|
-
statuses.append(a_status)
|
|
80
|
-
|
|
81
|
-
# Print statuses
|
|
82
|
-
for i, status in enumerate(statuses):
|
|
83
|
-
print(f"Manager {i}: {status}")
|
|
84
|
-
|
|
69
|
+
statuses = collect_session_statuses(self.managers)
|
|
70
|
+
print_session_statuses(statuses)
|
|
85
71
|
sched = Scheduler(routine=routine, wait_ms=wait_ms, logger=logger)
|
|
86
72
|
sched.run()
|
|
87
73
|
|
|
88
74
|
def save(self, session_id: Optional[str] = None) -> str:
|
|
89
75
|
if session_id is None:
|
|
90
|
-
session_id =
|
|
91
|
-
|
|
92
|
-
# Create session directory
|
|
76
|
+
session_id = generate_session_id()
|
|
93
77
|
session_dir = TMP_SERIALIZATION_DIR / session_id
|
|
94
|
-
session_dir
|
|
95
|
-
|
|
96
|
-
# Save the machine2wt_tabs configuration
|
|
97
|
-
config_file = session_dir / "machine2wt_tabs.json"
|
|
98
|
-
text = json.dumps(self.machine2wt_tabs, indent=2, ensure_ascii=False)
|
|
99
|
-
config_file.write_text(text, encoding="utf-8")
|
|
100
|
-
|
|
101
|
-
# Save session metadata
|
|
78
|
+
ensure_session_dir_exists(session_dir)
|
|
79
|
+
save_json_file(session_dir / "machine2wt_tabs.json", self.machine2wt_tabs, "machine2wt_tabs")
|
|
102
80
|
metadata = {"session_name_prefix": self.session_name_prefix, "created_at": str(datetime.now()), "num_managers": len(self.managers), "machines": list(self.machine2wt_tabs.keys()), "manager_type": "WTSessionManager"}
|
|
103
|
-
|
|
104
|
-
text = json.dumps(metadata, indent=2, ensure_ascii=False)
|
|
105
|
-
metadata_file.write_text(text, encoding="utf-8")
|
|
106
|
-
|
|
107
|
-
# Save each WTRemoteLayoutGenerator
|
|
81
|
+
save_json_file(session_dir / "metadata.json", metadata, "metadata")
|
|
108
82
|
managers_dir = session_dir / "managers"
|
|
109
83
|
managers_dir.mkdir(exist_ok=True)
|
|
110
|
-
|
|
111
84
|
for i, manager in enumerate(self.managers):
|
|
112
|
-
|
|
113
|
-
manager.to_json(str(manager_file))
|
|
114
|
-
|
|
85
|
+
manager.to_json(str(managers_dir / f"manager_{i}_{manager.remote_name}.json"))
|
|
115
86
|
logger.info(f"✅ Saved WTSessionManager session to: {session_dir}")
|
|
116
87
|
return session_id
|
|
117
88
|
|
|
118
89
|
@classmethod
|
|
119
90
|
def load(cls, session_id: str) -> "WTSessionManager":
|
|
120
91
|
session_dir = TMP_SERIALIZATION_DIR / session_id
|
|
121
|
-
|
|
122
92
|
if not session_dir.exists():
|
|
123
93
|
raise FileNotFoundError(f"Session directory not found: {session_dir}")
|
|
124
|
-
|
|
125
|
-
if
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
# Load metadata
|
|
131
|
-
metadata_file = session_dir / "metadata.json"
|
|
132
|
-
session_name_prefix = "WTJobMgr" # default fallback
|
|
133
|
-
if metadata_file.exists():
|
|
134
|
-
text = metadata_file.read_text(encoding="utf-8")
|
|
135
|
-
metadata = json.loads(text)
|
|
136
|
-
session_name_prefix = metadata.get("session_name_prefix", "WTJobMgr")
|
|
137
|
-
# Create new instance (this will create new managers)
|
|
94
|
+
loaded_data = load_json_file(session_dir / "machine2wt_tabs.json", "Configuration file")
|
|
95
|
+
machine2wt_tabs = loaded_data if isinstance(loaded_data, dict) else {} # type: ignore[arg-type]
|
|
96
|
+
metadata_data = load_json_file(session_dir / "metadata.json", "Metadata file") if (session_dir / "metadata.json").exists() else {}
|
|
97
|
+
metadata = metadata_data if isinstance(metadata_data, dict) else {} # type: ignore[arg-type]
|
|
98
|
+
session_name_prefix = metadata.get("session_name_prefix", "WTJobMgr") # type: ignore[union-attr]
|
|
138
99
|
instance = cls(machine2wt_tabs=machine2wt_tabs, session_name_prefix=session_name_prefix)
|
|
139
|
-
# Load saved managers to restore their states
|
|
140
100
|
managers_dir = session_dir / "managers"
|
|
141
101
|
if managers_dir.exists():
|
|
142
|
-
# Clear the auto-created managers and load the saved ones
|
|
143
102
|
instance.managers = []
|
|
144
|
-
|
|
145
|
-
manager_files = sorted(managers_dir.glob("manager_*.json"))
|
|
146
|
-
for manager_file in manager_files:
|
|
103
|
+
for manager_file in sorted(managers_dir.glob("manager_*.json")):
|
|
147
104
|
try:
|
|
148
105
|
loaded_manager = WTRemoteLayoutGenerator.from_json(str(manager_file))
|
|
149
106
|
instance.managers.append(loaded_manager)
|
|
@@ -154,33 +111,11 @@ class WTSessionManager:
|
|
|
154
111
|
|
|
155
112
|
@staticmethod
|
|
156
113
|
def list_saved_sessions() -> list[str]:
|
|
157
|
-
|
|
158
|
-
return []
|
|
159
|
-
|
|
160
|
-
sessions = []
|
|
161
|
-
for item in TMP_SERIALIZATION_DIR.iterdir():
|
|
162
|
-
if item.is_dir() and (item / "metadata.json").exists():
|
|
163
|
-
sessions.append(item.name)
|
|
164
|
-
|
|
165
|
-
return sorted(sessions)
|
|
114
|
+
return list_saved_sessions_in_dir(TMP_SERIALIZATION_DIR)
|
|
166
115
|
|
|
167
116
|
@staticmethod
|
|
168
117
|
def delete_session(session_id: str) -> bool:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if not session_dir.exists():
|
|
172
|
-
logger.warning(f"Session directory not found: {session_dir}")
|
|
173
|
-
return False
|
|
174
|
-
|
|
175
|
-
try:
|
|
176
|
-
import shutil
|
|
177
|
-
|
|
178
|
-
shutil.rmtree(session_dir)
|
|
179
|
-
logger.info(f"✅ Deleted session: {session_id}")
|
|
180
|
-
return True
|
|
181
|
-
except Exception as e:
|
|
182
|
-
logger.error(f"Failed to delete session {session_id}: {e}")
|
|
183
|
-
return False
|
|
118
|
+
return delete_session_dir(TMP_SERIALIZATION_DIR / session_id, session_id)
|
|
184
119
|
|
|
185
120
|
def start_all_sessions(self) -> dict[str, Any]:
|
|
186
121
|
"""Start all Windows Terminal sessions on their respective remote machines."""
|
|
@@ -207,121 +142,38 @@ class WTSessionManager:
|
|
|
207
142
|
return results
|
|
208
143
|
|
|
209
144
|
def check_all_sessions_status(self) -> dict[str, dict[str, Any]]:
|
|
210
|
-
"""Check the status of all remote sessions and their commands."""
|
|
211
145
|
status_report = {}
|
|
212
|
-
|
|
213
146
|
for manager in self.managers:
|
|
214
147
|
session_key = f"{manager.remote_name}:{manager.session_name}"
|
|
215
|
-
|
|
216
148
|
try:
|
|
217
|
-
# Get Windows Terminal session status
|
|
218
149
|
wt_status = manager.session_manager.check_wt_session_status()
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
# Calculate summary for this session
|
|
224
|
-
running_count = sum(1 for status in commands_status.values() if status.get("running", False))
|
|
225
|
-
total_count = len(commands_status)
|
|
226
|
-
|
|
227
|
-
status_report[session_key] = {
|
|
228
|
-
"remote_name": manager.remote_name,
|
|
229
|
-
"session_name": manager.session_name,
|
|
230
|
-
"wt_status": wt_status,
|
|
231
|
-
"commands_status": commands_status,
|
|
232
|
-
"summary": {"total_commands": total_count, "running_commands": running_count, "stopped_commands": total_count - running_count, "session_healthy": wt_status.get("wt_running", False)},
|
|
233
|
-
}
|
|
234
|
-
|
|
150
|
+
tabs = manager.layout_config["layoutTabs"]
|
|
151
|
+
commands_status = manager.process_monitor.check_all_commands_status(tabs)
|
|
152
|
+
summary = calculate_session_summary(commands_status, wt_status.get("wt_running", False))
|
|
153
|
+
status_report[session_key] = {"remote_name": manager.remote_name, "session_name": manager.session_name, "wt_status": wt_status, "commands_status": commands_status, "summary": summary}
|
|
235
154
|
except Exception as e:
|
|
236
155
|
status_report[session_key] = {"remote_name": manager.remote_name, "session_name": manager.session_name, "error": str(e), "summary": {"total_commands": 0, "running_commands": 0, "stopped_commands": 0, "session_healthy": False}}
|
|
237
156
|
logger.error(f"Error checking status for {session_key}: {e}")
|
|
238
|
-
|
|
239
157
|
return status_report
|
|
240
158
|
|
|
241
159
|
def get_global_summary(self) -> dict[str, Any]:
|
|
242
|
-
"""Get a global summary across all remote sessions."""
|
|
243
160
|
all_status = self.check_all_sessions_status()
|
|
244
|
-
|
|
245
|
-
total_sessions = len(all_status)
|
|
246
|
-
healthy_sessions = sum(1 for status in all_status.values() if status["summary"]["session_healthy"])
|
|
247
|
-
total_commands = sum(status["summary"]["total_commands"] for status in all_status.values())
|
|
248
|
-
total_running = sum(status["summary"]["running_commands"] for status in all_status.values())
|
|
249
|
-
|
|
250
|
-
return {
|
|
251
|
-
"total_sessions": total_sessions,
|
|
252
|
-
"healthy_sessions": healthy_sessions,
|
|
253
|
-
"unhealthy_sessions": total_sessions - healthy_sessions,
|
|
254
|
-
"total_commands": total_commands,
|
|
255
|
-
"running_commands": total_running,
|
|
256
|
-
"stopped_commands": total_commands - total_running,
|
|
257
|
-
"all_sessions_healthy": healthy_sessions == total_sessions,
|
|
258
|
-
"all_commands_running": total_running == total_commands,
|
|
259
|
-
"remote_machines": list(set(status["remote_name"] for status in all_status.values())),
|
|
260
|
-
}
|
|
161
|
+
return calculate_global_summary_from_status(all_status, include_remote_machines=True)
|
|
261
162
|
|
|
262
163
|
def print_status_report(self) -> None:
|
|
263
|
-
"""Print a comprehensive status report for all remote sessions."""
|
|
264
164
|
all_status = self.check_all_sessions_status()
|
|
265
165
|
global_summary = self.get_global_summary()
|
|
266
|
-
|
|
267
|
-
print("=" * 80)
|
|
268
|
-
print("🖥️ WINDOWS TERMINAL REMOTE MANAGER STATUS REPORT")
|
|
269
|
-
print("=" * 80)
|
|
270
|
-
|
|
271
|
-
# Global summary
|
|
272
|
-
print("🌐 GLOBAL SUMMARY:")
|
|
273
|
-
print(f" Total sessions: {global_summary['total_sessions']}")
|
|
274
|
-
print(f" Healthy sessions: {global_summary['healthy_sessions']}")
|
|
275
|
-
print(f" Total commands: {global_summary['total_commands']}")
|
|
276
|
-
print(f" Running commands: {global_summary['running_commands']}")
|
|
277
|
-
print(f" Remote machines: {len(global_summary['remote_machines'])}")
|
|
278
|
-
print(f" All healthy: {'✅' if global_summary['all_sessions_healthy'] else '❌'}")
|
|
279
|
-
print()
|
|
280
|
-
|
|
281
|
-
# Per-session details
|
|
166
|
+
print_global_summary(global_summary, "WINDOWS TERMINAL REMOTE MANAGER STATUS REPORT")
|
|
282
167
|
for _, status in all_status.items():
|
|
283
|
-
remote_name
|
|
284
|
-
session_name = status["session_name"]
|
|
285
|
-
|
|
286
|
-
print(f"🖥️ REMOTE: {remote_name} | SESSION: {session_name}")
|
|
168
|
+
print(f"🖥️ REMOTE: {status['remote_name']} | SESSION: {status['session_name']}")
|
|
287
169
|
print("-" * 60)
|
|
288
|
-
|
|
289
170
|
if "error" in status:
|
|
290
171
|
print(f"❌ Error: {status['error']}")
|
|
291
172
|
print()
|
|
292
173
|
continue
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
commands_status = status["commands_status"]
|
|
296
|
-
summary = status["summary"]
|
|
297
|
-
|
|
298
|
-
# Windows Terminal session health
|
|
299
|
-
if wt_status.get("wt_running", False):
|
|
300
|
-
if wt_status.get("session_exists", False):
|
|
301
|
-
session_windows = wt_status.get("session_windows", [])
|
|
302
|
-
all_windows = wt_status.get("all_windows", [])
|
|
303
|
-
print(f"✅ Windows Terminal is running on {remote_name}")
|
|
304
|
-
print(f" Session windows: {len(session_windows)}")
|
|
305
|
-
print(f" Total WT windows: {len(all_windows)}")
|
|
306
|
-
else:
|
|
307
|
-
print(f"⚠️ Windows Terminal is running but no session windows found on {remote_name}")
|
|
308
|
-
else:
|
|
309
|
-
print(f"❌ Windows Terminal issue on {remote_name}: {wt_status.get('error', 'Unknown error')}")
|
|
310
|
-
|
|
311
|
-
# Commands in this session
|
|
312
|
-
print(f" Commands ({summary['running_commands']}/{summary['total_commands']} running):")
|
|
313
|
-
for tab_name, cmd_status in commands_status.items():
|
|
314
|
-
status_icon = "✅" if cmd_status.get("running", False) else "❌"
|
|
315
|
-
cmd_text = cmd_status.get("command", "Unknown")[:50]
|
|
316
|
-
if len(cmd_status.get("command", "")) > 50:
|
|
317
|
-
cmd_text += "..."
|
|
318
|
-
print(f" {status_icon} {tab_name}: {cmd_text}")
|
|
319
|
-
|
|
320
|
-
if cmd_status.get("processes"):
|
|
321
|
-
for proc in cmd_status["processes"][:2]: # Show first 2 processes
|
|
322
|
-
print(f" └─ PID {proc.get('pid', 'Unknown')}: {proc.get('name', 'Unknown')}")
|
|
174
|
+
print_session_health_status(status["wt_status"], remote_name=status["remote_name"])
|
|
175
|
+
print_commands_status(status["commands_status"], status["summary"])
|
|
323
176
|
print()
|
|
324
|
-
|
|
325
177
|
print("=" * 80)
|
|
326
178
|
|
|
327
179
|
def get_remote_overview(self) -> dict[str, Any]:
|
|
@@ -341,7 +193,7 @@ class WTSessionManager:
|
|
|
341
193
|
# Get Windows Terminal version
|
|
342
194
|
wt_version = manager.session_manager.get_wt_version()
|
|
343
195
|
|
|
344
|
-
overview[remote_name] = {"windows_info": windows_info, "wt_processes": wt_processes, "wt_version": wt_version, "session_name": manager.session_name, "tab_count": len(manager.
|
|
196
|
+
overview[remote_name] = {"windows_info": windows_info, "wt_processes": wt_processes, "wt_version": wt_version, "session_name": manager.session_name, "tab_count": len(manager.layout_config["layoutTabs"])}
|
|
345
197
|
|
|
346
198
|
except Exception as e:
|
|
347
199
|
overview[manager.remote_name] = {"error": str(e), "session_name": manager.session_name}
|
|
@@ -130,34 +130,21 @@ class WTLayoutGenerator:
|
|
|
130
130
|
|
|
131
131
|
return " ".join(wt_parts)
|
|
132
132
|
|
|
133
|
-
def create_wt_script(self, tabs: List[TabConfig],
|
|
134
|
-
"""Create a Windows Terminal PowerShell script and return
|
|
133
|
+
def create_wt_script(self, tabs: List[TabConfig], session_name: str, window_name: str | None = None) -> str:
|
|
134
|
+
"""Create a Windows Terminal PowerShell script content and return it as string."""
|
|
135
135
|
self.validate_tab_config(tabs)
|
|
136
136
|
|
|
137
137
|
# Generate unique suffix for this script
|
|
138
138
|
random_suffix = self.generate_random_suffix()
|
|
139
139
|
wt_command = self.generate_wt_command(tabs, window_name or session_name)
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
output_dir.mkdir(parents=True, exist_ok=True)
|
|
144
|
-
|
|
145
|
-
# Create PowerShell script
|
|
146
|
-
ps1_file = output_dir / f"wt_layout_{session_name}_{random_suffix}.ps1"
|
|
147
|
-
|
|
148
|
-
# Create PowerShell script content
|
|
149
|
-
text = f"""# Windows Terminal layout for {session_name}
|
|
141
|
+
# Create PowerShell script content
|
|
142
|
+
script_content = f"""# Windows Terminal layout for {session_name}
|
|
150
143
|
# Generated on {random_suffix}
|
|
151
144
|
{wt_command}
|
|
152
145
|
"""
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
logger.info(f"Windows Terminal PowerShell script created: {ps1_file.absolute()}")
|
|
156
|
-
return str(ps1_file.absolute())
|
|
157
|
-
|
|
158
|
-
except OSError as e:
|
|
159
|
-
logger.error(f"Failed to create PowerShell script: {e}")
|
|
160
|
-
raise
|
|
146
|
+
logger.info("Windows Terminal PowerShell script content generated")
|
|
147
|
+
return script_content
|
|
161
148
|
|
|
162
149
|
def generate_split_pane_command(self, tabs: List[TabConfig], window_name: str | None = None) -> str:
|
|
163
150
|
"""Generate Windows Terminal command with split panes instead of separate tabs."""
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import uuid
|
|
3
|
+
import logging
|
|
4
|
+
import shutil
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
logger = logging.getLogger(__name__)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def generate_session_id() -> str:
|
|
12
|
+
return str(uuid.uuid4())[:8]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def save_json_file(file_path: Path, data: dict[str, Any] | list[Any], description: str) -> None:
|
|
16
|
+
text = json.dumps(data, indent=2, ensure_ascii=False)
|
|
17
|
+
file_path.write_text(text, encoding="utf-8")
|
|
18
|
+
logger.debug(f"Saved {description} to {file_path}")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def load_json_file(file_path: Path, description: str) -> dict[str, Any] | list[Any]:
|
|
22
|
+
if not file_path.exists():
|
|
23
|
+
raise FileNotFoundError(f"{description} not found: {file_path}")
|
|
24
|
+
text = file_path.read_text(encoding="utf-8")
|
|
25
|
+
return json.loads(text)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def list_saved_sessions_in_dir(serialization_dir: Path) -> list[str]:
|
|
29
|
+
if not serialization_dir.exists():
|
|
30
|
+
return []
|
|
31
|
+
sessions = []
|
|
32
|
+
for item in serialization_dir.iterdir():
|
|
33
|
+
if item.is_dir() and (item / "metadata.json").exists():
|
|
34
|
+
sessions.append(item.name)
|
|
35
|
+
return sorted(sessions)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def delete_session_dir(session_dir: Path, session_id: str) -> bool:
|
|
39
|
+
if not session_dir.exists():
|
|
40
|
+
logger.warning(f"Session directory not found: {session_dir}")
|
|
41
|
+
return False
|
|
42
|
+
try:
|
|
43
|
+
shutil.rmtree(session_dir)
|
|
44
|
+
logger.info(f"✅ Deleted session: {session_id}")
|
|
45
|
+
return True
|
|
46
|
+
except Exception as e:
|
|
47
|
+
logger.error(f"Failed to delete session {session_id}: {e}")
|
|
48
|
+
return False
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def ensure_session_dir_exists(session_dir: Path) -> None:
|
|
52
|
+
session_dir.mkdir(parents=True, exist_ok=True)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def collect_status_data_from_managers(managers: list[Any]) -> list[dict[str, Any]]:
|
|
5
|
+
statuses = []
|
|
6
|
+
for manager in managers:
|
|
7
|
+
tabs = manager.layout_config["layoutTabs"]
|
|
8
|
+
if hasattr(manager, "process_monitor"):
|
|
9
|
+
a_status = manager.process_monitor.check_all_commands_status(tabs)
|
|
10
|
+
else:
|
|
11
|
+
a_status = manager.check_all_commands_status()
|
|
12
|
+
statuses.append(a_status)
|
|
13
|
+
return statuses
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def flatten_status_data(statuses: list[dict[str, dict[str, Any]]]) -> list[dict[str, Any]]:
|
|
17
|
+
keys = []
|
|
18
|
+
values = []
|
|
19
|
+
for item in statuses:
|
|
20
|
+
keys.extend(item.keys())
|
|
21
|
+
values.extend(item.values())
|
|
22
|
+
|
|
23
|
+
status_data = []
|
|
24
|
+
for i, key in enumerate(keys):
|
|
25
|
+
if i < len(values):
|
|
26
|
+
status_data.append({"tabName": key, "status": values[i]})
|
|
27
|
+
return status_data
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def check_if_all_stopped(status_data: list[dict[str, Any]]) -> bool:
|
|
31
|
+
running_count = sum(1 for item in status_data if item.get("status", {}).get("running", False))
|
|
32
|
+
return running_count == 0
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def print_status_table(status_data: list[dict[str, Any]]) -> None:
|
|
36
|
+
for item in status_data:
|
|
37
|
+
print(f"Tab: {item['tabName']}, Status: {item['status']}")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def collect_session_statuses(managers: list[Any]) -> list[dict[str, Any]]:
|
|
41
|
+
statuses = []
|
|
42
|
+
for manager in managers:
|
|
43
|
+
a_status = manager.session_manager.check_wt_session_status()
|
|
44
|
+
statuses.append(a_status)
|
|
45
|
+
return statuses
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def print_session_statuses(statuses: list[dict[str, Any]]) -> None:
|
|
49
|
+
for i, status in enumerate(statuses):
|
|
50
|
+
print(f"Manager {i}: {status}")
|
|
@@ -5,11 +5,13 @@ Status reporting utilities for Windows Terminal layouts and sessions.
|
|
|
5
5
|
|
|
6
6
|
import logging
|
|
7
7
|
from typing import Dict, Any, List
|
|
8
|
+
from rich.console import Console
|
|
8
9
|
from machineconfig.cluster.sessions_managers.wt_utils.process_monitor import WTProcessMonitor
|
|
9
10
|
from machineconfig.cluster.sessions_managers.wt_utils.session_manager import WTSessionManager
|
|
10
11
|
from machineconfig.utils.schemas.layouts.layout_types import TabConfig
|
|
11
12
|
|
|
12
13
|
logger = logging.getLogger(__name__)
|
|
14
|
+
console = Console()
|
|
13
15
|
|
|
14
16
|
|
|
15
17
|
class WTStatusReporter:
|
|
@@ -82,11 +84,11 @@ class WTStatusReporter:
|
|
|
82
84
|
for proc in processes:
|
|
83
85
|
pid = proc.get("pid", "Unknown")
|
|
84
86
|
name = proc.get("name", "Unknown")
|
|
85
|
-
print(f" └─ PID {pid}: {name}")
|
|
87
|
+
console.print(f" [dim]└─[/dim] PID {pid}: {name}")
|
|
86
88
|
|
|
87
89
|
if len(cmd_status["processes"]) > 3:
|
|
88
90
|
remaining = len(cmd_status["processes"]) - 3
|
|
89
|
-
print(f" └─ ... and {remaining} more processes")
|
|
91
|
+
console.print(f" [dim]└─[/dim] ... and {remaining} more processes")
|
|
90
92
|
|
|
91
93
|
if cmd_status.get("error"):
|
|
92
94
|
print(f" Error: {cmd_status['error']}")
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
from typing import Any, Optional
|
|
2
|
+
from rich.console import Console
|
|
3
|
+
|
|
4
|
+
console = Console()
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def print_global_summary(global_summary: dict[str, Any], title: str) -> None:
|
|
8
|
+
print("=" * 80)
|
|
9
|
+
print(f"🖥️ {title}")
|
|
10
|
+
print("=" * 80)
|
|
11
|
+
print("🌐 GLOBAL SUMMARY:")
|
|
12
|
+
print(f" Total sessions: {global_summary['total_sessions']}")
|
|
13
|
+
print(f" Healthy sessions: {global_summary['healthy_sessions']}")
|
|
14
|
+
print(f" Total commands: {global_summary['total_commands']}")
|
|
15
|
+
print(f" Running commands: {global_summary['running_commands']}")
|
|
16
|
+
if "remote_machines" in global_summary:
|
|
17
|
+
print(f" Remote machines: {len(global_summary['remote_machines'])}")
|
|
18
|
+
print(f" All healthy: {'✅' if global_summary['all_sessions_healthy'] else '❌'}")
|
|
19
|
+
print()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def print_session_health_status(wt_status: dict[str, Any], remote_name: Optional[str] = None) -> None:
|
|
23
|
+
location_str = f" on {remote_name}" if remote_name else ""
|
|
24
|
+
if wt_status.get("wt_running", False):
|
|
25
|
+
if wt_status.get("session_exists", False):
|
|
26
|
+
session_windows = wt_status.get("session_windows", [])
|
|
27
|
+
all_windows = wt_status.get("all_windows", [])
|
|
28
|
+
print(f"✅ Windows Terminal is running{location_str}")
|
|
29
|
+
print(f" Session windows: {len(session_windows)}")
|
|
30
|
+
print(f" Total WT windows: {len(all_windows)}")
|
|
31
|
+
else:
|
|
32
|
+
print(f"⚠️ Windows Terminal is running but no session windows found{location_str}")
|
|
33
|
+
else:
|
|
34
|
+
print(f"❌ Windows Terminal issue{location_str}: {wt_status.get('error', 'Unknown error')}")
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def print_commands_status(commands_status: dict[str, dict[str, Any]], summary: dict[str, int]) -> None:
|
|
38
|
+
print(f" Commands ({summary['running_commands']}/{summary['total_commands']} running):")
|
|
39
|
+
for tab_name, cmd_status in commands_status.items():
|
|
40
|
+
status_icon = "✅" if cmd_status.get("running", False) else "❌"
|
|
41
|
+
cmd_text = cmd_status.get("command", "Unknown")[:50]
|
|
42
|
+
if len(cmd_status.get("command", "")) > 50:
|
|
43
|
+
cmd_text += "..."
|
|
44
|
+
console.print(f" {status_icon} {tab_name}: {cmd_text}")
|
|
45
|
+
if cmd_status.get("processes"):
|
|
46
|
+
for proc in cmd_status["processes"][:2]:
|
|
47
|
+
console.print(f" [dim]└─[/dim] PID {proc.get('pid', 'Unknown')}: {proc.get('name', 'Unknown')}")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def calculate_session_summary(commands_status: dict[str, dict[str, Any]], session_healthy: bool) -> dict[str, Any]:
|
|
51
|
+
running_count = sum(1 for status in commands_status.values() if status.get("running", False))
|
|
52
|
+
total_count = len(commands_status)
|
|
53
|
+
return {"total_commands": total_count, "running_commands": running_count, "stopped_commands": total_count - running_count, "session_healthy": session_healthy}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def calculate_global_summary_from_status(all_status: dict[str, dict[str, Any]], include_remote_machines: bool = False) -> dict[str, Any]:
|
|
57
|
+
total_sessions = len(all_status)
|
|
58
|
+
healthy_sessions = sum(1 for status in all_status.values() if status.get("summary", {}).get("session_healthy", False))
|
|
59
|
+
total_commands = sum(status.get("summary", {}).get("total_commands", 0) for status in all_status.values())
|
|
60
|
+
total_running = sum(status.get("summary", {}).get("running_commands", 0) for status in all_status.values())
|
|
61
|
+
|
|
62
|
+
result: dict[str, Any] = {
|
|
63
|
+
"total_sessions": total_sessions,
|
|
64
|
+
"healthy_sessions": healthy_sessions,
|
|
65
|
+
"unhealthy_sessions": total_sessions - healthy_sessions,
|
|
66
|
+
"total_commands": total_commands,
|
|
67
|
+
"running_commands": total_running,
|
|
68
|
+
"stopped_commands": total_commands - total_running,
|
|
69
|
+
"all_sessions_healthy": healthy_sessions == total_sessions,
|
|
70
|
+
"all_commands_running": total_running == total_commands,
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if include_remote_machines:
|
|
74
|
+
result["remote_machines"] = list(set(status.get("remote_name", "") for status in all_status.values() if "remote_name" in status))
|
|
75
|
+
|
|
76
|
+
return result
|