@q-agent/agent 0.1.10 → 0.1.11

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.
@@ -854,7 +854,12 @@ async function processExplorationJob(cfg, session) {
854
854
  const args = [script, session.baseUrl];
855
855
  if (storageState)
856
856
  args.push(storageState);
857
- const child = (0, child_process_1.spawn)((0, paths_1.nodeBin)(), args, { cwd: nm, env: nodePathEnv(nm) });
857
+ // Run the explore browser HEADED on the paired device: the user watches the
858
+ // session, and a headed browser dodges WAF/bot-protection that blocks headless.
859
+ const child = (0, child_process_1.spawn)((0, paths_1.nodeBin)(), args, {
860
+ cwd: nm,
861
+ env: { ...nodePathEnv(nm), QAGENT_EXPLORE_HEADED: "1" },
862
+ });
858
863
  activeChild = child;
859
864
  // Capture the driver's stderr so a launch failure (missing browser, bad
860
865
  // Playwright resolution, …) is visible instead of a silent "complete".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q-agent/agent",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Q-Agent Local Agent — claims execution jobs from the Q-Agent server and runs Playwright locally, so manual login/MFA happens on the user's own machine and session credentials never leave it.",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -159,7 +159,10 @@ async function handle(line) {
159
159
 
160
160
  (async () => {
161
161
  if (!baseURL) { console.error('explore_session: missing baseURL arg'); process.exit(1); }
162
- browser = await chromium.launch({ headless: true });
162
+ // Headed when QAGENT_EXPLORE_HEADED=1 (the Local Agent sets it so the user can
163
+ // watch, and a headed browser trips WAF/bot-protection far less than headless);
164
+ // headless otherwise (e.g. the server, which has no display).
165
+ browser = await chromium.launch({ headless: process.env.QAGENT_EXPLORE_HEADED !== '1' });
163
166
  const contextOpts = { baseURL };
164
167
  if (storageState) contextOpts.storageState = storageState;
165
168
  const context = await browser.newContext(contextOpts);