@vosjs/cli 0.9.1 → 0.9.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.
@@ -154,6 +154,8 @@ function validateActions(value) {
154
154
  errors.push(`${at}: wait needs ms`);
155
155
  if (s.do === "type" && typeof s.text !== "string")
156
156
  errors.push(`${at}: type needs text`);
157
+ if (s.do === "type" && s.focus !== void 0 && typeof s.focus !== "boolean")
158
+ errors.push(`${at}: type focus must be true or false`);
157
159
  if (s.do === "scroll" && typeof s.dy !== "number")
158
160
  errors.push(`${at}: scroll needs dy`);
159
161
  if (s.do === "move" && (typeof s.x !== "number" || typeof s.y !== "number")) {
@@ -3426,7 +3428,7 @@ async function recordTake(browser, url, actions, paths, log, opts = {}) {
3426
3428
  case "type": {
3427
3429
  const rect = await boxOf(step.selector);
3428
3430
  if (rect) {
3429
- await clickAt(rect);
3431
+ if (step.focus !== false) await clickAt(rect);
3430
3432
  const delay = step.delayMs ?? 40;
3431
3433
  const ping = () => emit({
3432
3434
  x: Math.round(rect.x + rect.w / 2),
@@ -6150,7 +6152,12 @@ function convertAgentBrowser(records, opts = {}) {
6150
6152
  case "key": {
6151
6153
  const key = args.at(0);
6152
6154
  if (key === "Enter" && lastTarget) {
6153
- emit(n, { do: "type", selector: lastTarget, text: "\n" });
6155
+ emit(n, {
6156
+ do: "type",
6157
+ selector: lastTarget,
6158
+ text: "\n",
6159
+ focus: false
6160
+ });
6154
6161
  notes.push(
6155
6162
  `line ${n}: press Enter became a newline typed into the last field`
6156
6163
  );
@@ -7434,4 +7441,4 @@ export {
7434
7441
  convertAgentBrowser,
7435
7442
  run
7436
7443
  };
7437
- //# sourceMappingURL=chunk-74MSNLT2.js.map
7444
+ //# sourceMappingURL=chunk-NKUOT5JE.js.map