app-manager-edge-worker 1.3.0 → 1.3.2

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
@@ -201,6 +201,21 @@ Log levels: `[INFO]` · `[SUCCESS]` · `[WARN]` · `[ERROR]` · `[TASK]` (job di
201
201
 
202
202
  ---
203
203
 
204
+ ### v1.3.2
205
+ - **Sub-Second Inline Error Resolution & Strict Outcome Race Protocol**:
206
+ - **Dynamic In-Page Error Detection**: Expanded `defaultBroadErrorSelector` to capture generic inline portal validation elements (`.err`, `span.err`, `p.err`, `div.err`, `[class*='err-']`, `[data-ng-bind*='ERR']`, `[data-ng-show*='err']`, `[data-ng-show*='w_gst']`, `[role='alert']`), eliminating 15-second hangs when portal rejections insert error lines without page reload.
207
+ - **Prioritized Error-First Outcome Race**: Re-ordered `waitForFunction` post-submit race to evaluate visible error elements and semantic error regexes *before* success selectors, preventing false-positive table matches on empty layout wrappers (such as captcha reload tables).
208
+ - **Semantic Pattern Fallback**: When portals display error lines using customized selectors, the worker scans visible DOM leaf elements against canonical failure signatures and links them back to defined `errorDetection.rules` by pattern, surfacing exact error codes (`ERR_INVALID_GSTIN`) and messages instantly.
209
+ - **Multi-Phase Native Form Dispatch**: Enhanced submit button triggering in `HITL_SESSION_SOLVE` with direct DOM `click` and `submit` event cascades, ensuring reactive SPA frameworks (AngularJS `data-ng-submit`, React, jQuery) dispatch form payloads immediately without dropping clicks.
210
+
211
+ ### v1.3.1
212
+ - **Robust Portal Input Resolution & Dynamic SPA Lifecycle Engine**:
213
+ - **Dynamic Multi-Selector Fallback Generation**: Form input selectors now automatically generate and evaluate candidate fallbacks (e.g. `input[name="for_gstin"]` expands to include `#for_gstin`, `[name="for_gstin"]`, `input#for_gstin`, `input[data-ng-model*="gstin"]`, and placeholder variants), resolving elements regardless of framework attribute formatting.
214
+ - **IFrame-Aware Element Discovery**: Introduced `locateElementInPageOrFrames` across `HITL_SESSION_INIT`, `HITL_SESSION_REFRESH`, and `HITL_SESSION_SOLVE`, querying the main page as well as all nested frames/iframes for inputs, captchas, and submit buttons.
215
+ - **Realistic Timeout Scaling**: Replaced fragile hardcoded timeouts (4s - 6s) with dynamic portal timeout scaling (`Math.max(timeoutMs, 20000)`), granting heavy client-side frameworks (AngularJS, React) sufficient headroom to download scripts and compile views.
216
+ - **AngularJS Scope & Model Synchronization**: Typed input values now dispatch full keyboard cascades (`input`, `change`, `keydown`, `keyup`, `blur`) and directly synchronize AngularJS `ngModel` (`$setViewValue`, `$render`, `$apply`) to trigger dynamic validation and captcha loaders (e.g. `showCap1`).
217
+ - **Actionable Diagnostic Logging**: Failure to locate an element now logs the browser's active URL and document title in terminal output with detailed context.
218
+
204
219
  ### v1.3.0
205
220
  - **Multi-Error Identifier Rules & Inspection Resilience Engine**:
206
221
  - **Custom Error Identifier Rules**: Supported typed error detection rules (`errorDetection.rules`) allowing classification of multiple distinct errors (e.g. `INVALID_GSTIN`, `INVALID_CAPTCHA`, `NOT_FOUND`) with tailored actions (`RETRY_CAPTCHA`, `BUSINESS_ERROR`, `ABORT_SESSION`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "app-manager-edge-worker",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Distributed Scraper Edge Worker for Apps Manager. Run on any local machine, VPS, or Termux Android device to serve browser and HTTP scraping jobs.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,4 +46,4 @@
46
46
  "qrcode": "^1.5.4",
47
47
  "socket.io-client": "^4.8.1"
48
48
  }
49
- }
49
+ }
package/src/banner.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from "module";
2
2
 
3
3
  const require = createRequire(import.meta.url);
4
- let workerVersion = "1.3.0";
4
+ let workerVersion = "1.3.2";
5
5
  try {
6
6
  const pkg = require("../package.json");
7
7
  if (pkg?.version) workerVersion = pkg.version;
package/src/client.js CHANGED
@@ -20,11 +20,11 @@ import fs from "fs";
20
20
  import { getWhatsAppHandler } from "./handlers/whatsappHandler.js";
21
21
  import { printBanner, logInfo, logSuccess, logWarn, logError, logJob } from "./banner.js";
22
22
 
23
- let workerPkgVersion = "1.3.0";
23
+ let workerPkgVersion = "1.3.2";
24
24
  try {
25
25
  const pkg = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
26
26
  if (pkg?.version) workerPkgVersion = pkg.version;
27
- } catch (_) {}
27
+ } catch (_) { }
28
28
 
29
29
  export async function startWorkerClient(config) {
30
30
  const { workerKey, serverUrl, concurrency, workerName, keepAliveMinutes = 7 } = config;
@@ -229,8 +229,8 @@ export async function startWorkerClient(config) {
229
229
  const targetUrl = jobType === "SEND_EMAIL"
230
230
  ? (payload.mailOptions?.to ? `to: ${payload.mailOptions.to}` : "email")
231
231
  : jobType.startsWith("WHATSAPP_")
232
- ? (payload.recipientPhone ? `WA: ${payload.recipientPhone}` : "whatsapp")
233
- : (payload.url || "(no url)");
232
+ ? (payload.recipientPhone ? `WA: ${payload.recipientPhone}` : "whatsapp")
233
+ : (payload.url || "(no url)");
234
234
 
235
235
  logJob(jobType, targetUrl);
236
236
  activeJobs++;
@@ -396,7 +396,7 @@ export async function startWorkerClient(config) {
396
396
  if (isTermux) {
397
397
  try {
398
398
  execSync("termux-wake-unlock", { stdio: "ignore" });
399
- } catch {}
399
+ } catch { }
400
400
  }
401
401
  socket.disconnect();
402
402
  await localBrowserManager.close();