@quanta-intellect/vessel-browser 0.1.44 → 0.1.46

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.
@@ -2763,16 +2763,30 @@ function getElementRole(el) {
2763
2763
  function getElementDescription(el) {
2764
2764
  return getTrimmedText(el.getAttribute("aria-description")) || getNodeTextByIds(el.getAttribute("aria-describedby")) || getTrimmedText(el.getAttribute("title")) || void 0;
2765
2765
  }
2766
- function getElementValue(el) {
2767
- if (el instanceof HTMLSelectElement) {
2768
- return getTrimmedText(el.value);
2766
+ function shouldExposeFieldValue(el) {
2767
+ if (!(el instanceof HTMLInputElement)) {
2768
+ return false;
2769
2769
  }
2770
+ const type = (el.type || "").toLowerCase();
2771
+ if (type !== "number") {
2772
+ return false;
2773
+ }
2774
+ const label = getInputLabelWithSource(el).label;
2775
+ const signals = [
2776
+ el.name,
2777
+ el.id,
2778
+ el.getAttribute("placeholder"),
2779
+ el.getAttribute("aria-label"),
2780
+ label
2781
+ ].filter(Boolean).join(" ").toLowerCase();
2782
+ return /\b(qty|quantity|count|items?)\b/.test(signals);
2783
+ }
2784
+ function getElementValue(el) {
2770
2785
  if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {
2771
- if (el.type === "password") return void 0;
2772
- if (el.type === "checkbox" || el.type === "radio") {
2786
+ if (el.type === "password" || el.type === "checkbox" || el.type === "radio") {
2773
2787
  return void 0;
2774
2788
  }
2775
- return getTrimmedText(el.value);
2789
+ return shouldExposeFieldValue(el) ? getTrimmedText(el.value) : void 0;
2776
2790
  }
2777
2791
  return void 0;
2778
2792
  }
@@ -3209,6 +3223,11 @@ function interactByIndex(index, action, value) {
3209
3223
  return "Error[stale-index]: Element not found — the page may have changed. Call read_page to refresh.";
3210
3224
  }
3211
3225
  if (action === "click") {
3226
+ el.scrollIntoView({ behavior: "instant", block: "center", inline: "center" });
3227
+ const rect = el.getBoundingClientRect();
3228
+ if (rect.width <= 0 || rect.height <= 0) {
3229
+ return "Error[hidden]: Element has no visible area. It may be inside a collapsed, lazy-loaded, or virtual-scroll section. Scroll toward it, then call read_page to refresh visible elements.";
3230
+ }
3212
3231
  el.focus();
3213
3232
  el.click();
3214
3233
  if (el instanceof HTMLInputElement) {
@@ -3235,6 +3254,7 @@ function interactByIndex(index, action, value) {
3235
3254
  return "Clicked: " + (el.getAttribute("aria-label") || el.textContent?.trim().slice(0, 60) || el.tagName.toLowerCase()) + (href ? "\nhref: " + href : "");
3236
3255
  }
3237
3256
  if (action === "focus") {
3257
+ el.scrollIntoView({ behavior: "instant", block: "center", inline: "center" });
3238
3258
  el.focus();
3239
3259
  return "Focused: " + (el.getAttribute("aria-label") || el.textContent?.trim().slice(0, 60) || el.tagName.toLowerCase());
3240
3260
  }
@@ -82,7 +82,8 @@ const Channels = {
82
82
  HISTORY_UPDATE: "history:update",
83
83
  // Premium
84
84
  PREMIUM_GET_STATE: "premium:get-state",
85
- PREMIUM_ACTIVATE: "premium:activate",
85
+ PREMIUM_ACTIVATION_START: "premium:activation-start",
86
+ PREMIUM_ACTIVATION_VERIFY: "premium:activation-verify",
86
87
  PREMIUM_CHECKOUT: "premium:checkout",
87
88
  PREMIUM_PORTAL: "premium:portal",
88
89
  PREMIUM_RESET: "premium:reset",
@@ -285,7 +286,13 @@ const api = {
285
286
  },
286
287
  premium: {
287
288
  getState: () => electron.ipcRenderer.invoke(Channels.PREMIUM_GET_STATE),
288
- activate: (email) => electron.ipcRenderer.invoke(Channels.PREMIUM_ACTIVATE, email),
289
+ requestCode: (email) => electron.ipcRenderer.invoke(Channels.PREMIUM_ACTIVATION_START, email),
290
+ verifyCode: (email, code, challengeToken) => electron.ipcRenderer.invoke(
291
+ Channels.PREMIUM_ACTIVATION_VERIFY,
292
+ email,
293
+ code,
294
+ challengeToken
295
+ ),
289
296
  checkout: (email) => electron.ipcRenderer.invoke(Channels.PREMIUM_CHECKOUT, email),
290
297
  portal: () => electron.ipcRenderer.invoke(Channels.PREMIUM_PORTAL),
291
298
  reset: () => electron.ipcRenderer.invoke(Channels.PREMIUM_RESET),