@howaboua/pi-browser 0.0.1 → 0.0.2
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 +7 -1
- package/README.md +2 -2
- package/dist/remote-worker.js +1 -1
- package/dist/src/cdp/evaluate.js +4 -4
- package/package.json +5 -5
- package/src/cdp/evaluate.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# @howaboua/pi-browser
|
|
2
2
|
|
|
3
|
+
## 0.0.2
|
|
4
|
+
|
|
5
|
+
- Keep tool results actionable.
|
|
6
|
+
|
|
7
|
+
- Browser evaluation errors preserve JavaScript exception details instead of a generic “Uncaught”.
|
|
8
|
+
- Skill path inventories omit installed dependencies; reference reads list only the requested sources instead of repeating the full inventory.
|
|
9
|
+
|
|
3
10
|
## 0.0.1
|
|
4
11
|
|
|
5
12
|
- Initial release of Browser, a persistent typed CDP tool for normal Pi, Code Mode, and Notebook Mode.
|
|
6
13
|
|
|
7
14
|
- Inspect existing browser tabs, follow references, find text, click, type, capture screenshots, and use raw CDP when needed.
|
|
8
15
|
- Connect to local or configured remote hosts, with aliases and worker setup managed through `/browser`.
|
|
9
|
-
|
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@ The extension is the TypeScript counterpart of Pi Codex's browser custom tool. I
|
|
|
10
10
|
pi install npm:@howaboua/pi-browser
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Requires Node.js 22.19 or newer and a Chrome-family browser with remote debugging enabled at `chrome://inspect/#remote-debugging`.
|
|
13
|
+
Requires Pi 0.84.3 or newer, Node.js 22.19 or newer, and a Chrome-family browser with remote debugging enabled at `chrome://inspect/#remote-debugging`.
|
|
14
14
|
|
|
15
|
-
Pi Codex 3.0.
|
|
15
|
+
Pi Codex 3.0.25 or newer is optional. Without it, Browser remains a normal top-level Pi tool. Do not load Pi Codex's example `browser.toml` custom tool alongside this extension.
|
|
16
16
|
|
|
17
17
|
## Use
|
|
18
18
|
|
package/dist/remote-worker.js
CHANGED
|
@@ -1527,7 +1527,7 @@ async function evaluate(cdp, sessionId, expression, signal) {
|
|
|
1527
1527
|
if (exception) {
|
|
1528
1528
|
const details = asRecord(exception, "Runtime exception");
|
|
1529
1529
|
const nested = details["exception"] && typeof details["exception"] === "object" && !Array.isArray(details["exception"]) ? details["exception"] : undefined;
|
|
1530
|
-
throw new Error(typeof
|
|
1530
|
+
throw new Error(typeof nested?.["description"] === "string" ? nested["description"] : typeof details["text"] === "string" ? details["text"] : "Runtime evaluation failed");
|
|
1531
1531
|
}
|
|
1532
1532
|
const result = asRecord(response["result"], "Runtime result");
|
|
1533
1533
|
return result["value"];
|
package/dist/src/cdp/evaluate.js
CHANGED
|
@@ -14,10 +14,10 @@ export async function evaluate(cdp, sessionId, expression, signal) {
|
|
|
14
14
|
!Array.isArray(details["exception"])
|
|
15
15
|
? details["exception"]
|
|
16
16
|
: undefined;
|
|
17
|
-
throw new Error(typeof
|
|
18
|
-
?
|
|
19
|
-
: typeof
|
|
20
|
-
?
|
|
17
|
+
throw new Error(typeof nested?.["description"] === "string"
|
|
18
|
+
? nested["description"]
|
|
19
|
+
: typeof details["text"] === "string"
|
|
20
|
+
? details["text"]
|
|
21
21
|
: "Runtime evaluation failed");
|
|
22
22
|
}
|
|
23
23
|
const result = asRecord(response["result"], "Runtime result");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howaboua/pi-browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Logged-in browser inspection and control for Pi, Code Mode and Notebook Mode.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"pack:dry": "npm pack --dry-run"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@howaboua/pi-codex-conversion": ">=3.0.
|
|
49
|
+
"@howaboua/pi-codex-conversion": ">=3.0.26",
|
|
50
50
|
"@earendil-works/pi-ai": ">=0.84.3",
|
|
51
51
|
"@earendil-works/pi-coding-agent": ">=0.84.3",
|
|
52
52
|
"typebox": "*",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@howaboua/pi-codex-conversion": "3.0.
|
|
61
|
+
"@howaboua/pi-codex-conversion": "3.0.26",
|
|
62
62
|
"@biomejs/biome": "^2.5.10",
|
|
63
|
-
"@earendil-works/pi-ai": "0.
|
|
64
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
63
|
+
"@earendil-works/pi-ai": "0.85.0",
|
|
64
|
+
"@earendil-works/pi-coding-agent": "0.85.0",
|
|
65
65
|
"@types/node": "^26.2.0",
|
|
66
66
|
"tsx": "^4.23.12",
|
|
67
67
|
"typebox": "1.3.18",
|
package/src/cdp/evaluate.ts
CHANGED
|
@@ -31,10 +31,10 @@ export async function evaluate(
|
|
|
31
31
|
? (details["exception"] as Record<string, unknown>)
|
|
32
32
|
: undefined;
|
|
33
33
|
throw new Error(
|
|
34
|
-
typeof
|
|
35
|
-
?
|
|
36
|
-
: typeof
|
|
37
|
-
?
|
|
34
|
+
typeof nested?.["description"] === "string"
|
|
35
|
+
? nested["description"]
|
|
36
|
+
: typeof details["text"] === "string"
|
|
37
|
+
? details["text"]
|
|
38
38
|
: "Runtime evaluation failed",
|
|
39
39
|
);
|
|
40
40
|
}
|