dsh-builtin-browser 0.4.7 → 0.4.8
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 +28 -0
- package/README.en.md +62 -491
- package/README.md +44 -470
- package/client.js +10 -10
- package/cordis.patch.yml +4 -4
- package/desktop-bridge/plugin-browser-bridge.js +1 -1
- package/docs/README.md +8 -4
- package/docs/architecture.md +82 -11
- package/docs/development.md +38 -0
- package/docs/limitations.md +49 -0
- package/docs/tool-reference.md +42 -42
- package/docs/user-guide.md +93 -37
- package/docs/why-browser.md +3 -3
- package/lib/browser/types.d.ts +2 -2
- package/lib/browser-electron/entry.d.ts +2 -2
- package/lib/browser-electron/entry.js +1 -1
- package/lib/browser-electron/history-store.d.ts +1 -1
- package/lib/browser-electron/history-store.js +1 -1
- package/lib/browser-electron/host-main.js +3 -3
- package/lib/browser-electron/provider.d.ts +9 -9
- package/lib/browser-electron/provider.js +14 -14
- package/lib/browser-electron/remote-host.js +1 -1
- package/lib/browser-electron/settings-store.d.ts +4 -4
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/tool-browser/element-fields.d.ts +4 -4
- package/lib/tool-browser/element-fields.js +6 -6
- package/lib/tool-browser/index.d.ts +6 -6
- package/lib/tool-browser/index.js +161 -139
- package/package.json +2 -2
- package/scripts/verify-host-compat.mjs +6 -6
- package/src/browser/types.ts +2 -2
- package/src/browser-electron/entry.ts +2 -2
- package/src/browser-electron/history-store.ts +1 -1
- package/src/browser-electron/host-main.ts +3 -3
- package/src/browser-electron/provider.ts +15 -15
- package/src/browser-electron/remote-host.ts +1 -1
- package/src/browser-electron/settings-store.ts +4 -4
- package/src/index.ts +1 -1
- package/src/tool-browser/element-fields.ts +6 -6
- package/src/tool-browser/index.ts +164 -140
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* and the tool's `output.schema` declared the properties. Nothing connected them, and the
|
|
9
9
|
* result is this project's most repeatable bug:
|
|
10
10
|
*
|
|
11
|
-
* - `
|
|
11
|
+
* - `dsh_browser_a11y`'s `selector` — computed by the provider, declared by the schema,
|
|
12
12
|
* printed by the renderer, and dropped by the projection. 134 tests stayed green.
|
|
13
|
-
* - `
|
|
13
|
+
* - `dsh_browser_screenshot`'s `width`/`height` — measured by the provider, declared by the
|
|
14
14
|
* schema, and dropped by the projection. 172 tests stayed green. It was found a round
|
|
15
15
|
* later, by reading the three places that agree and noticing the fourth did not.
|
|
16
16
|
*
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* projection forgets is silently dropped. One table cannot get either wrong on its own.
|
|
25
25
|
*/
|
|
26
26
|
/**
|
|
27
|
-
* The fields of one entry in `
|
|
27
|
+
* The fields of one entry in `dsh_browser_snapshot` / `dsh_browser_open`'s `elements`.
|
|
28
28
|
*
|
|
29
29
|
* `selector` is the reason this file exists; see the header. It was added to the schema and
|
|
30
30
|
* the projection separately, and only one of them landed.
|
|
@@ -39,7 +39,7 @@ const ELEMENT_FIELDS = {
|
|
|
39
39
|
frame: { schema: { type: 'boolean' } },
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
|
-
* The fields of one entry in `
|
|
42
|
+
* The fields of one entry in `dsh_browser_a11y`'s `nodes`.
|
|
43
43
|
*
|
|
44
44
|
* Different shape from an element on purpose: a role and an accessible name carry meaning a
|
|
45
45
|
* tag and a label string do not, and `depth` is what renders the tree.
|
|
@@ -80,7 +80,7 @@ function project(fields, source) {
|
|
|
80
80
|
return out;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
* The `elements` item schema for
|
|
83
|
+
* The `elements` item schema for dsh_browser_snapshot and dsh_browser_open.
|
|
84
84
|
*
|
|
85
85
|
* Written as a literal rather than generated, because `defineTool` validates the output schema
|
|
86
86
|
* against its own `ValueSchemaSpec` and a generated `Record<string, …>` is too wide to satisfy
|
|
@@ -102,7 +102,7 @@ export const ELEMENT_ITEM_SCHEMA = {
|
|
|
102
102
|
},
|
|
103
103
|
};
|
|
104
104
|
/**
|
|
105
|
-
* The `nodes` item schema for
|
|
105
|
+
* The `nodes` item schema for dsh_browser_a11y.
|
|
106
106
|
*
|
|
107
107
|
* Same reasoning as {@link ELEMENT_ITEM_SCHEMA}: literal for the type checker, table-backed by
|
|
108
108
|
* test.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Model-facing browser tools over `ctx.browser`: `
|
|
3
|
-
* `
|
|
4
|
-
* `
|
|
5
|
-
* `
|
|
2
|
+
* Model-facing browser tools over `ctx.browser`: `dsh_browser_open`,
|
|
3
|
+
* `dsh_browser_snapshot`, `dsh_browser_execute`, `dsh_browser_content`,
|
|
4
|
+
* `dsh_browser_screenshot`, and tab management (`dsh_browser_list_tabs`,
|
|
5
|
+
* `dsh_browser_switch_tab`, `dsh_browser_close_tab`, `dsh_browser_reset`).
|
|
6
6
|
*
|
|
7
7
|
* The tool layer owns only the model-facing schema, argument validation, and
|
|
8
8
|
* result formatting — never provider selection or page driving, which belong
|
|
9
9
|
* to the seam. Session lifecycle is owned here at the plugin level: each
|
|
10
10
|
* calling task (a DSH session) gets its own browser session — the first
|
|
11
|
-
* `
|
|
11
|
+
* `dsh_browser_open` (or any tool when no session exists) opens it, and later
|
|
12
12
|
* tools in the same task reuse it. Concurrent tasks therefore never fight
|
|
13
13
|
* over tabs, history, or navigation state.
|
|
14
14
|
* @module dsh-browser/tool-browser
|
|
@@ -38,7 +38,7 @@ export interface Config {
|
|
|
38
38
|
* Tools that only observe, plus the ones that undo a restriction.
|
|
39
39
|
*
|
|
40
40
|
* Never subject to an allow-list: restricting what the agent may *do* must not also
|
|
41
|
-
* blind it or trap it, and the tool descriptions promise as much.
|
|
41
|
+
* blind it or trap it, and the tool descriptions promise as much. dsh_browser_restrict
|
|
42
42
|
* is in here so a task that restricted everything can still lift it.
|
|
43
43
|
*/
|
|
44
44
|
export declare const READ_ONLY_TOOLS: ReadonlySet<string>;
|