gm-gc 2.0.233 → 2.0.235
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/gemini-extension.json +1 -1
- package/hooks/pre-tool-use-hook.js +14 -4
- package/package.json +1 -1
package/gemini-extension.json
CHANGED
|
@@ -296,10 +296,12 @@ const run = () => {
|
|
|
296
296
|
let out = stripFooter((r.stdout || '') + (r.stderr || ''));
|
|
297
297
|
const bg = out.match(/Task ID:\s*(task_\S+)/);
|
|
298
298
|
if (bg) {
|
|
299
|
-
runGmExec(['sleep', bg[1], '
|
|
299
|
+
runGmExec(['sleep', bg[1], '15'], { timeout: 25000 });
|
|
300
300
|
const sr = runGmExec(['status', bg[1]], { timeout: 15000 });
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
const statusOut = stripFooter((sr.stdout || '') + (sr.stderr || ''));
|
|
302
|
+
const stillRunning = /Status:\s*running/i.test(statusOut);
|
|
303
|
+
out = statusOut;
|
|
304
|
+
if (!stillRunning) runGmExec(['close', bg[1]], { timeout: 10000 });
|
|
303
305
|
}
|
|
304
306
|
return out;
|
|
305
307
|
};
|
|
@@ -368,7 +370,15 @@ const run = () => {
|
|
|
368
370
|
} else if (lang === 'agent-browser') {
|
|
369
371
|
// agent-browser reads agent-browser.json from cwd automatically (headed, profile, session, etc.)
|
|
370
372
|
// Just run with shell:true so .cmd wrappers resolve, and use process.cwd() so config is picked up
|
|
371
|
-
const
|
|
373
|
+
const abNative = (() => {
|
|
374
|
+
const abDir = path.join(TOOLS_DIR, 'node_modules', 'agent-browser', 'bin');
|
|
375
|
+
const ext = IS_WIN ? '.exe' : '';
|
|
376
|
+
const archMap = { x64: 'x64', arm64: 'arm64', ia32: 'x64' };
|
|
377
|
+
const osMap = { win32: 'win32', darwin: 'darwin', linux: 'linux' };
|
|
378
|
+
const candidate = path.join(abDir, `agent-browser-${osMap[process.platform] || process.platform}-${archMap[process.arch] || process.arch}${ext}`);
|
|
379
|
+
return fs.existsSync(candidate) ? candidate : null;
|
|
380
|
+
})();
|
|
381
|
+
const abBin = abNative || (fs.existsSync(localBin('agent-browser')) ? localBin('agent-browser') : 'agent-browser');
|
|
372
382
|
const AB_CMDS = new Set(['open','goto','navigate','close','quit','exit','back','forward','reload','click','dblclick','type','fill','press','check','uncheck','select','drag','upload','hover','focus','scroll','scrollintoview','wait','screenshot','pdf','snapshot','get','is','find','eval','connect','tab','frame','dialog','state','session','network','cookies','storage','set','trace','profiler','record','console','errors','highlight','inspect','diff','keyboard','mouse','install','upgrade','confirm','deny','auth','device','window']);
|
|
373
383
|
const AB_GLOBAL_FLAGS = new Set(['--cdp','--headed','--headless','--session','--session-name','--auto-connect','--profile','--allow-file-access','--color-scheme','-p','--platform','--device']);
|
|
374
384
|
const AB_GLOBAL_FLAGS_WITH_VALUE = new Set(['--cdp','--session','--session-name','--profile','--color-scheme','-p','--platform','--device']);
|