opensteer 0.8.18 → 0.9.1
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/README.md +5 -5
- package/dist/chunk-4LP7QP2O.js +4336 -0
- package/dist/chunk-4LP7QP2O.js.map +1 -0
- package/dist/{chunk-GQ3PGLYQ.js → chunk-6PGXWW3X.js} +5142 -9634
- package/dist/chunk-6PGXWW3X.js.map +1 -0
- package/dist/chunk-BMPUL66S.js +1170 -0
- package/dist/chunk-BMPUL66S.js.map +1 -0
- package/dist/{chunk-T6TG4WO2.js → chunk-L4FWHBQJ.js} +4 -3
- package/dist/chunk-L4FWHBQJ.js.map +1 -0
- package/dist/chunk-Z53HNZ7Z.js +1800 -0
- package/dist/chunk-Z53HNZ7Z.js.map +1 -0
- package/dist/cli/bin.cjs +3533 -499
- package/dist/cli/bin.cjs.map +1 -1
- package/dist/cli/bin.js +130 -11
- package/dist/cli/bin.js.map +1 -1
- package/dist/index.cjs +1382 -487
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -27
- package/dist/index.d.ts +20 -27
- package/dist/index.js +4 -2
- package/dist/local-view/public/assets/app.css +770 -0
- package/dist/local-view/public/assets/app.js +2053 -0
- package/dist/local-view/public/index.html +235 -0
- package/dist/local-view/serve-entry.cjs +7436 -0
- package/dist/local-view/serve-entry.cjs.map +1 -0
- package/dist/local-view/serve-entry.d.cts +1 -0
- package/dist/local-view/serve-entry.d.ts +1 -0
- package/dist/local-view/serve-entry.js +23 -0
- package/dist/local-view/serve-entry.js.map +1 -0
- package/dist/opensteer-KZCRP425.js +6 -0
- package/dist/{opensteer-XMCWYUH3.js.map → opensteer-KZCRP425.js.map} +1 -1
- package/dist/session-control-VGBFOH3Y.js +39 -0
- package/dist/session-control-VGBFOH3Y.js.map +1 -0
- package/package.json +8 -8
- package/skills/README.md +12 -6
- package/skills/opensteer/SKILL.md +275 -217
- package/skills/recorder/SKILL.md +1 -1
- package/dist/chunk-GQ3PGLYQ.js.map +0 -1
- package/dist/chunk-T6TG4WO2.js.map +0 -1
- package/dist/opensteer-XMCWYUH3.js +0 -4
package/dist/cli/bin.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import '../chunk-KCINASQC.js';
|
|
3
|
-
import {
|
|
3
|
+
import { runLocalViewService } from '../chunk-Z53HNZ7Z.js';
|
|
4
|
+
import { createOpensteerSemanticRuntime, dispatchSemanticOperation, loadEnvironment, normalizeOpensteerProviderMode, resolveOpensteerRuntimeConfig, assertProviderSupportsEngine, resolveOpensteerProvider, requireCloudAppBaseUrl, CloudSessionProxy, FlowRecorderCollector, generateReplayScript, OpensteerCloudClient } from '../chunk-6PGXWW3X.js';
|
|
5
|
+
import { OpensteerBrowserManager, stopLocalViewService, setLocalViewMode, ensureLocalViewServiceRunning, buildLocalViewSessionUrl, resolveOpensteerEngineName, resolveFilesystemWorkspacePath } from '../chunk-4LP7QP2O.js';
|
|
6
|
+
import { discoverLocalCdpBrowsers, inspectCdpEndpoint, readPersistedLocalBrowserSessionRecord, isProcessRunning, buildLocalViewSessionId, pathExists, readPersistedCloudSessionRecord } from '../chunk-BMPUL66S.js';
|
|
4
7
|
import process4 from 'process';
|
|
5
8
|
import { mkdir, writeFile } from 'fs/promises';
|
|
6
9
|
import path2 from 'path';
|
|
@@ -12,7 +15,7 @@ import { fileURLToPath } from 'url';
|
|
|
12
15
|
|
|
13
16
|
// package.json
|
|
14
17
|
var package_default = {
|
|
15
|
-
version: "0.
|
|
18
|
+
version: "0.9.1"};
|
|
16
19
|
|
|
17
20
|
// src/cli/env-loader.ts
|
|
18
21
|
async function loadCliEnvironment(cwd) {
|
|
@@ -27,6 +30,10 @@ Session:
|
|
|
27
30
|
open <url> [--workspace <id>] [--headless] [--provider local|cloud]
|
|
28
31
|
close
|
|
29
32
|
status
|
|
33
|
+
view [--workspace <id>] [--json]
|
|
34
|
+
view stop [--json]
|
|
35
|
+
view --auto [--json]
|
|
36
|
+
view --no-auto [--json]
|
|
30
37
|
|
|
31
38
|
Navigation:
|
|
32
39
|
goto <url> [--capture-network <label>]
|
|
@@ -51,7 +58,7 @@ Network:
|
|
|
51
58
|
network query [--capture <label>] [--url <pattern>] [--hostname <host>] [--path <path>] [--method <m>] [--status <code>] [--type <resourceType>] [--json] [--before <id>] [--after <id>] [--limit <n>]
|
|
52
59
|
--json filters to JSON and GraphQL responses only
|
|
53
60
|
network detail <recordId> [--probe]
|
|
54
|
-
fetch <url> [--method <m>] [--header key=value ...] [--query key=value ...] [--body <json>] [--body-text <text>] [--transport auto|direct|matched-tls|page] [--cookies] [--follow-redirects]
|
|
61
|
+
fetch <url> [--method <m>] [--header key=value ...] [--query key=value ...] [--body <json>] [--body-text <text>] [--transport auto|direct|matched-tls|context|page] [--cookies] [--follow-redirects]
|
|
55
62
|
|
|
56
63
|
Browser State:
|
|
57
64
|
state [domain]
|
|
@@ -148,6 +155,9 @@ function resolveCommandLength(tokens) {
|
|
|
148
155
|
if (tokens[0] === "skills") {
|
|
149
156
|
return Math.min(tokens.length, 2);
|
|
150
157
|
}
|
|
158
|
+
if (tokens[0] === "view") {
|
|
159
|
+
return Math.min(tokens.length, 2);
|
|
160
|
+
}
|
|
151
161
|
if (tokens[0] === "status" || tokens[0] === "record" || tokens[0] === "exec") {
|
|
152
162
|
return 1;
|
|
153
163
|
}
|
|
@@ -179,6 +189,8 @@ var CLI_OPTION_SPECS = {
|
|
|
179
189
|
copy: { kind: "boolean" },
|
|
180
190
|
all: { kind: "boolean" },
|
|
181
191
|
list: { kind: "boolean" },
|
|
192
|
+
auto: { kind: "boolean" },
|
|
193
|
+
"no-auto": { kind: "boolean" },
|
|
182
194
|
"attach-endpoint": { kind: "value" },
|
|
183
195
|
"attach-header": { kind: "value", multiple: true },
|
|
184
196
|
"fresh-tab": { kind: "boolean" },
|
|
@@ -340,6 +352,14 @@ function parseCommandLine(argv) {
|
|
|
340
352
|
const json = readOptionalBoolean(rawOptions, "json");
|
|
341
353
|
const agents = rawOptions.get("agent");
|
|
342
354
|
const skills = rawOptions.get("skill");
|
|
355
|
+
const autoLocalView = readOptionalBoolean(rawOptions, "auto");
|
|
356
|
+
const noAutoLocalView = readOptionalBoolean(rawOptions, "no-auto");
|
|
357
|
+
if (autoLocalView === true && noAutoLocalView === true) {
|
|
358
|
+
throw new Error('Options "--auto" and "--no-auto" cannot be combined.');
|
|
359
|
+
}
|
|
360
|
+
if (command[0] !== "view" && (autoLocalView !== void 0 || noAutoLocalView !== void 0)) {
|
|
361
|
+
throw new Error('Options "--auto" and "--no-auto" are only supported with "view".');
|
|
362
|
+
}
|
|
343
363
|
const global = readOptionalBoolean(rawOptions, "global");
|
|
344
364
|
const yes = readOptionalBoolean(rawOptions, "yes");
|
|
345
365
|
const copy = readOptionalBoolean(rawOptions, "copy");
|
|
@@ -362,6 +382,7 @@ function parseCommandLine(argv) {
|
|
|
362
382
|
...json === void 0 ? {} : { json },
|
|
363
383
|
...agents === void 0 ? {} : { agents },
|
|
364
384
|
...skills === void 0 ? {} : { skills },
|
|
385
|
+
...autoLocalView === true ? { localViewMode: "auto" } : noAutoLocalView === true ? { localViewMode: "manual" } : {},
|
|
365
386
|
...global === void 0 ? {} : { global },
|
|
366
387
|
...yes === void 0 ? {} : { yes },
|
|
367
388
|
...copy === void 0 ? {} : { copy },
|
|
@@ -464,7 +485,7 @@ function readJsonArray(options, name) {
|
|
|
464
485
|
|
|
465
486
|
// src/cli/operation-input.ts
|
|
466
487
|
var CLICK_BUTTONS = /* @__PURE__ */ new Set(["left", "middle", "right"]);
|
|
467
|
-
var FETCH_TRANSPORTS = /* @__PURE__ */ new Set(["auto", "direct", "matched-tls", "page"]);
|
|
488
|
+
var FETCH_TRANSPORTS = /* @__PURE__ */ new Set(["auto", "direct", "matched-tls", "context", "page"]);
|
|
468
489
|
var CAPTCHA_PROVIDERS = /* @__PURE__ */ new Set(["2captcha", "capsolver"]);
|
|
469
490
|
var CAPTCHA_TYPES = /* @__PURE__ */ new Set(["recaptcha-v2", "hcaptcha", "turnstile"]);
|
|
470
491
|
var SANDBOX_FIDELITIES = /* @__PURE__ */ new Set(["minimal", "standard", "full"]);
|
|
@@ -588,7 +609,7 @@ async function buildOperationInput(operation, parsed, runtime) {
|
|
|
588
609
|
const capture = readSingle(parsed.rawOptions, "capture");
|
|
589
610
|
const url = readSingle(parsed.rawOptions, "url");
|
|
590
611
|
const hostname = readSingle(parsed.rawOptions, "hostname");
|
|
591
|
-
const
|
|
612
|
+
const path5 = readSingle(parsed.rawOptions, "path");
|
|
592
613
|
const method = readSingle(parsed.rawOptions, "method");
|
|
593
614
|
const status = readOptionalNumber(parsed.rawOptions, "status");
|
|
594
615
|
const resourceType = readSingle(parsed.rawOptions, "type");
|
|
@@ -600,7 +621,7 @@ async function buildOperationInput(operation, parsed, runtime) {
|
|
|
600
621
|
...capture === void 0 ? {} : { capture },
|
|
601
622
|
...url === void 0 ? {} : { url },
|
|
602
623
|
...hostname === void 0 ? {} : { hostname },
|
|
603
|
-
...
|
|
624
|
+
...path5 === void 0 ? {} : { path: path5 },
|
|
604
625
|
...method === void 0 ? {} : { method },
|
|
605
626
|
...status === void 0 ? {} : { status },
|
|
606
627
|
...resourceType === void 0 ? {} : { resourceType },
|
|
@@ -945,7 +966,9 @@ function readClickButton(value) {
|
|
|
945
966
|
}
|
|
946
967
|
function readFetchTransport(value) {
|
|
947
968
|
if (value === void 0 || !FETCH_TRANSPORTS.has(value)) {
|
|
948
|
-
throw new Error(
|
|
969
|
+
throw new Error(
|
|
970
|
+
'Expected "--transport" to be one of: auto, direct, matched-tls, context, page.'
|
|
971
|
+
);
|
|
949
972
|
}
|
|
950
973
|
return value;
|
|
951
974
|
}
|
|
@@ -1920,6 +1943,21 @@ function resolveOpensteerLocalSkillSourcePath() {
|
|
|
1920
1943
|
}
|
|
1921
1944
|
throw new Error("Unable to find the packaged Opensteer skill source directory.");
|
|
1922
1945
|
}
|
|
1946
|
+
function resolveOpensteerRepoSkillSourcePath(startDir = process.cwd()) {
|
|
1947
|
+
let currentDir = path2.resolve(startDir);
|
|
1948
|
+
const filesystemRoot = path2.parse(currentDir).root;
|
|
1949
|
+
while (true) {
|
|
1950
|
+
const candidate = path2.join(currentDir, "skills");
|
|
1951
|
+
const skillManifest = path2.join(candidate, "opensteer", "SKILL.md");
|
|
1952
|
+
if (existsSync(skillManifest)) {
|
|
1953
|
+
return candidate;
|
|
1954
|
+
}
|
|
1955
|
+
if (currentDir === filesystemRoot) {
|
|
1956
|
+
return void 0;
|
|
1957
|
+
}
|
|
1958
|
+
currentDir = path2.dirname(currentDir);
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1923
1961
|
async function checkOpensteerGitHubReachable() {
|
|
1924
1962
|
try {
|
|
1925
1963
|
const response = await fetch(`https://github.com/${OPENSTEER_GITHUB_SOURCE}`, {
|
|
@@ -1935,13 +1973,14 @@ async function checkOpensteerGitHubReachable() {
|
|
|
1935
1973
|
async function runOpensteerSkillsInstaller(options = {}, overrideDeps = {}) {
|
|
1936
1974
|
const deps = {
|
|
1937
1975
|
resolveSkillsCliPath: resolveOpensteerSkillsCliPath,
|
|
1976
|
+
resolveRepoSkillSourcePath: resolveOpensteerRepoSkillSourcePath,
|
|
1938
1977
|
resolveLocalSkillSourcePath: resolveOpensteerLocalSkillSourcePath,
|
|
1939
1978
|
checkGitHubReachable: checkOpensteerGitHubReachable,
|
|
1940
1979
|
spawnInvocation: spawnOpensteerSkillsInvocation,
|
|
1941
1980
|
...overrideDeps
|
|
1942
1981
|
};
|
|
1943
|
-
const
|
|
1944
|
-
const skillSourcePath =
|
|
1982
|
+
const repoSkillSourcePath = deps.resolveRepoSkillSourcePath();
|
|
1983
|
+
const skillSourcePath = repoSkillSourcePath ?? (await deps.checkGitHubReachable() ? OPENSTEER_GITHUB_SOURCE : deps.resolveLocalSkillSourcePath());
|
|
1945
1984
|
const invocation = createOpensteerSkillsInvocation({
|
|
1946
1985
|
options,
|
|
1947
1986
|
skillsCliPath: deps.resolveSkillsCliPath(),
|
|
@@ -2128,7 +2167,7 @@ function formatLaneRow(input) {
|
|
|
2128
2167
|
const provider = input.provider.padEnd(7, " ");
|
|
2129
2168
|
const status = input.status.padEnd(9, " ");
|
|
2130
2169
|
const summary = input.summary.padEnd(16, " ");
|
|
2131
|
-
return `${input.marker} ${provider} ${status} ${summary}${input.detail
|
|
2170
|
+
return `${input.marker} ${provider} ${status} ${summary}${input.detail === void 0 ? "" : ` ${input.detail}`}`.trimEnd();
|
|
2132
2171
|
}
|
|
2133
2172
|
|
|
2134
2173
|
// src/cli/exec.ts
|
|
@@ -2143,6 +2182,82 @@ async function runExecExpression(context, expression) {
|
|
|
2143
2182
|
}
|
|
2144
2183
|
return fn.call(context);
|
|
2145
2184
|
}
|
|
2185
|
+
async function handleViewCommand(parsed) {
|
|
2186
|
+
const subcommand = parsed.command[1];
|
|
2187
|
+
if (subcommand === "serve") {
|
|
2188
|
+
assertNoViewPreferenceFlag(parsed);
|
|
2189
|
+
await runLocalViewService();
|
|
2190
|
+
return;
|
|
2191
|
+
}
|
|
2192
|
+
if (subcommand === "stop") {
|
|
2193
|
+
assertNoViewPreferenceFlag(parsed);
|
|
2194
|
+
const stopped = await stopLocalViewService();
|
|
2195
|
+
writeViewOutput(parsed, { stopped });
|
|
2196
|
+
return;
|
|
2197
|
+
}
|
|
2198
|
+
if (subcommand !== void 0) {
|
|
2199
|
+
throw new Error(`Unknown view command: view ${subcommand}`);
|
|
2200
|
+
}
|
|
2201
|
+
if (parsed.options.localViewMode !== void 0) {
|
|
2202
|
+
const preference = await setLocalViewMode(parsed.options.localViewMode);
|
|
2203
|
+
writeViewOutput(parsed, { mode: preference.mode });
|
|
2204
|
+
return;
|
|
2205
|
+
}
|
|
2206
|
+
const service = await ensureLocalViewServiceRunning();
|
|
2207
|
+
const sessionId = parsed.options.workspace === void 0 ? void 0 : await resolveWorkspaceSessionId({
|
|
2208
|
+
rootDir: process.cwd(),
|
|
2209
|
+
workspace: parsed.options.workspace
|
|
2210
|
+
});
|
|
2211
|
+
const url = buildLocalViewSessionUrl({
|
|
2212
|
+
baseUrl: service.url,
|
|
2213
|
+
...sessionId === void 0 ? {} : { sessionId }
|
|
2214
|
+
});
|
|
2215
|
+
writeViewOutput(parsed, {
|
|
2216
|
+
url,
|
|
2217
|
+
...sessionId === void 0 ? {} : { sessionId }
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
2220
|
+
async function resolveWorkspaceSessionId(input) {
|
|
2221
|
+
const rootPath = resolveFilesystemWorkspacePath({
|
|
2222
|
+
rootDir: path2.resolve(input.rootDir),
|
|
2223
|
+
workspace: input.workspace
|
|
2224
|
+
});
|
|
2225
|
+
const live = await readPersistedLocalBrowserSessionRecord(rootPath);
|
|
2226
|
+
if (!live || !isProcessRunning(live.pid)) {
|
|
2227
|
+
return void 0;
|
|
2228
|
+
}
|
|
2229
|
+
return buildLocalViewSessionId({
|
|
2230
|
+
rootPath,
|
|
2231
|
+
pid: live.pid,
|
|
2232
|
+
startedAt: live.startedAt
|
|
2233
|
+
});
|
|
2234
|
+
}
|
|
2235
|
+
function assertNoViewPreferenceFlag(parsed) {
|
|
2236
|
+
if (parsed.options.localViewMode !== void 0) {
|
|
2237
|
+
throw new Error("View preference flags cannot be combined with this subcommand.");
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
function writeViewOutput(parsed, value) {
|
|
2241
|
+
if (parsed.options.json === true) {
|
|
2242
|
+
process.stdout.write(`${JSON.stringify(value, null, 2)}
|
|
2243
|
+
`);
|
|
2244
|
+
return;
|
|
2245
|
+
}
|
|
2246
|
+
if ("url" in value) {
|
|
2247
|
+
process.stdout.write(`${value.url}
|
|
2248
|
+
`);
|
|
2249
|
+
return;
|
|
2250
|
+
}
|
|
2251
|
+
if ("stopped" in value) {
|
|
2252
|
+
process.stdout.write(
|
|
2253
|
+
`${value.stopped ? "Local view service stopped." : "Local view service is not running."}
|
|
2254
|
+
`
|
|
2255
|
+
);
|
|
2256
|
+
return;
|
|
2257
|
+
}
|
|
2258
|
+
process.stdout.write(`Local view preference set to ${value.mode}.
|
|
2259
|
+
`);
|
|
2260
|
+
}
|
|
2146
2261
|
|
|
2147
2262
|
// src/cli/bin.ts
|
|
2148
2263
|
var emitProcessWarning = process4.emitWarning.bind(process4);
|
|
@@ -2194,6 +2309,10 @@ async function main() {
|
|
|
2194
2309
|
await handleRecordCommandEntry(parsed);
|
|
2195
2310
|
return;
|
|
2196
2311
|
}
|
|
2312
|
+
if (parsed.command[0] === "view") {
|
|
2313
|
+
await handleViewCommand(parsed);
|
|
2314
|
+
return;
|
|
2315
|
+
}
|
|
2197
2316
|
if (parsed.command[0] === "exec") {
|
|
2198
2317
|
await handleExecCommand(parsed);
|
|
2199
2318
|
return;
|
|
@@ -2246,7 +2365,7 @@ async function handleExecCommand(parsed) {
|
|
|
2246
2365
|
);
|
|
2247
2366
|
}
|
|
2248
2367
|
const { engineName, runtimeProvider } = resolveCliRuntimeSelection(parsed);
|
|
2249
|
-
const { Opensteer } = await import('../opensteer-
|
|
2368
|
+
const { Opensteer } = await import('../opensteer-KZCRP425.js');
|
|
2250
2369
|
const opensteer = new Opensteer({
|
|
2251
2370
|
workspace: parsed.options.workspace,
|
|
2252
2371
|
rootDir: process4.cwd(),
|