@opencode/browse 0.0.17-dev.170 → 0.0.17-dev.171
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/{cli-k6tgme5c.mjs → cli-n2yqdpef.mjs} +12 -12
- package/dist/cli.mjs +12 -12
- package/dist/{helpers-g8dsh6s5.mjs → helpers-na4s8h8f.mjs} +1 -1
- package/dist/{legacy-runtime-jj1srsz7.mjs → legacy-runtime-pef5jajn.mjs} +4 -4
- package/dist/{main-63xjd6ts.mjs → main-31mjsvtm.mjs} +2 -2
- package/dist/{main-16tqhq5g.mjs → main-3gx5fe95.mjs} +1 -1
- package/dist/{main-99dxg777.mjs → main-5snyxk65.mjs} +2 -2
- package/dist/{main-43k95nh0.mjs → main-6q5nqhy7.mjs} +1 -1
- package/dist/{main-8k9qykpa.mjs → main-g13tfban.mjs} +1 -1
- package/dist/{main-32h1fmkw.mjs → main-gvzdjgte.mjs} +3 -3
- package/dist/main-hrrgcjhe.mjs +4 -0
- package/dist/{main-e17wqzky.mjs → main-ma5ncx3b.mjs} +2 -2
- package/dist/{main-3g0xky5y.mjs → main-qq7x2tgn.mjs} +2 -2
- package/dist/{main-apebcva2.mjs → main-t8c7aq8b.mjs} +3 -3
- package/dist/{main-0tr21dqs.mjs → main-x9vdxj9f.mjs} +3 -3
- package/dist/{mcp-85av73hq.mjs → mcp-eqfvz2d5.mjs} +7 -7
- package/dist/{migrate-1vqatsz2.mjs → migrate-h0e3yv0y.mjs} +4 -4
- package/dist/{relay-xkw8xs4k.mjs → relay-9fsv094e.mjs} +234 -39
- package/dist/{runtime-update-ny5cgrba.mjs → runtime-update-7m0tkybs.mjs} +4 -4
- package/dist/{setup-18revp9m.mjs → setup-ac6kjvgh.mjs} +7 -7
- package/dist/{skill-text-z1pce87x.mjs → skill-text-thdaq5mc.mjs} +14 -1
- package/dist/{supervisor-93fvdjav.mjs → supervisor-638mhqwx.mjs} +3 -3
- package/dist/{update-y6xqxqww.mjs → update-tyrveejz.mjs} +3 -3
- package/dist/{version-ngzs1vvq.mjs → version-njwyb4qk.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +14 -1
- package/dist/main-dsx1pjp8.mjs +0 -4
|
@@ -25,7 +25,7 @@ import"./main-pmfd055v.mjs";
|
|
|
25
25
|
import {
|
|
26
26
|
opencodeBrowserVersion2,
|
|
27
27
|
opencodeBrowserBuildId2
|
|
28
|
-
} from "./main-
|
|
28
|
+
} from "./main-hrrgcjhe.mjs";
|
|
29
29
|
import {
|
|
30
30
|
configRoot2,
|
|
31
31
|
dataRoot,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
devExtension,
|
|
39
39
|
installCommand,
|
|
40
40
|
autoUpdateStatus
|
|
41
|
-
} from "./main-
|
|
41
|
+
} from "./main-t8c7aq8b.mjs";
|
|
42
42
|
import {
|
|
43
43
|
extensionProtocolVersion,
|
|
44
44
|
extensionProtocolAdvice
|
|
@@ -64,29 +64,29 @@ import {
|
|
|
64
64
|
ensureExtensionConnected,
|
|
65
65
|
stoppedRelayStatus,
|
|
66
66
|
statusCollections
|
|
67
|
-
} from "./main-
|
|
67
|
+
} from "./main-x9vdxj9f.mjs";
|
|
68
68
|
import"./main-4h7rfhhr.mjs";
|
|
69
69
|
import {
|
|
70
70
|
updateJson2,
|
|
71
71
|
formatUpdateNotice2,
|
|
72
72
|
updateNotice2
|
|
73
|
-
} from "./main-
|
|
73
|
+
} from "./main-ma5ncx3b.mjs";
|
|
74
74
|
import {
|
|
75
75
|
settingKeys,
|
|
76
76
|
formatSettings,
|
|
77
77
|
ensureSessionExists
|
|
78
|
-
} from "./main-
|
|
78
|
+
} from "./main-qq7x2tgn.mjs";
|
|
79
79
|
import {
|
|
80
80
|
addSecret,
|
|
81
81
|
listSecrets,
|
|
82
82
|
removeSecret
|
|
83
|
-
} from "./main-
|
|
83
|
+
} from "./main-g13tfban.mjs";
|
|
84
84
|
import {
|
|
85
85
|
defaultJournalBaseDir,
|
|
86
86
|
readJournalEntries,
|
|
87
87
|
formatJournalEntry
|
|
88
|
-
} from "./main-
|
|
89
|
-
import"./main-
|
|
88
|
+
} from "./main-5snyxk65.mjs";
|
|
89
|
+
import"./main-3gx5fe95.mjs";
|
|
90
90
|
import {
|
|
91
91
|
taggedEnum,
|
|
92
92
|
is2,
|
|
@@ -5844,7 +5844,7 @@ var status = make("status", {
|
|
|
5844
5844
|
}
|
|
5845
5845
|
})).pipe(withDescription4("Show relay, extension, and target status"));
|
|
5846
5846
|
var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
|
|
5847
|
-
const { runMcpServer } = yield* promise(() => import("./mcp-
|
|
5847
|
+
const { runMcpServer } = yield* promise(() => import("./mcp-eqfvz2d5.mjs"));
|
|
5848
5848
|
yield* runMcpServer;
|
|
5849
5849
|
})).pipe(withDescription4("Run the browse MCP server over stdio"));
|
|
5850
5850
|
registerCliCommand(400, () => tabs);
|
|
@@ -5865,7 +5865,7 @@ registerCliCommand(810, ({ packageRoot }) => make("doctor", {
|
|
|
5865
5865
|
}
|
|
5866
5866
|
})).pipe(withDescription4("Diagnose the local browse install and runtime")));
|
|
5867
5867
|
registerCliCommand(820, () => make("skill", {}, fn("Cli.skill")(function* () {
|
|
5868
|
-
const { skillText } = yield* promise(() => import("./skill-text-
|
|
5868
|
+
const { skillText } = yield* promise(() => import("./skill-text-thdaq5mc.mjs"));
|
|
5869
5869
|
yield* log(skillText.trimEnd());
|
|
5870
5870
|
})).pipe(withDescription4("Print the browse agent skill text")));
|
|
5871
5871
|
registerCliCommand(900, () => mcp);
|
|
@@ -6292,12 +6292,12 @@ registerCliCommand(710, () => flightRecorder);
|
|
|
6292
6292
|
|
|
6293
6293
|
// src/cli/relay.ts
|
|
6294
6294
|
var serve = make("serve", {}, fn("Cli.serve")(function* () {
|
|
6295
|
-
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-
|
|
6295
|
+
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-9fsv094e.mjs"), import("./helpers-na4s8h8f.mjs")]));
|
|
6296
6296
|
const port = yield* portConfig;
|
|
6297
6297
|
const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
|
|
6298
6298
|
yield* scoped(gen(function* () {
|
|
6299
6299
|
const relay = yield* startRelay({ port, additionalExtensionOrigins });
|
|
6300
|
-
yield* promise(() => import("./legacy-runtime-
|
|
6300
|
+
yield* promise(() => import("./legacy-runtime-pef5jajn.mjs").then((module) => module.commitLegacyTakeover()));
|
|
6301
6301
|
yield* log(`browse relay listening at ${relay.url}`);
|
|
6302
6302
|
yield* log(`browse connects automatically while the browser runs. Run \`${cliCommand("status")}\` to check.`);
|
|
6303
6303
|
yield* never;
|
package/dist/cli.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
|
|
9
9
|
// src/main.ts
|
|
10
10
|
import path from "node:path";
|
|
11
|
-
var embeddedVersion = "0.0.17-dev.
|
|
11
|
+
var embeddedVersion = "0.0.17-dev.171";
|
|
12
12
|
var setupCommands = new Set(["install", "uninstall", "extension", "pair", "set"]);
|
|
13
13
|
var command = process.argv[2];
|
|
14
14
|
var args = process.argv.slice(3);
|
|
@@ -18,26 +18,26 @@ var options = separator === -1 ? args : args.slice(0, separator);
|
|
|
18
18
|
var askedForHelp = command === "--help" || command === "-h" || options.some((arg) => arg === "--help" || arg === "-h");
|
|
19
19
|
var preCliHelp = askedForHelp && (command === "update" || command !== undefined && setupCommands.has(command));
|
|
20
20
|
var oldRuntime = legacyRuntime();
|
|
21
|
-
var takingOver = command === "serve" && !askedForHelp && legacyRuntimeActive(oldRuntime) && await import("./legacy-runtime-
|
|
21
|
+
var takingOver = command === "serve" && !askedForHelp && legacyRuntimeActive(oldRuntime) && await import("./legacy-runtime-pef5jajn.mjs").then((module) => module.prepareLegacyTakeover(oldRuntime)).catch(() => false);
|
|
22
22
|
if (!takingOver)
|
|
23
23
|
settleLegacyHome(process.env, oldRuntime);
|
|
24
24
|
if (command !== "--version" && command !== "-v" && !askedForHelp && !takingOver && !process.env.OPENCODE_BROWSER_HOME && legacyRootsLeft()) {
|
|
25
25
|
try {
|
|
26
|
-
const { migrateLegacy } = await import("./migrate-
|
|
26
|
+
const { migrateLegacy } = await import("./migrate-h0e3yv0y.mjs");
|
|
27
27
|
migrateLegacy();
|
|
28
28
|
} catch {}
|
|
29
29
|
}
|
|
30
30
|
if (command === "--version" || command === "-v") {
|
|
31
|
-
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-
|
|
31
|
+
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-njwyb4qk.mjs")).opencodeBrowserVersion;
|
|
32
32
|
process.stdout.write(`${opencodeBrowserVersion}
|
|
33
33
|
`);
|
|
34
|
-
} else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-
|
|
35
|
-
const { runBinaryMcp } = await import("./supervisor-
|
|
34
|
+
} else if (command === "mcp" && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1" && (await import("./supervisor-638mhqwx.mjs")).supervisesMcp()) {
|
|
35
|
+
const { runBinaryMcp } = await import("./supervisor-638mhqwx.mjs");
|
|
36
36
|
await runBinaryMcp(process.argv.slice(3));
|
|
37
37
|
} else if (invokedAs === "opencode-browser-mcp" || command === "mcp" && process.argv.length === 3) {
|
|
38
38
|
const { NodeRuntime } = await import("./index-j79y2me1.mjs");
|
|
39
39
|
const { defaultTeardown } = await import("./Runtime-jrg7sc9p.mjs");
|
|
40
|
-
const { runMcpServer } = await import("./mcp-
|
|
40
|
+
const { runMcpServer } = await import("./mcp-eqfvz2d5.mjs");
|
|
41
41
|
let stdinGone = false;
|
|
42
42
|
const onStdinGone = () => {
|
|
43
43
|
stdinGone = true;
|
|
@@ -59,13 +59,13 @@ if (command === "--version" || command === "-v") {
|
|
|
59
59
|
})
|
|
60
60
|
}));
|
|
61
61
|
} else if (command === "self-update" || command === "runtime-switch") {
|
|
62
|
-
const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-
|
|
62
|
+
const { runSelfUpdate, runRuntimeSwitch } = await import("./runtime-update-7m0tkybs.mjs");
|
|
63
63
|
await (command === "self-update" ? runSelfUpdate : runRuntimeSwitch)(process.argv.slice(3));
|
|
64
64
|
} else if (command === "update" && !askedForHelp) {
|
|
65
|
-
const { runUpdateCommand } = await import("./update-
|
|
65
|
+
const { runUpdateCommand } = await import("./update-tyrveejz.mjs");
|
|
66
66
|
await runUpdateCommand(process.argv.slice(3));
|
|
67
67
|
} else if (command && setupCommands.has(command) && !askedForHelp) {
|
|
68
|
-
const { runSetup } = await import("./setup-
|
|
68
|
+
const { runSetup } = await import("./setup-ac6kjvgh.mjs");
|
|
69
69
|
await runSetup(command, process.argv.slice(3));
|
|
70
70
|
} else {
|
|
71
71
|
if (preCliHelp || !command || command === "--help" || command === "-h") {
|
|
@@ -102,9 +102,9 @@ executable in ~/.local/bin (or $XDG_BIN_HOME).
|
|
|
102
102
|
`);
|
|
103
103
|
}
|
|
104
104
|
if (command === "status" && !askedForHelp && !process.argv.includes("--json")) {
|
|
105
|
-
const { printSetupStatus } = await import("./setup-
|
|
105
|
+
const { printSetupStatus } = await import("./setup-ac6kjvgh.mjs");
|
|
106
106
|
printSetupStatus();
|
|
107
107
|
}
|
|
108
|
-
const { runCli } = await import("./cli-
|
|
108
|
+
const { runCli } = await import("./cli-n2yqdpef.mjs");
|
|
109
109
|
runCli(preCliHelp ? ["--help"] : undefined);
|
|
110
110
|
}
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "./main-pmfd055v.mjs";
|
|
6
6
|
import {
|
|
7
7
|
opencodeBrowserVersion2
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-hrrgcjhe.mjs";
|
|
9
9
|
import {
|
|
10
10
|
installerBinaryPath,
|
|
11
11
|
compiledBinary,
|
|
12
12
|
channelOf,
|
|
13
13
|
installedRuntime2
|
|
14
|
-
} from "./main-
|
|
14
|
+
} from "./main-t8c7aq8b.mjs";
|
|
15
15
|
|
|
16
16
|
// src/setup/legacy-runtime.ts
|
|
17
17
|
import fs from "node:fs";
|
|
@@ -37,7 +37,7 @@ async function prepareLegacyTakeover(legacy, options = {}) {
|
|
|
37
37
|
if (await portInUse(Number(env.OPENCODE_BROWSER_PORT) || 19988))
|
|
38
38
|
return false;
|
|
39
39
|
const home = options.home ?? os.homedir();
|
|
40
|
-
const { copyLegacyData } = await import("./migrate-
|
|
40
|
+
const { copyLegacyData } = await import("./migrate-h0e3yv0y.mjs");
|
|
41
41
|
delete env.OPENCODE_BROWSER_HOME;
|
|
42
42
|
copyLegacyData(home);
|
|
43
43
|
pending = { legacy, install, home };
|
|
@@ -51,7 +51,7 @@ async function commitLegacyTakeover(now = Date.now()) {
|
|
|
51
51
|
try {
|
|
52
52
|
if (!adoptLegacyRuntime(legacy, install, now))
|
|
53
53
|
return false;
|
|
54
|
-
const { migrateLegacy } = await import("./migrate-
|
|
54
|
+
const { migrateLegacy } = await import("./migrate-h0e3yv0y.mjs");
|
|
55
55
|
migrateLegacy(home, now);
|
|
56
56
|
return true;
|
|
57
57
|
} catch {
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
bundledPairingCodeTtlMs,
|
|
6
6
|
mintPairingCode,
|
|
7
7
|
writeExtensionPairing
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-6q5nqhy7.mjs";
|
|
9
9
|
import {
|
|
10
10
|
configRoot2,
|
|
11
11
|
cacheRoot,
|
|
12
12
|
devExtensionUrl,
|
|
13
13
|
devExtensionFolder
|
|
14
|
-
} from "./main-
|
|
14
|
+
} from "./main-t8c7aq8b.mjs";
|
|
15
15
|
|
|
16
16
|
// src/setup/dev-extension.ts
|
|
17
17
|
import { createHash } from "node:crypto";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./main-4h7rfhhr.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isValidSessionId2
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-x9vdxj9f.mjs";
|
|
7
7
|
import {
|
|
8
8
|
decodeUnknownOption,
|
|
9
9
|
optionalKey,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./main-wpt5ha44.mjs";
|
|
20
20
|
import {
|
|
21
21
|
stateRoot
|
|
22
|
-
} from "./main-
|
|
22
|
+
} from "./main-t8c7aq8b.mjs";
|
|
23
23
|
|
|
24
24
|
// src/session-manager/journal.ts
|
|
25
25
|
import fs from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-hrrgcjhe.mjs";
|
|
4
4
|
import {
|
|
5
5
|
configRoot2,
|
|
6
6
|
dataRoot,
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
npmGlobalRoot,
|
|
22
22
|
installedVersion,
|
|
23
23
|
runCommand
|
|
24
|
-
} from "./main-
|
|
24
|
+
} from "./main-t8c7aq8b.mjs";
|
|
25
25
|
import {
|
|
26
26
|
writeStdout
|
|
27
27
|
} from "./main-tk4axre7.mjs";
|
|
28
28
|
import {
|
|
29
29
|
formatPairingCode
|
|
30
|
-
} from "./main-
|
|
30
|
+
} from "./main-6q5nqhy7.mjs";
|
|
31
31
|
import {
|
|
32
32
|
unpackedExtensionId
|
|
33
33
|
} from "./main-b3jrctcx.mjs";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
installedRuntime2,
|
|
7
7
|
autoUpdateStatus,
|
|
8
8
|
updateAvailable
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-t8c7aq8b.mjs";
|
|
10
10
|
import {
|
|
11
11
|
unpackedReloadAdvice
|
|
12
12
|
} from "./main-b3jrctcx.mjs";
|
|
@@ -315,7 +315,7 @@ function runUpdate(args, deps) {
|
|
|
315
315
|
async function runUpdateCommand2(args) {
|
|
316
316
|
const log = (line) => process.stdout.write(line + `
|
|
317
317
|
`);
|
|
318
|
-
const { runInstalledUpdate } = await import("./runtime-update-
|
|
318
|
+
const { runInstalledUpdate } = await import("./runtime-update-7m0tkybs.mjs");
|
|
319
319
|
if (await runInstalledUpdate(args))
|
|
320
320
|
return;
|
|
321
321
|
if (compiledBinary()) {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
parseTargetSelection2,
|
|
13
13
|
getObject2,
|
|
14
14
|
getString2
|
|
15
|
-
} from "./main-
|
|
15
|
+
} from "./main-x9vdxj9f.mjs";
|
|
16
16
|
import {
|
|
17
17
|
isStream,
|
|
18
18
|
provideContext
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
} from "./main-qazf3bhk.mjs";
|
|
104
104
|
import {
|
|
105
105
|
cliCommand
|
|
106
|
-
} from "./main-
|
|
106
|
+
} from "./main-t8c7aq8b.mjs";
|
|
107
107
|
|
|
108
108
|
// node_modules/effect/dist/PrimaryKey.js
|
|
109
109
|
var symbol = "~effect/PrimaryKey";
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./main-pmfd055v.mjs";
|
|
5
5
|
import {
|
|
6
6
|
opencodeBrowserVersion2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-hrrgcjhe.mjs";
|
|
8
8
|
|
|
9
9
|
// src/paths.ts
|
|
10
10
|
import fs from "node:fs";
|
|
@@ -114,7 +114,7 @@ function cliInstall() {
|
|
|
114
114
|
return { kind: "binary", binary: installedBinary() ?? process.execPath, pathEnv: process.env.PATH };
|
|
115
115
|
if (fromCheckout())
|
|
116
116
|
return { kind: "checkout", bundle: path.join(packageRoot(), "dist", "cli.mjs") };
|
|
117
|
-
return { kind: "npm", version: "0.0.17-dev.
|
|
117
|
+
return { kind: "npm", version: "0.0.17-dev.171", npx: /[/\\]_npx[/\\]/.test(process.argv[1] ?? "") };
|
|
118
118
|
}
|
|
119
119
|
function cliPrefix(install = cliInstall()) {
|
|
120
120
|
if (install.kind === "binary") {
|
|
@@ -136,7 +136,7 @@ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjh
|
|
|
136
136
|
return id ? { id } : {};
|
|
137
137
|
}
|
|
138
138
|
var RELEASE_SERVICE = "https://anoma.ly/release";
|
|
139
|
-
function devExtension(baked = { file: "browse-extension-0.0.17-dev.
|
|
139
|
+
function devExtension(baked = { file: "browse-extension-0.0.17-dev.171.zip", sha256: "ceb4ed7e02b00480bbd8d5304af2df0a990ff40b91ddfc62df2a7eeaacfaf98e", size: 184210 }) {
|
|
140
140
|
return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
|
|
141
141
|
}
|
|
142
142
|
var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./main-s3g4jwx5.mjs";
|
|
19
19
|
import {
|
|
20
20
|
opencodeBrowserBuildId2
|
|
21
|
-
} from "./main-
|
|
21
|
+
} from "./main-hrrgcjhe.mjs";
|
|
22
22
|
import {
|
|
23
23
|
stateRoot,
|
|
24
24
|
compiledBinary,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
compareVersions,
|
|
29
29
|
installedRuntime2,
|
|
30
30
|
installedVersion
|
|
31
|
-
} from "./main-
|
|
31
|
+
} from "./main-t8c7aq8b.mjs";
|
|
32
32
|
import {
|
|
33
33
|
relayAuthorization
|
|
34
|
-
} from "./main-
|
|
34
|
+
} from "./main-3gx5fe95.mjs";
|
|
35
35
|
import {
|
|
36
36
|
Pointer,
|
|
37
37
|
passthrough,
|
|
@@ -46,11 +46,11 @@ import {
|
|
|
46
46
|
import"./main-pmfd055v.mjs";
|
|
47
47
|
import {
|
|
48
48
|
opencodeBrowserVersion2
|
|
49
|
-
} from "./main-
|
|
49
|
+
} from "./main-hrrgcjhe.mjs";
|
|
50
50
|
import {
|
|
51
51
|
cliCommand,
|
|
52
52
|
autoUpdateStatus
|
|
53
|
-
} from "./main-
|
|
53
|
+
} from "./main-t8c7aq8b.mjs";
|
|
54
54
|
import"./main-b3jrctcx.mjs";
|
|
55
55
|
import {
|
|
56
56
|
option,
|
|
@@ -70,12 +70,12 @@ import {
|
|
|
70
70
|
relayBuildProblem,
|
|
71
71
|
ensureRelay,
|
|
72
72
|
ensureExtensionConnected
|
|
73
|
-
} from "./main-
|
|
73
|
+
} from "./main-x9vdxj9f.mjs";
|
|
74
74
|
import"./main-4h7rfhhr.mjs";
|
|
75
75
|
import {
|
|
76
76
|
updateJson2,
|
|
77
77
|
createUpdateWatcher2
|
|
78
|
-
} from "./main-
|
|
78
|
+
} from "./main-ma5ncx3b.mjs";
|
|
79
79
|
import {
|
|
80
80
|
settingSpecs,
|
|
81
81
|
securityVariables,
|
|
@@ -156,12 +156,12 @@ import {
|
|
|
156
156
|
toolResultForValue2,
|
|
157
157
|
mcpErrorMessage2,
|
|
158
158
|
toolResult
|
|
159
|
-
} from "./main-
|
|
159
|
+
} from "./main-qq7x2tgn.mjs";
|
|
160
160
|
import {
|
|
161
161
|
makeUnsafe,
|
|
162
162
|
make3,
|
|
163
163
|
listSecrets
|
|
164
|
-
} from "./main-
|
|
164
|
+
} from "./main-g13tfban.mjs";
|
|
165
165
|
import {
|
|
166
166
|
Clock,
|
|
167
167
|
type,
|
|
@@ -176,7 +176,7 @@ import {
|
|
|
176
176
|
orElse,
|
|
177
177
|
exhaustive
|
|
178
178
|
} from "./main-048kx59h.mjs";
|
|
179
|
-
import"./main-
|
|
179
|
+
import"./main-3gx5fe95.mjs";
|
|
180
180
|
import {
|
|
181
181
|
Class,
|
|
182
182
|
taggedEnum,
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
editAgentConfig,
|
|
8
8
|
OPENCODE_CONFIG_NAMES,
|
|
9
9
|
configureMcp
|
|
10
|
-
} from "./main-
|
|
10
|
+
} from "./main-gvzdjgte.mjs";
|
|
11
11
|
import {
|
|
12
12
|
legacyDataRoot,
|
|
13
13
|
legacyRoots,
|
|
14
14
|
legacyRuntime,
|
|
15
15
|
LEGACY_HANDOVER_GRACE_MS
|
|
16
16
|
} from "./main-pmfd055v.mjs";
|
|
17
|
-
import"./main-
|
|
17
|
+
import"./main-hrrgcjhe.mjs";
|
|
18
18
|
import {
|
|
19
19
|
configRoot2,
|
|
20
20
|
dataRoot,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
binRoot,
|
|
24
24
|
binaryName,
|
|
25
25
|
devExtensionFolder
|
|
26
|
-
} from "./main-
|
|
26
|
+
} from "./main-t8c7aq8b.mjs";
|
|
27
27
|
import"./main-tk4axre7.mjs";
|
|
28
28
|
import"./main-4h7rfhhr.mjs";
|
|
29
|
-
import"./main-
|
|
29
|
+
import"./main-6q5nqhy7.mjs";
|
|
30
30
|
import"./main-b3jrctcx.mjs";
|
|
31
31
|
|
|
32
32
|
// src/setup/migrate.ts
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
opencodeBrowserVersion2,
|
|
6
6
|
opencodeBrowserBuildId2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-hrrgcjhe.mjs";
|
|
8
8
|
import {
|
|
9
9
|
defaultRoots,
|
|
10
10
|
configRoot2,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
setStoredMode,
|
|
29
29
|
autoUpdateStatus,
|
|
30
30
|
createAutoUpdater
|
|
31
|
-
} from "./main-
|
|
31
|
+
} from "./main-t8c7aq8b.mjs";
|
|
32
32
|
import {
|
|
33
33
|
extensionProtocolVersion,
|
|
34
34
|
minExtensionProtocolVersion,
|
|
@@ -108,7 +108,7 @@ import {
|
|
|
108
108
|
dataUrlDocument2,
|
|
109
109
|
appendManagedRelayProcessLog,
|
|
110
110
|
relayLog
|
|
111
|
-
} from "./main-
|
|
111
|
+
} from "./main-x9vdxj9f.mjs";
|
|
112
112
|
import {
|
|
113
113
|
context,
|
|
114
114
|
pendingPairingCodeKeys,
|
|
@@ -126,7 +126,7 @@ import {
|
|
|
126
126
|
pairingSessionKey,
|
|
127
127
|
sessionProof,
|
|
128
128
|
wrapToken
|
|
129
|
-
} from "./main-
|
|
129
|
+
} from "./main-6q5nqhy7.mjs";
|
|
130
130
|
import {
|
|
131
131
|
makeUnsafe,
|
|
132
132
|
terminateChildProcess,
|
|
@@ -149,16 +149,16 @@ import {
|
|
|
149
149
|
checkNavigationUrl,
|
|
150
150
|
readSecret,
|
|
151
151
|
secretText
|
|
152
|
-
} from "./main-
|
|
152
|
+
} from "./main-g13tfban.mjs";
|
|
153
153
|
import {
|
|
154
154
|
defaultJournalBaseDir,
|
|
155
155
|
makeJournalEntry,
|
|
156
156
|
appendJournalEntry,
|
|
157
157
|
startJournalRetention
|
|
158
|
-
} from "./main-
|
|
158
|
+
} from "./main-5snyxk65.mjs";
|
|
159
159
|
import {
|
|
160
160
|
createUpdateWatcher2
|
|
161
|
-
} from "./main-
|
|
161
|
+
} from "./main-ma5ncx3b.mjs";
|
|
162
162
|
import {
|
|
163
163
|
SettingsInputError,
|
|
164
164
|
parseSettingChanges,
|
|
@@ -166,13 +166,13 @@ import {
|
|
|
166
166
|
settingsToExtension,
|
|
167
167
|
describeSettings,
|
|
168
168
|
describeChanges
|
|
169
|
-
} from "./main-
|
|
169
|
+
} from "./main-qq7x2tgn.mjs";
|
|
170
170
|
import {
|
|
171
171
|
relayHostname,
|
|
172
172
|
isLocalPeer,
|
|
173
173
|
installedDevExtension,
|
|
174
174
|
syncDevExtension
|
|
175
|
-
} from "./main-
|
|
175
|
+
} from "./main-31mjsvtm.mjs";
|
|
176
176
|
import {
|
|
177
177
|
currentTimeMillis,
|
|
178
178
|
value,
|
|
@@ -185,7 +185,7 @@ import {
|
|
|
185
185
|
relayToken,
|
|
186
186
|
secretsEqual,
|
|
187
187
|
ensurePrivateDirectory
|
|
188
|
-
} from "./main-
|
|
188
|
+
} from "./main-3gx5fe95.mjs";
|
|
189
189
|
import {
|
|
190
190
|
join,
|
|
191
191
|
interrupt,
|
|
@@ -846,6 +846,64 @@ class CdpClientPool {
|
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
848
|
|
|
849
|
+
// src/cdp/emulation.ts
|
|
850
|
+
var deviceMetricsClearRetryMs = 100;
|
|
851
|
+
function clearDeviceMetricsOverride(send, options = {}) {
|
|
852
|
+
const clear = send("Emulation.clearDeviceMetricsOverride", {});
|
|
853
|
+
return gen(function* () {
|
|
854
|
+
yield* clear;
|
|
855
|
+
yield* sleep(deviceMetricsClearRetryMs);
|
|
856
|
+
if (options.retry?.() === false)
|
|
857
|
+
return;
|
|
858
|
+
yield* clear;
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
class DeviceMetricsOverrides {
|
|
863
|
+
nextGeneration = 1;
|
|
864
|
+
entries = new Map;
|
|
865
|
+
mark(tabId, sessionId) {
|
|
866
|
+
const generation = this.nextGeneration++;
|
|
867
|
+
this.entries.set(tabId, { sessionId, generation });
|
|
868
|
+
return generation;
|
|
869
|
+
}
|
|
870
|
+
generation(tabId) {
|
|
871
|
+
return this.entries.get(tabId)?.generation ?? 0;
|
|
872
|
+
}
|
|
873
|
+
sessionId(tabId) {
|
|
874
|
+
return this.entries.get(tabId)?.sessionId;
|
|
875
|
+
}
|
|
876
|
+
isCurrent(tabId, generation) {
|
|
877
|
+
return this.generation(tabId) === generation;
|
|
878
|
+
}
|
|
879
|
+
take(sessionId) {
|
|
880
|
+
const taken = [];
|
|
881
|
+
for (const [tabId, entry] of this.entries) {
|
|
882
|
+
if (entry.sessionId !== sessionId)
|
|
883
|
+
continue;
|
|
884
|
+
entry.sessionId = undefined;
|
|
885
|
+
taken.push({ tabId, generation: entry.generation });
|
|
886
|
+
}
|
|
887
|
+
return taken;
|
|
888
|
+
}
|
|
889
|
+
clear(tabId, generation, sessionId) {
|
|
890
|
+
const entry = this.entries.get(tabId);
|
|
891
|
+
if (!entry || entry.generation !== generation)
|
|
892
|
+
return;
|
|
893
|
+
if (sessionId !== undefined && entry.sessionId !== undefined && entry.sessionId !== sessionId)
|
|
894
|
+
return;
|
|
895
|
+
entry.sessionId = undefined;
|
|
896
|
+
}
|
|
897
|
+
forget(tabId) {
|
|
898
|
+
this.entries.delete(tabId);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
function tabsToClearOnExecuteEnd(options) {
|
|
902
|
+
if (options.readOnly)
|
|
903
|
+
return [];
|
|
904
|
+
return options.overrides.take(options.sessionId).filter(({ tabId }) => options.canSee(tabId));
|
|
905
|
+
}
|
|
906
|
+
|
|
849
907
|
// src/cdp/visibility.ts
|
|
850
908
|
function canClientSeeTarget(options) {
|
|
851
909
|
if (options.targetOwnerSessionId === undefined) {
|
|
@@ -6950,6 +7008,8 @@ var downloadCapabilityErrorMessage = "Downloads are unavailable in browse extens
|
|
|
6950
7008
|
var downloadGuardedPages = new WeakSet;
|
|
6951
7009
|
var downloadGuardedContexts = new WeakSet;
|
|
6952
7010
|
var viewportZoomGuardedPages = new WeakSet;
|
|
7011
|
+
var viewportGuards = new WeakMap;
|
|
7012
|
+
var viewportRestoreTimeoutMs = 2000;
|
|
6953
7013
|
var explicitMediaOptions = [
|
|
6954
7014
|
["colorScheme", "prefers-color-scheme"],
|
|
6955
7015
|
["reducedMotion", "prefers-reduced-motion"],
|
|
@@ -7027,9 +7087,17 @@ function installViewportZoomGuard(options) {
|
|
|
7027
7087
|
}
|
|
7028
7088
|
if (typeof page.setViewportSize === "function") {
|
|
7029
7089
|
const originalSetViewportSize = page.setViewportSize.bind(page);
|
|
7090
|
+
const guard = { original: undefined, dirty: false };
|
|
7030
7091
|
Object.defineProperty(page, "setViewportSize", {
|
|
7031
7092
|
configurable: true,
|
|
7032
7093
|
value: async (size) => {
|
|
7094
|
+
guard.dirty = true;
|
|
7095
|
+
if (!guard.original) {
|
|
7096
|
+
const before = await withTimeout(page.evaluate(() => ({ width: window.innerWidth, height: window.innerHeight, outerWidth: window.outerWidth })), 1000).catch(() => timedOut);
|
|
7097
|
+
if (typeof before !== "symbol" && before.width <= before.outerWidth && before.outerWidth - before.width <= 40) {
|
|
7098
|
+
guard.original = { width: before.width, height: before.height };
|
|
7099
|
+
}
|
|
7100
|
+
}
|
|
7033
7101
|
await originalSetViewportSize(size);
|
|
7034
7102
|
try {
|
|
7035
7103
|
const measured = await withTimeout(page.evaluate(() => ({
|
|
@@ -7043,9 +7111,74 @@ function installViewportZoomGuard(options) {
|
|
|
7043
7111
|
} catch {}
|
|
7044
7112
|
}
|
|
7045
7113
|
});
|
|
7114
|
+
viewportGuards.set(page, guard);
|
|
7046
7115
|
}
|
|
7047
7116
|
viewportZoomGuardedPages.add(page);
|
|
7048
7117
|
}
|
|
7118
|
+
function forgetPlaywrightViewport(page) {
|
|
7119
|
+
try {
|
|
7120
|
+
const client = page;
|
|
7121
|
+
client._viewportSize = undefined;
|
|
7122
|
+
const server = client._connection?.toImpl?.(page);
|
|
7123
|
+
if (!server)
|
|
7124
|
+
return;
|
|
7125
|
+
server._emulatedSize = undefined;
|
|
7126
|
+
const mainFrameSession = server.delegate?._mainFrameSession;
|
|
7127
|
+
if (mainFrameSession)
|
|
7128
|
+
mainFrameSession._metricsOverride = undefined;
|
|
7129
|
+
} catch {}
|
|
7130
|
+
}
|
|
7131
|
+
async function restoreEmulatedViewport(page) {
|
|
7132
|
+
const guard = viewportGuards.get(page);
|
|
7133
|
+
if (!guard?.dirty)
|
|
7134
|
+
return;
|
|
7135
|
+
const original = guard.original;
|
|
7136
|
+
guard.dirty = false;
|
|
7137
|
+
guard.original = undefined;
|
|
7138
|
+
let cancelled = false;
|
|
7139
|
+
const restore = async () => {
|
|
7140
|
+
if (page.isClosed())
|
|
7141
|
+
return;
|
|
7142
|
+
const cdp = await page.context().newCDPSession(page);
|
|
7143
|
+
try {
|
|
7144
|
+
if (cancelled)
|
|
7145
|
+
return;
|
|
7146
|
+
const attempts = original ? 3 : 2;
|
|
7147
|
+
for (let attempt = 0;attempt < attempts; attempt++) {
|
|
7148
|
+
if (cancelled)
|
|
7149
|
+
return;
|
|
7150
|
+
await cdp.send("Emulation.clearDeviceMetricsOverride");
|
|
7151
|
+
await delay(120);
|
|
7152
|
+
if (cancelled)
|
|
7153
|
+
return;
|
|
7154
|
+
if (!original)
|
|
7155
|
+
continue;
|
|
7156
|
+
const measured = await withTimeout(page.evaluate(() => ({ width: window.innerWidth, height: window.innerHeight })), 500).catch(() => timedOut);
|
|
7157
|
+
if (typeof measured === "symbol")
|
|
7158
|
+
break;
|
|
7159
|
+
if (Math.abs(measured.width - original.width) <= 2 && Math.abs(measured.height - original.height) <= 2)
|
|
7160
|
+
break;
|
|
7161
|
+
}
|
|
7162
|
+
} finally {
|
|
7163
|
+
await cdp.detach().catch(() => {});
|
|
7164
|
+
}
|
|
7165
|
+
};
|
|
7166
|
+
const outcome = await withTimeout(restore(), viewportRestoreTimeoutMs).catch(() => timedOut);
|
|
7167
|
+
if (typeof outcome === "symbol")
|
|
7168
|
+
cancelled = true;
|
|
7169
|
+
forgetPlaywrightViewport(page);
|
|
7170
|
+
}
|
|
7171
|
+
async function withRestoredViewports(options) {
|
|
7172
|
+
try {
|
|
7173
|
+
return await options.run();
|
|
7174
|
+
} finally {
|
|
7175
|
+
let pages = [options.page];
|
|
7176
|
+
try {
|
|
7177
|
+
pages = Array.from(new Set([options.page, ...options.context.pages()]));
|
|
7178
|
+
} catch {}
|
|
7179
|
+
await Promise.all(pages.map((page) => restoreEmulatedViewport(page)));
|
|
7180
|
+
}
|
|
7181
|
+
}
|
|
7049
7182
|
|
|
7050
7183
|
// src/execute/default-page.ts
|
|
7051
7184
|
class DefaultPageHost {
|
|
@@ -11414,6 +11547,7 @@ class ExecuteSandbox extends DefaultPageHost {
|
|
|
11414
11547
|
allowNode = executeAllowsNode();
|
|
11415
11548
|
snapshotRefs = { selectors: new Map };
|
|
11416
11549
|
networkCapture = new Recorder;
|
|
11550
|
+
viewportGuardContexts = new WeakSet;
|
|
11417
11551
|
secrets;
|
|
11418
11552
|
actionTimeoutContext;
|
|
11419
11553
|
realm;
|
|
@@ -11458,32 +11592,38 @@ class ExecuteSandbox extends DefaultPageHost {
|
|
|
11458
11592
|
for (const warning of pageVisibleApiSourceWarnings(code))
|
|
11459
11593
|
this.addWarningOnce(warning);
|
|
11460
11594
|
const globals = await this.getGlobals(options);
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
globals,
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11595
|
+
return await withRestoredViewports({
|
|
11596
|
+
context: globals.context,
|
|
11597
|
+
page: globals.page,
|
|
11598
|
+
run: async () => {
|
|
11599
|
+
const { result, logs, logSummary, aftermath } = await runUserCode({
|
|
11600
|
+
code,
|
|
11601
|
+
globals,
|
|
11602
|
+
...this.realm ? { realm: this.realm } : {},
|
|
11603
|
+
onUnhandledRejection: (warning) => this.addWarningOnce(warning)
|
|
11604
|
+
}).then(async (completed) => ({ ...completed, aftermath: await this.withChallenge(globals.page, completed.aftermath, false) })).catch(async (error) => {
|
|
11605
|
+
if (!(error instanceof ExecuteCodeError) || !error.aftermath)
|
|
11606
|
+
throw error;
|
|
11607
|
+
throw new ExecuteCodeError(error.originalError, error.logs, error.logSummary, await this.withChallenge(globals.page, error.aftermath, true));
|
|
11608
|
+
});
|
|
11609
|
+
await this.networkCapture.settleForOutput();
|
|
11610
|
+
const extracted = extractExecuteMedia(result);
|
|
11611
|
+
const redactedValue = this.secrets.redactOutputValue(extracted.value);
|
|
11612
|
+
const jsonSafeResult = toJsonSafeValue(redactedValue);
|
|
11613
|
+
const bounded = boundExecuteResult(stringifyResult(redactedValue), jsonSafeResult.serializable ? jsonSafeResult.value : undefined, jsonSafeResult.serializable);
|
|
11614
|
+
const warnings = this.finalizeWarnings(logSummary, jsonValueWarning(redactedValue, jsonSafeResult), bounded.warning);
|
|
11615
|
+
return {
|
|
11616
|
+
text: bounded.text,
|
|
11617
|
+
...bounded.hasValue ? { value: bounded.value } : {},
|
|
11618
|
+
...extracted.media.length > 0 ? { media: extracted.media } : {},
|
|
11619
|
+
isError: false,
|
|
11620
|
+
logs: this.secrets.redactCaptureLogs(logs),
|
|
11621
|
+
logSummary,
|
|
11622
|
+
warnings,
|
|
11623
|
+
aftermath: this.secrets.redactCaptureAftermath(aftermath)
|
|
11624
|
+
};
|
|
11625
|
+
}
|
|
11470
11626
|
});
|
|
11471
|
-
await this.networkCapture.settleForOutput();
|
|
11472
|
-
const extracted = extractExecuteMedia(result);
|
|
11473
|
-
const redactedValue = this.secrets.redactOutputValue(extracted.value);
|
|
11474
|
-
const jsonSafeResult = toJsonSafeValue(redactedValue);
|
|
11475
|
-
const bounded = boundExecuteResult(stringifyResult(redactedValue), jsonSafeResult.serializable ? jsonSafeResult.value : undefined, jsonSafeResult.serializable);
|
|
11476
|
-
const warnings = this.finalizeWarnings(logSummary, jsonValueWarning(redactedValue, jsonSafeResult), bounded.warning);
|
|
11477
|
-
return {
|
|
11478
|
-
text: bounded.text,
|
|
11479
|
-
...bounded.hasValue ? { value: bounded.value } : {},
|
|
11480
|
-
...extracted.media.length > 0 ? { media: extracted.media } : {},
|
|
11481
|
-
isError: false,
|
|
11482
|
-
logs: this.secrets.redactCaptureLogs(logs),
|
|
11483
|
-
logSummary,
|
|
11484
|
-
warnings,
|
|
11485
|
-
aftermath: this.secrets.redactCaptureAftermath(aftermath)
|
|
11486
|
-
};
|
|
11487
11627
|
} finally {
|
|
11488
11628
|
this.restoreActionTimeout();
|
|
11489
11629
|
this.actionTimeoutContext?.setDefaultTimeout?.(defaultActionTimeoutMs);
|
|
@@ -11748,7 +11888,12 @@ class ExecuteSandbox extends DefaultPageHost {
|
|
|
11748
11888
|
this.actionTimeoutContext = context;
|
|
11749
11889
|
context.setDefaultTimeout?.(this.actionTimeoutMs);
|
|
11750
11890
|
this.applyActionTimeout(page);
|
|
11751
|
-
|
|
11891
|
+
this.installViewportGuards(context);
|
|
11892
|
+
this.networkCapture.bindPage(this.page);
|
|
11893
|
+
return { browser, context, page };
|
|
11894
|
+
}
|
|
11895
|
+
installViewportGuards(context) {
|
|
11896
|
+
const install = (page) => installViewportZoomGuard({
|
|
11752
11897
|
page,
|
|
11753
11898
|
explicitMediaFeatures: this.explicitMediaFeatures,
|
|
11754
11899
|
getExplicitMedia: () => this.explicitMedia,
|
|
@@ -11757,8 +11902,12 @@ class ExecuteSandbox extends DefaultPageHost {
|
|
|
11757
11902
|
},
|
|
11758
11903
|
addWarningOnce: (warning) => this.addWarningOnce(warning)
|
|
11759
11904
|
});
|
|
11760
|
-
|
|
11761
|
-
|
|
11905
|
+
for (const page of context.pages())
|
|
11906
|
+
install(page);
|
|
11907
|
+
if (!this.viewportGuardContexts.has(context)) {
|
|
11908
|
+
context.on("page", install);
|
|
11909
|
+
this.viewportGuardContexts.add(context);
|
|
11910
|
+
}
|
|
11762
11911
|
}
|
|
11763
11912
|
ensureSessionPage(label) {
|
|
11764
11913
|
return tryPromise({
|
|
@@ -13841,6 +13990,13 @@ class OpenCodeBrowserSessions {
|
|
|
13841
13990
|
}));
|
|
13842
13991
|
yield* manager.releaseSessionTargetOwnership(session);
|
|
13843
13992
|
yield* manager.closeOpenCodeBrowserSession(session);
|
|
13993
|
+
yield* sync2(() => {
|
|
13994
|
+
try {
|
|
13995
|
+
manager.hooks.onSessionDeleted?.(id);
|
|
13996
|
+
} catch (error) {
|
|
13997
|
+
console.error("Session deleted hook failed", error);
|
|
13998
|
+
}
|
|
13999
|
+
});
|
|
13844
14000
|
return true;
|
|
13845
14001
|
})));
|
|
13846
14002
|
return { deleted, ...stopped ? { stopped } : {} };
|
|
@@ -16468,6 +16624,7 @@ function createCdpDispatcher(options) {
|
|
|
16468
16624
|
navigationGuard,
|
|
16469
16625
|
ghostCursor,
|
|
16470
16626
|
tabActivity,
|
|
16627
|
+
deviceMetricsOverrides,
|
|
16471
16628
|
mainFrameIdsByTab,
|
|
16472
16629
|
blankNavigationWaiters,
|
|
16473
16630
|
sendDebuggerCommand,
|
|
@@ -16667,6 +16824,20 @@ function createCdpDispatcher(options) {
|
|
|
16667
16824
|
}
|
|
16668
16825
|
if (message.method === ghostCursorCommandMethod)
|
|
16669
16826
|
return yield* ghostCursor.command(tabId, message.params);
|
|
16827
|
+
if (message.method === "Emulation.clearDeviceMetricsOverride") {
|
|
16828
|
+
const clientSessionId = cdpClients.sessionId(socket);
|
|
16829
|
+
const owner = deviceMetricsOverrides.sessionId(tabId);
|
|
16830
|
+
if (clientSessionId !== undefined && owner !== undefined && owner !== clientSessionId) {
|
|
16831
|
+
return {};
|
|
16832
|
+
}
|
|
16833
|
+
const generation = deviceMetricsOverrides.generation(tabId);
|
|
16834
|
+
yield* clearDeviceMetricsOverride((method, params) => sendDebuggerCommand({ tabId, method, params }), { retry: () => deviceMetricsOverrides.isCurrent(tabId, generation) });
|
|
16835
|
+
deviceMetricsOverrides.clear(tabId, generation, clientSessionId);
|
|
16836
|
+
return {};
|
|
16837
|
+
}
|
|
16838
|
+
if (message.method === "Emulation.setDeviceMetricsOverride" && route.chromeSessionId === undefined) {
|
|
16839
|
+
deviceMetricsOverrides.mark(tabId, cdpClients.sessionId(socket));
|
|
16840
|
+
}
|
|
16670
16841
|
if (message.method === "Page.navigate" && route.chromeSessionId === undefined) {
|
|
16671
16842
|
const dataNavigation = yield* navigateTopFrameToDataUrl({
|
|
16672
16843
|
tabId,
|
|
@@ -19184,6 +19355,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19184
19355
|
const keepaliveIntervalMs = yield* Int("OPENCODE_BROWSER_KEEPALIVE_MS").pipe(withDefault(20000));
|
|
19185
19356
|
const idleTabTtlMs = yield* Int("OPENCODE_BROWSER_IDLE_TAB_TTL_MS").pipe(withDefault(15 * 60000));
|
|
19186
19357
|
const journalBaseDir = defaultJournalBaseDir();
|
|
19358
|
+
const deviceMetricsOverrides = new DeviceMetricsOverrides;
|
|
19187
19359
|
const sessions = new OpenCodeBrowserSessions(endpointUrl, (id, onDefaultTargetChange) => new ExecuteSandbox({
|
|
19188
19360
|
endpointUrl,
|
|
19189
19361
|
authToken,
|
|
@@ -19216,7 +19388,28 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19216
19388
|
targetBrowserKey: (tabId) => browsers.ownerKey(tabId),
|
|
19217
19389
|
getUserAttachedPageUrls: (session) => registry.listRootTargets().filter((target) => target.owner === "user" && browsers.ownerKey(target.tabId) === session.browser?.key).map((target) => target.targetInfo.url || "about:blank"),
|
|
19218
19390
|
...executeTimeoutMs === undefined ? {} : { executeTimeoutMs },
|
|
19219
|
-
onExecuteStateChange: (sessionId, executing) =>
|
|
19391
|
+
onExecuteStateChange: (sessionId, executing) => gen(function* () {
|
|
19392
|
+
yield* presentation.onSessionExecuteStateChange(sessionId, executing);
|
|
19393
|
+
if (executing)
|
|
19394
|
+
return;
|
|
19395
|
+
const tabs = tabsToClearOnExecuteEnd({
|
|
19396
|
+
overrides: deviceMetricsOverrides,
|
|
19397
|
+
readOnly: sessions.isReadOnly(sessionId),
|
|
19398
|
+
sessionId,
|
|
19399
|
+
canSee: (tabId) => {
|
|
19400
|
+
const target = registry.tabTargets.get(tabId);
|
|
19401
|
+
return target !== undefined && cdpRouter.canSessionSeeTarget(sessionId, target);
|
|
19402
|
+
}
|
|
19403
|
+
});
|
|
19404
|
+
for (const { tabId, generation } of tabs) {
|
|
19405
|
+
if (!deviceMetricsOverrides.isCurrent(tabId, generation))
|
|
19406
|
+
continue;
|
|
19407
|
+
yield* clearDeviceMetricsOverride((method, params) => sendDebuggerCommand({ tabId, method, params }), { retry: () => deviceMetricsOverrides.isCurrent(tabId, generation) }).pipe(timeoutOption("2 seconds"), ignore);
|
|
19408
|
+
}
|
|
19409
|
+
}),
|
|
19410
|
+
onSessionDeleted: (sessionId) => {
|
|
19411
|
+
deviceMetricsOverrides.take(sessionId);
|
|
19412
|
+
},
|
|
19220
19413
|
onExecuteRecord: (record) => {
|
|
19221
19414
|
const entry = makeJournalEntry({
|
|
19222
19415
|
sessionId: record.sessionId,
|
|
@@ -19417,6 +19610,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19417
19610
|
protectedFrames.forgetTab(tabId);
|
|
19418
19611
|
navigationGuard.forgetTab(tabId);
|
|
19419
19612
|
ghostCursor.forget(tabId);
|
|
19613
|
+
deviceMetricsOverrides.forget(tabId);
|
|
19420
19614
|
forgetTab(tabId);
|
|
19421
19615
|
for (const [sessionId, childTabId] of suppressedChildSessions) {
|
|
19422
19616
|
if (childTabId === tabId)
|
|
@@ -19547,6 +19741,7 @@ var makeRelay = fnUntraced(function* (options = {}) {
|
|
|
19547
19741
|
navigationGuard,
|
|
19548
19742
|
ghostCursor,
|
|
19549
19743
|
tabActivity,
|
|
19744
|
+
deviceMetricsOverrides,
|
|
19550
19745
|
mainFrameIdsByTab,
|
|
19551
19746
|
blankNavigationWaiters,
|
|
19552
19747
|
sendDebuggerCommand,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import"./main-3mhynene.mjs";
|
|
2
2
|
import"./main-pmfd055v.mjs";
|
|
3
|
-
import"./main-
|
|
3
|
+
import"./main-hrrgcjhe.mjs";
|
|
4
4
|
import {
|
|
5
5
|
cliCommand,
|
|
6
6
|
installCommand,
|
|
@@ -18,17 +18,17 @@ import {
|
|
|
18
18
|
registryUrl,
|
|
19
19
|
fetchPublished,
|
|
20
20
|
runInstaller
|
|
21
|
-
} from "./main-
|
|
21
|
+
} from "./main-t8c7aq8b.mjs";
|
|
22
22
|
import"./main-b3jrctcx.mjs";
|
|
23
23
|
import {
|
|
24
24
|
Service,
|
|
25
25
|
layerFetch,
|
|
26
26
|
restartRelay,
|
|
27
27
|
startManagedRelay
|
|
28
|
-
} from "./main-
|
|
28
|
+
} from "./main-x9vdxj9f.mjs";
|
|
29
29
|
import"./main-4h7rfhhr.mjs";
|
|
30
30
|
import"./main-s3g4jwx5.mjs";
|
|
31
|
-
import"./main-
|
|
31
|
+
import"./main-3gx5fe95.mjs";
|
|
32
32
|
import {
|
|
33
33
|
succeed6,
|
|
34
34
|
gen,
|
|
@@ -63,11 +63,11 @@ import {
|
|
|
63
63
|
installRuntime,
|
|
64
64
|
installedRuntime,
|
|
65
65
|
manualMcpEntry
|
|
66
|
-
} from "./main-
|
|
66
|
+
} from "./main-gvzdjgte.mjs";
|
|
67
67
|
import"./main-pmfd055v.mjs";
|
|
68
68
|
import {
|
|
69
69
|
opencodeBrowserBuildId2
|
|
70
|
-
} from "./main-
|
|
70
|
+
} from "./main-hrrgcjhe.mjs";
|
|
71
71
|
import {
|
|
72
72
|
installedBinaryPath,
|
|
73
73
|
installerBinaryPath,
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
autoUpdateStatus,
|
|
85
85
|
describeAutoUpdate,
|
|
86
86
|
runCommand
|
|
87
|
-
} from "./main-
|
|
87
|
+
} from "./main-t8c7aq8b.mjs";
|
|
88
88
|
import"./main-4h7rfhhr.mjs";
|
|
89
89
|
import {
|
|
90
90
|
pairingCodeTtlMs,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
revokeBrowserToken,
|
|
99
99
|
legacyPairingCode,
|
|
100
100
|
removeLegacyPairingCode
|
|
101
|
-
} from "./main-
|
|
101
|
+
} from "./main-6q5nqhy7.mjs";
|
|
102
102
|
import {
|
|
103
103
|
unpackedExtensionId,
|
|
104
104
|
extensionProtocolSkew,
|
|
@@ -107,16 +107,16 @@ import {
|
|
|
107
107
|
import"./main-tk4axre7.mjs";
|
|
108
108
|
import {
|
|
109
109
|
defaultSiteSecretsDir
|
|
110
|
-
} from "./main-
|
|
110
|
+
} from "./main-g13tfban.mjs";
|
|
111
111
|
import {
|
|
112
112
|
parseHostname,
|
|
113
113
|
readRelayConfig,
|
|
114
114
|
writeRelayConfig,
|
|
115
115
|
syncDevExtension
|
|
116
|
-
} from "./main-
|
|
116
|
+
} from "./main-31mjsvtm.mjs";
|
|
117
117
|
import {
|
|
118
118
|
relayAuthorization
|
|
119
|
-
} from "./main-
|
|
119
|
+
} from "./main-3gx5fe95.mjs";
|
|
120
120
|
|
|
121
121
|
// src/setup.ts
|
|
122
122
|
import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
|
|
@@ -241,6 +241,12 @@ values between calls on \`state\`. A single run without an \`await\` is stopped
|
|
|
241
241
|
about 2 seconds; split heavy loops with
|
|
242
242
|
\`await new Promise(r => setTimeout(r, 0))\` or do the work in the page.
|
|
243
243
|
|
|
244
|
+
\`execute\`'s \`timeoutMs\` (MCP) / \`--timeout-ms\` (CLI) is the whole-script
|
|
245
|
+
deadline, 60 seconds by default and paused during \`handoff()\`; \`0\` disables it.
|
|
246
|
+
When you set it (or the relay sets \`OPENCODE_BROWSER_EXECUTE_TIMEOUT_MS\`),
|
|
247
|
+
Playwright actions and navigations get the same budget, at least 30 seconds;
|
|
248
|
+
without either they keep Playwright's 30-second default.
|
|
249
|
+
|
|
244
250
|
Await promises: a rejection with no handler never stops the relay. A running call
|
|
245
251
|
gets the error; a later one resets the realm and warns on the next call (a
|
|
246
252
|
one-shot \`--rm\` session is already gone). Full Node mode has no realm to reset.
|
|
@@ -286,7 +292,14 @@ A cross-origin iframe also needs \`allow="clipboard-write"\` (or \`clipboard-rea
|
|
|
286
292
|
from its parent; without it Chrome refuses the call and nothing in the frame can
|
|
287
293
|
fix that, so write from the top page or read the value from the DOM instead.
|
|
288
294
|
Clipboard reads usually ask the user for permission, so use \`handoff()\` or avoid
|
|
289
|
-
them. \`context.grantPermissions()
|
|
295
|
+
them. Permission grants are refused (\`context.grantPermissions()\`,
|
|
296
|
+
\`context.clearPermissions()\`, \`Browser.grantPermissions\`, \`Browser.setPermission\`,
|
|
297
|
+
\`Browser.resetPermissions\`), so don't try them.
|
|
298
|
+
|
|
299
|
+
\`page.setViewportSize({ width, height })\` emulates a viewport inside the user's
|
|
300
|
+
window: the tab is letterboxed while it is set, and browse clears the override
|
|
301
|
+
when the script ends (within a couple of seconds), so the tab returns to the
|
|
302
|
+
window's size. Don't rely on the size carrying over to the next \`execute\`.
|
|
290
303
|
|
|
291
304
|
The page's console messages and uncaught errors are off by default because
|
|
292
305
|
capturing them lets the page detect a debugger. Turn them on for one page when
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import"./main-pmfd055v.mjs";
|
|
2
|
-
import"./main-
|
|
2
|
+
import"./main-hrrgcjhe.mjs";
|
|
3
3
|
import {
|
|
4
4
|
entrySpawnCommand,
|
|
5
5
|
installedRuntime2,
|
|
6
6
|
installedVersion
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-t8c7aq8b.mjs";
|
|
8
8
|
|
|
9
9
|
// src/mcp/supervisor.ts
|
|
10
10
|
import { spawn } from "node:child_process";
|
|
@@ -35,7 +35,7 @@ async function runBinaryMcp(args) {
|
|
|
35
35
|
const runtime = installedRuntime2();
|
|
36
36
|
if (!runtime || runtime.kind === "npx") {
|
|
37
37
|
process.env[directEnvironmentVariable] = "1";
|
|
38
|
-
const { runCli } = await import("./cli-
|
|
38
|
+
const { runCli } = await import("./cli-n2yqdpef.mjs");
|
|
39
39
|
return runCli();
|
|
40
40
|
}
|
|
41
41
|
const REPLAY = `opencode-browser-shim-initialize-${randomUUID()}`;
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
updateNotice2,
|
|
5
5
|
createUpdateWatcher2,
|
|
6
6
|
runUpdateCommand2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-ma5ncx3b.mjs";
|
|
8
8
|
import"./main-b3jrctcx.mjs";
|
|
9
|
-
import"./main-
|
|
9
|
+
import"./main-t8c7aq8b.mjs";
|
|
10
10
|
import"./main-pmfd055v.mjs";
|
|
11
|
-
import"./main-
|
|
11
|
+
import"./main-hrrgcjhe.mjs";
|
|
12
12
|
export {
|
|
13
13
|
createUpdateWatcher2 as createUpdateWatcher,
|
|
14
14
|
formatUpdateNotice2 as formatUpdateNotice,
|
package/package.json
CHANGED
package/skills/browse/SKILL.md
CHANGED
|
@@ -240,6 +240,12 @@ values between calls on `state`. A single run without an `await` is stopped afte
|
|
|
240
240
|
about 2 seconds; split heavy loops with
|
|
241
241
|
`await new Promise(r => setTimeout(r, 0))` or do the work in the page.
|
|
242
242
|
|
|
243
|
+
`execute`'s `timeoutMs` (MCP) / `--timeout-ms` (CLI) is the whole-script
|
|
244
|
+
deadline, 60 seconds by default and paused during `handoff()`; `0` disables it.
|
|
245
|
+
When you set it (or the relay sets `OPENCODE_BROWSER_EXECUTE_TIMEOUT_MS`),
|
|
246
|
+
Playwright actions and navigations get the same budget, at least 30 seconds;
|
|
247
|
+
without either they keep Playwright's 30-second default.
|
|
248
|
+
|
|
243
249
|
Await promises: a rejection with no handler never stops the relay. A running call
|
|
244
250
|
gets the error; a later one resets the realm and warns on the next call (a
|
|
245
251
|
one-shot `--rm` session is already gone). Full Node mode has no realm to reset.
|
|
@@ -285,7 +291,14 @@ A cross-origin iframe also needs `allow="clipboard-write"` (or `clipboard-read`)
|
|
|
285
291
|
from its parent; without it Chrome refuses the call and nothing in the frame can
|
|
286
292
|
fix that, so write from the top page or read the value from the DOM instead.
|
|
287
293
|
Clipboard reads usually ask the user for permission, so use `handoff()` or avoid
|
|
288
|
-
them. `context.grantPermissions()
|
|
294
|
+
them. Permission grants are refused (`context.grantPermissions()`,
|
|
295
|
+
`context.clearPermissions()`, `Browser.grantPermissions`, `Browser.setPermission`,
|
|
296
|
+
`Browser.resetPermissions`), so don't try them.
|
|
297
|
+
|
|
298
|
+
`page.setViewportSize({ width, height })` emulates a viewport inside the user's
|
|
299
|
+
window: the tab is letterboxed while it is set, and browse clears the override
|
|
300
|
+
when the script ends (within a couple of seconds), so the tab returns to the
|
|
301
|
+
window's size. Don't rely on the size carrying over to the next `execute`.
|
|
289
302
|
|
|
290
303
|
The page's console messages and uncaught errors are off by default because
|
|
291
304
|
capturing them lets the page detect a debugger. Turn them on for one page when
|
package/dist/main-dsx1pjp8.mjs
DELETED