opensteer 0.8.4 → 0.8.6
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-C7GWMSTV.js → chunk-KYRC6CLB.js} +7946 -7899
- package/dist/chunk-KYRC6CLB.js.map +1 -0
- package/dist/cli/bin.cjs +327 -255
- package/dist/cli/bin.cjs.map +1 -1
- package/dist/cli/bin.js +67 -41
- package/dist/cli/bin.js.map +1 -1
- package/dist/index.cjs +8020 -7966
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +78 -11
- package/dist/index.d.ts +78 -11
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/skills/opensteer/SKILL.md +10 -9
- package/skills/opensteer/references/cli-reference.md +37 -6
- package/skills/opensteer/references/request-workflow.md +2 -0
- package/skills/opensteer/references/sdk-reference.md +2 -0
- package/dist/chunk-C7GWMSTV.js.map +0 -1
package/dist/cli/bin.cjs
CHANGED
|
@@ -49,6 +49,9 @@ var prettier__namespace = /*#__PURE__*/_interopNamespace(prettier);
|
|
|
49
49
|
var vm__default = /*#__PURE__*/_interopDefault(vm);
|
|
50
50
|
var WebSocket2__default = /*#__PURE__*/_interopDefault(WebSocket2);
|
|
51
51
|
|
|
52
|
+
// package.json
|
|
53
|
+
var package_default = {
|
|
54
|
+
version: "0.8.6"};
|
|
52
55
|
util.promisify(child_process.execFile);
|
|
53
56
|
Math.floor(Date.now() - process.uptime() * 1e3);
|
|
54
57
|
({ ...process.env});
|
|
@@ -8949,101 +8952,20 @@ function createReverseReportRegistry(rootPath) {
|
|
|
8949
8952
|
}
|
|
8950
8953
|
var TAG_DELIMITER = "";
|
|
8951
8954
|
var NODE_SQLITE_SPECIFIER = `node:${"sqlite"}`;
|
|
8955
|
+
var SAVED_NETWORK_SQLITE_SUPPORT_ERROR = "Saved-network operations require Node's built-in SQLite support. Use a Node runtime with node:sqlite enabled.";
|
|
8952
8956
|
var SqliteSavedNetworkStore = class {
|
|
8953
8957
|
databasePath;
|
|
8954
8958
|
database;
|
|
8959
|
+
directoryInitialization;
|
|
8960
|
+
databaseInitialization;
|
|
8955
8961
|
constructor(rootPath) {
|
|
8956
8962
|
this.databasePath = path6__default.default.join(rootPath, "registry", "saved-network.sqlite");
|
|
8957
8963
|
}
|
|
8958
8964
|
async initialize() {
|
|
8959
|
-
await
|
|
8960
|
-
const { DatabaseSync } = await import(NODE_SQLITE_SPECIFIER);
|
|
8961
|
-
const database = new DatabaseSync(this.databasePath);
|
|
8962
|
-
database.exec("PRAGMA journal_mode = WAL");
|
|
8963
|
-
database.exec("PRAGMA foreign_keys = ON");
|
|
8964
|
-
database.exec(`
|
|
8965
|
-
CREATE TABLE IF NOT EXISTS saved_network_records (
|
|
8966
|
-
record_id TEXT PRIMARY KEY,
|
|
8967
|
-
request_id TEXT NOT NULL,
|
|
8968
|
-
session_ref TEXT NOT NULL,
|
|
8969
|
-
page_ref TEXT,
|
|
8970
|
-
page_ref_key TEXT NOT NULL,
|
|
8971
|
-
frame_ref TEXT,
|
|
8972
|
-
document_ref TEXT,
|
|
8973
|
-
action_id TEXT,
|
|
8974
|
-
method TEXT NOT NULL,
|
|
8975
|
-
method_lc TEXT NOT NULL,
|
|
8976
|
-
url TEXT NOT NULL,
|
|
8977
|
-
url_lc TEXT NOT NULL,
|
|
8978
|
-
hostname TEXT NOT NULL,
|
|
8979
|
-
hostname_lc TEXT NOT NULL,
|
|
8980
|
-
path TEXT NOT NULL,
|
|
8981
|
-
path_lc TEXT NOT NULL,
|
|
8982
|
-
status INTEGER,
|
|
8983
|
-
status_text TEXT,
|
|
8984
|
-
resource_type TEXT NOT NULL,
|
|
8985
|
-
navigation_request INTEGER NOT NULL,
|
|
8986
|
-
request_headers_json TEXT NOT NULL,
|
|
8987
|
-
response_headers_json TEXT NOT NULL,
|
|
8988
|
-
request_body_json TEXT,
|
|
8989
|
-
response_body_json TEXT,
|
|
8990
|
-
initiator_json TEXT,
|
|
8991
|
-
timing_json TEXT,
|
|
8992
|
-
transfer_json TEXT,
|
|
8993
|
-
source_json TEXT,
|
|
8994
|
-
capture_state TEXT NOT NULL,
|
|
8995
|
-
request_body_state TEXT NOT NULL,
|
|
8996
|
-
response_body_state TEXT NOT NULL,
|
|
8997
|
-
request_body_skip_reason TEXT,
|
|
8998
|
-
response_body_skip_reason TEXT,
|
|
8999
|
-
request_body_error TEXT,
|
|
9000
|
-
response_body_error TEXT,
|
|
9001
|
-
redirect_from_request_id TEXT,
|
|
9002
|
-
redirect_to_request_id TEXT,
|
|
9003
|
-
saved_at INTEGER NOT NULL
|
|
9004
|
-
);
|
|
9005
|
-
|
|
9006
|
-
CREATE UNIQUE INDEX IF NOT EXISTS saved_network_records_scope_request
|
|
9007
|
-
ON saved_network_records (session_ref, page_ref_key, request_id);
|
|
9008
|
-
|
|
9009
|
-
CREATE INDEX IF NOT EXISTS saved_network_records_saved_at
|
|
9010
|
-
ON saved_network_records (saved_at DESC);
|
|
9011
|
-
|
|
9012
|
-
CREATE TABLE IF NOT EXISTS saved_network_tags (
|
|
9013
|
-
record_id TEXT NOT NULL REFERENCES saved_network_records(record_id) ON DELETE CASCADE,
|
|
9014
|
-
tag TEXT NOT NULL,
|
|
9015
|
-
PRIMARY KEY (record_id, tag)
|
|
9016
|
-
);
|
|
9017
|
-
|
|
9018
|
-
CREATE INDEX IF NOT EXISTS saved_network_tags_tag
|
|
9019
|
-
ON saved_network_tags (tag);
|
|
9020
|
-
`);
|
|
9021
|
-
this.ensureColumn(
|
|
9022
|
-
database,
|
|
9023
|
-
"saved_network_records",
|
|
9024
|
-
"capture_state",
|
|
9025
|
-
"TEXT NOT NULL DEFAULT 'complete'"
|
|
9026
|
-
);
|
|
9027
|
-
this.ensureColumn(
|
|
9028
|
-
database,
|
|
9029
|
-
"saved_network_records",
|
|
9030
|
-
"request_body_state",
|
|
9031
|
-
"TEXT NOT NULL DEFAULT 'skipped'"
|
|
9032
|
-
);
|
|
9033
|
-
this.ensureColumn(
|
|
9034
|
-
database,
|
|
9035
|
-
"saved_network_records",
|
|
9036
|
-
"response_body_state",
|
|
9037
|
-
"TEXT NOT NULL DEFAULT 'skipped'"
|
|
9038
|
-
);
|
|
9039
|
-
this.ensureColumn(database, "saved_network_records", "request_body_skip_reason", "TEXT");
|
|
9040
|
-
this.ensureColumn(database, "saved_network_records", "response_body_skip_reason", "TEXT");
|
|
9041
|
-
this.ensureColumn(database, "saved_network_records", "request_body_error", "TEXT");
|
|
9042
|
-
this.ensureColumn(database, "saved_network_records", "response_body_error", "TEXT");
|
|
9043
|
-
this.database = database;
|
|
8965
|
+
await this.ensureDatabaseDirectory();
|
|
9044
8966
|
}
|
|
9045
8967
|
async save(records, tag) {
|
|
9046
|
-
const database = this.requireDatabase();
|
|
8968
|
+
const database = await this.requireDatabase();
|
|
9047
8969
|
const readExisting = database.prepare(`
|
|
9048
8970
|
SELECT record_id
|
|
9049
8971
|
FROM saved_network_records
|
|
@@ -9235,7 +9157,7 @@ var SqliteSavedNetworkStore = class {
|
|
|
9235
9157
|
});
|
|
9236
9158
|
}
|
|
9237
9159
|
async query(input = {}) {
|
|
9238
|
-
const database = this.requireDatabase();
|
|
9160
|
+
const database = await this.requireDatabase();
|
|
9239
9161
|
const limit = Math.max(1, Math.min(input.limit ?? 50, 200));
|
|
9240
9162
|
const { whereSql, parameters } = buildSavedNetworkWhere(input);
|
|
9241
9163
|
const rows = database.prepare(
|
|
@@ -9266,7 +9188,7 @@ var SqliteSavedNetworkStore = class {
|
|
|
9266
9188
|
return record;
|
|
9267
9189
|
}
|
|
9268
9190
|
async clear(input = {}) {
|
|
9269
|
-
const database = this.requireDatabase();
|
|
9191
|
+
const database = await this.requireDatabase();
|
|
9270
9192
|
const countAll = database.prepare(`
|
|
9271
9193
|
SELECT COUNT(*) AS cleared
|
|
9272
9194
|
FROM saved_network_records
|
|
@@ -9303,11 +9225,127 @@ var SqliteSavedNetworkStore = class {
|
|
|
9303
9225
|
return cleared;
|
|
9304
9226
|
});
|
|
9305
9227
|
}
|
|
9306
|
-
requireDatabase() {
|
|
9307
|
-
if (
|
|
9308
|
-
|
|
9228
|
+
async requireDatabase() {
|
|
9229
|
+
if (this.database) {
|
|
9230
|
+
return this.database;
|
|
9231
|
+
}
|
|
9232
|
+
this.databaseInitialization ??= this.openDatabase();
|
|
9233
|
+
try {
|
|
9234
|
+
return await this.databaseInitialization;
|
|
9235
|
+
} catch (error) {
|
|
9236
|
+
this.databaseInitialization = void 0;
|
|
9237
|
+
throw error;
|
|
9238
|
+
}
|
|
9239
|
+
}
|
|
9240
|
+
async openDatabase() {
|
|
9241
|
+
await this.ensureDatabaseDirectory();
|
|
9242
|
+
let DatabaseSync;
|
|
9243
|
+
try {
|
|
9244
|
+
({ DatabaseSync } = await import(NODE_SQLITE_SPECIFIER));
|
|
9245
|
+
} catch (error) {
|
|
9246
|
+
throw normalizeSqliteImportError(error);
|
|
9247
|
+
}
|
|
9248
|
+
const database = new DatabaseSync(this.databasePath);
|
|
9249
|
+
try {
|
|
9250
|
+
this.configureDatabase(database);
|
|
9251
|
+
this.database = database;
|
|
9252
|
+
return database;
|
|
9253
|
+
} catch (error) {
|
|
9254
|
+
closeSqliteDatabase(database);
|
|
9255
|
+
throw error;
|
|
9309
9256
|
}
|
|
9310
|
-
|
|
9257
|
+
}
|
|
9258
|
+
async ensureDatabaseDirectory() {
|
|
9259
|
+
this.directoryInitialization ??= ensureDirectory(path6__default.default.dirname(this.databasePath)).catch(
|
|
9260
|
+
(error) => {
|
|
9261
|
+
this.directoryInitialization = void 0;
|
|
9262
|
+
throw error;
|
|
9263
|
+
}
|
|
9264
|
+
);
|
|
9265
|
+
await this.directoryInitialization;
|
|
9266
|
+
}
|
|
9267
|
+
configureDatabase(database) {
|
|
9268
|
+
database.exec("PRAGMA journal_mode = WAL");
|
|
9269
|
+
database.exec("PRAGMA foreign_keys = ON");
|
|
9270
|
+
database.exec(`
|
|
9271
|
+
CREATE TABLE IF NOT EXISTS saved_network_records (
|
|
9272
|
+
record_id TEXT PRIMARY KEY,
|
|
9273
|
+
request_id TEXT NOT NULL,
|
|
9274
|
+
session_ref TEXT NOT NULL,
|
|
9275
|
+
page_ref TEXT,
|
|
9276
|
+
page_ref_key TEXT NOT NULL,
|
|
9277
|
+
frame_ref TEXT,
|
|
9278
|
+
document_ref TEXT,
|
|
9279
|
+
action_id TEXT,
|
|
9280
|
+
method TEXT NOT NULL,
|
|
9281
|
+
method_lc TEXT NOT NULL,
|
|
9282
|
+
url TEXT NOT NULL,
|
|
9283
|
+
url_lc TEXT NOT NULL,
|
|
9284
|
+
hostname TEXT NOT NULL,
|
|
9285
|
+
hostname_lc TEXT NOT NULL,
|
|
9286
|
+
path TEXT NOT NULL,
|
|
9287
|
+
path_lc TEXT NOT NULL,
|
|
9288
|
+
status INTEGER,
|
|
9289
|
+
status_text TEXT,
|
|
9290
|
+
resource_type TEXT NOT NULL,
|
|
9291
|
+
navigation_request INTEGER NOT NULL,
|
|
9292
|
+
request_headers_json TEXT NOT NULL,
|
|
9293
|
+
response_headers_json TEXT NOT NULL,
|
|
9294
|
+
request_body_json TEXT,
|
|
9295
|
+
response_body_json TEXT,
|
|
9296
|
+
initiator_json TEXT,
|
|
9297
|
+
timing_json TEXT,
|
|
9298
|
+
transfer_json TEXT,
|
|
9299
|
+
source_json TEXT,
|
|
9300
|
+
capture_state TEXT NOT NULL,
|
|
9301
|
+
request_body_state TEXT NOT NULL,
|
|
9302
|
+
response_body_state TEXT NOT NULL,
|
|
9303
|
+
request_body_skip_reason TEXT,
|
|
9304
|
+
response_body_skip_reason TEXT,
|
|
9305
|
+
request_body_error TEXT,
|
|
9306
|
+
response_body_error TEXT,
|
|
9307
|
+
redirect_from_request_id TEXT,
|
|
9308
|
+
redirect_to_request_id TEXT,
|
|
9309
|
+
saved_at INTEGER NOT NULL
|
|
9310
|
+
);
|
|
9311
|
+
|
|
9312
|
+
CREATE UNIQUE INDEX IF NOT EXISTS saved_network_records_scope_request
|
|
9313
|
+
ON saved_network_records (session_ref, page_ref_key, request_id);
|
|
9314
|
+
|
|
9315
|
+
CREATE INDEX IF NOT EXISTS saved_network_records_saved_at
|
|
9316
|
+
ON saved_network_records (saved_at DESC);
|
|
9317
|
+
|
|
9318
|
+
CREATE TABLE IF NOT EXISTS saved_network_tags (
|
|
9319
|
+
record_id TEXT NOT NULL REFERENCES saved_network_records(record_id) ON DELETE CASCADE,
|
|
9320
|
+
tag TEXT NOT NULL,
|
|
9321
|
+
PRIMARY KEY (record_id, tag)
|
|
9322
|
+
);
|
|
9323
|
+
|
|
9324
|
+
CREATE INDEX IF NOT EXISTS saved_network_tags_tag
|
|
9325
|
+
ON saved_network_tags (tag);
|
|
9326
|
+
`);
|
|
9327
|
+
this.ensureColumn(
|
|
9328
|
+
database,
|
|
9329
|
+
"saved_network_records",
|
|
9330
|
+
"capture_state",
|
|
9331
|
+
"TEXT NOT NULL DEFAULT 'complete'"
|
|
9332
|
+
);
|
|
9333
|
+
this.ensureColumn(
|
|
9334
|
+
database,
|
|
9335
|
+
"saved_network_records",
|
|
9336
|
+
"request_body_state",
|
|
9337
|
+
"TEXT NOT NULL DEFAULT 'skipped'"
|
|
9338
|
+
);
|
|
9339
|
+
this.ensureColumn(
|
|
9340
|
+
database,
|
|
9341
|
+
"saved_network_records",
|
|
9342
|
+
"response_body_state",
|
|
9343
|
+
"TEXT NOT NULL DEFAULT 'skipped'"
|
|
9344
|
+
);
|
|
9345
|
+
this.ensureColumn(database, "saved_network_records", "request_body_skip_reason", "TEXT");
|
|
9346
|
+
this.ensureColumn(database, "saved_network_records", "response_body_skip_reason", "TEXT");
|
|
9347
|
+
this.ensureColumn(database, "saved_network_records", "request_body_error", "TEXT");
|
|
9348
|
+
this.ensureColumn(database, "saved_network_records", "response_body_error", "TEXT");
|
|
9311
9349
|
}
|
|
9312
9350
|
ensureColumn(database, table, column, definition) {
|
|
9313
9351
|
const rows = database.prepare(`PRAGMA table_info(${table})`).all();
|
|
@@ -9452,6 +9490,20 @@ function inflateSavedNetworkRow(row, includeBodies) {
|
|
|
9452
9490
|
function stringifyOptional(value) {
|
|
9453
9491
|
return value === void 0 ? null : JSON.stringify(value);
|
|
9454
9492
|
}
|
|
9493
|
+
function normalizeSqliteImportError(error) {
|
|
9494
|
+
if (error instanceof Error && error.code === "ERR_UNKNOWN_BUILTIN_MODULE" && error.message.includes(NODE_SQLITE_SPECIFIER)) {
|
|
9495
|
+
return new Error(SAVED_NETWORK_SQLITE_SUPPORT_ERROR, {
|
|
9496
|
+
cause: error
|
|
9497
|
+
});
|
|
9498
|
+
}
|
|
9499
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
9500
|
+
}
|
|
9501
|
+
function closeSqliteDatabase(database) {
|
|
9502
|
+
try {
|
|
9503
|
+
database.close();
|
|
9504
|
+
} catch {
|
|
9505
|
+
}
|
|
9506
|
+
}
|
|
9455
9507
|
function withSqliteTransaction(database, task) {
|
|
9456
9508
|
database.exec("BEGIN IMMEDIATE");
|
|
9457
9509
|
try {
|
|
@@ -11093,7 +11145,7 @@ function resolveSelectedSkills(options) {
|
|
|
11093
11145
|
}
|
|
11094
11146
|
|
|
11095
11147
|
// src/provider/config.ts
|
|
11096
|
-
var
|
|
11148
|
+
var OPENSTEER_PROVIDER_MODES = ["local", "cloud"];
|
|
11097
11149
|
function assertProviderSupportsEngine(provider, engine) {
|
|
11098
11150
|
if (engine !== "abp") {
|
|
11099
11151
|
return;
|
|
@@ -11104,30 +11156,30 @@ function assertProviderSupportsEngine(provider, engine) {
|
|
|
11104
11156
|
);
|
|
11105
11157
|
}
|
|
11106
11158
|
}
|
|
11107
|
-
function
|
|
11159
|
+
function normalizeOpensteerProviderMode(value, source = "OPENSTEER_PROVIDER") {
|
|
11108
11160
|
const normalized = value.trim().toLowerCase();
|
|
11109
|
-
if (normalized ===
|
|
11161
|
+
if (normalized === OPENSTEER_PROVIDER_MODES[0] || normalized === OPENSTEER_PROVIDER_MODES[1]) {
|
|
11110
11162
|
return normalized;
|
|
11111
11163
|
}
|
|
11112
11164
|
throw new Error(
|
|
11113
|
-
`${source} must be one of ${
|
|
11165
|
+
`${source} must be one of ${OPENSTEER_PROVIDER_MODES.join(", ")}; received "${value}".`
|
|
11114
11166
|
);
|
|
11115
11167
|
}
|
|
11116
11168
|
function resolveOpensteerProvider(input = {}) {
|
|
11117
11169
|
if (input.provider) {
|
|
11118
11170
|
return {
|
|
11119
|
-
|
|
11171
|
+
mode: input.provider.mode,
|
|
11120
11172
|
source: "explicit"
|
|
11121
11173
|
};
|
|
11122
11174
|
}
|
|
11123
11175
|
if (input.environmentProvider !== void 0 && input.environmentProvider.trim().length > 0) {
|
|
11124
11176
|
return {
|
|
11125
|
-
|
|
11177
|
+
mode: normalizeOpensteerProviderMode(input.environmentProvider),
|
|
11126
11178
|
source: "env"
|
|
11127
11179
|
};
|
|
11128
11180
|
}
|
|
11129
11181
|
return {
|
|
11130
|
-
|
|
11182
|
+
mode: "local",
|
|
11131
11183
|
source: "default"
|
|
11132
11184
|
};
|
|
11133
11185
|
}
|
|
@@ -11781,6 +11833,13 @@ var OpensteerCloudClient = class {
|
|
|
11781
11833
|
});
|
|
11782
11834
|
return await response.json();
|
|
11783
11835
|
}
|
|
11836
|
+
async importDescriptors(entries) {
|
|
11837
|
+
const response = await this.request("/registry/descriptors/import", {
|
|
11838
|
+
method: "POST",
|
|
11839
|
+
body: { entries }
|
|
11840
|
+
});
|
|
11841
|
+
return await response.json();
|
|
11842
|
+
}
|
|
11784
11843
|
async importRequestPlans(entries) {
|
|
11785
11844
|
const response = await this.request("/registry/request-plans/import", {
|
|
11786
11845
|
method: "POST",
|
|
@@ -11876,10 +11935,10 @@ function resolveCloudConfig(input = {}) {
|
|
|
11876
11935
|
...input.provider === void 0 ? {} : { provider: input.provider },
|
|
11877
11936
|
...input.environmentProvider === void 0 ? {} : { environmentProvider: input.environmentProvider }
|
|
11878
11937
|
});
|
|
11879
|
-
if (provider.
|
|
11938
|
+
if (provider.mode !== "cloud") {
|
|
11880
11939
|
return void 0;
|
|
11881
11940
|
}
|
|
11882
|
-
const cloudProvider = input.provider?.
|
|
11941
|
+
const cloudProvider = input.provider?.mode === "cloud" ? input.provider : void 0;
|
|
11883
11942
|
const apiKey = cloudProvider?.apiKey ?? process.env.OPENSTEER_API_KEY;
|
|
11884
11943
|
if (!apiKey || apiKey.trim().length === 0) {
|
|
11885
11944
|
throw new Error("provider=cloud requires OPENSTEER_API_KEY or provider.apiKey.");
|
|
@@ -11896,11 +11955,11 @@ function resolveCloudConfig(input = {}) {
|
|
|
11896
11955
|
}
|
|
11897
11956
|
|
|
11898
11957
|
// ../runtime-core/package.json
|
|
11899
|
-
var
|
|
11900
|
-
version: "0.1.
|
|
11958
|
+
var package_default2 = {
|
|
11959
|
+
version: "0.1.1"};
|
|
11901
11960
|
|
|
11902
11961
|
// ../runtime-core/src/version.ts
|
|
11903
|
-
var OPENSTEER_RUNTIME_CORE_VERSION =
|
|
11962
|
+
var OPENSTEER_RUNTIME_CORE_VERSION = package_default2.version;
|
|
11904
11963
|
|
|
11905
11964
|
// ../runtime-core/src/internal/errors.ts
|
|
11906
11965
|
function normalizeThrownOpensteerError(error, fallbackMessage) {
|
|
@@ -11971,8 +12030,74 @@ var defaultSnapshotSettleObserver = {
|
|
|
11971
12030
|
}
|
|
11972
12031
|
};
|
|
11973
12032
|
Object.freeze(defaultSnapshotSettleObserver);
|
|
12033
|
+
var DOM_ACTION_VISUAL_STABILITY_PROFILES = {
|
|
12034
|
+
"dom.click": { settleMs: 750, scope: "visible-frames", timeoutMs: 7e3 },
|
|
12035
|
+
"dom.input": { settleMs: 750, scope: "visible-frames", timeoutMs: 7e3 },
|
|
12036
|
+
"dom.scroll": { settleMs: 600, scope: "visible-frames", timeoutMs: 7e3 },
|
|
12037
|
+
"dom.hover": { settleMs: 200, scope: "main-frame", timeoutMs: 2500 }
|
|
12038
|
+
};
|
|
12039
|
+
var DEFAULT_DOM_ACTION_VISUAL_STABILITY_PROFILE = {
|
|
12040
|
+
settleMs: 750,
|
|
12041
|
+
scope: "visible-frames",
|
|
12042
|
+
timeoutMs: 7e3
|
|
12043
|
+
};
|
|
12044
|
+
var NAVIGATION_VISUAL_STABILITY_PROFILE = {
|
|
12045
|
+
settleMs: 750,
|
|
12046
|
+
scope: "visible-frames",
|
|
12047
|
+
timeoutMs: 7e3
|
|
12048
|
+
};
|
|
12049
|
+
var defaultDomActionSettleObserver = {
|
|
12050
|
+
async settle(input) {
|
|
12051
|
+
if (input.trigger !== "dom-action") {
|
|
12052
|
+
return false;
|
|
12053
|
+
}
|
|
12054
|
+
const profile = DOM_ACTION_VISUAL_STABILITY_PROFILES[input.operation] ?? DEFAULT_DOM_ACTION_VISUAL_STABILITY_PROFILE;
|
|
12055
|
+
const effectiveTimeout = input.remainingMs === void 0 ? profile.timeoutMs : Math.min(profile.timeoutMs, input.remainingMs);
|
|
12056
|
+
if (effectiveTimeout <= 0) {
|
|
12057
|
+
return false;
|
|
12058
|
+
}
|
|
12059
|
+
try {
|
|
12060
|
+
await input.engine.waitForVisualStability({
|
|
12061
|
+
pageRef: input.pageRef,
|
|
12062
|
+
timeoutMs: effectiveTimeout,
|
|
12063
|
+
settleMs: profile.settleMs,
|
|
12064
|
+
scope: profile.scope
|
|
12065
|
+
});
|
|
12066
|
+
return true;
|
|
12067
|
+
} catch {
|
|
12068
|
+
return false;
|
|
12069
|
+
}
|
|
12070
|
+
}
|
|
12071
|
+
};
|
|
12072
|
+
Object.freeze(defaultDomActionSettleObserver);
|
|
12073
|
+
var defaultNavigationSettleObserver = {
|
|
12074
|
+
async settle(input) {
|
|
12075
|
+
if (input.trigger !== "navigation") {
|
|
12076
|
+
return false;
|
|
12077
|
+
}
|
|
12078
|
+
const profile = NAVIGATION_VISUAL_STABILITY_PROFILE;
|
|
12079
|
+
const effectiveTimeout = input.remainingMs === void 0 ? profile.timeoutMs : Math.min(profile.timeoutMs, input.remainingMs);
|
|
12080
|
+
if (effectiveTimeout <= 0) {
|
|
12081
|
+
return false;
|
|
12082
|
+
}
|
|
12083
|
+
try {
|
|
12084
|
+
await input.engine.waitForVisualStability({
|
|
12085
|
+
pageRef: input.pageRef,
|
|
12086
|
+
timeoutMs: effectiveTimeout,
|
|
12087
|
+
settleMs: profile.settleMs,
|
|
12088
|
+
scope: profile.scope
|
|
12089
|
+
});
|
|
12090
|
+
return true;
|
|
12091
|
+
} catch {
|
|
12092
|
+
return false;
|
|
12093
|
+
}
|
|
12094
|
+
}
|
|
12095
|
+
};
|
|
12096
|
+
Object.freeze(defaultNavigationSettleObserver);
|
|
11974
12097
|
var DEFAULT_SETTLE_OBSERVERS = Object.freeze([
|
|
11975
|
-
defaultSnapshotSettleObserver
|
|
12098
|
+
defaultSnapshotSettleObserver,
|
|
12099
|
+
defaultDomActionSettleObserver,
|
|
12100
|
+
defaultNavigationSettleObserver
|
|
11976
12101
|
]);
|
|
11977
12102
|
var defaultTimeoutPolicy = {
|
|
11978
12103
|
resolveTimeoutMs(input) {
|
|
@@ -20192,7 +20317,6 @@ async function compileOpensteerExtractionFieldTargets(options) {
|
|
|
20192
20317
|
await collectFieldTargetsFromSchemaObject({
|
|
20193
20318
|
dom: options.dom,
|
|
20194
20319
|
pageRef: options.pageRef,
|
|
20195
|
-
latestSnapshotCounters: options.latestSnapshotCounters,
|
|
20196
20320
|
value: options.schema,
|
|
20197
20321
|
path: "",
|
|
20198
20322
|
fields,
|
|
@@ -20210,22 +20334,11 @@ async function extractOpensteerExtractionFieldTargets(options) {
|
|
|
20210
20334
|
source: "current_url"
|
|
20211
20335
|
};
|
|
20212
20336
|
}
|
|
20213
|
-
if ("path" in field) {
|
|
20214
|
-
return {
|
|
20215
|
-
key: field.key,
|
|
20216
|
-
target: {
|
|
20217
|
-
kind: "path",
|
|
20218
|
-
path: field.path
|
|
20219
|
-
},
|
|
20220
|
-
...field.attribute === void 0 ? {} : { attribute: field.attribute }
|
|
20221
|
-
};
|
|
20222
|
-
}
|
|
20223
20337
|
return {
|
|
20224
20338
|
key: field.key,
|
|
20225
20339
|
target: {
|
|
20226
|
-
kind: "
|
|
20227
|
-
|
|
20228
|
-
anchor: field.anchor
|
|
20340
|
+
kind: "path",
|
|
20341
|
+
path: field.path
|
|
20229
20342
|
},
|
|
20230
20343
|
...field.attribute === void 0 ? {} : { attribute: field.attribute }
|
|
20231
20344
|
};
|
|
@@ -20234,8 +20347,6 @@ async function extractOpensteerExtractionFieldTargets(options) {
|
|
|
20234
20347
|
}
|
|
20235
20348
|
async function compilePersistedOpensteerExtractionPayloadFromFieldTargets(options) {
|
|
20236
20349
|
const fields = await resolvePersistableFieldTargets({
|
|
20237
|
-
pageRef: options.pageRef,
|
|
20238
|
-
dom: options.dom,
|
|
20239
20350
|
fieldTargets: options.fieldTargets
|
|
20240
20351
|
});
|
|
20241
20352
|
const payload = buildPersistedOpensteerExtractionPayload(fields);
|
|
@@ -20267,7 +20378,6 @@ async function collectFieldTargetsFromSchemaObject(options) {
|
|
|
20267
20378
|
await collectFieldTargetsFromSchemaValue({
|
|
20268
20379
|
dom: options.dom,
|
|
20269
20380
|
pageRef: options.pageRef,
|
|
20270
|
-
latestSnapshotCounters: options.latestSnapshotCounters,
|
|
20271
20381
|
value: childValue,
|
|
20272
20382
|
path: joinDataPath(options.path, normalizedKey),
|
|
20273
20383
|
fields: options.fields,
|
|
@@ -20282,7 +20392,6 @@ async function collectFieldTargetsFromSchemaValue(options) {
|
|
|
20282
20392
|
await compileFieldTarget({
|
|
20283
20393
|
dom: options.dom,
|
|
20284
20394
|
pageRef: options.pageRef,
|
|
20285
|
-
latestSnapshotCounters: options.latestSnapshotCounters,
|
|
20286
20395
|
field: normalizedField,
|
|
20287
20396
|
path: options.path
|
|
20288
20397
|
})
|
|
@@ -20311,7 +20420,6 @@ async function collectFieldTargetsFromSchemaValue(options) {
|
|
|
20311
20420
|
await collectFieldTargetsFromSchemaObject({
|
|
20312
20421
|
dom: options.dom,
|
|
20313
20422
|
pageRef: options.pageRef,
|
|
20314
|
-
latestSnapshotCounters: options.latestSnapshotCounters,
|
|
20315
20423
|
value: itemValue,
|
|
20316
20424
|
path: appendDataPathIndex(options.path, index),
|
|
20317
20425
|
fields: options.fields,
|
|
@@ -20334,7 +20442,6 @@ async function collectFieldTargetsFromSchemaValue(options) {
|
|
|
20334
20442
|
await collectFieldTargetsFromSchemaObject({
|
|
20335
20443
|
dom: options.dom,
|
|
20336
20444
|
pageRef: options.pageRef,
|
|
20337
|
-
latestSnapshotCounters: options.latestSnapshotCounters,
|
|
20338
20445
|
value: options.value,
|
|
20339
20446
|
path: options.path,
|
|
20340
20447
|
fields: options.fields,
|
|
@@ -20361,10 +20468,10 @@ async function compileFieldTarget(options) {
|
|
|
20361
20468
|
}
|
|
20362
20469
|
return {
|
|
20363
20470
|
key: options.path,
|
|
20364
|
-
|
|
20365
|
-
|
|
20366
|
-
|
|
20367
|
-
|
|
20471
|
+
path: await resolveSelectorFieldPath({
|
|
20472
|
+
dom: options.dom,
|
|
20473
|
+
pageRef: options.pageRef,
|
|
20474
|
+
selector: `[c="${String(options.field.element)}"]`
|
|
20368
20475
|
}),
|
|
20369
20476
|
...options.field.attribute === void 0 ? {} : { attribute: options.field.attribute }
|
|
20370
20477
|
};
|
|
@@ -20382,24 +20489,6 @@ async function resolveSelectorFieldPath(options) {
|
|
|
20382
20489
|
locator: resolved.locator
|
|
20383
20490
|
});
|
|
20384
20491
|
}
|
|
20385
|
-
async function resolveLiveFieldTarget(options) {
|
|
20386
|
-
const counters = options.latestSnapshotCounters;
|
|
20387
|
-
if (counters === void 0) {
|
|
20388
|
-
throw new Error(
|
|
20389
|
-
`Extraction schema field "${labelForPath(options.path)}" uses element ${String(options.field.element)} but no snapshot is available.`
|
|
20390
|
-
);
|
|
20391
|
-
}
|
|
20392
|
-
const counter = counters.get(options.field.element);
|
|
20393
|
-
if (!counter) {
|
|
20394
|
-
throw new Error(
|
|
20395
|
-
`Extraction schema field "${labelForPath(options.path)}" references missing counter ${String(options.field.element)}.`
|
|
20396
|
-
);
|
|
20397
|
-
}
|
|
20398
|
-
return {
|
|
20399
|
-
locator: counter.locator,
|
|
20400
|
-
anchor: counter.anchor
|
|
20401
|
-
};
|
|
20402
|
-
}
|
|
20403
20492
|
async function resolvePersistableFieldTargets(options) {
|
|
20404
20493
|
const fields = [];
|
|
20405
20494
|
for (const field of options.fieldTargets) {
|
|
@@ -20410,29 +20499,9 @@ async function resolvePersistableFieldTargets(options) {
|
|
|
20410
20499
|
});
|
|
20411
20500
|
continue;
|
|
20412
20501
|
}
|
|
20413
|
-
if ("path" in field) {
|
|
20414
|
-
fields.push({
|
|
20415
|
-
key: field.key,
|
|
20416
|
-
path: sanitizeElementPath(field.path),
|
|
20417
|
-
...field.attribute === void 0 ? {} : { attribute: field.attribute }
|
|
20418
|
-
});
|
|
20419
|
-
continue;
|
|
20420
|
-
}
|
|
20421
|
-
const resolved = await options.dom.resolveTarget({
|
|
20422
|
-
pageRef: options.pageRef,
|
|
20423
|
-
method: "extract",
|
|
20424
|
-
target: {
|
|
20425
|
-
kind: "live",
|
|
20426
|
-
locator: field.locator,
|
|
20427
|
-
anchor: field.anchor
|
|
20428
|
-
}
|
|
20429
|
-
});
|
|
20430
|
-
const path16 = resolved.replayPath ?? await options.dom.buildPath({
|
|
20431
|
-
locator: resolved.locator
|
|
20432
|
-
});
|
|
20433
20502
|
fields.push({
|
|
20434
20503
|
key: field.key,
|
|
20435
|
-
path: sanitizeElementPath(
|
|
20504
|
+
path: sanitizeElementPath(field.path),
|
|
20436
20505
|
...field.attribute === void 0 ? {} : { attribute: field.attribute }
|
|
20437
20506
|
});
|
|
20438
20507
|
}
|
|
@@ -21573,8 +21642,7 @@ async function compileOpensteerSnapshot(options) {
|
|
|
21573
21642
|
title: pageInfo.title,
|
|
21574
21643
|
mode: options.mode,
|
|
21575
21644
|
html: dense.html,
|
|
21576
|
-
counters: [...dense.counterRecords.values()].map(toPublicCounterRecord)
|
|
21577
|
-
counterRecords: dense.counterRecords
|
|
21645
|
+
counters: [...dense.counterRecords.values()].map(toPublicCounterRecord)
|
|
21578
21646
|
};
|
|
21579
21647
|
}
|
|
21580
21648
|
async function getMainDocumentSnapshot(engine, pageRef) {
|
|
@@ -23193,6 +23261,7 @@ var OpensteerSessionRuntime = class {
|
|
|
23193
23261
|
engineFactory;
|
|
23194
23262
|
policy;
|
|
23195
23263
|
injectedDescriptorStore;
|
|
23264
|
+
injectedExtractionDescriptorStore;
|
|
23196
23265
|
registryOverrides;
|
|
23197
23266
|
cleanupRootOnClose;
|
|
23198
23267
|
sessionInfoBase;
|
|
@@ -23205,7 +23274,6 @@ var OpensteerSessionRuntime = class {
|
|
|
23205
23274
|
sessionRef;
|
|
23206
23275
|
pageRef;
|
|
23207
23276
|
runId;
|
|
23208
|
-
latestSnapshot;
|
|
23209
23277
|
backgroundNetworkPersistence = /* @__PURE__ */ new Set();
|
|
23210
23278
|
cookieJars = /* @__PURE__ */ new Map();
|
|
23211
23279
|
recipeCache = /* @__PURE__ */ new Map();
|
|
@@ -23219,6 +23287,7 @@ var OpensteerSessionRuntime = class {
|
|
|
23219
23287
|
this.engineFactory = options.engineFactory;
|
|
23220
23288
|
this.policy = options.policy ?? defaultPolicy();
|
|
23221
23289
|
this.injectedDescriptorStore = options.descriptorStore;
|
|
23290
|
+
this.injectedExtractionDescriptorStore = options.extractionDescriptorStore;
|
|
23222
23291
|
this.registryOverrides = options.registryOverrides;
|
|
23223
23292
|
this.cleanupRootOnClose = options.cleanupRootOnClose ?? options.workspace === void 0;
|
|
23224
23293
|
this.sessionInfoBase = options.sessionInfo ?? {};
|
|
@@ -23230,7 +23299,7 @@ var OpensteerSessionRuntime = class {
|
|
|
23230
23299
|
const base = this.sessionInfoBase;
|
|
23231
23300
|
return {
|
|
23232
23301
|
provider: base.provider ?? {
|
|
23233
|
-
|
|
23302
|
+
mode: "local",
|
|
23234
23303
|
ownership: "owned",
|
|
23235
23304
|
engine: "playwright"
|
|
23236
23305
|
},
|
|
@@ -23297,7 +23366,6 @@ var OpensteerSessionRuntime = class {
|
|
|
23297
23366
|
timeout.throwIfAborted();
|
|
23298
23367
|
this.sessionRef = sessionRef;
|
|
23299
23368
|
this.pageRef = createdPage.data.pageRef;
|
|
23300
|
-
this.latestSnapshot = void 0;
|
|
23301
23369
|
await timeout.runStep(() => this.ensureSemantics());
|
|
23302
23370
|
let frameRef2 = createdPage.frameRef;
|
|
23303
23371
|
if (input.url !== void 0) {
|
|
@@ -23420,7 +23488,6 @@ var OpensteerSessionRuntime = class {
|
|
|
23420
23488
|
})
|
|
23421
23489
|
);
|
|
23422
23490
|
this.pageRef = created.data.pageRef;
|
|
23423
|
-
this.latestSnapshot = void 0;
|
|
23424
23491
|
return this.readSessionState();
|
|
23425
23492
|
},
|
|
23426
23493
|
options
|
|
@@ -23463,7 +23530,6 @@ var OpensteerSessionRuntime = class {
|
|
|
23463
23530
|
() => this.requireEngine().activatePage({ pageRef: input.pageRef })
|
|
23464
23531
|
);
|
|
23465
23532
|
this.pageRef = input.pageRef;
|
|
23466
|
-
this.latestSnapshot = void 0;
|
|
23467
23533
|
return this.readSessionState();
|
|
23468
23534
|
},
|
|
23469
23535
|
options
|
|
@@ -23527,7 +23593,6 @@ var OpensteerSessionRuntime = class {
|
|
|
23527
23593
|
);
|
|
23528
23594
|
}
|
|
23529
23595
|
this.pageRef = activePageRef;
|
|
23530
|
-
this.latestSnapshot = void 0;
|
|
23531
23596
|
return {
|
|
23532
23597
|
closedPageRef: targetPageRef,
|
|
23533
23598
|
...activePageRef === void 0 ? {} : { activePageRef },
|
|
@@ -23586,7 +23651,6 @@ var OpensteerSessionRuntime = class {
|
|
|
23586
23651
|
timeout
|
|
23587
23652
|
);
|
|
23588
23653
|
timeout.throwIfAborted();
|
|
23589
|
-
this.latestSnapshot = void 0;
|
|
23590
23654
|
await this.completeMutationCapture(timeout, baselineRequestIds, input.networkTag);
|
|
23591
23655
|
return {
|
|
23592
23656
|
navigation: navigation2,
|
|
@@ -23756,7 +23820,6 @@ var OpensteerSessionRuntime = class {
|
|
|
23756
23820
|
})
|
|
23757
23821
|
);
|
|
23758
23822
|
timeout.throwIfAborted();
|
|
23759
|
-
this.latestSnapshot = compiled;
|
|
23760
23823
|
const artifacts2 = await this.captureSnapshotArtifacts(
|
|
23761
23824
|
pageRef,
|
|
23762
23825
|
{
|
|
@@ -23906,8 +23969,7 @@ var OpensteerSessionRuntime = class {
|
|
|
23906
23969
|
() => compileOpensteerExtractionFieldTargets({
|
|
23907
23970
|
pageRef,
|
|
23908
23971
|
schema: input.schema,
|
|
23909
|
-
dom: this.requireDom()
|
|
23910
|
-
...this.latestSnapshot?.counterRecords === void 0 ? {} : { latestSnapshotCounters: this.latestSnapshot.counterRecords }
|
|
23972
|
+
dom: this.requireDom()
|
|
23911
23973
|
})
|
|
23912
23974
|
);
|
|
23913
23975
|
data = toCanonicalJsonValue(
|
|
@@ -27026,7 +27088,6 @@ var OpensteerSessionRuntime = class {
|
|
|
27026
27088
|
});
|
|
27027
27089
|
timeout.throwIfAborted();
|
|
27028
27090
|
this.pageRef = output2.pageRef;
|
|
27029
|
-
this.latestSnapshot = void 0;
|
|
27030
27091
|
await this.completeMutationCapture(timeout, baselineRequestIds, input.networkTag);
|
|
27031
27092
|
const artifacts2 = await this.persistComputerArtifacts(output2, timeout);
|
|
27032
27093
|
return {
|
|
@@ -27256,8 +27317,7 @@ var OpensteerSessionRuntime = class {
|
|
|
27256
27317
|
};
|
|
27257
27318
|
}
|
|
27258
27319
|
if (target.kind === "element") {
|
|
27259
|
-
const
|
|
27260
|
-
const elementTarget = counter ? { kind: "live", locator: counter.locator, anchor: counter.anchor } : { kind: "selector", selector: `[c="${String(target.element)}"]` };
|
|
27320
|
+
const elementTarget = { kind: "selector", selector: `[c="${String(target.element)}"]` };
|
|
27261
27321
|
const resolved2 = await timeout.runStep(
|
|
27262
27322
|
() => this.requireDom().resolveTarget({
|
|
27263
27323
|
pageRef,
|
|
@@ -29173,14 +29233,6 @@ var OpensteerSessionRuntime = class {
|
|
|
29173
29233
|
selector: target.selector
|
|
29174
29234
|
};
|
|
29175
29235
|
}
|
|
29176
|
-
const counter = this.latestSnapshot?.counterRecords.get(target.element);
|
|
29177
|
-
if (counter) {
|
|
29178
|
-
return {
|
|
29179
|
-
kind: "live",
|
|
29180
|
-
locator: counter.locator,
|
|
29181
|
-
anchor: counter.anchor
|
|
29182
|
-
};
|
|
29183
|
-
}
|
|
29184
29236
|
return {
|
|
29185
29237
|
kind: "selector",
|
|
29186
29238
|
selector: `[c="${String(target.element)}"]`
|
|
@@ -29241,7 +29293,7 @@ var OpensteerSessionRuntime = class {
|
|
|
29241
29293
|
dom: this.dom,
|
|
29242
29294
|
policy: this.policy
|
|
29243
29295
|
});
|
|
29244
|
-
this.extractionDescriptors = createOpensteerExtractionDescriptorStore({
|
|
29296
|
+
this.extractionDescriptors = this.injectedExtractionDescriptorStore ?? createOpensteerExtractionDescriptorStore({
|
|
29245
29297
|
root,
|
|
29246
29298
|
namespace: this.workspace
|
|
29247
29299
|
});
|
|
@@ -29462,7 +29514,6 @@ var OpensteerSessionRuntime = class {
|
|
|
29462
29514
|
this.backgroundNetworkPersistence.clear();
|
|
29463
29515
|
this.sessionRef = void 0;
|
|
29464
29516
|
this.pageRef = void 0;
|
|
29465
|
-
this.latestSnapshot = void 0;
|
|
29466
29517
|
this.runId = void 0;
|
|
29467
29518
|
this.dom = void 0;
|
|
29468
29519
|
this.computer = void 0;
|
|
@@ -32448,12 +32499,9 @@ async function syncLocalRegistryToCloud(client, workspace, store) {
|
|
|
32448
32499
|
store.registry.recipes.list(),
|
|
32449
32500
|
store.registry.authRecipes.list()
|
|
32450
32501
|
]);
|
|
32451
|
-
const
|
|
32452
|
-
const entry = toSelectorCacheImportEntry(workspace, record);
|
|
32453
|
-
return entry === void 0 ? [] : [entry];
|
|
32454
|
-
});
|
|
32502
|
+
const descriptorEntries = descriptors.map((record) => toDescriptorImportEntry(workspace, record));
|
|
32455
32503
|
await Promise.all([
|
|
32456
|
-
importInBatches(
|
|
32504
|
+
importInBatches(descriptorEntries, (entries) => client.importDescriptors(entries)),
|
|
32457
32505
|
importInBatches(
|
|
32458
32506
|
requestPlans.map((record) => toRequestPlanImportEntry(workspace, record)),
|
|
32459
32507
|
(entries) => client.importRequestPlans(entries)
|
|
@@ -32468,19 +32516,18 @@ async function syncLocalRegistryToCloud(client, workspace, store) {
|
|
|
32468
32516
|
)
|
|
32469
32517
|
]);
|
|
32470
32518
|
}
|
|
32471
|
-
function
|
|
32472
|
-
const descriptor = parseDomDescriptorRecord(record);
|
|
32473
|
-
if (descriptor === void 0) {
|
|
32474
|
-
return void 0;
|
|
32475
|
-
}
|
|
32519
|
+
function toDescriptorImportEntry(workspace, record) {
|
|
32476
32520
|
return {
|
|
32477
32521
|
workspace,
|
|
32478
|
-
|
|
32479
|
-
|
|
32480
|
-
|
|
32481
|
-
|
|
32482
|
-
|
|
32483
|
-
|
|
32522
|
+
recordId: record.id,
|
|
32523
|
+
key: record.key,
|
|
32524
|
+
version: record.version,
|
|
32525
|
+
contentHash: record.contentHash,
|
|
32526
|
+
tags: [...record.tags],
|
|
32527
|
+
...record.provenance === void 0 ? {} : { provenance: record.provenance },
|
|
32528
|
+
payload: record.payload,
|
|
32529
|
+
createdAt: record.createdAt,
|
|
32530
|
+
updatedAt: record.updatedAt
|
|
32484
32531
|
};
|
|
32485
32532
|
}
|
|
32486
32533
|
function toRegistryImportEntry(workspace, record) {
|
|
@@ -32596,7 +32643,7 @@ var CloudSessionProxy = class {
|
|
|
32596
32643
|
}
|
|
32597
32644
|
return {
|
|
32598
32645
|
provider: {
|
|
32599
|
-
|
|
32646
|
+
mode: "cloud",
|
|
32600
32647
|
ownership: "managed",
|
|
32601
32648
|
engine: "playwright",
|
|
32602
32649
|
baseUrl: this.cloud.getConfig().baseUrl
|
|
@@ -32929,7 +32976,7 @@ var CloudSessionProxy = class {
|
|
|
32929
32976
|
try {
|
|
32930
32977
|
const workspaceStore = await this.ensureWorkspaceStore();
|
|
32931
32978
|
await syncLocalRegistryToCloud(this.cloud, this.workspace, workspaceStore);
|
|
32932
|
-
} catch {
|
|
32979
|
+
} catch (error) {
|
|
32933
32980
|
}
|
|
32934
32981
|
}
|
|
32935
32982
|
bindClient(record) {
|
|
@@ -33028,6 +33075,7 @@ var OpensteerRuntime = class extends OpensteerSessionRuntime {
|
|
|
33028
33075
|
...options.engineFactory === void 0 ? {} : { engineFactory: options.engineFactory },
|
|
33029
33076
|
...options.policy === void 0 ? {} : { policy: options.policy },
|
|
33030
33077
|
...options.descriptorStore === void 0 ? {} : { descriptorStore: options.descriptorStore },
|
|
33078
|
+
...options.extractionDescriptorStore === void 0 ? {} : { extractionDescriptorStore: options.extractionDescriptorStore },
|
|
33031
33079
|
cleanupRootOnClose
|
|
33032
33080
|
})
|
|
33033
33081
|
);
|
|
@@ -33051,10 +33099,11 @@ function buildSharedRuntimeOptions(input) {
|
|
|
33051
33099
|
...input.engine === void 0 ? { engineFactory } : {},
|
|
33052
33100
|
...input.policy === void 0 ? {} : { policy: input.policy },
|
|
33053
33101
|
...input.descriptorStore === void 0 ? {} : { descriptorStore: input.descriptorStore },
|
|
33102
|
+
...input.extractionDescriptorStore === void 0 ? {} : { extractionDescriptorStore: input.extractionDescriptorStore },
|
|
33054
33103
|
cleanupRootOnClose: input.cleanupRootOnClose,
|
|
33055
33104
|
sessionInfo: {
|
|
33056
33105
|
provider: {
|
|
33057
|
-
|
|
33106
|
+
mode: "local",
|
|
33058
33107
|
ownership,
|
|
33059
33108
|
engine: input.engineName
|
|
33060
33109
|
},
|
|
@@ -33080,7 +33129,7 @@ function resolveOpensteerRuntimeConfig(input = {}) {
|
|
|
33080
33129
|
...input.provider === void 0 ? {} : { provider: input.provider },
|
|
33081
33130
|
...input.environmentProvider === void 0 ? {} : { environmentProvider: input.environmentProvider }
|
|
33082
33131
|
});
|
|
33083
|
-
if (provider.
|
|
33132
|
+
if (provider.mode === "cloud") {
|
|
33084
33133
|
return {
|
|
33085
33134
|
provider,
|
|
33086
33135
|
cloud: resolveCloudConfig({
|
|
@@ -33098,8 +33147,8 @@ function createOpensteerSemanticRuntime(input = {}) {
|
|
|
33098
33147
|
...input.provider === void 0 ? {} : { provider: input.provider },
|
|
33099
33148
|
...process.env.OPENSTEER_PROVIDER === void 0 ? {} : { environmentProvider: process.env.OPENSTEER_PROVIDER }
|
|
33100
33149
|
});
|
|
33101
|
-
assertProviderSupportsEngine(config.provider.
|
|
33102
|
-
if (config.provider.
|
|
33150
|
+
assertProviderSupportsEngine(config.provider.mode, engine);
|
|
33151
|
+
if (config.provider.mode === "cloud") {
|
|
33103
33152
|
return new CloudSessionProxy(new OpensteerCloudClient(config.cloud), {
|
|
33104
33153
|
...runtimeOptions.rootDir === void 0 ? {} : { rootDir: runtimeOptions.rootDir },
|
|
33105
33154
|
...runtimeOptions.rootPath === void 0 ? {} : { rootPath: runtimeOptions.rootPath },
|
|
@@ -33115,7 +33164,7 @@ function createOpensteerSemanticRuntime(input = {}) {
|
|
|
33115
33164
|
async function collectOpensteerStatus(input) {
|
|
33116
33165
|
const output = {
|
|
33117
33166
|
provider: {
|
|
33118
|
-
current: input.provider.
|
|
33167
|
+
current: input.provider.mode,
|
|
33119
33168
|
source: mapProviderSource(input.provider.source),
|
|
33120
33169
|
...input.cloudConfig === void 0 ? {} : { cloudBaseUrl: input.cloudConfig.baseUrl }
|
|
33121
33170
|
},
|
|
@@ -33134,10 +33183,10 @@ async function collectOpensteerStatus(input) {
|
|
|
33134
33183
|
...output,
|
|
33135
33184
|
rootPath,
|
|
33136
33185
|
lanes: {
|
|
33137
|
-
local: describeLocalLane(localRecord, input.provider.
|
|
33186
|
+
local: describeLocalLane(localRecord, input.provider.mode === "local"),
|
|
33138
33187
|
cloud: await describeCloudLane({
|
|
33139
33188
|
record: cloudRecord,
|
|
33140
|
-
current: input.provider.
|
|
33189
|
+
current: input.provider.mode === "cloud",
|
|
33141
33190
|
cloudConfig: input.cloudConfig
|
|
33142
33191
|
})
|
|
33143
33192
|
}
|
|
@@ -33323,12 +33372,18 @@ var OPERATION_ALIASES = /* @__PURE__ */ new Map([
|
|
|
33323
33372
|
["close", "session.close"]
|
|
33324
33373
|
]);
|
|
33325
33374
|
async function main() {
|
|
33326
|
-
|
|
33327
|
-
const
|
|
33328
|
-
if (
|
|
33375
|
+
const argv = process2__default.default.argv.slice(2);
|
|
33376
|
+
const bootstrapAction = resolveCliBootstrapAction(argv);
|
|
33377
|
+
if (bootstrapAction === "version") {
|
|
33378
|
+
printVersion();
|
|
33379
|
+
return;
|
|
33380
|
+
}
|
|
33381
|
+
if (bootstrapAction === "help") {
|
|
33329
33382
|
printHelp();
|
|
33330
33383
|
return;
|
|
33331
33384
|
}
|
|
33385
|
+
await loadCliEnvironment(process2__default.default.cwd());
|
|
33386
|
+
const parsed = parseCommandLine(argv);
|
|
33332
33387
|
if (parsed.command[0] === "browser") {
|
|
33333
33388
|
await handleBrowserCommand(parsed);
|
|
33334
33389
|
return;
|
|
@@ -33359,15 +33414,16 @@ async function main() {
|
|
|
33359
33414
|
if (parsed.options.workspace === void 0) {
|
|
33360
33415
|
throw new Error('Stateful commands require "--workspace <id>".');
|
|
33361
33416
|
}
|
|
33417
|
+
const engineName = resolveCliEngineName(parsed);
|
|
33362
33418
|
const provider = resolveCliProvider(parsed);
|
|
33363
|
-
assertProviderSupportsEngine(provider.
|
|
33364
|
-
assertCloudCliOptionsMatchProvider(parsed, provider.
|
|
33365
|
-
const runtimeProvider = buildCliRuntimeProvider(parsed, provider.
|
|
33419
|
+
assertProviderSupportsEngine(provider.mode, engineName);
|
|
33420
|
+
assertCloudCliOptionsMatchProvider(parsed, provider.mode);
|
|
33421
|
+
const runtimeProvider = buildCliRuntimeProvider(parsed, provider.mode);
|
|
33366
33422
|
if (operation === "session.close") {
|
|
33367
|
-
if (provider.
|
|
33423
|
+
if (provider.mode === "cloud") {
|
|
33368
33424
|
const runtime2 = createOpensteerSemanticRuntime({
|
|
33369
33425
|
...runtimeProvider === void 0 ? {} : { provider: runtimeProvider },
|
|
33370
|
-
engine:
|
|
33426
|
+
engine: engineName,
|
|
33371
33427
|
runtimeOptions: {
|
|
33372
33428
|
workspace: parsed.options.workspace,
|
|
33373
33429
|
rootDir: process2__default.default.cwd(),
|
|
@@ -33384,7 +33440,7 @@ async function main() {
|
|
|
33384
33440
|
const manager = new OpensteerBrowserManager({
|
|
33385
33441
|
rootDir: process2__default.default.cwd(),
|
|
33386
33442
|
workspace: parsed.options.workspace,
|
|
33387
|
-
engineName
|
|
33443
|
+
engineName,
|
|
33388
33444
|
browser: "persistent",
|
|
33389
33445
|
...parsed.options.launch === void 0 ? {} : { launch: parsed.options.launch },
|
|
33390
33446
|
...parsed.options.context === void 0 ? {} : { context: parsed.options.context }
|
|
@@ -33396,7 +33452,7 @@ async function main() {
|
|
|
33396
33452
|
}
|
|
33397
33453
|
const runtime = createOpensteerSemanticRuntime({
|
|
33398
33454
|
...runtimeProvider === void 0 ? {} : { provider: runtimeProvider },
|
|
33399
|
-
engine:
|
|
33455
|
+
engine: engineName,
|
|
33400
33456
|
runtimeOptions: {
|
|
33401
33457
|
workspace: parsed.options.workspace,
|
|
33402
33458
|
rootDir: process2__default.default.cwd(),
|
|
@@ -33450,10 +33506,11 @@ async function handleBrowserCommand(parsed) {
|
|
|
33450
33506
|
if (parsed.options.workspace === void 0) {
|
|
33451
33507
|
throw new Error('Browser workspace commands require "--workspace <id>".');
|
|
33452
33508
|
}
|
|
33509
|
+
const engineName = resolveCliEngineName(parsed);
|
|
33453
33510
|
const manager = new OpensteerBrowserManager({
|
|
33454
33511
|
rootDir: process2__default.default.cwd(),
|
|
33455
33512
|
workspace: parsed.options.workspace,
|
|
33456
|
-
|
|
33513
|
+
engineName,
|
|
33457
33514
|
browser: "persistent",
|
|
33458
33515
|
...parsed.options.launch === void 0 ? {} : { launch: parsed.options.launch },
|
|
33459
33516
|
...parsed.options.context === void 0 ? {} : { context: parsed.options.context }
|
|
@@ -33585,14 +33642,8 @@ function parseCommandLine(argv) {
|
|
|
33585
33642
|
const commandTokens = leadingTokens.slice(0, commandLength);
|
|
33586
33643
|
const rest = leadingTokens.slice(commandLength);
|
|
33587
33644
|
const rawOptions = /* @__PURE__ */ new Map();
|
|
33588
|
-
let help = false;
|
|
33589
33645
|
while (index < argv.length) {
|
|
33590
33646
|
const token = argv[index];
|
|
33591
|
-
if (token === "--help" || token === "-h") {
|
|
33592
|
-
help = true;
|
|
33593
|
-
index += 1;
|
|
33594
|
-
continue;
|
|
33595
|
-
}
|
|
33596
33647
|
if (!token.startsWith("--")) {
|
|
33597
33648
|
rest.push(token);
|
|
33598
33649
|
index += 1;
|
|
@@ -33609,11 +33660,7 @@ function parseCommandLine(argv) {
|
|
|
33609
33660
|
index += 2;
|
|
33610
33661
|
}
|
|
33611
33662
|
const browserKind = readSingle(rawOptions, "browser");
|
|
33612
|
-
const
|
|
33613
|
-
const engineName = resolveOpensteerEngineName({
|
|
33614
|
-
...requestedEngine === void 0 ? {} : { requested: requestedEngine },
|
|
33615
|
-
...process2__default.default.env.OPENSTEER_ENGINE === void 0 ? {} : { environment: process2__default.default.env.OPENSTEER_ENGINE }
|
|
33616
|
-
});
|
|
33663
|
+
const requestedEngineName = readSingle(rawOptions, "engine");
|
|
33617
33664
|
const attachEndpoint = readSingle(rawOptions, "attach-endpoint");
|
|
33618
33665
|
const attachHeaders = parseKeyValueList(rawOptions.get("attach-header"));
|
|
33619
33666
|
const freshTab = readOptionalBoolean(rawOptions, "fresh-tab");
|
|
@@ -33652,7 +33699,7 @@ function parseCommandLine(argv) {
|
|
|
33652
33699
|
const inputJson = readJsonObject(rawOptions, "input-json");
|
|
33653
33700
|
const schemaJson = readJsonObject(rawOptions, "schema-json");
|
|
33654
33701
|
const providerValue = readSingle(rawOptions, "provider");
|
|
33655
|
-
const provider = providerValue === void 0 ? void 0 :
|
|
33702
|
+
const provider = providerValue === void 0 ? void 0 : normalizeOpensteerProviderMode(providerValue, "--provider");
|
|
33656
33703
|
const cloudBaseUrl = readSingle(rawOptions, "cloud-base-url");
|
|
33657
33704
|
const cloudApiKey = readSingle(rawOptions, "cloud-api-key");
|
|
33658
33705
|
const cloudProfileId = readSingle(rawOptions, "cloud-profile-id");
|
|
@@ -33670,7 +33717,7 @@ function parseCommandLine(argv) {
|
|
|
33670
33717
|
const list = readOptionalBoolean(rawOptions, "list");
|
|
33671
33718
|
const options = {
|
|
33672
33719
|
...workspace === void 0 ? {} : { workspace },
|
|
33673
|
-
|
|
33720
|
+
...requestedEngineName === void 0 ? {} : { requestedEngineName },
|
|
33674
33721
|
...provider === void 0 ? {} : { provider },
|
|
33675
33722
|
...cloudBaseUrl === void 0 ? {} : { cloudBaseUrl },
|
|
33676
33723
|
...cloudApiKey === void 0 ? {} : { cloudApiKey },
|
|
@@ -33704,10 +33751,23 @@ function parseCommandLine(argv) {
|
|
|
33704
33751
|
return {
|
|
33705
33752
|
command: commandTokens,
|
|
33706
33753
|
rest,
|
|
33707
|
-
options
|
|
33708
|
-
help
|
|
33754
|
+
options
|
|
33709
33755
|
};
|
|
33710
33756
|
}
|
|
33757
|
+
function resolveCliBootstrapAction(argv) {
|
|
33758
|
+
if (argv.length === 0) {
|
|
33759
|
+
return "help";
|
|
33760
|
+
}
|
|
33761
|
+
for (const token of argv) {
|
|
33762
|
+
if (token === "--version") {
|
|
33763
|
+
return "version";
|
|
33764
|
+
}
|
|
33765
|
+
if (token === "--help" || token === "-h") {
|
|
33766
|
+
return "help";
|
|
33767
|
+
}
|
|
33768
|
+
}
|
|
33769
|
+
return void 0;
|
|
33770
|
+
}
|
|
33711
33771
|
function buildCliBrowserProfile(parsed) {
|
|
33712
33772
|
if (parsed.options.cloudProfileReuseIfActive === true && parsed.options.cloudProfileId === void 0) {
|
|
33713
33773
|
throw new Error('"--cloud-profile-reuse-if-active" requires "--cloud-profile-id <id>".');
|
|
@@ -33719,13 +33779,19 @@ function buildCliBrowserProfile(parsed) {
|
|
|
33719
33779
|
}
|
|
33720
33780
|
function buildCliExplicitProvider(parsed) {
|
|
33721
33781
|
if (parsed.options.provider === "local") {
|
|
33722
|
-
return {
|
|
33782
|
+
return { mode: "local" };
|
|
33723
33783
|
}
|
|
33724
33784
|
if (parsed.options.provider === "cloud") {
|
|
33725
|
-
return {
|
|
33785
|
+
return { mode: "cloud" };
|
|
33726
33786
|
}
|
|
33727
33787
|
return void 0;
|
|
33728
33788
|
}
|
|
33789
|
+
function resolveCliEngineName(parsed) {
|
|
33790
|
+
return resolveOpensteerEngineName({
|
|
33791
|
+
...parsed.options.requestedEngineName === void 0 ? {} : { requested: parsed.options.requestedEngineName },
|
|
33792
|
+
...process2__default.default.env.OPENSTEER_ENGINE === void 0 ? {} : { environment: process2__default.default.env.OPENSTEER_ENGINE }
|
|
33793
|
+
});
|
|
33794
|
+
}
|
|
33729
33795
|
function resolveCliProvider(parsed) {
|
|
33730
33796
|
const explicitProvider = buildCliExplicitProvider(parsed);
|
|
33731
33797
|
return resolveOpensteerProvider({
|
|
@@ -33733,25 +33799,25 @@ function resolveCliProvider(parsed) {
|
|
|
33733
33799
|
...process2__default.default.env.OPENSTEER_PROVIDER === void 0 ? {} : { environmentProvider: process2__default.default.env.OPENSTEER_PROVIDER }
|
|
33734
33800
|
});
|
|
33735
33801
|
}
|
|
33736
|
-
function buildCliRuntimeProvider(parsed,
|
|
33802
|
+
function buildCliRuntimeProvider(parsed, providerMode) {
|
|
33737
33803
|
const explicitProvider = buildCliExplicitProvider(parsed);
|
|
33738
|
-
if (
|
|
33739
|
-
return explicitProvider?.
|
|
33804
|
+
if (providerMode === "local") {
|
|
33805
|
+
return explicitProvider?.mode === "local" ? explicitProvider : void 0;
|
|
33740
33806
|
}
|
|
33741
33807
|
const browserProfile = buildCliBrowserProfile(parsed);
|
|
33742
33808
|
const hasCloudOverrides = parsed.options.cloudBaseUrl !== void 0 || parsed.options.cloudApiKey !== void 0 || browserProfile !== void 0;
|
|
33743
|
-
if (!hasCloudOverrides && explicitProvider?.
|
|
33809
|
+
if (!hasCloudOverrides && explicitProvider?.mode !== "cloud") {
|
|
33744
33810
|
return void 0;
|
|
33745
33811
|
}
|
|
33746
33812
|
return {
|
|
33747
|
-
|
|
33813
|
+
mode: "cloud",
|
|
33748
33814
|
...parsed.options.cloudBaseUrl === void 0 ? {} : { baseUrl: parsed.options.cloudBaseUrl },
|
|
33749
33815
|
...parsed.options.cloudApiKey === void 0 ? {} : { apiKey: parsed.options.cloudApiKey },
|
|
33750
33816
|
...browserProfile === void 0 ? {} : { browserProfile }
|
|
33751
33817
|
};
|
|
33752
33818
|
}
|
|
33753
|
-
function assertCloudCliOptionsMatchProvider(parsed,
|
|
33754
|
-
if (
|
|
33819
|
+
function assertCloudCliOptionsMatchProvider(parsed, providerMode) {
|
|
33820
|
+
if (providerMode !== "cloud" && (parsed.options.cloudBaseUrl !== void 0 || parsed.options.cloudApiKey !== void 0 || parsed.options.cloudProfileId !== void 0 || parsed.options.cloudProfileReuseIfActive === true)) {
|
|
33755
33821
|
throw new Error(
|
|
33756
33822
|
'Cloud-specific options require provider=cloud. Set "--provider cloud" or OPENSTEER_PROVIDER=cloud.'
|
|
33757
33823
|
);
|
|
@@ -33759,8 +33825,8 @@ function assertCloudCliOptionsMatchProvider(parsed, providerKind) {
|
|
|
33759
33825
|
}
|
|
33760
33826
|
async function handleStatusCommand(parsed) {
|
|
33761
33827
|
const provider = resolveCliProvider(parsed);
|
|
33762
|
-
assertCloudCliOptionsMatchProvider(parsed, provider.
|
|
33763
|
-
const runtimeProvider = buildCliRuntimeProvider(parsed, provider.
|
|
33828
|
+
assertCloudCliOptionsMatchProvider(parsed, provider.mode);
|
|
33829
|
+
const runtimeProvider = buildCliRuntimeProvider(parsed, provider.mode);
|
|
33764
33830
|
const runtimeConfig = resolveOpensteerRuntimeConfig({
|
|
33765
33831
|
...runtimeProvider === void 0 ? {} : { provider: runtimeProvider },
|
|
33766
33832
|
...process2__default.default.env.OPENSTEER_PROVIDER === void 0 ? {} : { environmentProvider: process2__default.default.env.OPENSTEER_PROVIDER }
|
|
@@ -33881,6 +33947,8 @@ Usage:
|
|
|
33881
33947
|
opensteer run <semantic-operation> --workspace <id> --input-json <json>
|
|
33882
33948
|
|
|
33883
33949
|
Common options:
|
|
33950
|
+
--help
|
|
33951
|
+
--version
|
|
33884
33952
|
--workspace <id>
|
|
33885
33953
|
--provider local|cloud
|
|
33886
33954
|
--cloud-base-url <url>
|
|
@@ -33902,6 +33970,10 @@ Common options:
|
|
|
33902
33970
|
--agent <name> repeatable
|
|
33903
33971
|
`);
|
|
33904
33972
|
}
|
|
33973
|
+
function printVersion() {
|
|
33974
|
+
process2__default.default.stdout.write(`${package_default.version}
|
|
33975
|
+
`);
|
|
33976
|
+
}
|
|
33905
33977
|
main().catch((error) => {
|
|
33906
33978
|
const payload = error instanceof Error ? {
|
|
33907
33979
|
error: {
|