@leg3ndy/otto-bridge 0.7.6 → 0.8.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.
@@ -1201,10 +1201,13 @@ export class NativeMacOSJobExecutor {
1201
1201
  if (!verification.ok) {
1202
1202
  throw new Error(verification.reason || `Nao consegui confirmar o envio da mensagem para ${action.contact} no WhatsApp.`);
1203
1203
  }
1204
+ const afterSend = await this.readWhatsAppVisibleConversation(action.contact, Math.max(12, beforeSend.messages.length + 4)).catch(() => null);
1204
1205
  resultPayload.whatsapp = {
1205
1206
  action: "send_message",
1206
1207
  contact: action.contact,
1207
1208
  text_preview: clipText(action.text, 180),
1209
+ messages: afterSend?.messages || [],
1210
+ summary: afterSend?.summary || "",
1208
1211
  };
1209
1212
  completionNotes.push(`Enviei no WhatsApp para ${action.contact}: ${clipText(action.text, 180)}`);
1210
1213
  continue;
@@ -1251,7 +1254,12 @@ export class NativeMacOSJobExecutor {
1251
1254
  await this.triggerMacOSMediaTransport(nativeMediaTransport);
1252
1255
  let validated = false;
1253
1256
  let validationReason = "";
1254
- if (action.verification_prompt) {
1257
+ if (browserApp) {
1258
+ const browserValidation = await this.confirmBrowserClick(browserApp, initialBrowserState, targetDescription, null);
1259
+ validated = browserValidation.ok;
1260
+ validationReason = browserValidation.reason;
1261
+ }
1262
+ if (!validated && action.verification_prompt) {
1255
1263
  const verification = await this.validateVisualClickWithVision(job.job_id, targetDescription, action.verification_prompt, progressPercent, reporter, artifacts, "native_media_transport_result");
1256
1264
  if (verification.unavailable) {
1257
1265
  lastFailureReason = verification.reason;
@@ -1260,12 +1268,7 @@ export class NativeMacOSJobExecutor {
1260
1268
  validated = verification.ok;
1261
1269
  validationReason = verification.reason;
1262
1270
  }
1263
- else if (browserApp) {
1264
- const browserValidation = await this.confirmBrowserClick(browserApp, initialBrowserState, targetDescription, null);
1265
- validated = browserValidation.ok;
1266
- validationReason = browserValidation.reason;
1267
- }
1268
- else {
1271
+ else if (!browserApp) {
1269
1272
  validated = true;
1270
1273
  }
1271
1274
  if (validated) {
@@ -1290,7 +1293,12 @@ export class NativeMacOSJobExecutor {
1290
1293
  if (domClick?.clicked) {
1291
1294
  let validated = false;
1292
1295
  let validationReason = "";
1293
- if (action.verification_prompt) {
1296
+ if (browserApp) {
1297
+ const browserValidation = await this.confirmBrowserClick(browserApp, initialBrowserState, targetDescription, domClick.matchedHref || null);
1298
+ validated = browserValidation.ok;
1299
+ validationReason = browserValidation.reason;
1300
+ }
1301
+ if (!validated && action.verification_prompt) {
1294
1302
  const verification = await this.validateVisualClickWithVision(job.job_id, targetDescription, action.verification_prompt, progressPercent, reporter, artifacts, "dom_click_result");
1295
1303
  if (verification.unavailable) {
1296
1304
  lastFailureReason = verification.reason;
@@ -1299,10 +1307,8 @@ export class NativeMacOSJobExecutor {
1299
1307
  validated = verification.ok;
1300
1308
  validationReason = verification.reason;
1301
1309
  }
1302
- else {
1303
- const browserValidation = await this.confirmBrowserClick(browserApp, initialBrowserState, targetDescription, domClick.matchedHref || null);
1304
- validated = browserValidation.ok;
1305
- validationReason = browserValidation.reason;
1310
+ else if (!browserApp) {
1311
+ validated = true;
1306
1312
  }
1307
1313
  if (validated) {
1308
1314
  this.lastVisualTargetDescription = targetDescription;
@@ -1333,7 +1339,12 @@ export class NativeMacOSJobExecutor {
1333
1339
  if (ocrClick.clicked) {
1334
1340
  let validated = false;
1335
1341
  let validationReason = "";
1336
- if (action.verification_prompt) {
1342
+ if (browserApp) {
1343
+ const browserValidation = await this.confirmBrowserClick(browserApp, visualBeforeState, targetDescription, null);
1344
+ validated = browserValidation.ok;
1345
+ validationReason = browserValidation.reason;
1346
+ }
1347
+ if (!validated && action.verification_prompt) {
1337
1348
  const verification = await this.validateVisualClickWithVision(job.job_id, targetDescription, action.verification_prompt, progressPercent, reporter, artifacts, "local_ocr_click_result");
1338
1349
  if (verification.unavailable) {
1339
1350
  lastFailureReason = verification.reason;
@@ -1342,12 +1353,7 @@ export class NativeMacOSJobExecutor {
1342
1353
  validated = verification.ok;
1343
1354
  validationReason = verification.reason;
1344
1355
  }
1345
- else if (browserApp) {
1346
- const browserValidation = await this.confirmBrowserClick(browserApp, visualBeforeState, targetDescription, null);
1347
- validated = browserValidation.ok;
1348
- validationReason = browserValidation.reason;
1349
- }
1350
- else {
1356
+ else if (!browserApp) {
1351
1357
  validated = true;
1352
1358
  }
1353
1359
  if (validated) {
package/dist/types.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const BRIDGE_CONFIG_VERSION = 1;
2
- export const BRIDGE_VERSION = "0.7.6";
2
+ export const BRIDGE_VERSION = "0.8.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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leg3ndy/otto-bridge",
3
- "version": "0.7.6",
3
+ "version": "0.8.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Local companion for Otto Bridge device pairing and WebSocket runtime.",