@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.
Files changed (33) hide show
  1. package/dist/{cli-5980z4hc.mjs → cli-mx6tbg2m.mjs} +63 -52
  2. package/dist/cli.mjs +30 -19
  3. package/dist/{helpers-h1mvscyw.mjs → helpers-hgm1z9h5.mjs} +2 -2
  4. package/dist/{index-0dcypq31.mjs → index-yzz55kxm.mjs} +1 -1
  5. package/dist/{main-d1hydckg.mjs → main-1fdejpga.mjs} +9 -9
  6. package/dist/{main-tcae6pr3.mjs → main-6chyyr6j.mjs} +44 -39
  7. package/dist/{main-rt6g5418.mjs → main-8z9d979q.mjs} +15 -15
  8. package/dist/{setup-q1sfzdr9.mjs → main-b7g6460c.mjs} +3608 -4406
  9. package/dist/{main-gevbt7h7.mjs → main-csnx585b.mjs} +151 -151
  10. package/dist/{main-j38051kb.mjs → main-cymarjp4.mjs} +47 -47
  11. package/dist/main-j2ehvkhk.mjs +465 -0
  12. package/dist/main-r3a6053j.mjs +157 -0
  13. package/dist/main-s7017yah.mjs +161 -0
  14. package/dist/main-sjrzyg3x.mjs +73 -0
  15. package/dist/main-vgzr4689.mjs +61 -0
  16. package/dist/{main-5vffh0gd.mjs → main-zq79yb8r.mjs} +6 -6
  17. package/dist/main-zya5ttbr.mjs +4 -0
  18. package/dist/{mcp-x1vq2n6t.mjs → mcp-h0qcxhqc.mjs} +138 -137
  19. package/dist/migrate-pgckfkg5.mjs +233 -0
  20. package/dist/{relay-94r2w21z.mjs → relay-gafgjtav.mjs} +191 -129
  21. package/dist/runtime-update-p2pnfdy1.mjs +156 -0
  22. package/dist/setup-fhhjnx9r.mjs +956 -0
  23. package/dist/{skill-text-x7sccp6h.mjs → skill-text-6p6scqwe.mjs} +2 -2
  24. package/dist/{supervisor-e2w15458.mjs → supervisor-06t66v4t.mjs} +38 -17
  25. package/dist/{update-c8xwkt5v.mjs → update-7hagfdc0.mjs} +3 -3
  26. package/dist/{version-0jtmhnzb.mjs → version-hhcvk9wm.mjs} +1 -1
  27. package/package.json +1 -1
  28. package/skills/browse/SKILL.md +2 -2
  29. package/dist/main-jkq3ey3t.mjs +0 -805
  30. package/dist/main-nhr7bg32.mjs +0 -131
  31. package/dist/main-s5mqta5j.mjs +0 -303
  32. package/dist/main-wpbmhp3v.mjs +0 -4
  33. 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 \`<data root>/sessions/<id>/journal.jsonl\`
277
- (\`~/.local/share/opencode-browser\` on macOS and Linux). Never place credentials
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-wpbmhp3v.mjs";
1
+ import"./main-zya5ttbr.mjs";
2
2
  import {
3
- versionEntry,
4
- readCurrent,
5
- npmRuntime
6
- } from "./main-jkq3ey3t.mjs";
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 = npmRuntime();
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-5980z4hc.mjs");
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 = () => readCurrent(layout)?.version ?? runtime.version;
24
- const command = (version) => {
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 next = spawn(command(version), ["mcp", ...args], { stdio: ["pipe", "pipe", "inherit"], env: { ...process.env, [directEnvironmentVariable]: "1" } });
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-d1hydckg.mjs";
7
+ } from "./main-1fdejpga.mjs";
8
8
  import"./main-mrew6jy8.mjs";
9
- import"./main-jkq3ey3t.mjs";
10
- import"./main-wpbmhp3v.mjs";
9
+ import"./main-j2ehvkhk.mjs";
10
+ import"./main-zya5ttbr.mjs";
11
11
  export {
12
12
  createUpdateWatcher2 as createUpdateWatcher,
13
13
  formatUpdateNotice2 as formatUpdateNotice,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  opencodeBrowserVersion2,
3
3
  opencodeBrowserBuildId2
4
- } from "./main-wpbmhp3v.mjs";
4
+ } from "./main-zya5ttbr.mjs";
5
5
  export {
6
6
  opencodeBrowserBuildId2 as opencodeBrowserBuildId,
7
7
  opencodeBrowserVersion2 as opencodeBrowserVersion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencode/browse",
3
- "version": "0.0.11-dev.75",
3
+ "version": "0.0.11-dev.77",
4
4
  "description": "browse: connect the extension to opencode, and drive your browser from any agent (CLI, MCP, Playwright).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -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 `<data root>/sessions/<id>/journal.jsonl`
276
- (`~/.local/share/opencode-browser` on macOS and Linux). Never place credentials
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