@canaryai/cli 0.2.15 → 0.2.16

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.
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __cr } from "module"; const require = __cr(import.meta.url);
2
2
  import {
3
3
  PlaywrightClient
4
- } from "./chunk-ZYUOJQQX.js";
4
+ } from "./chunk-WOVAMA3N.js";
5
5
 
6
6
  // src/local-browser/host.ts
7
7
  var HEARTBEAT_INTERVAL_MS = 3e4;
@@ -384,4 +384,4 @@ var LocalBrowserHost = class {
384
384
  export {
385
385
  LocalBrowserHost
386
386
  };
387
- //# sourceMappingURL=chunk-W3OTKNJB.js.map
387
+ //# sourceMappingURL=chunk-MKE3V6GC.js.map
@@ -40154,8 +40154,19 @@ function buildSection(element, depth) {
40154
40154
  function markBackgroundSections(sections) {
40155
40155
  const hasActiveSibling = sections.some((s) => s.containsActive);
40156
40156
  if (hasActiveSibling) {
40157
- for (const section of sections) {
40157
+ let lastActiveIndex = -1;
40158
+ for (let i = sections.length - 1; i >= 0; i--) {
40159
+ if (sections[i].containsActive) {
40160
+ lastActiveIndex = i;
40161
+ break;
40162
+ }
40163
+ }
40164
+ for (let i = 0; i < sections.length; i++) {
40165
+ const section = sections[i];
40158
40166
  if (!section.containsActive) {
40167
+ if (DIALOG_ROLES.has(section.role) && i > lastActiveIndex) {
40168
+ continue;
40169
+ }
40159
40170
  section.isBackground = true;
40160
40171
  section.collapsed = shouldCollapse(section);
40161
40172
  }
@@ -46039,7 +46050,8 @@ var PlaywrightClient = class _PlaywrightClient {
46039
46050
  highlightInteractions,
46040
46051
  cursorOverlay,
46041
46052
  extraHTTPHeaders,
46042
- httpCredentials
46053
+ httpCredentials,
46054
+ proxy
46043
46055
  } = options;
46044
46056
  const resolvedBrowserMode = browserMode ?? "headless";
46045
46057
  const resolvedViewport = viewport ?? DEFAULT_VIEWPORT;
@@ -46053,7 +46065,8 @@ var PlaywrightClient = class _PlaywrightClient {
46053
46065
  highlightInteractions,
46054
46066
  cursorOverlay,
46055
46067
  extraHTTPHeaders,
46056
- httpCredentials
46068
+ httpCredentials,
46069
+ proxy
46057
46070
  };
46058
46071
  this.storageStatePath = storageStatePath;
46059
46072
  this.pageClosedIntentionally = false;
@@ -46157,7 +46170,8 @@ var PlaywrightClient = class _PlaywrightClient {
46157
46170
  stealth,
46158
46171
  extensions,
46159
46172
  extraHTTPHeaders,
46160
- httpCredentials
46173
+ httpCredentials,
46174
+ proxy
46161
46175
  }),
46162
46176
  {
46163
46177
  logger: this.logger,
@@ -46338,7 +46352,8 @@ var PlaywrightClient = class _PlaywrightClient {
46338
46352
  stealth,
46339
46353
  extensions,
46340
46354
  extraHTTPHeaders,
46341
- httpCredentials
46355
+ httpCredentials,
46356
+ proxy
46342
46357
  } = options;
46343
46358
  const resolvedViewport = viewport ?? DEFAULT_VIEWPORT;
46344
46359
  const useStealthMode = stealth === true || typeof stealth === "object" && stealth.enabled;
@@ -46373,6 +46388,13 @@ var PlaywrightClient = class _PlaywrightClient {
46373
46388
  contextOptions.httpCredentials = httpCredentials;
46374
46389
  this.logger.info("[DirectPlaywright] HTTP Basic Authentication configured");
46375
46390
  }
46391
+ if (proxy) {
46392
+ this.logger.info("[DirectPlaywright] Proxy configured", {
46393
+ server: proxy.server.replace(/\/\/[^@]+@/, "//***@"),
46394
+ bypass: proxy.bypass,
46395
+ hasAuth: !!(proxy.username && proxy.password)
46396
+ });
46397
+ }
46376
46398
  if (storageStatePath) {
46377
46399
  try {
46378
46400
  await fs4.access(storageStatePath);
@@ -46415,6 +46437,7 @@ var PlaywrightClient = class _PlaywrightClient {
46415
46437
  // We use --headless=new in args for extension support
46416
46438
  args,
46417
46439
  ...executablePath ? { executablePath } : {},
46440
+ ...proxy ? { proxy } : {},
46418
46441
  ...contextOptions
46419
46442
  }),
46420
46443
  3e4,
@@ -46426,7 +46449,8 @@ var PlaywrightClient = class _PlaywrightClient {
46426
46449
  chromiumLauncher.launch({
46427
46450
  headless: browserMode === "headless",
46428
46451
  args,
46429
- ...executablePath ? { executablePath } : {}
46452
+ ...executablePath ? { executablePath } : {},
46453
+ ...proxy ? { proxy } : {}
46430
46454
  }),
46431
46455
  3e4,
46432
46456
  "[DirectPlaywright] chromium.launch"
@@ -49539,4 +49563,4 @@ playwright-extra/dist/index.esm.js:
49539
49563
  * @license MIT
49540
49564
  *)
49541
49565
  */
49542
- //# sourceMappingURL=chunk-ZYUOJQQX.js.map
49566
+ //# sourceMappingURL=chunk-WOVAMA3N.js.map