@opencode/browse 0.0.17-dev.167 → 0.0.17-dev.169
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-py6ebe02.mjs → cli-zx7g8fek.mjs} +12 -12
- package/dist/cli.mjs +12 -12
- package/dist/{helpers-mert7md7.mjs → helpers-nxtpzjhw.mjs} +1 -1
- package/dist/{legacy-runtime-de2sceym.mjs → legacy-runtime-rvcn5zs6.mjs} +4 -4
- package/dist/{main-fvr1t5a4.mjs → main-6k1dq78p.mjs} +3 -3
- package/dist/main-9xbcy9q0.mjs +4 -0
- package/dist/{main-bcjvvmxe.mjs → main-dwjfhfpm.mjs} +1 -1
- package/dist/{main-fj2kx39g.mjs → main-fs2ymcvd.mjs} +3 -3
- package/dist/{main-qnqvw9p4.mjs → main-gbq7c729.mjs} +3 -3
- package/dist/{main-r4edfgmd.mjs → main-h55dwr1s.mjs} +2 -2
- package/dist/{main-kw4xb98p.mjs → main-m3xnn0cx.mjs} +2 -2
- package/dist/{main-4gkh3htw.mjs → main-rvmzfmb7.mjs} +2 -2
- package/dist/{main-p86jpn82.mjs → main-sx7qpdfw.mjs} +1 -1
- package/dist/{main-avzqdpgh.mjs → main-w80ghbx8.mjs} +1 -1
- package/dist/{main-4g70hy05.mjs → main-wf904nhj.mjs} +2 -2
- package/dist/{mcp-kge733se.mjs → mcp-37b0xgq0.mjs} +9 -9
- package/dist/{migrate-mgj7s730.mjs → migrate-49s4pykq.mjs} +4 -4
- package/dist/{relay-wy7xbnc2.mjs → relay-jkgh5rzg.mjs} +7072 -6603
- package/dist/{runtime-update-vtwx1n3a.mjs → runtime-update-9d3dsv6t.mjs} +4 -4
- package/dist/{setup-zdma4gsz.mjs → setup-74nz1gqg.mjs} +7 -7
- package/dist/{skill-text-1707p2cn.mjs → skill-text-z1pce87x.mjs} +31 -7
- package/dist/{supervisor-t8jfk3km.mjs → supervisor-5pjptkgz.mjs} +3 -3
- package/dist/{update-1jana23v.mjs → update-n4sw8eht.mjs} +3 -3
- package/dist/{version-4are1pb8.mjs → version-2cadxvsa.mjs} +1 -1
- package/package.json +1 -1
- package/skills/browse/SKILL.md +31 -7
- package/dist/main-hkgd08wq.mjs +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import"./main-9bk4pprj.mjs";
|
|
2
2
|
import"./main-pmfd055v.mjs";
|
|
3
|
-
import"./main-
|
|
3
|
+
import"./main-9xbcy9q0.mjs";
|
|
4
4
|
import {
|
|
5
5
|
cliCommand,
|
|
6
6
|
installCommand,
|
|
@@ -18,17 +18,17 @@ import {
|
|
|
18
18
|
registryUrl,
|
|
19
19
|
fetchPublished,
|
|
20
20
|
runInstaller
|
|
21
|
-
} from "./main-
|
|
21
|
+
} from "./main-gbq7c729.mjs";
|
|
22
22
|
import"./main-b3jrctcx.mjs";
|
|
23
23
|
import {
|
|
24
24
|
Service,
|
|
25
25
|
layerFetch,
|
|
26
26
|
restartRelay,
|
|
27
27
|
startManagedRelay
|
|
28
|
-
} from "./main-
|
|
28
|
+
} from "./main-fs2ymcvd.mjs";
|
|
29
29
|
import"./main-4h7rfhhr.mjs";
|
|
30
30
|
import"./main-jf7jberd.mjs";
|
|
31
|
-
import"./main-
|
|
31
|
+
import"./main-w80ghbx8.mjs";
|
|
32
32
|
import {
|
|
33
33
|
succeed6,
|
|
34
34
|
gen,
|
|
@@ -63,11 +63,11 @@ import {
|
|
|
63
63
|
installRuntime,
|
|
64
64
|
installedRuntime,
|
|
65
65
|
manualMcpEntry
|
|
66
|
-
} from "./main-
|
|
66
|
+
} from "./main-6k1dq78p.mjs";
|
|
67
67
|
import"./main-pmfd055v.mjs";
|
|
68
68
|
import {
|
|
69
69
|
opencodeBrowserBuildId2
|
|
70
|
-
} from "./main-
|
|
70
|
+
} from "./main-9xbcy9q0.mjs";
|
|
71
71
|
import {
|
|
72
72
|
installedBinaryPath,
|
|
73
73
|
installerBinaryPath,
|
|
@@ -84,7 +84,7 @@ import {
|
|
|
84
84
|
autoUpdateStatus,
|
|
85
85
|
describeAutoUpdate,
|
|
86
86
|
runCommand
|
|
87
|
-
} from "./main-
|
|
87
|
+
} from "./main-gbq7c729.mjs";
|
|
88
88
|
import"./main-4h7rfhhr.mjs";
|
|
89
89
|
import {
|
|
90
90
|
pairingCodeTtlMs,
|
|
@@ -98,7 +98,7 @@ import {
|
|
|
98
98
|
revokeBrowserToken,
|
|
99
99
|
legacyPairingCode,
|
|
100
100
|
removeLegacyPairingCode
|
|
101
|
-
} from "./main-
|
|
101
|
+
} from "./main-dwjfhfpm.mjs";
|
|
102
102
|
import {
|
|
103
103
|
unpackedExtensionId,
|
|
104
104
|
extensionProtocolSkew,
|
|
@@ -107,16 +107,16 @@ import {
|
|
|
107
107
|
import"./main-tk4axre7.mjs";
|
|
108
108
|
import {
|
|
109
109
|
defaultSiteSecretsDir
|
|
110
|
-
} from "./main-
|
|
110
|
+
} from "./main-sx7qpdfw.mjs";
|
|
111
111
|
import {
|
|
112
112
|
parseHostname,
|
|
113
113
|
readRelayConfig,
|
|
114
114
|
writeRelayConfig,
|
|
115
115
|
syncDevExtension
|
|
116
|
-
} from "./main-
|
|
116
|
+
} from "./main-wf904nhj.mjs";
|
|
117
117
|
import {
|
|
118
118
|
relayAuthorization
|
|
119
|
-
} from "./main-
|
|
119
|
+
} from "./main-w80ghbx8.mjs";
|
|
120
120
|
|
|
121
121
|
// src/setup.ts
|
|
122
122
|
import { mkdirSync as mkdirSync2, rmSync as rmSync2, writeFileSync } from "node:fs";
|
|
@@ -120,12 +120,25 @@ Useful inspection helpers:
|
|
|
120
120
|
one-time-code and card fields (\`autocomplete\` \`cc-number\`, \`cc-csc\`,
|
|
121
121
|
\`cc-exp*\`); other readonly fields show their value, so a generated address or
|
|
122
122
|
code is readable. A field the page locks after you type into it counts as
|
|
123
|
-
readonly.
|
|
123
|
+
readonly. Visible iframes appear as \`iframe\` lines with their own documents
|
|
124
|
+
nested under them, same-origin and cross-origin alike, up to 8 frames three
|
|
125
|
+
levels deep; iframe elements under 20px in both directions are skipped. So a
|
|
126
|
+
dialog whose form lives in a payment iframe is readable without
|
|
127
|
+
\`page.frames()\`; pass \`snapshot({ frames: false })\` to leave iframe content
|
|
128
|
+
out. \`snapshot({ find: /checkout/i, context: 2 })\` searches it, and
|
|
124
129
|
\`snapshot({ diff: true })\` or \`{ delta: true }\` reports changes.
|
|
125
|
-
- \`ref("e12")\` resolves a control from the latest snapshot
|
|
126
|
-
|
|
130
|
+
- \`ref("e12")\` resolves a control from the latest snapshot, including controls
|
|
131
|
+
inside an iframe: those refs resolve in that frame and fail closed when the
|
|
132
|
+
frame navigates. Refs fail closed after navigation or incompatible DOM drift;
|
|
133
|
+
compatible refs keep their ids. \`snapshot({ within: page.frameLocator(...) })\`
|
|
134
|
+
captures a frame and its refs resolve there.
|
|
127
135
|
- \`ariaSnapshot(target?, { timeout })\` returns Playwright's detailed YAML tree
|
|
128
|
-
when the compact snapshot omits needed structure.
|
|
136
|
+
when the compact snapshot omits needed structure. The tree keeps Playwright's
|
|
137
|
+
anonymous \`- iframe\` lines, and each iframe's document follows it as a
|
|
138
|
+
labelled block in document order (\`- iframe "name" [src=host]:\`, with nested
|
|
139
|
+
frames as further labelled blocks). It applies the same value hiding in
|
|
140
|
+
every frame; a frame it cannot read becomes a note, and if it cannot confirm
|
|
141
|
+
that redaction was removed the call fails rather than return values.
|
|
129
142
|
- \`screenshotWithLabels({ page?, path? })\` adds visual labels when layout
|
|
130
143
|
matters and registers its labels for \`ref()\`.
|
|
131
144
|
- \`screenshotDiff({ baseline, path?, threshold?, fullPage? })\` compares a saved
|
|
@@ -242,7 +255,10 @@ is no \`process\`, \`require\`, \`import()\`, \`eval\`, \`fs\`, \`os\`,
|
|
|
242
255
|
Files go through \`files\` and Playwright file options, which accept absolute paths
|
|
243
256
|
inside the execute file roots (the temp directory, \`/tmp\`, and directories in
|
|
244
257
|
\`OPENCODE_BROWSER_FILE_ROOTS\`); raw CDP commands that name local files are
|
|
245
|
-
checked the same way
|
|
258
|
+
checked the same way. Every existing folder and file between the root and the
|
|
259
|
+
target must be owned by you and not group/world writable, and a file or folder
|
|
260
|
+
directly in a shared root like \`/tmp\` is refused; \`files.path(name)\`, which
|
|
261
|
+
points into \`files.dir\`, is the easy way:
|
|
246
262
|
|
|
247
263
|
\`\`\`js
|
|
248
264
|
const saved = await files.write("report.csv", csvText)
|
|
@@ -264,6 +280,14 @@ Cookie access is limited to the hosts of the session's pages, and
|
|
|
264
280
|
\`page.bringToFront()\` is refused because it raises the user's window; use
|
|
265
281
|
\`handoff()\` when the user needs to act.
|
|
266
282
|
|
|
283
|
+
Clipboard calls in a frame need that frame focused: in the same \`frame.evaluate\`,
|
|
284
|
+
call \`window.focus()\` before \`navigator.clipboard\` (or click in the frame first).
|
|
285
|
+
A cross-origin iframe also needs \`allow="clipboard-write"\` (or \`clipboard-read\`)
|
|
286
|
+
from its parent; without it Chrome refuses the call and nothing in the frame can
|
|
287
|
+
fix that, so write from the top page or read the value from the DOM instead.
|
|
288
|
+
Clipboard reads usually ask the user for permission, so use \`handoff()\` or avoid
|
|
289
|
+
them. \`context.grantPermissions()\` is refused, so don't try it.
|
|
290
|
+
|
|
267
291
|
The page's console messages and uncaught errors are off by default because
|
|
268
292
|
capturing them lets the page detect a debugger. Turn them on for one page when
|
|
269
293
|
debugging, then turn them off:
|
|
@@ -318,8 +342,8 @@ Never globally auto-accept native dialogs.
|
|
|
318
342
|
|
|
319
343
|
browse refuses navigations to \`file:\`, \`chrome:\`, \`chrome-extension:\`,
|
|
320
344
|
\`devtools:\` and \`view-source:\` URLs, and blocks CDP commands that would destroy
|
|
321
|
-
shared browser state, including browser close
|
|
322
|
-
work around those guardrails.
|
|
345
|
+
shared browser state, including browser close, cookie/cache clearing, and
|
|
346
|
+
granting or changing site permissions. Never work around those guardrails.
|
|
323
347
|
|
|
324
348
|
Every execute is journaled under \`<state root>/sessions/<id>/journal.jsonl\`
|
|
325
349
|
(\`~/.local/state/browse\` on macOS and Linux). Never place credentials
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import"./main-pmfd055v.mjs";
|
|
2
|
-
import"./main-
|
|
2
|
+
import"./main-9xbcy9q0.mjs";
|
|
3
3
|
import {
|
|
4
4
|
entrySpawnCommand,
|
|
5
5
|
installedRuntime2,
|
|
6
6
|
installedVersion
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-gbq7c729.mjs";
|
|
8
8
|
|
|
9
9
|
// src/mcp/supervisor.ts
|
|
10
10
|
import { spawn } from "node:child_process";
|
|
@@ -35,7 +35,7 @@ async function runBinaryMcp(args) {
|
|
|
35
35
|
const runtime = installedRuntime2();
|
|
36
36
|
if (!runtime || runtime.kind === "npx") {
|
|
37
37
|
process.env[directEnvironmentVariable] = "1";
|
|
38
|
-
const { runCli } = await import("./cli-
|
|
38
|
+
const { runCli } = await import("./cli-zx7g8fek.mjs");
|
|
39
39
|
return runCli();
|
|
40
40
|
}
|
|
41
41
|
const REPLAY = `opencode-browser-shim-initialize-${randomUUID()}`;
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
updateNotice2,
|
|
5
5
|
createUpdateWatcher2,
|
|
6
6
|
runUpdateCommand2
|
|
7
|
-
} from "./main-
|
|
7
|
+
} from "./main-h55dwr1s.mjs";
|
|
8
8
|
import"./main-b3jrctcx.mjs";
|
|
9
|
-
import"./main-
|
|
9
|
+
import"./main-gbq7c729.mjs";
|
|
10
10
|
import"./main-pmfd055v.mjs";
|
|
11
|
-
import"./main-
|
|
11
|
+
import"./main-9xbcy9q0.mjs";
|
|
12
12
|
export {
|
|
13
13
|
createUpdateWatcher2 as createUpdateWatcher,
|
|
14
14
|
formatUpdateNotice2 as formatUpdateNotice,
|
package/package.json
CHANGED
package/skills/browse/SKILL.md
CHANGED
|
@@ -119,12 +119,25 @@ Useful inspection helpers:
|
|
|
119
119
|
one-time-code and card fields (`autocomplete` `cc-number`, `cc-csc`,
|
|
120
120
|
`cc-exp*`); other readonly fields show their value, so a generated address or
|
|
121
121
|
code is readable. A field the page locks after you type into it counts as
|
|
122
|
-
readonly.
|
|
122
|
+
readonly. Visible iframes appear as `iframe` lines with their own documents
|
|
123
|
+
nested under them, same-origin and cross-origin alike, up to 8 frames three
|
|
124
|
+
levels deep; iframe elements under 20px in both directions are skipped. So a
|
|
125
|
+
dialog whose form lives in a payment iframe is readable without
|
|
126
|
+
`page.frames()`; pass `snapshot({ frames: false })` to leave iframe content
|
|
127
|
+
out. `snapshot({ find: /checkout/i, context: 2 })` searches it, and
|
|
123
128
|
`snapshot({ diff: true })` or `{ delta: true }` reports changes.
|
|
124
|
-
- `ref("e12")` resolves a control from the latest snapshot
|
|
125
|
-
|
|
129
|
+
- `ref("e12")` resolves a control from the latest snapshot, including controls
|
|
130
|
+
inside an iframe: those refs resolve in that frame and fail closed when the
|
|
131
|
+
frame navigates. Refs fail closed after navigation or incompatible DOM drift;
|
|
132
|
+
compatible refs keep their ids. `snapshot({ within: page.frameLocator(...) })`
|
|
133
|
+
captures a frame and its refs resolve there.
|
|
126
134
|
- `ariaSnapshot(target?, { timeout })` returns Playwright's detailed YAML tree
|
|
127
|
-
when the compact snapshot omits needed structure.
|
|
135
|
+
when the compact snapshot omits needed structure. The tree keeps Playwright's
|
|
136
|
+
anonymous `- iframe` lines, and each iframe's document follows it as a
|
|
137
|
+
labelled block in document order (`- iframe "name" [src=host]:`, with nested
|
|
138
|
+
frames as further labelled blocks). It applies the same value hiding in
|
|
139
|
+
every frame; a frame it cannot read becomes a note, and if it cannot confirm
|
|
140
|
+
that redaction was removed the call fails rather than return values.
|
|
128
141
|
- `screenshotWithLabels({ page?, path? })` adds visual labels when layout
|
|
129
142
|
matters and registers its labels for `ref()`.
|
|
130
143
|
- `screenshotDiff({ baseline, path?, threshold?, fullPage? })` compares a saved
|
|
@@ -241,7 +254,10 @@ is no `process`, `require`, `import()`, `eval`, `fs`, `os`,
|
|
|
241
254
|
Files go through `files` and Playwright file options, which accept absolute paths
|
|
242
255
|
inside the execute file roots (the temp directory, `/tmp`, and directories in
|
|
243
256
|
`OPENCODE_BROWSER_FILE_ROOTS`); raw CDP commands that name local files are
|
|
244
|
-
checked the same way
|
|
257
|
+
checked the same way. Every existing folder and file between the root and the
|
|
258
|
+
target must be owned by you and not group/world writable, and a file or folder
|
|
259
|
+
directly in a shared root like `/tmp` is refused; `files.path(name)`, which
|
|
260
|
+
points into `files.dir`, is the easy way:
|
|
245
261
|
|
|
246
262
|
```js
|
|
247
263
|
const saved = await files.write("report.csv", csvText)
|
|
@@ -263,6 +279,14 @@ Cookie access is limited to the hosts of the session's pages, and
|
|
|
263
279
|
`page.bringToFront()` is refused because it raises the user's window; use
|
|
264
280
|
`handoff()` when the user needs to act.
|
|
265
281
|
|
|
282
|
+
Clipboard calls in a frame need that frame focused: in the same `frame.evaluate`,
|
|
283
|
+
call `window.focus()` before `navigator.clipboard` (or click in the frame first).
|
|
284
|
+
A cross-origin iframe also needs `allow="clipboard-write"` (or `clipboard-read`)
|
|
285
|
+
from its parent; without it Chrome refuses the call and nothing in the frame can
|
|
286
|
+
fix that, so write from the top page or read the value from the DOM instead.
|
|
287
|
+
Clipboard reads usually ask the user for permission, so use `handoff()` or avoid
|
|
288
|
+
them. `context.grantPermissions()` is refused, so don't try it.
|
|
289
|
+
|
|
266
290
|
The page's console messages and uncaught errors are off by default because
|
|
267
291
|
capturing them lets the page detect a debugger. Turn them on for one page when
|
|
268
292
|
debugging, then turn them off:
|
|
@@ -317,8 +341,8 @@ Never globally auto-accept native dialogs.
|
|
|
317
341
|
|
|
318
342
|
browse refuses navigations to `file:`, `chrome:`, `chrome-extension:`,
|
|
319
343
|
`devtools:` and `view-source:` URLs, and blocks CDP commands that would destroy
|
|
320
|
-
shared browser state, including browser close
|
|
321
|
-
work around those guardrails.
|
|
344
|
+
shared browser state, including browser close, cookie/cache clearing, and
|
|
345
|
+
granting or changing site permissions. Never work around those guardrails.
|
|
322
346
|
|
|
323
347
|
Every execute is journaled under `<state root>/sessions/<id>/journal.jsonl`
|
|
324
348
|
(`~/.local/state/browse` on macOS and Linux). Never place credentials
|
package/dist/main-hkgd08wq.mjs
DELETED