opensteer 0.9.0 → 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/dist/chunk-4LP7QP2O.js +4336 -0
- package/dist/chunk-4LP7QP2O.js.map +1 -0
- package/dist/{chunk-656MQUSM.js → chunk-6PGXWW3X.js} +4787 -9519
- 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-OIKLSFXA.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 +3050 -281
- package/dist/cli/bin.cjs.map +1 -1
- package/dist/cli/bin.js +124 -7
- package/dist/cli/bin.js.map +1 -1
- package/dist/index.cjs +918 -263
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- 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-LKX3233A.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 +3 -0
- package/skills/opensteer/SKILL.md +229 -48
- package/dist/chunk-656MQUSM.js.map +0 -1
- package/dist/chunk-OIKLSFXA.js.map +0 -1
- package/dist/opensteer-LKX3233A.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.9.
|
|
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>]
|
|
@@ -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 },
|
|
@@ -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 },
|
|
@@ -1922,6 +1943,21 @@ function resolveOpensteerLocalSkillSourcePath() {
|
|
|
1922
1943
|
}
|
|
1923
1944
|
throw new Error("Unable to find the packaged Opensteer skill source directory.");
|
|
1924
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
|
+
}
|
|
1925
1961
|
async function checkOpensteerGitHubReachable() {
|
|
1926
1962
|
try {
|
|
1927
1963
|
const response = await fetch(`https://github.com/${OPENSTEER_GITHUB_SOURCE}`, {
|
|
@@ -1937,13 +1973,14 @@ async function checkOpensteerGitHubReachable() {
|
|
|
1937
1973
|
async function runOpensteerSkillsInstaller(options = {}, overrideDeps = {}) {
|
|
1938
1974
|
const deps = {
|
|
1939
1975
|
resolveSkillsCliPath: resolveOpensteerSkillsCliPath,
|
|
1976
|
+
resolveRepoSkillSourcePath: resolveOpensteerRepoSkillSourcePath,
|
|
1940
1977
|
resolveLocalSkillSourcePath: resolveOpensteerLocalSkillSourcePath,
|
|
1941
1978
|
checkGitHubReachable: checkOpensteerGitHubReachable,
|
|
1942
1979
|
spawnInvocation: spawnOpensteerSkillsInvocation,
|
|
1943
1980
|
...overrideDeps
|
|
1944
1981
|
};
|
|
1945
|
-
const
|
|
1946
|
-
const skillSourcePath =
|
|
1982
|
+
const repoSkillSourcePath = deps.resolveRepoSkillSourcePath();
|
|
1983
|
+
const skillSourcePath = repoSkillSourcePath ?? (await deps.checkGitHubReachable() ? OPENSTEER_GITHUB_SOURCE : deps.resolveLocalSkillSourcePath());
|
|
1947
1984
|
const invocation = createOpensteerSkillsInvocation({
|
|
1948
1985
|
options,
|
|
1949
1986
|
skillsCliPath: deps.resolveSkillsCliPath(),
|
|
@@ -2145,6 +2182,82 @@ async function runExecExpression(context, expression) {
|
|
|
2145
2182
|
}
|
|
2146
2183
|
return fn.call(context);
|
|
2147
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
|
+
}
|
|
2148
2261
|
|
|
2149
2262
|
// src/cli/bin.ts
|
|
2150
2263
|
var emitProcessWarning = process4.emitWarning.bind(process4);
|
|
@@ -2196,6 +2309,10 @@ async function main() {
|
|
|
2196
2309
|
await handleRecordCommandEntry(parsed);
|
|
2197
2310
|
return;
|
|
2198
2311
|
}
|
|
2312
|
+
if (parsed.command[0] === "view") {
|
|
2313
|
+
await handleViewCommand(parsed);
|
|
2314
|
+
return;
|
|
2315
|
+
}
|
|
2199
2316
|
if (parsed.command[0] === "exec") {
|
|
2200
2317
|
await handleExecCommand(parsed);
|
|
2201
2318
|
return;
|
|
@@ -2248,7 +2365,7 @@ async function handleExecCommand(parsed) {
|
|
|
2248
2365
|
);
|
|
2249
2366
|
}
|
|
2250
2367
|
const { engineName, runtimeProvider } = resolveCliRuntimeSelection(parsed);
|
|
2251
|
-
const { Opensteer } = await import('../opensteer-
|
|
2368
|
+
const { Opensteer } = await import('../opensteer-KZCRP425.js');
|
|
2252
2369
|
const opensteer = new Opensteer({
|
|
2253
2370
|
workspace: parsed.options.workspace,
|
|
2254
2371
|
rootDir: process4.cwd(),
|