@opencode/browse 0.0.10-dev.64 → 0.0.10-dev.67
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-0fyepn5b.mjs → cli-qrjme0am.mjs} +15 -15
- package/dist/cli.mjs +9 -9
- package/dist/coreBundle-v82htk0w.mjs +9 -0
- package/dist/{helpers-kmj4wchh.mjs → helpers-mp1j877d.mjs} +2 -2
- package/dist/{main-tnyq91gh.mjs → main-3hcsagz7.mjs} +7 -7
- package/dist/{main-8wrwjdce.mjs → main-675wpqng.mjs} +4 -4
- package/dist/{main-khy154ws.mjs → main-9156hx8a.mjs} +2 -2
- package/dist/{main-aja6gj20.mjs → main-fwv9bpgk.mjs} +20 -18
- package/dist/main-s1vp1rjp.mjs +4 -0
- package/dist/{main-sjm7k9b8.mjs → main-v4z6qtmx.mjs} +3 -3
- package/dist/{main-y2petnx6.mjs → main-ww8xvpdv.mjs} +3 -3
- package/dist/{main-89xzf2dv.mjs → main-zwfkvc8r.mjs} +2 -2
- package/dist/{mcp-3xn2v9v3.mjs → mcp-qgfs63cv.mjs} +10 -9
- package/dist/{relay-fgxtcvpb.mjs → relay-mesbs50m.mjs} +25 -24
- package/dist/{runtime-update-admq237e.mjs → runtime-update-x9fmjr34.mjs} +4 -4
- package/dist/{setup-pe49707h.mjs → setup-3c7y4sqf.mjs} +7 -7
- package/dist/{skill-text-rc6te209.mjs → skill-text-g8avyxz3.mjs} +51 -49
- package/dist/{supervisor-573pzc3q.mjs → supervisor-yey35sd1.mjs} +3 -3
- package/dist/{update-9dg4qyqc.mjs → update-fsfnbweb.mjs} +3 -3
- package/dist/{version-ejc4s8nb.mjs → version-kdhpx2d9.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +51 -49
- package/dist/main-5m62h6ty.mjs +0 -4
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
import {
|
|
106
106
|
opencodeBrowserVersion2,
|
|
107
107
|
opencodeBrowserBuildId2
|
|
108
|
-
} from "./main-
|
|
108
|
+
} from "./main-s1vp1rjp.mjs";
|
|
109
109
|
import {
|
|
110
110
|
dataRoot,
|
|
111
111
|
fromCheckout,
|
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
devExtension,
|
|
116
116
|
installCommand,
|
|
117
117
|
autoUpdateStatus
|
|
118
|
-
} from "./main-
|
|
118
|
+
} from "./main-fwv9bpgk.mjs";
|
|
119
119
|
import {
|
|
120
120
|
extensionProtocolVersion,
|
|
121
121
|
extensionProtocolAdvice
|
|
@@ -141,13 +141,13 @@ import {
|
|
|
141
141
|
ensureExtensionConnected,
|
|
142
142
|
stoppedRelayStatus,
|
|
143
143
|
statusCollections
|
|
144
|
-
} from "./main-
|
|
145
|
-
import"./main-
|
|
144
|
+
} from "./main-675wpqng.mjs";
|
|
145
|
+
import"./main-v4z6qtmx.mjs";
|
|
146
146
|
import {
|
|
147
147
|
updateJson2,
|
|
148
148
|
formatUpdateNotice2,
|
|
149
149
|
updateNotice2
|
|
150
|
-
} from "./main-
|
|
150
|
+
} from "./main-zwfkvc8r.mjs";
|
|
151
151
|
import {
|
|
152
152
|
settingKeys,
|
|
153
153
|
formatSettings,
|
|
@@ -155,12 +155,12 @@ import {
|
|
|
155
155
|
addSecret,
|
|
156
156
|
listSecrets,
|
|
157
157
|
removeSecret
|
|
158
|
-
} from "./main-
|
|
158
|
+
} from "./main-3hcsagz7.mjs";
|
|
159
159
|
import {
|
|
160
160
|
defaultJournalBaseDir,
|
|
161
161
|
readJournalEntries,
|
|
162
162
|
formatJournalEntry
|
|
163
|
-
} from "./main-
|
|
163
|
+
} from "./main-ww8xvpdv.mjs";
|
|
164
164
|
import {
|
|
165
165
|
pipeArguments,
|
|
166
166
|
dual,
|
|
@@ -5124,7 +5124,7 @@ var createDoctorReport = fn("Doctor.createReport")(function* (options) {
|
|
|
5124
5124
|
name: metadata.name,
|
|
5125
5125
|
version: metadata.version,
|
|
5126
5126
|
bin: {
|
|
5127
|
-
opencodeBrowser: metadata.bin?.
|
|
5127
|
+
opencodeBrowser: metadata.bin?.browse ?? null
|
|
5128
5128
|
}
|
|
5129
5129
|
})));
|
|
5130
5130
|
const fileExists = (relativePath) => fs.exists(path.join(options.packageRoot, relativePath)).pipe(orElseSucceed(() => false));
|
|
@@ -5245,7 +5245,7 @@ function buildDoctorChecks(options) {
|
|
|
5245
5245
|
const packageBinChecks = options.packageResult.ok ? [
|
|
5246
5246
|
{
|
|
5247
5247
|
id: "bin-opencode-browser",
|
|
5248
|
-
label: "
|
|
5248
|
+
label: "browse bin",
|
|
5249
5249
|
status: options.packageResult.value.bin.opencodeBrowser ? "ok" : "fail",
|
|
5250
5250
|
message: options.packageResult.value.bin.opencodeBrowser ?? "missing from package.json bin"
|
|
5251
5251
|
}
|
|
@@ -5558,7 +5558,7 @@ function hoistJsonFlag(args) {
|
|
|
5558
5558
|
return { json, argv: [...argv, "--json", ...delimiter === -1 ? [] : args.slice(delimiter)] };
|
|
5559
5559
|
}
|
|
5560
5560
|
var stderrLine = (message) => sync2(() => {
|
|
5561
|
-
process2.stderr.write(`
|
|
5561
|
+
process2.stderr.write(`browse: ${message.split(`
|
|
5562
5562
|
`)[0].slice(0, 300)}
|
|
5563
5563
|
`);
|
|
5564
5564
|
});
|
|
@@ -5856,7 +5856,7 @@ var status = make("status", {
|
|
|
5856
5856
|
}
|
|
5857
5857
|
})).pipe(withDescription4("Show relay, extension, and target status"));
|
|
5858
5858
|
var mcp = make("mcp", {}, fn("Cli.mcp")(function* () {
|
|
5859
|
-
const { runMcpServer } = yield* promise(() => import("./mcp-
|
|
5859
|
+
const { runMcpServer } = yield* promise(() => import("./mcp-qgfs63cv.mjs"));
|
|
5860
5860
|
yield* runMcpServer;
|
|
5861
5861
|
})).pipe(withDescription4("Run the browse MCP server over stdio"));
|
|
5862
5862
|
registerCliCommand(400, () => tabs);
|
|
@@ -5877,7 +5877,7 @@ registerCliCommand(810, ({ packageRoot }) => make("doctor", {
|
|
|
5877
5877
|
}
|
|
5878
5878
|
})).pipe(withDescription4("Diagnose the local browse install and runtime")));
|
|
5879
5879
|
registerCliCommand(820, () => make("skill", {}, fn("Cli.skill")(function* () {
|
|
5880
|
-
const { skillText } = yield* promise(() => import("./skill-text-
|
|
5880
|
+
const { skillText } = yield* promise(() => import("./skill-text-g8avyxz3.mjs"));
|
|
5881
5881
|
yield* log(skillText.trimEnd());
|
|
5882
5882
|
})).pipe(withDescription4("Print the browse agent skill text")));
|
|
5883
5883
|
registerCliCommand(900, () => mcp);
|
|
@@ -6304,7 +6304,7 @@ registerCliCommand(710, () => flightRecorder);
|
|
|
6304
6304
|
|
|
6305
6305
|
// src/cli/relay.ts
|
|
6306
6306
|
var serve = make("serve", {}, fn("Cli.serve")(function* () {
|
|
6307
|
-
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-
|
|
6307
|
+
const [{ startRelay }, { parseAdditionalExtensionOrigins }] = yield* promise(() => Promise.all([import("./relay-mesbs50m.mjs"), import("./helpers-mp1j877d.mjs")]));
|
|
6308
6308
|
const port = yield* portConfig;
|
|
6309
6309
|
const additionalExtensionOrigins = parseAdditionalExtensionOrigins(yield* extensionOriginsConfig);
|
|
6310
6310
|
yield* scoped(gen(function* () {
|
|
@@ -6654,12 +6654,12 @@ registerCliCommand(800, () => journal);
|
|
|
6654
6654
|
|
|
6655
6655
|
// src/cli.ts
|
|
6656
6656
|
var packageRoot = path5.dirname(path5.dirname(fileURLToPath(import.meta.url)));
|
|
6657
|
-
var opencodeBrowser = make("
|
|
6657
|
+
var opencodeBrowser = make("browse").pipe(withDescription4("Control the user's existing browser through the browse extension"), withSubcommands(buildRegisteredCliCommands({ packageRoot })));
|
|
6658
6658
|
var mainLayer = mergeAll(layerFetch, layer).pipe(provideMerge(layer2));
|
|
6659
6659
|
function runCli(rawArgs = process4.argv.slice(2)) {
|
|
6660
6660
|
const cliArgs = hoistJsonFlag(rawArgs);
|
|
6661
6661
|
const subcommand = cliArgs.argv.find((arg) => !arg.startsWith("-"));
|
|
6662
|
-
const commandName = subcommand ? `
|
|
6662
|
+
const commandName = subcommand ? `browse ${subcommand}` : "browse";
|
|
6663
6663
|
const reportUsageError = (error2) => gen(function* () {
|
|
6664
6664
|
const errors = error2._tag === "ShowHelp" ? error2.errors : [error2];
|
|
6665
6665
|
if (errors.length === 0)
|
package/dist/cli.mjs
CHANGED
|
@@ -2,29 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
// src/main.ts
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
var embeddedVersion = "0.0.10-dev.
|
|
5
|
+
var embeddedVersion = "0.0.10-dev.67";
|
|
6
6
|
var setupCommands = new Set(["install", "uninstall", "extension", "pair", "rollback", "set"]);
|
|
7
7
|
var command = process.argv[2];
|
|
8
8
|
var invokedAs = path.basename(process.argv[1] ?? "");
|
|
9
9
|
if (command === "--version" || command === "-v") {
|
|
10
|
-
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-
|
|
10
|
+
const opencodeBrowserVersion = embeddedVersion ?? (await import("./version-kdhpx2d9.mjs")).opencodeBrowserVersion;
|
|
11
11
|
process.stdout.write(`${opencodeBrowserVersion}
|
|
12
12
|
`);
|
|
13
13
|
} else if (command === "mcp" && globalThis.__OPENCODE_BROWSER_COMPILED__ && process.env.OPENCODE_BROWSER_MCP_DIRECT !== "1") {
|
|
14
|
-
const { runBinaryMcp } = await import("./supervisor-
|
|
14
|
+
const { runBinaryMcp } = await import("./supervisor-yey35sd1.mjs");
|
|
15
15
|
await runBinaryMcp(process.argv.slice(3));
|
|
16
16
|
} else if (invokedAs === "opencode-browser-mcp" || command === "mcp" && process.argv.length === 3) {
|
|
17
17
|
const { NodeRuntime } = await import("./index-8v65jg3n.mjs");
|
|
18
|
-
const { runMcpServer } = await import("./mcp-
|
|
18
|
+
const { runMcpServer } = await import("./mcp-qgfs63cv.mjs");
|
|
19
19
|
runMcpServer.pipe(NodeRuntime.runMain);
|
|
20
20
|
} else if (command === "runtime-install" || command === "runtime-switch") {
|
|
21
|
-
const { runRuntimeInstall, runRuntimeSwitch } = await import("./runtime-update-
|
|
21
|
+
const { runRuntimeInstall, runRuntimeSwitch } = await import("./runtime-update-x9fmjr34.mjs");
|
|
22
22
|
await (command === "runtime-install" ? runRuntimeInstall : runRuntimeSwitch)(process.argv.slice(3));
|
|
23
23
|
} else if (command === "update") {
|
|
24
|
-
const { runUpdateCommand } = await import("./update-
|
|
24
|
+
const { runUpdateCommand } = await import("./update-fsfnbweb.mjs");
|
|
25
25
|
await runUpdateCommand(process.argv.slice(3));
|
|
26
26
|
} else if (command && setupCommands.has(command)) {
|
|
27
|
-
const { runSetup } = await import("./setup-
|
|
27
|
+
const { runSetup } = await import("./setup-3c7y4sqf.mjs");
|
|
28
28
|
await runSetup(command, process.argv.slice(3));
|
|
29
29
|
} else {
|
|
30
30
|
if (!command || command === "--help" || command === "-h") {
|
|
@@ -59,9 +59,9 @@ if (command === "--version" || command === "-v") {
|
|
|
59
59
|
`);
|
|
60
60
|
}
|
|
61
61
|
if (command === "status" && !process.argv.includes("--json")) {
|
|
62
|
-
const { printSetupStatus } = await import("./setup-
|
|
62
|
+
const { printSetupStatus } = await import("./setup-3c7y4sqf.mjs");
|
|
63
63
|
printSetupStatus();
|
|
64
64
|
}
|
|
65
|
-
const { runCli } = await import("./cli-
|
|
65
|
+
const { runCli } = await import("./cli-qrjme0am.mjs");
|
|
66
66
|
runCli();
|
|
67
67
|
}
|
|
@@ -31,8 +31,8 @@ import {
|
|
|
31
31
|
isRestrictedTarget2,
|
|
32
32
|
isRestrictedUrl2,
|
|
33
33
|
dataUrlDocument2
|
|
34
|
-
} from "./main-
|
|
35
|
-
import"./main-
|
|
34
|
+
} from "./main-675wpqng.mjs";
|
|
35
|
+
import"./main-v4z6qtmx.mjs";
|
|
36
36
|
import"./main-mrew6jy8.mjs";
|
|
37
37
|
export {
|
|
38
38
|
HttpRouteError2 as HttpRouteError,
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
parseTargetSelection2,
|
|
3
3
|
getObject2,
|
|
4
4
|
getString2
|
|
5
|
-
} from "./main-
|
|
5
|
+
} from "./main-675wpqng.mjs";
|
|
6
6
|
import {
|
|
7
7
|
isNodeError,
|
|
8
8
|
writeJsonFileAtomically
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-v4z6qtmx.mjs";
|
|
10
10
|
import {
|
|
11
11
|
getStackTraceLimit,
|
|
12
12
|
setStackTraceLimit,
|
|
@@ -102,10 +102,6 @@ import {
|
|
|
102
102
|
Json,
|
|
103
103
|
JsonObject
|
|
104
104
|
} from "./main-ta3yc4kx.mjs";
|
|
105
|
-
import {
|
|
106
|
-
dataRoot,
|
|
107
|
-
cliCommand
|
|
108
|
-
} from "./main-aja6gj20.mjs";
|
|
109
105
|
import {
|
|
110
106
|
pipeArguments,
|
|
111
107
|
identity,
|
|
@@ -118,6 +114,10 @@ import {
|
|
|
118
114
|
isObject,
|
|
119
115
|
hasProperty
|
|
120
116
|
} from "./main-yf9xhpn4.mjs";
|
|
117
|
+
import {
|
|
118
|
+
dataRoot,
|
|
119
|
+
cliCommand
|
|
120
|
+
} from "./main-fwv9bpgk.mjs";
|
|
121
121
|
|
|
122
122
|
// node_modules/effect/dist/Semaphore.js
|
|
123
123
|
var makeUnsafe = (permits) => new SemaphoreImpl(permits);
|
|
@@ -2616,7 +2616,7 @@ var readSecret = fn("SiteSecrets.read")(function* (name, options = {}) {
|
|
|
2616
2616
|
const filePath = yield* secretPath(options.baseDir ?? defaultSiteSecretsDir(), name);
|
|
2617
2617
|
const text = yield* tryPromise({
|
|
2618
2618
|
try: () => fs2.readFile(filePath, "utf8"),
|
|
2619
|
-
catch: (cause) => isNodeError(cause) && cause.code === "ENOENT" ? new SiteSecretError({ message: `Secret not found: ${name}. Ask the user to add it with
|
|
2619
|
+
catch: (cause) => isNodeError(cause) && cause.code === "ENOENT" ? new SiteSecretError({ message: `Secret not found: ${name}. Ask the user to add it with \`${cliCommand(`secrets add ${name} --origin <origin>`)}\`.`, reason: "not-found" }) : new SiteSecretError({ message: `Could not read secret ${name}`, reason: "read-failed", cause })
|
|
2620
2620
|
});
|
|
2621
2621
|
return yield* try_({
|
|
2622
2622
|
try: () => decodeUnknownSync(StoredSiteSecret)(JSON.parse(text)),
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./main-mrew6jy8.mjs";
|
|
8
8
|
import {
|
|
9
9
|
relayAuthorization
|
|
10
|
-
} from "./main-
|
|
10
|
+
} from "./main-v4z6qtmx.mjs";
|
|
11
11
|
import {
|
|
12
12
|
assignProperty,
|
|
13
13
|
PipeInspectableProto,
|
|
@@ -110,14 +110,14 @@ import {
|
|
|
110
110
|
} from "./main-ta3yc4kx.mjs";
|
|
111
111
|
import {
|
|
112
112
|
opencodeBrowserBuildId2
|
|
113
|
-
} from "./main-
|
|
113
|
+
} from "./main-s1vp1rjp.mjs";
|
|
114
114
|
import {
|
|
115
115
|
compiledBinary,
|
|
116
116
|
scriptEntry,
|
|
117
117
|
cliCommand,
|
|
118
118
|
installCommand,
|
|
119
119
|
npmRuntime
|
|
120
|
-
} from "./main-
|
|
120
|
+
} from "./main-fwv9bpgk.mjs";
|
|
121
121
|
import {
|
|
122
122
|
dual,
|
|
123
123
|
memoize,
|
|
@@ -1715,7 +1715,7 @@ function startManagedRelay(entrypoint = loadedCliEntrypoint, executable = proces
|
|
|
1715
1715
|
return try_({
|
|
1716
1716
|
try: () => {
|
|
1717
1717
|
if (!entrypoint) {
|
|
1718
|
-
throw new Error("Cannot locate the
|
|
1718
|
+
throw new Error("Cannot locate the browse CLI entrypoint");
|
|
1719
1719
|
}
|
|
1720
1720
|
const launch = managedRelayLaunch(entrypoint, executable, execArgv);
|
|
1721
1721
|
const { OPENCODE_BROWSER_RESTART_REQUEST_ID: _inheritedRestartRequestId, ...env } = relayEnvironment(process2.env);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
writePrivateJsonFileSync
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-v4z6qtmx.mjs";
|
|
4
4
|
import {
|
|
5
5
|
dataRoot,
|
|
6
6
|
devExtensionUrl,
|
|
7
7
|
devExtensionFolder
|
|
8
|
-
} from "./main-
|
|
8
|
+
} from "./main-fwv9bpgk.mjs";
|
|
9
9
|
|
|
10
10
|
// src/relay/browser-pairing.ts
|
|
11
11
|
import crypto from "node:crypto";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-s1vp1rjp.mjs";
|
|
4
4
|
|
|
5
5
|
// src/update/auto-update.ts
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
@@ -48,21 +48,24 @@ function checkoutRoot() {
|
|
|
48
48
|
return fromCheckout() ? path.dirname(packageRoot()) : undefined;
|
|
49
49
|
}
|
|
50
50
|
var quoted = (value) => /^[\w@%+=:,./-]+$/.test(value) ? value : JSON.stringify(value);
|
|
51
|
-
function
|
|
52
|
-
if (compiledBinary())
|
|
53
|
-
|
|
54
|
-
const dir = path.dirname(binary);
|
|
55
|
-
const onPath = (process.env.PATH ?? "").split(path.delimiter).some((entry) => entry && path.resolve(entry) === dir);
|
|
56
|
-
return `${onPath ? "browse" : quoted(binary)} ${args}`;
|
|
57
|
-
}
|
|
51
|
+
function cliInstall() {
|
|
52
|
+
if (compiledBinary())
|
|
53
|
+
return { kind: "binary", binary: installedBinary() ?? process.execPath, pathEnv: process.env.PATH };
|
|
58
54
|
if (fromCheckout())
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
return { kind: "checkout", bundle: path.join(packageRoot(), "dist", "cli.mjs") };
|
|
56
|
+
return { kind: "npm", version: "0.0.10-dev.67" };
|
|
57
|
+
}
|
|
58
|
+
function cliPrefix(install = cliInstall()) {
|
|
59
|
+
if (install.kind === "binary") {
|
|
60
|
+
const dir = path.dirname(install.binary);
|
|
61
|
+
const onPath = (install.pathEnv ?? "").split(path.delimiter).some((entry) => entry && path.resolve(entry) === dir);
|
|
62
|
+
return onPath ? "browse" : quoted(install.binary);
|
|
63
|
+
}
|
|
64
|
+
if (install.kind === "checkout")
|
|
65
|
+
return `node ${quoted(install.bundle)}`;
|
|
66
|
+
return install.version?.includes("-dev.") ? "npx @opencode/browse@dev" : "npx @opencode/browse";
|
|
65
67
|
}
|
|
68
|
+
var cliCommand = (args, install = cliInstall()) => `${cliPrefix(install)} ${args}`;
|
|
66
69
|
var STORE_ITEM_ID = /^[a-p]{32}$/;
|
|
67
70
|
var PUBLIC_STORE_ID = "mfnicocicmmlkpjnaffgihfjhdgjkdjg";
|
|
68
71
|
function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjhdgjkdjg" }) {
|
|
@@ -70,16 +73,14 @@ function storeConfig(env = process.env, baked = { id: "mfnicocicmmlkpjnaffgihfjh
|
|
|
70
73
|
return id ? { id } : {};
|
|
71
74
|
}
|
|
72
75
|
var RELEASE_SERVICE = "https://anoma.ly/release";
|
|
73
|
-
function devExtension(baked = { file: "browse-extension-0.0.10-dev.
|
|
76
|
+
function devExtension(baked = { file: "browse-extension-0.0.10-dev.67.zip", sha256: "fedb1dbe1503803a6c72ab1e9b602f25779e445600cb21b1cabe4a66f58a8a66", size: 182517 }) {
|
|
74
77
|
return baked && /^[0-9a-f]{64}$/.test(baked.sha256) && /^[\w.-]+\.zip$/.test(baked.file) ? baked : undefined;
|
|
75
78
|
}
|
|
76
79
|
var devExtensionUrl = (extension, env = process.env) => `${(env.OPENCODE_BROWSER_RELEASE_SERVICE || RELEASE_SERVICE).replace(/\/+$/, "")}/browse/files/${extension.sha256}/${extension.file}`;
|
|
77
80
|
var devExtensionFolder = (root = dataRoot()) => path.join(root, "extension");
|
|
78
81
|
var storeUrl = (id) => `https://chromewebstore.google.com/detail/${id}`;
|
|
79
82
|
function installCommand() {
|
|
80
|
-
|
|
81
|
-
return cliCommand("install");
|
|
82
|
-
return fromCheckout() ? `cd ${quoted(path.dirname(packageRoot()))} && bun run setup` : "npx @opencode/browse install";
|
|
83
|
+
return fromCheckout() ? `cd ${quoted(path.dirname(packageRoot()))} && bun run setup` : cliCommand("install");
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
// src/update/auto-update.ts
|
|
@@ -214,6 +215,7 @@ function autoUpdateStatus(options = {}) {
|
|
|
214
215
|
const install = runtime ? "npm" : fromCheckout() ? "checkout" : current ? "npm" : "other";
|
|
215
216
|
return {
|
|
216
217
|
install,
|
|
218
|
+
cli: cliPrefix(),
|
|
217
219
|
mode: storedMode(layout),
|
|
218
220
|
effective: install === "npm" ? override ?? storedMode(layout) : "off",
|
|
219
221
|
...override ? { overriddenBy: env.OPENCODE_BROWSER_AUTO_UPDATE !== undefined ? "OPENCODE_BROWSER_AUTO_UPDATE" : "OPENCODE_BROWSER_UPDATE_CHECK" } : {},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isNodeError
|
|
3
|
-
} from "./main-
|
|
3
|
+
} from "./main-v4z6qtmx.mjs";
|
|
4
4
|
import {
|
|
5
5
|
isValidSessionId2
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-675wpqng.mjs";
|
|
7
7
|
import {
|
|
8
8
|
isSome,
|
|
9
9
|
decodeUnknownOption,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./main-ta3yc4kx.mjs";
|
|
18
18
|
import {
|
|
19
19
|
dataRoot
|
|
20
|
-
} from "./main-
|
|
20
|
+
} from "./main-fwv9bpgk.mjs";
|
|
21
21
|
|
|
22
22
|
// src/session-manager/journal.ts
|
|
23
23
|
import fs from "node:fs";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
compareVersions,
|
|
7
7
|
npmRuntime,
|
|
8
8
|
autoUpdateStatus
|
|
9
|
-
} from "./main-
|
|
9
|
+
} from "./main-fwv9bpgk.mjs";
|
|
10
10
|
import {
|
|
11
11
|
unpackedReloadAdvice
|
|
12
12
|
} from "./main-mrew6jy8.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 { runNpmUpdate } = await import("./runtime-update-
|
|
318
|
+
const { runNpmUpdate } = await import("./runtime-update-x9fmjr34.mjs");
|
|
319
319
|
if (await runNpmUpdate(args))
|
|
320
320
|
return;
|
|
321
321
|
if (compiledBinary()) {
|
|
@@ -259,10 +259,11 @@ import {
|
|
|
259
259
|
} from "./main-ta3yc4kx.mjs";
|
|
260
260
|
import {
|
|
261
261
|
opencodeBrowserVersion2
|
|
262
|
-
} from "./main-
|
|
262
|
+
} from "./main-s1vp1rjp.mjs";
|
|
263
263
|
import {
|
|
264
|
+
cliCommand,
|
|
264
265
|
autoUpdateStatus
|
|
265
|
-
} from "./main-
|
|
266
|
+
} from "./main-fwv9bpgk.mjs";
|
|
266
267
|
import"./main-mrew6jy8.mjs";
|
|
267
268
|
import {
|
|
268
269
|
option,
|
|
@@ -274,12 +275,12 @@ import {
|
|
|
274
275
|
relayBuildProblem,
|
|
275
276
|
ensureRelay,
|
|
276
277
|
ensureExtensionConnected
|
|
277
|
-
} from "./main-
|
|
278
|
-
import"./main-
|
|
278
|
+
} from "./main-675wpqng.mjs";
|
|
279
|
+
import"./main-v4z6qtmx.mjs";
|
|
279
280
|
import {
|
|
280
281
|
updateJson2,
|
|
281
282
|
createUpdateWatcher2
|
|
282
|
-
} from "./main-
|
|
283
|
+
} from "./main-zwfkvc8r.mjs";
|
|
283
284
|
import {
|
|
284
285
|
makeUnsafe,
|
|
285
286
|
make,
|
|
@@ -352,7 +353,7 @@ import {
|
|
|
352
353
|
mcpErrorMessage2,
|
|
353
354
|
toolResult,
|
|
354
355
|
listSecrets
|
|
355
|
-
} from "./main-
|
|
356
|
+
} from "./main-3hcsagz7.mjs";
|
|
356
357
|
import {
|
|
357
358
|
Clock,
|
|
358
359
|
type,
|
|
@@ -8867,8 +8868,8 @@ registerMcpTools({
|
|
|
8867
8868
|
destructive: false,
|
|
8868
8869
|
idempotent: true,
|
|
8869
8870
|
handle: () => tryPromise({
|
|
8870
|
-
try: () => import("./skill-text-
|
|
8871
|
-
catch: (cause) => new Error("read
|
|
8871
|
+
try: () => import("./skill-text-g8avyxz3.mjs").then((module) => module.skillText),
|
|
8872
|
+
catch: (cause) => new Error("read browse skill", { cause })
|
|
8872
8873
|
})
|
|
8873
8874
|
}
|
|
8874
8875
|
]
|
|
@@ -9250,7 +9251,7 @@ registerMcpTools({
|
|
|
9250
9251
|
{
|
|
9251
9252
|
name: "secrets_list",
|
|
9252
9253
|
requiresRelayCompatibility: false,
|
|
9253
|
-
description:
|
|
9254
|
+
description: `List what agents may type without seeing: site secrets the user stored (names, kinds and allowed origins; type them with secrets.type(target, name) in execute; only the user adds them with \`${cliCommand("secrets add")}\`).`,
|
|
9254
9255
|
inputSchema: sessionOnlyInputSchema,
|
|
9255
9256
|
readOnly: true,
|
|
9256
9257
|
destructive: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
opencodeBrowserVersion2,
|
|
3
3
|
opencodeBrowserBuildId2
|
|
4
|
-
} from "./main-
|
|
4
|
+
} from "./main-s1vp1rjp.mjs";
|
|
5
5
|
import {
|
|
6
6
|
dataRoot,
|
|
7
7
|
oldStoreMarker,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
setStoredMode,
|
|
20
20
|
autoUpdateStatus,
|
|
21
21
|
createAutoUpdater
|
|
22
|
-
} from "./main-
|
|
22
|
+
} from "./main-fwv9bpgk.mjs";
|
|
23
23
|
import {
|
|
24
24
|
extensionProtocolVersion,
|
|
25
25
|
minExtensionProtocolVersion,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
relayToken,
|
|
45
45
|
secretsEqual,
|
|
46
46
|
ensurePrivateDirectory
|
|
47
|
-
} from "./main-
|
|
47
|
+
} from "./main-v4z6qtmx.mjs";
|
|
48
48
|
import {
|
|
49
49
|
withDefault,
|
|
50
50
|
option,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
isRestrictedTarget2,
|
|
99
99
|
isRestrictedUrl2,
|
|
100
100
|
dataUrlDocument2
|
|
101
|
-
} from "./main-
|
|
101
|
+
} from "./main-675wpqng.mjs";
|
|
102
102
|
import {
|
|
103
103
|
relayHostname,
|
|
104
104
|
isLocalPeer,
|
|
@@ -120,7 +120,7 @@ import {
|
|
|
120
120
|
wrapToken,
|
|
121
121
|
installedDevExtension,
|
|
122
122
|
syncDevExtension
|
|
123
|
-
} from "./main-
|
|
123
|
+
} from "./main-9156hx8a.mjs";
|
|
124
124
|
import {
|
|
125
125
|
makeUnsafe,
|
|
126
126
|
SettingsInputError,
|
|
@@ -148,16 +148,16 @@ import {
|
|
|
148
148
|
checkNavigationUrl,
|
|
149
149
|
readSecret,
|
|
150
150
|
secretText
|
|
151
|
-
} from "./main-
|
|
151
|
+
} from "./main-3hcsagz7.mjs";
|
|
152
152
|
import {
|
|
153
153
|
defaultJournalBaseDir,
|
|
154
154
|
makeJournalEntry,
|
|
155
155
|
appendJournalEntry,
|
|
156
156
|
startJournalRetention
|
|
157
|
-
} from "./main-
|
|
157
|
+
} from "./main-ww8xvpdv.mjs";
|
|
158
158
|
import {
|
|
159
159
|
createUpdateWatcher2
|
|
160
|
-
} from "./main-
|
|
160
|
+
} from "./main-zwfkvc8r.mjs";
|
|
161
161
|
import {
|
|
162
162
|
isNone,
|
|
163
163
|
isSome,
|
|
@@ -1719,11 +1719,8 @@ class CdpRuntime {
|
|
|
1719
1719
|
}
|
|
1720
1720
|
}
|
|
1721
1721
|
|
|
1722
|
-
// src/execute.ts
|
|
1723
|
-
import { chromium, errors } from "patchright-core";
|
|
1724
|
-
|
|
1725
1722
|
// src/snapshot/aria-snapshot.ts
|
|
1726
|
-
|
|
1723
|
+
var { selectors } = await import("./coreBundle-v82htk0w.mjs");
|
|
1727
1724
|
var redactionCleanupErrorMessage = "browse could not confirm ARIA snapshot value-redaction cleanup";
|
|
1728
1725
|
var redactionSelectorSource = `({
|
|
1729
1726
|
query(root, body) {
|
|
@@ -9764,9 +9761,6 @@ class Recorder {
|
|
|
9764
9761
|
}
|
|
9765
9762
|
}
|
|
9766
9763
|
|
|
9767
|
-
// src/execute/patchright-tuning.ts
|
|
9768
|
-
import { createRequire } from "node:module";
|
|
9769
|
-
|
|
9770
9764
|
// src/relay/log.ts
|
|
9771
9765
|
import fs7 from "node:fs";
|
|
9772
9766
|
import os5 from "node:os";
|
|
@@ -9795,8 +9789,7 @@ function relayLog(event, fields = {}) {
|
|
|
9795
9789
|
}
|
|
9796
9790
|
|
|
9797
9791
|
// src/execute/patchright-tuning.ts
|
|
9798
|
-
function tunePatchright() {
|
|
9799
|
-
const { server } = createRequire(import.meta.url)("patchright-core/lib/coreBundle");
|
|
9792
|
+
function tunePatchright({ server }) {
|
|
9800
9793
|
const page = server?.Page?.prototype;
|
|
9801
9794
|
const mainFrame = page?.mainFrame;
|
|
9802
9795
|
if (!page || typeof mainFrame !== "function") {
|
|
@@ -9828,7 +9821,8 @@ function tunePatchright() {
|
|
|
9828
9821
|
}
|
|
9829
9822
|
|
|
9830
9823
|
// src/execute.ts
|
|
9831
|
-
|
|
9824
|
+
var { chromium, errors, internals } = await import("./coreBundle-v82htk0w.mjs");
|
|
9825
|
+
tunePatchright(internals);
|
|
9832
9826
|
|
|
9833
9827
|
class ExecuteSandbox extends DefaultPageHost {
|
|
9834
9828
|
options;
|
|
@@ -10329,8 +10323,8 @@ function mjpegMatroskaHeader(width, height) {
|
|
|
10329
10323
|
]));
|
|
10330
10324
|
const streamInfo = element(info, Buffer.concat([
|
|
10331
10325
|
element(timestampScale, unsignedInteger(1e6)),
|
|
10332
|
-
element(muxingApp, Buffer.from("
|
|
10333
|
-
element(writingApp, Buffer.from("
|
|
10326
|
+
element(muxingApp, Buffer.from("browse")),
|
|
10327
|
+
element(writingApp, Buffer.from("browse"))
|
|
10334
10328
|
]));
|
|
10335
10329
|
const track = element(trackEntry, Buffer.concat([
|
|
10336
10330
|
element(trackNumber, unsignedInteger(1)),
|
|
@@ -14583,12 +14577,19 @@ function relayProcessFaultSummary() {
|
|
|
14583
14577
|
};
|
|
14584
14578
|
}
|
|
14585
14579
|
function shouldSuppressRelayProcessFault(cause) {
|
|
14580
|
+
if (isPatchrightProtocolError(cause))
|
|
14581
|
+
return true;
|
|
14586
14582
|
const errorText = cause instanceof Error ? `${cause.message}
|
|
14587
14583
|
${cause.stack ?? ""}` : String(cause);
|
|
14588
14584
|
return /playwright-core|patchright-core|coreBundle|Duplicate target/i.test(errorText);
|
|
14589
14585
|
}
|
|
14586
|
+
function isPatchrightProtocolError(cause) {
|
|
14587
|
+
return cause instanceof Error && Object.hasOwn(cause, "method") && Object.hasOwn(cause, "logs") && "type" in cause && (cause.type === "error" || cause.type === "closed" || cause.type === "crashed");
|
|
14588
|
+
}
|
|
14590
14589
|
function isBenignClosedSessionRejection(cause) {
|
|
14591
|
-
if (!(cause instanceof Error)
|
|
14590
|
+
if (!(cause instanceof Error))
|
|
14591
|
+
return false;
|
|
14592
|
+
if (!isPatchrightProtocolError(cause) && !/patchright-core|playwright-core|coreBundle/.test(cause.stack ?? ""))
|
|
14592
14593
|
return false;
|
|
14593
14594
|
return /^Protocol error \([\w.]+\): .*(session closed|Target closed|Extension disconnected|extension is not connected|Unknown CDP session|Detached while handling command|Relay closed)/i.test(cause.message);
|
|
14594
14595
|
}
|
|
@@ -14624,13 +14625,13 @@ function rethrowProcessFault(cause) {
|
|
|
14624
14625
|
}
|
|
14625
14626
|
function logProcessFault(kind, cause, detail, disposition) {
|
|
14626
14627
|
const errorText = cause instanceof Error ? cause.stack ?? cause.message : String(cause);
|
|
14627
|
-
const message = `[
|
|
14628
|
+
const message = `[browse relay] ${kind}; ${disposition}
|
|
14628
14629
|
${errorText}`;
|
|
14629
14630
|
console.error(message);
|
|
14630
14631
|
if (process.env.OPENCODE_BROWSER_MANAGED_RELAY === "1")
|
|
14631
14632
|
appendManagedRelayProcessLog(message);
|
|
14632
14633
|
if (debugEnvironmentEnabled(process.env.OPENCODE_BROWSER_DEBUG)) {
|
|
14633
|
-
console.error(`[
|
|
14634
|
+
console.error(`[browse relay] ${kind} detail`, detail);
|
|
14634
14635
|
}
|
|
14635
14636
|
}
|
|
14636
14637
|
function debugEnvironmentEnabled(value) {
|
|
@@ -15197,7 +15198,7 @@ function createExtensionEventHandler(options) {
|
|
|
15197
15198
|
if (!text)
|
|
15198
15199
|
return;
|
|
15199
15200
|
const level = message.params?.level === "error" || message.params?.level === "warn" ? message.params.level : "log";
|
|
15200
|
-
console[level](`[
|
|
15201
|
+
console[level](`[browse extension] ${text}`);
|
|
15201
15202
|
return;
|
|
15202
15203
|
}
|
|
15203
15204
|
if (extensionMethod === "ready") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-s1vp1rjp.mjs";
|
|
2
2
|
import {
|
|
3
3
|
cliCommand,
|
|
4
4
|
installCommand,
|
|
@@ -18,15 +18,15 @@ import {
|
|
|
18
18
|
installVersion,
|
|
19
19
|
pruneVersions,
|
|
20
20
|
switchVersion
|
|
21
|
-
} from "./main-
|
|
21
|
+
} from "./main-fwv9bpgk.mjs";
|
|
22
22
|
import"./main-mrew6jy8.mjs";
|
|
23
23
|
import {
|
|
24
24
|
Service,
|
|
25
25
|
layerFetch,
|
|
26
26
|
restartRelay,
|
|
27
27
|
startManagedRelay
|
|
28
|
-
} from "./main-
|
|
29
|
-
import"./main-
|
|
28
|
+
} from "./main-675wpqng.mjs";
|
|
29
|
+
import"./main-v4z6qtmx.mjs";
|
|
30
30
|
import {
|
|
31
31
|
succeed6,
|
|
32
32
|
suspend2,
|