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
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listLocalChromeProfiles
|
|
3
|
+
} from "../chunk-K5CL76MG.js";
|
|
4
|
+
|
|
5
|
+
// src/cli/local-profile.ts
|
|
6
|
+
var HELP_TEXT = `Usage: opensteer local-profile <command> [options]
|
|
7
|
+
|
|
8
|
+
Inspect local Chrome profiles for real-browser mode.
|
|
9
|
+
|
|
10
|
+
Commands:
|
|
11
|
+
list List available local Chrome profiles
|
|
12
|
+
|
|
13
|
+
Options:
|
|
14
|
+
--json JSON output
|
|
15
|
+
--user-data-dir <path> Override Chrome user-data root
|
|
16
|
+
-h, --help Show this help
|
|
17
|
+
`;
|
|
18
|
+
function parseOpensteerLocalProfileArgs(argv) {
|
|
19
|
+
const [command, ...rest] = argv;
|
|
20
|
+
if (!command || command === "help" || command === "--help" || command === "-h") {
|
|
21
|
+
return { mode: "help" };
|
|
22
|
+
}
|
|
23
|
+
if (command !== "list") {
|
|
24
|
+
return {
|
|
25
|
+
mode: "error",
|
|
26
|
+
error: `Unsupported local-profile command "${command}".`
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
let json = false;
|
|
30
|
+
let userDataDir;
|
|
31
|
+
for (let index = 0; index < rest.length; index += 1) {
|
|
32
|
+
const arg = rest[index];
|
|
33
|
+
if (arg === "--json") {
|
|
34
|
+
json = true;
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (arg === "--help" || arg === "-h") {
|
|
38
|
+
return { mode: "help" };
|
|
39
|
+
}
|
|
40
|
+
if (arg === "--user-data-dir") {
|
|
41
|
+
const value = rest[index + 1];
|
|
42
|
+
if (!value) {
|
|
43
|
+
return {
|
|
44
|
+
mode: "error",
|
|
45
|
+
error: "--user-data-dir requires a path value."
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
userDataDir = value;
|
|
49
|
+
index += 1;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
mode: "error",
|
|
54
|
+
error: `Unsupported option "${arg}" for "opensteer local-profile list".`
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
mode: "list",
|
|
59
|
+
json,
|
|
60
|
+
userDataDir
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
async function runOpensteerLocalProfileCli(argv, overrides = {}) {
|
|
64
|
+
const deps = {
|
|
65
|
+
writeStdout: (message) => process.stdout.write(message),
|
|
66
|
+
writeStderr: (message) => process.stderr.write(message),
|
|
67
|
+
...overrides
|
|
68
|
+
};
|
|
69
|
+
const parsed = parseOpensteerLocalProfileArgs(argv);
|
|
70
|
+
if (parsed.mode === "help") {
|
|
71
|
+
deps.writeStdout(HELP_TEXT);
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
if (parsed.mode === "error") {
|
|
75
|
+
deps.writeStderr(`${parsed.error}
|
|
76
|
+
`);
|
|
77
|
+
return 1;
|
|
78
|
+
}
|
|
79
|
+
const profiles = listLocalChromeProfiles(parsed.userDataDir);
|
|
80
|
+
if (parsed.json) {
|
|
81
|
+
deps.writeStdout(JSON.stringify({ profiles }, null, 2));
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
84
|
+
if (!profiles.length) {
|
|
85
|
+
deps.writeStdout("No local Chrome profiles found.\n");
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
for (const profile of profiles) {
|
|
89
|
+
deps.writeStdout(`${profile.directory} ${profile.name}
|
|
90
|
+
`);
|
|
91
|
+
}
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
export {
|
|
95
|
+
parseOpensteerLocalProfileArgs,
|
|
96
|
+
runOpensteerLocalProfileCli
|
|
97
|
+
};
|