machineconfig 1.97__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.

Files changed (166) hide show
  1. machineconfig/cluster/cloud_manager.py +22 -26
  2. machineconfig/cluster/data_transfer.py +2 -2
  3. machineconfig/cluster/distribute.py +0 -2
  4. machineconfig/cluster/file_manager.py +4 -4
  5. machineconfig/cluster/job_params.py +1 -1
  6. machineconfig/cluster/loader_runner.py +8 -8
  7. machineconfig/cluster/remote_machine.py +4 -4
  8. machineconfig/cluster/script_execution.py +2 -2
  9. machineconfig/cluster/sessions_managers/archive/create_zellij_template.py +1 -1
  10. machineconfig/cluster/sessions_managers/enhanced_command_runner.py +23 -23
  11. machineconfig/cluster/sessions_managers/wt_local.py +78 -76
  12. machineconfig/cluster/sessions_managers/wt_local_manager.py +91 -91
  13. machineconfig/cluster/sessions_managers/wt_remote.py +39 -39
  14. machineconfig/cluster/sessions_managers/wt_remote_manager.py +94 -91
  15. machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +56 -54
  16. machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +49 -49
  17. machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py +18 -18
  18. machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +42 -42
  19. machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +36 -36
  20. machineconfig/cluster/sessions_managers/zellij_local.py +43 -46
  21. machineconfig/cluster/sessions_managers/zellij_local_manager.py +139 -120
  22. machineconfig/cluster/sessions_managers/zellij_remote.py +35 -35
  23. machineconfig/cluster/sessions_managers/zellij_remote_manager.py +33 -33
  24. machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +15 -15
  25. machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +25 -26
  26. machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +49 -49
  27. machineconfig/cluster/sessions_managers/zellij_utils/remote_executor.py +5 -5
  28. machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +15 -15
  29. machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +11 -11
  30. machineconfig/cluster/templates/utils.py +3 -3
  31. machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
  32. machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
  33. machineconfig/jobs/python/__pycache__/python_ve_symlink.cpython-311.pyc +0 -0
  34. machineconfig/jobs/python/check_installations.py +8 -9
  35. machineconfig/jobs/python/python_cargo_build_share.py +2 -2
  36. machineconfig/jobs/python/vscode/link_ve.py +7 -7
  37. machineconfig/jobs/python/vscode/select_interpreter.py +7 -7
  38. machineconfig/jobs/python/vscode/sync_code.py +5 -5
  39. machineconfig/jobs/python_custom_installers/archive/ngrok.py +2 -2
  40. machineconfig/jobs/python_custom_installers/dev/aider.py +3 -3
  41. machineconfig/jobs/python_custom_installers/dev/alacritty.py +3 -3
  42. machineconfig/jobs/python_custom_installers/dev/brave.py +3 -3
  43. machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +5 -5
  44. machineconfig/jobs/python_custom_installers/dev/code.py +3 -3
  45. machineconfig/jobs/python_custom_installers/dev/cursor.py +9 -9
  46. machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +4 -4
  47. machineconfig/jobs/python_custom_installers/dev/espanso.py +4 -4
  48. machineconfig/jobs/python_custom_installers/dev/goes.py +4 -4
  49. machineconfig/jobs/python_custom_installers/dev/lvim.py +4 -4
  50. machineconfig/jobs/python_custom_installers/dev/nerdfont.py +3 -3
  51. machineconfig/jobs/python_custom_installers/dev/redis.py +3 -3
  52. machineconfig/jobs/python_custom_installers/dev/wezterm.py +3 -3
  53. machineconfig/jobs/python_custom_installers/dev/winget.py +27 -27
  54. machineconfig/jobs/python_custom_installers/docker.py +3 -3
  55. machineconfig/jobs/python_custom_installers/gh.py +7 -7
  56. machineconfig/jobs/python_custom_installers/hx.py +1 -1
  57. machineconfig/jobs/python_custom_installers/warp-cli.py +3 -3
  58. machineconfig/jobs/python_generic_installers/config.json +412 -389
  59. machineconfig/jobs/python_windows_installers/dev/config.json +1 -1
  60. machineconfig/logger.py +50 -0
  61. machineconfig/profile/__pycache__/__init__.cpython-311.pyc +0 -0
  62. machineconfig/profile/__pycache__/create.cpython-311.pyc +0 -0
  63. machineconfig/profile/__pycache__/shell.cpython-311.pyc +0 -0
  64. machineconfig/profile/create.py +23 -16
  65. machineconfig/profile/create_hardlinks.py +8 -8
  66. machineconfig/profile/shell.py +41 -37
  67. machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
  68. machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
  69. machineconfig/scripts/linux/devops +2 -2
  70. machineconfig/scripts/linux/fire +1 -0
  71. machineconfig/scripts/linux/fire_agents +0 -1
  72. machineconfig/scripts/linux/mcinit +1 -1
  73. machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
  74. machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc +0 -0
  75. machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
  76. machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc +0 -0
  77. machineconfig/scripts/python/__pycache__/devops.cpython-313.pyc +0 -0
  78. machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc +0 -0
  79. machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-313.pyc +0 -0
  80. machineconfig/scripts/python/__pycache__/fire_agents.cpython-311.pyc +0 -0
  81. machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
  82. machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc +0 -0
  83. machineconfig/scripts/python/ai/__pycache__/init.cpython-311.pyc +0 -0
  84. machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-311.pyc +0 -0
  85. machineconfig/scripts/python/ai/chatmodes/Thinking-Beast-Mode.chatmode.md +337 -0
  86. machineconfig/scripts/python/ai/chatmodes/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md +644 -0
  87. machineconfig/scripts/python/ai/chatmodes/deepResearch.chatmode.md +81 -0
  88. machineconfig/scripts/python/ai/configs/.gemini/settings.json +81 -0
  89. machineconfig/scripts/python/ai/instructions/python/dev.instructions.md +45 -0
  90. machineconfig/scripts/python/ai/mcinit.py +103 -0
  91. machineconfig/scripts/python/ai/prompts/allLintersAndTypeCheckers.prompt.md +5 -0
  92. machineconfig/scripts/python/ai/prompts/research-report-skeleton.prompt.md +38 -0
  93. machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +47 -0
  94. machineconfig/scripts/python/archive/tmate_conn.py +5 -5
  95. machineconfig/scripts/python/archive/tmate_start.py +3 -3
  96. machineconfig/scripts/python/choose_wezterm_theme.py +2 -2
  97. machineconfig/scripts/python/cloud_copy.py +19 -18
  98. machineconfig/scripts/python/cloud_mount.py +9 -7
  99. machineconfig/scripts/python/cloud_repo_sync.py +11 -11
  100. machineconfig/scripts/python/cloud_sync.py +1 -1
  101. machineconfig/scripts/python/croshell.py +14 -14
  102. machineconfig/scripts/python/devops.py +6 -6
  103. machineconfig/scripts/python/devops_add_identity.py +8 -6
  104. machineconfig/scripts/python/devops_add_ssh_key.py +18 -18
  105. machineconfig/scripts/python/devops_backup_retrieve.py +13 -13
  106. machineconfig/scripts/python/devops_devapps_install.py +3 -3
  107. machineconfig/scripts/python/devops_update_repos.py +1 -1
  108. machineconfig/scripts/python/dotfile.py +2 -2
  109. machineconfig/scripts/python/fire_agents.py +183 -41
  110. machineconfig/scripts/python/fire_jobs.py +17 -17
  111. machineconfig/scripts/python/ftpx.py +2 -2
  112. machineconfig/scripts/python/gh_models.py +94 -94
  113. machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.pyc +0 -0
  114. machineconfig/scripts/python/helpers/__pycache__/cloud_helpers.cpython-311.pyc +0 -0
  115. machineconfig/scripts/python/helpers/__pycache__/helpers2.cpython-311.pyc +0 -0
  116. machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-311.pyc +0 -0
  117. machineconfig/scripts/python/helpers/cloud_helpers.py +3 -3
  118. machineconfig/scripts/python/helpers/helpers2.py +1 -1
  119. machineconfig/scripts/python/helpers/helpers4.py +8 -6
  120. machineconfig/scripts/python/helpers/helpers5.py +7 -7
  121. machineconfig/scripts/python/helpers/repo_sync_helpers.py +1 -1
  122. machineconfig/scripts/python/mount_nfs.py +3 -2
  123. machineconfig/scripts/python/mount_nw_drive.py +4 -4
  124. machineconfig/scripts/python/mount_ssh.py +3 -2
  125. machineconfig/scripts/python/repos.py +8 -8
  126. machineconfig/scripts/python/scheduler.py +1 -1
  127. machineconfig/scripts/python/start_slidev.py +8 -7
  128. machineconfig/scripts/python/start_terminals.py +1 -1
  129. machineconfig/scripts/python/viewer.py +40 -40
  130. machineconfig/scripts/python/wifi_conn.py +65 -66
  131. machineconfig/scripts/python/wsl_windows_transfer.py +1 -1
  132. machineconfig/scripts/windows/mcinit.ps1 +1 -1
  133. machineconfig/settings/linters/.ruff.toml +2 -2
  134. machineconfig/settings/shells/ipy/profiles/default/startup/playext.py +71 -71
  135. machineconfig/settings/shells/wt/settings.json +8 -8
  136. machineconfig/setup_linux/web_shortcuts/tmp.sh +2 -0
  137. machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +10 -7
  138. machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +9 -7
  139. machineconfig/utils/ai/browser_user_wrapper.py +5 -5
  140. machineconfig/utils/ai/generate_file_checklist.py +11 -12
  141. machineconfig/utils/ai/url2md.py +1 -1
  142. machineconfig/utils/cloud/onedrive/setup_oauth.py +4 -4
  143. machineconfig/utils/cloud/onedrive/transaction.py +129 -129
  144. machineconfig/utils/code.py +13 -6
  145. machineconfig/utils/installer.py +51 -53
  146. machineconfig/utils/installer_utils/installer_abc.py +21 -10
  147. machineconfig/utils/installer_utils/installer_class.py +42 -16
  148. machineconfig/utils/io_save.py +3 -15
  149. machineconfig/utils/options.py +10 -3
  150. machineconfig/utils/path.py +5 -0
  151. machineconfig/utils/path_reduced.py +201 -149
  152. machineconfig/utils/procs.py +23 -23
  153. machineconfig/utils/scheduling.py +11 -12
  154. machineconfig/utils/ssh.py +270 -0
  155. machineconfig/utils/terminal.py +180 -0
  156. machineconfig/utils/utils.py +1 -2
  157. machineconfig/utils/utils2.py +43 -0
  158. machineconfig/utils/utils5.py +163 -34
  159. machineconfig/utils/ve.py +2 -2
  160. {machineconfig-1.97.dist-info → machineconfig-2.0.dist-info}/METADATA +13 -8
  161. {machineconfig-1.97.dist-info → machineconfig-2.0.dist-info}/RECORD +163 -149
  162. machineconfig/cluster/self_ssh.py +0 -57
  163. machineconfig/scripts/python/ai/init.py +0 -56
  164. machineconfig/scripts/python/ai/rules/python/dev.md +0 -31
  165. {machineconfig-1.97.dist-info → machineconfig-2.0.dist-info}/WHEEL +0 -0
  166. {machineconfig-1.97.dist-info → machineconfig-2.0.dist-info}/top_level.txt +0 -0
@@ -18,20 +18,20 @@ TMP_LAYOUT_DIR = Path.home().joinpath("tmp_results", "wt_layouts", "layout_manag
18
18
 
19
19
 
20
20
  class WTRemoteLayoutGenerator:
21
-
21
+
22
22
  def __init__(self, remote_name: str, session_name_prefix: str):
23
23
  self.remote_name = remote_name
24
24
  self.session_name = session_name_prefix + "_" + WTLayoutGenerator.generate_random_suffix()
25
25
  self.tab_config: Dict[str, Tuple[str, str]] = {}
26
26
  self.script_path: Optional[str] = None
27
-
27
+
28
28
  # Initialize modular components
29
29
  self.remote_executor = WTRemoteExecutor(remote_name)
30
30
  self.layout_generator = WTLayoutGenerator()
31
31
  self.process_monitor = WTProcessMonitor(self.remote_executor)
32
32
  self.session_manager = WTSessionManager(self.remote_executor, self.session_name, TMP_LAYOUT_DIR)
33
33
  self.status_reporter = WTStatusReporter(self.process_monitor, self.session_manager)
34
-
34
+
35
35
  def copy_script_to_remote(self, local_script_file: Path, random_suffix: str) -> str:
36
36
  return self.session_manager.copy_script_to_remote(local_script_file, random_suffix)
37
37
 
@@ -42,12 +42,12 @@ class WTRemoteLayoutGenerator:
42
42
  output_path = Path(output_dir)
43
43
  else:
44
44
  output_path = TMP_LAYOUT_DIR
45
- self.script_path = self.layout_generator.create_wt_script(tab_config, output_path, self.session_name)
45
+ self.script_path = self.layout_generator.create_wt_script(tab_config, output_path, self.session_name)
46
46
  return self.script_path
47
-
47
+
48
48
  def get_layout_preview(self, tab_config: Dict[str, Tuple[str, str]]) -> str:
49
49
  return self.layout_generator.generate_wt_command(tab_config)
50
-
50
+
51
51
  def check_command_status(self, tab_name: str, use_verification: bool = True) -> Dict[str, Any]:
52
52
  return self.process_monitor.check_command_status(tab_name, self.tab_config, use_verification)
53
53
 
@@ -120,42 +120,42 @@ class WTRemoteLayoutGenerator:
120
120
  path_obj = default_dir / f"wt_session_{random_id}.json"
121
121
  else:
122
122
  path_obj = Path(file_path)
123
-
123
+
124
124
  # Ensure .json extension
125
125
  if not str(path_obj).endswith('.json'):
126
126
  path_obj = path_obj.with_suffix('.json')
127
-
127
+
128
128
  # Ensure parent directory exists
129
129
  path_obj.parent.mkdir(parents=True, exist_ok=True)
130
-
130
+
131
131
  # Serialize to JSON
132
132
  data = self.to_dict()
133
-
134
- with open(path_obj, 'w', encoding='utf-8') as f:
135
- json.dump(data, f, indent=2, ensure_ascii=False)
136
-
133
+
134
+ text = json.dumps(data, indent=2, ensure_ascii=False)
135
+ path_obj.write_text(text, encoding="utf-8")
136
+
137
137
  logger.info(f"✅ Serialized WTRemoteLayoutGenerator to: {path_obj}")
138
138
  return str(path_obj)
139
139
 
140
140
  @classmethod
141
141
  def from_json(cls, file_path: str) -> 'WTRemoteLayoutGenerator':
142
142
  path_obj = Path(file_path)
143
-
143
+
144
144
  # Ensure .json extension
145
145
  if not str(path_obj).endswith('.json'):
146
146
  path_obj = path_obj.with_suffix('.json')
147
-
147
+
148
148
  if not path_obj.exists():
149
149
  raise FileNotFoundError(f"JSON file not found: {path_obj}")
150
-
150
+
151
151
  # Load JSON data
152
152
  with open(path_obj, 'r', encoding='utf-8') as f:
153
153
  data = json.load(f)
154
-
154
+
155
155
  # Validate that it's the correct class
156
156
  if data.get('class_name') != cls.__name__:
157
157
  logger.warning(f"Class name mismatch: expected {cls.__name__}, got {data.get('class_name')}")
158
-
158
+
159
159
  # Create new instance
160
160
  # Extract session name prefix by removing the suffix
161
161
  session_name = data['session_name']
@@ -163,14 +163,14 @@ class WTRemoteLayoutGenerator:
163
163
  session_name_prefix = '_'.join(session_name.split('_')[:-1])
164
164
  else:
165
165
  session_name_prefix = session_name
166
-
166
+
167
167
  instance = cls(remote_name=data['remote_name'], session_name_prefix=session_name_prefix)
168
-
168
+
169
169
  # Restore state
170
170
  instance.session_name = data['session_name']
171
171
  instance.tab_config = data['tab_config']
172
172
  instance.script_path = data['script_path']
173
-
173
+
174
174
  logger.info(f"✅ Loaded WTRemoteLayoutGenerator from: {file_path}")
175
175
  return instance
176
176
 
@@ -180,10 +180,10 @@ class WTRemoteLayoutGenerator:
180
180
  dir_path = Path.home() / "tmp_results" / "wt_sessions" / "serialized"
181
181
  else:
182
182
  dir_path = Path(directory_path)
183
-
183
+
184
184
  if not dir_path.exists():
185
185
  return []
186
-
186
+
187
187
  json_files = [f.name for f in dir_path.glob("*.json")]
188
188
  return sorted(json_files)
189
189
 
@@ -220,69 +220,69 @@ if __name__ == "__main__":
220
220
  # Example usage
221
221
  sample_tabs = {
222
222
  "🤖Bot1": ("~/code/bytesense/bithence", "python bot1.py --create_new_bot True"),
223
- "🤖Bot2": ("~/code/bytesense/bithence", "python bot2.py --create_new_bot True"),
223
+ "🤖Bot2": ("~/code/bytesense/bithence", "python bot2.py --create_new_bot True"),
224
224
  "📊Monitor": ("~", "Get-Process | Sort-Object CPU -Descending | Select-Object -First 10"),
225
225
  "📝Logs": ("C:/logs", "Get-Content app.log -Wait")
226
226
  }
227
-
227
+
228
228
  # Replace 'myserver' with an actual SSH config alias for a Windows machine
229
229
  remote_name = "myserver" # This should be in ~/.ssh/config
230
230
  session_name = "test_remote_session"
231
-
231
+
232
232
  try:
233
233
  # Create layout using the remote generator
234
234
  generator = WTRemoteLayoutGenerator(remote_name=remote_name, session_name_prefix=session_name)
235
235
  script_path = generator.create_wt_layout(sample_tabs)
236
236
  print(f"✅ Remote layout created successfully: {script_path}")
237
-
237
+
238
238
  # Check if Windows Terminal is available on remote
239
239
  wt_available = generator.check_wt_available()
240
240
  print(f"🖥️ Windows Terminal available on {remote_name}: {'✅' if wt_available else '❌'}")
241
-
241
+
242
242
  # Get remote Windows info
243
243
  windows_info = generator.get_remote_windows_info()
244
244
  if windows_info.get("wt_available"):
245
245
  print(f"📦 Remote system info: {windows_info.get('windows_info', 'Unknown')}")
246
-
246
+
247
247
  # Demonstrate serialization
248
248
  print("\n💾 Demonstrating serialization...")
249
249
  saved_path = generator.to_json()
250
250
  print(f"✅ Session saved to: {saved_path}")
251
-
251
+
252
252
  # List all saved sessions
253
253
  saved_sessions = WTRemoteLayoutGenerator.list_saved_sessions()
254
254
  print(f"📋 Available saved sessions: {saved_sessions}")
255
-
255
+
256
256
  # Demonstrate loading (using the full path)
257
257
  loaded_generator = WTRemoteLayoutGenerator.from_json(saved_path)
258
258
  print(f"✅ Session loaded successfully: {loaded_generator.session_name}")
259
259
  print(f"📊 Loaded tabs: {list(loaded_generator.tab_config.keys())}")
260
-
260
+
261
261
  # Show command preview
262
262
  preview = generator.get_layout_preview(sample_tabs)
263
263
  print(f"\n📋 Command Preview:\n{preview}")
264
-
264
+
265
265
  # Demonstrate status checking
266
266
  print(f"\n🔍 Checking command status on remote '{remote_name}':")
267
267
  generator.print_status_report()
268
-
268
+
269
269
  # Show Windows Terminal overview
270
270
  print(f"\n🖥️ Windows Terminal Overview:")
271
271
  generator.print_windows_terminal_overview()
272
-
272
+
273
273
  # Start the session (uncomment to actually start)
274
274
  # start_result = generator.start_wt_session()
275
275
  # print(f"Session start result: {start_result}")
276
-
276
+
277
277
  # Attach to session (uncomment to attach)
278
278
  # generator.attach_to_session()
279
-
279
+
280
280
  print(f"\n▶️ To start this session, run:")
281
281
  print(f" generator.start_wt_session()")
282
282
  print(f"\n📎 To attach to this session, run:")
283
283
  print(f" generator.attach_to_session()")
284
-
284
+
285
285
  except Exception as e:
286
286
  print(f"❌ Error: {e}")
287
287
  import traceback
288
- traceback.print_exc()
288
+ traceback.print_exc()