@jobshimo/browser-link 0.20.0 → 0.22.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/README.md +74 -70
- package/dist/bridge/events.d.ts +1 -1
- package/dist/bridge/events.js +6 -1
- package/dist/bridge/events.js.map +1 -1
- package/dist/bridge/ipc-client.d.ts +6 -7
- package/dist/bridge/ipc-client.js +4 -3
- package/dist/bridge/ipc-client.js.map +1 -1
- package/dist/bridge/protocol.d.ts +28 -16
- package/dist/bridge/protocol.js +23 -7
- package/dist/bridge/protocol.js.map +1 -1
- package/dist/bridge/server.d.ts +8 -10
- package/dist/bridge/server.js.map +1 -1
- package/dist/bridge/ws-bridge.d.ts +53 -18
- package/dist/bridge/ws-bridge.js +129 -21
- package/dist/bridge/ws-bridge.js.map +1 -1
- package/dist/cli.js +62 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/config.d.ts +5 -0
- package/dist/commands/config.js +62 -8
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/map.d.ts +2 -0
- package/dist/commands/map.js +698 -0
- package/dist/commands/map.js.map +1 -0
- package/dist/config.d.ts +19 -0
- package/dist/config.js.map +1 -1
- package/dist/extension/background.js +424 -1
- package/dist/extension/background.js.map +1 -1
- package/dist/extension/flow-recording-policy.d.ts +47 -0
- package/dist/extension/flow-recording-policy.js +54 -0
- package/dist/extension/flow-recording-policy.js.map +1 -0
- package/dist/extension/inpage/recorder.d.ts +35 -0
- package/dist/extension/inpage/recorder.js +333 -0
- package/dist/extension/inpage/recorder.js.map +1 -0
- package/dist/extension/manifest.json +1 -1
- package/dist/extension/popup.html +56 -0
- package/dist/extension/popup.js +195 -4
- package/dist/extension/popup.js.map +1 -1
- package/dist/extension/recording.d.ts +158 -0
- package/dist/extension/recording.js +214 -0
- package/dist/extension/recording.js.map +1 -0
- package/dist/map/queries.d.ts +107 -0
- package/dist/map/queries.js +174 -0
- package/dist/map/queries.js.map +1 -1
- package/dist/messages.d.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G,CAAC,CAAC,CAAC;AACvE,CAAC,CAAC,CAAC;AACH,qBAAqB,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;IACjC,yEAAyE;AAC3E,CAAC,CAAC,CAAC;AACH,0BAA0B,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;IACtC,+DAA+D;AACjE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure, chrome.*-free logic for turning captured in-page recorder events
|
|
3
|
+
* (see `inpage/recorder.ts`) into `browser.flow`-grammar steps (see
|
|
4
|
+
* `flow.ts`'s `FlowStep`), enforcing the 20-step cap, and building the
|
|
5
|
+
* navigation `wait_for` hint. background.ts owns the CDP binding, the
|
|
6
|
+
* `chrome.tabs.onUpdated` navigation signal, and the actual step array for
|
|
7
|
+
* an in-progress recording; every DECISION about what that array should
|
|
8
|
+
* contain next lives here, unit-tested without a real browser tab — same
|
|
9
|
+
* separation `idle-policy.ts` and `settle.ts` already established.
|
|
10
|
+
*
|
|
11
|
+
* PRIVACY NOTE: `toFlowStep` is the ONLY place a `type` step's `text`
|
|
12
|
+
* field is ever set, and it is ALWAYS the constant `TEXT_PLACEHOLDER`
|
|
13
|
+
* (`"<TEXT>"`) — there is no code path here, or in `inpage/recorder.ts`,
|
|
14
|
+
* that has access to a field's real value in the first place.
|
|
15
|
+
*/
|
|
16
|
+
import type { FlowStep } from './flow.js';
|
|
17
|
+
/** Mirrors `MAX_FLOW_STEPS` in flow.ts / the server's `browser.flow` schema
|
|
18
|
+
* — a recording can never produce more steps than a flow recipe can hold. */
|
|
19
|
+
export declare const MAX_RECORDING_STEPS = 20;
|
|
20
|
+
/** The ONLY string ever used for a recorded `type` step's `text` field.
|
|
21
|
+
* See the module doc — recorder.ts never transmits the real value, so this
|
|
22
|
+
* constant is never substituting anything sensitive; it exists purely so
|
|
23
|
+
* the recipe is immediately recognizable as needing a real value filled in
|
|
24
|
+
* before replay (same placeholder convention `browser.map.save` already
|
|
25
|
+
* documents for hand-written flow recipes). */
|
|
26
|
+
export declare const TEXT_PLACEHOLDER = "<TEXT>";
|
|
27
|
+
/** The default navigation-hint step suggested after a step that caused the
|
|
28
|
+
* tab to navigate. `expression` is a valid `wait_for` mode per the
|
|
29
|
+
* `browser.flow` schema (`oneOf: [selector, expression, network_url]`) —
|
|
30
|
+
* kept intentionally simple (readyState) rather than guessing at a
|
|
31
|
+
* selector on a document the recorder has not seen yet. Rendered by the
|
|
32
|
+
* popup as an EDITABLE suggestion, not a fixed fact — the user (or a later
|
|
33
|
+
* agent editing the saved recipe) may replace it with a more specific
|
|
34
|
+
* selector-based wait. */
|
|
35
|
+
export declare function buildNavigationWaitForStep(): FlowStep;
|
|
36
|
+
/** Raw payload shapes emitted by `inpage/recorder.ts` over the CDP
|
|
37
|
+
* binding — one JSON string per call. Mirrors the payload shapes
|
|
38
|
+
* documented in recorder.ts's module doc (minus the transport-level
|
|
39
|
+
* `nonce`, which `parseRecordedPayload` consumes and strips). */
|
|
40
|
+
export type RecordedPayload = {
|
|
41
|
+
kind: 'click';
|
|
42
|
+
selector: string;
|
|
43
|
+
ambiguous?: boolean;
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'type';
|
|
46
|
+
selector: string;
|
|
47
|
+
ambiguous?: boolean;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'press';
|
|
50
|
+
key: string;
|
|
51
|
+
};
|
|
52
|
+
/** Fresh per-recording-session identifiers (see recorder.ts's THREAT MODEL
|
|
53
|
+
* doc). The three global NAMES (binding, active-flag, stop-fn) are
|
|
54
|
+
* INDEPENDENT random values with no shared prefix OR suffix — so a page
|
|
55
|
+
* cannot cheaply enumerate `Object.getOwnPropertyNames(window)` for a
|
|
56
|
+
* predictable pattern (`startsWith('__blRec_')`, `endsWith('_active')`, …)
|
|
57
|
+
* to detect that recording is active; every recorder global is
|
|
58
|
+
* indistinguishable from an ordinary random page global. The `nonce` is the
|
|
59
|
+
* shared secret that authenticates every payload. All are generated from
|
|
60
|
+
* `crypto.randomUUID()` — available in the MV3 service worker, the popup,
|
|
61
|
+
* and every test environment this repo targets (Node >= 19). A leading
|
|
62
|
+
* letter is prepended so each name is a syntactically valid identifier
|
|
63
|
+
* (the recorder accesses every global via bracket notation, so this is
|
|
64
|
+
* belt-and-braces, not strictly required). */
|
|
65
|
+
export interface RecordingSession {
|
|
66
|
+
bindingName: string;
|
|
67
|
+
activeFlag: string;
|
|
68
|
+
stopFn: string;
|
|
69
|
+
nonce: string;
|
|
70
|
+
}
|
|
71
|
+
export declare function generateRecordingSession(): RecordingSession;
|
|
72
|
+
/** Upper bound on a recorded selector's length. genSelectorInfo's worst
|
|
73
|
+
* case (a fully-qualified 32-part structural path) sits far below this;
|
|
74
|
+
* anything longer is not a selector the recorder produced. */
|
|
75
|
+
export declare const MAX_RECORDED_SELECTOR_LENGTH = 1000;
|
|
76
|
+
/** The ONLY keys the recorder ever emits as a `press` payload — the
|
|
77
|
+
* allowlist `parseRecordedPayload` enforces. Deliberately NOT the full set
|
|
78
|
+
* `browser.press` accepts: recorder-originated steps are validated MORE
|
|
79
|
+
* strictly than agent-authored ones, because the binding channel they
|
|
80
|
+
* arrive over is callable by page scripts (see recorder.ts's THREAT MODEL
|
|
81
|
+
* doc). Kept in sync by hand with recorder.ts's SPECIAL_KEYS + Enter. */
|
|
82
|
+
export declare const RECORDED_PRESS_KEYS: ReadonlySet<string>;
|
|
83
|
+
/**
|
|
84
|
+
* Parse + validate one `Runtime.bindingCalled` payload string against the
|
|
85
|
+
* ACTIVE session's nonce. Returns `null` on anything malformed — and the
|
|
86
|
+
* bar here is deliberately HIGHER than the generic `validateFlowSteps`,
|
|
87
|
+
* because the CDP binding is callable by any script running in the target
|
|
88
|
+
* page (see recorder.ts's THREAT MODEL doc), not just the recorder:
|
|
89
|
+
*
|
|
90
|
+
* - the payload's `nonce` must equal `expectedNonce` (the per-session
|
|
91
|
+
* secret only the injected recorder knows) — a blind page-script call
|
|
92
|
+
* fails HERE and records nothing;
|
|
93
|
+
* - `selector` is length-capped and rejected on control characters, so
|
|
94
|
+
* the channel cannot smuggle arbitrary blobs (e.g. a cookie string
|
|
95
|
+
* disguised as a selector) into the map DB;
|
|
96
|
+
* - `key` must be on the exact allowlist of keys the recorder emits.
|
|
97
|
+
*/
|
|
98
|
+
export declare function parseRecordedPayload(raw: string, expectedNonce: string): RecordedPayload | null;
|
|
99
|
+
/**
|
|
100
|
+
* Convert one captured payload into its `browser.flow`-grammar step. The
|
|
101
|
+
* `type` branch is the privacy boundary described in the module doc — the
|
|
102
|
+
* placeholder is a constant, never derived from anything the payload
|
|
103
|
+
* carries (the payload has no field capable of carrying a real value in
|
|
104
|
+
* the first place).
|
|
105
|
+
*
|
|
106
|
+
* The payload's `ambiguous` flag is deliberately NOT embedded in the step
|
|
107
|
+
* itself: `browser.flow`'s JSON schema sets `additionalProperties: false`
|
|
108
|
+
* on every step body, so an extra key would make the recipe fail schema
|
|
109
|
+
* validation at REPLAY time. Instead, background.ts tracks which step
|
|
110
|
+
* indices were ambiguous (`RecordingState.ambiguousStepIndices`), the
|
|
111
|
+
* popup surfaces a per-step warning in the review list, and
|
|
112
|
+
* `buildAmbiguousNote` below folds the same information into the saved
|
|
113
|
+
* recipe's description — the computed safety signal is surfaced, never
|
|
114
|
+
* silently dropped.
|
|
115
|
+
*/
|
|
116
|
+
export declare function toFlowStep(payload: RecordedPayload): FlowStep;
|
|
117
|
+
/**
|
|
118
|
+
* Human-readable caution for a recipe whose recorded selectors could not
|
|
119
|
+
* be made unique across the page's deep search scope (see
|
|
120
|
+
* `genSelectorInfo`'s `ambiguous` flag). `indices` are 0-based step
|
|
121
|
+
* positions; the note renders them 1-based to match the popup's numbered
|
|
122
|
+
* review list. Returns `null` when nothing was ambiguous, so callers can
|
|
123
|
+
* skip touching the description entirely in the common case.
|
|
124
|
+
*/
|
|
125
|
+
export declare function buildAmbiguousNote(indices: readonly number[]): string | null;
|
|
126
|
+
/** Result of appending a step to an in-progress recording. `capped: true`
|
|
127
|
+
* means the 20-step ceiling was already reached BEFORE this call — the
|
|
128
|
+
* step was NOT appended, and background.ts should auto-stop the
|
|
129
|
+
* recording and surface the cap notice to the popup. */
|
|
130
|
+
export interface AppendResult {
|
|
131
|
+
steps: FlowStep[];
|
|
132
|
+
capped: boolean;
|
|
133
|
+
}
|
|
134
|
+
/** Append one already-converted `FlowStep` to a recording's step list,
|
|
135
|
+
* enforcing `MAX_RECORDING_STEPS`. Pure — returns a NEW array, never
|
|
136
|
+
* mutates `steps`, so background.ts can keep using the previous array if
|
|
137
|
+
* `capped` comes back true. */
|
|
138
|
+
export declare function appendRecordingStep(steps: readonly FlowStep[], step: FlowStep): AppendResult;
|
|
139
|
+
/**
|
|
140
|
+
* Decide whether a newly-observed tab URL represents a navigation that
|
|
141
|
+
* happened WHILE recording (vs. e.g. a same-document hash change or a
|
|
142
|
+
* redundant `chrome.tabs.onUpdated` "complete" event for the URL already
|
|
143
|
+
* being recorded). Pure string comparison — background.ts is responsible
|
|
144
|
+
* for tracking `lastRecordedUrl` and calling this on every "complete"
|
|
145
|
+
* update for the recording tab.
|
|
146
|
+
*
|
|
147
|
+
* LIMITATION (documented in the README): the caller drives this off
|
|
148
|
+
* `chrome.tabs.onUpdated`'s "complete" status, which does NOT fire for
|
|
149
|
+
* single-page-app route changes done purely via the History API
|
|
150
|
+
* (`pushState`/`replaceState`, no document load). Those transitions get no
|
|
151
|
+
* automatic `wait_for` hint step; a user editing the recipe adds one by
|
|
152
|
+
* hand if replay needs to wait for the SPA route to settle.
|
|
153
|
+
*/
|
|
154
|
+
export declare function isNavigationForRecording(lastRecordedUrl: string, currentUrl: string): boolean;
|
|
155
|
+
/** One-line human-readable description of a `FlowStep`, for the popup's
|
|
156
|
+
* step review list. Deliberately terse — the popup shows these in a
|
|
157
|
+
* scrollable `<ol>` alongside the step count. */
|
|
158
|
+
export declare function describeFlowStep(step: FlowStep): string;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/** Mirrors `MAX_FLOW_STEPS` in flow.ts / the server's `browser.flow` schema
|
|
2
|
+
* — a recording can never produce more steps than a flow recipe can hold. */
|
|
3
|
+
export const MAX_RECORDING_STEPS = 20;
|
|
4
|
+
/** The ONLY string ever used for a recorded `type` step's `text` field.
|
|
5
|
+
* See the module doc — recorder.ts never transmits the real value, so this
|
|
6
|
+
* constant is never substituting anything sensitive; it exists purely so
|
|
7
|
+
* the recipe is immediately recognizable as needing a real value filled in
|
|
8
|
+
* before replay (same placeholder convention `browser.map.save` already
|
|
9
|
+
* documents for hand-written flow recipes). */
|
|
10
|
+
export const TEXT_PLACEHOLDER = '<TEXT>';
|
|
11
|
+
/** The default navigation-hint step suggested after a step that caused the
|
|
12
|
+
* tab to navigate. `expression` is a valid `wait_for` mode per the
|
|
13
|
+
* `browser.flow` schema (`oneOf: [selector, expression, network_url]`) —
|
|
14
|
+
* kept intentionally simple (readyState) rather than guessing at a
|
|
15
|
+
* selector on a document the recorder has not seen yet. Rendered by the
|
|
16
|
+
* popup as an EDITABLE suggestion, not a fixed fact — the user (or a later
|
|
17
|
+
* agent editing the saved recipe) may replace it with a more specific
|
|
18
|
+
* selector-based wait. */
|
|
19
|
+
export function buildNavigationWaitForStep() {
|
|
20
|
+
return { wait_for: { expression: "document.readyState === 'complete'" } };
|
|
21
|
+
}
|
|
22
|
+
export function generateRecordingSession() {
|
|
23
|
+
// A fresh bare random identifier per call. 32 hex chars from randomUUID,
|
|
24
|
+
// with the FIRST char remapped to a letter whose value still varies with
|
|
25
|
+
// the random input (hex letters a-f pass through; digits 0-9 map to g-p).
|
|
26
|
+
// Result: a valid identifier with NO fixed, shared, guessable prefix or
|
|
27
|
+
// suffix across sessions — nothing a page can pattern-match on.
|
|
28
|
+
const rand = () => {
|
|
29
|
+
const hex = crypto.randomUUID().replace(/-/g, '');
|
|
30
|
+
const first = hex[0];
|
|
31
|
+
const firstLetter = /[0-9]/.test(first)
|
|
32
|
+
? String.fromCharCode('g'.charCodeAt(0) + Number(first))
|
|
33
|
+
: first;
|
|
34
|
+
return firstLetter + hex.slice(1);
|
|
35
|
+
};
|
|
36
|
+
return { bindingName: rand(), activeFlag: rand(), stopFn: rand(), nonce: rand() };
|
|
37
|
+
}
|
|
38
|
+
/** Upper bound on a recorded selector's length. genSelectorInfo's worst
|
|
39
|
+
* case (a fully-qualified 32-part structural path) sits far below this;
|
|
40
|
+
* anything longer is not a selector the recorder produced. */
|
|
41
|
+
export const MAX_RECORDED_SELECTOR_LENGTH = 1000;
|
|
42
|
+
/** The ONLY keys the recorder ever emits as a `press` payload — the
|
|
43
|
+
* allowlist `parseRecordedPayload` enforces. Deliberately NOT the full set
|
|
44
|
+
* `browser.press` accepts: recorder-originated steps are validated MORE
|
|
45
|
+
* strictly than agent-authored ones, because the binding channel they
|
|
46
|
+
* arrive over is callable by page scripts (see recorder.ts's THREAT MODEL
|
|
47
|
+
* doc). Kept in sync by hand with recorder.ts's SPECIAL_KEYS + Enter. */
|
|
48
|
+
export const RECORDED_PRESS_KEYS = new Set([
|
|
49
|
+
'Enter',
|
|
50
|
+
'Escape',
|
|
51
|
+
'Tab',
|
|
52
|
+
'ArrowUp',
|
|
53
|
+
'ArrowDown',
|
|
54
|
+
'ArrowLeft',
|
|
55
|
+
'ArrowRight',
|
|
56
|
+
]);
|
|
57
|
+
/**
|
|
58
|
+
* Characters no legitimate CSS selector generated by genSelectorInfo can
|
|
59
|
+
* contain: C0 + DEL + C1 controls, ZWSP, line/paragraph separators, the
|
|
60
|
+
* legacy bidi embedding/override controls (LRE..RLO), WORD JOINER, the
|
|
61
|
+
* modern bidi isolate block (LRI..PDI), and BOM. Deliberately does NOT
|
|
62
|
+
* block ZWJ (U+200D — present in every multi-codepoint emoji sequence) or
|
|
63
|
+
* LRM/RLM (U+200E/U+200F — embedded by RTL-aware sites): genSelectorInfo's
|
|
64
|
+
* aria-label branch inlines raw attribute text, so a legit label carrying
|
|
65
|
+
* an emoji or directional mark must still parse. The nonce remains the
|
|
66
|
+
* real gate; this is defense in depth against a selector-shaped smuggling
|
|
67
|
+
* attempt using genuinely invisible / spoofing characters.
|
|
68
|
+
*/
|
|
69
|
+
/* eslint-disable no-control-regex -- intentionally matches control chars */
|
|
70
|
+
const CONTROL_CHARS = /[\u0000-\u001F\u007F-\u009F\u200B\u2028\u2029\u202A-\u202E\u2060\u2066-\u2069\uFEFF]/;
|
|
71
|
+
/* eslint-enable no-control-regex */
|
|
72
|
+
/**
|
|
73
|
+
* Parse + validate one `Runtime.bindingCalled` payload string against the
|
|
74
|
+
* ACTIVE session's nonce. Returns `null` on anything malformed — and the
|
|
75
|
+
* bar here is deliberately HIGHER than the generic `validateFlowSteps`,
|
|
76
|
+
* because the CDP binding is callable by any script running in the target
|
|
77
|
+
* page (see recorder.ts's THREAT MODEL doc), not just the recorder:
|
|
78
|
+
*
|
|
79
|
+
* - the payload's `nonce` must equal `expectedNonce` (the per-session
|
|
80
|
+
* secret only the injected recorder knows) — a blind page-script call
|
|
81
|
+
* fails HERE and records nothing;
|
|
82
|
+
* - `selector` is length-capped and rejected on control characters, so
|
|
83
|
+
* the channel cannot smuggle arbitrary blobs (e.g. a cookie string
|
|
84
|
+
* disguised as a selector) into the map DB;
|
|
85
|
+
* - `key` must be on the exact allowlist of keys the recorder emits.
|
|
86
|
+
*/
|
|
87
|
+
export function parseRecordedPayload(raw, expectedNonce) {
|
|
88
|
+
let obj;
|
|
89
|
+
try {
|
|
90
|
+
obj = JSON.parse(raw);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
if (!obj || typeof obj !== 'object')
|
|
96
|
+
return null;
|
|
97
|
+
const o = obj;
|
|
98
|
+
if (typeof o.nonce !== 'string' || o.nonce !== expectedNonce)
|
|
99
|
+
return null;
|
|
100
|
+
if (o.kind === 'click' || o.kind === 'type') {
|
|
101
|
+
if (typeof o.selector !== 'string' || o.selector.length === 0)
|
|
102
|
+
return null;
|
|
103
|
+
if (o.selector.length > MAX_RECORDED_SELECTOR_LENGTH)
|
|
104
|
+
return null;
|
|
105
|
+
if (CONTROL_CHARS.test(o.selector))
|
|
106
|
+
return null;
|
|
107
|
+
const ambiguous = o.ambiguous === true;
|
|
108
|
+
return ambiguous
|
|
109
|
+
? { kind: o.kind, selector: o.selector, ambiguous: true }
|
|
110
|
+
: { kind: o.kind, selector: o.selector };
|
|
111
|
+
}
|
|
112
|
+
if (o.kind === 'press') {
|
|
113
|
+
if (typeof o.key !== 'string' || !RECORDED_PRESS_KEYS.has(o.key))
|
|
114
|
+
return null;
|
|
115
|
+
return { kind: 'press', key: o.key };
|
|
116
|
+
}
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Convert one captured payload into its `browser.flow`-grammar step. The
|
|
121
|
+
* `type` branch is the privacy boundary described in the module doc — the
|
|
122
|
+
* placeholder is a constant, never derived from anything the payload
|
|
123
|
+
* carries (the payload has no field capable of carrying a real value in
|
|
124
|
+
* the first place).
|
|
125
|
+
*
|
|
126
|
+
* The payload's `ambiguous` flag is deliberately NOT embedded in the step
|
|
127
|
+
* itself: `browser.flow`'s JSON schema sets `additionalProperties: false`
|
|
128
|
+
* on every step body, so an extra key would make the recipe fail schema
|
|
129
|
+
* validation at REPLAY time. Instead, background.ts tracks which step
|
|
130
|
+
* indices were ambiguous (`RecordingState.ambiguousStepIndices`), the
|
|
131
|
+
* popup surfaces a per-step warning in the review list, and
|
|
132
|
+
* `buildAmbiguousNote` below folds the same information into the saved
|
|
133
|
+
* recipe's description — the computed safety signal is surfaced, never
|
|
134
|
+
* silently dropped.
|
|
135
|
+
*/
|
|
136
|
+
export function toFlowStep(payload) {
|
|
137
|
+
switch (payload.kind) {
|
|
138
|
+
case 'click':
|
|
139
|
+
return { click: { selector: payload.selector } };
|
|
140
|
+
case 'type':
|
|
141
|
+
return { type: { selector: payload.selector, text: TEXT_PLACEHOLDER } };
|
|
142
|
+
case 'press':
|
|
143
|
+
return { press: { key: payload.key } };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Human-readable caution for a recipe whose recorded selectors could not
|
|
148
|
+
* be made unique across the page's deep search scope (see
|
|
149
|
+
* `genSelectorInfo`'s `ambiguous` flag). `indices` are 0-based step
|
|
150
|
+
* positions; the note renders them 1-based to match the popup's numbered
|
|
151
|
+
* review list. Returns `null` when nothing was ambiguous, so callers can
|
|
152
|
+
* skip touching the description entirely in the common case.
|
|
153
|
+
*/
|
|
154
|
+
export function buildAmbiguousNote(indices) {
|
|
155
|
+
if (indices.length === 0)
|
|
156
|
+
return null;
|
|
157
|
+
const human = indices.map((i) => i + 1).join(', ');
|
|
158
|
+
const plural = indices.length === 1 ? 'Step' : 'Steps';
|
|
159
|
+
return (`${plural} ${human}: selector may match multiple elements ` +
|
|
160
|
+
`(resolves first-match-wins) — verify before replaying.`);
|
|
161
|
+
}
|
|
162
|
+
/** Append one already-converted `FlowStep` to a recording's step list,
|
|
163
|
+
* enforcing `MAX_RECORDING_STEPS`. Pure — returns a NEW array, never
|
|
164
|
+
* mutates `steps`, so background.ts can keep using the previous array if
|
|
165
|
+
* `capped` comes back true. */
|
|
166
|
+
export function appendRecordingStep(steps, step) {
|
|
167
|
+
if (steps.length >= MAX_RECORDING_STEPS) {
|
|
168
|
+
return { steps: [...steps], capped: true };
|
|
169
|
+
}
|
|
170
|
+
return { steps: [...steps, step], capped: false };
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Decide whether a newly-observed tab URL represents a navigation that
|
|
174
|
+
* happened WHILE recording (vs. e.g. a same-document hash change or a
|
|
175
|
+
* redundant `chrome.tabs.onUpdated` "complete" event for the URL already
|
|
176
|
+
* being recorded). Pure string comparison — background.ts is responsible
|
|
177
|
+
* for tracking `lastRecordedUrl` and calling this on every "complete"
|
|
178
|
+
* update for the recording tab.
|
|
179
|
+
*
|
|
180
|
+
* LIMITATION (documented in the README): the caller drives this off
|
|
181
|
+
* `chrome.tabs.onUpdated`'s "complete" status, which does NOT fire for
|
|
182
|
+
* single-page-app route changes done purely via the History API
|
|
183
|
+
* (`pushState`/`replaceState`, no document load). Those transitions get no
|
|
184
|
+
* automatic `wait_for` hint step; a user editing the recipe adds one by
|
|
185
|
+
* hand if replay needs to wait for the SPA route to settle.
|
|
186
|
+
*/
|
|
187
|
+
export function isNavigationForRecording(lastRecordedUrl, currentUrl) {
|
|
188
|
+
return currentUrl.length > 0 && currentUrl !== lastRecordedUrl;
|
|
189
|
+
}
|
|
190
|
+
/** One-line human-readable description of a `FlowStep`, for the popup's
|
|
191
|
+
* step review list. Deliberately terse — the popup shows these in a
|
|
192
|
+
* scrollable `<ol>` alongside the step count. */
|
|
193
|
+
export function describeFlowStep(step) {
|
|
194
|
+
if ('click' in step)
|
|
195
|
+
return `Click ${step.click.selector ?? '(implicit target)'}`;
|
|
196
|
+
if ('type' in step)
|
|
197
|
+
return `Type into ${step.type.selector ?? '(focused field)'}`;
|
|
198
|
+
if ('press' in step)
|
|
199
|
+
return `Press ${step.press.key}`;
|
|
200
|
+
if ('wait_for' in step) {
|
|
201
|
+
const w = step.wait_for;
|
|
202
|
+
if (w.selector)
|
|
203
|
+
return `Wait for ${w.selector}`;
|
|
204
|
+
if (w.expression)
|
|
205
|
+
return `Wait for ${w.expression}`;
|
|
206
|
+
if (w.network_url)
|
|
207
|
+
return `Wait for network: ${w.network_url}`;
|
|
208
|
+
return 'Wait';
|
|
209
|
+
}
|
|
210
|
+
if ('find' in step)
|
|
211
|
+
return `Find "${step.find.text}"`;
|
|
212
|
+
return 'Unknown step';
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=recording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recording.js","sourceRoot":"","sources":["../src/recording.ts"],"names":[],"mappings":"AAiBA;6EAC6E;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC;;;;;+CAK+C;AAC/C,MAAM,CAAC,MAAM,g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AI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;IACtD,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
package/dist/map/queries.d.ts
CHANGED
|
@@ -42,6 +42,34 @@ export declare function saveEntry(input: SaveEntryInput): {
|
|
|
42
42
|
app: AppRow;
|
|
43
43
|
entry: EntryRow;
|
|
44
44
|
};
|
|
45
|
+
export interface RestoreEntryInput {
|
|
46
|
+
origin: string;
|
|
47
|
+
app_key?: string | null;
|
|
48
|
+
title?: string | null;
|
|
49
|
+
url_pattern: string;
|
|
50
|
+
kind: EntryKind;
|
|
51
|
+
purpose: string;
|
|
52
|
+
payload: unknown;
|
|
53
|
+
notes?: string | null;
|
|
54
|
+
verified_at?: string | null;
|
|
55
|
+
failed_at?: string | null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Restore-only counterpart to `saveEntry`, used by `browser-link map
|
|
59
|
+
* import`. `saveEntry` models "the agent just successfully executed
|
|
60
|
+
* this": it stamps `verified_at = now` and clears `failed_at` — the right
|
|
61
|
+
* semantics for a live save, and the WRONG ones for a backup restore,
|
|
62
|
+
* where re-stamping would silently "heal" a selector the map knew to be
|
|
63
|
+
* broken. This writes `verified_at`/`failed_at`/`notes` exactly as given
|
|
64
|
+
* (including null), preserving the entry's track record through an
|
|
65
|
+
* export → import round trip. Same upsert key as `saveEntry`
|
|
66
|
+
* ((app, url_pattern, kind, purpose)); the agent-facing
|
|
67
|
+
* `browser.map.save` never calls this.
|
|
68
|
+
*/
|
|
69
|
+
export declare function restoreEntry(input: RestoreEntryInput): {
|
|
70
|
+
app: AppRow;
|
|
71
|
+
entry: EntryRow;
|
|
72
|
+
};
|
|
45
73
|
export interface RecallInput {
|
|
46
74
|
origin: string;
|
|
47
75
|
app_key?: string | null;
|
|
@@ -71,6 +99,59 @@ export interface ForgetResult {
|
|
|
71
99
|
export declare function forget(input: ForgetInput): ForgetResult;
|
|
72
100
|
export declare function renameApp(app_id: number, new_app_key: string): AppRow | null;
|
|
73
101
|
export declare function listApps(): AppRow[];
|
|
102
|
+
export interface AppSummary extends AppRow {
|
|
103
|
+
entries: number;
|
|
104
|
+
flows: number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Every app with its entry and flow counts, most-recently-seen first.
|
|
108
|
+
* Powers `browser-link map ls` — `listApps()` alone does not carry counts,
|
|
109
|
+
* and the CLI is the only caller that needs them (the MCP-facing
|
|
110
|
+
* `browser.map.apps` tool intentionally stays lean). Counts are computed
|
|
111
|
+
* with correlated subqueries rather than a JOIN + GROUP BY so an app with
|
|
112
|
+
* zero entries or zero flows still gets a row (a JOIN would need two LEFT
|
|
113
|
+
* JOINs to avoid multiplying rows across both tables).
|
|
114
|
+
*/
|
|
115
|
+
export declare function listAppsWithCounts(): AppSummary[];
|
|
116
|
+
/**
|
|
117
|
+
* Every app matching an identifier, most-recently-seen first — by app_key
|
|
118
|
+
* (exact match) first, falling back to origin (canonicalized, same rule
|
|
119
|
+
* every other write/lookup path uses) when no app_key matches. app_key
|
|
120
|
+
* uniqueness is per-origin, so the same key CAN match apps on several
|
|
121
|
+
* origins; a caller about to DELETE something must check `length > 1`
|
|
122
|
+
* and confirm with the user rather than silently trusting position 0
|
|
123
|
+
* (see `browser-link map forget --flow`). Read-only callers can take
|
|
124
|
+
* position 0 directly — that is exactly what `findApp` does.
|
|
125
|
+
*/
|
|
126
|
+
export declare function findAppCandidates(identifier: string): AppRow[];
|
|
127
|
+
/**
|
|
128
|
+
* Resolve one app by app_key (exact match; most-recently-seen wins if the
|
|
129
|
+
* same key was used across more than one origin) OR by origin
|
|
130
|
+
* (canonicalized, same rule every other write/lookup path uses). Backs
|
|
131
|
+
* `browser-link map show`/`export <app>`, where a human names one app with
|
|
132
|
+
* whichever identifier they remember. Returns `null` — never throws — so
|
|
133
|
+
* callers can produce their own "not found, did you mean…" message with
|
|
134
|
+
* the full app_key list from `listApps()`. Destructive callers must use
|
|
135
|
+
* `findAppCandidates` instead, so an ambiguous identifier is detected
|
|
136
|
+
* BEFORE anything is deleted.
|
|
137
|
+
*/
|
|
138
|
+
export declare function findApp(identifier: string): AppRow | null;
|
|
139
|
+
/**
|
|
140
|
+
* Exact (origin, app_key) lookup — the same identity `apps`' UNIQUE
|
|
141
|
+
* constraint (and `upsertApp`) matches on. Used by `browser-link map
|
|
142
|
+
* import --replace` to find the existing app to wipe before writing the
|
|
143
|
+
* imported data fresh; unlike `findApp`, this never falls back to a
|
|
144
|
+
* fuzzier match — replace must target the exact app the export file
|
|
145
|
+
* describes, not a same-named app_key on a different origin.
|
|
146
|
+
*/
|
|
147
|
+
export declare function findAppByOriginAndKey(origin: string, app_key: string): AppRow | null;
|
|
148
|
+
/**
|
|
149
|
+
* Every entry saved for an app, regardless of url_pattern. Unlike
|
|
150
|
+
* `recall()`, this is not origin/url-scoped and — like `getMapHint` —
|
|
151
|
+
* deliberately does NOT touch `last_seen_at`: a CLI read (`map show`,
|
|
152
|
+
* `map export`) is passive and must not affect map freshness.
|
|
153
|
+
*/
|
|
154
|
+
export declare function listEntries(app_id: number): EntryRow[];
|
|
74
155
|
export interface MapHint {
|
|
75
156
|
app_key: string;
|
|
76
157
|
entries: number;
|
|
@@ -118,5 +199,31 @@ export declare function saveFlow(input: SaveFlowInput): {
|
|
|
118
199
|
app: AppRow;
|
|
119
200
|
flow: FlowRow;
|
|
120
201
|
};
|
|
202
|
+
export interface RestoreFlowInput extends SaveFlowInput {
|
|
203
|
+
use_count?: number;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Restore-only counterpart to `saveFlow`, used by `browser-link map
|
|
207
|
+
* import`. `saveFlow` always inserts with `use_count = 0` — right for a
|
|
208
|
+
* brand-new recipe, wrong for a backup restore, where it would erase the
|
|
209
|
+
* flow's track record. On insert, the imported `use_count` is written
|
|
210
|
+
* as-is; on update (merge into an app that already has this flow name),
|
|
211
|
+
* the LARGER of the existing and imported counts wins, so a merge can
|
|
212
|
+
* never LOWER a locally-earned track record. Only a non-negative integer
|
|
213
|
+
* is accepted — anything else falls back to 0 rather than poisoning the
|
|
214
|
+
* column. The agent-facing `browser.map.save` never calls this.
|
|
215
|
+
*/
|
|
216
|
+
export declare function restoreFlow(input: RestoreFlowInput): {
|
|
217
|
+
app: AppRow;
|
|
218
|
+
flow: FlowRow;
|
|
219
|
+
};
|
|
121
220
|
/** Every flow recipe saved for an app, alphabetical by name. */
|
|
122
221
|
export declare function listFlows(app_id: number): FlowRow[];
|
|
222
|
+
/**
|
|
223
|
+
* Delete a single named flow recipe, leaving the app and its entries
|
|
224
|
+
* untouched. Backs `browser-link map forget <app> --flow <name>` — the
|
|
225
|
+
* single-flow counterpart to `forget()`'s app_id/entry_id deletion, which
|
|
226
|
+
* has no notion of a flow name. Returns whether a row was actually
|
|
227
|
+
* deleted, so the caller can tell "deleted" from "no such flow".
|
|
228
|
+
*/
|
|
229
|
+
export declare function deleteFlow(app_id: number, name: string): boolean;
|