@jobshimo/browser-link 0.36.0 → 0.38.0
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/dist/agent-instructions/content.js +5 -349
- package/dist/agent-instructions/content.js.map +1 -1
- package/dist/bridge/server.d.ts +5 -0
- package/dist/bridge/server.js +1 -1
- package/dist/bridge/server.js.map +1 -1
- package/dist/cdp/flow.d.ts +44 -3
- package/dist/cdp/flow.js +65 -19
- package/dist/cdp/flow.js.map +1 -1
- package/dist/cdp/inpage/builders.d.ts +110 -24
- package/dist/cdp/inpage/builders.js +203 -53
- package/dist/cdp/inpage/builders.js.map +1 -1
- package/dist/cdp/inpage/deep-query.d.ts +1 -1
- package/dist/cdp/inpage/deep-query.js +12 -9
- package/dist/cdp/inpage/deep-query.js.map +1 -1
- package/dist/cdp/inpage/observer.d.ts +36 -7
- package/dist/cdp/inpage/observer.js +242 -16
- package/dist/cdp/inpage/observer.js.map +1 -1
- package/dist/cdp/transport.js +96 -9
- package/dist/cdp/transport.js.map +1 -1
- package/dist/commands/about.js +4 -2
- package/dist/commands/about.js.map +1 -1
- package/dist/extension/background.js +97 -13
- package/dist/extension/background.js.map +1 -1
- package/dist/extension/flow.d.ts +44 -3
- package/dist/extension/flow.js +65 -19
- package/dist/extension/flow.js.map +1 -1
- package/dist/extension/inpage/builders.d.ts +110 -24
- package/dist/extension/inpage/builders.js +203 -53
- package/dist/extension/inpage/builders.js.map +1 -1
- package/dist/extension/inpage/deep-query.d.ts +1 -1
- package/dist/extension/inpage/deep-query.js +12 -9
- package/dist/extension/inpage/deep-query.js.map +1 -1
- package/dist/extension/inpage/observer.d.ts +36 -7
- package/dist/extension/inpage/observer.js +242 -16
- package/dist/extension/inpage/observer.js.map +1 -1
- package/dist/extension/manifest.json +1 -1
- package/dist/manual/core.d.ts +20 -0
- package/dist/manual/core.js +71 -0
- package/dist/manual/core.js.map +1 -0
- package/dist/manual/render.d.ts +22 -0
- package/dist/manual/render.js +56 -0
- package/dist/manual/render.js.map +1 -0
- package/dist/manual/status.d.ts +23 -0
- package/dist/manual/status.js +52 -0
- package/dist/manual/status.js.map +1 -0
- package/dist/manual/tool.d.ts +20 -0
- package/dist/manual/tool.js +106 -0
- package/dist/manual/tool.js.map +1 -0
- package/dist/manual/topics.d.ts +18 -0
- package/dist/manual/topics.js +60 -0
- package/dist/manual/topics.js.map +1 -0
- package/dist/map/queries.d.ts +2 -0
- package/dist/map/queries.js +23 -1
- package/dist/map/queries.js.map +1 -1
- package/dist/map/tools.js +26 -4
- package/dist/map/tools.js.map +1 -1
- package/dist/permissions.js +6 -0
- package/dist/permissions.js.map +1 -1
- package/dist/server.js +11 -14
- package/dist/server.js.map +1 -1
- package/dist/tools/browser-definitions.js +113 -23
- package/dist/tools/browser-definitions.js.map +1 -1
- package/dist/tools/browser-dispatch.d.ts +24 -26
- package/dist/tools/browser-dispatch.js +169 -14
- package/dist/tools/browser-dispatch.js.map +1 -1
- package/dist/tools/server-instructions.d.ts +24 -13
- package/dist/tools/server-instructions.js +25 -303
- package/dist/tools/server-instructions.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { renderInstallBody } from '../manual/render.js';
|
|
1
2
|
import { VERSION } from '../version.js';
|
|
2
3
|
/**
|
|
3
4
|
* The block we drop into each agent's global instructions markdown file.
|
|
@@ -22,356 +23,11 @@ export function beginMarker(version = VERSION) {
|
|
|
22
23
|
* `version` as `string | undefined`). */
|
|
23
24
|
export const BEGIN_RE = /<!--\s*browser-link:instructions:begin(?:\s+v(?<version>\d+\.\d+\.\d+))?\s*-->/;
|
|
24
25
|
export const END_RE = /<!--\s*browser-link:instructions:end\s*-->/;
|
|
25
|
-
/** Block body
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* trigger list are DATA — what the user actually types — not instructions
|
|
29
|
-
* to the agent. */
|
|
26
|
+
/** Block body: the agent manual core followed by the topics an agent needs
|
|
27
|
+
* every session, rendered by `../manual/render.ts` (one source shared with
|
|
28
|
+
* the MCP connect-time instructions). */
|
|
30
29
|
function body() {
|
|
31
|
-
return
|
|
32
|
-
'## browser-link — reflex protocol (ALWAYS ACTIVE)',
|
|
33
|
-
'',
|
|
34
|
-
'You have `browser.*` MCP tools (the bridge exposed by `@jobshimo/browser-link`).',
|
|
35
|
-
'These tools see only Chrome tabs the user explicitly connected via the',
|
|
36
|
-
'companion extension. Never reason about state you cannot see.',
|
|
37
|
-
'',
|
|
38
|
-
'### TRIGGER LIST — call before responding when ANY apply',
|
|
39
|
-
'',
|
|
40
|
-
'User mentions any of these (English or Spanish):',
|
|
41
|
-
'- "the button doesn\'t work" / "no anda el botón" / "no funciona X"',
|
|
42
|
-
'- "broken layout" / "está roto" / "se ve mal" / "looks wrong"',
|
|
43
|
-
'- "check if X works" / "fíjate si anda X" / "¿anda X?" / "does X work?"',
|
|
44
|
-
'- "the page" / "la página" / "la web" / "the site"',
|
|
45
|
-
'- "open this in the browser" / "abrí esto en el navegador" / "navegá a"',
|
|
46
|
-
'- a UI element, web app name, URL, browser tab, layout, dialog, form',
|
|
47
|
-
'→ call `browser.list_tabs` FIRST, then `browser.map.recall` with the tab origin.',
|
|
48
|
-
'',
|
|
49
|
-
'`browser.list_tabs` entry carries a `map` field',
|
|
50
|
-
'(`{ app_key, entries, flows, mechanisms, pitfalls, inline? }`):',
|
|
51
|
-
"→ that tab's origin already has data in the persistent map. If `inline`",
|
|
52
|
-
'is present the (small) map is already in the hint — read its pitfalls',
|
|
53
|
-
'first and skip the round trip; otherwise call',
|
|
54
|
-
'`browser.map.recall` BEFORE `browser.snapshot`. No `map` field means',
|
|
55
|
-
'the map has nothing for that origin yet; skip straight to snapshot.',
|
|
56
|
-
'',
|
|
57
|
-
'About to suggest a code change to UI / React / DOM:',
|
|
58
|
-
'→ `browser.snapshot` first, verify current state. Do not speculate.',
|
|
59
|
-
'',
|
|
60
|
-
'Tool call returned "Tab not connected":',
|
|
61
|
-
'→ `browser.events` to see tab-renamed entries before retrying. After a',
|
|
62
|
-
'primary restart the extension keeps auto-reconnecting dropped tabs for',
|
|
63
|
-
'up to 10 minutes (1s/2s/4s/8s/15s, then every 30s; same tab_id when',
|
|
64
|
-
'possible) — wait and retry before asking the human to re-press Connect.',
|
|
65
|
-
'',
|
|
66
|
-
'After a non-trivial flow worked end-to-end (opened dialog, filled form,',
|
|
67
|
-
'found a setting):',
|
|
68
|
-
'→ `browser.map.save` (UI structure only — never IDs, names, dates).',
|
|
69
|
-
'Optionally attach `flows` (named, replayable step recipes) to the same',
|
|
70
|
-
'call — see the recall → adapt → flow pattern below. ALSO save what you',
|
|
71
|
-
'learned about how the app behaves underneath (`mechanisms: [{ key,',
|
|
72
|
-
'description }]`, e.g. "a GET of an item URL marks it complete") and',
|
|
73
|
-
'what does NOT work (`pitfalls: [{ key, description, symptom? }]`, e.g.',
|
|
74
|
-
'"click on the next link returns ok but does not navigate"). A pitfall',
|
|
75
|
-
'costs far more to rediscover than a selector. Behaviour, never content:',
|
|
76
|
-
'no IDs, names, dates or real values.',
|
|
77
|
-
'',
|
|
78
|
-
'`browser.map.recall` returned saved `flows` for this app:',
|
|
79
|
-
'→ ADAPT the steps first — substitute any placeholder text (e.g.',
|
|
80
|
-
'`type text "<QUERY>"`) with the real value the user asked for — THEN',
|
|
81
|
-
'run the adapted steps via `browser.flow`. Never replay a saved flow',
|
|
82
|
-
'verbatim when it contains a placeholder.',
|
|
83
|
-
'',
|
|
84
|
-
'Several MCP clients sharing one bridge (multi-agent mode):',
|
|
85
|
-
'→ `browser.claim_tab` before operating on a tab so other agents see it',
|
|
86
|
-
'in use. `browser.release_tab` when done.',
|
|
87
|
-
'',
|
|
88
|
-
'To SEE a page use `browser.screenshot` (mode viewport | full_page |',
|
|
89
|
-
'element + selector; works on cdp: tabs too). Images cost tokens: prefer',
|
|
90
|
-
'element or jpeg when full fidelity is not needed.',
|
|
91
|
-
'',
|
|
92
|
-
'A `list_tabs` entry has `tab_id` starting with `cdp:` (`transport: "cdp"`):',
|
|
93
|
-
'→ that tab is reached via cdp-direct, not the extension — every tool',
|
|
94
|
-
'works the same EXCEPT drag (standalone AND as a flow step)/console/',
|
|
95
|
-
'network/network_body/canvas_screenshot/dialog_respond/set_permission/',
|
|
96
|
-
'wait_for_tab and download by selector (clear error naming the',
|
|
97
|
-
'extension as the fallback; download by url works).',
|
|
98
|
-
'cdp-direct only appears',
|
|
99
|
-
'when the user has both enabled it AND granted access — you cannot',
|
|
100
|
-
'enable or grant it yourself. A "cdp-direct is disabled" or "requires an',
|
|
101
|
-
'active grant" error means relay the suggested command to the user',
|
|
102
|
-
'(`browser-link config set cdp-direct.enabled true` or',
|
|
103
|
-
'`browser-link cdp allow`) — there is no workaround from here.',
|
|
104
|
-
'',
|
|
105
|
-
'### SELF-CHECK after each user message',
|
|
106
|
-
'',
|
|
107
|
-
'"Is the user talking about a web page, UI, or anything visible in a browser?',
|
|
108
|
-
'If yes → did I run `browser.list_tabs` yet? If no → STOP and run it now."',
|
|
109
|
-
'',
|
|
110
|
-
'### NEVER',
|
|
111
|
-
'',
|
|
112
|
-
'- Speculate about DOM state without a snapshot.',
|
|
113
|
-
'- Suggest "try clicking X" without verifying X exists in the current page.',
|
|
114
|
-
'- Save selectors you have not just successfully executed.',
|
|
115
|
-
'- Store domain data (IDs, user names, dates, etc.) in the persistent map.',
|
|
116
|
-
'- Save a flow recipe with a real value baked into a step (a real search',
|
|
117
|
-
' query, a real name) instead of a placeholder like `<QUERY>` — flows',
|
|
118
|
-
' store UI structure only, exactly like every other map entry.',
|
|
119
|
-
'',
|
|
120
|
-
'### TOKEN-EFFICIENT PATTERNS — prefer dedicated tools, fall back to evaluate',
|
|
121
|
-
'',
|
|
122
|
-
'`browser.evaluate` is the escape hatch. Every dedicated tool below is',
|
|
123
|
-
'cheaper in tokens AND more reliable than a hand-rolled expression.',
|
|
124
|
-
'',
|
|
125
|
-
'- Any multi-step interaction (find a target → act on it → wait → act',
|
|
126
|
-
' again) → `browser.flow({ steps: [...] })` is now the DEFAULT, not a',
|
|
127
|
-
' fallback. find → click → wait_for → type → press used to cost 5+',
|
|
128
|
-
' separate MCP round trips — each one a full LLM inference — and now',
|
|
129
|
-
' costs ONE `browser.flow` call (two if a step fails and you need a',
|
|
130
|
-
" corrective follow-up). A `find` step's selector becomes the implicit",
|
|
131
|
-
' target for the very next click/type/press step that omits',
|
|
132
|
-
' `selector`. Repeated drag-and-drop (card-matching exercises, sortable',
|
|
133
|
-
' lists) batches the same way: N `drag` steps — same params as',
|
|
134
|
-
' browser.drag, endpoints always explicit, drag stays OUT of the',
|
|
135
|
-
' implicit-target chain — in ONE flow instead of N browser.drag calls',
|
|
136
|
-
' (extension tabs only; a drag step on a cdp: tab fails at that step).',
|
|
137
|
-
' Flow is strictly sequential and fails fast — reach for individual',
|
|
138
|
-
' click/type/press/find/wait_for/drag calls only when you need to',
|
|
139
|
-
' branch on an intermediate result.',
|
|
140
|
-
'- Finding an element by visible text → `browser.find({ text, role? })`,',
|
|
141
|
-
' NOT `browser.evaluate` with a `textContent` grep. `find` covers',
|
|
142
|
-
' `<div onclick>` (which a naive `querySelectorAll("button")` MISSES',
|
|
143
|
-
' SILENTLY), applies visibility + ARIA checks, returns a stable',
|
|
144
|
-
' selector + viewport coords, and on multi-match returns up to 5',
|
|
145
|
-
' candidates with snippets for disambiguation. On `not-found`, read',
|
|
146
|
-
' `near_misses` (up to 3 ranked candidates) before giving up — and if',
|
|
147
|
-
' `error` names a role mismatch, drop `role` or match the role the',
|
|
148
|
-
' closest near-miss actually has.',
|
|
149
|
-
'- Quick orientation without a full snapshot → `browser.state({})`.',
|
|
150
|
-
' Returns `{ url, title, focused?, dialogs?, scroll?, viewport }` —',
|
|
151
|
-
' cheaper than `browser.snapshot` when you just need to know where you',
|
|
152
|
-
' are (is a dialog open, what has focus) before deciding whether a',
|
|
153
|
-
' full snapshot is even needed.',
|
|
154
|
-
'- `snapshot`/`find`/`click`/`type` all pierce OPEN Shadow DOM roots and',
|
|
155
|
-
' same-origin iframes automatically — no special handling needed for',
|
|
156
|
-
' web components or in-page iframes. CLOSED shadow roots and',
|
|
157
|
-
' cross-origin iframes stay out of reach (no CDP workaround). If',
|
|
158
|
-
' `click` returns "Element covered by …", something else is on top of',
|
|
159
|
-
' the target — click or dismiss that element first, do not blindly',
|
|
160
|
-
' retry with `force:true`. A pointer-events:none target (invisible',
|
|
161
|
-
' a11y layer) is NOT reported as covered: the click proceeds and the',
|
|
162
|
-
' ok result carries `hit_element` naming what actually received it —',
|
|
163
|
-
' present on any off-target click (force:true included), omitted',
|
|
164
|
-
' when the click hit the resolved element itself.',
|
|
165
|
-
'- A snapshot/find entry with `ambiguous: true` has a selector that',
|
|
166
|
-
' matches structurally-identical twins in other shadow roots/iframes',
|
|
167
|
-
' (no CSS syntax can scope to one root). It resolves first-match-wins:',
|
|
168
|
-
' use it in the SAME turn, and NEVER `browser.map.save` it.',
|
|
169
|
-
'- Trimming snapshot size → `browser.snapshot({ within_selector, only_interactive, exclude, max_interactive })`.',
|
|
170
|
-
' Filters are applied IN-page so the dropped material never travels back.',
|
|
171
|
-
' Pass `exclude:["nav","footer"]` to skip repeated landmarks; pass',
|
|
172
|
-
' `within_selector` when only one region matters.',
|
|
173
|
-
'- Looking at the same view again → take ONE full `browser.snapshot` per',
|
|
174
|
-
' view, keep its `snapshot_id`, and pass it as `since` for every later',
|
|
175
|
-
' look: `browser.snapshot({ since })` returns only `added` / `removed` /',
|
|
176
|
-
' `changed` entries instead of the whole page. On `since_status:',
|
|
177
|
-
' "doc-changed"` (or `evicted`, `observer-unavailable`) you already got',
|
|
178
|
-
' the full snapshot back: keep its new `snapshot_id`. A changed',
|
|
179
|
-
' neighbour can be listed because its selector changed — use the current',
|
|
180
|
-
' one. `ref` (`e<N>`) on entries is an element handle valid only for the',
|
|
181
|
-
' `doc_id` that issued it; for now it is informational, not an action',
|
|
182
|
-
' target.',
|
|
183
|
-
'- Reading N values → ONE `browser.evaluate` returning an object:',
|
|
184
|
-
' `(() => ({ a: document.querySelector("#a").value, b: ... }))()`.',
|
|
185
|
-
' Never N separate evaluates for N reads.',
|
|
186
|
-
'- Scrolling → `browser.evaluate` with `pane.scrollTop = N` or',
|
|
187
|
-
' `el.scrollIntoView({ block: "center" })`. No dedicated tool needed.',
|
|
188
|
-
'- Special keys (Enter/Tab/Escape/arrows/shortcuts) → `browser.press`,',
|
|
189
|
-
' NOT `browser.evaluate` with a synthetic `KeyboardEvent`. Synthetic',
|
|
190
|
-
' `dispatchEvent` produces `isTrusted:false` events — rich editors,',
|
|
191
|
-
' autocompletes, and non-DOM runtimes (Qt-WASM, WebGL) silently ignore',
|
|
192
|
-
' them. `browser.press` dispatches a real CDP `Input.dispatchKeyEvent`',
|
|
193
|
-
' sequence (`isTrusted:true`). For TYPING text → `browser.type` (native',
|
|
194
|
-
' setter; controlled components update their state).',
|
|
195
|
-
'- After `click`/`type`/`press`, a separate `browser.wait_for` is',
|
|
196
|
-
' usually unnecessary — all three accept `settle_ms` (default 150) and',
|
|
197
|
-
' return a `settle` object (`{ settled, duration_ms, mutation_count,',
|
|
198
|
-
' url_changed?, focus_moved?, changes, observer? }`) once the page goes',
|
|
199
|
-
' quiet. Settle proves QUIET, not EFFECT, but it measures from a mark',
|
|
200
|
-
' taken BEFORE the action: `settle.changes` (records, targets, kinds,',
|
|
201
|
-
' roots, descriptors) is what the action caused, and `mutation_count: 0`',
|
|
202
|
-
' with `changes` present means no DOM change in the quiet window.',
|
|
203
|
-
' `changes: null` with `observer: "<reason>"` means the observer was not',
|
|
204
|
-
' available for that action. A reaction that starts after the quiet',
|
|
205
|
-
' window is still invisible: reach for `expect` or `wait_for` when you',
|
|
206
|
-
' need a SPECIFIC condition (a particular selector, network request, or',
|
|
207
|
-
' expression), not just "did anything change".',
|
|
208
|
-
'- When you are counting on a specific EFFECT of a `click`/`type`/`press`',
|
|
209
|
-
' (navigation, a dialog opening, a result appearing), pass `expect`',
|
|
210
|
-
' (`url_changed`, `selector_appears`, `selector_disappears`,',
|
|
211
|
-
' `text_appears`, `timeout_ms`): a no-op action then fails right there',
|
|
212
|
-
' with `expectation not met: ...` instead of reading as success. It is',
|
|
213
|
-
' also accepted on the matching `browser.flow` steps. `expect` asserts',
|
|
214
|
-
' a transition: appears/disappears conditions are sampled before the',
|
|
215
|
-
' action, and one that already held beforehand fails immediately.',
|
|
216
|
-
'- Paging `browser.events` → keep `lastId = result.latest_id` in your',
|
|
217
|
-
' working notes and pass as `since_id` next call. One variable. The',
|
|
218
|
-
' server does not maintain per-agent cursors.',
|
|
219
|
-
'- Download / Export / Save buttons → `browser.download({ selector })`,',
|
|
220
|
-
' NOT `browser.click`. A plain click can open Chrome\'s native "Save as"',
|
|
221
|
-
' dialog, which nothing can press. `browser.download` cancels that',
|
|
222
|
-
' download before it prompts, fetches the file in the page and returns',
|
|
223
|
-
' `{ ok, state, path, bytes, mime }`. Known URL → `{ url }` instead.',
|
|
224
|
-
'',
|
|
225
|
-
'### BULK WORK — `flow` + `repeat`, NEVER a loop inside `evaluate`',
|
|
226
|
-
'',
|
|
227
|
-
'"Click every element matching X until the list drains" is a',
|
|
228
|
-
'`browser.flow` with a `repeat` step, not an `evaluate` loop:',
|
|
229
|
-
'',
|
|
230
|
-
'```',
|
|
231
|
-
'{ repeat: { steps: [{ click: { selector: ".row .delete" } }],',
|
|
232
|
-
' max_iterations: 200, while_found: ".row", delay_ms: 250 } }',
|
|
233
|
-
'```',
|
|
234
|
-
'',
|
|
235
|
-
'- Every click stays trusted CDP input with the occlusion guard and a',
|
|
236
|
-
' recovery snapshot, and you get a per-iteration record. An',
|
|
237
|
-
' `evaluate` loop has NONE of that — `el.click()` is',
|
|
238
|
-
' `isTrusted:false`, nothing hit-tests, nothing is recorded.',
|
|
239
|
-
'- Budget reality, so you size it right the first time:',
|
|
240
|
-
' `2000 + max_iterations * (inner + delay_ms + 500 if while_found)',
|
|
241
|
-
' <= 60000`. A click costs 2500ms with default settle, 500ms with',
|
|
242
|
-
' `settle_ms: 0`. So a throttled drain loop fits ~46 iterations per',
|
|
243
|
-
' call; SET `settle_ms: 0` on the inner click or you only get ~23.',
|
|
244
|
-
' Draining a long list means several calls — that is expected, and',
|
|
245
|
-
' each call resumes where the last stopped while `while_found` still',
|
|
246
|
-
' matches. The win here is safety, not fewer round trips.',
|
|
247
|
-
'- The worst case per click is its SETTLE CAP (`settle_timeout_ms`,',
|
|
248
|
-
' default 2000), not `settle_ms` — a page that never goes quiet burns',
|
|
249
|
-
' the cap every time. If a flow still runs out of time it does not',
|
|
250
|
-
' die empty: it returns `{ ok: true, stopped_by: "timeout",',
|
|
251
|
-
' steps_completed, results }` (a repeat adds `iterations_completed`,',
|
|
252
|
-
' `partial_iteration`). A timeout is not a human stop — continue the',
|
|
253
|
-
' remaining work, but never relaunch irreversible steps that already',
|
|
254
|
-
' completed; resume from the counts. After a server-side recovered',
|
|
255
|
-
' timeout (`results_available: false`) `steps_completed` can be ONE',
|
|
256
|
-
' LOWER than what really ran, so check the page state of the first',
|
|
257
|
-
' step you would re-run before repeating it.',
|
|
258
|
-
'- `max_iterations` is REQUIRED and repeats do NOT nest. Inner steps',
|
|
259
|
-
' count against the same 20-step ceiling. If the projected budget',
|
|
260
|
-
' exceeds 60s you have two options: lower `max_iterations` and run the',
|
|
261
|
-
' flow again (each call picks up where the last left off while',
|
|
262
|
-
' `while_found` still matches), or run it ONCE with `detach: true` —',
|
|
263
|
-
' see below.',
|
|
264
|
-
'- Use `while_found` to decide when to stop, NOT a page counter. It',
|
|
265
|
-
' checks for a VISIBLE match before each iteration and reports',
|
|
266
|
-
' `stopped_by: "condition"` vs `"max_iterations"`.',
|
|
267
|
-
'- `delay_ms` throttles between iterations. Use it on anything',
|
|
268
|
-
' server-backed.',
|
|
269
|
-
'- BEFORE an irreversible bulk run (deleting, sending, paying), call',
|
|
270
|
-
' the same flow once with `dry_run: true`. It dispatches NOTHING and',
|
|
271
|
-
' reports `max_iterations` / `inner_steps` / `delay_ms` /',
|
|
272
|
-
' `while_found` / `would_start` per repeat, plus `budget_ms` and',
|
|
273
|
-
' `requires_detach`. A dry run is never rejected for being too long —',
|
|
274
|
-
' it is judged against the 30-minute detached ceiling, so you can',
|
|
275
|
-
' always project first and then pick the mode.',
|
|
276
|
-
'',
|
|
277
|
-
'### WORK LONGER THAN 60s — `detach`, then poll `flow_status`',
|
|
278
|
-
'',
|
|
279
|
-
'A flow over the 60s budget does not have to become an `evaluate` loop.',
|
|
280
|
-
'`browser.flow({ steps, detach: true })` returns AT ONCE with',
|
|
281
|
-
'`{ flow_id, detached: true, expires_at }` and keeps running with every',
|
|
282
|
-
'guarantee intact — trusted input, occlusion guard, per-iteration',
|
|
283
|
-
'record, a real stop button.',
|
|
284
|
-
'',
|
|
285
|
-
'The lifecycle, in order:',
|
|
286
|
-
'',
|
|
287
|
-
'1. `flow({ steps, dry_run: true })` — project it. Non-negotiable',
|
|
288
|
-
' before anything irreversible.',
|
|
289
|
-
'2. `flow({ steps, detach: true })` → keep the `flow_id`.',
|
|
290
|
-
'3. `flow_status({ tab_id, flow_id })` — poll AT A HUMAN PACE (every',
|
|
291
|
-
' few seconds at most; each poll is a full inference). While',
|
|
292
|
-
' `state: "running"` you get `steps_completed` / `iterations_completed`',
|
|
293
|
-
' and no manifest. Once it ends you get `state` plus `manifest` — the',
|
|
294
|
-
' same `results` array a foreground flow returns, and the ONLY answer',
|
|
295
|
-
' to "which N things did that actually touch?".',
|
|
296
|
-
'4. `flow_cancel({ tab_id, flow_id })` to stop it. Lands within one',
|
|
297
|
-
' step; read the state back rather than assuming.',
|
|
298
|
-
'',
|
|
299
|
-
'Rules that will bite you otherwise:',
|
|
300
|
-
'',
|
|
301
|
-
'- ONE detached flow per tab. A second is rejected naming the running',
|
|
302
|
-
' id — poll or cancel that one first.',
|
|
303
|
-
'- `state: "cancelled"` means a PERSON stopped you (popup Stop button,',
|
|
304
|
-
' or another agent). Never relaunch it. Report what the manifest says',
|
|
305
|
-
' actually happened and ask.',
|
|
306
|
-
'- `state: "expired"` means it hit the 30-minute ceiling mid-run. The',
|
|
307
|
-
' partial manifest is real work — reconcile before doing anything.',
|
|
308
|
-
'- `state: "failed"` with `stopped_by: "worker-terminated"` means Chrome',
|
|
309
|
-
' killed the extension service worker under the flow. It is NEVER',
|
|
310
|
-
' auto-resumed, and its manifest died with it. Re-derive what is left',
|
|
311
|
-
' from the page before relaunching, or you will double-act.',
|
|
312
|
-
'- `state: "unknown"` means this bridge has no record of that id. Do',
|
|
313
|
-
' not read it as "it never ran".',
|
|
314
|
-
'- Do not detach work that fits in 60s. A foreground flow hands you the',
|
|
315
|
-
' results directly; detaching costs you a polling loop for nothing.',
|
|
316
|
-
'',
|
|
317
|
-
'### LONG-RUNNING WORK — a timed-out `evaluate` KEEPS RUNNING',
|
|
318
|
-
'',
|
|
319
|
-
'Reach for this only when `flow` + `repeat` + `detach` genuinely cannot',
|
|
320
|
-
'express the work (it needs branching, or arbitrary JS per item). It is',
|
|
321
|
-
'the escape hatch, and it is strictly worse than everything above:',
|
|
322
|
-
'untrusted `el.click()`, no occlusion check, no recovery snapshot, no',
|
|
323
|
-
'status, no cancel, no manifest.',
|
|
324
|
-
'',
|
|
325
|
-
'A bridge timeout drops the RESPONSE only. The expression itself keeps',
|
|
326
|
-
'running in the page; there is no cancellation path. A timeout reads',
|
|
327
|
-
'like failure, so the reflex is to relaunch — and on irreversible',
|
|
328
|
-
'actions (deleting, sending, paying) that starts a SECOND concurrent',
|
|
329
|
-
'loop over the same items.',
|
|
330
|
-
'',
|
|
331
|
-
'- **If an `evaluate` times out, verify whether it is still working',
|
|
332
|
-
' BEFORE relaunching.** Read its progress global, or re-read an',
|
|
333
|
-
' authoritative count from the page, and confirm it has actually',
|
|
334
|
-
' stopped. This one check is the difference between a slow job and a',
|
|
335
|
-
' double-executed irreversible one.',
|
|
336
|
-
'- Never put long work inside a single `browser.evaluate`. Launch a',
|
|
337
|
-
' self-guarding worker that reports progress to a global, then read',
|
|
338
|
-
' that global with short calls:',
|
|
339
|
-
' ```js',
|
|
340
|
-
' if (window.__job?.running) return { already: true, state: window.__job };',
|
|
341
|
-
' window.__job = { running: true, done: 0, remaining: null,',
|
|
342
|
-
' manifest: [], error: null, finished: false };',
|
|
343
|
-
' (async () => { /* work; update window.__job */ })();',
|
|
344
|
-
' return { launched: true };',
|
|
345
|
-
' ```',
|
|
346
|
-
' The guard on `running` is mandatory, not decorative: without it a',
|
|
347
|
-
' retried call after a timeout starts a second concurrent worker over',
|
|
348
|
-
' the same irreversible actions.',
|
|
349
|
-
'- To WAIT on that worker → `browser.wait_for` with an expression',
|
|
350
|
-
' (`window.__job?.finished === true`), NOT a chain of `evaluate` +',
|
|
351
|
-
' `setTimeout`. Each hand-rolled poll costs a full LLM inference;',
|
|
352
|
-
' `wait_for` parks server-side for up to 30s in ONE call.',
|
|
353
|
-
'- Accumulate what you touched into the job global as you act',
|
|
354
|
-
' (`window.__job.manifest.push(id)`) and read it back BEFORE the tab',
|
|
355
|
-
' navigates away. After an irreversible bulk action that manifest is',
|
|
356
|
-
' the only possible answer to "which ones did you actually do?" —',
|
|
357
|
-
' `browser.events` records that actions happened, never their subject.',
|
|
358
|
-
'',
|
|
359
|
-
'### READING DATA — silent traps that produce confident WRONG answers',
|
|
360
|
-
'',
|
|
361
|
-
"- Never regex over a `DOMParser` document's text. `innerText` is",
|
|
362
|
-
' `undefined` on a document with no layout, and the `textContent`',
|
|
363
|
-
' fallback sweeps up `<script>`, CSS and hidden nodes. Select per',
|
|
364
|
-
" field (`row.querySelector('.price')`) and read that leaf's",
|
|
365
|
-
' `textContent`. Sanity-check extracted figures against what',
|
|
366
|
-
' `snapshot` shows before acting on them: this exact trap reported a',
|
|
367
|
-
' maximum price of 28,00 when the real maximum was 8,00 — confident,',
|
|
368
|
-
' plausible, and wrong.',
|
|
369
|
-
"- Never treat a paginated list's own counter as ground truth. Find",
|
|
370
|
-
' the authoritative total elsewhere (a parent or summary page), and',
|
|
371
|
-
' confirm completion by an explicit empty-state string rather than by',
|
|
372
|
-
' a counter reaching zero — counters routinely VANISH at zero, and',
|
|
373
|
-
' the leftover parse reads as a phantom "1 remaining" forever.',
|
|
374
|
-
].join('\n');
|
|
30
|
+
return renderInstallBody().join('\n');
|
|
375
31
|
}
|
|
376
32
|
/** Full fenced block to write into the file, including a trailing newline.
|
|
377
33
|
* The line between markers carries the managed-by stamp so a user reading
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/agent-instructions/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,sCAAsC,CAAC;AACnE,MAAM,CAAC,MAAM,UAAU,GAAG,wCAAwC,CAAC;AAEnE,MAAM,UAAU,WAAW,CAAC,OAAO,GAAG,OAAO;IAC3C,OAAO,GAAG,YAAY,KAAK,OAAO,MAAM,CAAC;AAC3C,CAAC;AAED;;;;yCAIyC;AACzC,MAAM,CAAC,MAAM,QAAQ,GACnB,gFAAgF,CAAC;AACnF,MAAM,CAAC,MAAM,MAAM,GAAG,4CAA4C,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/agent-instructions/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,sCAAsC,CAAC;AACnE,MAAM,CAAC,MAAM,UAAU,GAAG,wCAAwC,CAAC;AAEnE,MAAM,UAAU,WAAW,CAAC,OAAO,GAAG,OAAO;IAC3C,OAAO,GAAG,YAAY,KAAK,OAAO,MAAM,CAAC;AAC3C,CAAC;AAED;;;;yCAIyC;AACzC,MAAM,CAAC,MAAM,QAAQ,GACnB,gFAAgF,CAAC;AACnF,MAAM,CAAC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D,CAAC;AAWD,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACjD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IAChD,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,sBAAsB,GAAG,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC;IACtD,MAAM,oBAAoB,GAAG,sBAAsB,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACpE,6DAA6D;IAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,oBAAoB,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,oBAAoB,GAAG,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC;IACrF,OAAO;QACL,UAAU,EAAE,KAAK,CAAC,KAAK;QACvB,QAAQ;QACR,gBAAgB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,IAAI,IAAI;KAChD,CAAC;AACJ,CAAC"}
|
package/dist/bridge/server.d.ts
CHANGED
|
@@ -23,6 +23,11 @@ export interface IpcServerOptions {
|
|
|
23
23
|
* production wiring is in `server.ts`'s `runPrimary`.
|
|
24
24
|
*/
|
|
25
25
|
pushSettings?: (settings: SettingsPushPayload) => number;
|
|
26
|
+
/** The `initialize.instructions` text proxies receive. The primary passes
|
|
27
|
+
* the text it built at start (with the outdated-block notice when one
|
|
28
|
+
* applies) so a proxied agent reads the same text as the primary's own
|
|
29
|
+
* client. Defaults to `SERVER_INSTRUCTIONS`. */
|
|
30
|
+
instructions?: string;
|
|
26
31
|
}
|
|
27
32
|
export declare class IpcServer {
|
|
28
33
|
private deps;
|
package/dist/bridge/server.js
CHANGED
|
@@ -350,7 +350,7 @@ export class IpcServer {
|
|
|
350
350
|
protocolVersion: '2024-11-05',
|
|
351
351
|
capabilities: { tools: {} },
|
|
352
352
|
serverInfo: { name: 'browser-link', version: VERSION },
|
|
353
|
-
instructions: SERVER_INSTRUCTIONS,
|
|
353
|
+
instructions: this.options.instructions ?? SERVER_INSTRUCTIONS,
|
|
354
354
|
};
|
|
355
355
|
return { jsonrpc: '2.0', id, result };
|
|
356
356
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/bridge/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyC,MAAM,UAAU,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAoB,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,EACpB,WAAW,EACX,mBAAmB,EACnB,UAAU,GAGX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAqB,MAAM,eAAe,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC;;;;;;;GAOG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAE5C;gFACgF;AAChF,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IACtD,MAAM;IACN,UAAU;IACV,QAAQ;IACR,KAAK;IACL,SAAS;IACT,cAAc;IACd,kBAAkB;CACnB,CAAC,CAAC;AAEH,uEAAuE;AACvE,SAA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;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;QAClE,CAAC;IACH,CAAC;CACF"}
|
package/dist/cdp/flow.d.ts
CHANGED
|
@@ -59,6 +59,25 @@ export type ActionOutcome<T> = {
|
|
|
59
59
|
ok: false;
|
|
60
60
|
error: string;
|
|
61
61
|
};
|
|
62
|
+
/** The error text for an action target given as an observer `ref` (spec v4
|
|
63
|
+
* §6.3) that could not be resolved, shared by both transports' perform*
|
|
64
|
+
* functions so the extension and cdp-direct report the same string.
|
|
65
|
+
* `failure` is the in-page `resolveTarget` result (see `PAGE_OBSERVER_JS`
|
|
66
|
+
* in `inpage/builders.ts`). The `ref-stale:` prefix is a stable contract.
|
|
67
|
+
* Returns `null` for any other reason, which the caller reports as it
|
|
68
|
+
* always did. */
|
|
69
|
+
export declare function refFailureMessage(failure: {
|
|
70
|
+
reason?: string;
|
|
71
|
+
doc_id?: string;
|
|
72
|
+
}, ref: string): string | null;
|
|
73
|
+
/** The error text for a click whose predicted hit lands on an ancestor of
|
|
74
|
+
* the target instead of the target itself (the in-page resolve reports
|
|
75
|
+
* `reason: 'retargeted'`, see `checkOcclusion` in `inpage/deep-query.ts`):
|
|
76
|
+
* the target is painted but not at its own centre — clipped by an overflow
|
|
77
|
+
* container, zero-size, or covered by its own parent. Shared by both
|
|
78
|
+
* transports' `performClick` so the standalone tool and a flow click step
|
|
79
|
+
* report the same string. `target` is the selector or ref as given. */
|
|
80
|
+
export declare function retargetedClickMessage(hitElement: string, target: string): string;
|
|
62
81
|
/** Hard cap on steps per flow — mirrors the `maxItems: 20` on the MCP
|
|
63
82
|
* schema (`browser-definitions.ts`) and the server-side validation
|
|
64
83
|
* (`browser-dispatch.ts`). Enforced again here so neither the extension
|
|
@@ -92,6 +111,12 @@ export interface FindStepResult {
|
|
|
92
111
|
* when `role` excluded matches that existed under a broader scan. */
|
|
93
112
|
error?: string;
|
|
94
113
|
selector?: string;
|
|
114
|
+
/** The observer ref of the matched element (present when the page
|
|
115
|
+
* observer is installed). The implicit target a find step leaves stays
|
|
116
|
+
* its `selector`. */
|
|
117
|
+
ref?: string;
|
|
118
|
+
/** Set when a find by `ref` re-resolved a replaced node. */
|
|
119
|
+
reresolved?: boolean;
|
|
95
120
|
ambiguous?: boolean;
|
|
96
121
|
tag?: string;
|
|
97
122
|
text?: string;
|
|
@@ -103,6 +128,9 @@ export interface FindStepResult {
|
|
|
103
128
|
}
|
|
104
129
|
export interface ClickStepParams {
|
|
105
130
|
selector?: string;
|
|
131
|
+
/** Observer ref (`<doc_tag>:e<N>`) as the target instead of `selector`; exactly one
|
|
132
|
+
* of the two. A step ref beats the implicit target of a preceding find. */
|
|
133
|
+
ref?: string;
|
|
106
134
|
force?: boolean;
|
|
107
135
|
settle_ms?: number;
|
|
108
136
|
/** Cap on the settle wait; the worst case a step can spend settling. */
|
|
@@ -110,8 +138,14 @@ export interface ClickStepParams {
|
|
|
110
138
|
expect?: ExpectParams;
|
|
111
139
|
}
|
|
112
140
|
export interface ClickStepResult {
|
|
141
|
+
/** The selector, or the ref, the click was asked for. */
|
|
113
142
|
clicked: string;
|
|
114
143
|
tag: string;
|
|
144
|
+
/** Present when the target was given as a ref. */
|
|
145
|
+
ref?: string;
|
|
146
|
+
/** Present (true) only when the ref's node was gone and was re-resolved
|
|
147
|
+
* by its semantic key. */
|
|
148
|
+
reresolved?: boolean;
|
|
115
149
|
/** Descriptor of the element that actually receives the dispatched
|
|
116
150
|
* click, present ONLY when it differs from the resolved target: a
|
|
117
151
|
* pointer-events:none target whose real hit-target sibling takes the
|
|
@@ -124,6 +158,7 @@ export interface ClickStepResult {
|
|
|
124
158
|
}
|
|
125
159
|
export interface TypeStepParams {
|
|
126
160
|
selector?: string;
|
|
161
|
+
ref?: string;
|
|
127
162
|
text: string;
|
|
128
163
|
clear?: boolean;
|
|
129
164
|
settle_ms?: number;
|
|
@@ -133,6 +168,8 @@ export interface TypeStepParams {
|
|
|
133
168
|
export interface TypeStepResult {
|
|
134
169
|
typed: number;
|
|
135
170
|
selector?: string;
|
|
171
|
+
ref?: string;
|
|
172
|
+
reresolved?: boolean;
|
|
136
173
|
settle?: Record<string, unknown>;
|
|
137
174
|
expect?: ExpectMet;
|
|
138
175
|
}
|
|
@@ -140,6 +177,7 @@ export interface PressStepParams {
|
|
|
140
177
|
key: string;
|
|
141
178
|
modifiers?: string[];
|
|
142
179
|
selector?: string;
|
|
180
|
+
ref?: string;
|
|
143
181
|
settle_ms?: number;
|
|
144
182
|
settle_timeout_ms?: number;
|
|
145
183
|
expect?: ExpectParams;
|
|
@@ -147,11 +185,15 @@ export interface PressStepParams {
|
|
|
147
185
|
export interface PressStepResult {
|
|
148
186
|
key: string;
|
|
149
187
|
modifiers: string[];
|
|
188
|
+
ref?: string;
|
|
189
|
+
reresolved?: boolean;
|
|
150
190
|
settle?: Record<string, unknown>;
|
|
151
191
|
expect?: ExpectMet;
|
|
152
192
|
}
|
|
153
193
|
export interface WaitForStepParams {
|
|
154
194
|
selector?: string;
|
|
195
|
+
/** Observer ref instead of `selector`; `condition` applies to both. */
|
|
196
|
+
ref?: string;
|
|
155
197
|
expression?: string;
|
|
156
198
|
network_url?: string;
|
|
157
199
|
condition?: string;
|
|
@@ -306,9 +348,8 @@ export type FlowStep = {
|
|
|
306
348
|
* follow-up round trip. */
|
|
307
349
|
export interface FlowDeps {
|
|
308
350
|
performFind(params: FindStepParams): Promise<ActionOutcome<FindStepResult>>;
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}): Promise<ActionOutcome<ClickStepResult>>;
|
|
351
|
+
/** Called with exactly one of `selector` / `ref` set. */
|
|
352
|
+
performClick(params: ClickStepParams): Promise<ActionOutcome<ClickStepResult>>;
|
|
312
353
|
performType(params: TypeStepParams): Promise<ActionOutcome<TypeStepResult>>;
|
|
313
354
|
performPress(params: PressStepParams): Promise<ActionOutcome<PressStepResult>>;
|
|
314
355
|
performWaitFor(params: WaitForStepParams): Promise<ActionOutcome<WaitForStepResult>>;
|