opensteer 0.9.7 → 0.9.8

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 (34) hide show
  1. package/README.md +2 -2
  2. package/dist/{chunk-R33BXCMQ.js → chunk-BPGXP3RF.js} +245 -21
  3. package/dist/chunk-BPGXP3RF.js.map +1 -0
  4. package/dist/{chunk-PJXN7HED.js → chunk-EXXRLPLI.js} +46 -35
  5. package/dist/chunk-EXXRLPLI.js.map +1 -0
  6. package/dist/{chunk-U4BUCIZ4.js → chunk-GKYBP3KD.js} +4 -4
  7. package/dist/chunk-GKYBP3KD.js.map +1 -0
  8. package/dist/{chunk-3OHKIPBD.js → chunk-LFWP5RXF.js} +189 -53
  9. package/dist/chunk-LFWP5RXF.js.map +1 -0
  10. package/dist/{chunk-52UNH5UW.js → chunk-SOJEWKSW.js} +5 -5
  11. package/dist/{chunk-52UNH5UW.js.map → chunk-SOJEWKSW.js.map} +1 -1
  12. package/dist/cli/bin.cjs +570 -119
  13. package/dist/cli/bin.cjs.map +1 -1
  14. package/dist/cli/bin.js +106 -28
  15. package/dist/cli/bin.js.map +1 -1
  16. package/dist/index.cjs +211 -72
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +10 -1
  19. package/dist/index.d.ts +10 -1
  20. package/dist/index.js +4 -4
  21. package/dist/local-view/serve-entry.cjs +288 -50
  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-XLPY343Y.js +6 -0
  25. package/dist/{opensteer-CY2QUJEG.js.map → opensteer-XLPY343Y.js.map} +1 -1
  26. package/dist/{session-control-FIP6ZJLH.js → session-control-FVKKD45R.js} +4 -4
  27. package/dist/{session-control-FIP6ZJLH.js.map → session-control-FVKKD45R.js.map} +1 -1
  28. package/package.json +7 -7
  29. package/skills/recorder/SKILL.md +2 -2
  30. package/dist/chunk-3OHKIPBD.js.map +0 -1
  31. package/dist/chunk-PJXN7HED.js.map +0 -1
  32. package/dist/chunk-R33BXCMQ.js.map +0 -1
  33. package/dist/chunk-U4BUCIZ4.js.map +0 -1
  34. package/dist/opensteer-CY2QUJEG.js +0 -6
package/dist/cli/bin.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { runLocalViewService } from '../chunk-R33BXCMQ.js';
3
- import { createOpensteerSemanticRuntime, dispatchSemanticOperation, isBrowserCoreError, loadEnvironment, normalizeOpensteerProviderMode, resolveOpensteerRuntimeConfig, assertProviderSupportsEngine, resolveOpensteerProvider, requireCloudAppBaseUrl, CloudSessionProxy, FlowRecorderCollector, generateReplayScript, OpensteerCloudClient } from '../chunk-3OHKIPBD.js';
4
- import { isOpensteerProtocolError, OpensteerBrowserManager, stopLocalViewService, setLocalViewMode, ensureLocalViewServiceRunning, buildLocalViewSessionUrl, resolveOpensteerEngineName, resolveFilesystemWorkspacePath } from '../chunk-PJXN7HED.js';
5
- import { discoverLocalCdpBrowsers, inspectCdpEndpoint, readPersistedLocalBrowserSessionRecord, getPersistedLocalBrowserSessionOwnership, isAttachedLocalBrowserSessionReachable, isProcessRunning, buildLocalViewSessionIdForRecord, pathExists, readPersistedCloudSessionRecord } from '../chunk-U4BUCIZ4.js';
2
+ import { runLocalViewService } from '../chunk-BPGXP3RF.js';
3
+ import { createOpensteerSemanticRuntime, dispatchSemanticOperation, isBrowserCoreError, loadEnvironment, normalizeOpensteerProviderMode, resolveOpensteerRuntimeConfig, assertProviderSupportsEngine, resolveOpensteerProvider, requireCloudAppBaseUrl, CloudSessionProxy, FlowRecorderCollector, generateReplayScript, OpensteerCloudClient } from '../chunk-LFWP5RXF.js';
4
+ import { isOpensteerProtocolError, OpensteerBrowserManager, stopLocalViewService, setLocalViewMode, ensureLocalViewServiceRunning, buildLocalViewSessionUrl, resolveOpensteerEngineName, resolveFilesystemWorkspacePath } from '../chunk-EXXRLPLI.js';
5
+ import { discoverLocalCdpBrowsers, inspectCdpEndpoint, readPersistedLocalBrowserSessionRecord, getPersistedLocalBrowserSessionOwnership, isAttachedLocalBrowserSessionReachable, isProcessRunning, buildLocalViewSessionIdForRecord, pathExists, readPersistedCloudSessionRecord } from '../chunk-GKYBP3KD.js';
6
6
  import process4 from 'process';
7
7
  import { mkdir, writeFile } from 'fs/promises';
8
8
  import path2 from 'path';
@@ -14,7 +14,7 @@ import { fileURLToPath } from 'url';
14
14
 
15
15
  // package.json
16
16
  var package_default = {
17
- version: "0.9.7"};
17
+ version: "0.9.8"};
18
18
 
19
19
  // src/cli/env-loader.ts
20
20
  async function loadCliEnvironment(cwd) {
@@ -656,14 +656,22 @@ async function buildOperationInput(operation, parsed, runtime) {
656
656
  return parsed.rest[0] === void 0 ? {} : { mode: parsed.rest[0] };
657
657
  case "page.evaluate":
658
658
  if (parsed.rest[0] === void 0) {
659
- throw new CliError("missing_arguments", "evaluate requires a script.", CLI_USAGE_HINTS[operation]);
659
+ throw new CliError(
660
+ "missing_arguments",
661
+ "evaluate requires a script.",
662
+ CLI_USAGE_HINTS[operation]
663
+ );
660
664
  }
661
665
  return {
662
666
  script: joinRest(parsed.rest, 0)
663
667
  };
664
668
  case "page.add-init-script":
665
669
  if (parsed.rest[0] === void 0) {
666
- throw new CliError("missing_arguments", "init-script requires a script.", CLI_USAGE_HINTS[operation]);
670
+ throw new CliError(
671
+ "missing_arguments",
672
+ "init-script requires a script.",
673
+ CLI_USAGE_HINTS[operation]
674
+ );
667
675
  }
668
676
  return {
669
677
  script: joinRest(parsed.rest, 0)
@@ -679,7 +687,11 @@ async function buildOperationInput(operation, parsed, runtime) {
679
687
  return buildElementTargetInput(parsed, "hover");
680
688
  case "dom.input": {
681
689
  if (parsed.rest[1] === void 0) {
682
- throw new CliError("missing_arguments", "input requires an element number and text.", CLI_USAGE_HINTS[operation]);
690
+ throw new CliError(
691
+ "missing_arguments",
692
+ "input requires an element number and text.",
693
+ CLI_USAGE_HINTS[operation]
694
+ );
683
695
  }
684
696
  const pressEnter = readOptionalBoolean(parsed.rawOptions, "press-enter");
685
697
  return {
@@ -710,7 +722,11 @@ async function buildOperationInput(operation, parsed, runtime) {
710
722
  }
711
723
  case "dom.extract": {
712
724
  if (parsed.rest[0] === void 0) {
713
- throw new CliError("missing_arguments", "extract requires a template.", CLI_USAGE_HINTS[operation]);
725
+ throw new CliError(
726
+ "missing_arguments",
727
+ "extract requires a template.",
728
+ CLI_USAGE_HINTS[operation]
729
+ );
714
730
  }
715
731
  const persist = readPersistKey(parsed, "extract");
716
732
  return {
@@ -746,7 +762,11 @@ async function buildOperationInput(operation, parsed, runtime) {
746
762
  }
747
763
  case "network.detail": {
748
764
  if (parsed.rest[0] === void 0) {
749
- throw new CliError("missing_arguments", "network detail requires a record id.", CLI_USAGE_HINTS[operation]);
765
+ throw new CliError(
766
+ "missing_arguments",
767
+ "network detail requires a record id.",
768
+ CLI_USAGE_HINTS[operation]
769
+ );
750
770
  }
751
771
  const probeFlag = readOptionalBoolean(parsed.rawOptions, "probe");
752
772
  return {
@@ -757,7 +777,11 @@ async function buildOperationInput(operation, parsed, runtime) {
757
777
  case "session.fetch": {
758
778
  const url = parsed.rest[0];
759
779
  if (url === void 0) {
760
- throw new CliError("missing_arguments", "fetch requires a URL.", CLI_USAGE_HINTS[operation]);
780
+ throw new CliError(
781
+ "missing_arguments",
782
+ "fetch requires a URL.",
783
+ CLI_USAGE_HINTS[operation]
784
+ );
761
785
  }
762
786
  const bodyJson = readJsonValue(parsed.rawOptions, "body");
763
787
  const bodyText = readSingle(parsed.rawOptions, "body-text");
@@ -796,7 +820,11 @@ async function buildOperationInput(operation, parsed, runtime) {
796
820
  const siteKey = readSingle(parsed.rawOptions, "site-key");
797
821
  const pageUrl = readSingle(parsed.rawOptions, "page-url");
798
822
  if (provider === void 0 || apiKey === void 0) {
799
- throw new CliError("missing_arguments", 'captcha solve requires "--provider" and "--api-key".', CLI_USAGE_HINTS[operation]);
823
+ throw new CliError(
824
+ "missing_arguments",
825
+ 'captcha solve requires "--provider" and "--api-key".',
826
+ CLI_USAGE_HINTS[operation]
827
+ );
800
828
  }
801
829
  return {
802
830
  provider: readCaptchaProvider(provider),
@@ -826,7 +854,11 @@ async function buildOperationInput(operation, parsed, runtime) {
826
854
  case "scripts.beautify":
827
855
  case "scripts.deobfuscate": {
828
856
  if (parsed.rest[0] === void 0) {
829
- throw new CliError("missing_arguments", `${parsed.command.join(" ")} requires an artifact id.`, CLI_USAGE_HINTS[operation]);
857
+ throw new CliError(
858
+ "missing_arguments",
859
+ `${parsed.command.join(" ")} requires an artifact id.`,
860
+ CLI_USAGE_HINTS[operation]
861
+ );
830
862
  }
831
863
  const persist = readOptionalBoolean(parsed.rawOptions, "persist");
832
864
  return {
@@ -836,7 +868,11 @@ async function buildOperationInput(operation, parsed, runtime) {
836
868
  }
837
869
  case "scripts.sandbox":
838
870
  if (parsed.rest[0] === void 0) {
839
- throw new CliError("missing_arguments", "scripts sandbox requires an artifact id.", CLI_USAGE_HINTS[operation]);
871
+ throw new CliError(
872
+ "missing_arguments",
873
+ "scripts sandbox requires an artifact id.",
874
+ CLI_USAGE_HINTS[operation]
875
+ );
840
876
  }
841
877
  {
842
878
  const fidelity = readSingle(parsed.rawOptions, "fidelity");
@@ -885,14 +921,22 @@ async function buildOperationInput(operation, parsed, runtime) {
885
921
  case "interaction.get":
886
922
  case "interaction.replay":
887
923
  if (parsed.rest[0] === void 0) {
888
- throw new CliError("missing_arguments", `${parsed.command.join(" ")} requires a trace id.`, CLI_USAGE_HINTS[operation]);
924
+ throw new CliError(
925
+ "missing_arguments",
926
+ `${parsed.command.join(" ")} requires a trace id.`,
927
+ CLI_USAGE_HINTS[operation]
928
+ );
889
929
  }
890
930
  return {
891
931
  traceId: parsed.rest[0]
892
932
  };
893
933
  case "interaction.diff":
894
934
  if (parsed.rest[0] === void 0 || parsed.rest[1] === void 0) {
895
- throw new CliError("missing_arguments", "interaction diff requires two trace ids.", CLI_USAGE_HINTS[operation]);
935
+ throw new CliError(
936
+ "missing_arguments",
937
+ "interaction diff requires two trace ids.",
938
+ CLI_USAGE_HINTS[operation]
939
+ );
896
940
  }
897
941
  return {
898
942
  leftTraceId: parsed.rest[0],
@@ -900,7 +944,11 @@ async function buildOperationInput(operation, parsed, runtime) {
900
944
  };
901
945
  case "artifact.read":
902
946
  if (parsed.rest[0] === void 0) {
903
- throw new CliError("missing_arguments", "artifact read requires an artifact id.", CLI_USAGE_HINTS[operation]);
947
+ throw new CliError(
948
+ "missing_arguments",
949
+ "artifact read requires an artifact id.",
950
+ CLI_USAGE_HINTS[operation]
951
+ );
904
952
  }
905
953
  return {
906
954
  artifactId: parsed.rest[0]
@@ -1038,7 +1086,10 @@ function buildComputerExecuteInput(parsed) {
1038
1086
  }
1039
1087
  };
1040
1088
  default:
1041
- throw new CliError("unknown_command", `Unknown computer command: ${parsed.command.join(" ")}`);
1089
+ throw new CliError(
1090
+ "unknown_command",
1091
+ `Unknown computer command: ${parsed.command.join(" ")}`
1092
+ );
1042
1093
  }
1043
1094
  }
1044
1095
  async function resolvePageRefByIndex(runtime, index) {
@@ -1068,7 +1119,10 @@ function readRequiredNumber(value, message) {
1068
1119
  }
1069
1120
  function readSingleDirection(value) {
1070
1121
  if (value === void 0 || !SCROLL_DIRECTIONS.has(value)) {
1071
- throw new CliError("missing_arguments", "scroll requires a direction: up, down, left, or right.");
1122
+ throw new CliError(
1123
+ "missing_arguments",
1124
+ "scroll requires a direction: up, down, left, or right."
1125
+ );
1072
1126
  }
1073
1127
  return value;
1074
1128
  }
@@ -1095,13 +1149,19 @@ function readCaptchaProvider(value) {
1095
1149
  }
1096
1150
  function readCaptchaType(value) {
1097
1151
  if (value === void 0 || !CAPTCHA_TYPES.has(value)) {
1098
- throw new CliError("invalid_value", 'Expected "--type" to be one of: recaptcha-v2, hcaptcha, turnstile.');
1152
+ throw new CliError(
1153
+ "invalid_value",
1154
+ 'Expected "--type" to be one of: recaptcha-v2, hcaptcha, turnstile.'
1155
+ );
1099
1156
  }
1100
1157
  return value;
1101
1158
  }
1102
1159
  function readSandboxFidelity(value) {
1103
1160
  if (value === void 0 || !SANDBOX_FIDELITIES.has(value)) {
1104
- throw new CliError("invalid_value", 'Expected "--fidelity" to be one of: minimal, standard, full.');
1161
+ throw new CliError(
1162
+ "invalid_value",
1163
+ 'Expected "--fidelity" to be one of: minimal, standard, full.'
1164
+ );
1105
1165
  }
1106
1166
  return value;
1107
1167
  }
@@ -1124,7 +1184,10 @@ function readKeyModifiers(value) {
1124
1184
  }
1125
1185
  for (const modifier of modifiers) {
1126
1186
  if (!KEY_MODIFIERS.has(modifier)) {
1127
- throw new CliError("invalid_value", 'Expected "--modifiers" to contain only: Shift, Control, Alt, Meta.');
1187
+ throw new CliError(
1188
+ "invalid_value",
1189
+ 'Expected "--modifiers" to contain only: Shift, Control, Alt, Meta.'
1190
+ );
1128
1191
  }
1129
1192
  }
1130
1193
  return [...new Set(modifiers)];
@@ -2458,7 +2521,10 @@ async function main() {
2458
2521
  throw new CliError("unknown_command", `Unknown command: ${parsed.command.join(" ")}`);
2459
2522
  }
2460
2523
  if (parsed.options.workspace === void 0) {
2461
- throw new CliError("missing_workspace", 'Stateful commands require "--workspace <id>" or OPENSTEER_WORKSPACE.');
2524
+ throw new CliError(
2525
+ "missing_workspace",
2526
+ 'Stateful commands require "--workspace <id>" or OPENSTEER_WORKSPACE.'
2527
+ );
2462
2528
  }
2463
2529
  const { engineName, provider, runtimeProvider } = resolveCliRuntimeSelection(parsed);
2464
2530
  if (operation === "session.close") {
@@ -2505,7 +2571,10 @@ async function main() {
2505
2571
  }
2506
2572
  async function handleExecCommand(parsed) {
2507
2573
  if (parsed.options.workspace === void 0) {
2508
- throw new CliError("missing_workspace", 'exec requires "--workspace <id>" or OPENSTEER_WORKSPACE.');
2574
+ throw new CliError(
2575
+ "missing_workspace",
2576
+ 'exec requires "--workspace <id>" or OPENSTEER_WORKSPACE.'
2577
+ );
2509
2578
  }
2510
2579
  const expression = parsed.rest.join(" ");
2511
2580
  if (!expression) {
@@ -2516,7 +2585,7 @@ async function handleExecCommand(parsed) {
2516
2585
  );
2517
2586
  }
2518
2587
  const { engineName, runtimeProvider } = resolveCliRuntimeSelection(parsed);
2519
- const { Opensteer } = await import('../opensteer-CY2QUJEG.js');
2588
+ const { Opensteer } = await import('../opensteer-XLPY343Y.js');
2520
2589
  const opensteer = new Opensteer({
2521
2590
  workspace: parsed.options.workspace,
2522
2591
  rootDir: process4.cwd(),
@@ -2648,7 +2717,10 @@ async function handleCloseCommand(parsed, engineName, providerMode, runtimeProvi
2648
2717
  }
2649
2718
  async function handleRecordCommandEntry(parsed) {
2650
2719
  if (parsed.options.workspace === void 0) {
2651
- throw new CliError("missing_workspace", 'record requires "--workspace <id>" or OPENSTEER_WORKSPACE.');
2720
+ throw new CliError(
2721
+ "missing_workspace",
2722
+ 'record requires "--workspace <id>" or OPENSTEER_WORKSPACE.'
2723
+ );
2652
2724
  }
2653
2725
  const url = parsed.options.url ?? parsed.rest[0];
2654
2726
  if (url === void 0) {
@@ -2688,7 +2760,10 @@ async function handleRecordCommandEntry(parsed) {
2688
2760
  return;
2689
2761
  }
2690
2762
  if (parsed.options.launch?.headless === true) {
2691
- throw new CliError("config_conflict", 'record requires a headed browser. Remove "--headless true".');
2763
+ throw new CliError(
2764
+ "config_conflict",
2765
+ 'record requires a headed browser. Remove "--headless true".'
2766
+ );
2692
2767
  }
2693
2768
  if (typeof recordBrowser === "object") {
2694
2769
  throw new CliError("config_conflict", 'record does not support browser.mode="attach".');
@@ -2760,7 +2835,10 @@ function resolveCliBootstrapAction(argv) {
2760
2835
  }
2761
2836
  function buildCliBrowserProfile(parsed) {
2762
2837
  if (parsed.options.cloudProfileReuseIfActive === true && parsed.options.cloudProfileId === void 0) {
2763
- throw new CliError("invalid_option", '"--cloud-profile-reuse-if-active" requires "--cloud-profile-id <id>".');
2838
+ throw new CliError(
2839
+ "invalid_option",
2840
+ '"--cloud-profile-reuse-if-active" requires "--cloud-profile-id <id>".'
2841
+ );
2764
2842
  }
2765
2843
  return parsed.options.cloudProfileId === void 0 ? void 0 : {
2766
2844
  profileId: parsed.options.cloudProfileId,