machineconfig 1.96__py3-none-any.whl β 2.0__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/cluster/cloud_manager.py +22 -26
- machineconfig/cluster/data_transfer.py +2 -2
- machineconfig/cluster/distribute.py +0 -2
- machineconfig/cluster/file_manager.py +4 -4
- machineconfig/cluster/job_params.py +1 -1
- machineconfig/cluster/loader_runner.py +8 -8
- machineconfig/cluster/remote_machine.py +4 -4
- machineconfig/cluster/script_execution.py +2 -2
- machineconfig/cluster/sessions_managers/archive/create_zellij_template.py +1 -1
- machineconfig/cluster/sessions_managers/enhanced_command_runner.py +23 -23
- machineconfig/cluster/sessions_managers/wt_local.py +78 -76
- machineconfig/cluster/sessions_managers/wt_local_manager.py +91 -91
- machineconfig/cluster/sessions_managers/wt_remote.py +39 -39
- machineconfig/cluster/sessions_managers/wt_remote_manager.py +94 -91
- machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +56 -54
- machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +49 -49
- machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py +18 -18
- machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +42 -42
- machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +36 -36
- machineconfig/cluster/sessions_managers/zellij_local.py +43 -46
- machineconfig/cluster/sessions_managers/zellij_local_manager.py +139 -120
- machineconfig/cluster/sessions_managers/zellij_remote.py +35 -35
- machineconfig/cluster/sessions_managers/zellij_remote_manager.py +33 -33
- machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +15 -15
- machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +25 -26
- machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +49 -49
- machineconfig/cluster/sessions_managers/zellij_utils/remote_executor.py +5 -5
- machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +15 -15
- machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +11 -11
- machineconfig/cluster/templates/utils.py +3 -3
- machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/jobs/python/__pycache__/python_ve_symlink.cpython-311.pyc +0 -0
- machineconfig/jobs/python/check_installations.py +8 -9
- machineconfig/jobs/python/python_cargo_build_share.py +2 -2
- machineconfig/jobs/python/vscode/link_ve.py +7 -7
- machineconfig/jobs/python/vscode/select_interpreter.py +7 -7
- machineconfig/jobs/python/vscode/sync_code.py +5 -5
- machineconfig/jobs/python_custom_installers/archive/ngrok.py +2 -2
- machineconfig/jobs/python_custom_installers/dev/aider.py +3 -3
- machineconfig/jobs/python_custom_installers/dev/alacritty.py +3 -3
- machineconfig/jobs/python_custom_installers/dev/brave.py +3 -3
- machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +5 -5
- machineconfig/jobs/python_custom_installers/dev/code.py +3 -3
- machineconfig/jobs/python_custom_installers/dev/cursor.py +9 -9
- machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/espanso.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/goes.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/lvim.py +4 -4
- machineconfig/jobs/python_custom_installers/dev/nerdfont.py +3 -3
- machineconfig/jobs/python_custom_installers/dev/redis.py +3 -3
- machineconfig/jobs/python_custom_installers/dev/wezterm.py +3 -3
- machineconfig/jobs/python_custom_installers/dev/winget.py +27 -27
- machineconfig/jobs/python_custom_installers/docker.py +3 -3
- machineconfig/jobs/python_custom_installers/gh.py +7 -7
- machineconfig/jobs/python_custom_installers/hx.py +1 -1
- machineconfig/jobs/python_custom_installers/warp-cli.py +3 -3
- machineconfig/jobs/python_generic_installers/config.json +412 -389
- machineconfig/jobs/python_windows_installers/dev/config.json +1 -1
- machineconfig/logger.py +50 -0
- machineconfig/profile/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/create.cpython-311.pyc +0 -0
- machineconfig/profile/__pycache__/shell.cpython-311.pyc +0 -0
- machineconfig/profile/create.py +23 -16
- machineconfig/profile/create_hardlinks.py +8 -8
- machineconfig/profile/shell.py +41 -37
- machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/linux/devops +2 -2
- machineconfig/scripts/linux/fire +1 -0
- machineconfig/scripts/linux/fire_agents +0 -1
- machineconfig/scripts/linux/mcinit +27 -0
- machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-313.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_agents.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
- machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/__pycache__/init.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-311.pyc +0 -0
- machineconfig/scripts/python/ai/chatmodes/Thinking-Beast-Mode.chatmode.md +337 -0
- machineconfig/scripts/python/ai/chatmodes/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md +644 -0
- machineconfig/scripts/python/ai/chatmodes/deepResearch.chatmode.md +81 -0
- machineconfig/scripts/python/ai/configs/.gemini/settings.json +81 -0
- machineconfig/scripts/python/ai/instructions/python/dev.instructions.md +45 -0
- machineconfig/scripts/python/ai/mcinit.py +103 -0
- machineconfig/scripts/python/ai/prompts/allLintersAndTypeCheckers.prompt.md +5 -0
- machineconfig/scripts/python/ai/prompts/research-report-skeleton.prompt.md +38 -0
- machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +47 -0
- machineconfig/scripts/python/archive/tmate_conn.py +5 -5
- machineconfig/scripts/python/archive/tmate_start.py +3 -3
- machineconfig/scripts/python/choose_wezterm_theme.py +2 -2
- machineconfig/scripts/python/cloud_copy.py +19 -18
- machineconfig/scripts/python/cloud_mount.py +9 -7
- machineconfig/scripts/python/cloud_repo_sync.py +11 -11
- machineconfig/scripts/python/cloud_sync.py +1 -1
- machineconfig/scripts/python/croshell.py +14 -14
- machineconfig/scripts/python/devops.py +6 -6
- machineconfig/scripts/python/devops_add_identity.py +8 -6
- machineconfig/scripts/python/devops_add_ssh_key.py +18 -18
- machineconfig/scripts/python/devops_backup_retrieve.py +13 -13
- machineconfig/scripts/python/devops_devapps_install.py +3 -3
- machineconfig/scripts/python/devops_update_repos.py +1 -1
- machineconfig/scripts/python/dotfile.py +2 -2
- machineconfig/scripts/python/fire_agents.py +183 -41
- machineconfig/scripts/python/fire_jobs.py +17 -11
- machineconfig/scripts/python/ftpx.py +2 -2
- machineconfig/scripts/python/gh_models.py +94 -94
- machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/cloud_helpers.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers2.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-311.pyc +0 -0
- machineconfig/scripts/python/helpers/cloud_helpers.py +3 -3
- machineconfig/scripts/python/helpers/helpers2.py +1 -1
- machineconfig/scripts/python/helpers/helpers4.py +8 -6
- machineconfig/scripts/python/helpers/helpers5.py +7 -7
- machineconfig/scripts/python/helpers/repo_sync_helpers.py +1 -1
- machineconfig/scripts/python/mount_nfs.py +3 -2
- machineconfig/scripts/python/mount_nw_drive.py +4 -4
- machineconfig/scripts/python/mount_ssh.py +3 -2
- machineconfig/scripts/python/repos.py +8 -8
- machineconfig/scripts/python/scheduler.py +1 -1
- machineconfig/scripts/python/start_slidev.py +8 -7
- machineconfig/scripts/python/start_terminals.py +1 -1
- machineconfig/scripts/python/viewer.py +40 -40
- machineconfig/scripts/python/wifi_conn.py +65 -66
- machineconfig/scripts/python/wsl_windows_transfer.py +1 -1
- machineconfig/scripts/windows/mcinit.ps1 +4 -0
- machineconfig/settings/linters/.ruff.toml +2 -2
- machineconfig/settings/shells/ipy/profiles/default/startup/playext.py +71 -71
- machineconfig/settings/shells/wt/settings.json +8 -8
- machineconfig/setup_linux/web_shortcuts/tmp.sh +2 -0
- machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +10 -7
- machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +9 -7
- machineconfig/utils/ai/browser_user_wrapper.py +5 -5
- machineconfig/utils/ai/generate_file_checklist.py +11 -12
- machineconfig/utils/ai/url2md.py +1 -1
- machineconfig/utils/cloud/onedrive/setup_oauth.py +4 -4
- machineconfig/utils/cloud/onedrive/transaction.py +129 -129
- machineconfig/utils/code.py +13 -6
- machineconfig/utils/installer.py +51 -53
- machineconfig/utils/installer_utils/installer_abc.py +21 -10
- machineconfig/utils/installer_utils/installer_class.py +42 -16
- machineconfig/utils/io_save.py +3 -15
- machineconfig/utils/options.py +10 -3
- machineconfig/utils/path.py +5 -0
- machineconfig/utils/path_reduced.py +201 -149
- machineconfig/utils/procs.py +23 -23
- machineconfig/utils/scheduling.py +11 -12
- machineconfig/utils/ssh.py +270 -0
- machineconfig/utils/terminal.py +180 -0
- machineconfig/utils/utils.py +1 -2
- machineconfig/utils/utils2.py +43 -0
- machineconfig/utils/utils5.py +163 -34
- machineconfig/utils/ve.py +2 -2
- {machineconfig-1.96.dist-info β machineconfig-2.0.dist-info}/METADATA +13 -8
- {machineconfig-1.96.dist-info β machineconfig-2.0.dist-info}/RECORD +163 -144
- machineconfig/cluster/self_ssh.py +0 -57
- {machineconfig-1.96.dist-info β machineconfig-2.0.dist-info}/WHEEL +0 -0
- {machineconfig-1.96.dist-info β machineconfig-2.0.dist-info}/top_level.txt +0 -0
|
@@ -30,12 +30,12 @@ class ZellijLayoutGenerator:
|
|
|
30
30
|
children
|
|
31
31
|
}
|
|
32
32
|
"""
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
@staticmethod
|
|
35
35
|
def _generate_random_suffix(length: int = 8) -> str:
|
|
36
36
|
"""Generate a random string suffix for unique layout file names."""
|
|
37
37
|
return ''.join(random.choices(string.ascii_lowercase + string.digits, k=length))
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
@staticmethod
|
|
40
40
|
def _parse_command(command: str) -> tuple[str, List[str]]:
|
|
41
41
|
try:
|
|
@@ -46,7 +46,7 @@ class ZellijLayoutGenerator:
|
|
|
46
46
|
logger.error(f"Error parsing command '{command}': {e}")
|
|
47
47
|
parts = command.split()
|
|
48
48
|
return parts[0] if parts else "", parts[1:] if len(parts) > 1 else []
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
@staticmethod
|
|
51
51
|
def _format_args_for_kdl(args: List[str]) -> str:
|
|
52
52
|
if not args: return ""
|
|
@@ -58,7 +58,7 @@ class ZellijLayoutGenerator:
|
|
|
58
58
|
else:
|
|
59
59
|
formatted_args.append(f'"{arg}"')
|
|
60
60
|
return " ".join(formatted_args)
|
|
61
|
-
|
|
61
|
+
|
|
62
62
|
@staticmethod
|
|
63
63
|
def _create_tab_section(tab_name: str, cwd: str, command: str) -> str:
|
|
64
64
|
cmd, args = ZellijLayoutGenerator._parse_command(command)
|
|
@@ -70,7 +70,7 @@ class ZellijLayoutGenerator:
|
|
|
70
70
|
if args_str: tab_section += f' args {args_str}\n'
|
|
71
71
|
tab_section += ' }\n }\n'
|
|
72
72
|
return tab_section
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
@staticmethod
|
|
75
75
|
def _validate_tab_config(tab_config: Dict[str, tuple[str, str]]) -> None:
|
|
76
76
|
if not tab_config: raise ValueError("Tab configuration cannot be empty")
|
|
@@ -78,22 +78,22 @@ class ZellijLayoutGenerator:
|
|
|
78
78
|
if not tab_name.strip(): raise ValueError(f"Invalid tab name: {tab_name}")
|
|
79
79
|
if not command.strip(): raise ValueError(f"Invalid command for tab '{tab_name}': {command}")
|
|
80
80
|
if not cwd.strip(): raise ValueError(f"Invalid cwd for tab '{tab_name}': {cwd}")
|
|
81
|
-
|
|
81
|
+
|
|
82
82
|
def create_zellij_layout(self, tab_config: Dict[str, tuple[str, str]], output_dir: Optional[str] = None, session_name: Optional[str] = None) -> str:
|
|
83
83
|
ZellijLayoutGenerator._validate_tab_config(tab_config)
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
# Enhanced Rich logging
|
|
86
86
|
tab_count = len(tab_config)
|
|
87
87
|
console.print(f"[bold cyan]π Creating Zellij layout[/bold cyan] [bright_green]with {tab_count} tabs[/bright_green]")
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
# Display tab summary with emojis and colors
|
|
90
90
|
for tab_name, (cwd, command) in tab_config.items():
|
|
91
91
|
console.print(f" [yellow]β[/yellow] [bold]{tab_name}[/bold] [dim]in[/dim] [blue]{cwd}[/blue]")
|
|
92
|
-
|
|
92
|
+
|
|
93
93
|
# Store session name and entire tab config for status checking
|
|
94
94
|
self.session_name = session_name or "default"
|
|
95
95
|
self.tab_config = tab_config.copy()
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
layout_content = self.layout_template
|
|
98
98
|
for tab_name, (cwd, command) in tab_config.items():
|
|
99
99
|
layout_content += "\n" + ZellijLayoutGenerator._create_tab_section(tab_name, cwd, command)
|
|
@@ -104,24 +104,22 @@ class ZellijLayoutGenerator:
|
|
|
104
104
|
output_path = Path(output_dir)
|
|
105
105
|
output_path.mkdir(parents=True, exist_ok=True)
|
|
106
106
|
layout_file = output_path / f"zellij_layout_{random_suffix}.kdl"
|
|
107
|
-
|
|
108
|
-
f.write(layout_content)
|
|
107
|
+
layout_file.write_text(layout_content, encoding="utf-8")
|
|
109
108
|
self.layout_path = str(layout_file.absolute())
|
|
110
109
|
else:
|
|
111
110
|
# Use the predefined TMP_LAYOUT_DIR for temporary files
|
|
112
111
|
TMP_LAYOUT_DIR.mkdir(parents=True, exist_ok=True)
|
|
113
112
|
layout_file = TMP_LAYOUT_DIR / f"zellij_layout_{self.session_name or 'default'}_{random_suffix}.kdl"
|
|
114
|
-
|
|
115
|
-
f.write(layout_content)
|
|
113
|
+
layout_file.write_text(layout_content, encoding="utf-8")
|
|
116
114
|
self.layout_path = str(layout_file.absolute())
|
|
117
|
-
|
|
115
|
+
|
|
118
116
|
# Enhanced Rich logging for file creation
|
|
119
117
|
console.print(f"[bold green]β
Zellij layout file created:[/bold green] [cyan]{self.layout_path}[/cyan]")
|
|
120
118
|
return self.layout_path
|
|
121
119
|
except OSError as e:
|
|
122
120
|
logger.error(f"Failed to create layout file: {e}")
|
|
123
121
|
raise
|
|
124
|
-
|
|
122
|
+
|
|
125
123
|
@staticmethod
|
|
126
124
|
def get_layout_preview(tab_config: Dict[str, tuple[str, str]], layout_template: str | None = None) -> str:
|
|
127
125
|
if layout_template is None:
|
|
@@ -139,7 +137,7 @@ class ZellijLayoutGenerator:
|
|
|
139
137
|
for tab_name, (cwd, command) in tab_config.items():
|
|
140
138
|
layout_content += "\n" + ZellijLayoutGenerator._create_tab_section(tab_name, cwd, command)
|
|
141
139
|
return layout_content + "\n}\n"
|
|
142
|
-
|
|
140
|
+
|
|
143
141
|
@staticmethod
|
|
144
142
|
def check_command_status(tab_name: str, tab_config: Dict[str, tuple[str, str]]) -> Dict[str, Any]:
|
|
145
143
|
if tab_name not in tab_config:
|
|
@@ -151,10 +149,10 @@ class ZellijLayoutGenerator:
|
|
|
151
149
|
"command": None,
|
|
152
150
|
"cwd": None
|
|
153
151
|
}
|
|
154
|
-
|
|
152
|
+
|
|
155
153
|
cwd, command = tab_config[tab_name]
|
|
156
154
|
cmd, _ = ZellijLayoutGenerator._parse_command(command)
|
|
157
|
-
|
|
155
|
+
|
|
158
156
|
try:
|
|
159
157
|
# Look for processes matching the command
|
|
160
158
|
matching_processes = []
|
|
@@ -162,7 +160,7 @@ class ZellijLayoutGenerator:
|
|
|
162
160
|
try:
|
|
163
161
|
if proc.info['cmdline'] and len(proc.info['cmdline']) > 0:
|
|
164
162
|
# Check if the command matches
|
|
165
|
-
if (proc.info['name'] == cmd or
|
|
163
|
+
if (proc.info['name'] == cmd or
|
|
166
164
|
cmd in proc.info['cmdline'][0] or
|
|
167
165
|
any(cmd in arg for arg in proc.info['cmdline'])):
|
|
168
166
|
matching_processes.append({
|
|
@@ -173,7 +171,7 @@ class ZellijLayoutGenerator:
|
|
|
173
171
|
})
|
|
174
172
|
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
175
173
|
continue
|
|
176
|
-
|
|
174
|
+
|
|
177
175
|
if matching_processes:
|
|
178
176
|
return {
|
|
179
177
|
"status": "running",
|
|
@@ -192,7 +190,7 @@ class ZellijLayoutGenerator:
|
|
|
192
190
|
"cwd": cwd,
|
|
193
191
|
"tab_name": tab_name
|
|
194
192
|
}
|
|
195
|
-
|
|
193
|
+
|
|
196
194
|
except Exception as e:
|
|
197
195
|
logger.error(f"Error checking command status for tab '{tab_name}': {e}")
|
|
198
196
|
return {
|
|
@@ -208,11 +206,11 @@ class ZellijLayoutGenerator:
|
|
|
208
206
|
if not self.tab_config:
|
|
209
207
|
logger.warning("No tab config tracked. Make sure to create a layout first.")
|
|
210
208
|
return {}
|
|
211
|
-
|
|
209
|
+
|
|
212
210
|
status_report = {}
|
|
213
211
|
for tab_name in self.tab_config:
|
|
214
212
|
status_report[tab_name] = ZellijLayoutGenerator.check_command_status(tab_name, self.tab_config)
|
|
215
|
-
|
|
213
|
+
|
|
216
214
|
return status_report
|
|
217
215
|
|
|
218
216
|
@staticmethod
|
|
@@ -225,11 +223,11 @@ class ZellijLayoutGenerator:
|
|
|
225
223
|
text=True,
|
|
226
224
|
timeout=10
|
|
227
225
|
)
|
|
228
|
-
|
|
226
|
+
|
|
229
227
|
if result.returncode == 0:
|
|
230
228
|
sessions = result.stdout.strip().split('\n') if result.stdout.strip() else []
|
|
231
229
|
session_running = any(session_name in session for session in sessions)
|
|
232
|
-
|
|
230
|
+
|
|
233
231
|
return {
|
|
234
232
|
"zellij_running": True,
|
|
235
233
|
"session_exists": session_running,
|
|
@@ -242,7 +240,7 @@ class ZellijLayoutGenerator:
|
|
|
242
240
|
"error": result.stderr,
|
|
243
241
|
"session_name": session_name
|
|
244
242
|
}
|
|
245
|
-
|
|
243
|
+
|
|
246
244
|
except subprocess.TimeoutExpired:
|
|
247
245
|
return {
|
|
248
246
|
"zellij_running": False,
|
|
@@ -265,10 +263,10 @@ class ZellijLayoutGenerator:
|
|
|
265
263
|
def get_comprehensive_status(self) -> Dict[str, Any]:
|
|
266
264
|
zellij_status = ZellijLayoutGenerator.check_zellij_session_status(self.session_name or "default")
|
|
267
265
|
commands_status = self.check_all_commands_status()
|
|
268
|
-
|
|
266
|
+
|
|
269
267
|
running_count = sum(1 for status in commands_status.values() if status.get("running", False))
|
|
270
268
|
total_count = len(commands_status)
|
|
271
|
-
|
|
269
|
+
|
|
272
270
|
return {
|
|
273
271
|
"zellij_session": zellij_status,
|
|
274
272
|
"commands": commands_status,
|
|
@@ -283,13 +281,13 @@ class ZellijLayoutGenerator:
|
|
|
283
281
|
def print_status_report(self) -> None:
|
|
284
282
|
from rich.panel import Panel
|
|
285
283
|
from rich.table import Table
|
|
286
|
-
|
|
284
|
+
|
|
287
285
|
status = self.get_comprehensive_status()
|
|
288
|
-
|
|
286
|
+
|
|
289
287
|
# Create main panel
|
|
290
288
|
console.print()
|
|
291
289
|
console.print(Panel.fit("π ZELLIJ LAYOUT STATUS REPORT", style="bold cyan"))
|
|
292
|
-
|
|
290
|
+
|
|
293
291
|
# Zellij session status
|
|
294
292
|
zellij = status["zellij_session"]
|
|
295
293
|
if zellij.get("zellij_running", False):
|
|
@@ -300,9 +298,9 @@ class ZellijLayoutGenerator:
|
|
|
300
298
|
else:
|
|
301
299
|
error_msg = zellij.get('error', 'Unknown error')
|
|
302
300
|
console.print(f"[bold red]β Zellij session issue:[/bold red] [red]{error_msg}[/red]")
|
|
303
|
-
|
|
301
|
+
|
|
304
302
|
console.print()
|
|
305
|
-
|
|
303
|
+
|
|
306
304
|
# Commands status table
|
|
307
305
|
table = Table(title="π COMMAND STATUS", show_header=True, header_style="bold magenta")
|
|
308
306
|
table.add_column("Tab", style="cyan", no_wrap=True)
|
|
@@ -310,7 +308,7 @@ class ZellijLayoutGenerator:
|
|
|
310
308
|
table.add_column("PID", justify="center", style="dim")
|
|
311
309
|
table.add_column("Memory", justify="center", style="blue")
|
|
312
310
|
table.add_column("Command", style="green", max_width=40)
|
|
313
|
-
|
|
311
|
+
|
|
314
312
|
for tab_name, cmd_status in status["commands"].items():
|
|
315
313
|
# Determine status display
|
|
316
314
|
if cmd_status.get("running", False):
|
|
@@ -327,17 +325,17 @@ class ZellijLayoutGenerator:
|
|
|
327
325
|
status_text = "[bold red]β Stopped[/bold red]"
|
|
328
326
|
pid = "N/A"
|
|
329
327
|
memory = "N/A"
|
|
330
|
-
|
|
328
|
+
|
|
331
329
|
command = cmd_status.get('command', 'Unknown')
|
|
332
330
|
# Truncate long commands
|
|
333
331
|
if len(command) > 35:
|
|
334
332
|
command = command[:32] + "..."
|
|
335
|
-
|
|
333
|
+
|
|
336
334
|
table.add_row(tab_name, status_text, pid, memory, command)
|
|
337
|
-
|
|
335
|
+
|
|
338
336
|
console.print(table)
|
|
339
337
|
console.print()
|
|
340
|
-
|
|
338
|
+
|
|
341
339
|
# Enhanced summary
|
|
342
340
|
summary = status["summary"]
|
|
343
341
|
from rich.panel import Panel
|
|
@@ -345,7 +343,7 @@ class ZellijLayoutGenerator:
|
|
|
345
343
|
[green]Running:[/green] {summary['running_commands']}
|
|
346
344
|
[red]Stopped:[/red] {summary['stopped_commands']}
|
|
347
345
|
[yellow]Session healthy:[/yellow] {'β
' if summary['session_healthy'] else 'β'}"""
|
|
348
|
-
|
|
346
|
+
|
|
349
347
|
console.print(Panel(summary_text, title="π Summary", style="blue"))
|
|
350
348
|
|
|
351
349
|
def created_zellij_layout(tab_config: Dict[str, tuple[str, str]], output_dir: Optional[str] = None) -> str:
|
|
@@ -355,7 +353,7 @@ def run_zellij_layout(tab_config: Dict[str, tuple[str, str]], session_name: Opti
|
|
|
355
353
|
if not session_name:
|
|
356
354
|
session_name = ''.join(random.choices(string.ascii_lowercase + string.digits, k=8))
|
|
357
355
|
layout_path = created_zellij_layout(tab_config)
|
|
358
|
-
|
|
356
|
+
|
|
359
357
|
# Use enhanced command execution
|
|
360
358
|
try:
|
|
361
359
|
from .enhanced_command_runner import enhanced_zellij_session_start
|
|
@@ -366,7 +364,6 @@ def run_zellij_layout(tab_config: Dict[str, tuple[str, str]], session_name: Opti
|
|
|
366
364
|
import subprocess
|
|
367
365
|
subprocess.run(cmd, shell=True, check=True)
|
|
368
366
|
console.print(f"[bold green]π Zellij layout is running[/bold green] [yellow]@[/yellow] [bold cyan]{session_name}[/bold cyan]")
|
|
369
|
-
|
|
370
367
|
return session_name
|
|
371
368
|
|
|
372
369
|
|
|
@@ -394,7 +391,7 @@ zellij action close-pane; sleep 2
|
|
|
394
391
|
if __name__ == "__main__":
|
|
395
392
|
sample_tabs = {
|
|
396
393
|
"π€Bot1": ("~/code/bytesense/bithence", "~/scripts/fire -mO go1.py bot1 --kw create_new_bot True"),
|
|
397
|
-
"π€Bot2": ("~/code/bytesense/bithence", "~/scripts/fire -mO go2.py bot2 --kw create_new_bot True"),
|
|
394
|
+
"π€Bot2": ("~/code/bytesense/bithence", "~/scripts/fire -mO go2.py bot2 --kw create_new_bot True"),
|
|
398
395
|
"πMonitor": ("~", "htop"),
|
|
399
396
|
"πLogs": ("/var/log", "tail -f /var/log/app.log")
|
|
400
397
|
}
|
|
@@ -403,16 +400,16 @@ if __name__ == "__main__":
|
|
|
403
400
|
generator = ZellijLayoutGenerator()
|
|
404
401
|
layout_path = generator.create_zellij_layout(sample_tabs, session_name="test_session")
|
|
405
402
|
print(f"β
Layout created successfully: {layout_path}")
|
|
406
|
-
|
|
403
|
+
|
|
407
404
|
# Demonstrate status checking
|
|
408
405
|
print("\nπ Checking command status (this is just a demo - commands aren't actually running):")
|
|
409
406
|
generator.print_status_report()
|
|
410
|
-
|
|
407
|
+
|
|
411
408
|
# Individual command status check
|
|
412
409
|
print("\nπ Individual command status for Bot1:")
|
|
413
410
|
bot1_status = ZellijLayoutGenerator.check_command_status("π€Bot1", generator.tab_config)
|
|
414
411
|
print(f"Status: {bot1_status['status']}")
|
|
415
412
|
print(f"Running: {bot1_status['running']}")
|
|
416
|
-
|
|
413
|
+
|
|
417
414
|
except Exception as e:
|
|
418
415
|
print(f"β Error: {e}")
|