agent-browser 0.20.6 → 0.20.7

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-browser",
3
- "version": "0.20.6",
3
+ "version": "0.20.7",
4
4
  "description": "Headless browser automation CLI for AI agents",
5
5
  "type": "module",
6
6
  "files": [
@@ -128,15 +128,60 @@ async function main() {
128
128
  showInstallReminder();
129
129
  }
130
130
 
131
+ function findSystemChrome() {
132
+ const os = platform();
133
+ if (os === 'darwin') {
134
+ const candidates = [
135
+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
136
+ '/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary',
137
+ '/Applications/Chromium.app/Contents/MacOS/Chromium',
138
+ ];
139
+ return candidates.find(p => existsSync(p)) || null;
140
+ }
141
+ if (os === 'linux') {
142
+ const names = ['google-chrome', 'google-chrome-stable', 'chromium-browser', 'chromium'];
143
+ for (const name of names) {
144
+ try {
145
+ const result = execSync(`which ${name} 2>/dev/null`, { encoding: 'utf8' }).trim();
146
+ if (result) return result;
147
+ } catch {}
148
+ }
149
+ return null;
150
+ }
151
+ if (os === 'win32') {
152
+ const candidates = [
153
+ `${process.env.LOCALAPPDATA}\\Google\\Chrome\\Application\\chrome.exe`,
154
+ 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
155
+ 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
156
+ ];
157
+ return candidates.find(p => p && existsSync(p)) || null;
158
+ }
159
+ return null;
160
+ }
161
+
131
162
  function showInstallReminder() {
163
+ const systemChrome = findSystemChrome();
164
+ if (systemChrome) {
165
+ console.log('');
166
+ console.log(` ✓ System Chrome found: ${systemChrome}`);
167
+ console.log(' agent-browser will use it automatically.');
168
+ console.log('');
169
+ return;
170
+ }
171
+
132
172
  console.log('');
133
- console.log(' To download Chrome, run:');
173
+ console.log(' No Chrome installation detected.');
174
+ console.log(' If you plan to use a local browser, run:');
134
175
  console.log('');
135
176
  console.log(' agent-browser install');
177
+ if (platform() === 'linux') {
178
+ console.log('');
179
+ console.log(' On Linux, include system dependencies with:');
180
+ console.log('');
181
+ console.log(' agent-browser install --with-deps');
182
+ }
136
183
  console.log('');
137
- console.log(' On Linux, include system dependencies with:');
138
- console.log('');
139
- console.log(' agent-browser install --with-deps');
184
+ console.log(' You can skip this if you use --cdp, --provider, --engine, or --executable-path.');
140
185
  console.log('');
141
186
  }
142
187