opensteer 0.6.3 → 0.6.4
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.
- package/bin/opensteer.mjs +94 -8
- package/dist/{browser-profile-client-DK9qa_Dj.d.cts → browser-profile-client-D6PuRefA.d.cts} +1 -1
- package/dist/{browser-profile-client-CaL-mwqs.d.ts → browser-profile-client-OUHaODro.d.ts} +1 -1
- package/dist/{chunk-SCNX4NN3.js → chunk-54KNQTOL.js} +141 -2
- package/dist/{chunk-FTKWQ6X3.js → chunk-6B6LOYU3.js} +1 -1
- package/dist/{chunk-3OMXCBPD.js → chunk-G6V2DJRN.js} +442 -591
- package/dist/chunk-K5CL76MG.js +81 -0
- package/dist/{chunk-KE35RQOJ.js → chunk-KPPOTU3D.js} +53 -144
- package/dist/cli/auth.cjs +53 -6
- package/dist/cli/auth.d.cts +1 -1
- package/dist/cli/auth.d.ts +1 -1
- package/dist/cli/auth.js +2 -2
- package/dist/cli/local-profile.cjs +197 -0
- package/dist/cli/local-profile.d.cts +18 -0
- package/dist/cli/local-profile.d.ts +18 -0
- package/dist/cli/local-profile.js +97 -0
- package/dist/cli/profile.cjs +2844 -2412
- package/dist/cli/profile.d.cts +2 -2
- package/dist/cli/profile.d.ts +2 -2
- package/dist/cli/profile.js +469 -7
- package/dist/cli/server.cjs +649 -204
- package/dist/cli/server.js +69 -16
- package/dist/index.cjs +578 -185
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +4 -3
- package/dist/{types-BxiRblC7.d.cts → types-BWItZPl_.d.cts} +31 -13
- package/dist/{types-BxiRblC7.d.ts → types-BWItZPl_.d.ts} +31 -13
- package/package.json +2 -2
- package/skills/opensteer/SKILL.md +34 -14
- package/skills/opensteer/references/cli-reference.md +1 -1
- package/skills/opensteer/references/examples.md +5 -3
- package/skills/opensteer/references/sdk-reference.md +16 -14
package/dist/cli/server.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Opensteer
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-G6V2DJRN.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeError,
|
|
6
6
|
resolveCloudSelection,
|
|
7
7
|
resolveConfigWithEnv
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-KPPOTU3D.js";
|
|
9
|
+
import "../chunk-K5CL76MG.js";
|
|
9
10
|
import "../chunk-3H5RRIMZ.js";
|
|
10
11
|
|
|
11
12
|
// src/cli/server.ts
|
|
@@ -382,10 +383,12 @@ function buildServerOpenConfig(options) {
|
|
|
382
383
|
enabled: options.cursorEnabled
|
|
383
384
|
},
|
|
384
385
|
browser: {
|
|
385
|
-
headless: options.headless
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
headless: options.headless,
|
|
387
|
+
mode: options.mode,
|
|
388
|
+
cdpUrl: options.cdpUrl,
|
|
389
|
+
userDataDir: options.userDataDir,
|
|
390
|
+
profileDirectory: options.profileDirectory,
|
|
391
|
+
executablePath: options.executablePath
|
|
389
392
|
}
|
|
390
393
|
};
|
|
391
394
|
if (!options.cloudAuth) {
|
|
@@ -437,6 +440,19 @@ function normalizeAuthScheme(value) {
|
|
|
437
440
|
);
|
|
438
441
|
}
|
|
439
442
|
|
|
443
|
+
// src/cli/open-browser-config.ts
|
|
444
|
+
function resolveCliBrowserRequestConfig(options) {
|
|
445
|
+
const mode = options.browser ?? (options.profileDirectory || options.userDataDir || options.executablePath ? "real" : void 0);
|
|
446
|
+
return {
|
|
447
|
+
mode,
|
|
448
|
+
headless: options.headless ?? (mode === "real" ? true : void 0),
|
|
449
|
+
cdpUrl: options.cdpUrl,
|
|
450
|
+
profileDirectory: options.profileDirectory,
|
|
451
|
+
userDataDir: options.userDataDir,
|
|
452
|
+
executablePath: options.executablePath
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
|
|
440
456
|
// src/cli/server.ts
|
|
441
457
|
var instance = null;
|
|
442
458
|
var launchPromise = null;
|
|
@@ -597,9 +613,11 @@ async function handleRequest(request, socket) {
|
|
|
597
613
|
try {
|
|
598
614
|
const url = args.url;
|
|
599
615
|
const headless = args.headless;
|
|
600
|
-
const
|
|
601
|
-
const
|
|
602
|
-
const
|
|
616
|
+
const browser = args.browser === "real" || args.browser === "chromium" ? args.browser : args.browser === void 0 ? void 0 : null;
|
|
617
|
+
const cdpUrl = args["cdp-url"];
|
|
618
|
+
const profileDirectory = args.profile;
|
|
619
|
+
const userDataDir = args["user-data-dir"];
|
|
620
|
+
const executablePath = args["browser-path"];
|
|
603
621
|
const cloudProfileId = typeof args["cloud-profile-id"] === "string" ? args["cloud-profile-id"].trim() : void 0;
|
|
604
622
|
const cloudProfileReuseIfActive = typeof args["cloud-profile-reuse-if-active"] === "boolean" ? args["cloud-profile-reuse-if-active"] : void 0;
|
|
605
623
|
const requestedCloudProfileBinding = normalizeCloudProfileBinding({
|
|
@@ -614,6 +632,21 @@ async function handleRequest(request, socket) {
|
|
|
614
632
|
"--cloud-profile-reuse-if-active requires --cloud-profile-id."
|
|
615
633
|
);
|
|
616
634
|
}
|
|
635
|
+
if (browser === null) {
|
|
636
|
+
throw new Error(
|
|
637
|
+
'--browser must be either "chromium" or "real".'
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
if (browser === "chromium" && (profileDirectory || userDataDir || executablePath)) {
|
|
641
|
+
throw new Error(
|
|
642
|
+
"--profile, --user-data-dir, and --browser-path require --browser real."
|
|
643
|
+
);
|
|
644
|
+
}
|
|
645
|
+
if (cdpUrl && browser === "real") {
|
|
646
|
+
throw new Error(
|
|
647
|
+
"--cdp-url cannot be combined with --browser real."
|
|
648
|
+
);
|
|
649
|
+
}
|
|
617
650
|
const requestedCursor = normalizeCursorFlag(args.cursor);
|
|
618
651
|
const requestedName = typeof args.name === "string" && args.name.trim().length > 0 ? sanitizeNamespace(args.name) : null;
|
|
619
652
|
if (requestedCursor !== null) {
|
|
@@ -655,26 +688,45 @@ async function handleRequest(request, socket) {
|
|
|
655
688
|
invalidateInstance();
|
|
656
689
|
}
|
|
657
690
|
}
|
|
691
|
+
const requestedBrowserConfig = resolveCliBrowserRequestConfig({
|
|
692
|
+
browser: browser ?? void 0,
|
|
693
|
+
headless,
|
|
694
|
+
cdpUrl,
|
|
695
|
+
profileDirectory,
|
|
696
|
+
userDataDir,
|
|
697
|
+
executablePath
|
|
698
|
+
});
|
|
658
699
|
if (instance && !launchPromise) {
|
|
659
700
|
assertCompatibleCloudProfileBinding(
|
|
660
701
|
logicalSession,
|
|
661
702
|
cloudProfileBinding,
|
|
662
703
|
requestedCloudProfileBinding
|
|
663
704
|
);
|
|
705
|
+
const existingBrowserConfig = instance.getConfig().browser || {};
|
|
706
|
+
const existingBrowserRecord = existingBrowserConfig;
|
|
707
|
+
const mismatch = Object.entries(requestedBrowserConfig).find(
|
|
708
|
+
([key, value]) => value !== void 0 && existingBrowserRecord[key] !== value
|
|
709
|
+
);
|
|
710
|
+
if (mismatch) {
|
|
711
|
+
const [key, value] = mismatch;
|
|
712
|
+
throw new Error(
|
|
713
|
+
`Session '${logicalSession}' is already bound to browser setting "${key}"=${JSON.stringify(existingBrowserRecord[key])}. Requested ${JSON.stringify(value)} does not match. Use the same browser flags for this session or start a different --session.`
|
|
714
|
+
);
|
|
715
|
+
}
|
|
664
716
|
}
|
|
717
|
+
let shouldLaunchInitialUrl = false;
|
|
665
718
|
if (!instance) {
|
|
666
719
|
instance = new Opensteer(
|
|
667
720
|
buildServerOpenConfig({
|
|
668
721
|
scopeDir,
|
|
669
722
|
name: activeNamespace,
|
|
670
723
|
cursorEnabled: effectiveCursorEnabled,
|
|
671
|
-
|
|
672
|
-
connectUrl,
|
|
673
|
-
channel,
|
|
674
|
-
profileDir,
|
|
724
|
+
...requestedBrowserConfig,
|
|
675
725
|
cloudAuth: cloudAuthOverride
|
|
676
726
|
})
|
|
677
727
|
);
|
|
728
|
+
const resolvedBrowserConfig = instance.getConfig().browser || {};
|
|
729
|
+
shouldLaunchInitialUrl = Boolean(url) && resolvedBrowserConfig.mode === "real" && !resolvedBrowserConfig.cdpUrl;
|
|
678
730
|
const nextCloudProfileBinding = resolveSessionCloudProfileBinding(
|
|
679
731
|
instance.getConfig(),
|
|
680
732
|
requestedCloudProfileBinding
|
|
@@ -686,12 +738,13 @@ async function handleRequest(request, socket) {
|
|
|
686
738
|
);
|
|
687
739
|
}
|
|
688
740
|
launchPromise = instance.launch({
|
|
689
|
-
|
|
741
|
+
initialUrl: shouldLaunchInitialUrl ? url : void 0,
|
|
742
|
+
...requestedBrowserConfig,
|
|
690
743
|
cloudBrowserProfile: cloudProfileId ? {
|
|
691
744
|
profileId: cloudProfileId,
|
|
692
745
|
reuseIfActive: cloudProfileReuseIfActive
|
|
693
746
|
} : void 0,
|
|
694
|
-
timeout:
|
|
747
|
+
timeout: cdpUrl ? 12e4 : 3e4
|
|
695
748
|
});
|
|
696
749
|
try {
|
|
697
750
|
await launchPromise;
|
|
@@ -709,7 +762,7 @@ async function handleRequest(request, socket) {
|
|
|
709
762
|
} else if (requestedCursor !== null) {
|
|
710
763
|
instance.setCursorEnabled(requestedCursor);
|
|
711
764
|
}
|
|
712
|
-
if (url) {
|
|
765
|
+
if (url && !shouldLaunchInitialUrl) {
|
|
713
766
|
await instance.goto(url);
|
|
714
767
|
}
|
|
715
768
|
sendResponse(socket, {
|