@aliwey/bmo 2.0.6 → 2.0.8

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.
package/bin/bmo.js CHANGED
@@ -152,6 +152,17 @@ Data lives in: ${BMO_HOME_DISPLAY}
152
152
  // ── bmo --update [version] ────────────────────────────────────────────────
153
153
  if (cmd === '--update' || cmd === '-update' || cmd === 'update') {
154
154
  const ver = args[0] ? `@${args[0]}` : '@latest';
155
+ console.log(`Stopping any running BMO background processes to release file locks...`);
156
+ try {
157
+ if (os.platform() === 'win32') {
158
+ execSync(`powershell -Command "Get-CimInstance Win32_Process | Where-Object { $_.CommandLine -like '*main.py*' -or $_.CommandLine -like '*cli.py*' -or $_.CommandLine -like '*bmo*' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue }"`, { stdio: 'ignore' });
159
+ } else {
160
+ execSync(`pkill -f "main.py|cli.py|bmo" || true`, { stdio: 'ignore' });
161
+ }
162
+ } catch (e) {
163
+ // Ignore failures
164
+ }
165
+
155
166
  console.log(`🗑️ Uninstalling old version of @aliwey/bmo...`);
156
167
  try {
157
168
  execSync('npm uninstall -g @aliwey/bmo', { stdio: 'inherit' });
package/cli.py CHANGED
@@ -1120,6 +1120,20 @@ def main_run():
1120
1120
  warnings.filterwarnings("ignore", category=ResourceWarning)
1121
1121
  # Suppress Windows asyncio pipe ValueError on exit (closed pipe repr noise)
1122
1122
  warnings.filterwarnings("ignore", message=".*I/O operation on closed pipe.*")
1123
+
1124
+ # Set up basic logging for the CLI TUI to write to ~/.bmo/logs/cli.log
1125
+ try:
1126
+ from config.settings import LOGS_DIR
1127
+ LOGS_DIR.mkdir(parents=True, exist_ok=True)
1128
+ logging.basicConfig(
1129
+ filename=LOGS_DIR / "cli.log",
1130
+ filemode="a",
1131
+ format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
1132
+ level=logging.INFO
1133
+ )
1134
+ except Exception:
1135
+ pass
1136
+
1123
1137
  try:
1124
1138
  asyncio.run(main())
1125
1139
  except KeyboardInterrupt:
@@ -57,7 +57,8 @@ class OpenCodeBotClient:
57
57
  try:
58
58
  r = await self._http.get("/session", timeout=5.0)
59
59
  return r.status_code < 500
60
- except Exception:
60
+ except Exception as e:
61
+ logger.error("is_alive check failed for %s: %s", OPENCODE_BASE_URL, e)
61
62
  return False
62
63
 
63
64
  async def connect(self) -> bool:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliwey/bmo",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "BMO — AI coding assistant with Telegram, CLI & Web sync. One command, all frontends.",
5
5
  "keywords": ["ai", "coding-assistant", "telegram-bot", "cli", "opencode", "bfp"],
6
6
  "homepage": "https://github.com/aliwey/bmo",