@leg3ndy/otto-bridge 0.6.3 → 0.6.4

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/README.md CHANGED
@@ -33,10 +33,10 @@ Enquanto o pacote nao estiver publicado, voce pode gerar um tarball local:
33
33
 
34
34
  ```bash
35
35
  npm pack
36
- npm install -g ./leg3ndy-otto-bridge-0.6.3.tgz
36
+ npm install -g ./leg3ndy-otto-bridge-0.6.4.tgz
37
37
  ```
38
38
 
39
- No `0.6.3`, `playwright` deixa de ser opcional no `otto-bridge`. O primeiro `npm install -g @leg3ndy/otto-bridge` pode demorar mais porque instala o browser persistente usado pelo WhatsApp Web e pelos fluxos web em background do bridge.
39
+ No `0.6.4`, `playwright` deixa de ser opcional no `otto-bridge`. O primeiro `npm install -g @leg3ndy/otto-bridge` pode demorar mais porque instala o browser persistente usado pelo WhatsApp Web e pelos fluxos web em background do bridge.
40
40
 
41
41
  ## Publicacao
42
42
 
@@ -106,7 +106,7 @@ otto-bridge run --executor clawd-cursor --clawd-url http://127.0.0.1:3847
106
106
 
107
107
  ### WhatsApp Web em background
108
108
 
109
- Fluxo recomendado no `0.6.3`:
109
+ Fluxo recomendado no `0.6.4`:
110
110
 
111
111
  ```bash
112
112
  otto-bridge extensions --install whatsappweb
@@ -116,7 +116,7 @@ otto-bridge extensions --status whatsappweb
116
116
 
117
117
  O setup agora abre o login do WhatsApp Web em um browser persistente do proprio bridge. Depois do QR code, o Otto usa a sessao local em background, sem depender de aba visivel no Safari.
118
118
 
119
- Contrato do `0.6.3`:
119
+ Contrato do `0.6.4`:
120
120
 
121
121
  - `otto-bridge extensions --setup whatsappweb`: autentica a sessao uma vez
122
122
  - `otto-bridge run`: mantem o browser persistente do WhatsApp vivo em background enquanto o runtime estiver ativo
package/dist/main.js CHANGED
@@ -201,6 +201,16 @@ async function resolvePublishedPackageVersion(tag) {
201
201
  }
202
202
  return null;
203
203
  }
204
+ async function resolveActiveCliVersion() {
205
+ const binary = process.platform === "win32" ? "otto-bridge.cmd" : "otto-bridge";
206
+ const result = await runChildCommandCapture(binary, ["version"]).catch(() => null);
207
+ if (!result || result.code !== 0) {
208
+ return null;
209
+ }
210
+ const output = String(result.stdout || "").trim();
211
+ const match = output.match(/@leg3ndy\/otto-bridge\s+([0-9]+(?:\.[0-9]+){1,3})/i);
212
+ return match?.[1]?.trim() || null;
213
+ }
204
214
  function isRetryableNpmUpdateFailure(detail) {
205
215
  const normalized = String(detail || "").toLowerCase();
206
216
  return [
@@ -534,9 +544,21 @@ async function runUpdateCommand(args) {
534
544
  process.stderr.write(result.stderr);
535
545
  }
536
546
  if (result.code === 0) {
537
- console.log("[otto-bridge] update completed");
538
- console.log("[otto-bridge] run `otto-bridge version` to confirm the installed version");
539
- return;
547
+ const activeVersion = await resolveActiveCliVersion();
548
+ if (!publishedVersion) {
549
+ console.log("[otto-bridge] update completed");
550
+ console.log("[otto-bridge] run `otto-bridge version` to confirm the installed version");
551
+ return;
552
+ }
553
+ if (activeVersion && compareSemver(activeVersion, publishedVersion) >= 0) {
554
+ console.log(`[otto-bridge] update completed active=${activeVersion}`);
555
+ return;
556
+ }
557
+ const observedVersion = activeVersion || BRIDGE_VERSION;
558
+ throw new Error(`[otto-bridge] O npm concluiu o install, mas o comando \`otto-bridge\` ainda responde ${observedVersion}. `
559
+ + `A atualizacao para ${publishedVersion} nao ficou ativa neste PATH ainda.\n`
560
+ + `[otto-bridge] Tente abrir um novo terminal e rodar \`otto-bridge version\`.\n`
561
+ + `[otto-bridge] Se continuar igual, rode manualmente: npm install -g ${BRIDGE_PACKAGE_NAME}@${publishedVersion} --prefer-online`);
540
562
  }
541
563
  lastFailureDetail = `${command} exited with code ${result.code}\n${result.stderr || result.stdout}`.trim();
542
564
  const retryable = isRetryableNpmUpdateFailure(lastFailureDetail);
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const BRIDGE_CONFIG_VERSION = 1;
2
- export const BRIDGE_VERSION = "0.6.3";
2
+ export const BRIDGE_VERSION = "0.6.4";
3
3
  export const BRIDGE_PACKAGE_NAME = "@leg3ndy/otto-bridge";
4
4
  export const DEFAULT_API_BASE_URL = "http://localhost:8000";
5
5
  export const DEFAULT_POLL_INTERVAL_MS = 3000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leg3ndy/otto-bridge",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Local companion for Otto Bridge device pairing and WebSocket runtime.",