@howaboua/pi-browser 0.0.9 → 0.0.11
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/CHANGELOG.md +9 -4
- package/README.md +3 -1
- package/biome.json +1 -1
- package/dist/index.js +1 -0
- package/dist/remote-worker.js +5 -5
- package/dist/src/browser/help.js +7 -7
- package/index.ts +1 -0
- package/package.json +7 -7
- package/src/browser/help.ts +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @howaboua/pi-browser
|
|
2
2
|
|
|
3
|
+
## 0.0.11
|
|
4
|
+
|
|
5
|
+
- - Browser calls in Code and Notebook now return objects instead of JSON strings.
|
|
6
|
+
- GPT mode uses note-style browser help.
|
|
7
|
+
|
|
8
|
+
## 0.0.10
|
|
9
|
+
|
|
10
|
+
- Use denser browser help in PCC GPT prompt mode.
|
|
11
|
+
|
|
3
12
|
## 0.0.9
|
|
4
13
|
|
|
5
14
|
- Use consistent tool discovery across native, Code and Notebook modes, with compact help in PCC GPT prompt mode.
|
|
@@ -25,14 +34,12 @@
|
|
|
25
34
|
## 0.0.5
|
|
26
35
|
|
|
27
36
|
- Browser snapshots now include link destinations.
|
|
28
|
-
|
|
29
37
|
- Browser help and schemas now describe single-action requests, shared batch fields and JSON results with less repetition.
|
|
30
38
|
- Click errors now identify zero-sized browser viewports.
|
|
31
39
|
|
|
32
40
|
## 0.0.4
|
|
33
41
|
|
|
34
42
|
- Added session-owned background browser work and direct form controls.
|
|
35
|
-
|
|
36
43
|
- Fill or clear fields, select options, and set checkbox states, including indeterminate checkboxes.
|
|
37
44
|
- Press keys and shortcuts on the focused element.
|
|
38
45
|
- Wait for an element, page text, or URL with cancellation and a bounded timeout.
|
|
@@ -47,13 +54,11 @@
|
|
|
47
54
|
## 0.0.2
|
|
48
55
|
|
|
49
56
|
- Keep tool results actionable.
|
|
50
|
-
|
|
51
57
|
- Browser evaluation errors preserve JavaScript exception details instead of a generic “Uncaught”.
|
|
52
58
|
- Skill path inventories omit installed dependencies; reference reads list only the requested sources instead of repeating the full inventory.
|
|
53
59
|
|
|
54
60
|
## 0.0.1
|
|
55
61
|
|
|
56
62
|
- Initial release of Browser, a persistent typed CDP tool for normal Pi, Code Mode, and Notebook Mode.
|
|
57
|
-
|
|
58
63
|
- Inspect existing browser tabs, follow references, find text, click, type, capture screenshots, and use raw CDP when needed.
|
|
59
64
|
- Connect to local or configured remote hosts, with aliases and worker setup managed through `/browser`.
|
package/README.md
CHANGED
|
@@ -19,9 +19,11 @@ Pi Codex 3.0.52 or newer is optional. Without it, Browser remains a normal top-l
|
|
|
19
19
|
In normal Pi, call `browser` with `{}` for help, then send JSON request strings in `command`. Explicit `command: "help"` and existing object requests remain accepted. In Code or Notebook Mode, start with:
|
|
20
20
|
|
|
21
21
|
```js
|
|
22
|
-
await tools.browser()
|
|
22
|
+
await tools.browser();
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
Code and Notebook calls return objects directly. Remove `JSON.parse` around browser results in saved code and helpers.
|
|
26
|
+
|
|
25
27
|
All modes accept single-action and batched requests described by help. A common route is `tabs`, then `open`, then `click` or `type` with the returned `ref_id` and element ID.
|
|
26
28
|
|
|
27
29
|
Long Code and Notebook calls use the normal `exec` and `wait` lifecycle. Cancellation stops pending CDP work, though an already dispatched browser mutation may still take effect.
|
package/biome.json
CHANGED
package/dist/index.js
CHANGED
package/dist/remote-worker.js
CHANGED
|
@@ -1732,13 +1732,13 @@ async function discardCachedResult(handle) {
|
|
|
1732
1732
|
function browserHelp(hosts = [], gpt = false) {
|
|
1733
1733
|
const routed = hosts.length > 0;
|
|
1734
1734
|
return {
|
|
1735
|
-
input:
|
|
1735
|
+
input: "{action,...fields}",
|
|
1736
1736
|
...routed ? {
|
|
1737
|
-
host: `${hosts.join("|")}${gpt ? " optional;
|
|
1737
|
+
host: `${hosts.join("|")}${gpt ? " optional; user-named host→retain EVERY call+refs/handles" : " optional; keep a user-named host on every call and its refs/handles"}`
|
|
1738
1738
|
} : {},
|
|
1739
|
-
refs: "tabs -> open; keep ref_id/id/cursors with their result",
|
|
1740
|
-
safety: gpt ? "
|
|
1741
|
-
batch: gpt ? "{action_name:[{...fields}],...}; nonempty arrays
|
|
1739
|
+
refs: gpt ? "tabs→open; ref_id/id/cursors stay with result" : "tabs -> open; keep ref_id/id/cursors with their result",
|
|
1740
|
+
safety: gpt ? "Unfamiliar low-trust navigation/consequential action→ask UNLESS authorised; NEVER close shared browser" : "Ask before unfamiliar low-trust navigation or consequential action unless authorized; never close shared browser",
|
|
1741
|
+
batch: gpt ? "{action_name:[{...fields}],...}; nonempty arrays; omit item action; root host/response_length; independent ONLY" : "{action_name:[{...fields}],...}; nonempty arrays; items omit action; host/response_length at request root; independent only",
|
|
1742
1742
|
actions: {
|
|
1743
1743
|
help: "",
|
|
1744
1744
|
tabs: "query? offset? owned_only? -> ref_id title url owned",
|
package/dist/src/browser/help.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export function browserHelp(hosts = [], gpt = false) {
|
|
2
2
|
const routed = hosts.length > 0;
|
|
3
3
|
return {
|
|
4
|
-
input:
|
|
5
|
-
? "Request={action,...fields}; Pi {command:JSON.stringify(request)}; Code/Notebook JSON.stringify(request), JSON.parse(result)"
|
|
6
|
-
: "Request={action,...fields}; Pi: {command:JSON.stringify(request)}; Code/Notebook: JSON.stringify(request), JSON.parse(result)",
|
|
4
|
+
input: "{action,...fields}",
|
|
7
5
|
...(routed
|
|
8
6
|
? {
|
|
9
|
-
host: `${hosts.join("|")}${gpt ? " optional;
|
|
7
|
+
host: `${hosts.join("|")}${gpt ? " optional; user-named host→retain EVERY call+refs/handles" : " optional; keep a user-named host on every call and its refs/handles"}`,
|
|
10
8
|
}
|
|
11
9
|
: {}),
|
|
12
|
-
refs:
|
|
10
|
+
refs: gpt
|
|
11
|
+
? "tabs→open; ref_id/id/cursors stay with result"
|
|
12
|
+
: "tabs -> open; keep ref_id/id/cursors with their result",
|
|
13
13
|
safety: gpt
|
|
14
|
-
? "
|
|
14
|
+
? "Unfamiliar low-trust navigation/consequential action→ask UNLESS authorised; NEVER close shared browser"
|
|
15
15
|
: "Ask before unfamiliar low-trust navigation or consequential action unless authorized; never close shared browser",
|
|
16
16
|
batch: gpt
|
|
17
|
-
? "{action_name:[{...fields}],...}; nonempty arrays
|
|
17
|
+
? "{action_name:[{...fields}],...}; nonempty arrays; omit item action; root host/response_length; independent ONLY"
|
|
18
18
|
: "{action_name:[{...fields}],...}; nonempty arrays; items omit action; host/response_length at request root; independent only",
|
|
19
19
|
actions: {
|
|
20
20
|
help: "",
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howaboua/pi-browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Logged-in browser inspection and control for Pi, Code Mode and Notebook Mode.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"pack:dry": "npm pack --dry-run"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@howaboua/pi-codex-conversion": ">=4.0.
|
|
48
|
+
"@howaboua/pi-codex-conversion": ">=4.0.5",
|
|
49
49
|
"@earendil-works/pi-ai": ">=1.0.0",
|
|
50
50
|
"@earendil-works/pi-coding-agent": ">=1.0.0",
|
|
51
51
|
"typebox": "*",
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@howaboua/pi-codex-conversion": "4.0.
|
|
61
|
-
"@biomejs/biome": "^2.
|
|
62
|
-
"@earendil-works/pi-ai": "1.
|
|
63
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
60
|
+
"@howaboua/pi-codex-conversion": "4.0.5",
|
|
61
|
+
"@biomejs/biome": "^2.6.3",
|
|
62
|
+
"@earendil-works/pi-ai": "1.4.0",
|
|
63
|
+
"@earendil-works/pi-coding-agent": "1.4.0",
|
|
64
64
|
"@types/node": "^26.6.5",
|
|
65
|
-
"typebox": "1.3
|
|
65
|
+
"typebox": "1.4.3",
|
|
66
66
|
"typescript": "^7.0.2"
|
|
67
67
|
},
|
|
68
68
|
"pi": {
|
package/src/browser/help.ts
CHANGED
|
@@ -4,20 +4,20 @@ export function browserHelp(
|
|
|
4
4
|
): Record<string, unknown> {
|
|
5
5
|
const routed = hosts.length > 0;
|
|
6
6
|
return {
|
|
7
|
-
input:
|
|
8
|
-
? "Request={action,...fields}; Pi {command:JSON.stringify(request)}; Code/Notebook JSON.stringify(request), JSON.parse(result)"
|
|
9
|
-
: "Request={action,...fields}; Pi: {command:JSON.stringify(request)}; Code/Notebook: JSON.stringify(request), JSON.parse(result)",
|
|
7
|
+
input: "{action,...fields}",
|
|
10
8
|
...(routed
|
|
11
9
|
? {
|
|
12
|
-
host: `${hosts.join("|")}${gpt ? " optional;
|
|
10
|
+
host: `${hosts.join("|")}${gpt ? " optional; user-named host→retain EVERY call+refs/handles" : " optional; keep a user-named host on every call and its refs/handles"}`,
|
|
13
11
|
}
|
|
14
12
|
: {}),
|
|
15
|
-
refs:
|
|
13
|
+
refs: gpt
|
|
14
|
+
? "tabs→open; ref_id/id/cursors stay with result"
|
|
15
|
+
: "tabs -> open; keep ref_id/id/cursors with their result",
|
|
16
16
|
safety: gpt
|
|
17
|
-
? "
|
|
17
|
+
? "Unfamiliar low-trust navigation/consequential action→ask UNLESS authorised; NEVER close shared browser"
|
|
18
18
|
: "Ask before unfamiliar low-trust navigation or consequential action unless authorized; never close shared browser",
|
|
19
19
|
batch: gpt
|
|
20
|
-
? "{action_name:[{...fields}],...}; nonempty arrays
|
|
20
|
+
? "{action_name:[{...fields}],...}; nonempty arrays; omit item action; root host/response_length; independent ONLY"
|
|
21
21
|
: "{action_name:[{...fields}],...}; nonempty arrays; items omit action; host/response_length at request root; independent only",
|
|
22
22
|
actions: {
|
|
23
23
|
help: "",
|