@ulpi/browse 1.4.4 → 2.3.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.
- package/LICENSE +191 -21
- package/README.md +186 -12
- package/bin/browse-android-app.apk +0 -0
- package/bin/browse-android.apk +0 -0
- package/bin/browse-ax +0 -0
- package/bin/browse-ios-runner/BrowseRunnerApp/BrowseRunnerApp.swift +382 -0
- package/bin/browse-ios-runner/BrowseRunnerApp/RunnerStatusStore.swift +135 -0
- package/bin/browse-ios-runner/BrowseRunnerUITests/ActionHandler.swift +277 -0
- package/bin/browse-ios-runner/BrowseRunnerUITests/BrowseRunnerUITests.swift +60 -0
- package/bin/browse-ios-runner/BrowseRunnerUITests/Models.swift +78 -0
- package/bin/browse-ios-runner/BrowseRunnerUITests/RunnerServer.swift +246 -0
- package/bin/browse-ios-runner/BrowseRunnerUITests/ScreenshotHandler.swift +35 -0
- package/bin/browse-ios-runner/BrowseRunnerUITests/StateHandler.swift +82 -0
- package/bin/browse-ios-runner/BrowseRunnerUITests/TreeBuilder.swift +323 -0
- package/bin/browse-ios-runner/build.sh +81 -0
- package/bin/browse-ios-runner/project.yml +47 -0
- package/browse-ios-runner/BrowseRunnerApp/BrowseRunnerApp.swift +382 -0
- package/browse-ios-runner/BrowseRunnerApp/RunnerStatusStore.swift +135 -0
- package/browse-ios-runner/BrowseRunnerUITests/ActionHandler.swift +277 -0
- package/browse-ios-runner/BrowseRunnerUITests/BrowseRunnerUITests.swift +60 -0
- package/browse-ios-runner/BrowseRunnerUITests/Models.swift +78 -0
- package/browse-ios-runner/BrowseRunnerUITests/RunnerServer.swift +246 -0
- package/browse-ios-runner/BrowseRunnerUITests/ScreenshotHandler.swift +35 -0
- package/browse-ios-runner/BrowseRunnerUITests/StateHandler.swift +82 -0
- package/browse-ios-runner/BrowseRunnerUITests/TreeBuilder.swift +323 -0
- package/browse-ios-runner/README.md +194 -0
- package/browse-ios-runner/build.sh +81 -0
- package/browse-ios-runner/project.yml +47 -0
- package/dist/browse.cjs +26595 -13648
- package/package.json +15 -5
- package/skill/SKILL.md +33 -0
- package/skill/references/commands.md +18 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,191 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2025 Ciprian Hacman
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @ulpi/browse
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Fast headless browser and native app automation CLI for AI coding agents. Persistent Chromium daemon via Playwright, ~100ms per command. Automate Android, iOS, and macOS apps through the same interface.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -300,7 +300,9 @@ browse record start # Record browsing commands as you go
|
|
|
300
300
|
browse record stop # Stop recording
|
|
301
301
|
browse record status # Check recording status
|
|
302
302
|
browse record export browse [path] # Export as chain-compatible JSON (replay with browse chain)
|
|
303
|
-
browse record export
|
|
303
|
+
browse record export flow [path] # Export as YAML flow (replay with browse flow)
|
|
304
|
+
browse record export replay [path] # Export as Chrome DevTools Recorder (browser only)
|
|
305
|
+
browse record export playwright [path] # Export as Playwright Test (browser only)
|
|
304
306
|
browse record export replay --selectors css,aria [path] # Filter selector types in export
|
|
305
307
|
```
|
|
306
308
|
|
|
@@ -519,6 +521,168 @@ For full process isolation (separate Chromium instances), use `BROWSE_PORT` to r
|
|
|
519
521
|
| Multiplexing | Yes (parallel agents) | No (one agent per profile) |
|
|
520
522
|
| Use case | Parallel browsing, lightweight | Real login state, heavy |
|
|
521
523
|
|
|
524
|
+
## Native App Automation
|
|
525
|
+
|
|
526
|
+
Automate Android, iOS, and macOS apps through the same CLI and ref workflow:
|
|
527
|
+
|
|
528
|
+
### Enable Platforms
|
|
529
|
+
|
|
530
|
+
```bash
|
|
531
|
+
browse enable android # Installs adb, JDK, Android SDK, emulator, system image, driver APK
|
|
532
|
+
browse enable ios # Builds iOS runner (requires Xcode)
|
|
533
|
+
browse enable macos # Builds macOS AX bridge (requires Xcode CLI tools)
|
|
534
|
+
browse enable all # Enable all platforms
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
Each `enable` command installs all dependencies and builds the native driver for that platform. Run once — everything is cached for future use.
|
|
538
|
+
|
|
539
|
+
### Simulator/Emulator Lifecycle
|
|
540
|
+
|
|
541
|
+
```bash
|
|
542
|
+
browse sim start --platform ios --app com.apple.Preferences --visible
|
|
543
|
+
browse sim start --platform android --app com.android.settings --visible
|
|
544
|
+
browse sim stop --platform ios
|
|
545
|
+
browse sim stop --platform android
|
|
546
|
+
browse sim status --platform ios
|
|
547
|
+
browse sim status --platform android
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
- `sim start` boots the simulator/emulator, launches the target app, and starts the automation driver
|
|
551
|
+
- `--visible` opens the simulator/emulator window (default: headless)
|
|
552
|
+
- Switching `--app` on a running simulator reconfigures the target without rebooting
|
|
553
|
+
- **Auto-install**: Android `sim start` automatically installs `adb`, Java, Android SDK, system image, and emulator via Homebrew if missing
|
|
554
|
+
|
|
555
|
+
### Android
|
|
556
|
+
|
|
557
|
+
```bash
|
|
558
|
+
browse sim start --platform android --app com.android.settings --visible
|
|
559
|
+
browse --platform android --app com.android.settings snapshot -i
|
|
560
|
+
browse --platform android --app com.android.settings tap @e3
|
|
561
|
+
browse --platform android --app com.android.settings swipe up
|
|
562
|
+
browse --platform android --app com.android.settings press back
|
|
563
|
+
browse --platform android --app com.android.settings text
|
|
564
|
+
browse --platform android --app com.android.settings screenshot app.png
|
|
565
|
+
browse sim stop --platform android
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
Auto-installs the full toolchain on first use (adb, JDK 21, Android SDK, emulator, system image, AVD). No manual setup required.
|
|
569
|
+
|
|
570
|
+
```bash
|
|
571
|
+
browse doctor --platform android # Check setup
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
### iOS
|
|
575
|
+
|
|
576
|
+
```bash
|
|
577
|
+
browse sim start --platform ios --app com.apple.Preferences --visible
|
|
578
|
+
browse --platform ios --app com.apple.Preferences snapshot -i
|
|
579
|
+
browse --platform ios --app com.apple.Preferences tap @e2
|
|
580
|
+
browse --platform ios --app com.apple.Preferences swipe up
|
|
581
|
+
browse --platform ios --app com.apple.Preferences press home
|
|
582
|
+
browse --platform ios --app com.apple.mobilesafari snapshot -i # Switch app
|
|
583
|
+
browse sim stop --platform ios
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
Requires: Xcode. Simulator boots automatically.
|
|
587
|
+
|
|
588
|
+
### macOS
|
|
589
|
+
|
|
590
|
+
```bash
|
|
591
|
+
browse --app "System Settings" snapshot -i
|
|
592
|
+
browse --app "System Settings" tap @e5
|
|
593
|
+
browse --app "System Settings" swipe up
|
|
594
|
+
browse --app TextEdit type "Hello"
|
|
595
|
+
browse --app TextEdit press "cmd+n" # Modifier combos supported
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
Requires: macOS, Accessibility permission granted to the terminal.
|
|
599
|
+
|
|
600
|
+
### Platform Flags
|
|
601
|
+
|
|
602
|
+
| Flag | Description |
|
|
603
|
+
|------|-------------|
|
|
604
|
+
| `--platform android\|ios\|macos` | Target platform (default: browser) |
|
|
605
|
+
| `--app <name>` | App package name (Android), bundle ID (iOS), or process name (macOS) |
|
|
606
|
+
| `--device <serial>` | Device serial (Android), simulator UDID (iOS) |
|
|
607
|
+
| `--visible` | Show simulator/emulator window (default: headless) |
|
|
608
|
+
|
|
609
|
+
### Unified Command Surface
|
|
610
|
+
|
|
611
|
+
All platforms support the same commands: `snapshot`, `text`, `tap`, `fill`, `type`, `press`, `swipe`, `screenshot`. The `@ref` workflow is identical — `snapshot -i` assigns refs, then `tap @e1`, `fill @e2 "text"`, etc. Commands requiring browser capabilities (navigation, tabs, JavaScript) are blocked with clear errors on app targets.
|
|
612
|
+
|
|
613
|
+
## Workflow Commands
|
|
614
|
+
|
|
615
|
+
### Flows
|
|
616
|
+
|
|
617
|
+
```bash
|
|
618
|
+
browse flow run.yaml # Execute YAML automation script
|
|
619
|
+
browse flow save login-flow # Save current recording as named flow
|
|
620
|
+
browse flow run login-flow # Execute saved flow
|
|
621
|
+
browse flow list # List saved flows
|
|
622
|
+
browse retry # Retry command with backoff (browser only)
|
|
623
|
+
browse watch # Watch DOM element for changes (browser only)
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
Flows work on all platforms (browser, Android, iOS, macOS). Each flow step goes through the `executeCommand()` pipeline — capability-gated per target. Recording captures individual flow steps, not the flow wrapper.
|
|
627
|
+
|
|
628
|
+
**Browser-only workflow commands:** `retry`, `watch`, `har start/stop`, `video start/stop`
|
|
629
|
+
**Browser-only export formats:** `record export replay`, `record export playwright`
|
|
630
|
+
|
|
631
|
+
### Assertions
|
|
632
|
+
|
|
633
|
+
```bash
|
|
634
|
+
browse expect "text 'Welcome'" # Assert text exists on page
|
|
635
|
+
browse expect "count .item > 3" # Assert element count
|
|
636
|
+
browse expect "url contains /dashboard" # Assert URL
|
|
637
|
+
browse expect "title 'My App'" # Assert page title
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
### SDK Mode
|
|
641
|
+
|
|
642
|
+
```typescript
|
|
643
|
+
import { createBrowser } from '@ulpi/browse/sdk';
|
|
644
|
+
|
|
645
|
+
const browser = await createBrowser();
|
|
646
|
+
await browser.goto('https://example.com');
|
|
647
|
+
const text = await browser.text();
|
|
648
|
+
await browser.close();
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
## Custom Extensibility
|
|
652
|
+
|
|
653
|
+
Extend browse with project-local JSON/YAML configuration in `.browse/`:
|
|
654
|
+
|
|
655
|
+
### Custom Audit Rules
|
|
656
|
+
|
|
657
|
+
`.browse/rules/my-rules.json`:
|
|
658
|
+
```json
|
|
659
|
+
[
|
|
660
|
+
{ "kind": "metric-threshold", "metric": "lcp", "max": 2000, "severity": "critical" },
|
|
661
|
+
{ "kind": "selector-count", "selector": "img:not([alt])", "max": 0, "severity": "warning" }
|
|
662
|
+
]
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
### Custom Detection Signatures
|
|
666
|
+
|
|
667
|
+
`.browse/detections/my-framework.json`:
|
|
668
|
+
```json
|
|
669
|
+
[
|
|
670
|
+
{ "name": "MyFramework", "detect": "!!window.__MY_FRAMEWORK__", "versionExpr": "window.__MY_FRAMEWORK__.version", "category": "custom" }
|
|
671
|
+
]
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
### Project Config
|
|
675
|
+
|
|
676
|
+
`browse.json`:
|
|
677
|
+
```json
|
|
678
|
+
{
|
|
679
|
+
"detectionPaths": [".browse/detections"],
|
|
680
|
+
"rulePaths": [".browse/rules"],
|
|
681
|
+
"flowPaths": [".browse/flows"],
|
|
682
|
+
"startupFlows": ["setup.yaml"]
|
|
683
|
+
}
|
|
684
|
+
```
|
|
685
|
+
|
|
522
686
|
## Security
|
|
523
687
|
|
|
524
688
|
All security features are opt-in — existing workflows are unaffected until you explicitly enable a feature.
|
|
@@ -587,7 +751,11 @@ Create a `browse.json` file at your project root to set persistent defaults:
|
|
|
587
751
|
"idleTimeout": 3600000,
|
|
588
752
|
"viewport": "1280x720",
|
|
589
753
|
"device": "iPhone 14",
|
|
590
|
-
"runtime": "playwright"
|
|
754
|
+
"runtime": "playwright",
|
|
755
|
+
"detectionPaths": [".browse/detections"],
|
|
756
|
+
"rulePaths": [".browse/rules"],
|
|
757
|
+
"flowPaths": [".browse/flows"],
|
|
758
|
+
"startupFlows": ["setup.yaml"]
|
|
591
759
|
}
|
|
592
760
|
```
|
|
593
761
|
|
|
@@ -635,7 +803,7 @@ Use browse to test the login flow. Run browse --help to see available commands.
|
|
|
635
803
|
|
|
636
804
|
## MCP Server Mode
|
|
637
805
|
|
|
638
|
-
Run browse as an [MCP](https://modelcontextprotocol.io/) server for editors that support the Model Context Protocol. All
|
|
806
|
+
Run browse as an [MCP](https://modelcontextprotocol.io/) server for editors that support the Model Context Protocol. All CLI commands are available as MCP tools — browser automation, app automation, perf-audit, detect, coverage, flows, and more.
|
|
639
807
|
|
|
640
808
|
```bash
|
|
641
809
|
browse --mcp
|
|
@@ -694,6 +862,7 @@ Use `--json` alongside `--mcp` for structured responses (`{success, data, comman
|
|
|
694
862
|
|------|-------------|
|
|
695
863
|
| `--session <id>` | Named session (isolates tabs, refs, cookies) |
|
|
696
864
|
| `--profile <name>` | Persistent browser profile (own Chromium, full state) |
|
|
865
|
+
| `--context [state\|delta\|full]` | Action context: `state` = page changes, `delta` = ARIA diff with refs, `full` = complete snapshot with refs |
|
|
697
866
|
| `--json` | Wrap output as `{success, data, command}` |
|
|
698
867
|
| `--content-boundaries` | Wrap page content in nonce-delimited markers |
|
|
699
868
|
| `--allowed-domains <d,d>` | Block navigation/resources outside allowlist |
|
|
@@ -717,6 +886,7 @@ Use `--json` alongside `--mcp` for structured responses (`{success, data, comman
|
|
|
717
886
|
| `BROWSE_TIMEOUT` | (none) | Override all command timeouts (ms) |
|
|
718
887
|
| `BROWSE_LOCAL_DIR` | `.browse/` or `/tmp` | State/log/screenshot directory |
|
|
719
888
|
| `BROWSE_JSON` | (none) | Set to `1` for JSON output mode |
|
|
889
|
+
| `BROWSE_CONTEXT` | (none) | Set to `1`/`state`/`delta`/`full` for action context levels |
|
|
720
890
|
| `BROWSE_CONTENT_BOUNDARIES` | (none) | Set to `1` for nonce-delimited output |
|
|
721
891
|
| `BROWSE_ALLOWED_DOMAINS` | (none) | Comma-separated domain allowlist |
|
|
722
892
|
| `BROWSE_MAX_OUTPUT` | (none) | Truncate output to N characters |
|
|
@@ -737,18 +907,22 @@ Use `--json` alongside `--mcp` for structured responses (`{success, data, comman
|
|
|
737
907
|
## Architecture
|
|
738
908
|
|
|
739
909
|
```
|
|
740
|
-
browse [--session <id>] <command>
|
|
910
|
+
browse [--session <id>] [--platform <p>] [--app <name>] <command>
|
|
741
911
|
|
|
|
742
912
|
CLI (thin HTTP client)
|
|
743
913
|
|
|
|
744
914
|
Persistent server (localhost, auto-started)
|
|
745
915
|
|
|
|
746
|
-
SessionManager
|
|
747
|
-
├──
|
|
748
|
-
├── "
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
916
|
+
SessionManager + CommandRegistry + executeCommand()
|
|
917
|
+
├── Browser sessions:
|
|
918
|
+
│ ├── "default" → BrowserManager → Chromium (Playwright)
|
|
919
|
+
│ ├── "agent-a" → BrowserManager → Chromium (shared)
|
|
920
|
+
│ └── "agent-b" → BrowserManager → Chromium (shared)
|
|
921
|
+
├── App sessions:
|
|
922
|
+
│ ├── "app:com.example" → AndroidAppManager → adb → device driver
|
|
923
|
+
│ ├── "app:com.example.ios" → IOSAppManager → simctl → Simulator
|
|
924
|
+
│ └── "app:Safari" → AppManager → browse-ax → macOS AX
|
|
925
|
+
└── All targets implement AutomationTarget interface
|
|
752
926
|
```
|
|
753
927
|
|
|
754
928
|
- **First command:** ~2s (server + Chromium startup, once)
|
|
@@ -794,4 +968,4 @@ Inspired by and originally derived from the `/browse` skill in [gstack](https://
|
|
|
794
968
|
|
|
795
969
|
## License
|
|
796
970
|
|
|
797
|
-
|
|
971
|
+
Apache-2.0
|
|
Binary file
|
|
Binary file
|
package/bin/browse-ax
ADDED
|
Binary file
|