milaidy 1.0.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/LICENSE +8 -0
- package/README.md +538 -0
- package/dist/argv-CfSowvEA.js +63 -0
- package/dist/config-B-mboG4v.js +4 -0
- package/dist/eliza-CPJjgw-e.js +1491 -0
- package/dist/eliza.js +2192 -0
- package/dist/entry.js +232 -0
- package/dist/index.js +209 -0
- package/dist/links-BFKlWqSe.js +15 -0
- package/dist/paths-D_yh1DEJ.js +69 -0
- package/dist/plugins-cli-B7kSre2c.js +134 -0
- package/dist/program-6KwWwKKh.js +510 -0
- package/dist/register.agents-CPVmSjMG.js +17 -0
- package/dist/register.browser-B2ooXxNx.js +15 -0
- package/dist/register.channels-CMYQ6K6Y.js +42 -0
- package/dist/register.cron-D91lY1_Y.js +9 -0
- package/dist/register.devices-rU5I5L_y.js +13 -0
- package/dist/register.gateway-82SLAvw3.js +22 -0
- package/dist/register.hooks-B_XTBEkt.js +9 -0
- package/dist/register.logs-BgEGcPd8.js +10 -0
- package/dist/register.models-BJt9eVgZ.js +26 -0
- package/dist/register.nodes-B5xY1s8a.js +9 -0
- package/dist/register.skills-SFQqYIhg.js +10 -0
- package/dist/register.subclis-uF_AsbWR.js +187 -0
- package/dist/run-main-XODklzS-.js +56 -0
- package/dist/theme-DBvtuGeq.js +36 -0
- package/dist/utils-C1AUpp_V.js +42 -0
- package/dist/version-Cpn3yr5D.js +26 -0
- package/dist/workspace-Co3Wul2D.js +206 -0
- package/dist/workspace-DCA6MNVK.js +350 -0
- package/docs/.i18n/README.md +31 -0
- package/docs/.i18n/glossary.zh-CN.json +210 -0
- package/docs/.i18n/zh-CN.tm.jsonl +1329 -0
- package/docs/CNAME +1 -0
- package/docs/automation/cron-jobs.md +468 -0
- package/docs/automation/cron-vs-heartbeat.md +254 -0
- package/docs/automation/gmail-pubsub.md +256 -0
- package/docs/automation/poll.md +69 -0
- package/docs/automation/webhook.md +163 -0
- package/docs/bedrock.md +176 -0
- package/docs/brave-search.md +41 -0
- package/docs/broadcast-groups.md +442 -0
- package/docs/cli/acp.md +170 -0
- package/docs/cli/agent.md +24 -0
- package/docs/cli/agents.md +75 -0
- package/docs/cli/approvals.md +50 -0
- package/docs/cli/browser.md +107 -0
- package/docs/cli/channels.md +79 -0
- package/docs/cli/config.md +50 -0
- package/docs/cli/configure.md +33 -0
- package/docs/cli/cron.md +42 -0
- package/docs/cli/dashboard.md +16 -0
- package/docs/cli/devices.md +67 -0
- package/docs/cli/directory.md +63 -0
- package/docs/cli/dns.md +23 -0
- package/docs/cli/docs.md +15 -0
- package/docs/cli/doctor.md +41 -0
- package/docs/cli/gateway.md +199 -0
- package/docs/cli/health.md +21 -0
- package/docs/cli/hooks.md +291 -0
- package/docs/cli/index.md +1029 -0
- package/docs/cli/logs.md +24 -0
- package/docs/cli/memory.md +45 -0
- package/docs/cli/message.md +239 -0
- package/docs/cli/models.md +79 -0
- package/docs/cli/node.md +112 -0
- package/docs/cli/nodes.md +73 -0
- package/docs/cli/onboard.md +29 -0
- package/docs/cli/pairing.md +21 -0
- package/docs/cli/plugins.md +62 -0
- package/docs/cli/reset.md +17 -0
- package/docs/cli/sandbox.md +152 -0
- package/docs/cli/security.md +26 -0
- package/docs/cli/sessions.md +16 -0
- package/docs/cli/setup.md +29 -0
- package/docs/cli/skills.md +26 -0
- package/docs/cli/status.md +26 -0
- package/docs/cli/system.md +60 -0
- package/docs/cli/tui.md +23 -0
- package/docs/cli/uninstall.md +17 -0
- package/docs/cli/update.md +98 -0
- package/docs/cli/voicecall.md +34 -0
- package/docs/cli/webhooks.md +25 -0
- package/docs/concepts/agent-loop.md +146 -0
- package/docs/concepts/agent-workspace.md +229 -0
- package/docs/concepts/agent.md +122 -0
- package/docs/concepts/architecture.md +129 -0
- package/docs/concepts/channel-routing.md +114 -0
- package/docs/concepts/compaction.md +61 -0
- package/docs/concepts/context.md +159 -0
- package/docs/concepts/features.md +53 -0
- package/docs/concepts/group-messages.md +84 -0
- package/docs/concepts/groups.md +373 -0
- package/docs/concepts/markdown-formatting.md +130 -0
- package/docs/concepts/memory.md +546 -0
- package/docs/concepts/messages.md +154 -0
- package/docs/concepts/model-failover.md +149 -0
- package/docs/concepts/model-providers.md +315 -0
- package/docs/concepts/models.md +208 -0
- package/docs/concepts/multi-agent.md +376 -0
- package/docs/concepts/oauth.md +145 -0
- package/docs/concepts/plugins.md +454 -0
- package/docs/concepts/presence.md +102 -0
- package/docs/concepts/queue.md +89 -0
- package/docs/concepts/retry.md +69 -0
- package/docs/concepts/secrets.md +300 -0
- package/docs/concepts/session-pruning.md +122 -0
- package/docs/concepts/session-tool.md +193 -0
- package/docs/concepts/session.md +188 -0
- package/docs/concepts/sessions.md +10 -0
- package/docs/concepts/skills.md +392 -0
- package/docs/concepts/streaming.md +135 -0
- package/docs/concepts/system-prompt.md +114 -0
- package/docs/concepts/timezone.md +91 -0
- package/docs/concepts/typebox.md +289 -0
- package/docs/concepts/typing-indicators.md +68 -0
- package/docs/concepts/usage-tracking.md +35 -0
- package/docs/custom.css +4 -0
- package/docs/date-time.md +128 -0
- package/docs/debugging.md +162 -0
- package/docs/docs.json +1599 -0
- package/docs/environment.md +81 -0
- package/docs/hooks.md +876 -0
- package/docs/index.md +179 -0
- package/docs/install/ansible.md +208 -0
- package/docs/install/bun.md +59 -0
- package/docs/install/development-channels.md +75 -0
- package/docs/install/docker.md +567 -0
- package/docs/install/index.md +185 -0
- package/docs/install/installer.md +123 -0
- package/docs/install/migrating.md +192 -0
- package/docs/install/nix.md +96 -0
- package/docs/install/node.md +78 -0
- package/docs/install/uninstall.md +128 -0
- package/docs/install/updating.md +228 -0
- package/docs/logging.md +350 -0
- package/docs/multi-agent-sandbox-tools.md +395 -0
- package/docs/network.md +54 -0
- package/docs/nodes/audio.md +114 -0
- package/docs/nodes/camera.md +156 -0
- package/docs/nodes/images.md +72 -0
- package/docs/nodes/index.md +341 -0
- package/docs/nodes/location-command.md +113 -0
- package/docs/nodes/media-understanding.md +379 -0
- package/docs/nodes/talk.md +90 -0
- package/docs/nodes/voicewake.md +65 -0
- package/docs/northflank.mdx +53 -0
- package/docs/perplexity.md +80 -0
- package/docs/platforms/android.md +129 -0
- package/docs/platforms/digitalocean.md +262 -0
- package/docs/platforms/exe-dev.md +125 -0
- package/docs/platforms/fly.md +486 -0
- package/docs/platforms/gcp.md +503 -0
- package/docs/platforms/hetzner.md +330 -0
- package/docs/platforms/index.md +53 -0
- package/docs/platforms/ios.md +106 -0
- package/docs/platforms/linux.md +94 -0
- package/docs/platforms/mac/bundled-gateway.md +73 -0
- package/docs/platforms/mac/canvas.md +125 -0
- package/docs/platforms/mac/child-process.md +69 -0
- package/docs/platforms/mac/dev-setup.md +102 -0
- package/docs/platforms/mac/health.md +34 -0
- package/docs/platforms/mac/icon.md +31 -0
- package/docs/platforms/mac/logging.md +57 -0
- package/docs/platforms/mac/menu-bar.md +81 -0
- package/docs/platforms/mac/peekaboo.md +65 -0
- package/docs/platforms/mac/permissions.md +44 -0
- package/docs/platforms/mac/release.md +85 -0
- package/docs/platforms/mac/remote.md +83 -0
- package/docs/platforms/mac/signing.md +47 -0
- package/docs/platforms/mac/skills.md +33 -0
- package/docs/platforms/mac/voice-overlay.md +60 -0
- package/docs/platforms/mac/voicewake.md +67 -0
- package/docs/platforms/mac/webchat.md +41 -0
- package/docs/platforms/mac/xpc.md +61 -0
- package/docs/platforms/macos-vm.md +281 -0
- package/docs/platforms/macos.md +203 -0
- package/docs/platforms/oracle.md +303 -0
- package/docs/platforms/raspberry-pi.md +358 -0
- package/docs/platforms/windows.md +159 -0
- package/docs/plugin.md +651 -0
- package/docs/plugins/agent-tools.md +99 -0
- package/docs/plugins/manifest.md +71 -0
- package/docs/plugins/voice-call.md +273 -0
- package/docs/plugins/zalouser.md +70 -0
- package/docs/providers/anthropic.md +152 -0
- package/docs/providers/claude-max-api-proxy.md +148 -0
- package/docs/providers/cloudflare-ai-gateway.md +71 -0
- package/docs/providers/deepgram.md +93 -0
- package/docs/providers/glm.md +33 -0
- package/docs/providers/index.md +63 -0
- package/docs/providers/minimax.md +208 -0
- package/docs/providers/models.md +51 -0
- package/docs/providers/moonshot.md +142 -0
- package/docs/providers/ollama.md +223 -0
- package/docs/providers/openai.md +62 -0
- package/docs/providers/opencode.md +36 -0
- package/docs/providers/openrouter.md +37 -0
- package/docs/providers/qwen.md +53 -0
- package/docs/providers/synthetic.md +99 -0
- package/docs/providers/venice.md +267 -0
- package/docs/providers/vercel-ai-gateway.md +50 -0
- package/docs/providers/xiaomi.md +64 -0
- package/docs/providers/zai.md +36 -0
- package/docs/railway.mdx +99 -0
- package/docs/reference/templates/AGENTS.md +9 -0
- package/docs/reference/templates/BOOTSTRAP.md +3 -0
- package/docs/reference/templates/HEARTBEAT.md +3 -0
- package/docs/reference/templates/IDENTITY.md +3 -0
- package/docs/reference/templates/TOOLS.md +3 -0
- package/docs/reference/templates/USER.md +3 -0
- package/docs/render.mdx +165 -0
- package/docs/start/docs-directory.md +63 -0
- package/docs/start/getting-started.md +212 -0
- package/docs/start/milaidy.md +247 -0
- package/docs/start/onboarding.md +258 -0
- package/docs/start/pairing.md +86 -0
- package/docs/start/quickstart.md +81 -0
- package/docs/start/setup.md +149 -0
- package/docs/start/showcase.md +416 -0
- package/docs/start/wizard.md +418 -0
- package/docs/testing.md +368 -0
- package/docs/token-use.md +112 -0
- package/docs/tools/agent-send.md +53 -0
- package/docs/tools/apply-patch.md +50 -0
- package/docs/tools/browser-linux-troubleshooting.md +139 -0
- package/docs/tools/browser-login.md +68 -0
- package/docs/tools/browser.md +576 -0
- package/docs/tools/chrome-extension.md +178 -0
- package/docs/tools/clawhub.md +257 -0
- package/docs/tools/creating-skills.md +54 -0
- package/docs/tools/elevated.md +57 -0
- package/docs/tools/exec-approvals.md +246 -0
- package/docs/tools/exec.md +179 -0
- package/docs/tools/firecrawl.md +61 -0
- package/docs/tools/index.md +508 -0
- package/docs/tools/llm-task.md +115 -0
- package/docs/tools/reactions.md +22 -0
- package/docs/tools/skills-config.md +76 -0
- package/docs/tools/skills.md +300 -0
- package/docs/tools/slash-commands.md +196 -0
- package/docs/tools/subagents.md +151 -0
- package/docs/tools/thinking.md +73 -0
- package/docs/tools/web.md +261 -0
- package/docs/tui.md +159 -0
- package/docs/vps.md +43 -0
- package/docs/web/control-ui.md +221 -0
- package/docs/web/dashboard.md +46 -0
- package/docs/web/index.md +116 -0
- package/docs/web/webchat.md +49 -0
- package/milaidy.mjs +14 -0
- package/package.json +271 -0
- package/skills/.cache/catalog.json +88519 -0
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Integrated browser control service + action commands"
|
|
3
|
+
read_when:
|
|
4
|
+
- Adding agent-controlled browser automation
|
|
5
|
+
- Debugging why milaidy is interfering with your own Chrome
|
|
6
|
+
- Implementing browser settings + lifecycle in the macOS app
|
|
7
|
+
title: "Browser (Milaidy-managed)"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Browser (milaidy-managed)
|
|
11
|
+
|
|
12
|
+
Milaidy can run a **dedicated Chrome/Brave/Edge/Chromium profile** that the agent controls.
|
|
13
|
+
It is isolated from your personal browser and is managed through a small local
|
|
14
|
+
control service inside the Gateway (loopback only).
|
|
15
|
+
|
|
16
|
+
Beginner view:
|
|
17
|
+
|
|
18
|
+
- Think of it as a **separate, agent-only browser**.
|
|
19
|
+
- The `milaidy` profile does **not** touch your personal browser profile.
|
|
20
|
+
- The agent can **open tabs, read pages, click, and type** in a safe lane.
|
|
21
|
+
- The default `chrome` profile uses the **system default Chromium browser** via the
|
|
22
|
+
extension relay; switch to `milaidy` for the isolated managed browser.
|
|
23
|
+
|
|
24
|
+
## What you get
|
|
25
|
+
|
|
26
|
+
- A separate browser profile named **milaidy** (orange accent by default).
|
|
27
|
+
- Deterministic tab control (list/open/focus/close).
|
|
28
|
+
- Agent actions (click/type/drag/select), snapshots, screenshots, PDFs.
|
|
29
|
+
- Optional multi-profile support (`milaidy`, `work`, `remote`, ...).
|
|
30
|
+
|
|
31
|
+
This browser is **not** your daily driver. It is a safe, isolated surface for
|
|
32
|
+
agent automation and verification.
|
|
33
|
+
|
|
34
|
+
## Quick start
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
milaidy browser --browser-profile milaidy status
|
|
38
|
+
milaidy browser --browser-profile milaidy start
|
|
39
|
+
milaidy browser --browser-profile milaidy open https://example.com
|
|
40
|
+
milaidy browser --browser-profile milaidy snapshot
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If you get “Browser disabled”, enable it in config (see below) and restart the
|
|
44
|
+
Gateway.
|
|
45
|
+
|
|
46
|
+
## Profiles: `milaidy` vs `chrome`
|
|
47
|
+
|
|
48
|
+
- `milaidy`: managed, isolated browser (no extension required).
|
|
49
|
+
- `chrome`: extension relay to your **system browser** (requires the Milaidy
|
|
50
|
+
extension to be attached to a tab).
|
|
51
|
+
|
|
52
|
+
Set `browser.defaultProfile: "milaidy"` if you want managed mode by default.
|
|
53
|
+
|
|
54
|
+
## Configuration
|
|
55
|
+
|
|
56
|
+
Browser settings live in `~/.milaidy/milaidy.json`.
|
|
57
|
+
|
|
58
|
+
```json5
|
|
59
|
+
{
|
|
60
|
+
browser: {
|
|
61
|
+
enabled: true, // default: true
|
|
62
|
+
// cdpUrl: "http://127.0.0.1:18792", // legacy single-profile override
|
|
63
|
+
remoteCdpTimeoutMs: 1500, // remote CDP HTTP timeout (ms)
|
|
64
|
+
remoteCdpHandshakeTimeoutMs: 3000, // remote CDP WebSocket handshake timeout (ms)
|
|
65
|
+
defaultProfile: "chrome",
|
|
66
|
+
color: "#FF4500",
|
|
67
|
+
headless: false,
|
|
68
|
+
noSandbox: false,
|
|
69
|
+
attachOnly: false,
|
|
70
|
+
executablePath: "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
|
|
71
|
+
profiles: {
|
|
72
|
+
milaidy: { cdpPort: 18800, color: "#FF4500" },
|
|
73
|
+
work: { cdpPort: 18801, color: "#0066CC" },
|
|
74
|
+
remote: { cdpUrl: "http://10.0.0.42:9222", color: "#00AA00" },
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Notes:
|
|
81
|
+
|
|
82
|
+
- The browser control service binds to loopback on a port derived from `gateway.port`
|
|
83
|
+
(default: `18791`, which is gateway + 2). The relay uses the next port (`18792`).
|
|
84
|
+
- If you override the Gateway port (`gateway.port` or `MILAIDY_GATEWAY_PORT`),
|
|
85
|
+
the derived browser ports shift to stay in the same “family”.
|
|
86
|
+
- `cdpUrl` defaults to the relay port when unset.
|
|
87
|
+
- `remoteCdpTimeoutMs` applies to remote (non-loopback) CDP reachability checks.
|
|
88
|
+
- `remoteCdpHandshakeTimeoutMs` applies to remote CDP WebSocket reachability checks.
|
|
89
|
+
- `attachOnly: true` means “never launch a local browser; only attach if it is already running.”
|
|
90
|
+
- `color` + per-profile `color` tint the browser UI so you can see which profile is active.
|
|
91
|
+
- Default profile is `chrome` (extension relay). Use `defaultProfile: "milaidy"` for the managed browser.
|
|
92
|
+
- Auto-detect order: system default browser if Chromium-based; otherwise Chrome → Brave → Edge → Chromium → Chrome Canary.
|
|
93
|
+
- Local `milaidy` profiles auto-assign `cdpPort`/`cdpUrl` — set those only for remote CDP.
|
|
94
|
+
|
|
95
|
+
## Use Brave (or another Chromium-based browser)
|
|
96
|
+
|
|
97
|
+
If your **system default** browser is Chromium-based (Chrome/Brave/Edge/etc),
|
|
98
|
+
Milaidy uses it automatically. Set `browser.executablePath` to override
|
|
99
|
+
auto-detection:
|
|
100
|
+
|
|
101
|
+
CLI example:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
milaidy config set browser.executablePath "/usr/bin/google-chrome"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
```json5
|
|
108
|
+
// macOS
|
|
109
|
+
{
|
|
110
|
+
browser: {
|
|
111
|
+
executablePath: "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Windows
|
|
116
|
+
{
|
|
117
|
+
browser: {
|
|
118
|
+
executablePath: "C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Linux
|
|
123
|
+
{
|
|
124
|
+
browser: {
|
|
125
|
+
executablePath: "/usr/bin/brave-browser"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Local vs remote control
|
|
131
|
+
|
|
132
|
+
- **Local control (default):** the Gateway starts the loopback control service and can launch a local browser.
|
|
133
|
+
- **Remote control (node host):** run a node host on the machine that has the browser; the Gateway proxies browser actions to it.
|
|
134
|
+
- **Remote CDP:** set `browser.profiles.<name>.cdpUrl` (or `browser.cdpUrl`) to
|
|
135
|
+
attach to a remote Chromium-based browser. In this case, Milaidy will not launch a local browser.
|
|
136
|
+
|
|
137
|
+
Remote CDP URLs can include auth:
|
|
138
|
+
|
|
139
|
+
- Query tokens (e.g., `https://provider.example?token=<token>`)
|
|
140
|
+
- HTTP Basic auth (e.g., `https://user:pass@provider.example`)
|
|
141
|
+
|
|
142
|
+
Milaidy preserves the auth when calling `/json/*` endpoints and when connecting
|
|
143
|
+
to the CDP WebSocket. Prefer environment variables or secrets managers for
|
|
144
|
+
tokens instead of committing them to config files.
|
|
145
|
+
|
|
146
|
+
## Node browser proxy (zero-config default)
|
|
147
|
+
|
|
148
|
+
If you run a **node host** on the machine that has your browser, Milaidy can
|
|
149
|
+
auto-route browser tool calls to that node without any extra browser config.
|
|
150
|
+
This is the default path for remote gateways.
|
|
151
|
+
|
|
152
|
+
Notes:
|
|
153
|
+
|
|
154
|
+
- The node host exposes its local browser control server via a **proxy command**.
|
|
155
|
+
- Profiles come from the node’s own `browser.profiles` config (same as local).
|
|
156
|
+
- Disable if you don’t want it:
|
|
157
|
+
- On the node: `nodeHost.browserProxy.enabled=false`
|
|
158
|
+
- On the gateway: `gateway.nodes.browser.mode="off"`
|
|
159
|
+
|
|
160
|
+
## Browserless (hosted remote CDP)
|
|
161
|
+
|
|
162
|
+
[Browserless](https://browserless.io) is a hosted Chromium service that exposes
|
|
163
|
+
CDP endpoints over HTTPS. You can point a Milaidy browser profile at a
|
|
164
|
+
Browserless region endpoint and authenticate with your API key.
|
|
165
|
+
|
|
166
|
+
Example:
|
|
167
|
+
|
|
168
|
+
```json5
|
|
169
|
+
{
|
|
170
|
+
browser: {
|
|
171
|
+
enabled: true,
|
|
172
|
+
defaultProfile: "browserless",
|
|
173
|
+
remoteCdpTimeoutMs: 2000,
|
|
174
|
+
remoteCdpHandshakeTimeoutMs: 4000,
|
|
175
|
+
profiles: {
|
|
176
|
+
browserless: {
|
|
177
|
+
cdpUrl: "https://production-sfo.browserless.io?token=<BROWSERLESS_API_KEY>",
|
|
178
|
+
color: "#00AA00",
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Notes:
|
|
186
|
+
|
|
187
|
+
- Replace `<BROWSERLESS_API_KEY>` with your real Browserless token.
|
|
188
|
+
- Choose the region endpoint that matches your Browserless account (see their docs).
|
|
189
|
+
|
|
190
|
+
## Security
|
|
191
|
+
|
|
192
|
+
Key ideas:
|
|
193
|
+
|
|
194
|
+
- Browser control is loopback-only; access flows through the Gateway’s auth or node pairing.
|
|
195
|
+
- Keep the Gateway and any node hosts on a private network (Tailscale); avoid public exposure.
|
|
196
|
+
- Treat remote CDP URLs/tokens as secrets; prefer env vars or a secrets manager.
|
|
197
|
+
|
|
198
|
+
Remote CDP tips:
|
|
199
|
+
|
|
200
|
+
- Prefer HTTPS endpoints and short-lived tokens where possible.
|
|
201
|
+
- Avoid embedding long-lived tokens directly in config files.
|
|
202
|
+
|
|
203
|
+
## Profiles (multi-browser)
|
|
204
|
+
|
|
205
|
+
Milaidy supports multiple named profiles (routing configs). Profiles can be:
|
|
206
|
+
|
|
207
|
+
- **milaidy-managed**: a dedicated Chromium-based browser instance with its own user data directory + CDP port
|
|
208
|
+
- **remote**: an explicit CDP URL (Chromium-based browser running elsewhere)
|
|
209
|
+
- **extension relay**: your existing Chrome tab(s) via the local relay + Chrome extension
|
|
210
|
+
|
|
211
|
+
Defaults:
|
|
212
|
+
|
|
213
|
+
- The `milaidy` profile is auto-created if missing.
|
|
214
|
+
- The `chrome` profile is built-in for the Chrome extension relay (points at `http://127.0.0.1:18792` by default).
|
|
215
|
+
- Local CDP ports allocate from **18800–18899** by default.
|
|
216
|
+
- Deleting a profile moves its local data directory to Trash.
|
|
217
|
+
|
|
218
|
+
All control endpoints accept `?profile=<name>`; the CLI uses `--browser-profile`.
|
|
219
|
+
|
|
220
|
+
## Chrome extension relay (use your existing Chrome)
|
|
221
|
+
|
|
222
|
+
Milaidy can also drive **your existing Chrome tabs** (no separate “milaidy” Chrome instance) via a local CDP relay + a Chrome extension.
|
|
223
|
+
|
|
224
|
+
Full guide: [Chrome extension](/tools/chrome-extension)
|
|
225
|
+
|
|
226
|
+
Flow:
|
|
227
|
+
|
|
228
|
+
- The Gateway runs locally (same machine) or a node host runs on the browser machine.
|
|
229
|
+
- A local **relay server** listens at a loopback `cdpUrl` (default: `http://127.0.0.1:18792`).
|
|
230
|
+
- You click the **Milaidy Browser Relay** extension icon on a tab to attach (it does not auto-attach).
|
|
231
|
+
- The agent controls that tab via the normal `browser` tool, by selecting the right profile.
|
|
232
|
+
|
|
233
|
+
If the Gateway runs elsewhere, run a node host on the browser machine so the Gateway can proxy browser actions.
|
|
234
|
+
|
|
235
|
+
### Sandboxed sessions
|
|
236
|
+
|
|
237
|
+
If the agent session is sandboxed, the `browser` tool may default to `target="sandbox"` (sandbox browser).
|
|
238
|
+
Chrome extension relay takeover requires host browser control, so either:
|
|
239
|
+
|
|
240
|
+
- run the session unsandboxed, or
|
|
241
|
+
- set `agents.defaults.sandbox.browser.allowHostControl: true` and use `target="host"` when calling the tool.
|
|
242
|
+
|
|
243
|
+
### Setup
|
|
244
|
+
|
|
245
|
+
1. Load the extension (dev/unpacked):
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
milaidy browser extension install
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
- Chrome → `chrome://extensions` → enable “Developer mode”
|
|
252
|
+
- “Load unpacked” → select the directory printed by `milaidy browser extension path`
|
|
253
|
+
- Pin the extension, then click it on the tab you want to control (badge shows `ON`).
|
|
254
|
+
|
|
255
|
+
2. Use it:
|
|
256
|
+
|
|
257
|
+
- CLI: `milaidy browser --browser-profile chrome tabs`
|
|
258
|
+
- Agent tool: `browser` with `profile="chrome"`
|
|
259
|
+
|
|
260
|
+
Optional: if you want a different name or relay port, create your own profile:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
milaidy browser create-profile \
|
|
264
|
+
--name my-chrome \
|
|
265
|
+
--driver extension \
|
|
266
|
+
--cdp-url http://127.0.0.1:18792 \
|
|
267
|
+
--color "#00AA00"
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Notes:
|
|
271
|
+
|
|
272
|
+
- This mode relies on Playwright-on-CDP for most operations (screenshots/snapshots/actions).
|
|
273
|
+
- Detach by clicking the extension icon again.
|
|
274
|
+
|
|
275
|
+
## Isolation guarantees
|
|
276
|
+
|
|
277
|
+
- **Dedicated user data dir**: never touches your personal browser profile.
|
|
278
|
+
- **Dedicated ports**: avoids `9222` to prevent collisions with dev workflows.
|
|
279
|
+
- **Deterministic tab control**: target tabs by `targetId`, not “last tab”.
|
|
280
|
+
|
|
281
|
+
## Browser selection
|
|
282
|
+
|
|
283
|
+
When launching locally, Milaidy picks the first available:
|
|
284
|
+
|
|
285
|
+
1. Chrome
|
|
286
|
+
2. Brave
|
|
287
|
+
3. Edge
|
|
288
|
+
4. Chromium
|
|
289
|
+
5. Chrome Canary
|
|
290
|
+
|
|
291
|
+
You can override with `browser.executablePath`.
|
|
292
|
+
|
|
293
|
+
Platforms:
|
|
294
|
+
|
|
295
|
+
- macOS: checks `/Applications` and `~/Applications`.
|
|
296
|
+
- Linux: looks for `google-chrome`, `brave`, `microsoft-edge`, `chromium`, etc.
|
|
297
|
+
- Windows: checks common install locations.
|
|
298
|
+
|
|
299
|
+
## Control API (optional)
|
|
300
|
+
|
|
301
|
+
For local integrations only, the Gateway exposes a small loopback HTTP API:
|
|
302
|
+
|
|
303
|
+
- Status/start/stop: `GET /`, `POST /start`, `POST /stop`
|
|
304
|
+
- Tabs: `GET /tabs`, `POST /tabs/open`, `POST /tabs/focus`, `DELETE /tabs/:targetId`
|
|
305
|
+
- Snapshot/screenshot: `GET /snapshot`, `POST /screenshot`
|
|
306
|
+
- Actions: `POST /navigate`, `POST /act`
|
|
307
|
+
- Hooks: `POST /hooks/file-chooser`, `POST /hooks/dialog`
|
|
308
|
+
- Downloads: `POST /download`, `POST /wait/download`
|
|
309
|
+
- Debugging: `GET /console`, `POST /pdf`
|
|
310
|
+
- Debugging: `GET /errors`, `GET /requests`, `POST /trace/start`, `POST /trace/stop`, `POST /highlight`
|
|
311
|
+
- Network: `POST /response/body`
|
|
312
|
+
- State: `GET /cookies`, `POST /cookies/set`, `POST /cookies/clear`
|
|
313
|
+
- State: `GET /storage/:kind`, `POST /storage/:kind/set`, `POST /storage/:kind/clear`
|
|
314
|
+
- Settings: `POST /set/offline`, `POST /set/headers`, `POST /set/credentials`, `POST /set/geolocation`, `POST /set/media`, `POST /set/timezone`, `POST /set/locale`, `POST /set/device`
|
|
315
|
+
|
|
316
|
+
All endpoints accept `?profile=<name>`.
|
|
317
|
+
|
|
318
|
+
### Playwright requirement
|
|
319
|
+
|
|
320
|
+
Some features (navigate/act/AI snapshot/role snapshot, element screenshots, PDF) require
|
|
321
|
+
Playwright. If Playwright isn’t installed, those endpoints return a clear 501
|
|
322
|
+
error. ARIA snapshots and basic screenshots still work for milaidy-managed Chrome.
|
|
323
|
+
For the Chrome extension relay driver, ARIA snapshots and screenshots require Playwright.
|
|
324
|
+
|
|
325
|
+
If you see `Playwright is not available in this gateway build`, install the full
|
|
326
|
+
Playwright package (not `playwright-core`) and restart the gateway, or reinstall
|
|
327
|
+
Milaidy with browser support.
|
|
328
|
+
|
|
329
|
+
#### Docker Playwright install
|
|
330
|
+
|
|
331
|
+
If your Gateway runs in Docker, avoid `npx playwright` (npm override conflicts).
|
|
332
|
+
Use the bundled CLI instead:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
docker compose run --rm milaidy-cli \
|
|
336
|
+
node /app/node_modules/playwright-core/cli.js install chromium
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
To persist browser downloads, set `PLAYWRIGHT_BROWSERS_PATH` (for example,
|
|
340
|
+
`/home/node/.cache/ms-playwright`) and make sure `/home/node` is persisted via
|
|
341
|
+
`MILAIDY_HOME_VOLUME` or a bind mount. See [Docker](/install/docker).
|
|
342
|
+
|
|
343
|
+
## How it works (internal)
|
|
344
|
+
|
|
345
|
+
High-level flow:
|
|
346
|
+
|
|
347
|
+
- A small **control server** accepts HTTP requests.
|
|
348
|
+
- It connects to Chromium-based browsers (Chrome/Brave/Edge/Chromium) via **CDP**.
|
|
349
|
+
- For advanced actions (click/type/snapshot/PDF), it uses **Playwright** on top
|
|
350
|
+
of CDP.
|
|
351
|
+
- When Playwright is missing, only non-Playwright operations are available.
|
|
352
|
+
|
|
353
|
+
This design keeps the agent on a stable, deterministic interface while letting
|
|
354
|
+
you swap local/remote browsers and profiles.
|
|
355
|
+
|
|
356
|
+
## CLI quick reference
|
|
357
|
+
|
|
358
|
+
All commands accept `--browser-profile <name>` to target a specific profile.
|
|
359
|
+
All commands also accept `--json` for machine-readable output (stable payloads).
|
|
360
|
+
|
|
361
|
+
Basics:
|
|
362
|
+
|
|
363
|
+
- `milaidy browser status`
|
|
364
|
+
- `milaidy browser start`
|
|
365
|
+
- `milaidy browser stop`
|
|
366
|
+
- `milaidy browser tabs`
|
|
367
|
+
- `milaidy browser tab`
|
|
368
|
+
- `milaidy browser tab new`
|
|
369
|
+
- `milaidy browser tab select 2`
|
|
370
|
+
- `milaidy browser tab close 2`
|
|
371
|
+
- `milaidy browser open https://example.com`
|
|
372
|
+
- `milaidy browser focus abcd1234`
|
|
373
|
+
- `milaidy browser close abcd1234`
|
|
374
|
+
|
|
375
|
+
Inspection:
|
|
376
|
+
|
|
377
|
+
- `milaidy browser screenshot`
|
|
378
|
+
- `milaidy browser screenshot --full-page`
|
|
379
|
+
- `milaidy browser screenshot --ref 12`
|
|
380
|
+
- `milaidy browser screenshot --ref e12`
|
|
381
|
+
- `milaidy browser snapshot`
|
|
382
|
+
- `milaidy browser snapshot --format aria --limit 200`
|
|
383
|
+
- `milaidy browser snapshot --interactive --compact --depth 6`
|
|
384
|
+
- `milaidy browser snapshot --efficient`
|
|
385
|
+
- `milaidy browser snapshot --labels`
|
|
386
|
+
- `milaidy browser snapshot --selector "#main" --interactive`
|
|
387
|
+
- `milaidy browser snapshot --frame "iframe#main" --interactive`
|
|
388
|
+
- `milaidy browser console --level error`
|
|
389
|
+
- `milaidy browser errors --clear`
|
|
390
|
+
- `milaidy browser requests --filter api --clear`
|
|
391
|
+
- `milaidy browser pdf`
|
|
392
|
+
- `milaidy browser responsebody "**/api" --max-chars 5000`
|
|
393
|
+
|
|
394
|
+
Actions:
|
|
395
|
+
|
|
396
|
+
- `milaidy browser navigate https://example.com`
|
|
397
|
+
- `milaidy browser resize 1280 720`
|
|
398
|
+
- `milaidy browser click 12 --double`
|
|
399
|
+
- `milaidy browser click e12 --double`
|
|
400
|
+
- `milaidy browser type 23 "hello" --submit`
|
|
401
|
+
- `milaidy browser press Enter`
|
|
402
|
+
- `milaidy browser hover 44`
|
|
403
|
+
- `milaidy browser scrollintoview e12`
|
|
404
|
+
- `milaidy browser drag 10 11`
|
|
405
|
+
- `milaidy browser select 9 OptionA OptionB`
|
|
406
|
+
- `milaidy browser download e12 /tmp/report.pdf`
|
|
407
|
+
- `milaidy browser waitfordownload /tmp/report.pdf`
|
|
408
|
+
- `milaidy browser upload /tmp/file.pdf`
|
|
409
|
+
- `milaidy browser fill --fields '[{"ref":"1","type":"text","value":"Ada"}]'`
|
|
410
|
+
- `milaidy browser dialog --accept`
|
|
411
|
+
- `milaidy browser wait --text "Done"`
|
|
412
|
+
- `milaidy browser wait "#main" --url "**/dash" --load networkidle --fn "window.ready===true"`
|
|
413
|
+
- `milaidy browser evaluate --fn '(el) => el.textContent' --ref 7`
|
|
414
|
+
- `milaidy browser highlight e12`
|
|
415
|
+
- `milaidy browser trace start`
|
|
416
|
+
- `milaidy browser trace stop`
|
|
417
|
+
|
|
418
|
+
State:
|
|
419
|
+
|
|
420
|
+
- `milaidy browser cookies`
|
|
421
|
+
- `milaidy browser cookies set session abc123 --url "https://example.com"`
|
|
422
|
+
- `milaidy browser cookies clear`
|
|
423
|
+
- `milaidy browser storage local get`
|
|
424
|
+
- `milaidy browser storage local set theme dark`
|
|
425
|
+
- `milaidy browser storage session clear`
|
|
426
|
+
- `milaidy browser set offline on`
|
|
427
|
+
- `milaidy browser set headers --json '{"X-Debug":"1"}'`
|
|
428
|
+
- `milaidy browser set credentials user pass`
|
|
429
|
+
- `milaidy browser set credentials --clear`
|
|
430
|
+
- `milaidy browser set geo 37.7749 -122.4194 --origin "https://example.com"`
|
|
431
|
+
- `milaidy browser set geo --clear`
|
|
432
|
+
- `milaidy browser set media dark`
|
|
433
|
+
- `milaidy browser set timezone America/New_York`
|
|
434
|
+
- `milaidy browser set locale en-US`
|
|
435
|
+
- `milaidy browser set device "iPhone 14"`
|
|
436
|
+
|
|
437
|
+
Notes:
|
|
438
|
+
|
|
439
|
+
- `upload` and `dialog` are **arming** calls; run them before the click/press
|
|
440
|
+
that triggers the chooser/dialog.
|
|
441
|
+
- `upload` can also set file inputs directly via `--input-ref` or `--element`.
|
|
442
|
+
- `snapshot`:
|
|
443
|
+
- `--format ai` (default when Playwright is installed): returns an AI snapshot with numeric refs (`aria-ref="<n>"`).
|
|
444
|
+
- `--format aria`: returns the accessibility tree (no refs; inspection only).
|
|
445
|
+
- `--efficient` (or `--mode efficient`): compact role snapshot preset (interactive + compact + depth + lower maxChars).
|
|
446
|
+
- Config default (tool/CLI only): set `browser.snapshotDefaults.mode: "efficient"` to use efficient snapshots when the caller does not pass a mode (see [Gateway configuration](/gateway/configuration#browser-milaidy-managed-browser)).
|
|
447
|
+
- Role snapshot options (`--interactive`, `--compact`, `--depth`, `--selector`) force a role-based snapshot with refs like `ref=e12`.
|
|
448
|
+
- `--frame "<iframe selector>"` scopes role snapshots to an iframe (pairs with role refs like `e12`).
|
|
449
|
+
- `--interactive` outputs a flat, easy-to-pick list of interactive elements (best for driving actions).
|
|
450
|
+
- `--labels` adds a viewport-only screenshot with overlayed ref labels (prints `MEDIA:<path>`).
|
|
451
|
+
- `click`/`type`/etc require a `ref` from `snapshot` (either numeric `12` or role ref `e12`).
|
|
452
|
+
CSS selectors are intentionally not supported for actions.
|
|
453
|
+
|
|
454
|
+
## Snapshots and refs
|
|
455
|
+
|
|
456
|
+
Milaidy supports two “snapshot” styles:
|
|
457
|
+
|
|
458
|
+
- **AI snapshot (numeric refs)**: `milaidy browser snapshot` (default; `--format ai`)
|
|
459
|
+
- Output: a text snapshot that includes numeric refs.
|
|
460
|
+
- Actions: `milaidy browser click 12`, `milaidy browser type 23 "hello"`.
|
|
461
|
+
- Internally, the ref is resolved via Playwright’s `aria-ref`.
|
|
462
|
+
|
|
463
|
+
- **Role snapshot (role refs like `e12`)**: `milaidy browser snapshot --interactive` (or `--compact`, `--depth`, `--selector`, `--frame`)
|
|
464
|
+
- Output: a role-based list/tree with `[ref=e12]` (and optional `[nth=1]`).
|
|
465
|
+
- Actions: `milaidy browser click e12`, `milaidy browser highlight e12`.
|
|
466
|
+
- Internally, the ref is resolved via `getByRole(...)` (plus `nth()` for duplicates).
|
|
467
|
+
- Add `--labels` to include a viewport screenshot with overlayed `e12` labels.
|
|
468
|
+
|
|
469
|
+
Ref behavior:
|
|
470
|
+
|
|
471
|
+
- Refs are **not stable across navigations**; if something fails, re-run `snapshot` and use a fresh ref.
|
|
472
|
+
- If the role snapshot was taken with `--frame`, role refs are scoped to that iframe until the next role snapshot.
|
|
473
|
+
|
|
474
|
+
## Wait power-ups
|
|
475
|
+
|
|
476
|
+
You can wait on more than just time/text:
|
|
477
|
+
|
|
478
|
+
- Wait for URL (globs supported by Playwright):
|
|
479
|
+
- `milaidy browser wait --url "**/dash"`
|
|
480
|
+
- Wait for load state:
|
|
481
|
+
- `milaidy browser wait --load networkidle`
|
|
482
|
+
- Wait for a JS predicate:
|
|
483
|
+
- `milaidy browser wait --fn "window.ready===true"`
|
|
484
|
+
- Wait for a selector to become visible:
|
|
485
|
+
- `milaidy browser wait "#main"`
|
|
486
|
+
|
|
487
|
+
These can be combined:
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
milaidy browser wait "#main" \
|
|
491
|
+
--url "**/dash" \
|
|
492
|
+
--load networkidle \
|
|
493
|
+
--fn "window.ready===true" \
|
|
494
|
+
--timeout-ms 15000
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
## Debug workflows
|
|
498
|
+
|
|
499
|
+
When an action fails (e.g. “not visible”, “strict mode violation”, “covered”):
|
|
500
|
+
|
|
501
|
+
1. `milaidy browser snapshot --interactive`
|
|
502
|
+
2. Use `click <ref>` / `type <ref>` (prefer role refs in interactive mode)
|
|
503
|
+
3. If it still fails: `milaidy browser highlight <ref>` to see what Playwright is targeting
|
|
504
|
+
4. If the page behaves oddly:
|
|
505
|
+
- `milaidy browser errors --clear`
|
|
506
|
+
- `milaidy browser requests --filter api --clear`
|
|
507
|
+
5. For deep debugging: record a trace:
|
|
508
|
+
- `milaidy browser trace start`
|
|
509
|
+
- reproduce the issue
|
|
510
|
+
- `milaidy browser trace stop` (prints `TRACE:<path>`)
|
|
511
|
+
|
|
512
|
+
## JSON output
|
|
513
|
+
|
|
514
|
+
`--json` is for scripting and structured tooling.
|
|
515
|
+
|
|
516
|
+
Examples:
|
|
517
|
+
|
|
518
|
+
```bash
|
|
519
|
+
milaidy browser status --json
|
|
520
|
+
milaidy browser snapshot --interactive --json
|
|
521
|
+
milaidy browser requests --filter api --json
|
|
522
|
+
milaidy browser cookies --json
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
Role snapshots in JSON include `refs` plus a small `stats` block (lines/chars/refs/interactive) so tools can reason about payload size and density.
|
|
526
|
+
|
|
527
|
+
## State and environment knobs
|
|
528
|
+
|
|
529
|
+
These are useful for “make the site behave like X” workflows:
|
|
530
|
+
|
|
531
|
+
- Cookies: `cookies`, `cookies set`, `cookies clear`
|
|
532
|
+
- Storage: `storage local|session get|set|clear`
|
|
533
|
+
- Offline: `set offline on|off`
|
|
534
|
+
- Headers: `set headers --json '{"X-Debug":"1"}'` (or `--clear`)
|
|
535
|
+
- HTTP basic auth: `set credentials user pass` (or `--clear`)
|
|
536
|
+
- Geolocation: `set geo <lat> <lon> --origin "https://example.com"` (or `--clear`)
|
|
537
|
+
- Media: `set media dark|light|no-preference|none`
|
|
538
|
+
- Timezone / locale: `set timezone ...`, `set locale ...`
|
|
539
|
+
- Device / viewport:
|
|
540
|
+
- `set device "iPhone 14"` (Playwright device presets)
|
|
541
|
+
- `set viewport 1280 720`
|
|
542
|
+
|
|
543
|
+
## Security & privacy
|
|
544
|
+
|
|
545
|
+
- The milaidy browser profile may contain logged-in sessions; treat it as sensitive.
|
|
546
|
+
- `browser act kind=evaluate` / `milaidy browser evaluate` and `wait --fn`
|
|
547
|
+
execute arbitrary JavaScript in the page context. Prompt injection can steer
|
|
548
|
+
this. Disable it with `browser.evaluateEnabled=false` if you do not need it.
|
|
549
|
+
- For logins and anti-bot notes (X/Twitter, etc.), see [Browser login + X/Twitter posting](/tools/browser-login).
|
|
550
|
+
- Keep the Gateway/node host private (loopback or tailnet-only).
|
|
551
|
+
- Remote CDP endpoints are powerful; tunnel and protect them.
|
|
552
|
+
|
|
553
|
+
## Troubleshooting
|
|
554
|
+
|
|
555
|
+
For Linux-specific issues (especially snap Chromium), see
|
|
556
|
+
[Browser troubleshooting](/tools/browser-linux-troubleshooting).
|
|
557
|
+
|
|
558
|
+
## Agent tools + how control works
|
|
559
|
+
|
|
560
|
+
The agent gets **one tool** for browser automation:
|
|
561
|
+
|
|
562
|
+
- `browser` — status/start/stop/tabs/open/focus/close/snapshot/screenshot/navigate/act
|
|
563
|
+
|
|
564
|
+
How it maps:
|
|
565
|
+
|
|
566
|
+
- `browser snapshot` returns a stable UI tree (AI or ARIA).
|
|
567
|
+
- `browser act` uses the snapshot `ref` IDs to click/type/drag/select.
|
|
568
|
+
- `browser screenshot` captures pixels (full page or element).
|
|
569
|
+
- `browser` accepts:
|
|
570
|
+
- `profile` to choose a named browser profile (milaidy, chrome, or remote CDP).
|
|
571
|
+
- `target` (`sandbox` | `host` | `node`) to select where the browser lives.
|
|
572
|
+
- In sandboxed sessions, `target: "host"` requires `agents.defaults.sandbox.browser.allowHostControl=true`.
|
|
573
|
+
- If `target` is omitted: sandboxed sessions default to `sandbox`, non-sandbox sessions default to `host`.
|
|
574
|
+
- If a browser-capable node is connected, the tool may auto-route to it unless you pin `target="host"` or `target="node"`.
|
|
575
|
+
|
|
576
|
+
This keeps the agent deterministic and avoids brittle selectors.
|