@moxxy/cli 0.37.2 → 0.38.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 CHANGED
@@ -83586,12 +83586,7 @@ var init_BootShell = __esm({
83586
83586
  if (!session || showWelcome) {
83587
83587
  return (0, import_jsx_runtime41.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime41.jsx)(BootScreen, { events: bootEvents, startedAt, ...session ? { workspace: session.cwd } : {}, ...bootError ? { error: bootError } : {}, welcome: firstRun }), session ? (0, import_jsx_runtime41.jsx)(BootInputArea, { session, ready: bootError == null, bootError, onSubmit: (text2) => setInitialPrompt(text2) }) : (0, import_jsx_runtime41.jsx)(DisabledBootInput, { placeholder: bootError ? "Start failed \u2014 run `moxxy doctor --check-keys`" : "Initializing\u2026" })] });
83588
83588
  }
83589
- return (
83590
- // Key by session id so switching fully re-mounts the view — every
83591
- // session-keyed hook (event stream, turn runner, permission queue) resets to
83592
- // the new session instead of carrying the prior one's state across.
83593
- (0, import_jsx_runtime41.jsx)(SessionView, { session, registerInteractiveResolver, ...getVault ? { getVault } : {}, ...getChannels ? { getChannels } : {}, ...initialPrompt ? { initialPrompt } : {}, ...switchNotice ? { initialNotice: switchNotice } : {}, ...model ? { model } : {}, ...version ? { version } : {}, ...updateAvailable ? { updateAvailable } : {}, canSwitchSession: Boolean(switchSession), onSwitchSession: handleSwitchSession }, session.id)
83594
- );
83589
+ return (0, import_jsx_runtime41.jsx)(SessionView, { session, registerInteractiveResolver, ...getVault ? { getVault } : {}, ...getChannels ? { getChannels } : {}, ...initialPrompt ? { initialPrompt } : {}, ...switchNotice ? { initialNotice: switchNotice } : {}, ...model ? { model } : {}, ...version ? { version } : {}, ...updateAvailable ? { updateAvailable } : {}, canSwitchSession: Boolean(switchSession), onSwitchSession: handleSwitchSession }, session.id);
83595
83590
  };
83596
83591
  BootInputArea = ({ session, ready, bootError, onSubmit }) => {
83597
83592
  const [systemNotice, setSystemNotice] = (0, import_react70.useState)(null);
@@ -84712,7 +84707,41 @@ var init_validation = __esm({
84712
84707
  optionId: z.string().max(128).optional(),
84713
84708
  text: z.string().max(1e4).optional()
84714
84709
  }).strict()
84715
- }).strict()
84710
+ }).strict(),
84711
+ // Agent browser. `webContentsId` selects a live Electron view and `url` is
84712
+ // navigated for real, so both are validated at the boundary rather than
84713
+ // trusted from the renderer.
84714
+ "browser.registerTab": z.object({
84715
+ webContentsId: z.number().int().nonnegative(),
84716
+ requestId: z.string().min(1).max(64).optional()
84717
+ }),
84718
+ "browser.releaseTab": z.object({ tabId: z.string().min(1).max(64) }),
84719
+ "browser.selectTab": z.object({ tabId: z.string().min(1).max(64) }),
84720
+ "browser.navigate": z.object({
84721
+ url: z.string().url().refine((u) => /^https?:\/\//i.test(u), "only http(s) URLs allowed"),
84722
+ tabId: z.string().min(1).max(64).optional()
84723
+ }),
84724
+ "browser.capture": z.object({
84725
+ tabId: z.string().min(1).max(64).optional(),
84726
+ // Bounded: a rectangle from a drag on screen, not an arbitrary region of an
84727
+ // arbitrarily large page. Positive extents only — a zero-width crop is a
84728
+ // stray click, and the host would refuse it anyway.
84729
+ clip: z.object({
84730
+ x: z.number().min(0).max(1e5),
84731
+ y: z.number().min(0).max(1e5),
84732
+ width: z.number().positive().max(1e5),
84733
+ height: z.number().positive().max(1e5)
84734
+ }).optional()
84735
+ }),
84736
+ "browser.confirmFocus": z.object({ requestId: z.string().min(1).max(64) }),
84737
+ "browser.history": z.object({
84738
+ action: z.enum(["back", "forward", "reload"]),
84739
+ tabId: z.string().min(1).max(64).optional()
84740
+ }),
84741
+ "browser.resolveHandoff": z.object({
84742
+ requestId: z.string().min(1).max(64),
84743
+ completed: z.boolean()
84744
+ })
84716
84745
  };
84717
84746
  }
84718
84747
  });
@@ -1,32 +1,97 @@
1
1
  ---
2
2
  name: browser
3
- description: Open an in-window browser the user can watch, then navigate, click, and screenshot it for them.
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
- # In-window browser
8
+ # The in-window browser
9
9
 
10
- The desktop has a **Browser** pane that shows a live view of the SAME browser
11
- your `browser_session` tool drives. When you navigate or click via
12
- `browser_session`, the user sees it happen in that pane — and they can take over
13
- (click, type, scroll, change the URL) on the same page.
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
- ## When to use it
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
- - The user asks you to open, browse, or act on a web page they want to watch.
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
- ## How to use it well
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
- - Drive the page with `browser_session`; the Browser pane reflects it live, so
26
- you don't need to narrate every pixel — just say what you're doing.
27
- - Take a `screenshot` when a visual check matters (did the page load, did the
28
- form submit) or when the user asks to see it.
29
- - Navigation is restricted to public http(s) origins (loopback / private /
30
- metadata addresses are blocked); don't try to reach internal hosts.
31
- - The user and you share one page — if they've navigated somewhere, read the
32
- current state (`url`, `text`, `screenshot`) before acting.
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.37.2",
3
+ "version": "0.38.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,7 +49,7 @@
49
49
  "dependencies": {
50
50
  "undici": "^6.28.0",
51
51
  "zod": "^3.25.76",
52
- "@moxxy/sdk": "0.37.2"
52
+ "@moxxy/sdk": "0.38.0"
53
53
  },
54
54
  "optionalDependencies": {
55
55
  "@napi-rs/keyring": "^1.3.0"
@@ -63,7 +63,7 @@
63
63
  "react": "^18.3.0",
64
64
  "tsup": "^8.0.0",
65
65
  "tsx": "^4.23.12",
66
- "typescript": "^5.7.3",
66
+ "typescript": "^6.0.3",
67
67
  "vitest": "^3.2.6"
68
68
  },
69
69
  "scripts": {