@uicontract/skill 0.2.1 → 0.3.0
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/SKILL.md +10 -3
- package/package.json +1 -1
- package/references/browser-tool-bridge.md +7 -6
package/SKILL.md
CHANGED
|
@@ -46,7 +46,12 @@ Use the `agentId` from the find result to target the element in the browser.
|
|
|
46
46
|
**agent-browser:**
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
|
|
49
|
+
# Scoped snapshot to find the element ref:
|
|
50
|
+
agent-browser snapshot -s '[data-agent-id="settings.billing.pause-subscription.button"]'
|
|
51
|
+
# Returns: - button "Pause subscription" [ref=e1]
|
|
52
|
+
|
|
53
|
+
# Interact using the ref:
|
|
54
|
+
agent-browser click @e1
|
|
50
55
|
```
|
|
51
56
|
|
|
52
57
|
**CSS selector (any tool):**
|
|
@@ -200,10 +205,12 @@ npx uicontract find "pause subscription" --json
|
|
|
200
205
|
agent-browser open http://localhost:3000/settings/billing
|
|
201
206
|
```
|
|
202
207
|
|
|
203
|
-
**Step 3 --
|
|
208
|
+
**Step 3 -- Target and interact:**
|
|
204
209
|
|
|
205
210
|
```bash
|
|
206
|
-
agent-browser
|
|
211
|
+
agent-browser snapshot -s '[data-agent-id="settings.billing.pause-subscription.button"]'
|
|
212
|
+
# Returns: - button "Pause subscription" [ref=e1]
|
|
213
|
+
agent-browser click @e1
|
|
207
214
|
```
|
|
208
215
|
|
|
209
216
|
## Key Rules
|
package/package.json
CHANGED
|
@@ -6,17 +6,18 @@ UI Contracts annotates source code with `data-agent-id` attributes. This referen
|
|
|
6
6
|
|
|
7
7
|
### agent-browser
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use a scoped snapshot to locate the element ref, then interact using that ref.
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
# Click an element
|
|
13
|
-
agent-browser
|
|
13
|
+
agent-browser snapshot -s '[data-agent-id="settings.billing.pause-subscription.button"]'
|
|
14
|
+
# Returns: - button "Pause subscription" [ref=e1]
|
|
15
|
+
agent-browser click @e1
|
|
14
16
|
|
|
15
17
|
# Fill a form field
|
|
16
|
-
agent-browser
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
agent-browser find testid "settings.billing.pause-subscription.button" visible
|
|
18
|
+
agent-browser snapshot -s '[data-agent-id="login.login-form.email.input"]'
|
|
19
|
+
# Returns: - textbox "Email" [ref=e1]
|
|
20
|
+
agent-browser fill @e1 "user@example.com"
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
### Playwright MCP
|