@jobshimo/browser-link 0.23.14 → 0.25.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 +32 -0
- package/dist/agent-instructions/content.js.map +1 -1
- package/dist/cdp/flow.d.ts +90 -8
- package/dist/cdp/flow.js +411 -122
- package/dist/cdp/flow.js.map +1 -1
- package/dist/cdp/transport.js +5 -1
- package/dist/cdp/transport.js.map +1 -1
- package/dist/extension/background.js +6 -1
- package/dist/extension/background.js.map +1 -1
- package/dist/extension/flow.d.ts +97 -8
- package/dist/extension/flow.js +418 -122
- package/dist/extension/flow.js.map +1 -1
- package/dist/extension/manifest.json +1 -1
- package/dist/tools/browser-definitions.js +84 -5
- package/dist/tools/browser-definitions.js.map +1 -1
- package/dist/tools/browser-dispatch.d.ts +3 -1
- package/dist/tools/browser-dispatch.js +130 -7
- package/dist/tools/browser-dispatch.js.map +1 -1
- package/package.json +1 -1
package/dist/extension/flow.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* browser.flow step sequencing — the logic behind the composite action
|
|
3
3
|
* tool. Runs a short, declarative list of find/click/type/press/wait_for/
|
|
4
|
-
* drag steps strictly in order, fails fast on the first step that
|
|
5
|
-
* not succeed, and threads an "implicit target" from a `find` step
|
|
6
|
-
* the very next click/type/press step that omits its own
|
|
7
|
-
* `drag` step stays OUT of that chain: both of its
|
|
8
|
-
* explicit (selector or coords), so it neither
|
|
9
|
-
* implicit target — a pending target survives a
|
|
10
|
-
* a later click/type/press, exactly like it
|
|
4
|
+
* drag/sleep steps strictly in order, fails fast on the first step that
|
|
5
|
+
* does not succeed, and threads an "implicit target" from a `find` step
|
|
6
|
+
* into the very next click/type/press step that omits its own
|
|
7
|
+
* `selector`. A `drag` step stays OUT of that chain: both of its
|
|
8
|
+
* endpoints are always explicit (selector or coords), so it neither
|
|
9
|
+
* consumes nor sets the implicit target — a pending target survives a
|
|
10
|
+
* drag step untouched for a later click/type/press, exactly like it
|
|
11
|
+
* survives a wait_for. A `sleep` step is a fixed pause and stays out of
|
|
12
|
+
* the chain for the same reason: it names no target at all.
|
|
13
|
+
*
|
|
14
|
+
* A `repeat` step runs a bounded sub-sequence up to `max_iterations`
|
|
15
|
+
* times, optionally stopping early while a `while_found` selector still
|
|
16
|
+
* matches. It does not nest, its inner steps count against the same
|
|
17
|
+
* 20-step ceiling, and each iteration starts with a FRESH implicit
|
|
18
|
+
* target — so nothing leaks across an iteration or across the repeat
|
|
19
|
+
* boundary in either direction.
|
|
11
20
|
*
|
|
12
21
|
* Deliberately decoupled from any specific transport: every side effect
|
|
13
22
|
* goes through the `FlowDeps` the caller injects. The concrete wiring —
|
|
@@ -34,7 +43,32 @@
|
|
|
34
43
|
* nor cdp-direct ever runs an oversized flow even if a future caller
|
|
35
44
|
* bypasses the server's own check (e.g. a directly-wired test harness). */
|
|
36
45
|
export const MAX_FLOW_STEPS = 20;
|
|
37
|
-
|
|
46
|
+
/** Hard cap on one `sleep` step's `ms`. Matches the ceiling a single
|
|
47
|
+
* `wait_for` step may request, so no one step can park the flow longer
|
|
48
|
+
* than the longest wait already expressible. Out-of-range values are a
|
|
49
|
+
* validation ERROR rather than a silent clamp: a flow that asked to
|
|
50
|
+
* throttle by 60s and got 30s would hammer a backend at twice the
|
|
51
|
+
* intended rate without ever saying so. */
|
|
52
|
+
export const MAX_FLOW_SLEEP_MS = 30_000;
|
|
53
|
+
/** Hard cap on one `repeat` step's `max_iterations`. The real ceiling in
|
|
54
|
+
* practice is the flow's own worst-case time budget (a repeat's budget is
|
|
55
|
+
* `max_iterations × (inner steps + delay)`), which bites long before this
|
|
56
|
+
* does; this is the backstop that keeps a typo from producing an
|
|
57
|
+
* absurd projected budget. */
|
|
58
|
+
export const MAX_FLOW_REPEAT_ITERATIONS = 500;
|
|
59
|
+
/** Hard cap on a `repeat`'s inter-iteration `delay_ms` — same ceiling a
|
|
60
|
+
* standalone `sleep` step may request. */
|
|
61
|
+
export const MAX_FLOW_REPEAT_DELAY_MS = 30_000;
|
|
62
|
+
const STEP_KINDS = [
|
|
63
|
+
'find',
|
|
64
|
+
'click',
|
|
65
|
+
'type',
|
|
66
|
+
'press',
|
|
67
|
+
'wait_for',
|
|
68
|
+
'drag',
|
|
69
|
+
'sleep',
|
|
70
|
+
'repeat',
|
|
71
|
+
];
|
|
38
72
|
function isStepKind(key) {
|
|
39
73
|
return STEP_KINDS.includes(key);
|
|
40
74
|
}
|
|
@@ -104,6 +138,359 @@ function resolveTarget(explicit, implicit) {
|
|
|
104
138
|
* document rather than genuinely missing its target. */
|
|
105
139
|
const NAVIGATION_RACE_HINT = " (previous step's settle reported context-destroyed — the page likely navigated;" +
|
|
106
140
|
' insert a wait_for step after the navigating action so this step does not race the page load)';
|
|
141
|
+
/** Execute ONE non-repeat step against `state`, which it mutates. */
|
|
142
|
+
async function executeLeafStep(kind, stepRecord, state, deps) {
|
|
143
|
+
const raceHint = () => state.lastSettleReason === 'context-destroyed' ? NAVIGATION_RACE_HINT : '';
|
|
144
|
+
if (kind === 'find') {
|
|
145
|
+
const params = stepRecord.find;
|
|
146
|
+
const outcome = await deps.performFind(params);
|
|
147
|
+
if (!outcome.ok)
|
|
148
|
+
return { ok: false, error: outcome.error + raceHint() };
|
|
149
|
+
const r = outcome.result;
|
|
150
|
+
if (!r.matched) {
|
|
151
|
+
const candidateNote = r.reason === 'multiple-matches' && r.candidates
|
|
152
|
+
? ` — candidates: ${JSON.stringify(r.candidates)}`
|
|
153
|
+
: '';
|
|
154
|
+
return { ok: false, error: `find: ${r.reason ?? 'not-found'}${candidateNote}${raceHint()}` };
|
|
155
|
+
}
|
|
156
|
+
if (r.ambiguous) {
|
|
157
|
+
return {
|
|
158
|
+
ok: false,
|
|
159
|
+
error: `find: selector "${r.selector ?? ''}" is ambiguous across shadow roots/iframes — refine text/role for a unique match`,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
state.implicitTarget = r.selector;
|
|
163
|
+
state.lastSettleReason = undefined;
|
|
164
|
+
return { ok: true, entry: { selector: r.selector } };
|
|
165
|
+
}
|
|
166
|
+
if (kind === 'wait_for') {
|
|
167
|
+
const params = stepRecord.wait_for;
|
|
168
|
+
const outcome = await deps.performWaitFor(params);
|
|
169
|
+
if (!outcome.ok)
|
|
170
|
+
return { ok: false, error: outcome.error + raceHint() };
|
|
171
|
+
if (!outcome.result.matched) {
|
|
172
|
+
// No race hint here: a wait_for step IS the recommended remedy for
|
|
173
|
+
// a navigation race — a plain timeout is a genuine non-match.
|
|
174
|
+
return {
|
|
175
|
+
ok: false,
|
|
176
|
+
error: `wait_for: condition not met within timeout (${outcome.result.elapsed_ms}ms, ${outcome.result.checks} checks)`,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
state.lastSettleReason = undefined;
|
|
180
|
+
return { ok: true, entry: { ok: true } };
|
|
181
|
+
}
|
|
182
|
+
if (kind === 'drag') {
|
|
183
|
+
const params = stepRecord.drag;
|
|
184
|
+
// No resolveTarget here ON PURPOSE: a drag names BOTH endpoints
|
|
185
|
+
// explicitly (selector or coords), so there is no single `selector`
|
|
186
|
+
// slot the implicit target could unambiguously fill — a pending
|
|
187
|
+
// implicit target survives this step untouched for a later
|
|
188
|
+
// click/type/press, exactly like it survives a wait_for.
|
|
189
|
+
const outcome = await deps.performDrag(params);
|
|
190
|
+
if (!outcome.ok)
|
|
191
|
+
return { ok: false, error: outcome.error + raceHint() };
|
|
192
|
+
// A successful drag resolved both endpoints via an in-page probe,
|
|
193
|
+
// which proves the document is reachable again after any earlier
|
|
194
|
+
// navigation — clear the race hint like find/wait_for do. (Drag has
|
|
195
|
+
// no settle phase, so there is no settle reason to carry instead.)
|
|
196
|
+
state.lastSettleReason = undefined;
|
|
197
|
+
return { ok: true, entry: compactActionResult(outcome.result) };
|
|
198
|
+
}
|
|
199
|
+
if (kind === 'sleep') {
|
|
200
|
+
const params = stepRecord.sleep;
|
|
201
|
+
const ms = params?.ms;
|
|
202
|
+
// Re-validated here even though the server already checked: this
|
|
203
|
+
// module is reachable from a directly-wired caller that never went
|
|
204
|
+
// through `validateFlowSteps` (see the runFlow doc comment).
|
|
205
|
+
if (typeof ms !== 'number' || !Number.isInteger(ms) || ms < 1 || ms > MAX_FLOW_SLEEP_MS) {
|
|
206
|
+
return {
|
|
207
|
+
ok: false,
|
|
208
|
+
error: `sleep: ms must be an integer between 1 and ${MAX_FLOW_SLEEP_MS}`,
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
// The guard above already REJECTED anything outside 1..MAX, so this
|
|
212
|
+
// Math.min can never actually reduce a value — it is not a silent
|
|
213
|
+
// clamp and does not weaken the reject-don't-clamp contract. It is
|
|
214
|
+
// here so the timer's upper bound is provable from this line alone:
|
|
215
|
+
// static analysis (CodeQL `js/resource-exhaustion`) cannot follow the
|
|
216
|
+
// bound through the compound guard, and an unbounded user-controlled
|
|
217
|
+
// timer duration is a finding worth keeping impossible BY SHAPE
|
|
218
|
+
// rather than by argument.
|
|
219
|
+
const delayMs = Math.min(ms, MAX_FLOW_SLEEP_MS);
|
|
220
|
+
await new Promise((resolve) => {
|
|
221
|
+
setTimeout(resolve, delayMs);
|
|
222
|
+
});
|
|
223
|
+
// Deliberately does NOT clear `lastSettleReason`: find/wait_for/drag
|
|
224
|
+
// clear it because each one probes the document and thereby PROVES
|
|
225
|
+
// it is reachable again. A sleep proves nothing — it just waits — so
|
|
226
|
+
// a pending navigation-race hint stays armed for the next failure.
|
|
227
|
+
// The implicit target likewise survives untouched, exactly as it
|
|
228
|
+
// survives a wait_for or a drag.
|
|
229
|
+
return { ok: true, entry: { slept_ms: ms } };
|
|
230
|
+
}
|
|
231
|
+
if (kind === 'click') {
|
|
232
|
+
const params = stepRecord.click;
|
|
233
|
+
const { resolved, consumed } = resolveTarget(params.selector, state.implicitTarget);
|
|
234
|
+
if (consumed)
|
|
235
|
+
state.implicitTarget = undefined;
|
|
236
|
+
if (resolved === undefined) {
|
|
237
|
+
return {
|
|
238
|
+
ok: false,
|
|
239
|
+
error: 'click: no selector provided and no implicit target from a preceding find',
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
const outcome = await deps.performClick({
|
|
243
|
+
force: params.force,
|
|
244
|
+
settle_ms: params.settle_ms,
|
|
245
|
+
selector: resolved,
|
|
246
|
+
});
|
|
247
|
+
if (!outcome.ok)
|
|
248
|
+
return { ok: false, error: outcome.error + raceHint() };
|
|
249
|
+
state.lastSettleReason = outcome.result.settle?.reason;
|
|
250
|
+
return { ok: true, entry: compactActionResult(outcome.result) };
|
|
251
|
+
}
|
|
252
|
+
if (kind === 'type') {
|
|
253
|
+
const params = stepRecord.type;
|
|
254
|
+
const { resolved, consumed } = resolveTarget(params.selector, state.implicitTarget);
|
|
255
|
+
if (consumed)
|
|
256
|
+
state.implicitTarget = undefined;
|
|
257
|
+
const outcome = await deps.performType({
|
|
258
|
+
text: params.text,
|
|
259
|
+
clear: params.clear,
|
|
260
|
+
settle_ms: params.settle_ms,
|
|
261
|
+
selector: resolved,
|
|
262
|
+
});
|
|
263
|
+
if (!outcome.ok)
|
|
264
|
+
return { ok: false, error: outcome.error + raceHint() };
|
|
265
|
+
state.lastSettleReason = outcome.result.settle?.reason;
|
|
266
|
+
return { ok: true, entry: compactActionResult(outcome.result) };
|
|
267
|
+
}
|
|
268
|
+
// press — the only kind left after the checks above.
|
|
269
|
+
const params = stepRecord.press;
|
|
270
|
+
const { resolved, consumed } = resolveTarget(params.selector, state.implicitTarget);
|
|
271
|
+
if (consumed)
|
|
272
|
+
state.implicitTarget = undefined;
|
|
273
|
+
const outcome = await deps.performPress({
|
|
274
|
+
key: params.key,
|
|
275
|
+
modifiers: params.modifiers,
|
|
276
|
+
settle_ms: params.settle_ms,
|
|
277
|
+
selector: resolved,
|
|
278
|
+
});
|
|
279
|
+
if (!outcome.ok)
|
|
280
|
+
return { ok: false, error: outcome.error + raceHint() };
|
|
281
|
+
state.lastSettleReason = outcome.result.settle?.reason;
|
|
282
|
+
return { ok: true, entry: compactActionResult(outcome.result) };
|
|
283
|
+
}
|
|
284
|
+
/** Validate a raw `repeat` body. Shared by the executor and the dry-run
|
|
285
|
+
* planner so a flow can never be projected under looser rules than it
|
|
286
|
+
* would actually run under. */
|
|
287
|
+
function normalizeRepeat(raw) {
|
|
288
|
+
const params = raw;
|
|
289
|
+
const innerSteps = params?.steps;
|
|
290
|
+
if (!Array.isArray(innerSteps) || innerSteps.length === 0) {
|
|
291
|
+
return { ok: false, error: 'repeat: steps must be a non-empty array' };
|
|
292
|
+
}
|
|
293
|
+
const maxIterations = params?.max_iterations;
|
|
294
|
+
if (typeof maxIterations !== 'number' ||
|
|
295
|
+
!Number.isInteger(maxIterations) ||
|
|
296
|
+
maxIterations < 1 ||
|
|
297
|
+
maxIterations > MAX_FLOW_REPEAT_ITERATIONS) {
|
|
298
|
+
return {
|
|
299
|
+
ok: false,
|
|
300
|
+
error: `repeat: max_iterations is required and must be an integer between 1 and ${MAX_FLOW_REPEAT_ITERATIONS}`,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
const whileFound = params?.while_found;
|
|
304
|
+
if (whileFound !== undefined && (typeof whileFound !== 'string' || whileFound.length === 0)) {
|
|
305
|
+
return { ok: false, error: 'repeat: while_found must be a non-empty string' };
|
|
306
|
+
}
|
|
307
|
+
const delayRaw = params?.delay_ms;
|
|
308
|
+
if (delayRaw !== undefined &&
|
|
309
|
+
(typeof delayRaw !== 'number' ||
|
|
310
|
+
!Number.isInteger(delayRaw) ||
|
|
311
|
+
delayRaw < 0 ||
|
|
312
|
+
delayRaw > MAX_FLOW_REPEAT_DELAY_MS)) {
|
|
313
|
+
return {
|
|
314
|
+
ok: false,
|
|
315
|
+
error: `repeat: delay_ms must be an integer between 0 and ${MAX_FLOW_REPEAT_DELAY_MS}`,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
for (let j = 0; j < innerSteps.length; j++) {
|
|
319
|
+
const innerKind = stepKind(innerSteps[j]);
|
|
320
|
+
if (!innerKind) {
|
|
321
|
+
return {
|
|
322
|
+
ok: false,
|
|
323
|
+
error: `repeat: step ${j}: each step must be exactly one of find | click | type | press | wait_for | drag | sleep`,
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
if (innerKind === 'repeat') {
|
|
327
|
+
return {
|
|
328
|
+
ok: false,
|
|
329
|
+
error: 'repeat: steps may not contain another repeat — nesting is not supported',
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return {
|
|
334
|
+
ok: true,
|
|
335
|
+
value: {
|
|
336
|
+
steps: innerSteps,
|
|
337
|
+
maxIterations,
|
|
338
|
+
whileFound,
|
|
339
|
+
// Bounded with Math.min for the same reason `sleep` is: the guard
|
|
340
|
+
// above already rejected anything larger, so this cannot silently
|
|
341
|
+
// clamp — it makes the timer's ceiling provable from the call site.
|
|
342
|
+
delayMs: Math.min(delayRaw ?? 0, MAX_FLOW_REPEAT_DELAY_MS),
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* One-shot presence test for `while_found`.
|
|
348
|
+
*
|
|
349
|
+
* Deliberately reuses the existing `performWaitFor` seam instead of adding
|
|
350
|
+
* a new `FlowDeps` method: `timeout_ms: 0` makes its poll loop run exactly
|
|
351
|
+
* ONE check and return (it evaluates the condition BEFORE testing the
|
|
352
|
+
* deadline), so this is a single in-page probe with no new wiring and
|
|
353
|
+
* identical behaviour on both transports. `condition: 'visible'` matches
|
|
354
|
+
* what `browser.find` considers a real element, so a row that is merely
|
|
355
|
+
* hidden ends the loop just as a removed one does.
|
|
356
|
+
*/
|
|
357
|
+
async function whileFoundStillMatches(selector, deps) {
|
|
358
|
+
const outcome = await deps.performWaitFor({ selector, condition: 'visible', timeout_ms: 0 });
|
|
359
|
+
if (!outcome.ok)
|
|
360
|
+
return { ok: false, error: outcome.error };
|
|
361
|
+
return { ok: true, matched: outcome.result.matched };
|
|
362
|
+
}
|
|
363
|
+
/** Run one `repeat` step to completion. */
|
|
364
|
+
async function executeRepeatStep(raw, deps) {
|
|
365
|
+
const normalized = normalizeRepeat(raw);
|
|
366
|
+
if (!normalized.ok)
|
|
367
|
+
return normalized;
|
|
368
|
+
const { steps: innerSteps, maxIterations, whileFound, delayMs } = normalized.value;
|
|
369
|
+
// Local, explicitly range-checked copy of the pause. `normalizeRepeat`
|
|
370
|
+
// already rejected anything outside 0..MAX, so the `else` is
|
|
371
|
+
// unreachable in practice — but the timer's ceiling has to be provable
|
|
372
|
+
// from an upper-bound COMPARISON inside this function. A `Math.min` is
|
|
373
|
+
// not enough here: the value reaches us through a property of the
|
|
374
|
+
// normalized object, and static analysis (CodeQL
|
|
375
|
+
// `js/resource-exhaustion`) does not carry the sanitizer across that
|
|
376
|
+
// hop. An unbounded user-controlled timer duration stays impossible by
|
|
377
|
+
// shape rather than by argument.
|
|
378
|
+
let iterationDelayMs = 0;
|
|
379
|
+
if (Number.isInteger(delayMs) && delayMs > 0 && delayMs <= MAX_FLOW_REPEAT_DELAY_MS) {
|
|
380
|
+
iterationDelayMs = delayMs;
|
|
381
|
+
}
|
|
382
|
+
const iterations = [];
|
|
383
|
+
let stoppedBy = 'max_iterations';
|
|
384
|
+
for (let iter = 0; iter < maxIterations; iter++) {
|
|
385
|
+
if (whileFound !== undefined) {
|
|
386
|
+
const probe = await whileFoundStillMatches(whileFound, deps);
|
|
387
|
+
if (!probe.ok) {
|
|
388
|
+
return { ok: false, error: `repeat: while_found probe failed — ${probe.error}` };
|
|
389
|
+
}
|
|
390
|
+
if (!probe.matched) {
|
|
391
|
+
stoppedBy = 'condition';
|
|
392
|
+
break;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
// Fresh state per iteration: iteration N can never act on whatever
|
|
396
|
+
// iteration N-1's `find` happened to resolve.
|
|
397
|
+
const state = { implicitTarget: undefined, lastSettleReason: undefined };
|
|
398
|
+
const entries = [];
|
|
399
|
+
for (let j = 0; j < innerSteps.length; j++) {
|
|
400
|
+
const innerRaw = innerSteps[j];
|
|
401
|
+
// Re-derived per iteration rather than trusted from normalizeRepeat:
|
|
402
|
+
// same defense-in-depth every other step shape gets.
|
|
403
|
+
const innerKind = stepKind(innerRaw);
|
|
404
|
+
if (innerKind === null || innerKind === 'repeat') {
|
|
405
|
+
return {
|
|
406
|
+
ok: false,
|
|
407
|
+
error: `repeat: iteration ${iter}, step ${j}: invalid step shape`,
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
const outcome = await executeLeafStep(innerKind, innerRaw, state, deps);
|
|
411
|
+
if (!outcome.ok) {
|
|
412
|
+
return {
|
|
413
|
+
ok: false,
|
|
414
|
+
error: `repeat: iteration ${iter}, step ${j} (${innerKind}) failed — ${outcome.error}`,
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
entries.push(outcome.entry);
|
|
418
|
+
}
|
|
419
|
+
iterations.push(entries);
|
|
420
|
+
if (iterationDelayMs > 0) {
|
|
421
|
+
await new Promise((resolve) => {
|
|
422
|
+
setTimeout(resolve, iterationDelayMs);
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
const entry = {
|
|
427
|
+
iterations_completed: iterations.length,
|
|
428
|
+
stopped_by: stoppedBy,
|
|
429
|
+
iterations,
|
|
430
|
+
};
|
|
431
|
+
return { ok: true, entry };
|
|
432
|
+
}
|
|
433
|
+
/** Total step count INCLUDING a repeat's inner steps. A 20-step ceiling
|
|
434
|
+
* that only counted the outer array would let a single repeat smuggle in
|
|
435
|
+
* an arbitrarily long body. */
|
|
436
|
+
function countTotalSteps(steps) {
|
|
437
|
+
let total = 0;
|
|
438
|
+
// Walked as `unknown`, not as FlowStep: the array is typed for
|
|
439
|
+
// ergonomic test-writing but arrives as untrusted JSON cast at the wire
|
|
440
|
+
// boundary, so an entry can genuinely be null or a primitive. Narrowing
|
|
441
|
+
// from `unknown` keeps those guards meaningful instead of letting the
|
|
442
|
+
// declared type talk the compiler out of them.
|
|
443
|
+
for (const step of steps) {
|
|
444
|
+
total++;
|
|
445
|
+
if (typeof step === 'object' && step !== null && 'repeat' in step) {
|
|
446
|
+
const inner = step.repeat?.steps;
|
|
447
|
+
if (Array.isArray(inner))
|
|
448
|
+
total += inner.length;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return total;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Project a flow without executing it. Reads are allowed (a `while_found`
|
|
455
|
+
* probe is a read); nothing is ever dispatched.
|
|
456
|
+
*/
|
|
457
|
+
async function planFlow(steps, deps) {
|
|
458
|
+
const results = [];
|
|
459
|
+
for (let i = 0; i < steps.length; i++) {
|
|
460
|
+
const raw = steps[i];
|
|
461
|
+
const kind = stepKind(raw);
|
|
462
|
+
if (!kind) {
|
|
463
|
+
return withRecoverySnapshot(deps, i, 'unknown', 'flow: each step must be exactly one of find | click | type | press | wait_for | drag | sleep | repeat', results.length);
|
|
464
|
+
}
|
|
465
|
+
if (kind !== 'repeat') {
|
|
466
|
+
results.push({ step: kind });
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
const stepRecord = raw;
|
|
470
|
+
const normalized = normalizeRepeat(stepRecord.repeat);
|
|
471
|
+
if (!normalized.ok) {
|
|
472
|
+
return withRecoverySnapshot(deps, i, kind, normalized.error, results.length);
|
|
473
|
+
}
|
|
474
|
+
const { maxIterations, whileFound, delayMs } = normalized.value;
|
|
475
|
+
let wouldStart = true;
|
|
476
|
+
if (whileFound !== undefined) {
|
|
477
|
+
const probe = await whileFoundStillMatches(whileFound, deps);
|
|
478
|
+
if (!probe.ok) {
|
|
479
|
+
return withRecoverySnapshot(deps, i, kind, `repeat: while_found probe failed — ${probe.error}`, results.length);
|
|
480
|
+
}
|
|
481
|
+
wouldStart = probe.matched;
|
|
482
|
+
}
|
|
483
|
+
results.push({
|
|
484
|
+
step: 'repeat',
|
|
485
|
+
max_iterations: maxIterations,
|
|
486
|
+
inner_steps: normalized.value.steps.length,
|
|
487
|
+
delay_ms: delayMs,
|
|
488
|
+
...(whileFound === undefined ? {} : { while_found: whileFound }),
|
|
489
|
+
would_start: wouldStart,
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
return { ok: true, steps_completed: 0, results, dry_run: true };
|
|
493
|
+
}
|
|
107
494
|
/**
|
|
108
495
|
* Run a declarative sequence of steps strictly in order, stopping at the
|
|
109
496
|
* first failure. See the module doc comment for the implicit-target and
|
|
@@ -114,138 +501,47 @@ const NAVIGATION_RACE_HINT = " (previous step's settle reported context-destroye
|
|
|
114
501
|
* array may originate from an untrusted JSON payload cast at the wire
|
|
115
502
|
* boundary in `background.ts` (extension) / `cdp/transport.ts` (server),
|
|
116
503
|
* and a malformed entry must fail the flow cleanly rather than throw.
|
|
504
|
+
*
|
|
505
|
+
* With `options.dryRun`, the flow is validated and projected instead:
|
|
506
|
+
* nothing is dispatched, and each entry describes what WOULD run.
|
|
117
507
|
*/
|
|
118
|
-
export async function runFlow(steps, deps) {
|
|
508
|
+
export async function runFlow(steps, deps, options = {}) {
|
|
119
509
|
if (!Array.isArray(steps) || steps.length === 0) {
|
|
120
510
|
return withRecoverySnapshot(deps, 0, 'none', 'flow: steps must be a non-empty array', 0);
|
|
121
511
|
}
|
|
122
|
-
|
|
123
|
-
|
|
512
|
+
const totalSteps = countTotalSteps(steps);
|
|
513
|
+
if (totalSteps > MAX_FLOW_STEPS) {
|
|
514
|
+
return withRecoverySnapshot(deps, 0, 'none', `flow: at most ${MAX_FLOW_STEPS} steps allowed, got ${totalSteps}`, 0);
|
|
124
515
|
}
|
|
516
|
+
if (options.dryRun === true)
|
|
517
|
+
return planFlow(steps, deps);
|
|
125
518
|
const results = [];
|
|
126
|
-
|
|
127
|
-
/** `settle.reason` from the most recent SUCCESSFUL action step. When it
|
|
128
|
-
* is 'context-destroyed', the next step failure gets the page-load-race
|
|
129
|
-
* hint appended. Reset by any successful find/wait_for step — those
|
|
130
|
-
* prove the page is reachable again. */
|
|
131
|
-
let lastSettleReason;
|
|
132
|
-
const raceHint = () => lastSettleReason === 'context-destroyed' ? NAVIGATION_RACE_HINT : '';
|
|
519
|
+
const state = { implicitTarget: undefined, lastSettleReason: undefined };
|
|
133
520
|
for (let i = 0; i < steps.length; i++) {
|
|
134
521
|
const raw = steps[i];
|
|
135
522
|
const kind = stepKind(raw);
|
|
136
523
|
if (!kind) {
|
|
137
|
-
return withRecoverySnapshot(deps, i, 'unknown', 'flow: each step must be exactly one of find | click | type | press | wait_for | drag', results.length);
|
|
524
|
+
return withRecoverySnapshot(deps, i, 'unknown', 'flow: each step must be exactly one of find | click | type | press | wait_for | drag | sleep | repeat', results.length);
|
|
138
525
|
}
|
|
139
526
|
const stepRecord = raw;
|
|
140
|
-
if (kind === '
|
|
141
|
-
const
|
|
142
|
-
const outcome = await deps.performFind(params);
|
|
143
|
-
if (!outcome.ok) {
|
|
144
|
-
return withRecoverySnapshot(deps, i, kind, outcome.error + raceHint(), results.length);
|
|
145
|
-
}
|
|
146
|
-
const r = outcome.result;
|
|
147
|
-
if (!r.matched) {
|
|
148
|
-
const candidateNote = r.reason === 'multiple-matches' && r.candidates
|
|
149
|
-
? ` — candidates: ${JSON.stringify(r.candidates)}`
|
|
150
|
-
: '';
|
|
151
|
-
return withRecoverySnapshot(deps, i, kind, `find: ${r.reason ?? 'not-found'}${candidateNote}${raceHint()}`, results.length);
|
|
152
|
-
}
|
|
153
|
-
if (r.ambiguous) {
|
|
154
|
-
return withRecoverySnapshot(deps, i, kind, `find: selector "${r.selector ?? ''}" is ambiguous across shadow roots/iframes — refine text/role for a unique match`, results.length);
|
|
155
|
-
}
|
|
156
|
-
implicitTarget = r.selector;
|
|
157
|
-
lastSettleReason = undefined;
|
|
158
|
-
results.push({ selector: r.selector });
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
if (kind === 'wait_for') {
|
|
162
|
-
const params = stepRecord.wait_for;
|
|
163
|
-
const outcome = await deps.performWaitFor(params);
|
|
164
|
-
if (!outcome.ok) {
|
|
165
|
-
return withRecoverySnapshot(deps, i, kind, outcome.error + raceHint(), results.length);
|
|
166
|
-
}
|
|
167
|
-
if (!outcome.result.matched) {
|
|
168
|
-
// No race hint here: a wait_for step IS the recommended remedy for
|
|
169
|
-
// a navigation race — a plain timeout is a genuine non-match.
|
|
170
|
-
return withRecoverySnapshot(deps, i, kind, `wait_for: condition not met within timeout (${outcome.result.elapsed_ms}ms, ${outcome.result.checks} checks)`, results.length);
|
|
171
|
-
}
|
|
172
|
-
lastSettleReason = undefined;
|
|
173
|
-
results.push({ ok: true });
|
|
174
|
-
continue;
|
|
175
|
-
}
|
|
176
|
-
if (kind === 'drag') {
|
|
177
|
-
const params = stepRecord.drag;
|
|
178
|
-
// No resolveTarget here ON PURPOSE: a drag names BOTH endpoints
|
|
179
|
-
// explicitly (selector or coords), so there is no single `selector`
|
|
180
|
-
// slot the implicit target could unambiguously fill — a pending
|
|
181
|
-
// implicit target survives this step untouched for a later
|
|
182
|
-
// click/type/press, exactly like it survives a wait_for.
|
|
183
|
-
const outcome = await deps.performDrag(params);
|
|
184
|
-
if (!outcome.ok) {
|
|
185
|
-
return withRecoverySnapshot(deps, i, kind, outcome.error + raceHint(), results.length);
|
|
186
|
-
}
|
|
187
|
-
// A successful drag resolved both endpoints via an in-page probe,
|
|
188
|
-
// which proves the document is reachable again after any earlier
|
|
189
|
-
// navigation — clear the race hint like find/wait_for do. (Drag has
|
|
190
|
-
// no settle phase, so there is no settle reason to carry instead.)
|
|
191
|
-
lastSettleReason = undefined;
|
|
192
|
-
results.push(compactActionResult(outcome.result));
|
|
193
|
-
continue;
|
|
194
|
-
}
|
|
195
|
-
if (kind === 'click') {
|
|
196
|
-
const params = stepRecord.click;
|
|
197
|
-
const { resolved, consumed } = resolveTarget(params.selector, implicitTarget);
|
|
198
|
-
if (consumed)
|
|
199
|
-
implicitTarget = undefined;
|
|
200
|
-
if (resolved === undefined) {
|
|
201
|
-
return withRecoverySnapshot(deps, i, kind, 'click: no selector provided and no implicit target from a preceding find', results.length);
|
|
202
|
-
}
|
|
203
|
-
const outcome = await deps.performClick({
|
|
204
|
-
force: params.force,
|
|
205
|
-
settle_ms: params.settle_ms,
|
|
206
|
-
selector: resolved,
|
|
207
|
-
});
|
|
208
|
-
if (!outcome.ok) {
|
|
209
|
-
return withRecoverySnapshot(deps, i, kind, outcome.error + raceHint(), results.length);
|
|
210
|
-
}
|
|
211
|
-
lastSettleReason = outcome.result.settle?.reason;
|
|
212
|
-
results.push(compactActionResult(outcome.result));
|
|
213
|
-
continue;
|
|
214
|
-
}
|
|
215
|
-
if (kind === 'type') {
|
|
216
|
-
const params = stepRecord.type;
|
|
217
|
-
const { resolved, consumed } = resolveTarget(params.selector, implicitTarget);
|
|
218
|
-
if (consumed)
|
|
219
|
-
implicitTarget = undefined;
|
|
220
|
-
const outcome = await deps.performType({
|
|
221
|
-
text: params.text,
|
|
222
|
-
clear: params.clear,
|
|
223
|
-
settle_ms: params.settle_ms,
|
|
224
|
-
selector: resolved,
|
|
225
|
-
});
|
|
527
|
+
if (kind === 'repeat') {
|
|
528
|
+
const outcome = await executeRepeatStep(stepRecord.repeat, deps);
|
|
226
529
|
if (!outcome.ok) {
|
|
227
|
-
return withRecoverySnapshot(deps, i, kind, outcome.error
|
|
530
|
+
return withRecoverySnapshot(deps, i, kind, outcome.error, results.length);
|
|
228
531
|
}
|
|
229
|
-
|
|
230
|
-
|
|
532
|
+
// A repeat body runs with its own state and does not leak one out:
|
|
533
|
+
// a pending implicit target from BEFORE the repeat also does not
|
|
534
|
+
// survive it, since the body may have navigated or re-rendered.
|
|
535
|
+
state.implicitTarget = undefined;
|
|
536
|
+
state.lastSettleReason = undefined;
|
|
537
|
+
results.push(outcome.entry);
|
|
231
538
|
continue;
|
|
232
539
|
}
|
|
233
|
-
|
|
234
|
-
const params = stepRecord.press;
|
|
235
|
-
const { resolved, consumed } = resolveTarget(params.selector, implicitTarget);
|
|
236
|
-
if (consumed)
|
|
237
|
-
implicitTarget = undefined;
|
|
238
|
-
const outcome = await deps.performPress({
|
|
239
|
-
key: params.key,
|
|
240
|
-
modifiers: params.modifiers,
|
|
241
|
-
settle_ms: params.settle_ms,
|
|
242
|
-
selector: resolved,
|
|
243
|
-
});
|
|
540
|
+
const outcome = await executeLeafStep(kind, stepRecord, state, deps);
|
|
244
541
|
if (!outcome.ok) {
|
|
245
|
-
return withRecoverySnapshot(deps, i, kind, outcome.error
|
|
542
|
+
return withRecoverySnapshot(deps, i, kind, outcome.error, results.length);
|
|
246
543
|
}
|
|
247
|
-
|
|
248
|
-
results.push(compactActionResult(outcome.result));
|
|
544
|
+
results.push(outcome.entry);
|
|
249
545
|
}
|
|
250
546
|
return { ok: true, steps_completed: results.length, results };
|
|
251
547
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.js","sourceRoot":"","sources":["../src/flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAUH;;;;2EAI2E;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAC;AAqIjC,MAAM,UAAU,GAAwB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAE/F,SAAS,UAAU,CAAC,GAAW;IAC7B,OAAQ,UAAgC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACzD,CAAC;AAED;;;;4DAI4D;AAC5D,SAAS,QAAQ,CAAC,IAAa;IAC7B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC3D,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAA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pD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;YACtB,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACjE,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;gBAChB,OAAO,oBAAoB,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YAC5E,CAAC;YACD,mEAAmE;YACnE,iEAAiE;YACjE,gEAAgE;YAChE,KAAK,CAAC,cAAc,GAAG,SAAS,CAAC;YACjC,KAAK,CAAC,gBAAgB,GAAG,SAAS,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAC5B,SAAS;QACX,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;YAChB,OAAO,oBAAoB,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "browser-link",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.25.0",
|
|
5
5
|
"description": "Bridge between Chrome and an MCP client (Claude Code, OpenCode, GitHub Copilot CLI, …). Per-tab manual activation.",
|
|
6
6
|
"permissions": [
|
|
7
7
|
"debugger",
|