opensteer 0.9.6 → 0.9.7

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 (33) hide show
  1. package/dist/{chunk-BVRIPCWA.js → chunk-3OHKIPBD.js} +316 -465
  2. package/dist/chunk-3OHKIPBD.js.map +1 -0
  3. package/dist/{chunk-L4NF74KI.js → chunk-52UNH5UW.js} +5 -5
  4. package/dist/{chunk-L4NF74KI.js.map → chunk-52UNH5UW.js.map} +1 -1
  5. package/dist/{chunk-3XBQRZZC.js → chunk-PJXN7HED.js} +115 -14
  6. package/dist/chunk-PJXN7HED.js.map +1 -0
  7. package/dist/{chunk-3I3A5OLB.js → chunk-R33BXCMQ.js} +16 -7
  8. package/dist/chunk-R33BXCMQ.js.map +1 -0
  9. package/dist/{chunk-T5P2QGZ3.js → chunk-U4BUCIZ4.js} +153 -12
  10. package/dist/chunk-U4BUCIZ4.js.map +1 -0
  11. package/dist/cli/bin.cjs +663 -544
  12. package/dist/cli/bin.cjs.map +1 -1
  13. package/dist/cli/bin.js +66 -50
  14. package/dist/cli/bin.js.map +1 -1
  15. package/dist/index.cjs +584 -495
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +26 -50
  18. package/dist/index.d.ts +26 -50
  19. package/dist/index.js +4 -4
  20. package/dist/local-view/public/assets/app.js +10 -1
  21. package/dist/local-view/serve-entry.cjs +687 -494
  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-CY2QUJEG.js +6 -0
  25. package/dist/{opensteer-UGA6YBRN.js.map → opensteer-CY2QUJEG.js.map} +1 -1
  26. package/dist/{session-control-U3L5H2ZI.js → session-control-FIP6ZJLH.js} +4 -4
  27. package/dist/{session-control-U3L5H2ZI.js.map → session-control-FIP6ZJLH.js.map} +1 -1
  28. package/package.json +7 -7
  29. package/dist/chunk-3I3A5OLB.js.map +0 -1
  30. package/dist/chunk-3XBQRZZC.js.map +0 -1
  31. package/dist/chunk-BVRIPCWA.js.map +0 -1
  32. package/dist/chunk-T5P2QGZ3.js.map +0 -1
  33. package/dist/opensteer-UGA6YBRN.js +0 -6
package/dist/cli/bin.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { runLocalViewService } from '../chunk-3I3A5OLB.js';
3
- import { createOpensteerSemanticRuntime, dispatchSemanticOperation, isBrowserCoreError, loadEnvironment, normalizeOpensteerProviderMode, resolveOpensteerRuntimeConfig, assertProviderSupportsEngine, resolveOpensteerProvider, requireCloudAppBaseUrl, CloudSessionProxy, FlowRecorderCollector, generateReplayScript, OpensteerCloudClient } from '../chunk-BVRIPCWA.js';
4
- import { isOpensteerProtocolError, OpensteerBrowserManager, stopLocalViewService, setLocalViewMode, ensureLocalViewServiceRunning, buildLocalViewSessionUrl, resolveOpensteerEngineName, resolveFilesystemWorkspacePath } from '../chunk-3XBQRZZC.js';
5
- import { discoverLocalCdpBrowsers, inspectCdpEndpoint, readPersistedLocalBrowserSessionRecord, isProcessRunning, buildLocalViewSessionId, pathExists, readPersistedCloudSessionRecord } from '../chunk-T5P2QGZ3.js';
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';
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.6"};
17
+ version: "0.9.7"};
18
18
 
19
19
  // src/cli/env-loader.ts
20
20
  async function loadCliEnvironment(cwd) {
@@ -1159,6 +1159,7 @@ function joinRest(rest, startIndex) {
1159
1159
  function renderOperationOutput(operation, result, input) {
1160
1160
  switch (operation) {
1161
1161
  case "session.open":
1162
+ case "page.activate":
1162
1163
  case "page.goto":
1163
1164
  return renderJson(formatNavigationOutput(result));
1164
1165
  case "page.snapshot":
@@ -1167,14 +1168,14 @@ function renderOperationOutput(operation, result, input) {
1167
1168
  case "dom.hover":
1168
1169
  case "dom.input":
1169
1170
  case "dom.scroll":
1170
- return renderJson(formatActionOutput(result, input));
1171
+ return renderJson(formatActionOutput(result));
1171
1172
  case "dom.extract":
1172
1173
  return renderJson(formatExtractOutput(result));
1173
1174
  case "page.list":
1174
- case "page.new":
1175
- case "page.activate":
1176
1175
  case "page.close":
1177
1176
  return formatTabOutput(result);
1177
+ case "page.new":
1178
+ return renderJson(formatCreatedPageOutput(result));
1178
1179
  case "network.query":
1179
1180
  return formatNetworkQueryOutput(result, input);
1180
1181
  case "network.detail":
@@ -1212,6 +1213,12 @@ function formatNavigationOutput(result) {
1212
1213
  ...readStringField(result, "title") === void 0 ? {} : { title: readStringField(result, "title") }
1213
1214
  };
1214
1215
  }
1216
+ function formatCreatedPageOutput(result) {
1217
+ return {
1218
+ ...readStringField(result, "pageRef") === void 0 ? {} : { pageRef: readStringField(result, "pageRef") },
1219
+ ...formatNavigationOutput(result)
1220
+ };
1221
+ }
1215
1222
  function formatSnapshotOutput(result) {
1216
1223
  if (result !== null && typeof result === "object" && typeof result.html === "string") {
1217
1224
  return `${result.html}
@@ -1219,36 +1226,11 @@ function formatSnapshotOutput(result) {
1219
1226
  }
1220
1227
  return renderJson(result);
1221
1228
  }
1222
- function formatActionOutput(result, input) {
1223
- const target = readObjectField(result, "target");
1224
- const output = {
1225
- ...readStringField(target, "tagName") === void 0 ? {} : { tagName: readStringField(target, "tagName") },
1226
- ...readStringField(target, "pathHint") === void 0 ? {} : { pathHint: readStringField(target, "pathHint") }
1229
+ function formatActionOutput(result) {
1230
+ return {
1231
+ ...readStringField(result, "tagName") === void 0 ? {} : { tagName: readStringField(result, "tagName") },
1232
+ ...readStringField(result, "persist") === void 0 ? {} : { persist: readStringField(result, "persist") }
1227
1233
  };
1228
- const point = readObjectField(result, "point");
1229
- if (point !== void 0) {
1230
- output.point = {
1231
- ...readNumberField(point, "x") === void 0 ? {} : { x: readNumberField(point, "x") },
1232
- ...readNumberField(point, "y") === void 0 ? {} : { y: readNumberField(point, "y") }
1233
- };
1234
- }
1235
- const persist = readStringField(target, "persist");
1236
- if (persist !== void 0) {
1237
- output.persist = persist;
1238
- }
1239
- const text = readStringField(input, "text");
1240
- if (text !== void 0) {
1241
- output.text = text;
1242
- }
1243
- const direction = readStringField(input, "direction");
1244
- if (direction !== void 0) {
1245
- output.direction = direction;
1246
- }
1247
- const amount = readNumberField(input, "amount");
1248
- if (amount !== void 0) {
1249
- output.amount = amount;
1250
- }
1251
- return output;
1252
1234
  }
1253
1235
  function formatExtractOutput(result) {
1254
1236
  const data = readUnknownField(result, "data");
@@ -1480,20 +1462,18 @@ function formatStateOutput(result) {
1480
1462
  `;
1481
1463
  }
1482
1464
  function formatComputerOutput(result) {
1483
- const action = readObjectField(result, "action");
1484
1465
  const screenshot = readObjectField(result, "screenshot");
1485
1466
  const payload = readObjectField(screenshot, "payload");
1486
- const timing = readObjectField(result, "timing");
1487
1467
  return {
1488
- ...action === void 0 ? {} : { action },
1468
+ ...readStringField(result, "url") === void 0 ? {} : { url: readStringField(result, "url") },
1469
+ ...readStringField(result, "title") === void 0 ? {} : { title: readStringField(result, "title") },
1489
1470
  ...payload === void 0 ? {} : {
1490
1471
  screenshot: {
1491
1472
  ...readStringField(payload, "uri") === void 0 ? {} : { uri: readStringField(payload, "uri") },
1492
1473
  ...readStringField(screenshot, "format") === void 0 ? {} : { format: readStringField(screenshot, "format") },
1493
1474
  ...readObjectField(screenshot, "size") === void 0 ? {} : { size: readObjectField(screenshot, "size") }
1494
1475
  }
1495
- },
1496
- ...timing === void 0 ? {} : { timingMs: timing }
1476
+ }
1497
1477
  };
1498
1478
  }
1499
1479
  function formatScriptsCaptureOutput(result) {
@@ -2141,7 +2121,7 @@ async function collectOpensteerStatus(input) {
2141
2121
  ...output,
2142
2122
  rootPath,
2143
2123
  lanes: {
2144
- local: describeLocalLane(localRecord, input.provider.mode === "local"),
2124
+ local: await describeLocalLane(localRecord, input.provider.mode === "local"),
2145
2125
  cloud: await describeCloudLane({
2146
2126
  record: cloudRecord,
2147
2127
  current: input.provider.mode === "cloud",
@@ -2193,8 +2173,38 @@ async function readWorkspaceCloudRecord(rootPath) {
2193
2173
  }
2194
2174
  return readPersistedCloudSessionRecord(rootPath);
2195
2175
  }
2196
- function describeLocalLane(record, current) {
2197
- if (record === void 0 || !isProcessRunning(record.pid)) {
2176
+ async function describeLocalLane(record, current) {
2177
+ if (record === void 0) {
2178
+ return {
2179
+ provider: "local",
2180
+ status: "idle",
2181
+ current,
2182
+ summary: "none"
2183
+ };
2184
+ }
2185
+ if (getPersistedLocalBrowserSessionOwnership(record) === "attached") {
2186
+ if (!await isAttachedLocalBrowserSessionReachable(record)) {
2187
+ return {
2188
+ provider: "local",
2189
+ status: "stale",
2190
+ current,
2191
+ summary: "attached browser unavailable",
2192
+ detail: record.engine,
2193
+ engine: record.engine
2194
+ };
2195
+ }
2196
+ const browser2 = record.executablePath ? path2.basename(record.executablePath).replace(/\.[A-Za-z0-9]+$/u, "") : void 0;
2197
+ return {
2198
+ provider: "local",
2199
+ status: "active",
2200
+ current,
2201
+ summary: "attached browser",
2202
+ detail: browser2 ?? record.engine,
2203
+ engine: record.engine,
2204
+ ...browser2 === void 0 ? {} : { browser: browser2 }
2205
+ };
2206
+ }
2207
+ if (!isProcessRunning(record.pid)) {
2198
2208
  return {
2199
2209
  provider: "local",
2200
2210
  status: "idle",
@@ -2340,13 +2350,19 @@ async function resolveWorkspaceSessionId(input) {
2340
2350
  workspace: input.workspace
2341
2351
  });
2342
2352
  const live = await readPersistedLocalBrowserSessionRecord(rootPath);
2343
- if (!live || !isProcessRunning(live.pid)) {
2353
+ if (!live) {
2354
+ return void 0;
2355
+ }
2356
+ if (getPersistedLocalBrowserSessionOwnership(live) === "attached") {
2357
+ if (!await isAttachedLocalBrowserSessionReachable(live)) {
2358
+ return void 0;
2359
+ }
2360
+ } else if (!isProcessRunning(live.pid)) {
2344
2361
  return void 0;
2345
2362
  }
2346
- return buildLocalViewSessionId({
2363
+ return buildLocalViewSessionIdForRecord({
2347
2364
  rootPath,
2348
- pid: live.pid,
2349
- startedAt: live.startedAt
2365
+ live
2350
2366
  });
2351
2367
  }
2352
2368
  function assertNoViewPreferenceFlag(parsed) {
@@ -2500,7 +2516,7 @@ async function handleExecCommand(parsed) {
2500
2516
  );
2501
2517
  }
2502
2518
  const { engineName, runtimeProvider } = resolveCliRuntimeSelection(parsed);
2503
- const { Opensteer } = await import('../opensteer-UGA6YBRN.js');
2519
+ const { Opensteer } = await import('../opensteer-CY2QUJEG.js');
2504
2520
  const opensteer = new Opensteer({
2505
2521
  workspace: parsed.options.workspace,
2506
2522
  rootDir: process4.cwd(),