deictic 0.3.0 → 0.4.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/API.md +31 -19
- package/README.md +6 -26
- package/dist/annotations/client.d.ts +1 -1
- package/dist/annotations/client.js +1 -1
- package/dist/annotations/index.d.ts +2 -101
- package/dist/annotations/index.js +1 -22
- package/dist/astro.d.ts +1 -1
- package/dist/astro.js +1 -1
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +37 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.js +1 -10
- package/dist/logs/client.d.ts +1 -1
- package/dist/logs/client.js +1 -1
- package/dist/logs/index.d.ts +2 -18
- package/dist/logs/index.js +1 -21
- package/dist/network/client.d.ts +1 -1
- package/dist/network/client.js +1 -1
- package/dist/network/index.d.ts +1 -1
- package/dist/network/index.js +1 -37
- package/dist/recommended/index.d.ts +7 -7
- package/dist/recommended/index.js +1 -26
- package/dist/recordings/client.d.ts +1 -1
- package/dist/recordings/client.js +1 -1
- package/dist/recordings/index.d.ts +1 -1
- package/dist/screenshots/client.d.ts +1 -1
- package/dist/screenshots/client.js +1 -108
- package/dist/screenshots/dom.d.ts +1 -1
- package/dist/screenshots/dom.js +1 -1
- package/dist/screenshots/index.d.ts +1 -1
- package/dist/screenshots/index.js +1 -98
- package/dist/screenshots/rrweb.d.ts +2 -1
- package/dist/screenshots/rrweb.d.ts.map +1 -1
- package/dist/screenshots/rrweb.js +6 -2
- package/dist/screenshots/rrweb.js.map +1 -1
- package/dist/shared/annotations.js +22 -0
- package/dist/shared/annotations.js.map +1 -0
- package/dist/shared/board.js +190 -0
- package/dist/shared/board.js.map +1 -0
- package/dist/shared/client.js +108 -0
- package/dist/{screenshots → shared}/client.js.map +1 -1
- package/dist/shared/endpoints.js +4 -1
- package/dist/shared/endpoints.js.map +1 -1
- package/dist/shared/find.js +156 -0
- package/dist/shared/find.js.map +1 -0
- package/dist/shared/frame.js +75 -0
- package/dist/shared/frame.js.map +1 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/index2.d.ts +85 -84
- package/dist/shared/index2.d.ts.map +1 -1
- package/dist/shared/index3.d.ts +83 -89
- package/dist/shared/index3.d.ts.map +1 -1
- package/dist/shared/index4.d.ts +98 -50
- package/dist/shared/index4.d.ts.map +1 -1
- package/dist/shared/index5.d.ts +13 -215
- package/dist/shared/index5.d.ts.map +1 -1
- package/dist/shared/index6.d.ts +55 -61
- package/dist/shared/index6.d.ts.map +1 -1
- package/dist/shared/index7.d.ts +224 -0
- package/dist/shared/index7.d.ts.map +1 -0
- package/dist/shared/index8.d.ts +52 -0
- package/dist/shared/index8.d.ts.map +1 -0
- package/dist/shared/index9.d.ts +70 -0
- package/dist/shared/index9.d.ts.map +1 -0
- package/dist/shared/init.js +472 -0
- package/dist/shared/init.js.map +1 -0
- package/dist/shared/local.js +165 -0
- package/dist/shared/local.js.map +1 -0
- package/dist/shared/logs.js +22 -0
- package/dist/shared/logs.js.map +1 -0
- package/dist/shared/network.js +39 -0
- package/dist/shared/network.js.map +1 -0
- package/dist/shared/packages.js +125 -0
- package/dist/shared/packages.js.map +1 -0
- package/dist/shared/playwright.js +36 -9
- package/dist/shared/playwright.js.map +1 -1
- package/dist/shared/recommended.js +26 -0
- package/dist/shared/recommended.js.map +1 -0
- package/dist/shared/recording.js +316 -0
- package/dist/shared/recording.js.map +1 -0
- package/dist/shared/recordings.js +2 -1
- package/dist/shared/recordings.js.map +1 -1
- package/dist/shared/screenshots.js +108 -0
- package/dist/shared/screenshots.js.map +1 -0
- package/dist/shared/src.js +10 -0
- package/dist/shared/src.js.map +1 -0
- package/dist/shared/task.js +108 -0
- package/dist/shared/task.js.map +1 -0
- package/dist/shared/tasks.js +33 -191
- package/dist/shared/tasks.js.map +1 -1
- package/dist/shared/transcribe.js +128 -0
- package/dist/shared/transcribe.js.map +1 -0
- package/dist/shared/vb.js +13 -0
- package/dist/shared/vb.js.map +1 -0
- package/dist/shared/vite.d.ts +16 -0
- package/dist/shared/vite.d.ts.map +1 -0
- package/dist/shared/vite.js +61 -0
- package/dist/shared/vite.js.map +1 -0
- package/dist/shared/voice.js +84 -0
- package/dist/{voice/index.js.map → shared/voice.js.map} +1 -1
- package/dist/shared/voice2.js +90 -0
- package/dist/shared/voice2.js.map +1 -0
- package/dist/shared/watch.js +209 -0
- package/dist/shared/watch.js.map +1 -0
- package/dist/shared/watchers.js +62 -0
- package/dist/shared/watchers.js.map +1 -0
- package/dist/tailwind/client.d.ts +1 -1
- package/dist/tailwind/client.js +1 -1
- package/dist/tailwind/index.d.ts +1 -1
- package/dist/tailwind/index.js +1 -1
- package/dist/tasks/client.d.ts +1 -1
- package/dist/tasks/client.d.ts.map +1 -1
- package/dist/tasks/client.js +45 -8
- package/dist/tasks/client.js.map +1 -1
- package/dist/tasks/index.d.ts +1 -1
- package/dist/tasks/index.js +3 -1
- package/dist/vite.d.ts +2 -15
- package/dist/vite.js +2 -60
- package/dist/voice/client.d.ts +1 -1
- package/dist/voice/client.js +1 -1
- package/dist/voice/index.d.ts +2 -52
- package/dist/voice/index.js +1 -84
- package/package.json +6 -9
- package/skills/deictic/SKILL.md +27 -42
- package/skills/deictic/references/recordings.md +9 -108
- package/skills/deictic/references/tasks.md +21 -107
- package/skills/deictic/references/watch.md +13 -66
- package/src/cli/board.ts +204 -0
- package/src/cli/bun.ts +133 -0
- package/src/cli/edit.ts +56 -0
- package/src/cli/find.ts +147 -0
- package/src/cli/frame.ts +90 -0
- package/src/cli/init.ts +388 -0
- package/src/cli/recording.ts +383 -0
- package/src/cli/task.ts +126 -0
- package/src/cli/transcribe.ts +129 -0
- package/src/cli/vb.ts +11 -0
- package/src/cli/voice.ts +59 -0
- package/src/cli/watch.ts +221 -0
- package/src/cli.ts +37 -0
- package/src/index.ts +5 -0
- package/src/plugins/logs/index.ts +1 -0
- package/src/plugins/network/index.ts +1 -0
- package/src/plugins/recordings/index.ts +1 -0
- package/src/plugins/screenshots/client.ts +3 -2
- package/src/plugins/screenshots/index.ts +10 -3
- package/src/plugins/screenshots/playwright.ts +34 -7
- package/src/plugins/screenshots/rrweb.ts +5 -1
- package/src/plugins/tasks/client.ts +62 -7
- package/src/plugins/tasks/index.ts +41 -20
- package/src/plugins/tasks/local.ts +19 -6
- package/src/plugins/tasks/watchers.ts +41 -6
- package/src/tools/endpoints.ts +3 -0
- package/src/tools/packages.ts +107 -0
- package/dist/annotations/index.d.ts.map +0 -1
- package/dist/annotations/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/logs/index.d.ts.map +0 -1
- package/dist/logs/index.js.map +0 -1
- package/dist/network/index.js.map +0 -1
- package/dist/recommended/index.js.map +0 -1
- package/dist/screenshots/index.js.map +0 -1
- package/dist/vite.d.ts.map +0 -1
- package/dist/vite.js.map +0 -1
- package/dist/voice/index.d.ts.map +0 -1
- package/skills/deictic/references/install.md +0 -103
- package/skills/deictic/scripts/frame.mjs +0 -62
- package/skills/deictic/scripts/lib.mjs +0 -277
- package/skills/deictic/scripts/recording.mjs +0 -266
- package/skills/deictic/scripts/task.mjs +0 -113
- package/skills/deictic/scripts/transcribe.mjs +0 -93
- package/skills/deictic/scripts/vb.mjs +0 -12
- package/skills/deictic/scripts/voice.mjs +0 -50
- package/skills/deictic/scripts/watch.mjs +0 -115
package/dist/shared/index2.d.ts
CHANGED
|
@@ -1,100 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { w as Shortcut } from "./index.js";
|
|
2
|
+
/** A point in page coordinates: CSS pixels from the document's top left, so it stays put as the page scrolls. */
|
|
3
|
+
interface Point {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}
|
|
7
|
+
/** A rectangle: in page coordinates for a shape, in viewport coordinates for an area to draw. */
|
|
8
|
+
interface Area {
|
|
3
9
|
x: number;
|
|
4
10
|
y: number;
|
|
5
11
|
width: number;
|
|
6
12
|
height: number;
|
|
7
13
|
}
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
type Shape = ({
|
|
15
|
+
kind: 'box';
|
|
16
|
+
} & Area) | {
|
|
17
|
+
kind: 'arrow';
|
|
18
|
+
from: Point;
|
|
19
|
+
to: Point;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'pen';
|
|
22
|
+
points: Point[];
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'note';
|
|
25
|
+
at: Point;
|
|
26
|
+
text: string;
|
|
27
|
+
};
|
|
28
|
+
interface Annotation {
|
|
10
29
|
id: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
size: {
|
|
16
|
-
width: number;
|
|
17
|
-
height: number;
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
interface CaptureOptions {
|
|
21
|
-
/** `viewport`, what the page shows, by default; or `element`, the element alone. */
|
|
22
|
-
area?: 'viewport' | 'element';
|
|
30
|
+
color: string;
|
|
31
|
+
shape: Shape;
|
|
32
|
+
/** When it was made, as `Date.now()`. */
|
|
33
|
+
at: number;
|
|
23
34
|
}
|
|
35
|
+
/** A change, as `subscribe` hears it: what a recording keeps, to show the marks as they were made. */
|
|
36
|
+
type AnnotationEvent = {
|
|
37
|
+
type: 'add';
|
|
38
|
+
annotation: Annotation;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'remove';
|
|
41
|
+
id: string;
|
|
42
|
+
} | {
|
|
43
|
+
type: 'clear';
|
|
44
|
+
};
|
|
24
45
|
/** The page's half, for other plugins' page halves. */
|
|
25
|
-
interface
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
46
|
+
interface Annotations {
|
|
47
|
+
/** Every annotation on this page, oldest first. */
|
|
48
|
+
list(): Annotation[];
|
|
49
|
+
add(shape: Shape, color?: string): Annotation;
|
|
50
|
+
remove(id: string): void;
|
|
51
|
+
clear(): void;
|
|
52
|
+
/** Hears every change from now on; answers what stops it. */
|
|
53
|
+
subscribe(listener: (event: AnnotationEvent) => void): () => void;
|
|
54
|
+
/**
|
|
55
|
+
* The annotations over a part of the viewport, in viewport CSS pixels, as an SVG that size: what a
|
|
56
|
+
* screenshot of that area draws over it. Nothing when there are none.
|
|
57
|
+
*/
|
|
58
|
+
svg(area: Area): string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Opens a picture (a screenshot, most often) over everything, with the toolbar, to draw on: answers the
|
|
61
|
+
* marks, in the picture's CSS pixels, on Save, and nothing on Cancel, Esc or `signal`. It starts from
|
|
62
|
+
* `marks`, to edit them again. They're the picture's alone, not the page's.
|
|
63
|
+
*/
|
|
64
|
+
edit(picture: Picture, marks?: readonly Annotation[], options?: {
|
|
65
|
+
signal?: AbortSignal;
|
|
66
|
+
}): Promise<Annotation[] | undefined>;
|
|
67
|
+
/** The picture with the marks drawn over it, as a PNG at the picture's own resolution. */
|
|
68
|
+
flatten(picture: Picture, marks: readonly Annotation[]): Promise<Blob>;
|
|
69
|
+
/**
|
|
70
|
+
* Annotate mode's tools, for another plugin's UI to show (a recording's toolbar): a pointer tool, picked
|
|
71
|
+
* to start with, leaves the page usable; while a drawing tool is picked, the page is drawn on. What's
|
|
72
|
+
* drawn is its own `marks`, not the page's: shown while it's open, kept by nothing, gone on `close`.
|
|
73
|
+
*/
|
|
74
|
+
tools(): {
|
|
75
|
+
element: HTMLElement;
|
|
76
|
+
marks: MarkSet;
|
|
77
|
+
close: () => void;
|
|
78
|
+
};
|
|
31
79
|
}
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} | undefined;
|
|
80
|
+
/** A set of marks on the page: the page's own, kept for the session, or a toolbar's, kept by nothing. */
|
|
81
|
+
type MarkSet = Pick<Annotations, 'list' | 'add' | 'remove' | 'clear' | 'subscribe' | 'svg'>;
|
|
82
|
+
/** An image to draw on: where it loads from (the page's origin, so a canvas may read it), and its size in CSS pixels, which marks on it are in. */
|
|
83
|
+
interface Picture {
|
|
84
|
+
url: string;
|
|
85
|
+
width: number;
|
|
86
|
+
height: number;
|
|
40
87
|
}
|
|
41
88
|
declare module 'deictic' {
|
|
42
|
-
interface ServerApis {
|
|
43
|
-
screenshots: Screenshots;
|
|
44
|
-
}
|
|
45
89
|
interface ClientApis {
|
|
46
|
-
|
|
90
|
+
annotations: Annotations;
|
|
47
91
|
}
|
|
48
92
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
/** Elements drawn as a blank box their size: `rr-block` by default. */
|
|
55
|
-
blockClass?: string;
|
|
56
|
-
blockSelector?: string;
|
|
57
|
-
/** Elements whose text is drawn as `*`: `rr-mask` by default. */
|
|
58
|
-
maskTextClass?: string;
|
|
59
|
-
maskTextSelector?: string;
|
|
60
|
-
/** Every field's value as `*`, not only passwords': false by default. */
|
|
61
|
-
maskAllInputs?: boolean;
|
|
62
|
-
}
|
|
63
|
-
/** Masking with its defaults, as a renderer's page half gets it. */
|
|
64
|
-
type ResolvedMasking = Required<Pick<Masking, 'blockClass' | 'maskTextClass' | 'maskAllInputs'>> & Masking;
|
|
65
|
-
/**
|
|
66
|
-
* How shots are made. `client` is the page module that captures, default-exporting `screenshotsClient(…)`
|
|
67
|
-
* from `deictic/screenshots/client`. A page half that sends a PNG needs nothing here; one that sends
|
|
68
|
-
* something else, as JSON (a DOM snapshot), needs `render` to make the PNG of it.
|
|
69
|
-
*/
|
|
70
|
-
interface Renderer {
|
|
71
|
-
client: string;
|
|
72
|
-
/** What the page half gets, besides the masking. */
|
|
73
|
-
clientOptions?: unknown;
|
|
74
|
-
render?(input: unknown): Promise<Uint8Array>;
|
|
75
|
-
}
|
|
76
|
-
/** Where `rrweb()` finds a browser: any Chromium renders the snapshot as the page's own would. */
|
|
77
|
-
interface BrowserOptions {
|
|
78
|
-
/** A Chromium-based browser's executable. */
|
|
79
|
-
executablePath?: string;
|
|
80
|
-
/** An installed browser by Playwright's name: `chrome`, `msedge`. By default Playwright's own Chromium, then Chrome, then Edge. */
|
|
81
|
-
channel?: string;
|
|
82
|
-
}
|
|
83
|
-
/** Draws the page in the page, from its DOM (`modern-screenshot`): no server needed, but text may lay out a little differently. */
|
|
84
|
-
declare const dom: () => Renderer;
|
|
85
|
-
/**
|
|
86
|
-
* Snapshots the page's DOM in the page (`rrweb-snapshot`, masking as rrweb does) and renders it in a
|
|
87
|
-
* browser beside the dev server (`playwright-core`), so text lays out as the page's does.
|
|
88
|
-
*/
|
|
89
|
-
declare const rrweb: (options?: BrowserOptions) => Renderer;
|
|
90
|
-
interface ScreenshotsOptions extends Masking {
|
|
91
|
-
/** How shots are made: `rrweb()` by default, or `dom()` where there's no server to render on. */
|
|
92
|
-
renderer?: Renderer;
|
|
93
|
-
/** How many shots to keep, the latest: 100 by default. */
|
|
94
|
-
keep?: number;
|
|
95
|
-
/** Where they're kept, from the project's root: `.deictic/screenshots` by default. */
|
|
96
|
-
dir?: string;
|
|
93
|
+
interface AnnotationsOptions {
|
|
94
|
+
/** What opens its tab directly, beside deictic's own shortcut, which opens any: none by default. */
|
|
95
|
+
shortcut?: Shortcut;
|
|
96
|
+
/** The colour marks are drawn in: a red that deictic's own green isn't. */
|
|
97
|
+
color?: string;
|
|
97
98
|
}
|
|
98
|
-
declare function
|
|
99
|
-
export {
|
|
99
|
+
declare function annotations(options?: AnnotationsOptions): import("deictic").ServerPlugin<unknown, unknown, unknown, unknown>;
|
|
100
|
+
export { Area as a, Point as c, AnnotationsOptions as i, Shape as l, AnnotationEvent as n, MarkSet as o, Annotations as r, Picture as s, Annotation as t, annotations as u };
|
|
100
101
|
//# sourceMappingURL=index2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.d.ts","names":[],"sources":["../../src/plugins/
|
|
1
|
+
{"version":3,"file":"index2.d.ts","names":[],"sources":["../../src/plugins/annotations/index.ts"],"mappings":";;UAYiB;EACf;EACA;;;UAIe;EACf;EACA;EACA;EACA;;KAGU;EACL;IAAgB;EACjB;EAAe,MAAM;EAAO,IAAI;;EAChC;EAAa,QAAQ;;EACrB;EAAc,IAAI;EAAO;;UAEd;EACf;EACA;EACA,OAAO;;EAEP;;;KAIU;EAAoB;EAAa,YAAY;;EAAiB;EAAgB;;EAAiB;;;UAG1F;;EAEf,QAAQ;EACR,IAAI,OAAO,OAAO,iBAAiB;EACnC,OAAO;EACP;;EAEA,UAAU,WAAW,OAAO;;;;;EAK5B,IAAI,MAAM;;;;;;EAMV,KAAK,SAAS,SAAS,iBAAiB,cAAc;IAAY,SAAS;MAAgB,QAAQ;;EAEnG,QAAQ,SAAS,SAAS,gBAAgB,eAAe,QAAQ;;;;;;EAMjE;IAAW,SAAS;IAAa,OAAO;IAAS;;;;KAIvC,UAAU,KAAK;;UAGV;EACf;EACA;EACA;;;YAIU;IACR,aAAa;;;UAIA;;EAEf,WAAW;;EAEX;;iBAGc,YAAY,UAAS,uCAAuB"}
|
package/dist/shared/index3.d.ts
CHANGED
|
@@ -1,112 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare const MARKS = "deictic.annotations";
|
|
8
|
-
/** Where the replay page finds what the plugin's routes would serve it, for a page published as a file. */
|
|
9
|
-
interface ReplaySources {
|
|
10
|
-
/** The folder `player.js` and `player.css` are in (`rrweb-player`'s `rrweb-player.umd.min.cjs` and `style.css`), from the page: `..`, the routes', by default. */
|
|
11
|
-
player?: string;
|
|
12
|
-
/**
|
|
13
|
-
* A script, from the page, that sets `globalThis.deicticReplay` before the page asks: `recording(id)` answers the
|
|
14
|
-
* recording (a `Kept`) and `clip(id)` a voice clip's URL, either as a promise. The routes by default.
|
|
15
|
-
*/
|
|
16
|
-
source?: string;
|
|
1
|
+
/** A rectangle in CSS pixels, from the shot's top left. */
|
|
2
|
+
interface Box {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
17
7
|
}
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
/** A recording as the page knows it: its ID, where it plays back, and how long it ran, in milliseconds. */
|
|
21
|
-
interface Recording {
|
|
8
|
+
/** A shot as the page knows it: its ID, where the dev server serves its PNG, and where the element is in it. */
|
|
9
|
+
interface Shot {
|
|
22
10
|
id: string;
|
|
23
11
|
url: string;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
/** The element, in the shot: nothing marks it there, as nothing of deictic's is drawn. */
|
|
13
|
+
box: Box;
|
|
14
|
+
/** The shot's size in CSS pixels; its PNG may have more, on a high-density screen. */
|
|
15
|
+
size: {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
|
27
19
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
at: number;
|
|
32
|
-
duration: number;
|
|
20
|
+
interface CaptureOptions {
|
|
21
|
+
/** `viewport`, what the page shows, by default; or `element`, the element alone. */
|
|
22
|
+
area?: 'viewport' | 'element';
|
|
33
23
|
}
|
|
34
24
|
/** The page's half, for other plugins' page halves. */
|
|
35
|
-
interface
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
record(): Promise<Recording | undefined>;
|
|
42
|
-
/** Whether one is going. */
|
|
43
|
-
recording(): boolean;
|
|
44
|
-
/** The one going, as `record` answers it: also one a page before this started, carried on here. */
|
|
45
|
-
going(): Promise<Recording | undefined> | undefined;
|
|
46
|
-
}
|
|
47
|
-
/** A plugin of rrweb's own, as its `record` takes them: what puts more than the page in a recording. */
|
|
48
|
-
type RecordPlugin = NonNullable<NonNullable<Parameters<typeof record>[0]>['plugins']>[number];
|
|
49
|
-
/**
|
|
50
|
-
* What a plugin that adds to recordings answers in the page, under its name (`logs` and `network` do): the
|
|
51
|
-
* recorder asks each it knows for its rrweb plugin as a recording starts, so nothing listens before, or after it stops.
|
|
52
|
-
*/
|
|
53
|
-
interface Recorded {
|
|
54
|
-
/** `sinceLoad`: the recording was going as this page loaded, so what the page did before now is its too. */
|
|
55
|
-
plugin(from: {
|
|
56
|
-
sinceLoad: boolean;
|
|
57
|
-
}): Promise<RecordPlugin>;
|
|
25
|
+
interface Capture {
|
|
26
|
+
capture(element: Element, options?: CaptureOptions): Promise<Shot>;
|
|
27
|
+
/** Keeps a PNG made of a shot (the same one with marks drawn over it, say) as a shot of its own. */
|
|
28
|
+
upload(png: Blob, of: Pick<Shot, 'box' | 'size'>): Promise<Shot>;
|
|
29
|
+
/** A copy of an element with what a shot hides hidden in it too: for a plugin that sends its HTML somewhere. */
|
|
30
|
+
masked(element: Element): Element;
|
|
58
31
|
}
|
|
59
32
|
/** The server's half, for other plugins' server halves. */
|
|
60
|
-
interface
|
|
61
|
-
/** A
|
|
33
|
+
interface Screenshots {
|
|
34
|
+
/** A shot's PNG, or nothing for one not kept (any more). */
|
|
62
35
|
read(id: string): {
|
|
63
36
|
data: Uint8Array<ArrayBuffer>;
|
|
64
37
|
name: string;
|
|
65
|
-
type: '
|
|
38
|
+
type: 'image/png';
|
|
66
39
|
} | undefined;
|
|
67
40
|
}
|
|
68
|
-
/** What a recording says as it begins: all of a `Kept` that's known then. */
|
|
69
|
-
type Meta = Omit<Kept, 'events' | 'duration' | 'voice'>;
|
|
70
|
-
/** What's kept: rrweb's events and what they can't say. */
|
|
71
|
-
interface Kept {
|
|
72
|
-
/** The page it started on. One that went on to others has each in its events, as rrweb's own: a `Meta`, then a snapshot. */
|
|
73
|
-
page: string;
|
|
74
|
-
viewport: {
|
|
75
|
-
width: number;
|
|
76
|
-
height: number;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* The colour scheme the page was in, which rrweb doesn't record: the replay shows it in the same, or a
|
|
80
|
-
* page styled by `prefers-color-scheme` would take the replay's.
|
|
81
|
-
*/
|
|
82
|
-
colorScheme?: 'light' | 'dark';
|
|
83
|
-
startedAt: number;
|
|
84
|
-
duration: number;
|
|
85
|
-
events: unknown[];
|
|
86
|
-
/** The mic's clips, played along with the replay. */
|
|
87
|
-
voice?: VoiceClip[];
|
|
88
|
-
}
|
|
89
41
|
declare module 'deictic' {
|
|
90
42
|
interface ServerApis {
|
|
91
|
-
|
|
43
|
+
screenshots: Screenshots;
|
|
92
44
|
}
|
|
93
45
|
interface ClientApis {
|
|
94
|
-
|
|
46
|
+
screenshots: Capture;
|
|
95
47
|
}
|
|
96
48
|
}
|
|
97
|
-
|
|
98
|
-
|
|
49
|
+
/**
|
|
50
|
+
* What a shot hides, as rrweb names it and by its defaults, so one marking in the app hides the same
|
|
51
|
+
* things from a screenshot as from an rrweb recording or snapshot.
|
|
52
|
+
*/
|
|
53
|
+
interface Masking {
|
|
54
|
+
/** Elements drawn as a blank box their size: `rr-block` by default. */
|
|
55
|
+
blockClass?: string;
|
|
56
|
+
blockSelector?: string;
|
|
57
|
+
/** Elements whose text is drawn as `*`: `rr-mask` by default. */
|
|
58
|
+
maskTextClass?: string;
|
|
59
|
+
maskTextSelector?: string;
|
|
60
|
+
/** Every field's value as `*`, not only passwords': false by default. */
|
|
61
|
+
maskAllInputs?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** Masking with its defaults, as a renderer's page half gets it. */
|
|
64
|
+
type ResolvedMasking = Required<Pick<Masking, 'blockClass' | 'maskTextClass' | 'maskAllInputs'>> & Masking;
|
|
65
|
+
/**
|
|
66
|
+
* How shots are made. `client` is the page module that captures, default-exporting `screenshotsClient(…)`
|
|
67
|
+
* from `deictic/screenshots/client`. A page half that sends a PNG needs nothing here; one that sends
|
|
68
|
+
* something else, as JSON (a DOM snapshot), needs `render` to make the PNG of it.
|
|
69
|
+
*/
|
|
70
|
+
interface Renderer {
|
|
71
|
+
client: string;
|
|
72
|
+
/** What the page half gets, besides the masking. */
|
|
73
|
+
clientOptions?: unknown;
|
|
74
|
+
/** The packages it imports that the project installs, as a plugin's `packages`. */
|
|
75
|
+
packages?: string[];
|
|
76
|
+
/** The PNG, or with it the element's `box` in it, where it's not where the page said (the page was drawn again elsewhere). */
|
|
77
|
+
render?(input: unknown): Promise<Uint8Array | {
|
|
78
|
+
png: Uint8Array;
|
|
79
|
+
box?: Box;
|
|
80
|
+
}>;
|
|
81
|
+
}
|
|
82
|
+
/** Where `rrweb()` finds a browser: any Chromium renders the snapshot as the page's own would. */
|
|
83
|
+
interface BrowserOptions {
|
|
84
|
+
/** A Chromium-based browser's executable. */
|
|
85
|
+
executablePath?: string;
|
|
86
|
+
/** An installed browser by Playwright's name: `chrome`, `msedge`. By default Playwright's own Chromium, then Chrome, then Edge. */
|
|
87
|
+
channel?: string;
|
|
88
|
+
}
|
|
89
|
+
/** Draws the page in the page, from its DOM (`modern-screenshot`): no server needed, but text may lay out a little differently. */
|
|
90
|
+
declare const dom: () => Renderer;
|
|
91
|
+
/**
|
|
92
|
+
* Snapshots the page's DOM in the page (`rrweb-snapshot`, masking as rrweb does) and renders it in a
|
|
93
|
+
* browser beside the dev server (`playwright-core`), so text lays out as the page's does.
|
|
94
|
+
*/
|
|
95
|
+
declare const rrweb: (options?: BrowserOptions) => Renderer;
|
|
96
|
+
interface ScreenshotsOptions extends Masking {
|
|
97
|
+
/** How shots are made: `rrweb()` by default, or `dom()` where there's no server to render on. */
|
|
98
|
+
renderer?: Renderer;
|
|
99
|
+
/** How many shots to keep, the latest: 100 by default. */
|
|
99
100
|
keep?: number;
|
|
100
|
-
/** Where they're kept, from the project's root: `.deictic/
|
|
101
|
+
/** Where they're kept, from the project's root: `.deictic/screenshots` by default. */
|
|
101
102
|
dir?: string;
|
|
102
|
-
/**
|
|
103
|
-
* What a `<canvas>` draws (a chart, a map, WebGL), which is no part of the page's markup: a picture of each
|
|
104
|
-
* canvas that changed, `fps` times a second, 2 by default. `false` for none, and a canvas replays blank.
|
|
105
|
-
*/
|
|
106
|
-
canvas?: boolean | {
|
|
107
|
-
fps?: number;
|
|
108
|
-
};
|
|
109
103
|
}
|
|
110
|
-
declare function
|
|
111
|
-
export {
|
|
104
|
+
declare function screenshots(options?: ScreenshotsOptions): import("deictic").ServerPlugin<never, never, never, Screenshots>;
|
|
105
|
+
export { Masking as a, Screenshots as c, dom as d, rrweb as f, CaptureOptions as i, ScreenshotsOptions as l, BrowserOptions as n, Renderer as o, screenshots as p, Capture as r, ResolvedMasking as s, Box as t, Shot as u };
|
|
112
106
|
//# sourceMappingURL=index3.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index3.d.ts","names":[],"sources":["../../src/plugins/
|
|
1
|
+
{"version":3,"file":"index3.d.ts","names":[],"sources":["../../src/plugins/screenshots/index.ts"],"mappings":";UAqBiB;EACf;EACA;EACA;EACA;;;UAIe;EACf;EACA;;EAEA,KAAK;;EAEL;IAAQ;IAAe;;;UAGR;;EAEf;;;UAIe;EACf,QAAQ,SAAS,SAAS,UAAU,iBAAiB,QAAQ;;EAE7D,OAAO,KAAK,MAAM,IAAI,KAAK,wBAAwB,QAAQ;;EAE3D,OAAO,SAAS,UAAU;;;UAIX;;EAEf,KAAK;IAAe,MAAM,WAAW;IAAc;IAAc;;;;YAIvD;IACR,aAAa;;YAEL;IACR,aAAa;;;;;;;UAQA;;EAEf;EACA;;EAEA;EACA;;EAEA;;;KAIU,kBAAkB,SAAS,KAAK,8DAA8D;;;;;;UAOzF;EACf;;EAEA;;EAEA;;EAEA,QAAQ,iBAAiB,QAAQ;IAAe,KAAK;IAAY,MAAM;;;;UAIxD;;EAEf;;EAEA;;;cAIW,WAAU;;;;;cAMV,QAAK,UAAa,mBAAsB;UAOpC,2BAA2B;;EAE1C,WAAW;;EAEX;;EAEA;;iBAOc,YAAY,UAAS,uCAAuB,kCAAA"}
|
package/dist/shared/index4.d.ts
CHANGED
|
@@ -1,64 +1,112 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { record } from "rrweb";
|
|
2
|
+
import { a as Masking } from "./index3.js";
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* prose) isn't found: bodies and headers are kept only where asked for, and `ignore` leaves a request out whole.
|
|
4
|
+
* The custom event's tag the marks go in: the page's annotations, as an SVG in page coordinates (`svg`),
|
|
5
|
+
* and as the annotations themselves (`annotations`, absent from recordings made before it was added).
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
declare const MARKS = "deictic.annotations";
|
|
8
|
+
/** Where the replay page finds what the plugin's routes would serve it, for a page published as a file. */
|
|
9
|
+
interface ReplaySources {
|
|
10
|
+
/** The folder `player.js` and `player.css` are in (`rrweb-player`'s `rrweb-player.umd.min.cjs` and `style.css`), from the page: `..`, the routes', by default. */
|
|
11
|
+
player?: string;
|
|
12
|
+
/**
|
|
13
|
+
* A script, from the page, that sets `globalThis.deicticReplay` before the page asks: `recording(id)` answers the
|
|
14
|
+
* recording (a `Kept`) and `clip(id)` a voice clip's URL, either as a promise. The routes by default.
|
|
15
|
+
*/
|
|
16
|
+
source?: string;
|
|
14
17
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/** The replay page's HTML: the routes' as it is, or one for a page published as a file. */
|
|
19
|
+
declare const replayPage: ({ player, source }?: ReplaySources) => string;
|
|
20
|
+
/** A recording as the page knows it: its ID, where it plays back, and how long it ran, in milliseconds. */
|
|
21
|
+
interface Recording {
|
|
22
|
+
id: string;
|
|
23
|
+
url: string;
|
|
24
|
+
duration: number;
|
|
25
|
+
/** What the mic took while it was on, where the voice plugin is loaded. */
|
|
26
|
+
voice?: VoiceClip[];
|
|
20
27
|
}
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
/** The request as it's kept, or nothing for one left out. */
|
|
30
|
-
declare function maskRequest<R extends Request>(request: R, { mask, ignore }: Masking): R | undefined;
|
|
31
|
-
interface NetworkOptions {
|
|
28
|
+
/** A stretch of the mic in a recording: the voice plugin's clip, and when it starts in the recording, in milliseconds. */
|
|
29
|
+
interface VoiceClip {
|
|
30
|
+
id: string;
|
|
31
|
+
at: number;
|
|
32
|
+
duration: number;
|
|
33
|
+
}
|
|
34
|
+
/** The page's half, for other plugins' page halves. */
|
|
35
|
+
interface Recorder {
|
|
32
36
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
37
|
+
* Records the page, with the toolbar, until Stop: answers the recording, kept by the dev server, or
|
|
38
|
+
* nothing when it's discarded. Rejects while another is going, or when it couldn't be kept. A page load
|
|
39
|
+
* doesn't end it: the next page of the site carries on, and `going` there answers what this would have.
|
|
35
40
|
*/
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
|
|
41
|
+
record(): Promise<Recording | undefined>;
|
|
42
|
+
/** Whether one is going. */
|
|
43
|
+
recording(): boolean;
|
|
44
|
+
/** The one going, as `record` answers it: also one a page before this started, carried on here. */
|
|
45
|
+
going(): Promise<Recording | undefined> | undefined;
|
|
46
|
+
}
|
|
47
|
+
/** A plugin of rrweb's own, as its `record` takes them: what puts more than the page in a recording. */
|
|
48
|
+
type RecordPlugin = NonNullable<NonNullable<Parameters<typeof record>[0]>['plugins']>[number];
|
|
49
|
+
/**
|
|
50
|
+
* What a plugin that adds to recordings answers in the page, under its name (`logs` and `network` do): the
|
|
51
|
+
* recorder asks each it knows for its rrweb plugin as a recording starts, so nothing listens before, or after it stops.
|
|
52
|
+
*/
|
|
53
|
+
interface Recorded {
|
|
54
|
+
/** `sinceLoad`: the recording was going as this page loaded, so what the page did before now is its too. */
|
|
55
|
+
plugin(from: {
|
|
56
|
+
sinceLoad: boolean;
|
|
57
|
+
}): Promise<RecordPlugin>;
|
|
58
|
+
}
|
|
59
|
+
/** The server's half, for other plugins' server halves. */
|
|
60
|
+
interface Recordings {
|
|
61
|
+
/** A recording's JSON, or nothing for one not kept (any more). */
|
|
62
|
+
read(id: string): {
|
|
63
|
+
data: Uint8Array<ArrayBuffer>;
|
|
64
|
+
name: string;
|
|
65
|
+
type: 'application/json';
|
|
66
|
+
} | undefined;
|
|
67
|
+
}
|
|
68
|
+
/** What a recording says as it begins: all of a `Kept` that's known then. */
|
|
69
|
+
type Meta = Omit<Kept, 'events' | 'duration' | 'voice'>;
|
|
70
|
+
/** What's kept: rrweb's events and what they can't say. */
|
|
71
|
+
interface Kept {
|
|
72
|
+
/** The page it started on. One that went on to others has each in its events, as rrweb's own: a `Meta`, then a snapshot. */
|
|
73
|
+
page: string;
|
|
74
|
+
viewport: {
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
};
|
|
39
78
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
79
|
+
* The colour scheme the page was in, which rrweb doesn't record: the replay shows it in the same, or a
|
|
80
|
+
* page styled by `prefers-color-scheme` would take the replay's.
|
|
42
81
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/** The options as the page half gets them. */
|
|
50
|
-
interface Resolved {
|
|
51
|
-
initiators: string[];
|
|
52
|
-
headers: boolean;
|
|
53
|
-
body: false | string[];
|
|
54
|
-
mask: string[];
|
|
55
|
-
ignore: string[];
|
|
82
|
+
colorScheme?: 'light' | 'dark';
|
|
83
|
+
startedAt: number;
|
|
84
|
+
duration: number;
|
|
85
|
+
events: unknown[];
|
|
86
|
+
/** The mic's clips, played along with the replay. */
|
|
87
|
+
voice?: VoiceClip[];
|
|
56
88
|
}
|
|
57
89
|
declare module 'deictic' {
|
|
90
|
+
interface ServerApis {
|
|
91
|
+
recordings: Recordings;
|
|
92
|
+
}
|
|
58
93
|
interface ClientApis {
|
|
59
|
-
|
|
94
|
+
recordings: Recorder;
|
|
60
95
|
}
|
|
61
96
|
}
|
|
62
|
-
|
|
63
|
-
|
|
97
|
+
interface RecordingsOptions extends Masking {
|
|
98
|
+
/** How many recordings to keep, the latest: 20 by default. */
|
|
99
|
+
keep?: number;
|
|
100
|
+
/** Where they're kept, from the project's root: `.deictic/recordings` by default. */
|
|
101
|
+
dir?: string;
|
|
102
|
+
/**
|
|
103
|
+
* What a `<canvas>` draws (a chart, a map, WebGL), which is no part of the page's markup: a picture of each
|
|
104
|
+
* canvas that changed, `fps` times a second, 2 by default. `false` for none, and a canvas replays blank.
|
|
105
|
+
*/
|
|
106
|
+
canvas?: boolean | {
|
|
107
|
+
fps?: number;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
declare function recordings(options?: RecordingsOptions): import("deictic").ServerPlugin<never, never, never, Recordings>;
|
|
111
|
+
export { Recorder as a, RecordingsOptions as c, ReplaySources as d, replayPage as f, Recorded as i, VoiceClip as l, Meta as n, Recording as o, MARKS as p, RecordPlugin as r, Recordings as s, Kept as t, recordings as u };
|
|
64
112
|
//# sourceMappingURL=index4.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.d.ts","names":[],"sources":["../../src/plugins/
|
|
1
|
+
{"version":3,"file":"index4.d.ts","names":[],"sources":["../../src/plugins/recordings/marks.ts","../../src/plugins/recordings/replay.ts","../../src/plugins/recordings/index.ts"],"mappings":";;;;;;cAIa;;UCyBI;;EAEf;;;;;EAKA;;;cAIW,eAAU,QAAA,WAA+B;;UCXrC;EACf;EACA;EACA;;EAEA,QAAQ;;;UAIO;EACf;EACA;EACA;;;UAIe;;;;;;EAMf,UAAU,QAAQ;;EAElB;;EAEA,SAAS,QAAQ;;;KAIP,eAAe,YAAY,YAAY,kBAAkB;;;;;UAMpD;;EAEf,OAAO;IAAQ;MAAuB,QAAQ;;;UAI/B;;EAEf,KAAK;IAAe,MAAM,WAAW;IAAc;IAAc;;;;KAIvD,OAAO,KAAK;;UAGP;;EAEf;EACA;IAAY;IAAe;;;;;;EAK3B;EACA;EACA;EACA;;EAEA,QAAQ;;;YAIE;IACR,YAAY;;YAEJ;IACR,YAAY;;;UAIC,0BAA0B;;EAEzC;;EAEA;;;;;EAKA;IAAqB;;;iBAmBP,WAAW,UAAS,sCAAsB,kCAAA"}
|