@moxxy/cli 0.41.3 → 0.42.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.
@@ -1,8 +1,11 @@
1
1
  ---
2
2
  name: browser
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.
3
+ description: Drive the in-window browser the user is watching — read a page as an accessibility tree, act by uid or in runs of named steps, work from a picture, and hand over when a page needs a person.
4
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]
5
+ label: Moxxy Browser
6
+ aliases: [moxxy_browser, przegladarka]
7
+ disallowed-tools: ["computer_*"]
8
+ allowed-tools: [browser_snapshot, browser_find, browser_click, browser_type, browser_key, browser_batch, browser_navigate, browser_tabs, browser_capture, browser_history, browser_await_human, browser_select, browser_scroll, browser_hover, browser_wait, browser_dialog, browser_allow_site, browser_point, browser_upload, browser_run, browser_session, web_fetch]
6
9
  ---
7
10
 
8
11
  # The in-window browser
@@ -12,9 +15,60 @@ page you drive — not a picture of one — so the user watches you work and can
12
15
  over on the spot. It carries their signed-in profile, which is why you must never
13
16
  treat it as a throwaway browser.
14
17
 
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.
18
+ Outside the desktop — `moxxy` in a terminal, or a runner on its own — the same
19
+ tools drive a browser of your own with no window. Everything below works the
20
+ same there, with two differences: nobody watches it or can take it over, and it
21
+ is signed in only where the user signed it in themselves (`moxxy browser login
22
+ <site>`, or `/browser login <site>` in the TUI). When a page needs a sign-in it
23
+ does not have, tell the user to run that and ask again — never type their
24
+ password.
25
+
26
+ **For a web page, use these tools, not the computer** — unless the user names
27
+ another browser or app (Arc, Safari, Chrome…) or writes `@computer_use`. Then
28
+ the work belongs in that app on their screen, through the computer tools, and
29
+ this pane stays out of it. `@moxxy_browser` is the opposite call: this pane,
30
+ and the computer tools are off for that request. Otherwise do not reach for macOS control, a screenshot
31
+ of the screen, or another browser: this one is where the user watches you work.
32
+
33
+ ## Be quick
34
+
35
+ Every call is a round trip the user waits for. The pages are not the slow part;
36
+ looking again is.
37
+
38
+ - **Go straight to the page.** Open the URL you know. When you have to guess one
39
+ (a search page, a product path), guess once; if it is wrong, use the site's own
40
+ search or links rather than guessing again.
41
+ - **Never open the page you are already on.** The snapshot names the URL; a
42
+ second `browser_navigate` to it only reloads it and throws your uids away.
43
+ - **Read once, broadly, then narrow.** One snapshot shows the whole page. Do not
44
+ scroll through it or capture it piece by piece to find something the tree
45
+ already lists.
46
+ - **Trust one clear signal.** An action's answer says what it set off (navigated,
47
+ a dialog, a tab it opened, what a field shows now). When it says the thing
48
+ happened, carry on; do not read the page again just to see it twice.
49
+ - **Plan the steps you know and send them together** — as one `browser_run` when
50
+ it is among your tools, otherwise as a `browser_batch` or as several calls in
51
+ one response.
52
+ - **Finish the task yourself.** The user asked you, not themselves: a search
53
+ that lands on the wrong article, a disambiguation page, a list on two pages —
54
+ each is one more step for you. Follow the link the page offers; never ask the
55
+ user to click something you can click.
56
+ - **A change the page says is not applied yet is not done.** When a page tells
57
+ you what is still needed ("restart to apply", "publish your changes") and no
58
+ control carries that word, use the control that does it under another name —
59
+ a restart that reloads the settings, a save that publishes. Do it yourself
60
+ when it applies only to what you set up or changed in this task; when it
61
+ would touch something else of the user's, ask first.
62
+ - **Report what you saw after your last action.** What an action sets off — a
63
+ save, an upload, a job — can take a while, and a check made before it says
64
+ nothing about the result. A read lists what the page itself marks as still
65
+ working under "### In progress"; wait for it (`browser_wait`) and read again.
66
+ An address that should start answering once it is done: `web_fetch` with
67
+ `untilUpMs` keeps trying while it refuses or answers 5xx. Say something does
68
+ not work only when that wait is over.
69
+ - **Answer from the whole list.** For "the cheapest", "the newest", "how many",
70
+ compare every item the page lists (and the next page, when there is one)
71
+ before you answer — not the first one that looks right.
18
72
 
19
73
  ## How to read a page
20
74
 
@@ -22,7 +76,6 @@ is the one the user is looking at; anything else acts somewhere they cannot see.
22
76
  that can be acted on, each with a `[uid]`. That is the form you act on: you name
23
77
  a uid, not a CSS selector and not a coordinate.
24
78
 
25
- - Read before acting, and again after anything that changes the page.
26
79
  - After the first read of a tab you get **only what changed** since it. A uid
27
80
  keeps meaning the same element, so everything not listed is still as you last
28
81
  saw it. Ask for `full: true` when you have lost your bearings — it costs far
@@ -32,15 +85,22 @@ a uid, not a CSS selector and not a coordinate.
32
85
  - If the answer is "unchanged since your last snapshot", the page really has not
33
86
  moved. Do something, then look again; reading twice in a row tells you nothing
34
87
  and is not free.
88
+ - A read has a size limit. On a long page it ends with "… N more rows not
89
+ shown"; the rest is still there and its uids still work.
90
+ - **When you need one thing on a long page,** `browser_find` with a few words
91
+ ("Save button", "email", "price") gives back only the rows that
92
+ match, each with its uid, from the whole page. A label that matches brings the
93
+ field after it. Every read stays in the conversation and is paid for again on
94
+ each later call, so a lookup of a few rows is the cheap way to aim.
35
95
 
36
96
  ## How to act
37
97
 
38
98
  - `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.
99
+ - `browser_type` — put text into a field, by uid; it replaces what the field
100
+ held, and `submit: true` presses Enter after it (the usual way to search).
101
+ - `browser_select` — choose an option of a native list by its label.
102
+ - `browser_key` — the things a click and a string cannot do: `Escape` to dismiss,
103
+ `Tab` to move on. The key lands wherever the page has focus.
44
104
  - `browser_navigate` — go to a URL. Public http(s) only; internal hosts are
45
105
  refused.
46
106
  - `browser_history` — back, forward, reload.
@@ -48,23 +108,84 @@ a uid, not a CSS selector and not a coordinate.
48
108
  Every one of these takes a `tab_id`. Pass the one the snapshot gave you; omit it
49
109
  only when you mean "whatever tab is in front".
50
110
 
111
+ When an action is refused, the answer says why — disabled, covered by a banner,
112
+ not drawn because a menu is closed. Fix that (close the banner, open the menu)
113
+ instead of repeating the same call.
114
+
115
+ ## Runs of steps
116
+
117
+ When `browser_run` is among your tools (the user has Jev on), it is the way to
118
+ act — even for a single click — instead of `browser_click`, `browser_type`,
119
+ `browser_select` and `browser_batch`: name each element in words as it reads on
120
+ the page ("Add to basket button of the second book", "Search field"), send
121
+ every step you already know in one call, and give `expect` to the steps that
122
+ open or change something ("the basket says 1 item"). It finds the elements on
123
+ the live page itself, so you need not read the page first when you know what
124
+ is on it. It finds each element by its name, from what worked
125
+ on this site before, or by asking Jev, checks every `expect`, and stops at the
126
+ first step that does not work, saying why. Its answer ends with the page as it
127
+ is now — continue from there; do not read it again.
128
+
129
+ When a run cannot find a control you named, it names the closest ones on the
130
+ page. Look at those before you decide it is not there: a page often calls the
131
+ thing you mean by another name ("Log in" for sign in, "Continue" for submit, a
132
+ restart that applies new settings).
133
+
134
+ Use the single tools for what a run reports as not done, for what has no name
135
+ on the page, and when a step depends on reading something first (which book is
136
+ cheapest, what a search found). When `browser_run` is not among your tools, do
137
+ not look for it: act with the single tools.
138
+
139
+ ## Allowing a site
140
+
141
+ The user allows a site once, and you act there without asking again.
142
+ `browser_allow_site` is how you ask: the tool puts the question to the user
143
+ itself and returns their answer. Before the first action on a site — opening one
144
+ of its pages, a click, typing — call it with the site and a one-line reason, in
145
+ the same response as that action. A site not allowed yet is never a
146
+ reason to stop or to hand the task back: call the tool and carry on. Every
147
+ snapshot lists the sites already allowed: never ask for one of those again. An
148
+ action on a site nobody allowed comes back refused with the site to ask for:
149
+ call the tool, then repeat the step. Reading a page never needs it. Only if the
150
+ user declines, do not act on that site; say what you would have done.
151
+
51
152
  ## Doing several things at once
52
153
 
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.
154
+ `browser_batch` runs a sequence of uid actions and reads the page **once**, at
155
+ the end. Filling a form as five separate calls pays for five reads of it.
156
+ Whenever you already know the next few steps — fill these fields, press Enter,
157
+ then look — put them in one batch. Steps stop at the first failure, and the
158
+ error names which step it was.
159
+
160
+ ## Below the fold, behind a menu, still loading
57
161
 
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.
162
+ - `browser_scroll` when what you need is further down a long list, or a list
163
+ loads more as you scroll. Clicking and typing scroll to their element on
164
+ their own, so never scroll just to reach a uid you already have.
165
+ - `browser_hover` for a menu that opens when the pointer is over it; then read
166
+ what appeared.
167
+ - `browser_wait` for something slower than a page load — a search still running,
168
+ an upload, a spinner — by the text that will appear (or, with `gone: true`,
169
+ disappear). Every action already waits for the page to settle.
61
170
 
62
171
  ## Tabs
63
172
 
64
173
  `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.
174
+ names the open tabs, so you never have to ask which page you are on. A link that
175
+ opens a new tab says so, with the new `tab_id`. The tab you are working in is
176
+ yours — the user switching tabs in the pane does not move your aim.
177
+
178
+ ## Where nothing has a name: work from a picture
179
+
180
+ A `<canvas>` app (a drawing board, a map, a game) shows things the accessibility
181
+ tree cannot name. There, `browser_capture` without a uid returns a named picture
182
+ of the viewport (`v1`, `v2`, …) in the page's pixels, and `browser_point` clicks,
183
+ double-clicks, drags along a path, scrolls, presses a key or types **at places in
184
+ that picture**. Each point answers with a fresh picture: point at the newest one.
185
+ A point is refused, with nothing done, when the page navigated, scrolled or
186
+ looks different at that place since the picture — capture again and aim anew.
187
+ Keyboard shortcuts of the app ("r" for a rectangle tool) go through
188
+ `browser_point` with `key`. Prefer uids whenever the tree has the element.
68
189
 
69
190
  ## When the page wants a person
70
191
 
@@ -81,12 +202,22 @@ stop reading the page while they deal with it. Afterwards, take a fresh snapshot
81
202
  and confirm from the page itself that it worked — "I clicked Done" is not
82
203
  evidence of anything.
83
204
 
84
- ## Seeing it
205
+ In a browser with no window, `browser_await_human` answers that nobody can do it
206
+ there. Stop acting on that page and tell the user what it needs; they can finish
207
+ it in the Moxxy desktop app or in their own browser.
208
+
209
+ A file field is filled with `browser_upload` (paths on this computer; the user
210
+ is asked each time) — never click the button that opens the system's file
211
+ dialog, which you cannot answer.
212
+
213
+ ## When the user takes over
85
214
 
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.
215
+ On the desktop the user can take the browser at any moment — by pressing on the page, typing
216
+ into it, or Take over. From then on every action is refused with "The user has
217
+ taken over the browser". Do not retry, and do not reach the page another way
218
+ (`browser_session`, a script, the computer tools): tell them what you were about
219
+ to do and wait. They hand it back with Resume or by sending a new message; then
220
+ read the page afresh, since they may have changed it.
90
221
 
91
222
  ## The escape hatch
92
223
 
@@ -21,9 +21,10 @@ allowed-tools:
21
21
  - schedule_disable
22
22
  - schedule_run_now
23
23
  - telegram_send_message
24
+ - discord_send_message
24
25
  ---
25
26
 
26
- Use this skill when the user wants a prompt to fire automatically — recurring on a cron, or once at a fixed time. Each scheduled run starts a fresh turn, the assistant's final message gets written to `~/.moxxy/inbox/`, and the prompt itself can call delivery tools (e.g. `telegram_send_message`) for push notifications.
27
+ Use this skill when the user wants a prompt to fire automatically — recurring on a cron, or once at a fixed time. Each scheduled run starts a fresh turn, the assistant's final message gets written to `~/.moxxy/inbox/`, and the prompt itself can call delivery tools (e.g. `telegram_send_message`, `discord_send_message`) for push notifications.
27
28
 
28
29
  ## Pattern
29
30
 
@@ -40,6 +41,7 @@ Use this skill when the user wants a prompt to fire automatically — recurring
40
41
  - "Fetch today's top 5 Hacker News posts; for each, write a 2-line summary; then call `telegram_send_message` with a markdown-formatted digest."
41
42
  - "Check Gmail for new messages from <X>; if any, summarize and call `telegram_send_message`."
42
43
  - "Remind me about <X>. Call `telegram_send_message` with a short reminder."
44
+ - "Check the CI status of <repo>; if a build failed, call `discord_send_message` with the failing job and a one-line cause."
43
45
 
44
46
  4. **Call `schedule_create`** with `{ name, prompt, cron | runAt, channel?, model? }`. The tool returns `nextFireIso` so you can confirm the schedule will fire when expected.
45
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxxy/cli",
3
- "version": "0.41.3",
3
+ "version": "0.42.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",
@@ -30,7 +30,7 @@
30
30
  "author": "Michal Makowski <michal.makowski97@gmail.com>",
31
31
  "license": "MIT",
32
32
  "engines": {
33
- "node": ">=20.19.0"
33
+ "node": ">=22.19.0"
34
34
  },
35
35
  "type": "module",
36
36
  "main": "./dist/bin.js",
@@ -47,16 +47,16 @@
47
47
  "access": "public"
48
48
  },
49
49
  "dependencies": {
50
- "undici": "^6.28.1",
50
+ "undici": "^8.11.2",
51
51
  "zod": "^3.25.76",
52
- "@moxxy/sdk": "0.41.3"
52
+ "@moxxy/sdk": "0.42.0"
53
53
  },
54
54
  "optionalDependencies": {
55
55
  "@napi-rs/keyring": "^2.1.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@clack/prompts": "1.8.1",
59
- "@types/node": "^22.10.0",
59
+ "@types/node": "^22.20.5",
60
60
  "@types/react": "^18.3.0",
61
61
  "ink": "^5.0.0",
62
62
  "punycode": "^2.3.1",
@@ -64,7 +64,7 @@
64
64
  "tsup": "^8.0.0",
65
65
  "tsx": "^4.23.15",
66
66
  "typescript": "^6.0.3",
67
- "vitest": "^4.1.11"
67
+ "vitest": "^5.0.3"
68
68
  },
69
69
  "scripts": {
70
70
  "build": "tsx scripts/gen-requirements.mts && tsup",