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.
Files changed (41) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.en.md +62 -491
  3. package/README.md +44 -470
  4. package/client.js +10 -10
  5. package/cordis.patch.yml +4 -4
  6. package/desktop-bridge/plugin-browser-bridge.js +1 -1
  7. package/docs/README.md +8 -4
  8. package/docs/architecture.md +82 -11
  9. package/docs/development.md +38 -0
  10. package/docs/limitations.md +49 -0
  11. package/docs/tool-reference.md +42 -42
  12. package/docs/user-guide.md +93 -37
  13. package/docs/why-browser.md +3 -3
  14. package/lib/browser/types.d.ts +2 -2
  15. package/lib/browser-electron/entry.d.ts +2 -2
  16. package/lib/browser-electron/entry.js +1 -1
  17. package/lib/browser-electron/history-store.d.ts +1 -1
  18. package/lib/browser-electron/history-store.js +1 -1
  19. package/lib/browser-electron/host-main.js +3 -3
  20. package/lib/browser-electron/provider.d.ts +9 -9
  21. package/lib/browser-electron/provider.js +14 -14
  22. package/lib/browser-electron/remote-host.js +1 -1
  23. package/lib/browser-electron/settings-store.d.ts +4 -4
  24. package/lib/index.d.ts +1 -1
  25. package/lib/index.js +1 -1
  26. package/lib/tool-browser/element-fields.d.ts +4 -4
  27. package/lib/tool-browser/element-fields.js +6 -6
  28. package/lib/tool-browser/index.d.ts +6 -6
  29. package/lib/tool-browser/index.js +161 -139
  30. package/package.json +2 -2
  31. package/scripts/verify-host-compat.mjs +6 -6
  32. package/src/browser/types.ts +2 -2
  33. package/src/browser-electron/entry.ts +2 -2
  34. package/src/browser-electron/history-store.ts +1 -1
  35. package/src/browser-electron/host-main.ts +3 -3
  36. package/src/browser-electron/provider.ts +15 -15
  37. package/src/browser-electron/remote-host.ts +1 -1
  38. package/src/browser-electron/settings-store.ts +4 -4
  39. package/src/index.ts +1 -1
  40. package/src/tool-browser/element-fields.ts +6 -6
  41. 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
- * - `browser_a11y`'s `selector` — computed by the provider, declared by the schema,
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
- * - `browser_screenshot`'s `width`/`height` — measured by the provider, declared by the
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 `browser_snapshot` / `browser_open`'s `elements`.
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 `browser_a11y`'s `nodes`.
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 browser_snapshot and browser_open.
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 browser_a11y.
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`: `browser_open`,
3
- * `browser_snapshot`, `browser_execute`, `browser_content`,
4
- * `browser_screenshot`, and tab management (`browser_list_tabs`,
5
- * `browser_switch_tab`, `browser_close_tab`, `browser_reset`).
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
- * `browser_open` (or any tool when no session exists) opens it, and later
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. browser_restrict
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>;