surfagent 1.2.0 → 1.2.1
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/cli.js +9 -2
- package/package.json +1 -1
- package/src/cli.ts +8 -2
package/dist/cli.js
CHANGED
|
@@ -28,6 +28,12 @@ function detectOS() {
|
|
|
28
28
|
return 'linux';
|
|
29
29
|
}
|
|
30
30
|
function getChromePath() {
|
|
31
|
+
if (process.env.BROWSER_PATH) {
|
|
32
|
+
if (fs.existsSync(process.env.BROWSER_PATH))
|
|
33
|
+
return process.env.BROWSER_PATH;
|
|
34
|
+
console.error(`[surfagent] BROWSER_PATH set but not found: ${process.env.BROWSER_PATH}`);
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
31
37
|
const os = detectOS();
|
|
32
38
|
const paths = {
|
|
33
39
|
mac: [
|
|
@@ -118,6 +124,7 @@ Usage:
|
|
|
118
124
|
Environment variables:
|
|
119
125
|
CDP_PORT Chrome debug port (default: 9222)
|
|
120
126
|
API_PORT API server port (default: 3456)
|
|
127
|
+
BROWSER_PATH Path to any Chromium-based browser (Arc, Brave, Edge, etc.)
|
|
121
128
|
CHROME_USER_DATA_DIR Chrome profile directory (default: /tmp/surfagent-chrome)
|
|
122
129
|
|
|
123
130
|
After starting, your AI agent can call http://localhost:3456
|
|
@@ -148,7 +155,7 @@ Full API docs: https://github.com/AllAboutAI-YT/surfagent#readme
|
|
|
148
155
|
}
|
|
149
156
|
const chromePath = getChromePath();
|
|
150
157
|
if (!chromePath) {
|
|
151
|
-
console.error('[surfagent] Chrome not found. Install Google Chrome
|
|
158
|
+
console.error('[surfagent] Chrome not found. Install Google Chrome or set BROWSER_PATH to a Chromium-based browser.');
|
|
152
159
|
process.exit(1);
|
|
153
160
|
}
|
|
154
161
|
startChrome(chromePath);
|
|
@@ -179,7 +186,7 @@ Full API docs: https://github.com/AllAboutAI-YT/surfagent#readme
|
|
|
179
186
|
else {
|
|
180
187
|
const chromePath = getChromePath();
|
|
181
188
|
if (!chromePath) {
|
|
182
|
-
console.error('[surfagent] Chrome not found. Install Google Chrome
|
|
189
|
+
console.error('[surfagent] Chrome not found. Install Google Chrome or set BROWSER_PATH to a Chromium-based browser.');
|
|
183
190
|
process.exit(1);
|
|
184
191
|
}
|
|
185
192
|
startChrome(chromePath);
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -32,6 +32,11 @@ function detectOS(): 'mac' | 'linux' | 'windows' {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
function getChromePath(): string | null {
|
|
35
|
+
if (process.env.BROWSER_PATH) {
|
|
36
|
+
if (fs.existsSync(process.env.BROWSER_PATH)) return process.env.BROWSER_PATH;
|
|
37
|
+
console.error(`[surfagent] BROWSER_PATH set but not found: ${process.env.BROWSER_PATH}`);
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
35
40
|
const os = detectOS();
|
|
36
41
|
const paths: Record<string, string[]> = {
|
|
37
42
|
mac: [
|
|
@@ -127,6 +132,7 @@ Usage:
|
|
|
127
132
|
Environment variables:
|
|
128
133
|
CDP_PORT Chrome debug port (default: 9222)
|
|
129
134
|
API_PORT API server port (default: 3456)
|
|
135
|
+
BROWSER_PATH Path to any Chromium-based browser (Arc, Brave, Edge, etc.)
|
|
130
136
|
CHROME_USER_DATA_DIR Chrome profile directory (default: /tmp/surfagent-chrome)
|
|
131
137
|
|
|
132
138
|
After starting, your AI agent can call http://localhost:3456
|
|
@@ -159,7 +165,7 @@ Full API docs: https://github.com/AllAboutAI-YT/surfagent#readme
|
|
|
159
165
|
|
|
160
166
|
const chromePath = getChromePath();
|
|
161
167
|
if (!chromePath) {
|
|
162
|
-
console.error('[surfagent] Chrome not found. Install Google Chrome
|
|
168
|
+
console.error('[surfagent] Chrome not found. Install Google Chrome or set BROWSER_PATH to a Chromium-based browser.');
|
|
163
169
|
process.exit(1);
|
|
164
170
|
}
|
|
165
171
|
|
|
@@ -193,7 +199,7 @@ Full API docs: https://github.com/AllAboutAI-YT/surfagent#readme
|
|
|
193
199
|
} else {
|
|
194
200
|
const chromePath = getChromePath();
|
|
195
201
|
if (!chromePath) {
|
|
196
|
-
console.error('[surfagent] Chrome not found. Install Google Chrome
|
|
202
|
+
console.error('[surfagent] Chrome not found. Install Google Chrome or set BROWSER_PATH to a Chromium-based browser.');
|
|
197
203
|
process.exit(1);
|
|
198
204
|
}
|
|
199
205
|
startChrome(chromePath);
|