opensteer 0.8.15 → 0.8.17
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-DFQCK2U6.js → chunk-KBO7DDPF.js} +183 -255
- package/dist/chunk-KBO7DDPF.js.map +1 -0
- package/dist/chunk-KCINASQC.js +3 -0
- package/dist/chunk-KCINASQC.js.map +1 -0
- package/dist/chunk-Y3ULLNOS.js +359 -0
- package/dist/chunk-Y3ULLNOS.js.map +1 -0
- package/dist/cli/bin.cjs +25851 -23402
- package/dist/cli/bin.cjs.map +1 -1
- package/dist/cli/bin.js +117 -87
- package/dist/cli/bin.js.map +1 -1
- package/dist/index.cjs +101 -160
- 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 +3 -345
- package/dist/index.js.map +1 -1
- package/dist/opensteer-3Q3LR5XM.js +4 -0
- package/dist/opensteer-3Q3LR5XM.js.map +1 -0
- package/package.json +10 -9
- package/skills/opensteer/SKILL.md +74 -75
- package/LICENSE +0 -21
- package/dist/chunk-DFQCK2U6.js.map +0 -1
- package/skills/opensteer/references/cli-reference.md +0 -118
- package/skills/opensteer/references/request-workflow.md +0 -153
- package/skills/opensteer/references/sdk-reference.md +0 -157
|
@@ -2949,6 +2949,20 @@ var opensteerNetworkRedirectHopSchema = objectSchema(
|
|
|
2949
2949
|
required: ["method", "url"]
|
|
2950
2950
|
}
|
|
2951
2951
|
);
|
|
2952
|
+
var opensteerReplayAttemptSchema = objectSchema(
|
|
2953
|
+
{
|
|
2954
|
+
transport: transportKindSchema,
|
|
2955
|
+
status: integerSchema({ minimum: 100, maximum: 599 }),
|
|
2956
|
+
ok: { type: "boolean" },
|
|
2957
|
+
durationMs: integerSchema({ minimum: 0 }),
|
|
2958
|
+
note: stringSchema(),
|
|
2959
|
+
error: stringSchema()
|
|
2960
|
+
},
|
|
2961
|
+
{
|
|
2962
|
+
title: "OpensteerReplayAttempt",
|
|
2963
|
+
required: ["transport", "ok", "durationMs"]
|
|
2964
|
+
}
|
|
2965
|
+
);
|
|
2952
2966
|
var opensteerNetworkDetailOutputSchema = objectSchema(
|
|
2953
2967
|
{
|
|
2954
2968
|
recordId: stringSchema({ minLength: 1 }),
|
|
@@ -2972,28 +2986,24 @@ var opensteerNetworkDetailOutputSchema = objectSchema(
|
|
|
2972
2986
|
}
|
|
2973
2987
|
),
|
|
2974
2988
|
redirectChain: arraySchema(opensteerNetworkRedirectHopSchema),
|
|
2975
|
-
notes: arraySchema(stringSchema())
|
|
2989
|
+
notes: arraySchema(stringSchema()),
|
|
2990
|
+
transportProbe: objectSchema(
|
|
2991
|
+
{
|
|
2992
|
+
recommended: transportKindSchema,
|
|
2993
|
+
attempts: arraySchema(opensteerReplayAttemptSchema)
|
|
2994
|
+
},
|
|
2995
|
+
{
|
|
2996
|
+
title: "OpensteerTransportProbeResult",
|
|
2997
|
+
required: ["attempts"]
|
|
2998
|
+
}
|
|
2999
|
+
)
|
|
2976
3000
|
},
|
|
2977
3001
|
{
|
|
2978
3002
|
title: "OpensteerNetworkDetailOutput",
|
|
2979
3003
|
required: ["recordId", "summary", "requestHeaders", "responseHeaders"]
|
|
2980
3004
|
}
|
|
2981
3005
|
);
|
|
2982
|
-
|
|
2983
|
-
{
|
|
2984
|
-
transport: transportKindSchema,
|
|
2985
|
-
status: integerSchema({ minimum: 100, maximum: 599 }),
|
|
2986
|
-
ok: { type: "boolean" },
|
|
2987
|
-
durationMs: integerSchema({ minimum: 0 }),
|
|
2988
|
-
note: stringSchema(),
|
|
2989
|
-
error: stringSchema()
|
|
2990
|
-
},
|
|
2991
|
-
{
|
|
2992
|
-
title: "OpensteerReplayAttempt",
|
|
2993
|
-
required: ["transport", "ok", "durationMs"]
|
|
2994
|
-
}
|
|
2995
|
-
);
|
|
2996
|
-
var opensteerNetworkReplayInputSchema = objectSchema(
|
|
3006
|
+
objectSchema(
|
|
2997
3007
|
{
|
|
2998
3008
|
recordId: stringSchema({ minLength: 1 }),
|
|
2999
3009
|
pageRef: pageRefSchema,
|
|
@@ -3007,7 +3017,6 @@ var opensteerNetworkReplayInputSchema = objectSchema(
|
|
|
3007
3017
|
required: ["recordId"]
|
|
3008
3018
|
}
|
|
3009
3019
|
);
|
|
3010
|
-
var opensteerNetworkReplayOutputSchema;
|
|
3011
3020
|
var opensteerSessionFetchTransportSchema = enumSchema(
|
|
3012
3021
|
["auto", "direct", "matched-tls", "page"],
|
|
3013
3022
|
{
|
|
@@ -3349,7 +3358,7 @@ var opensteerRequestResponseResultSchema = objectSchema(
|
|
|
3349
3358
|
required: ["url", "status", "statusText", "headers", "redirected"]
|
|
3350
3359
|
}
|
|
3351
3360
|
);
|
|
3352
|
-
|
|
3361
|
+
objectSchema(
|
|
3353
3362
|
{
|
|
3354
3363
|
recordId: stringSchema({ minLength: 1 }),
|
|
3355
3364
|
transport: transportKindSchema,
|
|
@@ -6329,7 +6338,6 @@ var opensteerExposedSemanticOperationNames = [
|
|
|
6329
6338
|
"dom.extract",
|
|
6330
6339
|
"network.query",
|
|
6331
6340
|
"network.detail",
|
|
6332
|
-
"network.replay",
|
|
6333
6341
|
"interaction.capture",
|
|
6334
6342
|
"interaction.get",
|
|
6335
6343
|
"interaction.diff",
|
|
@@ -6366,7 +6374,6 @@ var opensteerPackageRunnableSemanticOperationNames = /* @__PURE__ */ new Set([
|
|
|
6366
6374
|
"dom.extract",
|
|
6367
6375
|
"network.query",
|
|
6368
6376
|
"network.detail",
|
|
6369
|
-
"network.replay",
|
|
6370
6377
|
"interaction.capture",
|
|
6371
6378
|
"interaction.get",
|
|
6372
6379
|
"interaction.diff",
|
|
@@ -6804,9 +6811,12 @@ var opensteerNetworkDetailInputSchema = objectSchema(
|
|
|
6804
6811
|
required: ["recordId"]
|
|
6805
6812
|
}
|
|
6806
6813
|
);
|
|
6807
|
-
var opensteerComputerMouseButtonSchema = enumSchema(
|
|
6808
|
-
|
|
6809
|
-
|
|
6814
|
+
var opensteerComputerMouseButtonSchema = enumSchema(
|
|
6815
|
+
["left", "middle", "right"],
|
|
6816
|
+
{
|
|
6817
|
+
title: "OpensteerComputerMouseButton"
|
|
6818
|
+
}
|
|
6819
|
+
);
|
|
6810
6820
|
var opensteerComputerKeyModifierSchema = enumSchema(
|
|
6811
6821
|
["Shift", "Control", "Alt", "Meta"],
|
|
6812
6822
|
{
|
|
@@ -6883,10 +6893,7 @@ var opensteerDomExtractInputSchema = defineSchema({
|
|
|
6883
6893
|
title: "OpensteerDomExtractInput"
|
|
6884
6894
|
}
|
|
6885
6895
|
),
|
|
6886
|
-
anyOf: [
|
|
6887
|
-
defineSchema({ required: ["persist"] }),
|
|
6888
|
-
defineSchema({ required: ["schema"] })
|
|
6889
|
-
]
|
|
6896
|
+
anyOf: [defineSchema({ required: ["persist"] }), defineSchema({ required: ["schema"] })]
|
|
6890
6897
|
});
|
|
6891
6898
|
var jsonValueSchema3 = recordSchema({}, { title: "JsonValueRecord" });
|
|
6892
6899
|
var opensteerDomExtractOutputSchema = objectSchema(
|
|
@@ -7266,13 +7273,6 @@ var opensteerSemanticOperationSpecificationsBase = [
|
|
|
7266
7273
|
outputSchema: opensteerNetworkDetailOutputSchema,
|
|
7267
7274
|
requiredCapabilities: ["inspect.network", "inspect.networkBodies"]
|
|
7268
7275
|
}),
|
|
7269
|
-
defineSemanticOperationSpec({
|
|
7270
|
-
name: "network.replay",
|
|
7271
|
-
description: "Replay a captured request through the transport ladder and report the transport that worked.",
|
|
7272
|
-
inputSchema: opensteerNetworkReplayInputSchema,
|
|
7273
|
-
outputSchema: opensteerNetworkReplayOutputSchema,
|
|
7274
|
-
requiredCapabilities: ["inspect.network", "inspect.cookies", "pages.manage"]
|
|
7275
|
-
}),
|
|
7276
7276
|
defineSemanticOperationSpec({
|
|
7277
7277
|
name: "interaction.capture",
|
|
7278
7278
|
description: "Capture a guarded interaction window, including event properties, state changes, and downstream network.",
|
|
@@ -16198,6 +16198,108 @@ function isStealthProfile(input) {
|
|
|
16198
16198
|
async function sleep(ms) {
|
|
16199
16199
|
await new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
16200
16200
|
}
|
|
16201
|
+
var ENV_FILENAMES = [".env", ".env.local"];
|
|
16202
|
+
var OPENSTEER_ENV_PREFIX = "OPENSTEER_";
|
|
16203
|
+
var opensteerEnvironmentCache = /* @__PURE__ */ new Map();
|
|
16204
|
+
function resolveOpensteerEnvironment(cwd = process.cwd(), baseEnv = process.env) {
|
|
16205
|
+
const resolvedCwd = path7.resolve(cwd);
|
|
16206
|
+
const signature = buildEnvironmentSignature(baseEnv, isOpensteerEnvironmentKey);
|
|
16207
|
+
const cached = opensteerEnvironmentCache.get(resolvedCwd);
|
|
16208
|
+
if (cached && cached.signature === signature) {
|
|
16209
|
+
return { ...cached.values };
|
|
16210
|
+
}
|
|
16211
|
+
const resolved = resolveEnvironmentFiles(resolvedCwd, baseEnv, isOpensteerEnvironmentKey);
|
|
16212
|
+
opensteerEnvironmentCache.set(resolvedCwd, {
|
|
16213
|
+
signature,
|
|
16214
|
+
values: { ...resolved }
|
|
16215
|
+
});
|
|
16216
|
+
return { ...resolved };
|
|
16217
|
+
}
|
|
16218
|
+
function loadEnvironment(cwd = process.cwd()) {
|
|
16219
|
+
const resolved = resolveEnvironmentFiles(path7.resolve(cwd), process.env);
|
|
16220
|
+
for (const [key, value] of Object.entries(resolved)) {
|
|
16221
|
+
process.env[key] = value;
|
|
16222
|
+
}
|
|
16223
|
+
}
|
|
16224
|
+
function collectDirectories(cwd) {
|
|
16225
|
+
const directories = [];
|
|
16226
|
+
let current = path7.resolve(cwd);
|
|
16227
|
+
for (; ; ) {
|
|
16228
|
+
directories.unshift(current);
|
|
16229
|
+
const parent = path7.dirname(current);
|
|
16230
|
+
if (parent === current) {
|
|
16231
|
+
return directories;
|
|
16232
|
+
}
|
|
16233
|
+
current = parent;
|
|
16234
|
+
}
|
|
16235
|
+
}
|
|
16236
|
+
function parseEnvFile(contents) {
|
|
16237
|
+
const parsed = {};
|
|
16238
|
+
for (const rawLine of contents.split(/\r?\n/u)) {
|
|
16239
|
+
const trimmed = rawLine.trim();
|
|
16240
|
+
if (!trimmed || trimmed.startsWith("#")) {
|
|
16241
|
+
continue;
|
|
16242
|
+
}
|
|
16243
|
+
const line = trimmed.startsWith("export ") ? trimmed.slice("export ".length) : trimmed;
|
|
16244
|
+
const separatorIndex = line.indexOf("=");
|
|
16245
|
+
if (separatorIndex <= 0) {
|
|
16246
|
+
continue;
|
|
16247
|
+
}
|
|
16248
|
+
const key = line.slice(0, separatorIndex).trim();
|
|
16249
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(key)) {
|
|
16250
|
+
continue;
|
|
16251
|
+
}
|
|
16252
|
+
const rawValue = line.slice(separatorIndex + 1).trim();
|
|
16253
|
+
parsed[key] = parseEnvValue(rawValue);
|
|
16254
|
+
}
|
|
16255
|
+
return parsed;
|
|
16256
|
+
}
|
|
16257
|
+
function parseEnvValue(rawValue) {
|
|
16258
|
+
if (rawValue.length >= 2 && rawValue.startsWith('"') && rawValue.endsWith('"')) {
|
|
16259
|
+
return rawValue.slice(1, -1).replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, " ").replace(/\\"/g, '"');
|
|
16260
|
+
}
|
|
16261
|
+
if (rawValue.length >= 2 && rawValue.startsWith("'") && rawValue.endsWith("'")) {
|
|
16262
|
+
return rawValue.slice(1, -1);
|
|
16263
|
+
}
|
|
16264
|
+
return rawValue.replace(/\s+#.*$/u, "").trimEnd();
|
|
16265
|
+
}
|
|
16266
|
+
function resolveEnvironmentFiles(cwd, baseEnv, predicate) {
|
|
16267
|
+
const resolved = collectEnvironment(baseEnv, predicate);
|
|
16268
|
+
const protectedKeys = new Set(Object.keys(resolved));
|
|
16269
|
+
const directories = collectDirectories(cwd);
|
|
16270
|
+
for (const directory of directories) {
|
|
16271
|
+
for (const filename of ENV_FILENAMES) {
|
|
16272
|
+
const filePath = path7.join(directory, filename);
|
|
16273
|
+
if (!existsSync(filePath)) {
|
|
16274
|
+
continue;
|
|
16275
|
+
}
|
|
16276
|
+
const parsed = parseEnvFile(readFileSync(filePath, "utf8"));
|
|
16277
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
16278
|
+
if (predicate && !predicate(key) || protectedKeys.has(key)) {
|
|
16279
|
+
continue;
|
|
16280
|
+
}
|
|
16281
|
+
resolved[key] = value;
|
|
16282
|
+
}
|
|
16283
|
+
}
|
|
16284
|
+
}
|
|
16285
|
+
return resolved;
|
|
16286
|
+
}
|
|
16287
|
+
function collectEnvironment(baseEnv, predicate) {
|
|
16288
|
+
const resolved = {};
|
|
16289
|
+
for (const [key, value] of Object.entries(baseEnv)) {
|
|
16290
|
+
if (predicate && !predicate(key) || value === void 0) {
|
|
16291
|
+
continue;
|
|
16292
|
+
}
|
|
16293
|
+
resolved[key] = value;
|
|
16294
|
+
}
|
|
16295
|
+
return resolved;
|
|
16296
|
+
}
|
|
16297
|
+
function buildEnvironmentSignature(baseEnv, predicate) {
|
|
16298
|
+
return Object.entries(baseEnv).filter(([key, value]) => predicate(key) && value !== void 0).sort(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey)).map(([key, value]) => `${key}=${value}`).join("\n");
|
|
16299
|
+
}
|
|
16300
|
+
function isOpensteerEnvironmentKey(key) {
|
|
16301
|
+
return key.startsWith(OPENSTEER_ENV_PREFIX);
|
|
16302
|
+
}
|
|
16201
16303
|
|
|
16202
16304
|
// src/provider/config.ts
|
|
16203
16305
|
var OPENSTEER_PROVIDER_MODES = ["local", "cloud"];
|
|
@@ -16354,12 +16456,7 @@ var BRAND_KEYCHAIN_SERVICE = {
|
|
|
16354
16456
|
async function resolveKeychainPassword(brandId) {
|
|
16355
16457
|
const service = BRAND_KEYCHAIN_SERVICE[brandId];
|
|
16356
16458
|
try {
|
|
16357
|
-
const { stdout } = await execFile2("security", [
|
|
16358
|
-
"find-generic-password",
|
|
16359
|
-
"-s",
|
|
16360
|
-
service,
|
|
16361
|
-
"-w"
|
|
16362
|
-
]);
|
|
16459
|
+
const { stdout } = await execFile2("security", ["find-generic-password", "-s", service, "-w"]);
|
|
16363
16460
|
return stdout.trim();
|
|
16364
16461
|
} catch {
|
|
16365
16462
|
throw new Error(
|
|
@@ -16973,11 +17070,6 @@ async function dispatchSemanticOperation(runtime, operation, input, options = {}
|
|
|
16973
17070
|
input,
|
|
16974
17071
|
options
|
|
16975
17072
|
);
|
|
16976
|
-
case "network.replay":
|
|
16977
|
-
return runtime.replayNetwork(
|
|
16978
|
-
input,
|
|
16979
|
-
options
|
|
16980
|
-
);
|
|
16981
17073
|
case "interaction.capture":
|
|
16982
17074
|
return runtime.captureInteraction(
|
|
16983
17075
|
input,
|
|
@@ -17057,7 +17149,7 @@ async function dispatchSemanticOperation(runtime, operation, input, options = {}
|
|
|
17057
17149
|
|
|
17058
17150
|
// ../runtime-core/package.json
|
|
17059
17151
|
var package_default = {
|
|
17060
|
-
version: "0.1.
|
|
17152
|
+
version: "0.1.7"};
|
|
17061
17153
|
|
|
17062
17154
|
// ../runtime-core/src/version.ts
|
|
17063
17155
|
var OPENSTEER_RUNTIME_CORE_VERSION = package_default.version;
|
|
@@ -21805,7 +21897,12 @@ var OpensteerSessionRuntime = class {
|
|
|
21805
21897
|
includeBodies: true,
|
|
21806
21898
|
redactSecretHeaders: false
|
|
21807
21899
|
});
|
|
21808
|
-
|
|
21900
|
+
const detail = await this.buildNetworkDetail(record, timeout);
|
|
21901
|
+
if (input.probe !== true) {
|
|
21902
|
+
return detail;
|
|
21903
|
+
}
|
|
21904
|
+
const transportProbe = await this.probeTransportsForRecord(record, timeout);
|
|
21905
|
+
return transportProbe === void 0 ? detail : { ...detail, transportProbe };
|
|
21809
21906
|
},
|
|
21810
21907
|
options
|
|
21811
21908
|
);
|
|
@@ -21840,54 +21937,6 @@ var OpensteerSessionRuntime = class {
|
|
|
21840
21937
|
throw error;
|
|
21841
21938
|
}
|
|
21842
21939
|
}
|
|
21843
|
-
async replayNetwork(input, options = {}) {
|
|
21844
|
-
const startedAt = Date.now();
|
|
21845
|
-
try {
|
|
21846
|
-
const output = await this.runWithOperationTimeout(
|
|
21847
|
-
"network.replay",
|
|
21848
|
-
async (timeout) => {
|
|
21849
|
-
const source = await this.resolveNetworkRecordByRecordId(input.recordId, timeout, {
|
|
21850
|
-
includeBodies: true,
|
|
21851
|
-
redactSecretHeaders: false
|
|
21852
|
-
});
|
|
21853
|
-
const replayRequest = buildReplayTransportRequest(source, input);
|
|
21854
|
-
return this.executeNetworkReplay(source, replayRequest, timeout, {
|
|
21855
|
-
...input.pageRef === void 0 ? {} : { pageRef: input.pageRef }
|
|
21856
|
-
});
|
|
21857
|
-
},
|
|
21858
|
-
options
|
|
21859
|
-
);
|
|
21860
|
-
await this.appendTrace({
|
|
21861
|
-
operation: "network.replay",
|
|
21862
|
-
startedAt,
|
|
21863
|
-
completedAt: Date.now(),
|
|
21864
|
-
outcome: "ok",
|
|
21865
|
-
data: {
|
|
21866
|
-
recordId: input.recordId,
|
|
21867
|
-
transport: output.transport,
|
|
21868
|
-
attempts: output.attempts.length
|
|
21869
|
-
},
|
|
21870
|
-
context: buildRuntimeTraceContext({
|
|
21871
|
-
sessionRef: this.sessionRef,
|
|
21872
|
-
pageRef: this.pageRef
|
|
21873
|
-
})
|
|
21874
|
-
});
|
|
21875
|
-
return output;
|
|
21876
|
-
} catch (error) {
|
|
21877
|
-
await this.appendTrace({
|
|
21878
|
-
operation: "network.replay",
|
|
21879
|
-
startedAt,
|
|
21880
|
-
completedAt: Date.now(),
|
|
21881
|
-
outcome: "error",
|
|
21882
|
-
error,
|
|
21883
|
-
context: buildRuntimeTraceContext({
|
|
21884
|
-
sessionRef: this.sessionRef,
|
|
21885
|
-
pageRef: this.pageRef
|
|
21886
|
-
})
|
|
21887
|
-
});
|
|
21888
|
-
throw error;
|
|
21889
|
-
}
|
|
21890
|
-
}
|
|
21891
21940
|
async captureScripts(input = {}, options = {}) {
|
|
21892
21941
|
assertValidSemanticOperationInput("scripts.capture", input);
|
|
21893
21942
|
const pageRef = input.pageRef ?? await this.ensurePageRef();
|
|
@@ -22483,7 +22532,7 @@ var OpensteerSessionRuntime = class {
|
|
|
22483
22532
|
completedAt: Date.now(),
|
|
22484
22533
|
outcome: "ok",
|
|
22485
22534
|
data: {
|
|
22486
|
-
transport: output.transport,
|
|
22535
|
+
...output.transport === void 0 ? {} : { transport: output.transport },
|
|
22487
22536
|
attempts: output.attempts.length,
|
|
22488
22537
|
...output.response === void 0 ? {} : { status: output.response.status },
|
|
22489
22538
|
url: input.url
|
|
@@ -23288,6 +23337,42 @@ var OpensteerSessionRuntime = class {
|
|
|
23288
23337
|
...notes.length === 0 ? {} : { notes }
|
|
23289
23338
|
};
|
|
23290
23339
|
}
|
|
23340
|
+
async probeTransportsForRecord(record, timeout) {
|
|
23341
|
+
if (record.record.status === void 0) {
|
|
23342
|
+
return void 0;
|
|
23343
|
+
}
|
|
23344
|
+
const request = buildReplayTransportRequest(record, { recordId: record.recordId });
|
|
23345
|
+
const fingerprint = buildCapturedRecordSuccessFingerprint(record);
|
|
23346
|
+
const attempts = [];
|
|
23347
|
+
let recommended;
|
|
23348
|
+
for (const transport of REPLAY_TRANSPORT_LADDER) {
|
|
23349
|
+
const attemptStartedAt = Date.now();
|
|
23350
|
+
try {
|
|
23351
|
+
const output = await this.executeReplayTransportAttempt(transport, request, timeout);
|
|
23352
|
+
const ok = matchesSuccessFingerprintFromProtocolResponse(output.response, fingerprint);
|
|
23353
|
+
attempts.push({
|
|
23354
|
+
transport,
|
|
23355
|
+
status: output.response.status,
|
|
23356
|
+
ok,
|
|
23357
|
+
durationMs: Date.now() - attemptStartedAt
|
|
23358
|
+
});
|
|
23359
|
+
if (ok && recommended === void 0) {
|
|
23360
|
+
recommended = transport;
|
|
23361
|
+
}
|
|
23362
|
+
} catch (error) {
|
|
23363
|
+
attempts.push({
|
|
23364
|
+
transport,
|
|
23365
|
+
ok: false,
|
|
23366
|
+
durationMs: Date.now() - attemptStartedAt,
|
|
23367
|
+
error: normalizeRuntimeErrorMessage(error)
|
|
23368
|
+
});
|
|
23369
|
+
}
|
|
23370
|
+
}
|
|
23371
|
+
return {
|
|
23372
|
+
...recommended === void 0 ? {} : { recommended },
|
|
23373
|
+
attempts
|
|
23374
|
+
};
|
|
23375
|
+
}
|
|
23291
23376
|
async buildRedirectChain(record, timeout) {
|
|
23292
23377
|
if (record.record.redirectFromRequestId === void 0 && record.record.redirectToRequestId === void 0) {
|
|
23293
23378
|
return {};
|
|
@@ -23406,57 +23491,6 @@ var OpensteerSessionRuntime = class {
|
|
|
23406
23491
|
})
|
|
23407
23492
|
};
|
|
23408
23493
|
}
|
|
23409
|
-
async executeNetworkReplay(source, request, timeout, options) {
|
|
23410
|
-
const fingerprint = buildCapturedRecordSuccessFingerprint(source);
|
|
23411
|
-
const attempts = [];
|
|
23412
|
-
let lastOutput;
|
|
23413
|
-
for (const transport of REPLAY_TRANSPORT_LADDER) {
|
|
23414
|
-
const attemptStartedAt = Date.now();
|
|
23415
|
-
try {
|
|
23416
|
-
const output = await this.executeReplayTransportAttempt(
|
|
23417
|
-
transport,
|
|
23418
|
-
request,
|
|
23419
|
-
timeout,
|
|
23420
|
-
options.pageRef
|
|
23421
|
-
);
|
|
23422
|
-
lastOutput = output;
|
|
23423
|
-
const ok = matchesSuccessFingerprintFromProtocolResponse(output.response, fingerprint);
|
|
23424
|
-
attempts.push({
|
|
23425
|
-
transport,
|
|
23426
|
-
status: output.response.status,
|
|
23427
|
-
ok,
|
|
23428
|
-
durationMs: Date.now() - attemptStartedAt
|
|
23429
|
-
});
|
|
23430
|
-
if (ok) {
|
|
23431
|
-
const fallbackNote = attempts.length > 1 ? buildReplayFallbackNote(attempts, transport) : void 0;
|
|
23432
|
-
const previewData2 = toStructuredPreviewData(output.data);
|
|
23433
|
-
return {
|
|
23434
|
-
recordId: source.recordId,
|
|
23435
|
-
transport,
|
|
23436
|
-
attempts,
|
|
23437
|
-
response: output.response,
|
|
23438
|
-
...previewData2 === void 0 ? {} : { data: previewData2 },
|
|
23439
|
-
...fallbackNote === void 0 ? {} : { note: fallbackNote }
|
|
23440
|
-
};
|
|
23441
|
-
}
|
|
23442
|
-
} catch (error) {
|
|
23443
|
-
attempts.push({
|
|
23444
|
-
transport,
|
|
23445
|
-
ok: false,
|
|
23446
|
-
durationMs: Date.now() - attemptStartedAt,
|
|
23447
|
-
error: normalizeRuntimeErrorMessage(error)
|
|
23448
|
-
});
|
|
23449
|
-
}
|
|
23450
|
-
}
|
|
23451
|
-
const previewData = toStructuredPreviewData(lastOutput?.data);
|
|
23452
|
-
return {
|
|
23453
|
-
recordId: source.recordId,
|
|
23454
|
-
attempts,
|
|
23455
|
-
...lastOutput?.response === void 0 ? {} : { response: lastOutput.response },
|
|
23456
|
-
...previewData === void 0 ? {} : { data: previewData },
|
|
23457
|
-
note: "all replay transports failed to reproduce the captured response"
|
|
23458
|
-
};
|
|
23459
|
-
}
|
|
23460
23494
|
async executeSessionFetch(request, input, timeout) {
|
|
23461
23495
|
const attempts = [];
|
|
23462
23496
|
let lastOutput;
|
|
@@ -28382,10 +28416,6 @@ var CloudSessionProxy = class {
|
|
|
28382
28416
|
await this.ensureSession();
|
|
28383
28417
|
return this.requireClient().invoke("network.detail", input);
|
|
28384
28418
|
}
|
|
28385
|
-
async replayNetwork(input) {
|
|
28386
|
-
await this.ensureSession();
|
|
28387
|
-
return this.requireClient().invoke("network.replay", input);
|
|
28388
|
-
}
|
|
28389
28419
|
async captureInteraction(input) {
|
|
28390
28420
|
await this.ensureSession();
|
|
28391
28421
|
return this.requireClient().invoke("interaction.capture", input);
|
|
@@ -28824,109 +28854,7 @@ function createOpensteerSemanticRuntime(input = {}) {
|
|
|
28824
28854
|
engineName: engine
|
|
28825
28855
|
});
|
|
28826
28856
|
}
|
|
28827
|
-
var ENV_FILENAMES = [".env", ".env.local"];
|
|
28828
|
-
var OPENSTEER_ENV_PREFIX = "OPENSTEER_";
|
|
28829
|
-
var opensteerEnvironmentCache = /* @__PURE__ */ new Map();
|
|
28830
|
-
function resolveOpensteerEnvironment(cwd = process.cwd(), baseEnv = process.env) {
|
|
28831
|
-
const resolvedCwd = path7.resolve(cwd);
|
|
28832
|
-
const signature = buildEnvironmentSignature(baseEnv, isOpensteerEnvironmentKey);
|
|
28833
|
-
const cached = opensteerEnvironmentCache.get(resolvedCwd);
|
|
28834
|
-
if (cached && cached.signature === signature) {
|
|
28835
|
-
return { ...cached.values };
|
|
28836
|
-
}
|
|
28837
|
-
const resolved = resolveEnvironmentFiles(resolvedCwd, baseEnv, isOpensteerEnvironmentKey);
|
|
28838
|
-
opensteerEnvironmentCache.set(resolvedCwd, {
|
|
28839
|
-
signature,
|
|
28840
|
-
values: { ...resolved }
|
|
28841
|
-
});
|
|
28842
|
-
return { ...resolved };
|
|
28843
|
-
}
|
|
28844
|
-
function loadEnvironment(cwd = process.cwd()) {
|
|
28845
|
-
const resolved = resolveEnvironmentFiles(path7.resolve(cwd), process.env);
|
|
28846
|
-
for (const [key, value] of Object.entries(resolved)) {
|
|
28847
|
-
process.env[key] = value;
|
|
28848
|
-
}
|
|
28849
|
-
}
|
|
28850
|
-
function collectDirectories(cwd) {
|
|
28851
|
-
const directories = [];
|
|
28852
|
-
let current = path7.resolve(cwd);
|
|
28853
|
-
for (; ; ) {
|
|
28854
|
-
directories.unshift(current);
|
|
28855
|
-
const parent = path7.dirname(current);
|
|
28856
|
-
if (parent === current) {
|
|
28857
|
-
return directories;
|
|
28858
|
-
}
|
|
28859
|
-
current = parent;
|
|
28860
|
-
}
|
|
28861
|
-
}
|
|
28862
|
-
function parseEnvFile(contents) {
|
|
28863
|
-
const parsed = {};
|
|
28864
|
-
for (const rawLine of contents.split(/\r?\n/u)) {
|
|
28865
|
-
const trimmed = rawLine.trim();
|
|
28866
|
-
if (!trimmed || trimmed.startsWith("#")) {
|
|
28867
|
-
continue;
|
|
28868
|
-
}
|
|
28869
|
-
const line = trimmed.startsWith("export ") ? trimmed.slice("export ".length) : trimmed;
|
|
28870
|
-
const separatorIndex = line.indexOf("=");
|
|
28871
|
-
if (separatorIndex <= 0) {
|
|
28872
|
-
continue;
|
|
28873
|
-
}
|
|
28874
|
-
const key = line.slice(0, separatorIndex).trim();
|
|
28875
|
-
if (!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(key)) {
|
|
28876
|
-
continue;
|
|
28877
|
-
}
|
|
28878
|
-
const rawValue = line.slice(separatorIndex + 1).trim();
|
|
28879
|
-
parsed[key] = parseEnvValue(rawValue);
|
|
28880
|
-
}
|
|
28881
|
-
return parsed;
|
|
28882
|
-
}
|
|
28883
|
-
function parseEnvValue(rawValue) {
|
|
28884
|
-
if (rawValue.length >= 2 && rawValue.startsWith('"') && rawValue.endsWith('"')) {
|
|
28885
|
-
return rawValue.slice(1, -1).replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, " ").replace(/\\"/g, '"');
|
|
28886
|
-
}
|
|
28887
|
-
if (rawValue.length >= 2 && rawValue.startsWith("'") && rawValue.endsWith("'")) {
|
|
28888
|
-
return rawValue.slice(1, -1);
|
|
28889
|
-
}
|
|
28890
|
-
return rawValue.replace(/\s+#.*$/u, "").trimEnd();
|
|
28891
|
-
}
|
|
28892
|
-
function resolveEnvironmentFiles(cwd, baseEnv, predicate) {
|
|
28893
|
-
const resolved = collectEnvironment(baseEnv, predicate);
|
|
28894
|
-
const protectedKeys = new Set(Object.keys(resolved));
|
|
28895
|
-
const directories = collectDirectories(cwd);
|
|
28896
|
-
for (const directory of directories) {
|
|
28897
|
-
for (const filename of ENV_FILENAMES) {
|
|
28898
|
-
const filePath = path7.join(directory, filename);
|
|
28899
|
-
if (!existsSync(filePath)) {
|
|
28900
|
-
continue;
|
|
28901
|
-
}
|
|
28902
|
-
const parsed = parseEnvFile(readFileSync(filePath, "utf8"));
|
|
28903
|
-
for (const [key, value] of Object.entries(parsed)) {
|
|
28904
|
-
if (predicate && !predicate(key) || protectedKeys.has(key)) {
|
|
28905
|
-
continue;
|
|
28906
|
-
}
|
|
28907
|
-
resolved[key] = value;
|
|
28908
|
-
}
|
|
28909
|
-
}
|
|
28910
|
-
}
|
|
28911
|
-
return resolved;
|
|
28912
|
-
}
|
|
28913
|
-
function collectEnvironment(baseEnv, predicate) {
|
|
28914
|
-
const resolved = {};
|
|
28915
|
-
for (const [key, value] of Object.entries(baseEnv)) {
|
|
28916
|
-
if (predicate && !predicate(key) || value === void 0) {
|
|
28917
|
-
continue;
|
|
28918
|
-
}
|
|
28919
|
-
resolved[key] = value;
|
|
28920
|
-
}
|
|
28921
|
-
return resolved;
|
|
28922
|
-
}
|
|
28923
|
-
function buildEnvironmentSignature(baseEnv, predicate) {
|
|
28924
|
-
return Object.entries(baseEnv).filter(([key, value]) => predicate(key) && value !== void 0).sort(([leftKey], [rightKey]) => leftKey.localeCompare(rightKey)).map(([key, value]) => `${key}=${value}`).join("\n");
|
|
28925
|
-
}
|
|
28926
|
-
function isOpensteerEnvironmentKey(key) {
|
|
28927
|
-
return key.startsWith(OPENSTEER_ENV_PREFIX);
|
|
28928
|
-
}
|
|
28929
28857
|
|
|
28930
28858
|
export { CloudSessionProxy, DEFAULT_OPENSTEER_ENGINE, DEFERRED_MATCH_ATTR_KEYS, ElementPathError, FlowRecorderCollector, MATCH_ATTRIBUTE_PRIORITY, OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL, OPENSTEER_ENGINE_NAMES, OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT, OPENSTEER_FILESYSTEM_WORKSPACE_VERSION, OpensteerAttachAmbiguousError, OpensteerBrowserManager, OpensteerCloudClient, OpensteerRuntime, OpensteerSessionRuntime2 as OpensteerSessionRuntime, STABLE_PRIMARY_ATTR_KEYS, assertProviderSupportsEngine, buildArrayFieldPathCandidates, buildDomDescriptorKey, buildDomDescriptorPayload, buildDomDescriptorVersion, buildPathCandidates, buildPathSelectorHint, buildSegmentSelector, clearPersistedSessionRecord, cloneElementPath, cloneReplayElementPath, cloneStructuralElementAnchor, createArtifactStore, createDomDescriptorStore, createDomRuntime, createFilesystemOpensteerWorkspace, createObservationStore, createOpensteerExtractionDescriptorStore, createOpensteerSemanticRuntime, defaultFallbackPolicy, defaultPolicy, defaultRetryPolicy, defaultSettlePolicy, defaultTimeoutPolicy, delayWithSignal, discoverLocalCdpBrowsers, dispatchSemanticOperation, generateReplayScript, hashDomDescriptorPersist, inspectCdpEndpoint, isCurrentUrlField, isProcessRunning, isValidCssAttributeKey, listLocalChromeProfiles, loadEnvironment, manifestToExternalBinaryLocation, normalizeExtractedValue, normalizeObservabilityConfig, normalizeOpensteerEngineName, normalizeOpensteerProviderMode, normalizeWorkspaceId, parseDomDescriptorRecord, parseExtractionDescriptorRecord, pathExists, readPersistedCloudSessionRecord, readPersistedLocalBrowserSessionRecord, readPersistedSessionRecord, requireCloudAppBaseUrl, resolveCloudConfig, resolveCloudSessionRecordPath, resolveDomActionBridge, resolveExtractedValueInContext, resolveFilesystemWorkspacePath, resolveLiveSessionRecordPath, resolveLocalSessionRecordPath, resolveOpensteerEngineName, resolveOpensteerEnvironment, resolveOpensteerProvider, resolveOpensteerRuntimeConfig, runWithPolicyTimeout, sanitizeElementPath, sanitizeReplayElementPath, sanitizeStructuralElementAnchor, settleWithPolicy, shouldKeepAttributeForPath, writePersistedSessionRecord };
|
|
28931
|
-
//# sourceMappingURL=chunk-
|
|
28932
|
-
//# sourceMappingURL=chunk-
|
|
28859
|
+
//# sourceMappingURL=chunk-KBO7DDPF.js.map
|
|
28860
|
+
//# sourceMappingURL=chunk-KBO7DDPF.js.map
|