opensteer 0.9.3 → 0.9.5

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.
Files changed (38) hide show
  1. package/README.md +158 -165
  2. package/dist/{chunk-UM2Q4JD2.js → chunk-7D45QUZ3.js} +5 -7
  3. package/dist/chunk-7D45QUZ3.js.map +1 -0
  4. package/dist/{chunk-GREXSYNC.js → chunk-7LQL5YUR.js} +578 -224
  5. package/dist/chunk-7LQL5YUR.js.map +1 -0
  6. package/dist/{chunk-2TIVULZY.js → chunk-GSCQQKZZ.js} +53 -9
  7. package/dist/chunk-GSCQQKZZ.js.map +1 -0
  8. package/dist/{chunk-BMPUL66S.js → chunk-T5P2QGZ3.js} +58 -53
  9. package/dist/chunk-T5P2QGZ3.js.map +1 -0
  10. package/dist/{chunk-FIMNKEG5.js → chunk-ZRF7WMS3.js} +4 -4
  11. package/dist/{chunk-FIMNKEG5.js.map → chunk-ZRF7WMS3.js.map} +1 -1
  12. package/dist/cli/bin.cjs +707 -278
  13. package/dist/cli/bin.cjs.map +1 -1
  14. package/dist/cli/bin.js +30 -34
  15. package/dist/cli/bin.js.map +1 -1
  16. package/dist/index.cjs +733 -473
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +25 -460
  19. package/dist/index.d.ts +25 -460
  20. package/dist/index.js +4 -5
  21. package/dist/local-view/serve-entry.cjs +106 -57
  22. package/dist/local-view/serve-entry.cjs.map +1 -1
  23. package/dist/local-view/serve-entry.js +2 -2
  24. package/dist/opensteer-T2JENADR.js +6 -0
  25. package/dist/{opensteer-IBDPRIEX.js.map → opensteer-T2JENADR.js.map} +1 -1
  26. package/dist/{session-control-IFE3IPS3.js → session-control-M3JD7ZKA.js} +4 -4
  27. package/dist/{session-control-IFE3IPS3.js.map → session-control-M3JD7ZKA.js.map} +1 -1
  28. package/package.json +6 -6
  29. package/skills/opensteer/SKILL.md +134 -95
  30. package/skills/recorder/SKILL.md +43 -48
  31. package/dist/chunk-2TIVULZY.js.map +0 -1
  32. package/dist/chunk-BMPUL66S.js.map +0 -1
  33. package/dist/chunk-GREXSYNC.js.map +0 -1
  34. package/dist/chunk-KCINASQC.js +0 -3
  35. package/dist/chunk-KCINASQC.js.map +0 -1
  36. package/dist/chunk-UM2Q4JD2.js.map +0 -1
  37. package/dist/opensteer-IBDPRIEX.js +0 -6
  38. package/skills/recorder/references/recorder-reference.md +0 -71
package/dist/index.js CHANGED
@@ -1,7 +1,6 @@
1
- import './chunk-KCINASQC.js';
2
- export { Opensteer } from './chunk-UM2Q4JD2.js';
3
- export { CloudSessionProxy, DEFERRED_MATCH_ATTR_KEYS, ElementPathError, MATCH_ATTRIBUTE_PRIORITY, OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL, OpensteerCloudClient, OpensteerRuntime, OpensteerSessionRuntime, STABLE_PRIMARY_ATTR_KEYS, assertProviderSupportsEngine, buildArrayFieldPathCandidates, buildDomDescriptorKey, buildDomDescriptorPayload, buildDomDescriptorVersion, buildPathCandidates, buildPathSelectorHint, buildSegmentSelector, cloneElementPath, cloneReplayElementPath, cloneStructuralElementAnchor, createDomDescriptorStore, createDomRuntime, createOpensteerExtractionDescriptorStore, createOpensteerSemanticRuntime, defaultFallbackPolicy, defaultPolicy, defaultRetryPolicy, defaultSettlePolicy, defaultTimeoutPolicy, delayWithSignal, dispatchSemanticOperation, hashDomDescriptorPersist, isCurrentUrlField, isValidCssAttributeKey, normalizeExtractedValue, normalizeOpensteerProviderMode, parseDomDescriptorRecord, parseExtractionDescriptorRecord, resolveCloudConfig, resolveDomActionBridge, resolveExtractedValueInContext, resolveOpensteerProvider, resolveOpensteerRuntimeConfig, runWithPolicyTimeout, sanitizeElementPath, sanitizeReplayElementPath, sanitizeStructuralElementAnchor, settleWithPolicy, shouldKeepAttributeForPath } from './chunk-GREXSYNC.js';
4
- export { DEFAULT_OPENSTEER_ENGINE, OPENSTEER_ENGINE_NAMES, OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT, OPENSTEER_FILESYSTEM_WORKSPACE_VERSION, OpensteerBrowserManager, createArtifactStore, createFilesystemOpensteerWorkspace, createObservationStore, manifestToExternalBinaryLocation, normalizeObservabilityConfig, normalizeOpensteerEngineName, normalizeWorkspaceId, resolveFilesystemWorkspacePath, resolveOpensteerEngineName } from './chunk-2TIVULZY.js';
5
- export { OpensteerAttachAmbiguousError, clearPersistedSessionRecord, discoverLocalCdpBrowsers, inspectCdpEndpoint, listLocalChromeProfiles, readPersistedCloudSessionRecord, readPersistedLocalBrowserSessionRecord, readPersistedSessionRecord, resolveCloudSessionRecordPath, resolveLiveSessionRecordPath, resolveLocalSessionRecordPath, writePersistedSessionRecord } from './chunk-BMPUL66S.js';
1
+ export { Opensteer } from './chunk-7D45QUZ3.js';
2
+ export { DEFERRED_MATCH_ATTR_KEYS, ElementPathError, MATCH_ATTRIBUTE_PRIORITY, OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL, OpensteerCloudClient, STABLE_PRIMARY_ATTR_KEYS, assertProviderSupportsEngine, buildArrayFieldPathCandidates, buildDomDescriptorKey, buildDomDescriptorPayload, buildDomDescriptorVersion, buildPathCandidates, buildPathSelectorHint, buildSegmentSelector, cloneElementPath, cloneReplayElementPath, cloneStructuralElementAnchor, createDomDescriptorStore, createDomRuntime, createOpensteerExtractionDescriptorStore, defaultFallbackPolicy, defaultPolicy, defaultRetryPolicy, defaultSettlePolicy, defaultTimeoutPolicy, delayWithSignal, hashDomDescriptorPersist, isCurrentUrlField, isValidCssAttributeKey, normalizeExtractedValue, normalizeOpensteerProviderMode, parseDomDescriptorRecord, parseExtractionDescriptorRecord, resolveCloudConfig, resolveDomActionBridge, resolveExtractedValueInContext, resolveOpensteerProvider, resolveOpensteerRuntimeConfig, runWithPolicyTimeout, sanitizeElementPath, sanitizeReplayElementPath, sanitizeStructuralElementAnchor, settleWithPolicy, shouldKeepAttributeForPath } from './chunk-7LQL5YUR.js';
3
+ export { DEFAULT_OPENSTEER_ENGINE, OPENSTEER_ENGINE_NAMES, OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT, OPENSTEER_FILESYSTEM_WORKSPACE_VERSION, OpensteerBrowserManager, createArtifactStore, createFilesystemOpensteerWorkspace, createObservationStore, manifestToExternalBinaryLocation, normalizeObservabilityConfig, normalizeOpensteerEngineName, normalizeWorkspaceId, resolveFilesystemWorkspacePath, resolveOpensteerEngineName } from './chunk-GSCQQKZZ.js';
4
+ export { OpensteerAttachAmbiguousError, clearPersistedSessionRecord, discoverLocalCdpBrowsers, inspectCdpEndpoint, listLocalChromeProfiles, readPersistedCloudSessionRecord, readPersistedLocalBrowserSessionRecord, readPersistedSessionRecord, resolveCloudSessionRecordPath, resolveLiveSessionRecordPath, resolveLocalSessionRecordPath, writePersistedSessionRecord } from './chunk-T5P2QGZ3.js';
6
5
  //# sourceMappingURL=index.js.map
7
6
  //# sourceMappingURL=index.js.map
@@ -647,32 +647,33 @@ var init_browser_brands = __esm({
647
647
  }
648
648
  },
649
649
  {
650
- id: "chromium",
651
- displayName: "Chromium",
650
+ id: "edge",
651
+ displayName: "Microsoft Edge",
652
652
  darwin: {
653
- executableCandidates: ["/Applications/Chromium.app/Contents/MacOS/Chromium"],
654
- userDataDir: "~/Library/Application Support/Chromium",
655
- bundleId: "org.chromium.Chromium",
656
- processNames: ["/Applications/Chromium.app/Contents/MacOS/Chromium"]
653
+ executableCandidates: ["/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"],
654
+ userDataDir: "~/Library/Application Support/Microsoft Edge",
655
+ bundleId: "com.microsoft.edgemac",
656
+ processNames: ["/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"]
657
657
  },
658
658
  win32: {
659
659
  executableCandidates: [
660
- path12.join(WINDOWS_PROGRAM_FILES, "Chromium", "Application", "chrome.exe"),
661
- path12.join(WINDOWS_PROGRAM_FILES_X86, "Chromium", "Application", "chrome.exe"),
662
- path12.join("~", "AppData", "Local", "Chromium", "Application", "chrome.exe")
660
+ path12.join(WINDOWS_PROGRAM_FILES, "Microsoft", "Edge", "Application", "msedge.exe"),
661
+ path12.join(WINDOWS_PROGRAM_FILES_X86, "Microsoft", "Edge", "Application", "msedge.exe"),
662
+ path12.join("~", "AppData", "Local", "Microsoft", "Edge", "Application", "msedge.exe")
663
663
  ],
664
- userDataDir: "~/AppData/Local/Chromium/User Data",
665
- processNames: ["/chromium/application/chrome.exe"]
664
+ userDataDir: "~/AppData/Local/Microsoft/Edge/User Data",
665
+ processNames: ["/microsoft/edge/application/msedge.exe"]
666
666
  },
667
667
  linux: {
668
668
  executableCandidates: [
669
- "/usr/bin/chromium",
670
- "/usr/bin/chromium-browser",
671
- resolveBinaryFromPath("chromium"),
672
- resolveBinaryFromPath("chromium-browser")
669
+ "/usr/bin/microsoft-edge",
670
+ "/usr/bin/microsoft-edge-stable",
671
+ "/opt/microsoft/msedge/msedge",
672
+ resolveBinaryFromPath("microsoft-edge"),
673
+ resolveBinaryFromPath("microsoft-edge-stable")
673
674
  ],
674
- userDataDir: "~/.config/chromium",
675
- processNames: ["/chromium", "/chromium-browser"]
675
+ userDataDir: "~/.config/microsoft-edge",
676
+ processNames: ["/microsoft-edge", "/microsoft-edge-stable", "/opt/microsoft/msedge/msedge"]
676
677
  }
677
678
  },
678
679
  {
@@ -709,36 +710,6 @@ var init_browser_brands = __esm({
709
710
  processNames: ["/brave-browser", "/opt/brave.com/brave/brave-browser"]
710
711
  }
711
712
  },
712
- {
713
- id: "edge",
714
- displayName: "Microsoft Edge",
715
- darwin: {
716
- executableCandidates: ["/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"],
717
- userDataDir: "~/Library/Application Support/Microsoft Edge",
718
- bundleId: "com.microsoft.edgemac",
719
- processNames: ["/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"]
720
- },
721
- win32: {
722
- executableCandidates: [
723
- path12.join(WINDOWS_PROGRAM_FILES, "Microsoft", "Edge", "Application", "msedge.exe"),
724
- path12.join(WINDOWS_PROGRAM_FILES_X86, "Microsoft", "Edge", "Application", "msedge.exe"),
725
- path12.join("~", "AppData", "Local", "Microsoft", "Edge", "Application", "msedge.exe")
726
- ],
727
- userDataDir: "~/AppData/Local/Microsoft/Edge/User Data",
728
- processNames: ["/microsoft/edge/application/msedge.exe"]
729
- },
730
- linux: {
731
- executableCandidates: [
732
- "/usr/bin/microsoft-edge",
733
- "/usr/bin/microsoft-edge-stable",
734
- "/opt/microsoft/msedge/msedge",
735
- resolveBinaryFromPath("microsoft-edge"),
736
- resolveBinaryFromPath("microsoft-edge-stable")
737
- ],
738
- userDataDir: "~/.config/microsoft-edge",
739
- processNames: ["/microsoft-edge", "/microsoft-edge-stable", "/opt/microsoft/msedge/msedge"]
740
- }
741
- },
742
713
  {
743
714
  id: "vivaldi",
744
715
  displayName: "Vivaldi",
@@ -777,6 +748,35 @@ var init_browser_brands = __esm({
777
748
  userDataDir: "~/Library/Application Support/net.imput.helium",
778
749
  processNames: ["/Applications/Helium.app/Contents/MacOS/Helium"]
779
750
  }
751
+ },
752
+ {
753
+ id: "chromium",
754
+ displayName: "Chromium",
755
+ darwin: {
756
+ executableCandidates: ["/Applications/Chromium.app/Contents/MacOS/Chromium"],
757
+ userDataDir: "~/Library/Application Support/Chromium",
758
+ bundleId: "org.chromium.Chromium",
759
+ processNames: ["/Applications/Chromium.app/Contents/MacOS/Chromium"]
760
+ },
761
+ win32: {
762
+ executableCandidates: [
763
+ path12.join(WINDOWS_PROGRAM_FILES, "Chromium", "Application", "chrome.exe"),
764
+ path12.join(WINDOWS_PROGRAM_FILES_X86, "Chromium", "Application", "chrome.exe"),
765
+ path12.join("~", "AppData", "Local", "Chromium", "Application", "chrome.exe")
766
+ ],
767
+ userDataDir: "~/AppData/Local/Chromium/User Data",
768
+ processNames: ["/chromium/application/chrome.exe"]
769
+ },
770
+ linux: {
771
+ executableCandidates: [
772
+ "/usr/bin/chromium",
773
+ "/usr/bin/chromium-browser",
774
+ resolveBinaryFromPath("chromium"),
775
+ resolveBinaryFromPath("chromium-browser")
776
+ ],
777
+ userDataDir: "~/.config/chromium",
778
+ processNames: ["/chromium", "/chromium-browser"]
779
+ }
780
780
  }
781
781
  ];
782
782
  }
@@ -795,10 +795,15 @@ function resolveChromeExecutablePath(executablePath) {
795
795
  }
796
796
  return resolvedPath;
797
797
  }
798
- for (const installation of detectLocalChromeInstallations()) {
799
- if (installation.executablePath) {
800
- return installation.executablePath;
801
- }
798
+ const chromeInstallation = detectLocalChromeInstallations().find(
799
+ (installation) => installation.brand === "chrome" && installation.executablePath !== null
800
+ );
801
+ if (chromeInstallation?.executablePath) {
802
+ return chromeInstallation.executablePath;
803
+ }
804
+ const brandedInstallation = detectInstalledBrowserBrands()[0];
805
+ if (brandedInstallation) {
806
+ return brandedInstallation.executablePath;
802
807
  }
803
808
  throw new Error(
804
809
  "Could not find a Chrome or Chromium executable. Pass browser.executablePath or --executable-path."
@@ -1290,10 +1295,11 @@ async function copyRootLevelEntries(input) {
1290
1295
  if (!entryStat.isDirectory()) {
1291
1296
  continue;
1292
1297
  }
1293
- if (SKIPPED_ROOT_DIRECTORIES.has(entry) || isProfileDirectory(input.sourceUserDataDir, entry)) {
1298
+ if (SKIPPED_ROOT_DIRECTORIES.has(entry)) {
1294
1299
  continue;
1295
1300
  }
1296
- if (input.copyMode === "session") {
1301
+ const profileDirectory = isProfileDirectory(input.sourceUserDataDir, entry);
1302
+ if (input.copyMode === "session" && !profileDirectory) {
1297
1303
  continue;
1298
1304
  }
1299
1305
  await promises.cp(sourcePath, targetPath, {
@@ -4418,6 +4424,26 @@ function normalizeWorkspace(workspace) {
4418
4424
  const normalized = workspace?.trim();
4419
4425
  return normalized === void 0 || normalized.length === 0 ? void 0 : normalized;
4420
4426
  }
4427
+ function resolveLaunchOptions(launch, environment) {
4428
+ if (launch?.executablePath !== void 0) {
4429
+ return launch;
4430
+ }
4431
+ const executablePath = normalizeConfiguredExecutablePath(environment.OPENSTEER_EXECUTABLE_PATH);
4432
+ if (executablePath === void 0) {
4433
+ return launch;
4434
+ }
4435
+ return {
4436
+ ...launch ?? {},
4437
+ executablePath
4438
+ };
4439
+ }
4440
+ function normalizeConfiguredExecutablePath(value) {
4441
+ if (value === void 0) {
4442
+ return void 0;
4443
+ }
4444
+ const trimmed = value.trim();
4445
+ return trimmed.length === 0 ? void 0 : trimmed;
4446
+ }
4421
4447
  function toPersistedLocalBrowserSessionRecord(workspace, live) {
4422
4448
  return {
4423
4449
  layout: "opensteer-session",
@@ -4513,7 +4539,7 @@ async function launchOwnedBrowser(input) {
4513
4539
  }
4514
4540
  function buildChromeArgs(userDataDir, launch, viewport, requestedRemoteDebuggingPort) {
4515
4541
  const isHeadless = launch?.headless ?? true;
4516
- const args = [
4542
+ const args = isHeadless ? [
4517
4543
  ...requestedRemoteDebuggingPort === void 0 ? ["--remote-debugging-port=0"] : [],
4518
4544
  "--no-first-run",
4519
4545
  "--no-default-browser-check",
@@ -4532,6 +4558,12 @@ function buildChromeArgs(userDataDir, launch, viewport, requestedRemoteDebugging
4532
4558
  "--password-store=basic",
4533
4559
  "--use-mock-keychain",
4534
4560
  `--user-data-dir=${userDataDir}`
4561
+ ] : [
4562
+ ...requestedRemoteDebuggingPort === void 0 ? ["--remote-debugging-port=0"] : [],
4563
+ "--no-first-run",
4564
+ "--no-default-browser-check",
4565
+ "--disable-blink-features=AutomationControlled",
4566
+ `--user-data-dir=${userDataDir}`
4535
4567
  ];
4536
4568
  if (isHeadless) {
4537
4569
  args.push("--headless=new");
@@ -4755,23 +4787,36 @@ function isMissingPackageError(error, packageName) {
4755
4787
  }
4756
4788
  return error.message.includes(`Cannot find package '${packageName}'`) || error.message.includes(`Cannot find module '${packageName}'`) || error.message.includes(`Cannot find module "${packageName}"`);
4757
4789
  }
4758
- function normalizeBrowserContextOptions(context) {
4790
+ function normalizeBrowserContextOptions(context, environment, engineName = DEFAULT_OPENSTEER_ENGINE) {
4759
4791
  const stealthProfile = resolveStealthProfile(context?.stealthProfile);
4760
4792
  const locale = context?.locale ?? stealthProfile?.locale;
4761
4793
  const timezoneId = context?.timezoneId ?? stealthProfile?.timezoneId;
4762
4794
  const userAgent = context?.userAgent ?? stealthProfile?.userAgent;
4795
+ const humanize = engineName === "abp" && context?.humanize === void 0 ? void 0 : resolveHumanizeOption(context?.humanize, environment);
4763
4796
  return {
4764
4797
  ...context ?? {},
4765
4798
  ...stealthProfile === void 0 ? {} : { stealthProfile },
4766
4799
  ...locale === void 0 ? {} : { locale },
4767
4800
  ...timezoneId === void 0 ? {} : { timezoneId },
4768
4801
  ...userAgent === void 0 ? {} : { userAgent },
4802
+ ...humanize === void 0 ? {} : { humanize },
4769
4803
  viewport: context?.viewport ?? stealthProfile?.viewport ?? {
4770
4804
  width: 1440,
4771
4805
  height: 900
4772
4806
  }
4773
4807
  };
4774
4808
  }
4809
+ function resolveHumanizeOption(explicit, environment) {
4810
+ if (explicit !== void 0) {
4811
+ return explicit;
4812
+ }
4813
+ const envValue = environment?.OPENSTEER_HUMANIZE;
4814
+ if (envValue !== void 0) {
4815
+ const normalized = envValue.trim().toLowerCase();
4816
+ return normalized !== "false" && normalized !== "0";
4817
+ }
4818
+ return void 0;
4819
+ }
4775
4820
  function toEngineBrowserContextOptions(context) {
4776
4821
  const { stealthProfile: _stealthProfile, ...engineContext } = context;
4777
4822
  return engineContext;
@@ -4825,9 +4870,13 @@ var init_browser_manager = __esm({
4825
4870
  this.workspace = normalizeWorkspace(options.workspace);
4826
4871
  this.mode = resolveBrowserMode(this.workspace, options.browser);
4827
4872
  this.browserOptions = isAttachBrowserOptions(options.browser) ? options.browser : void 0;
4828
- this.launchOptions = options.launch;
4829
- this.contextOptions = normalizeBrowserContextOptions(options.context);
4873
+ this.launchOptions = resolveLaunchOptions(options.launch, options.environment ?? process.env);
4830
4874
  this.engineName = options.engineName ?? DEFAULT_OPENSTEER_ENGINE;
4875
+ this.contextOptions = normalizeBrowserContextOptions(
4876
+ options.context,
4877
+ options.environment ?? process.env,
4878
+ this.engineName
4879
+ );
4831
4880
  assertSupportedEngineOptions({
4832
4881
  engineName: this.engineName,
4833
4882
  ...options.browser === void 0 ? {} : { browser: options.browser },