@hamp10/agentforge 0.2.17 → 0.2.18
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/bin/agentforge.js +10 -0
- package/package.json +1 -1
- package/src/hampagent/browser.js +5 -5
package/bin/agentforge.js
CHANGED
|
@@ -967,6 +967,16 @@ fi
|
|
|
967
967
|
--disable-sync \\
|
|
968
968
|
--disable-component-update \\
|
|
969
969
|
--safebrowsing-disable-auto-update \\
|
|
970
|
+
--disable-background-networking \\
|
|
971
|
+
--disable-background-timer-throttling \\
|
|
972
|
+
--disable-backgrounding-occluded-windows \\
|
|
973
|
+
--disable-renderer-backgrounding \\
|
|
974
|
+
--disable-features=TranslateUI,BlinkGenPropertyTrees \\
|
|
975
|
+
--disable-ipc-flooding-protection \\
|
|
976
|
+
--disable-hang-monitor \\
|
|
977
|
+
--disable-prompt-on-repost \\
|
|
978
|
+
--metrics-recording-only \\
|
|
979
|
+
--no-pings \\
|
|
970
980
|
"$@"
|
|
971
981
|
`);
|
|
972
982
|
fs.chmodSync(execPath, 0o755);
|
package/package.json
CHANGED
package/src/hampagent/browser.js
CHANGED
|
@@ -151,7 +151,8 @@ export async function browserAction(input) {
|
|
|
151
151
|
const page = await getPage();
|
|
152
152
|
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });
|
|
153
153
|
_activePage = page;
|
|
154
|
-
|
|
154
|
+
// Wait for network to quiet down (max 2s) instead of a fixed sleep
|
|
155
|
+
try { await page.waitForNetworkIdle({ idleTime: 300, timeout: 2000 }); } catch {}
|
|
155
156
|
return await _snapshot(page);
|
|
156
157
|
}
|
|
157
158
|
|
|
@@ -166,8 +167,7 @@ export async function browserAction(input) {
|
|
|
166
167
|
}
|
|
167
168
|
if (!target) return `Tab not found. Available tabs:\n${open.map((p,i) => `[${i}] ${p.url()}`).join('\n')}`;
|
|
168
169
|
await target.bringToFront();
|
|
169
|
-
_activePage = target;
|
|
170
|
-
await _wait(300);
|
|
170
|
+
_activePage = target;
|
|
171
171
|
return await _snapshot(target);
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -215,8 +215,8 @@ export async function browserAction(input) {
|
|
|
215
215
|
: `No visible element found matching "${input.text || input.selector}"`;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
// Wait for
|
|
219
|
-
await
|
|
218
|
+
// Wait for dynamic content to settle — use network idle (max 1.5s) not a fixed sleep
|
|
219
|
+
try { await page.waitForNetworkIdle({ idleTime: 200, timeout: 1500 }); } catch {}
|
|
220
220
|
|
|
221
221
|
// Always return a fresh snapshot after clicking so agent immediately sees what changed
|
|
222
222
|
const snap = await _snapshot(page);
|