browsertrack 0.1.2 → 0.2.1
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/AGENTS.md +6 -2
- package/dist/{chunk-ILRYKMME.js → chunk-3HOXPTM2.js} +97 -3
- package/dist/chunk-3HOXPTM2.js.map +1 -0
- package/dist/{chunk-G2Y3CXCY.js → chunk-464D4U2U.js} +86 -3
- package/dist/chunk-464D4U2U.js.map +1 -0
- package/dist/{chunk-SPCIROIU.js → chunk-7OCOQGDN.js} +24 -5
- package/dist/chunk-7OCOQGDN.js.map +1 -0
- package/dist/{chunk-SKCMT2DE.js → chunk-INXDWPJW.js} +806 -160
- package/dist/chunk-INXDWPJW.js.map +1 -0
- package/dist/cli/index.js +202 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/client/index.cjs +809 -161
- package/dist/client/index.d.ts +62 -11
- package/dist/client/index.js +7 -3
- package/dist/client.iife.js +206 -27
- package/dist/{notes-CBvN91Wf.d.ts → commands-fjuqKzkm.d.ts} +125 -91
- package/dist/core/index.d.ts +2 -2
- package/dist/daemon/index.d.ts +3 -3
- package/dist/daemon/index.js +2 -2
- package/dist/{engine-CeT9URuN.d.ts → engine-CmchnMDq.d.ts} +13 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/mcp/index.d.ts +4 -4
- package/dist/mcp/index.js +2 -2
- package/dist/{projects-CY8ungMt.d.ts → projects-DB7S312i.d.ts} +1 -1
- package/dist/{server-Dd8NX2Mk.d.ts → server-DiVmTrIR.d.ts} +1 -1
- package/docs/component-resolver.md +108 -0
- package/docs/index.md +3 -1
- package/docs/mcp-reference.md +15 -2
- package/docs/scenarios-flows.md +86 -0
- package/docs/visual-notes.md +36 -0
- package/package.json +1 -1
- package/packages/client/src/client.ts +18 -1
- package/packages/client/src/config.ts +84 -1
- package/packages/client/src/index.ts +4 -1
- package/packages/client/src/interceptors/interaction.ts +3 -0
- package/packages/client/src/notes/inspector.ts +640 -166
- package/packages/client/src/source/resolver.ts +272 -0
- package/packages/core/src/types/events.ts +3 -0
- package/packages/core/src/types/notes.ts +36 -0
- package/packages/daemon/src/notes/engine.ts +6 -0
- package/packages/daemon/src/server/ws.ts +23 -1
- package/packages/daemon/src/storage/db.ts +106 -3
- package/packages/mcp/src/handlers.ts +59 -0
- package/packages/mcp/src/tools.ts +28 -0
- package/test/client/component-resolver.test.ts +141 -0
- package/test/client/interceptors.test.ts +120 -0
- package/test/daemon/scenario-storage.test.ts +158 -0
- package/dist/chunk-G2Y3CXCY.js.map +0 -1
- package/dist/chunk-ILRYKMME.js.map +0 -1
- package/dist/chunk-SKCMT2DE.js.map +0 -1
- package/dist/chunk-SPCIROIU.js.map +0 -1
package/dist/client/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as Breadcrumb,
|
|
1
|
+
import { B as Breadcrumb, j as ElementSummary, b as ClientCommand, d as CommandResponse, w as VisualNote, R as RegionContext, f as ComponentSourceInfo } from '../commands-fjuqKzkm.js';
|
|
2
2
|
|
|
3
3
|
interface BrowserDiagClientOptions {
|
|
4
4
|
daemonUrl?: string;
|
|
@@ -14,16 +14,32 @@ interface BrowserDiagClientOptions {
|
|
|
14
14
|
enabled?: boolean;
|
|
15
15
|
shortcut?: string;
|
|
16
16
|
showBadges?: boolean;
|
|
17
|
+
showToolbar?: boolean;
|
|
17
18
|
maskSelectors?: string[];
|
|
18
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Hide visible BrowserTrack UI (toolbar dock, pins, hover overlay) by default.
|
|
22
|
+
*/
|
|
23
|
+
hidden?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Custom query parameter(s) used to hide the UI (e.g. 'e2e', 'no_ui', 'clean').
|
|
26
|
+
* Built-in query params like ?bt=0, ?bt=false, ?bt=hidden, ?browsertrack=false, ?no_bt are supported automatically.
|
|
27
|
+
*/
|
|
28
|
+
hideQueryParam?: string | string[];
|
|
19
29
|
debug?: boolean;
|
|
20
30
|
}
|
|
21
|
-
declare const DEFAULT_OPTIONS: Required<Omit<BrowserDiagClientOptions, 'notes'>> & {
|
|
31
|
+
declare const DEFAULT_OPTIONS: Required<Omit<BrowserDiagClientOptions, 'notes' | 'hideQueryParam'>> & {
|
|
32
|
+
hideQueryParam?: string | string[];
|
|
22
33
|
notes: Required<NonNullable<BrowserDiagClientOptions['notes']>>;
|
|
23
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Checks if the tool's visible UI should be hidden based on URL search query parameters.
|
|
37
|
+
*/
|
|
38
|
+
declare function shouldHideUIFromUrl(customParam?: string | string[], searchString?: string): boolean;
|
|
24
39
|
|
|
25
40
|
declare class BrowserTrackClient {
|
|
26
|
-
options: Required<Omit<BrowserDiagClientOptions, 'notes'>> & {
|
|
41
|
+
options: Required<Omit<BrowserDiagClientOptions, 'notes' | 'hideQueryParam'>> & {
|
|
42
|
+
hideQueryParam?: string | string[];
|
|
27
43
|
notes: Required<NonNullable<BrowserDiagClientOptions['notes']>>;
|
|
28
44
|
};
|
|
29
45
|
private breadcrumbs;
|
|
@@ -40,6 +56,8 @@ declare class BrowserTrackClient {
|
|
|
40
56
|
openNoteEditor(el?: HTMLElement, noteType?: 'element' | 'page'): void;
|
|
41
57
|
startRegionSelection(): void;
|
|
42
58
|
startElementSelection(): void;
|
|
59
|
+
isUIVisible(): boolean;
|
|
60
|
+
setUIVisible(visible: boolean): void;
|
|
43
61
|
setInspectMode(mode: 'element' | 'region' | 'page' | 'idle'): void;
|
|
44
62
|
createNote(targetEl: HTMLElement, message: string, noteType?: 'element' | 'page'): Promise<void>;
|
|
45
63
|
private handleRuntimeError;
|
|
@@ -140,17 +158,27 @@ interface InspectorOptions {
|
|
|
140
158
|
shortcut?: string;
|
|
141
159
|
maskSelectors?: string[];
|
|
142
160
|
showToolbar?: boolean;
|
|
161
|
+
showBadges?: boolean;
|
|
162
|
+
hidden?: boolean;
|
|
163
|
+
hideQueryParam?: string | string[];
|
|
143
164
|
onNoteCreated?: (note: Partial<VisualNote>) => void;
|
|
144
165
|
}
|
|
166
|
+
interface ActiveScenarioState {
|
|
167
|
+
id: string;
|
|
168
|
+
title: string;
|
|
169
|
+
stepNumber: number;
|
|
170
|
+
}
|
|
145
171
|
/**
|
|
146
|
-
* Isolated Visual Note Inspector rendering in Shadow DOM.
|
|
172
|
+
* Isolated Visual Note & Multi-Step Scenario Inspector rendering in Shadow DOM.
|
|
147
173
|
* Supports:
|
|
148
174
|
* 1. Element selection (hover highlight & click)
|
|
149
175
|
* 2. Region / Area selection (drag-and-drop rectangle on screen with cancel banner)
|
|
150
176
|
* 3. Whole page note
|
|
151
|
-
* 4.
|
|
152
|
-
* 5.
|
|
153
|
-
* 6.
|
|
177
|
+
* 4. Multi-Step Flow / Scenario Recording (sequential 'Save & Next Step' continuous capture)
|
|
178
|
+
* 5. Real-time Saved Note & Step Markers (pins with step sequencing numbers)
|
|
179
|
+
* 6. Interactive Note & Step Detail Card (with previous/next step walk-through navigation)
|
|
180
|
+
* 7. Floating quick dock / toolbar in bottom-right corner with Notes count and Flow controls
|
|
181
|
+
* 8. Automatic invisibility via query parameter (?bt=0, ?bt=false, ?bt=hidden, ?no_bt, custom query params)
|
|
154
182
|
*/
|
|
155
183
|
declare class NoteInspector {
|
|
156
184
|
private transport;
|
|
@@ -166,7 +194,9 @@ declare class NoteInspector {
|
|
|
166
194
|
private toolbarElement;
|
|
167
195
|
private modalOverlay;
|
|
168
196
|
private cardOverlay;
|
|
197
|
+
private toastContainer;
|
|
169
198
|
private activeMode;
|
|
199
|
+
private activeScenario;
|
|
170
200
|
private hoveredElement;
|
|
171
201
|
private selectedElement;
|
|
172
202
|
private selectedRegion;
|
|
@@ -175,11 +205,17 @@ declare class NoteInspector {
|
|
|
175
205
|
private dragStartY;
|
|
176
206
|
private savedNotes;
|
|
177
207
|
private showMarkers;
|
|
208
|
+
private isHidden;
|
|
178
209
|
private cleanups;
|
|
179
210
|
constructor(transport: WebSocketTransport, screenshotDriver: ScreenshotDriver, options?: InspectorOptions);
|
|
180
211
|
init(): void;
|
|
181
212
|
syncNotes(notes: VisualNote[]): void;
|
|
213
|
+
showToast(message: string, icon?: string, durationMs?: number): void;
|
|
214
|
+
startScenario(title?: string): void;
|
|
215
|
+
finishScenario(): void;
|
|
182
216
|
setMode(mode: NoteInspectMode): void;
|
|
217
|
+
isVisible(): boolean;
|
|
218
|
+
setVisible(visible: boolean): void;
|
|
183
219
|
private ensureContainer;
|
|
184
220
|
private createToolbar;
|
|
185
221
|
private updateToolbarState;
|
|
@@ -195,17 +231,32 @@ declare class NoteInspector {
|
|
|
195
231
|
openNoteEditor(el?: HTMLElement, noteType?: 'element' | 'page'): void;
|
|
196
232
|
openRegionNoteEditor(region: RegionContext): void;
|
|
197
233
|
private renderNoteModal;
|
|
198
|
-
saveVisualNote(targetEl: HTMLElement, message: string, noteType?: 'element' | 'page'
|
|
199
|
-
|
|
200
|
-
|
|
234
|
+
saveVisualNote(targetEl: HTMLElement, message: string, noteType?: 'element' | 'page', scenario?: {
|
|
235
|
+
scenarioId?: string;
|
|
236
|
+
stepNumber?: number;
|
|
237
|
+
scenarioTitle?: string;
|
|
238
|
+
}): Promise<void>;
|
|
239
|
+
saveRegionVisualNote(region: RegionContext, message: string, scenario?: {
|
|
240
|
+
scenarioId?: string;
|
|
241
|
+
stepNumber?: number;
|
|
242
|
+
scenarioTitle?: string;
|
|
243
|
+
}): Promise<void>;
|
|
201
244
|
private extractElementContext;
|
|
245
|
+
private cropDataUrl;
|
|
202
246
|
destroy(): void;
|
|
203
247
|
}
|
|
204
248
|
|
|
249
|
+
/**
|
|
250
|
+
* Resolves framework component metadata, source file paths, line numbers,
|
|
251
|
+
* and component hierarchy directly from a live DOM element.
|
|
252
|
+
* Supports React (Fiber), Vue 2 & 3, Svelte, Custom Elements, and standard data attributes.
|
|
253
|
+
*/
|
|
254
|
+
declare function resolveComponentSource(el: HTMLElement): ComponentSourceInfo | undefined;
|
|
255
|
+
|
|
205
256
|
/**
|
|
206
257
|
* Initializes the BrowserTrack client.
|
|
207
258
|
*/
|
|
208
259
|
declare function init(options?: BrowserDiagClientOptions): BrowserTrackClient;
|
|
209
260
|
declare function getClient(): BrowserTrackClient | null;
|
|
210
261
|
|
|
211
|
-
export { BreadcrumbBuffer, type BrowserDiagClientOptions, BrowserScriptScreenshotDriver, BrowserTrackClient, DEFAULT_OPTIONS, type InspectorOptions, type NoteInspectMode, NoteInspector, type ScreenshotDriver, type ScreenshotResult, getClient, init };
|
|
262
|
+
export { type ActiveScenarioState, BreadcrumbBuffer, type BrowserDiagClientOptions, BrowserScriptScreenshotDriver, BrowserTrackClient, DEFAULT_OPTIONS, type InspectorOptions, type NoteInspectMode, NoteInspector, type ScreenshotDriver, type ScreenshotResult, getClient, init, resolveComponentSource, shouldHideUIFromUrl };
|
package/dist/client/index.js
CHANGED
|
@@ -5,8 +5,10 @@ import {
|
|
|
5
5
|
DEFAULT_OPTIONS,
|
|
6
6
|
NoteInspector,
|
|
7
7
|
getClient,
|
|
8
|
-
init
|
|
9
|
-
|
|
8
|
+
init,
|
|
9
|
+
resolveComponentSource,
|
|
10
|
+
shouldHideUIFromUrl
|
|
11
|
+
} from "../chunk-INXDWPJW.js";
|
|
10
12
|
import "../chunk-6VA7GBAO.js";
|
|
11
13
|
export {
|
|
12
14
|
BreadcrumbBuffer,
|
|
@@ -15,6 +17,8 @@ export {
|
|
|
15
17
|
DEFAULT_OPTIONS,
|
|
16
18
|
NoteInspector,
|
|
17
19
|
getClient,
|
|
18
|
-
init
|
|
20
|
+
init,
|
|
21
|
+
resolveComponentSource,
|
|
22
|
+
shouldHideUIFromUrl
|
|
19
23
|
};
|
|
20
24
|
//# sourceMappingURL=index.js.map
|