@opencode/browse 0.0.11-dev.75 → 0.0.11-dev.77
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-5980z4hc.mjs → cli-mx6tbg2m.mjs} +63 -52
- package/dist/cli.mjs +30 -19
- package/dist/{helpers-h1mvscyw.mjs → helpers-hgm1z9h5.mjs} +2 -2
- package/dist/{index-0dcypq31.mjs → index-yzz55kxm.mjs} +1 -1
- package/dist/{main-d1hydckg.mjs → main-1fdejpga.mjs} +9 -9
- package/dist/{main-tcae6pr3.mjs → main-6chyyr6j.mjs} +44 -39
- package/dist/{main-rt6g5418.mjs → main-8z9d979q.mjs} +15 -15
- package/dist/{setup-q1sfzdr9.mjs → main-b7g6460c.mjs} +3608 -4406
- package/dist/{main-gevbt7h7.mjs → main-csnx585b.mjs} +151 -151
- package/dist/{main-j38051kb.mjs → main-cymarjp4.mjs} +47 -47
- package/dist/main-j2ehvkhk.mjs +465 -0
- package/dist/main-r3a6053j.mjs +157 -0
- package/dist/main-s7017yah.mjs +161 -0
- package/dist/main-sjrzyg3x.mjs +73 -0
- package/dist/main-vgzr4689.mjs +61 -0
- package/dist/{main-5vffh0gd.mjs → main-zq79yb8r.mjs} +6 -6
- package/dist/main-zya5ttbr.mjs +4 -0
- package/dist/{mcp-x1vq2n6t.mjs → mcp-h0qcxhqc.mjs} +138 -137
- package/dist/migrate-pgckfkg5.mjs +233 -0
- package/dist/{relay-94r2w21z.mjs → relay-gafgjtav.mjs} +191 -129
- package/dist/runtime-update-p2pnfdy1.mjs +156 -0
- package/dist/setup-fhhjnx9r.mjs +956 -0
- package/dist/{skill-text-x7sccp6h.mjs → skill-text-6p6scqwe.mjs} +2 -2
- package/dist/{supervisor-e2w15458.mjs → supervisor-06t66v4t.mjs} +38 -17
- package/dist/{update-c8xwkt5v.mjs → update-7hagfdc0.mjs} +3 -3
- package/dist/{version-0jtmhnzb.mjs → version-hhcvk9wm.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +2 -2
- package/dist/main-jkq3ey3t.mjs +0 -805
- package/dist/main-nhr7bg32.mjs +0 -131
- package/dist/main-s5mqta5j.mjs +0 -303
- package/dist/main-wpbmhp3v.mjs +0 -4
- package/dist/runtime-update-g516gc7h.mjs +0 -200
|
@@ -273,8 +273,8 @@ browse refuses navigations to \`file:\`, \`chrome:\`, \`chrome-extension:\`,
|
|
|
273
273
|
shared browser state, including browser close and cookie/cache clearing. Never
|
|
274
274
|
work around those guardrails.
|
|
275
275
|
|
|
276
|
-
Every execute is journaled under \`<
|
|
277
|
-
(\`~/.local/
|
|
276
|
+
Every execute is journaled under \`<state root>/sessions/<id>/journal.jsonl\`
|
|
277
|
+
(\`~/.local/state/browse\` on macOS and Linux). Never place credentials
|
|
278
278
|
directly in execute source.
|
|
279
279
|
|
|
280
280
|
## Network capture
|
|
@@ -1,30 +1,45 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-zya5ttbr.mjs";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "./main-
|
|
3
|
+
entryCommand,
|
|
4
|
+
installedRuntime2,
|
|
5
|
+
installedVersion
|
|
6
|
+
} from "./main-j2ehvkhk.mjs";
|
|
7
7
|
|
|
8
8
|
// src/mcp/supervisor.ts
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
10
|
-
import { existsSync } from "node:fs";
|
|
10
|
+
import { existsSync, statSync } from "node:fs";
|
|
11
|
+
import path from "node:path";
|
|
11
12
|
import { createInterface } from "node:readline";
|
|
12
13
|
var directEnvironmentVariable = "OPENCODE_BROWSER_MCP_DIRECT";
|
|
14
|
+
var watchedFile = (runtime) => runtime.kind === "binary" ? runtime.entry : path.join(path.dirname(path.dirname(runtime.entry)), "package.json");
|
|
15
|
+
function versionReader(runtime, initial) {
|
|
16
|
+
let version = initial;
|
|
17
|
+
let stamp = "";
|
|
18
|
+
return () => {
|
|
19
|
+
try {
|
|
20
|
+
const stat = statSync(watchedFile(runtime));
|
|
21
|
+
const next = `${stat.mtimeMs}:${stat.size}`;
|
|
22
|
+
if (next === stamp)
|
|
23
|
+
return version;
|
|
24
|
+
stamp = next;
|
|
25
|
+
version = installedVersion(runtime) ?? version;
|
|
26
|
+
return version;
|
|
27
|
+
} catch {
|
|
28
|
+
return version;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
13
32
|
async function runBinaryMcp(args) {
|
|
14
|
-
const runtime =
|
|
15
|
-
if (!runtime) {
|
|
33
|
+
const runtime = installedRuntime2();
|
|
34
|
+
if (!runtime || runtime.kind === "npx") {
|
|
16
35
|
process.env[directEnvironmentVariable] = "1";
|
|
17
|
-
const { runCli } = await import("./cli-
|
|
36
|
+
const { runCli } = await import("./cli-mx6tbg2m.mjs");
|
|
18
37
|
return runCli();
|
|
19
38
|
}
|
|
20
|
-
const { layout } = runtime;
|
|
21
39
|
const REPLAY = "opencode-browser-shim-initialize";
|
|
22
40
|
const relayPort = Number(process.env.OPENCODE_BROWSER_PORT) || 19988;
|
|
23
|
-
const current = (
|
|
24
|
-
const command = (
|
|
25
|
-
const entry = versionEntry(layout, version, true);
|
|
26
|
-
return existsSync(entry) ? entry : runtime.current.binary ?? process.execPath;
|
|
27
|
-
};
|
|
41
|
+
const current = versionReader(runtime, installedVersion(runtime) ?? runtime.version);
|
|
42
|
+
const command = () => runtime.entry;
|
|
28
43
|
process.env.OPENCODE_BROWSER_MCP_SESSION ??= "mcp-" + Math.random().toString(16).slice(2, 10).padEnd(8, "0");
|
|
29
44
|
process.env.OPENCODE_BROWSER_CLIENT_PID = String(process.pid);
|
|
30
45
|
let version = current();
|
|
@@ -62,7 +77,8 @@ async function runBinaryMcp(args) {
|
|
|
62
77
|
toChild(line);
|
|
63
78
|
};
|
|
64
79
|
const start = (replay) => {
|
|
65
|
-
const
|
|
80
|
+
const [file, ...prefix] = entryCommand(command());
|
|
81
|
+
const next = spawn(file, [...prefix, "mcp", ...args], { stdio: ["pipe", "pipe", "inherit"], env: { ...process.env, [directEnvironmentVariable]: "1" } });
|
|
66
82
|
next.stdin.on("error", () => {});
|
|
67
83
|
child = next;
|
|
68
84
|
next.on("exit", (code, signal) => {
|
|
@@ -161,6 +177,11 @@ async function runBinaryMcp(args) {
|
|
|
161
177
|
});
|
|
162
178
|
setInterval(() => void maybeSwap(), 1000).unref();
|
|
163
179
|
}
|
|
180
|
+
function supervisesMcp() {
|
|
181
|
+
const runtime = installedRuntime2();
|
|
182
|
+
return !!runtime && runtime.kind !== "npx" && existsSync(runtime.entry);
|
|
183
|
+
}
|
|
164
184
|
export {
|
|
165
|
-
runBinaryMcp
|
|
185
|
+
runBinaryMcp,
|
|
186
|
+
supervisesMcp
|
|
166
187
|
};
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
updateNotice2,
|
|
5
5
|
createUpdateWatcher2,
|
|
6
6
|
runUpdateCommand2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-1fdejpga.mjs";
|
|
8
8
|
import"./main-mrew6jy8.mjs";
|
|
9
|
-
import"./main-
|
|
10
|
-
import"./main-
|
|
9
|
+
import"./main-j2ehvkhk.mjs";
|
|
10
|
+
import"./main-zya5ttbr.mjs";
|
|
11
11
|
export {
|
|
12
12
|
createUpdateWatcher2 as createUpdateWatcher,
|
|
13
13
|
formatUpdateNotice2 as formatUpdateNotice,
|
package/package.json
CHANGED
package/skills/browse/SKILL.md
CHANGED
|
@@ -272,8 +272,8 @@ browse refuses navigations to `file:`, `chrome:`, `chrome-extension:`,
|
|
|
272
272
|
shared browser state, including browser close and cookie/cache clearing. Never
|
|
273
273
|
work around those guardrails.
|
|
274
274
|
|
|
275
|
-
Every execute is journaled under `<
|
|
276
|
-
(`~/.local/
|
|
275
|
+
Every execute is journaled under `<state root>/sessions/<id>/journal.jsonl`
|
|
276
|
+
(`~/.local/state/browse` on macOS and Linux). Never place credentials
|
|
277
277
|
directly in execute source.
|
|
278
278
|
|
|
279
279
|
## Network capture
|