@howaboua/pi-browser 0.0.3 → 0.0.4
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 +11 -0
- package/README.md +4 -0
- package/dist/index.js +2 -2
- package/dist/remote-worker.js +978 -136
- package/dist/src/browser/bounds.d.ts +1 -1
- package/dist/src/browser/bounds.js +6 -3
- package/dist/src/browser/help.js +8 -3
- package/dist/src/browser/operation-executor.js +15 -1
- package/dist/src/browser/operation.d.ts +25 -2
- package/dist/src/browser/operation.js +5 -0
- package/dist/src/browser/parse-operation.js +61 -2
- package/dist/src/browser/remote.d.ts +1 -1
- package/dist/src/browser/remote.js +2 -2
- package/dist/src/browser/runtime.d.ts +8 -3
- package/dist/src/browser/runtime.js +91 -25
- package/dist/src/browser/worker-server.js +12 -6
- package/dist/src/browser-parameters.d.ts +10 -0
- package/dist/src/browser-parameters.js +32 -0
- package/dist/src/browser-tool.d.ts +10 -0
- package/dist/src/browser-tool.js +2 -1
- package/dist/src/cdp/actions/click.d.ts +2 -0
- package/dist/src/cdp/actions/click.js +1 -1
- package/dist/src/cdp/actions/fill.d.ts +8 -0
- package/dist/src/cdp/actions/fill.js +175 -0
- package/dist/src/cdp/actions/key.d.ts +20 -0
- package/dist/src/cdp/actions/key.js +166 -0
- package/dist/src/cdp/actions/wait.d.ts +9 -0
- package/dist/src/cdp/actions/wait.js +95 -0
- package/dist/src/cdp/pages.d.ts +2 -1
- package/dist/src/cdp/pages.js +8 -4
- package/dist/src/cdp/session.d.ts +7 -1
- package/dist/src/cdp/session.js +79 -27
- package/dist/src/cdp/snapshot-contract.d.ts +4 -0
- package/dist/src/cdp/snapshot.js +67 -11
- package/dist/src/cdp/tabs.d.ts +32 -0
- package/dist/src/cdp/tabs.js +226 -0
- package/dist/src/cdp/types.d.ts +2 -0
- package/index.ts +2 -2
- package/package.json +5 -5
- package/src/browser/bounds.ts +7 -2
- package/src/browser/help.ts +8 -3
- package/src/browser/operation-executor.ts +34 -0
- package/src/browser/operation.ts +19 -1
- package/src/browser/parse-operation.ts +63 -2
- package/src/browser/remote.ts +2 -1
- package/src/browser/runtime.ts +115 -26
- package/src/browser/worker-server.ts +24 -7
- package/src/browser-parameters.ts +34 -0
- package/src/browser-tool.ts +2 -1
- package/src/cdp/actions/click.ts +1 -1
- package/src/cdp/actions/fill.ts +246 -0
- package/src/cdp/actions/key.ts +202 -0
- package/src/cdp/actions/wait.ts +117 -0
- package/src/cdp/pages.ts +9 -6
- package/src/cdp/session.ts +98 -46
- package/src/cdp/snapshot-contract.ts +4 -0
- package/src/cdp/snapshot.ts +86 -17
- package/src/cdp/tabs.ts +292 -0
- package/src/cdp/types.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @howaboua/pi-browser
|
|
2
2
|
|
|
3
|
+
## 0.0.4
|
|
4
|
+
|
|
5
|
+
- Added session-owned background browser work and direct form controls.
|
|
6
|
+
|
|
7
|
+
- Fill or clear fields, select options, and set checkbox states, including indeterminate checkboxes.
|
|
8
|
+
- Press keys and shortcuts on the focused element.
|
|
9
|
+
- Wait for an element, page text, or URL with cancellation and a bounded timeout.
|
|
10
|
+
- Page snapshots now report checked, selected, expanded, and disabled states.
|
|
11
|
+
- New tabs open in the background and keep rendering during control. Show them explicitly, list session-owned tabs, and close any tab by reference.
|
|
12
|
+
- Tab ownership survives reloads, worker restarts, and visits to hidden browser pages. Old ownership records expire after 30 days of inactivity. Concurrent Pi sessions keep separate element references.
|
|
13
|
+
|
|
3
14
|
## 0.0.3
|
|
4
15
|
|
|
5
16
|
- Removed redundant tool guidance from Ask, Shepherdr, Skills and Browser. Code and Notebook Mode now show one callable contract per tool, with detailed Browser and agent rules in help.
|
package/README.md
CHANGED
|
@@ -26,6 +26,10 @@ Normal Pi exposes the single-action contract. Code and Notebook Mode also accept
|
|
|
26
26
|
|
|
27
27
|
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.
|
|
28
28
|
|
|
29
|
+
New tabs open in the background and belong to the current Pi session. Owned tabs keep rendering during control without being brought forward. The agent can filter the tab list to its own tabs, show a tab when you want to see it, and close any tab by reference. Existing tabs remain accessible through their refs and are not silently claimed.
|
|
30
|
+
|
|
31
|
+
Ownership survives extension reloads and managed-worker restarts while the browser and local runtime state remain. Restarting the browser makes restored tabs shared again. Popups inherit ownership through Chrome's opener metadata, but can still take focus. This tool does not install a Chrome extension or create Chrome tab groups.
|
|
32
|
+
|
|
29
33
|
## Host routing
|
|
30
34
|
|
|
31
35
|
In Pi's interactive TUI, run `/browser`, add the SSH host names, identify the current machine, then save. Pi reloads the extension with the corresponding `host` choices. Advanced settings expose the remote Node command, which defaults to `node`.
|
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@ export default async function browserExtension(pi) {
|
|
|
20
20
|
registerBrowserCommand(pi);
|
|
21
21
|
pi.registerTool(tool);
|
|
22
22
|
const registration = await registerBrowserInCodeMode(pi, tool);
|
|
23
|
-
pi.on("session_shutdown", () => {
|
|
23
|
+
pi.on("session_shutdown", async () => {
|
|
24
24
|
registration?.unregister();
|
|
25
|
-
runtime.close();
|
|
25
|
+
await runtime.close();
|
|
26
26
|
});
|
|
27
27
|
if (configError) {
|
|
28
28
|
pi.on("session_start", (_event, ctx) => {
|