@opencode/browse 0.0.14 → 0.0.15-dev.102
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-yfb0tpey.mjs → cli-9sgczzrw.mjs} +15 -15
- package/dist/cli.mjs +25 -19
- package/dist/{helpers-wmv2w09f.mjs → helpers-18tnh8f3.mjs} +3 -1
- package/dist/{main-tazq9tx0.mjs → main-0jyyvzkx.mjs} +2 -2
- package/dist/{main-4y53y07g.mjs → main-0wvv6nat.mjs} +23 -7
- package/dist/{main-c1pcfhv0.mjs → main-2rtwhyhh.mjs} +2 -2
- package/dist/{main-8a0bd051.mjs → main-80jesay1.mjs} +11 -4
- package/dist/{main-6d4whs59.mjs → main-8r1t7vba.mjs} +1 -1
- package/dist/main-aeg6a5nk.mjs +4 -0
- package/dist/main-ckssvk4c.mjs +18 -0
- package/dist/{main-k9w11hc3.mjs → main-ezf20xwm.mjs} +1 -1
- package/dist/{main-6a3ja0sq.mjs → main-f7qkgyz5.mjs} +30 -15
- package/dist/{main-brfzdj0f.mjs → main-qxer7zjj.mjs} +2 -2
- package/dist/{main-pyvdynkn.mjs → main-rz1540v9.mjs} +2 -2
- package/dist/{mcp-cv3ka7f7.mjs → mcp-rmj6h1s1.mjs} +6 -6
- package/dist/{migrate-6bw83m5v.mjs → migrate-xgnfe9c3.mjs} +10 -13
- package/dist/{relay-6h6vhd11.mjs → relay-5zw323v4.mjs} +499 -173
- package/dist/{runtime-update-xrak66a4.mjs → runtime-update-wn4gab74.mjs} +4 -4
- package/dist/{setup-y7z0dmhf.mjs → setup-6fa9eddq.mjs} +30 -11
- package/dist/{skill-text-mrxy6zpc.mjs → skill-text-v68nbc12.mjs} +20 -5
- package/dist/{supervisor-1y9j1tpk.mjs → supervisor-rce413ez.mjs} +3 -3
- package/dist/{update-cw10gp3w.mjs → update-g0qt4kea.mjs} +3 -3
- package/dist/{version-p978a2bv.mjs → version-kpv6469c.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +20 -5
- package/dist/main-pk9kkfhn.mjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-aeg6a5nk.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-0wvv6nat.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-80jesay1.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-ezf20xwm.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-f7qkgyz5.mjs";
|
|
65
67
|
import {
|
|
66
68
|
opencodeBrowserBuildId2
|
|
67
|
-
} from "./main-
|
|
69
|
+
} from "./main-aeg6a5nk.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-0wvv6nat.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-8r1t7vba.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-2rtwhyhh.mjs";
|
|
107
111
|
import {
|
|
108
112
|
relayAuthorization
|
|
109
|
-
} from "./main-
|
|
113
|
+
} from "./main-ezf20xwm.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\`,
|
|
@@ -381,8 +394,10 @@ Common diagnoses:
|
|
|
381
394
|
page. Running setup again does not reload older workers.
|
|
382
395
|
- \`Target not found\`: attach the intended tab, then select or adopt it by a
|
|
383
396
|
unique URL substring or explicit index.
|
|
384
|
-
-
|
|
385
|
-
tab
|
|
397
|
+
- Dismissing Chromium's debugging bar (Cancel in Chrome, OK in some browsers)
|
|
398
|
+
detaches every tab: browse no longer controls them. Tabs an agent opened stay
|
|
399
|
+
open and close when idle; ask the user to lend the tab again with the toolbar
|
|
400
|
+
button, or continue in a new tab. \`execute\` says when this happened.
|
|
386
401
|
- Repeated execution-context errors: run one short follow-up so browse can
|
|
387
402
|
health-check the page. A live page is reconnected and re-resolved once; a
|
|
388
403
|
crashed or \`chrome-error://\` relay-owned page is recreated. It never replaces
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import"./main-
|
|
1
|
+
import"./main-aeg6a5nk.mjs";
|
|
2
2
|
import {
|
|
3
3
|
entryCommand,
|
|
4
4
|
installedRuntime2,
|
|
5
5
|
installedVersion
|
|
6
|
-
} from "./main-
|
|
6
|
+
} from "./main-0wvv6nat.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-9sgczzrw.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-qxer7zjj.mjs";
|
|
8
8
|
import"./main-mrew6jy8.mjs";
|
|
9
|
-
import"./main-
|
|
10
|
-
import"./main-
|
|
9
|
+
import"./main-0wvv6nat.mjs";
|
|
10
|
+
import"./main-aeg6a5nk.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`,
|
|
@@ -380,8 +393,10 @@ Common diagnoses:
|
|
|
380
393
|
page. Running setup again does not reload older workers.
|
|
381
394
|
- `Target not found`: attach the intended tab, then select or adopt it by a
|
|
382
395
|
unique URL substring or explicit index.
|
|
383
|
-
-
|
|
384
|
-
tab
|
|
396
|
+
- Dismissing Chromium's debugging bar (Cancel in Chrome, OK in some browsers)
|
|
397
|
+
detaches every tab: browse no longer controls them. Tabs an agent opened stay
|
|
398
|
+
open and close when idle; ask the user to lend the tab again with the toolbar
|
|
399
|
+
button, or continue in a new tab. `execute` says when this happened.
|
|
385
400
|
- Repeated execution-context errors: run one short follow-up so browse can
|
|
386
401
|
health-check the page. A live page is reconnected and re-resolved once; a
|
|
387
402
|
crashed or `chrome-error://` relay-owned page is recreated. It never replaces
|
package/dist/main-pk9kkfhn.mjs
DELETED