browsertrack 0.2.0 → 0.2.2
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 +11 -6
- package/README.md +2 -0
- package/dist/{chunk-WB7ZKWK7.js → chunk-4HRLW6YF.js} +509 -109
- package/dist/chunk-4HRLW6YF.js.map +1 -0
- package/dist/{chunk-3HOXPTM2.js → chunk-AYSVE6NG.js} +808 -53
- package/dist/chunk-AYSVE6NG.js.map +1 -0
- package/dist/{chunk-6VA7GBAO.js → chunk-QRZ57ME3.js} +70 -2
- package/dist/chunk-QRZ57ME3.js.map +1 -0
- package/dist/{chunk-UP5JKCFY.js → chunk-TWEYRBDU.js} +281 -44
- package/dist/chunk-TWEYRBDU.js.map +1 -0
- package/dist/cli/index.js +1040 -546
- package/dist/cli/index.js.map +1 -1
- package/dist/client/index.cjs +536 -109
- package/dist/client/index.d.ts +36 -4
- package/dist/client/index.js +8 -4
- package/dist/client.iife.js +42 -19
- package/dist/{notes-BMnonq46.d.ts → commands-fjuqKzkm.d.ts} +125 -114
- package/dist/core/index.d.ts +26 -3
- package/dist/core/index.js +9 -1
- package/dist/daemon/index.d.ts +4 -4
- package/dist/daemon/index.js +6 -8
- package/dist/{engine-B43IohQY.d.ts → engine-CmchnMDq.d.ts} +2 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +14 -7
- package/dist/mcp/index.d.ts +4 -4
- package/dist/mcp/index.js +7 -4
- package/dist/{projects-D5J-egVN.d.ts → projects-DB7S312i.d.ts} +1 -1
- package/dist/{server-BztYp1Zc.d.ts → server-DjV7RWQM.d.ts} +10 -2
- package/docs/cli.md +4 -1
- package/docs/component-resolver.md +108 -0
- package/docs/getting-started.md +60 -6
- package/docs/index.md +1 -0
- package/docs/mcp-reference.md +44 -2
- package/docs/visual-notes.md +36 -0
- package/package.json +1 -1
- package/packages/cli/src/index.ts +247 -151
- 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/interceptors/navigation.ts +38 -26
- package/packages/client/src/interceptors/network.ts +22 -17
- package/packages/client/src/notes/inspector.ts +186 -51
- package/packages/client/src/source/resolver.ts +278 -0
- package/packages/client/src/transport/websocket.ts +23 -18
- package/packages/core/src/index.ts +1 -0
- package/packages/core/src/safety.ts +86 -0
- package/packages/core/src/types/events.ts +3 -0
- package/packages/core/src/types/notes.ts +11 -0
- package/packages/daemon/src/server/daemon.ts +7 -1
- package/packages/daemon/src/server/http.ts +125 -5
- package/packages/daemon/src/server/ws.ts +33 -29
- package/packages/daemon/src/storage/db.ts +57 -35
- package/packages/mcp/src/handlers.ts +115 -45
- package/packages/mcp/src/server.ts +202 -2
- package/test/client/component-resolver.test.ts +141 -0
- package/test/client/interceptors.test.ts +56 -0
- package/test/core/safety.test.ts +106 -0
- package/test/daemon/storage.test.ts +36 -0
- package/test/e2e/daemon-mcp-e2e.test.ts +10 -0
- package/test/mcp/auto-start.test.ts +87 -0
- package/dist/chunk-3HOXPTM2.js.map +0 -1
- package/dist/chunk-6VA7GBAO.js.map +0 -1
- package/dist/chunk-7OCOQGDN.js +0 -635
- package/dist/chunk-7OCOQGDN.js.map +0 -1
- package/dist/chunk-UP5JKCFY.js.map +0 -1
- package/dist/chunk-WB7ZKWK7.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,6 +158,9 @@ 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
|
}
|
|
145
166
|
interface ActiveScenarioState {
|
|
@@ -157,6 +178,7 @@ interface ActiveScenarioState {
|
|
|
157
178
|
* 5. Real-time Saved Note & Step Markers (pins with step sequencing numbers)
|
|
158
179
|
* 6. Interactive Note & Step Detail Card (with previous/next step walk-through navigation)
|
|
159
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)
|
|
160
182
|
*/
|
|
161
183
|
declare class NoteInspector {
|
|
162
184
|
private transport;
|
|
@@ -183,6 +205,7 @@ declare class NoteInspector {
|
|
|
183
205
|
private dragStartY;
|
|
184
206
|
private savedNotes;
|
|
185
207
|
private showMarkers;
|
|
208
|
+
private isHidden;
|
|
186
209
|
private cleanups;
|
|
187
210
|
constructor(transport: WebSocketTransport, screenshotDriver: ScreenshotDriver, options?: InspectorOptions);
|
|
188
211
|
init(): void;
|
|
@@ -191,6 +214,8 @@ declare class NoteInspector {
|
|
|
191
214
|
startScenario(title?: string): void;
|
|
192
215
|
finishScenario(): void;
|
|
193
216
|
setMode(mode: NoteInspectMode): void;
|
|
217
|
+
isVisible(): boolean;
|
|
218
|
+
setVisible(visible: boolean): void;
|
|
194
219
|
private ensureContainer;
|
|
195
220
|
private createToolbar;
|
|
196
221
|
private updateToolbarState;
|
|
@@ -221,10 +246,17 @@ declare class NoteInspector {
|
|
|
221
246
|
destroy(): void;
|
|
222
247
|
}
|
|
223
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
|
+
|
|
224
256
|
/**
|
|
225
257
|
* Initializes the BrowserTrack client.
|
|
226
258
|
*/
|
|
227
259
|
declare function init(options?: BrowserDiagClientOptions): BrowserTrackClient;
|
|
228
260
|
declare function getClient(): BrowserTrackClient | null;
|
|
229
261
|
|
|
230
|
-
export { type ActiveScenarioState, 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,9 +5,11 @@ import {
|
|
|
5
5
|
DEFAULT_OPTIONS,
|
|
6
6
|
NoteInspector,
|
|
7
7
|
getClient,
|
|
8
|
-
init
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
init,
|
|
9
|
+
resolveComponentSource,
|
|
10
|
+
shouldHideUIFromUrl
|
|
11
|
+
} from "../chunk-4HRLW6YF.js";
|
|
12
|
+
import "../chunk-QRZ57ME3.js";
|
|
11
13
|
export {
|
|
12
14
|
BreadcrumbBuffer,
|
|
13
15
|
BrowserScriptScreenshotDriver,
|
|
@@ -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
|