@howaboua/pi-browser 0.0.12 → 0.0.13
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 +4 -0
- package/extension.ts +35 -0
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
package/extension.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineTool, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { Type } from "typebox";
|
|
3
|
+
import {
|
|
4
|
+
readBrowserRouteConfig,
|
|
5
|
+
readBrowserVoiceOnly,
|
|
6
|
+
} from "./src/browser/config.js";
|
|
7
|
+
import { registerBrowserCommand } from "./src/browser/settings.js";
|
|
8
|
+
|
|
9
|
+
/** Keep the normal browser graph out of Pi until the tool is enabled. */
|
|
10
|
+
export default async function browserExtension(
|
|
11
|
+
pi: ExtensionAPI,
|
|
12
|
+
): Promise<void> {
|
|
13
|
+
let voiceOnly = false;
|
|
14
|
+
try {
|
|
15
|
+
voiceOnly = readBrowserVoiceOnly();
|
|
16
|
+
} catch {
|
|
17
|
+
// Normal registration reports invalid configuration and retains local access.
|
|
18
|
+
}
|
|
19
|
+
if (voiceOnly) {
|
|
20
|
+
registerBrowserCommand(pi);
|
|
21
|
+
try {
|
|
22
|
+
readBrowserRouteConfig();
|
|
23
|
+
} catch (error) {
|
|
24
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
25
|
+
pi.on("session_start", (_event, ctx) => {
|
|
26
|
+
ctx.ui.notify(`${message}. Run /browser to repair it.`, "warning");
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const { default: registerBrowser } = await import(
|
|
32
|
+
"./src/browser-registration.js"
|
|
33
|
+
);
|
|
34
|
+
await registerBrowser(pi, { defineTool, Type });
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@howaboua/pi-browser",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Logged-in browser inspection and control for Pi, Code Mode and Notebook Mode.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"files": [
|
|
27
27
|
"dist/**/*.js",
|
|
28
28
|
"dist/**/*.d.ts",
|
|
29
|
+
"extension.ts",
|
|
29
30
|
"index.ts",
|
|
30
31
|
"remote-worker.ts",
|
|
31
32
|
"src",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"pack:dry": "npm pack --dry-run"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
48
|
-
"@howaboua/pi-codex-conversion": ">=4.0.
|
|
49
|
+
"@howaboua/pi-codex-conversion": ">=4.0.7",
|
|
49
50
|
"@earendil-works/pi-ai": ">=1.0.0",
|
|
50
51
|
"@earendil-works/pi-coding-agent": ">=1.0.0",
|
|
51
52
|
"typebox": "*",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
}
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
|
-
"@howaboua/pi-codex-conversion": "4.0.
|
|
61
|
+
"@howaboua/pi-codex-conversion": "4.0.7",
|
|
61
62
|
"@biomejs/biome": "^2.6.3",
|
|
62
63
|
"@earendil-works/pi-ai": "1.4.0",
|
|
63
64
|
"@earendil-works/pi-coding-agent": "1.4.0",
|
|
@@ -68,7 +69,7 @@
|
|
|
68
69
|
"pi": {
|
|
69
70
|
"extensions": [
|
|
70
71
|
"./changelog.ts",
|
|
71
|
-
"./
|
|
72
|
+
"./extension.ts"
|
|
72
73
|
]
|
|
73
74
|
},
|
|
74
75
|
"engines": {
|