@opencode/browse 0.0.14-dev.89 → 0.0.15-dev.100
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-de4qgw63.mjs → cli-6n92w2tr.mjs} +15 -15
- package/dist/cli.mjs +25 -19
- package/dist/{helpers-xmc7hjne.mjs → helpers-b363a8nv.mjs} +3 -1
- package/dist/{main-zzp23g5a.mjs → main-0pf5apge.mjs} +1 -1
- package/dist/{main-1vxdvhxq.mjs → main-0vy46qt0.mjs} +23 -7
- package/dist/{main-zv2rzdyy.mjs → main-1v1av1rf.mjs} +11 -4
- package/dist/{main-8sq2eksh.mjs → main-9eddfbwc.mjs} +1 -1
- package/dist/{main-xyak2r6b.mjs → main-bwkbapy8.mjs} +2 -2
- package/dist/main-ckssvk4c.mjs +18 -0
- package/dist/{main-3njywps1.mjs → main-cktye7tt.mjs} +2 -2
- package/dist/{main-skr1xf3n.mjs → main-njxjy1jj.mjs} +30 -15
- package/dist/{main-t7gk51hn.mjs → main-qrb9v6gy.mjs} +2 -2
- package/dist/{main-m9mn33h2.mjs → main-vbwhrdcz.mjs} +2 -2
- package/dist/main-zt63krh7.mjs +4 -0
- package/dist/{mcp-15evjbx4.mjs → mcp-rm9sf99b.mjs} +6 -6
- package/dist/{migrate-d5bj9eym.mjs → migrate-jpsgxnkg.mjs} +10 -13
- package/dist/{relay-kf1hanst.mjs → relay-hwwmvejt.mjs} +443 -156
- package/dist/{runtime-update-q0fbjj52.mjs → runtime-update-98db5p2b.mjs} +4 -4
- package/dist/{setup-bk39djpf.mjs → setup-cdwsskaa.mjs} +30 -11
- package/dist/{skill-text-mrxy6zpc.mjs → skill-text-28va391t.mjs} +16 -3
- package/dist/{supervisor-e60f40k9.mjs → supervisor-ncmszn2n.mjs} +3 -3
- package/dist/{update-pk34hat5.mjs → update-gc7wnpxj.mjs} +3 -3
- package/dist/{version-cm8f0bhc.mjs → version-5heaad93.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +16 -3
- package/dist/main-6qsa4k93.mjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-zt63krh7.mjs";
|
|
2
2
|
import {
|
|
3
3
|
cliCommand,
|
|
4
4
|
installCommand,
|
|
@@ -15,14 +15,14 @@ import {
|
|
|
15
15
|
registryUrl,
|
|
16
16
|
fetchPublished,
|
|
17
17
|
runInstaller
|
|
18
|
-
} from "./main-
|
|
18
|
+
} from "./main-0vy46qt0.mjs";
|
|
19
19
|
import"./main-mrew6jy8.mjs";
|
|
20
20
|
import {
|
|
21
21
|
Service,
|
|
22
22
|
layerFetch,
|
|
23
23
|
restartRelay,
|
|
24
24
|
startManagedRelay
|
|
25
|
-
} from "./main-
|
|
25
|
+
} from "./main-1v1av1rf.mjs";
|
|
26
26
|
import"./main-vgzr4689.mjs";
|
|
27
27
|
import {
|
|
28
28
|
succeed6,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
provide3,
|
|
33
33
|
runPromise
|
|
34
34
|
} from "./main-csnx585b.mjs";
|
|
35
|
-
import"./main-
|
|
35
|
+
import"./main-9eddfbwc.mjs";
|
|
36
36
|
|
|
37
37
|
// src/update/runtime-update.ts
|
|
38
38
|
var log = (line) => process.stdout.write(line + `
|
|
@@ -42,6 +42,8 @@ import {
|
|
|
42
42
|
fail,
|
|
43
43
|
installWaitTimeout,
|
|
44
44
|
waitTimeout,
|
|
45
|
+
samePath,
|
|
46
|
+
isInstallerBinary,
|
|
45
47
|
addToPath,
|
|
46
48
|
removeBinaryInstall,
|
|
47
49
|
oldStoreBuild,
|
|
@@ -61,12 +63,14 @@ import {
|
|
|
61
63
|
installRuntime,
|
|
62
64
|
installedRuntime,
|
|
63
65
|
manualMcpEntry
|
|
64
|
-
} from "./main-
|
|
66
|
+
} from "./main-njxjy1jj.mjs";
|
|
65
67
|
import {
|
|
66
68
|
opencodeBrowserBuildId2
|
|
67
|
-
} from "./main-
|
|
69
|
+
} from "./main-zt63krh7.mjs";
|
|
68
70
|
import {
|
|
69
71
|
installedBinaryPath,
|
|
72
|
+
installerBinaryPath,
|
|
73
|
+
defaultSettingsPath,
|
|
70
74
|
oldStoreMarker,
|
|
71
75
|
compiledBinary,
|
|
72
76
|
scriptEntry,
|
|
@@ -78,7 +82,7 @@ import {
|
|
|
78
82
|
autoUpdateStatus,
|
|
79
83
|
describeAutoUpdate,
|
|
80
84
|
runCommand
|
|
81
|
-
} from "./main-
|
|
85
|
+
} from "./main-0vy46qt0.mjs";
|
|
82
86
|
import"./main-vgzr4689.mjs";
|
|
83
87
|
import {
|
|
84
88
|
pairingCodeTtlMs,
|
|
@@ -92,7 +96,7 @@ import {
|
|
|
92
96
|
revokeBrowserToken,
|
|
93
97
|
legacyPairingCode,
|
|
94
98
|
removeLegacyPairingCode
|
|
95
|
-
} from "./main-
|
|
99
|
+
} from "./main-0pf5apge.mjs";
|
|
96
100
|
import {
|
|
97
101
|
unpackedExtensionId,
|
|
98
102
|
extensionProtocolSkew,
|
|
@@ -103,10 +107,10 @@ import {
|
|
|
103
107
|
readRelayConfig,
|
|
104
108
|
writeRelayConfig,
|
|
105
109
|
syncDevExtension
|
|
106
|
-
} from "./main-
|
|
110
|
+
} from "./main-bwkbapy8.mjs";
|
|
107
111
|
import {
|
|
108
112
|
relayAuthorization
|
|
109
|
-
} from "./main-
|
|
113
|
+
} from "./main-9eddfbwc.mjs";
|
|
110
114
|
|
|
111
115
|
// src/setup.ts
|
|
112
116
|
import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
|
|
@@ -580,6 +584,25 @@ async function uninstall(args) {
|
|
|
580
584
|
}
|
|
581
585
|
}
|
|
582
586
|
const binary = installedBinaryPath();
|
|
587
|
+
if (compiledBinary()) {
|
|
588
|
+
const installer = installerBinaryPath();
|
|
589
|
+
if (installer !== binary && existsSync(installer) && !samePath(installer, binary)) {
|
|
590
|
+
if (!existsSync(defaultSettingsPath()) && isInstallerBinary(installer, binary)) {
|
|
591
|
+
try {
|
|
592
|
+
rmSync(installer, { force: true });
|
|
593
|
+
log(`✓ Removed ${installer}`);
|
|
594
|
+
} catch {
|
|
595
|
+
log(`! Couldn't remove ${installer} while it's running; delete it after uninstall exits.`);
|
|
596
|
+
}
|
|
597
|
+
} else {
|
|
598
|
+
log(`! Left ${installer}; delete it if you no longer use browse there.`);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
if (existsSync(binary)) {
|
|
603
|
+
const left = removeBinaryInstall(binary);
|
|
604
|
+
log(left ? `! Couldn't remove ${left}. After uninstall exits, close any browse agents using the file(s) and delete them.` : `✓ Removed ${binary}`);
|
|
605
|
+
}
|
|
583
606
|
for (const directory of [paths.data, paths.config, paths.state, paths.cache]) {
|
|
584
607
|
try {
|
|
585
608
|
rmSync(directory, { recursive: true, force: true });
|
|
@@ -590,10 +613,6 @@ async function uninstall(args) {
|
|
|
590
613
|
log(`! Couldn't remove all of ${directory}; close running browse agents and remove the remaining files.`);
|
|
591
614
|
}
|
|
592
615
|
}
|
|
593
|
-
if (existsSync(binary)) {
|
|
594
|
-
const left = removeBinaryInstall(binary);
|
|
595
|
-
log(left ? `! Couldn't remove ${left}. After uninstall exits, close any browse agents using the file(s) and delete them.` : `✓ Removed ${binary}`);
|
|
596
|
-
}
|
|
597
616
|
if (!compiledBinary() && !fromSource) {
|
|
598
617
|
const npm = await runCommand("npm", ["uninstall", "-g", "@opencode/browse"], { timeoutMs: 120000 });
|
|
599
618
|
log(npm.status === 0 ? "✓ Removed the global npm package" : `! Couldn't remove the global npm package: ${(npm.stderr || npm.stdout).trim() || "npm uninstall failed"}`);
|
|
@@ -766,7 +785,7 @@ async function installSteps(args, tty, caller) {
|
|
|
766
785
|
const label = agentLabels[agent.name];
|
|
767
786
|
if (!selected.includes(agent.name)) {
|
|
768
787
|
if (!plan.picker && agent.installed && !flags.requested.length)
|
|
769
|
-
log(`To add ${label} too: ${cliCommand(`install --agent ${agent.name}`)}`);
|
|
788
|
+
log(`To add ${label}${selected.length ? " too" : ""}: ${cliCommand(`install --agent ${agent.name}`)}`);
|
|
770
789
|
continue;
|
|
771
790
|
}
|
|
772
791
|
if (agent.name === "opencode") {
|
|
@@ -55,9 +55,16 @@ MCP: \`session_adopt\` with \`tabId\` or \`targetUrl\`. Prefer adoption for
|
|
|
55
55
|
authenticated browser state rather than reproducing a login in a fresh page.
|
|
56
56
|
\`targetUrl\` and \`targetIndex\` select existing pages; they never navigate.
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
One relay can have several browsers connected at once, each with an id like
|
|
59
|
+
\`chrome-macbook\`. New sessions use the default browser, the first connected and
|
|
60
|
+
ready, unless \`session_new\` or the first \`execute\` that creates it gets
|
|
61
|
+
\`browser: "<id>"\`. \`status\` lists the connected browsers (\`browse status --json\`
|
|
62
|
+
on the CLI). A session stays in its browser, so start a new one to use another.
|
|
63
|
+
|
|
64
|
+
The \`browse\` CLI cannot pick a browser: \`session new\` takes only \`--read-only\`
|
|
65
|
+
and \`--allow-origin\`, so CLI sessions use the default browser. \`session_adopt\`
|
|
66
|
+
has no \`browser\` either; to adopt a tab in another browser, run \`session_new\`
|
|
67
|
+
with \`browser\` first, then \`session_adopt\` in that session.
|
|
61
68
|
|
|
62
69
|
## Inspect, act, verify
|
|
63
70
|
|
|
@@ -208,6 +215,12 @@ values between calls on \`state\`. A single run without an \`await\` is stopped
|
|
|
208
215
|
about 2 seconds; split heavy loops with
|
|
209
216
|
\`await new Promise(r => setTimeout(r, 0))\` or do the work in the page.
|
|
210
217
|
|
|
218
|
+
Await promises: a rejection with no handler never stops the relay. A running call
|
|
219
|
+
gets the error; a later one resets the realm and warns on the next call (a
|
|
220
|
+
one-shot \`--rm\` session is already gone). Full Node mode has no realm to reset.
|
|
221
|
+
\`await files.write(...)\` and \`await page.goto(...)\` put the error in the call
|
|
222
|
+
that caused it.
|
|
223
|
+
|
|
211
224
|
It runs in a restricted JavaScript realm, not a sandbox. It shares the relay's
|
|
212
225
|
process, so it is not a security boundary: treat code as running as you. There
|
|
213
226
|
is no \`process\`, \`require\`, \`import()\`, \`eval\`, \`fs\`, \`os\`,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-zt63krh7.mjs";
|
|
2
2
|
import {
|
|
3
3
|
entryCommand,
|
|
4
4
|
installedRuntime2,
|
|
5
5
|
installedVersion
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-0vy46qt0.mjs";
|
|
7
7
|
|
|
8
8
|
// src/mcp/supervisor.ts
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
@@ -33,7 +33,7 @@ async function runBinaryMcp(args) {
|
|
|
33
33
|
const runtime = installedRuntime2();
|
|
34
34
|
if (!runtime || runtime.kind === "npx") {
|
|
35
35
|
process.env[directEnvironmentVariable] = "1";
|
|
36
|
-
const { runCli } = await import("./cli-
|
|
36
|
+
const { runCli } = await import("./cli-6n92w2tr.mjs");
|
|
37
37
|
return runCli();
|
|
38
38
|
}
|
|
39
39
|
const REPLAY = "opencode-browser-shim-initialize";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
updateNotice2,
|
|
5
5
|
createUpdateWatcher2,
|
|
6
6
|
runUpdateCommand2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-vbwhrdcz.mjs";
|
|
8
8
|
import"./main-mrew6jy8.mjs";
|
|
9
|
-
import"./main-
|
|
10
|
-
import"./main-
|
|
9
|
+
import"./main-0vy46qt0.mjs";
|
|
10
|
+
import"./main-zt63krh7.mjs";
|
|
11
11
|
export {
|
|
12
12
|
createUpdateWatcher2 as createUpdateWatcher,
|
|
13
13
|
formatUpdateNotice2 as formatUpdateNotice,
|
package/package.json
CHANGED
package/skills/browse/SKILL.md
CHANGED
|
@@ -54,9 +54,16 @@ MCP: `session_adopt` with `tabId` or `targetUrl`. Prefer adoption for
|
|
|
54
54
|
authenticated browser state rather than reproducing a login in a fresh page.
|
|
55
55
|
`targetUrl` and `targetIndex` select existing pages; they never navigate.
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
One relay can have several browsers connected at once, each with an id like
|
|
58
|
+
`chrome-macbook`. New sessions use the default browser, the first connected and
|
|
59
|
+
ready, unless `session_new` or the first `execute` that creates it gets
|
|
60
|
+
`browser: "<id>"`. `status` lists the connected browsers (`browse status --json`
|
|
61
|
+
on the CLI). A session stays in its browser, so start a new one to use another.
|
|
62
|
+
|
|
63
|
+
The `browse` CLI cannot pick a browser: `session new` takes only `--read-only`
|
|
64
|
+
and `--allow-origin`, so CLI sessions use the default browser. `session_adopt`
|
|
65
|
+
has no `browser` either; to adopt a tab in another browser, run `session_new`
|
|
66
|
+
with `browser` first, then `session_adopt` in that session.
|
|
60
67
|
|
|
61
68
|
## Inspect, act, verify
|
|
62
69
|
|
|
@@ -207,6 +214,12 @@ values between calls on `state`. A single run without an `await` is stopped afte
|
|
|
207
214
|
about 2 seconds; split heavy loops with
|
|
208
215
|
`await new Promise(r => setTimeout(r, 0))` or do the work in the page.
|
|
209
216
|
|
|
217
|
+
Await promises: a rejection with no handler never stops the relay. A running call
|
|
218
|
+
gets the error; a later one resets the realm and warns on the next call (a
|
|
219
|
+
one-shot `--rm` session is already gone). Full Node mode has no realm to reset.
|
|
220
|
+
`await files.write(...)` and `await page.goto(...)` put the error in the call
|
|
221
|
+
that caused it.
|
|
222
|
+
|
|
210
223
|
It runs in a restricted JavaScript realm, not a sandbox. It shares the relay's
|
|
211
224
|
process, so it is not a security boundary: treat code as running as you. There
|
|
212
225
|
is no `process`, `require`, `import()`, `eval`, `fs`, `os`,
|
package/dist/main-6qsa4k93.mjs
DELETED