@leg3ndy/otto-bridge 0.6.9 → 0.6.10

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.9.tgz
36
+ npm install -g ./leg3ndy-otto-bridge-0.6.10.tgz
37
37
  ```
38
38
 
39
- No `0.6.9`, `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.10`, `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.9`:
109
+ Fluxo recomendado no `0.6.10`:
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.9`:
119
+ Contrato do `0.6.10`:
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, sem depender de uma aba aberta no Safari
@@ -1202,7 +1202,7 @@ export class NativeMacOSJobExecutor {
1202
1202
  contact: action.contact,
1203
1203
  text_preview: clipText(action.text, 180),
1204
1204
  };
1205
- completionNotes.push(`Enviei a mensagem no WhatsApp para ${action.contact}.`);
1205
+ completionNotes.push(`Enviei no WhatsApp para ${action.contact}: ${clipText(action.text, 180)}`);
1206
1206
  continue;
1207
1207
  }
1208
1208
  if (action.type === "whatsapp_read_chat") {
@@ -2437,12 +2437,11 @@ if (!titleNodes.length) {
2437
2437
  const winner = titleNodes[0];
2438
2438
  const target = winner.container instanceof HTMLElement ? winner.container : winner.node;
2439
2439
  target.scrollIntoView({ block: "center", inline: "center", behavior: "auto" });
2440
- target.dispatchEvent(new MouseEvent("mousedown", { bubbles: true, cancelable: true, view: window }));
2441
- target.dispatchEvent(new MouseEvent("mouseup", { bubbles: true, cancelable: true, view: window }));
2442
- target.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true, view: window }));
2443
2440
  if (typeof target.click === "function") {
2444
2441
  target.click();
2442
+ return { clicked: true };
2445
2443
  }
2444
+ target.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true, view: window }));
2446
2445
  return { clicked: true };
2447
2446
  `, { contact }, this.getWhatsAppWebScriptOptions(false));
2448
2447
  return Boolean(result?.clicked);
@@ -2508,12 +2507,11 @@ const sendCandidates = Array.from(document.querySelectorAll('[data-testid="compo
2508
2507
  const sendButton = sendCandidates[0];
2509
2508
  if (sendButton instanceof HTMLElement) {
2510
2509
  sendButton.scrollIntoView({ block: "center", inline: "center", behavior: "auto" });
2511
- sendButton.dispatchEvent(new MouseEvent("mousedown", { bubbles: true, cancelable: true, view: window }));
2512
- sendButton.dispatchEvent(new MouseEvent("mouseup", { bubbles: true, cancelable: true, view: window }));
2513
- sendButton.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true, view: window }));
2514
2510
  if (typeof sendButton.click === "function") {
2515
2511
  sendButton.click();
2512
+ return { sent: true };
2516
2513
  }
2514
+ sendButton.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true, view: window }));
2517
2515
  return { sent: true };
2518
2516
  }
2519
2517
 
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const BRIDGE_CONFIG_VERSION = 1;
2
- export const BRIDGE_VERSION = "0.6.9";
2
+ export const BRIDGE_VERSION = "0.6.10";
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;
@@ -439,12 +439,11 @@ export class WhatsAppBackgroundBrowser {
439
439
  const winner = titleNodes[0];
440
440
  const target = winner.container instanceof HTMLElement ? winner.container : winner.node;
441
441
  target.scrollIntoView({ block: "center", inline: "center", behavior: "auto" });
442
- target.dispatchEvent(new MouseEvent("mousedown", { bubbles: true, cancelable: true, view: window }));
443
- target.dispatchEvent(new MouseEvent("mouseup", { bubbles: true, cancelable: true, view: window }));
444
- target.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true, view: window }));
445
442
  if (typeof target.click === "function") {
446
443
  target.click();
444
+ return { clicked: true };
447
445
  }
446
+ target.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true, view: window }));
448
447
  return { clicked: true };
449
448
  }, contact));
450
449
  if (result.clicked === true) {
@@ -505,12 +504,11 @@ export class WhatsAppBackgroundBrowser {
505
504
  const sendButton = sendCandidates[0];
506
505
  if (sendButton instanceof HTMLElement) {
507
506
  sendButton.scrollIntoView({ block: "center", inline: "center", behavior: "auto" });
508
- sendButton.dispatchEvent(new MouseEvent("mousedown", { bubbles: true, cancelable: true, view: window }));
509
- sendButton.dispatchEvent(new MouseEvent("mouseup", { bubbles: true, cancelable: true, view: window }));
510
- sendButton.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true, view: window }));
511
507
  if (typeof sendButton.click === "function") {
512
508
  sendButton.click();
509
+ return { sent: true };
513
510
  }
511
+ sendButton.dispatchEvent(new MouseEvent("click", { bubbles: true, cancelable: true, view: window }));
514
512
  return { sent: true };
515
513
  }
516
514
  const composerCandidates = Array.from(document.querySelectorAll('footer div[contenteditable="true"], [data-testid="conversation-compose-box-input"], main footer [contenteditable="true"], footer textarea'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leg3ndy/otto-bridge",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Local companion for Otto Bridge device pairing and WebSocket runtime.",