@leg3ndy/otto-bridge 0.6.0 → 0.6.1

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,9 +33,11 @@ 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.0.tgz
36
+ npm install -g ./leg3ndy-otto-bridge-0.6.1.tgz
37
37
  ```
38
38
 
39
+ No `0.6.1`, `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
+
39
41
  ## Publicacao
40
42
 
41
43
  Checklist de release:
@@ -104,7 +106,7 @@ otto-bridge run --executor clawd-cursor --clawd-url http://127.0.0.1:3847
104
106
 
105
107
  ### WhatsApp Web em background
106
108
 
107
- Fluxo recomendado no `0.6.0`:
109
+ Fluxo recomendado no `0.6.1`:
108
110
 
109
111
  ```bash
110
112
  otto-bridge extensions --install whatsappweb
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const BRIDGE_CONFIG_VERSION = 1;
2
- export const BRIDGE_VERSION = "0.6.0";
2
+ export const BRIDGE_VERSION = "0.6.1";
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;
@@ -28,7 +28,7 @@ async function loadPlaywrightModule() {
28
28
  errors.push(`${candidate}: ${detail}`);
29
29
  }
30
30
  }
31
- throw new Error(`Playwright nao esta disponivel para o Otto Bridge. ${errors.length ? `Detalhes: ${errors.join(" | ")}` : ""}`.trim());
31
+ throw new Error(`Playwright nao esta disponivel para o Otto Bridge. Reinstale o pacote \`@leg3ndy/otto-bridge\` para garantir o browser persistente do bridge. ${errors.length ? `Detalhes: ${errors.join(" | ")}` : ""}`.trim());
32
32
  }
33
33
  function normalizeText(value) {
34
34
  return String(value || "")
@@ -421,6 +421,18 @@ export class WhatsAppBackgroundBrowser {
421
421
  if (!page) {
422
422
  return;
423
423
  }
424
+ const currentUrl = (() => {
425
+ try {
426
+ return typeof page.url === "function" ? String(page.url() || "") : "";
427
+ }
428
+ catch {
429
+ return "";
430
+ }
431
+ })();
432
+ const normalizedUrl = currentUrl.trim().toLowerCase();
433
+ if (normalizedUrl.startsWith(WHATSAPP_WEB_URL)) {
434
+ return;
435
+ }
424
436
  await page.goto(WHATSAPP_WEB_URL, {
425
437
  waitUntil: "domcontentloaded",
426
438
  timeout: 90_000,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leg3ndy/otto-bridge",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Local companion for Otto Bridge device pairing and WebSocket runtime.",
@@ -48,7 +48,7 @@
48
48
  "engines": {
49
49
  "node": ">=24"
50
50
  },
51
- "optionalDependencies": {
51
+ "dependencies": {
52
52
  "playwright": "^1.58.2"
53
53
  },
54
54
  "devDependencies": {