@moxxy/cli 0.37.2 → 0.39.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/dist/bin.js +6942 -7179
- package/dist/skills/browser.md +88 -23
- package/package.json +5 -5
package/dist/skills/browser.md
CHANGED
|
@@ -1,32 +1,97 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: browser
|
|
3
|
-
description:
|
|
4
|
-
triggers: ["open the browser", "in the browser", "go to this site", "navigate to", "show me the page", "screenshot the page", "click the button on", "fill the form on", "browse to"]
|
|
5
|
-
allowed-tools: [browser_session, web_fetch]
|
|
3
|
+
description: Drive the in-window browser the user is watching — read a page as an accessibility tree, click and type by uid, manage tabs, and hand over when a page needs a person.
|
|
4
|
+
triggers: ["open the browser", "in the browser", "go to this site", "navigate to", "show me the page", "screenshot the page", "click the button on", "fill the form on", "browse to", "search for", "on the website", "log in to", "sign in to", "book a", "order a", "design a"]
|
|
5
|
+
allowed-tools: [browser_snapshot, browser_click, browser_type, browser_key, browser_batch, browser_navigate, browser_tabs, browser_capture, browser_history, browser_await_human, browser_session, web_fetch]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
#
|
|
8
|
+
# The in-window browser
|
|
9
9
|
|
|
10
|
-
The desktop has a **Browser** pane
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
The desktop has a **Browser** pane showing a real Chromium view. It is the same
|
|
11
|
+
page you drive — not a picture of one — so the user watches you work and can take
|
|
12
|
+
over on the spot. It carries their signed-in profile, which is why you must never
|
|
13
|
+
treat it as a throwaway browser.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
**Use these tools, not the computer.** Do not reach for macOS control, a
|
|
16
|
+
screenshot of the screen, or any other browser to visit a web page. This browser
|
|
17
|
+
is the one the user is looking at; anything else acts somewhere they cannot see.
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
- You need to see a JS-heavy/interactive page (not just fetch HTML) — use
|
|
19
|
-
`browser_session` (`goto`, `click`, `fill`, `screenshot`). For a plain GET,
|
|
20
|
-
`web_fetch` is lighter.
|
|
21
|
-
- You want to show the user a result visually rather than pasting text.
|
|
19
|
+
## How to read a page
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
`browser_snapshot` gives you the page as an accessibility tree — every element
|
|
22
|
+
that can be acted on, each with a `[uid]`. That is the form you act on: you name
|
|
23
|
+
a uid, not a CSS selector and not a coordinate.
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
- Read before acting, and again after anything that changes the page.
|
|
26
|
+
- After the first read of a tab you get **only what changed** since it. A uid
|
|
27
|
+
keeps meaning the same element, so everything not listed is still as you last
|
|
28
|
+
saw it. Ask for `full: true` when you have lost your bearings — it costs far
|
|
29
|
+
more, so not by default.
|
|
30
|
+
- After a navigation the uids are gone with the page they described, and the next
|
|
31
|
+
read is a whole tree again.
|
|
32
|
+
- If the answer is "unchanged since your last snapshot", the page really has not
|
|
33
|
+
moved. Do something, then look again; reading twice in a row tells you nothing
|
|
34
|
+
and is not free.
|
|
35
|
+
|
|
36
|
+
## How to act
|
|
37
|
+
|
|
38
|
+
- `browser_click` — press something, by uid.
|
|
39
|
+
- `browser_type` — put text into a field, by uid.
|
|
40
|
+
- `browser_key` — the things a click and a string cannot do: `Enter` to submit,
|
|
41
|
+
`Escape` to dismiss, `Tab` to move on, and `Meta+a` then `Backspace` to empty a
|
|
42
|
+
field that already has something in it. The key lands wherever the page has
|
|
43
|
+
focus, so click the field first.
|
|
44
|
+
- `browser_navigate` — go to a URL. Public http(s) only; internal hosts are
|
|
45
|
+
refused.
|
|
46
|
+
- `browser_history` — back, forward, reload.
|
|
47
|
+
|
|
48
|
+
Every one of these takes a `tab_id`. Pass the one the snapshot gave you; omit it
|
|
49
|
+
only when you mean "whatever tab is in front".
|
|
50
|
+
|
|
51
|
+
## Doing several things at once
|
|
52
|
+
|
|
53
|
+
`browser_batch` runs a sequence and reads the page **once**, at the end. Reading
|
|
54
|
+
a large page costs thousands of tokens, so filling a form as five separate calls
|
|
55
|
+
pays for five reads of it. Whenever you already know the next few steps — fill
|
|
56
|
+
these fields, press Enter, then look — put them in one batch.
|
|
57
|
+
|
|
58
|
+
Steps stop at the first failure, so a sequence never carries on against a page
|
|
59
|
+
that did not do what you expected, and the error names which step it was. One
|
|
60
|
+
approval covers the whole thing, and it shows every step.
|
|
61
|
+
|
|
62
|
+
## Tabs
|
|
63
|
+
|
|
64
|
+
`browser_tabs` lists, opens, switches and closes them. Every snapshot already
|
|
65
|
+
names the open tabs, so you never have to ask which page you are on. The tab you
|
|
66
|
+
are working in is yours — the user switching tabs in the pane does not move your
|
|
67
|
+
aim.
|
|
68
|
+
|
|
69
|
+
## When the page wants a person
|
|
70
|
+
|
|
71
|
+
A cookie banner, a CAPTCHA, a sign-in form: the snapshot says so under
|
|
72
|
+
**Needs you**. Do not click through any of them.
|
|
73
|
+
|
|
74
|
+
- The consent is the user's to give. Do not accept or reject it for them.
|
|
75
|
+
- The CAPTCHA is theirs to solve. Do not try, and do not look for a way around it.
|
|
76
|
+
- The password is theirs to type. Never type one, and **never ask them to tell
|
|
77
|
+
you a credential** — they enter it themselves.
|
|
78
|
+
|
|
79
|
+
Call `browser_await_human` with a plain sentence saying what the page wants. You
|
|
80
|
+
stop reading the page while they deal with it. Afterwards, take a fresh snapshot
|
|
81
|
+
and confirm from the page itself that it worked — "I clicked Done" is not
|
|
82
|
+
evidence of anything.
|
|
83
|
+
|
|
84
|
+
## Seeing it
|
|
85
|
+
|
|
86
|
+
`browser_capture` takes a picture, and cropping to a uid is far cheaper than a
|
|
87
|
+
whole viewport. Reach for it when the accessibility tree is empty where something
|
|
88
|
+
is clearly visible — a `<canvas>` app, a chart, a rendered document — not as a
|
|
89
|
+
first look.
|
|
90
|
+
|
|
91
|
+
## The escape hatch
|
|
92
|
+
|
|
93
|
+
`browser_session` still drives the same page by CSS selector and can run an
|
|
94
|
+
expression in it. Use it when the accessibility tree genuinely does not describe
|
|
95
|
+
what you need. It is below the tools above, not beside them.
|
|
96
|
+
|
|
97
|
+
For a plain GET with no page to watch, `web_fetch` is lighter than all of this.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moxxy/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.0",
|
|
4
4
|
"description": "moxxy command-line agent: TUI, one-shot prompts, setup, services, and API-key or installed-CLI subscription providers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"moxxy",
|
|
@@ -49,13 +49,13 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"undici": "^6.28.0",
|
|
51
51
|
"zod": "^3.25.76",
|
|
52
|
-
"@moxxy/sdk": "0.
|
|
52
|
+
"@moxxy/sdk": "0.39.0"
|
|
53
53
|
},
|
|
54
54
|
"optionalDependencies": {
|
|
55
55
|
"@napi-rs/keyring": "^1.3.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@clack/prompts": "
|
|
58
|
+
"@clack/prompts": "1.0.1",
|
|
59
59
|
"@types/node": "^22.10.0",
|
|
60
60
|
"@types/react": "^18.3.0",
|
|
61
61
|
"ink": "^5.0.0",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"react": "^18.3.0",
|
|
64
64
|
"tsup": "^8.0.0",
|
|
65
65
|
"tsx": "^4.23.12",
|
|
66
|
-
"typescript": "^
|
|
67
|
-
"vitest": "^
|
|
66
|
+
"typescript": "^6.0.3",
|
|
67
|
+
"vitest": "^4.1.11"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "tsx scripts/gen-requirements.mts && tsup",
|