browser-pilot 0.0.7 → 0.0.9

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/dist/actions.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { P as Page, S as Step, B as BatchOptions, b as BatchResult } from './types-CbdmaocU.js';
2
- export { A as ActionType, c as StepResult } from './types-CbdmaocU.js';
1
+ import { y as Page, S as Step, B as BatchOptions, b as BatchResult } from './types-DOGsEYQa.js';
2
+ export { A as ActionType, c as StepResult } from './types-DOGsEYQa.js';
3
3
  import './client-7Nqka5MV.js';
4
4
 
5
5
  /**
@@ -18,8 +18,8 @@ declare class BatchExecutor {
18
18
  */
19
19
  private executeStep;
20
20
  /**
21
- * Get the first selector if multiple were provided
22
- * (actual used selector tracking would need to be implemented in Page)
21
+ * Get the actual selector that matched the element.
22
+ * Uses the last matched selector tracked by Page, falls back to first selector if unavailable.
23
23
  */
24
24
  private getUsedSelector;
25
25
  }
@@ -30,4 +30,23 @@ declare function addBatchToPage(page: Page): Page & {
30
30
  batch: (steps: Step[], options?: BatchOptions) => Promise<BatchResult>;
31
31
  };
32
32
 
33
- export { BatchExecutor, BatchOptions, BatchResult, Step, addBatchToPage };
33
+ /**
34
+ * Step validation for batch executor
35
+ *
36
+ * Validates steps before browser connection, catching malformed JSON
37
+ * from AI agents with actionable, specific feedback.
38
+ */
39
+ interface ValidationError {
40
+ stepIndex: number;
41
+ field: string;
42
+ message: string;
43
+ suggestion?: string;
44
+ }
45
+ interface ValidationResult {
46
+ valid: boolean;
47
+ errors: ValidationError[];
48
+ formatted(): string;
49
+ }
50
+ declare function validateSteps(steps: unknown[]): ValidationResult;
51
+
52
+ export { BatchExecutor, BatchOptions, BatchResult, Step, type ValidationError, type ValidationResult, addBatchToPage, validateSteps };
package/dist/actions.mjs CHANGED
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  BatchExecutor,
3
- addBatchToPage
4
- } from "./chunk-6RB3GKQP.mjs";
3
+ addBatchToPage,
4
+ validateSteps
5
+ } from "./chunk-KKW2SZLV.mjs";
5
6
  export {
6
7
  BatchExecutor,
7
- addBatchToPage
8
+ addBatchToPage,
9
+ validateSteps
8
10
  };