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
@@ -1,4 +1,4 @@
1
- import { filePathToUri, resolveStoragePath, encodePathSegment, ensureDirectory, pathExists, readJsonFile, writeJsonFileAtomic, normalizeTimestamp, withFilesystemLock, resolveLocalViewPreferencesPath, resolveLocalViewServiceLockDir, readLocalViewServiceState, isLocalViewServiceStateLive, clearLocalViewServiceState, getLocalViewServiceStateLiveness, clearPersistedSessionRecord, writePersistedSessionRecord, isProcessRunning, readPersistedLocalBrowserSessionRecord, buildLocalViewSessionId, selectAttachBrowserCandidate, resolveChromeExecutablePath, readDevToolsActivePort, inspectCdpEndpoint, normalizeNonEmptyString, toCanonicalJsonValue, canonicalJsonString, sha256Hex, joinStoragePath, writeBufferIfMissing, writeJsonFileExclusive, isAlreadyExistsError, readBinaryFile, listJsonFiles, expandHome, createLocalViewSessionManifest, writeLocalViewSessionManifest, deleteLocalViewSessionManifest, CURRENT_PROCESS_OWNER, getProcessLiveness, processOwnersEqual, parseProcessOwner } from './chunk-BMPUL66S.js';
1
+ import { filePathToUri, resolveStoragePath, encodePathSegment, ensureDirectory, pathExists, readJsonFile, writeJsonFileAtomic, normalizeTimestamp, withFilesystemLock, resolveLocalViewPreferencesPath, resolveLocalViewServiceLockDir, readLocalViewServiceState, isLocalViewServiceStateLive, clearLocalViewServiceState, getLocalViewServiceStateLiveness, clearPersistedSessionRecord, writePersistedSessionRecord, isProcessRunning, readPersistedLocalBrowserSessionRecord, buildLocalViewSessionId, selectAttachBrowserCandidate, resolveChromeExecutablePath, readDevToolsActivePort, inspectCdpEndpoint, normalizeNonEmptyString, toCanonicalJsonValue, canonicalJsonString, sha256Hex, joinStoragePath, writeBufferIfMissing, writeJsonFileExclusive, isAlreadyExistsError, readBinaryFile, listJsonFiles, expandHome, createLocalViewSessionManifest, writeLocalViewSessionManifest, deleteLocalViewSessionManifest, CURRENT_PROCESS_OWNER, getProcessLiveness, processOwnersEqual, parseProcessOwner } from './chunk-T5P2QGZ3.js';
2
2
  import path7, { join, resolve, dirname, relative } from 'path';
3
3
  import { randomBytes, randomUUID } from 'crypto';
4
4
  import { spawn } from 'child_process';
@@ -2289,10 +2289,11 @@ async function copyRootLevelEntries(input) {
2289
2289
  if (!entryStat.isDirectory()) {
2290
2290
  continue;
2291
2291
  }
2292
- if (SKIPPED_ROOT_DIRECTORIES.has(entry) || isProfileDirectory(input.sourceUserDataDir, entry)) {
2292
+ if (SKIPPED_ROOT_DIRECTORIES.has(entry)) {
2293
2293
  continue;
2294
2294
  }
2295
- if (input.copyMode === "session") {
2295
+ const profileDirectory = isProfileDirectory(input.sourceUserDataDir, entry);
2296
+ if (input.copyMode === "session" && !profileDirectory) {
2296
2297
  continue;
2297
2298
  }
2298
2299
  await cp(sourcePath, targetPath, {
@@ -3210,9 +3211,13 @@ var OpensteerBrowserManager = class {
3210
3211
  this.workspace = normalizeWorkspace(options.workspace);
3211
3212
  this.mode = resolveBrowserMode(this.workspace, options.browser);
3212
3213
  this.browserOptions = isAttachBrowserOptions(options.browser) ? options.browser : void 0;
3213
- this.launchOptions = options.launch;
3214
- this.contextOptions = normalizeBrowserContextOptions(options.context);
3214
+ this.launchOptions = resolveLaunchOptions(options.launch, options.environment ?? process.env);
3215
3215
  this.engineName = options.engineName ?? DEFAULT_OPENSTEER_ENGINE;
3216
+ this.contextOptions = normalizeBrowserContextOptions(
3217
+ options.context,
3218
+ options.environment ?? process.env,
3219
+ this.engineName
3220
+ );
3216
3221
  assertSupportedEngineOptions({
3217
3222
  engineName: this.engineName,
3218
3223
  ...options.browser === void 0 ? {} : { browser: options.browser },
@@ -3724,6 +3729,26 @@ function normalizeWorkspace(workspace) {
3724
3729
  const normalized = workspace?.trim();
3725
3730
  return normalized === void 0 || normalized.length === 0 ? void 0 : normalized;
3726
3731
  }
3732
+ function resolveLaunchOptions(launch, environment) {
3733
+ if (launch?.executablePath !== void 0) {
3734
+ return launch;
3735
+ }
3736
+ const executablePath = normalizeConfiguredExecutablePath(environment.OPENSTEER_EXECUTABLE_PATH);
3737
+ if (executablePath === void 0) {
3738
+ return launch;
3739
+ }
3740
+ return {
3741
+ ...launch ?? {},
3742
+ executablePath
3743
+ };
3744
+ }
3745
+ function normalizeConfiguredExecutablePath(value) {
3746
+ if (value === void 0) {
3747
+ return void 0;
3748
+ }
3749
+ const trimmed = value.trim();
3750
+ return trimmed.length === 0 ? void 0 : trimmed;
3751
+ }
3727
3752
  function toPersistedLocalBrowserSessionRecord(workspace, live) {
3728
3753
  return {
3729
3754
  layout: "opensteer-session",
@@ -3819,7 +3844,7 @@ async function launchOwnedBrowser(input) {
3819
3844
  }
3820
3845
  function buildChromeArgs(userDataDir, launch, viewport, requestedRemoteDebuggingPort) {
3821
3846
  const isHeadless = launch?.headless ?? true;
3822
- const args = [
3847
+ const args = isHeadless ? [
3823
3848
  ...requestedRemoteDebuggingPort === void 0 ? ["--remote-debugging-port=0"] : [],
3824
3849
  "--no-first-run",
3825
3850
  "--no-default-browser-check",
@@ -3838,6 +3863,12 @@ function buildChromeArgs(userDataDir, launch, viewport, requestedRemoteDebugging
3838
3863
  "--password-store=basic",
3839
3864
  "--use-mock-keychain",
3840
3865
  `--user-data-dir=${userDataDir}`
3866
+ ] : [
3867
+ ...requestedRemoteDebuggingPort === void 0 ? ["--remote-debugging-port=0"] : [],
3868
+ "--no-first-run",
3869
+ "--no-default-browser-check",
3870
+ "--disable-blink-features=AutomationControlled",
3871
+ `--user-data-dir=${userDataDir}`
3841
3872
  ];
3842
3873
  if (isHeadless) {
3843
3874
  args.push("--headless=new");
@@ -4061,23 +4092,36 @@ function isMissingPackageError(error, packageName) {
4061
4092
  }
4062
4093
  return error.message.includes(`Cannot find package '${packageName}'`) || error.message.includes(`Cannot find module '${packageName}'`) || error.message.includes(`Cannot find module "${packageName}"`);
4063
4094
  }
4064
- function normalizeBrowserContextOptions(context) {
4095
+ function normalizeBrowserContextOptions(context, environment, engineName = DEFAULT_OPENSTEER_ENGINE) {
4065
4096
  const stealthProfile = resolveStealthProfile(context?.stealthProfile);
4066
4097
  const locale = context?.locale ?? stealthProfile?.locale;
4067
4098
  const timezoneId = context?.timezoneId ?? stealthProfile?.timezoneId;
4068
4099
  const userAgent = context?.userAgent ?? stealthProfile?.userAgent;
4100
+ const humanize = engineName === "abp" && context?.humanize === void 0 ? void 0 : resolveHumanizeOption(context?.humanize, environment);
4069
4101
  return {
4070
4102
  ...context ?? {},
4071
4103
  ...stealthProfile === void 0 ? {} : { stealthProfile },
4072
4104
  ...locale === void 0 ? {} : { locale },
4073
4105
  ...timezoneId === void 0 ? {} : { timezoneId },
4074
4106
  ...userAgent === void 0 ? {} : { userAgent },
4107
+ ...humanize === void 0 ? {} : { humanize },
4075
4108
  viewport: context?.viewport ?? stealthProfile?.viewport ?? {
4076
4109
  width: 1440,
4077
4110
  height: 900
4078
4111
  }
4079
4112
  };
4080
4113
  }
4114
+ function resolveHumanizeOption(explicit, environment) {
4115
+ if (explicit !== void 0) {
4116
+ return explicit;
4117
+ }
4118
+ const envValue = environment?.OPENSTEER_HUMANIZE;
4119
+ if (envValue !== void 0) {
4120
+ const normalized = envValue.trim().toLowerCase();
4121
+ return normalized !== "false" && normalized !== "0";
4122
+ }
4123
+ return void 0;
4124
+ }
4081
4125
  function toEngineBrowserContextOptions(context) {
4082
4126
  const { stealthProfile: _stealthProfile, ...engineContext } = context;
4083
4127
  return engineContext;
@@ -4099,5 +4143,5 @@ async function sleep2(ms) {
4099
4143
  }
4100
4144
 
4101
4145
  export { DEFAULT_OPENSTEER_ENGINE, OPENSTEER_ENGINE_NAMES, OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT, OPENSTEER_FILESYSTEM_WORKSPACE_VERSION, OpensteerBrowserManager, assertSupportedEngineOptions, buildLocalViewSessionUrl, createArtifactStore, createFilesystemOpensteerWorkspace, createObservationStore, ensureLocalViewServiceRunning, manifestToExternalBinaryLocation, normalizeObservabilityConfig, normalizeObservationContext, normalizeOpensteerEngineName, normalizeWorkspaceId, resolveFilesystemWorkspacePath, resolveOpensteerEngineName, setLocalViewMode, stopLocalViewService };
4102
- //# sourceMappingURL=chunk-2TIVULZY.js.map
4103
- //# sourceMappingURL=chunk-2TIVULZY.js.map
4146
+ //# sourceMappingURL=chunk-GSCQQKZZ.js.map
4147
+ //# sourceMappingURL=chunk-GSCQQKZZ.js.map