deictic 0.1.0 → 0.2.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.
Files changed (107) hide show
  1. package/README.md +26 -3
  2. package/dist/annotations/index.d.ts +1 -1
  3. package/dist/astro.d.ts +1 -1
  4. package/dist/bun.d.ts +1 -1
  5. package/dist/bun.js +2 -2
  6. package/dist/client/index.d.ts +4 -2
  7. package/dist/client/index.d.ts.map +1 -1
  8. package/dist/client/index.js +13 -9
  9. package/dist/client/index.js.map +1 -1
  10. package/dist/index.d.ts +21 -218
  11. package/dist/index.js.map +1 -1
  12. package/dist/loader.js +1 -1
  13. package/dist/next.d.ts +1 -1
  14. package/dist/next.js +2 -2
  15. package/dist/recommended/index.d.ts +4 -4
  16. package/dist/recommended/index.js +2 -2
  17. package/dist/recordings/client.d.ts +1 -1
  18. package/dist/recordings/client.js +4 -4
  19. package/dist/recordings/client.js.map +1 -1
  20. package/dist/recordings/index.d.ts +2 -2
  21. package/dist/recordings/index.js +3 -3
  22. package/dist/screenshots/client.d.ts +1 -1
  23. package/dist/screenshots/client.js +2 -2
  24. package/dist/screenshots/client.js.map +1 -1
  25. package/dist/screenshots/dom.d.ts +1 -1
  26. package/dist/screenshots/index.d.ts +1 -1
  27. package/dist/screenshots/index.js +2 -2
  28. package/dist/screenshots/index.js.map +1 -1
  29. package/dist/screenshots/rrweb.d.ts +1 -1
  30. package/dist/{endpoints.js → shared/endpoints.js} +1 -1
  31. package/dist/shared/endpoints.js.map +1 -0
  32. package/dist/shared/index.d.ts +226 -0
  33. package/dist/shared/index.d.ts.map +1 -0
  34. package/dist/{index3.d.ts → shared/index2.d.ts} +1 -1
  35. package/dist/shared/index2.d.ts.map +1 -0
  36. package/dist/{index4.d.ts → shared/index3.d.ts} +15 -3
  37. package/dist/shared/index3.d.ts.map +1 -0
  38. package/dist/shared/index4.d.ts +184 -0
  39. package/dist/shared/index4.d.ts.map +1 -0
  40. package/dist/{index5.d.ts → shared/index5.d.ts} +1 -1
  41. package/dist/shared/index5.d.ts.map +1 -0
  42. package/dist/{integration.d.ts → shared/integration.d.ts} +4 -3
  43. package/dist/shared/integration.d.ts.map +1 -0
  44. package/dist/{integration.js → shared/integration.js} +5 -3
  45. package/dist/shared/integration.js.map +1 -0
  46. package/dist/{kept.js → shared/kept.js} +2 -2
  47. package/dist/shared/kept.js.map +1 -0
  48. package/dist/shared/marks.js.map +1 -0
  49. package/dist/shared/playwright.js.map +1 -0
  50. package/dist/{recordings.js → shared/recordings.js} +20 -9
  51. package/dist/shared/recordings.js.map +1 -0
  52. package/dist/shared/shortcut.js.map +1 -0
  53. package/dist/shared/tasks.js +521 -0
  54. package/dist/shared/tasks.js.map +1 -0
  55. package/dist/shared/waveform.js.map +1 -0
  56. package/dist/tailwind/client.d.ts +1 -1
  57. package/dist/tailwind/index.d.ts +1 -1
  58. package/dist/tasks/client.d.ts +1 -1
  59. package/dist/tasks/client.js +1 -1
  60. package/dist/tasks/index.d.ts +2 -159
  61. package/dist/tasks/index.js +1 -348
  62. package/dist/vite.d.ts +11 -12
  63. package/dist/vite.d.ts.map +1 -1
  64. package/dist/vite.js +21 -4
  65. package/dist/vite.js.map +1 -1
  66. package/dist/voice/client.js +2 -2
  67. package/dist/voice/client.js.map +1 -1
  68. package/dist/voice/index.js +1 -1
  69. package/dist/webpack.d.ts +1 -1
  70. package/dist/webpack.js +2 -2
  71. package/package.json +1 -1
  72. package/skills/deictic/SKILL.md +1 -1
  73. package/skills/deictic/references/install.md +20 -5
  74. package/skills/deictic/scripts/lib.mjs +21 -3
  75. package/skills/deictic/scripts/watch.mjs +2 -2
  76. package/src/client/index.ts +20 -7
  77. package/src/index.ts +7 -0
  78. package/src/plugins/recordings/client.ts +3 -2
  79. package/src/plugins/recordings/index.ts +3 -2
  80. package/src/plugins/recordings/replay.ts +32 -6
  81. package/src/plugins/screenshots/client.ts +3 -2
  82. package/src/plugins/tasks/index.ts +52 -8
  83. package/src/plugins/tasks/local.ts +170 -0
  84. package/src/plugins/voice/client.ts +3 -2
  85. package/src/tools/integration.ts +5 -3
  86. package/src/tools/kept.ts +2 -2
  87. package/src/vite.ts +23 -4
  88. package/dist/endpoints.js.map +0 -1
  89. package/dist/index.d.ts.map +0 -1
  90. package/dist/index2.d.ts +0 -23
  91. package/dist/index3.d.ts.map +0 -1
  92. package/dist/index4.d.ts.map +0 -1
  93. package/dist/index5.d.ts.map +0 -1
  94. package/dist/integration.d.ts.map +0 -1
  95. package/dist/integration.js.map +0 -1
  96. package/dist/kept.js.map +0 -1
  97. package/dist/marks.js.map +0 -1
  98. package/dist/playwright.js.map +0 -1
  99. package/dist/recordings.js.map +0 -1
  100. package/dist/shortcut.js.map +0 -1
  101. package/dist/tasks/index.d.ts.map +0 -1
  102. package/dist/tasks/index.js.map +0 -1
  103. package/dist/waveform.js.map +0 -1
  104. /package/dist/{marks.js → shared/marks.js} +0 -0
  105. /package/dist/{playwright.js → shared/playwright.js} +0 -0
  106. /package/dist/{shortcut.js → shared/shortcut.js} +0 -0
  107. /package/dist/{waveform.js → shared/waveform.js} +0 -0
@@ -0,0 +1,170 @@
1
+ /**
2
+ * The board tasks go to when nothing names one: `vb serve`, `@vercel/board`'s own, started with the dev server
3
+ * and stopped with it, its log in `.deictic/board`. So Alt-click adds a task with nothing else to run, and
4
+ * whoever works the tasks reaches the same board at the URL `.deictic/board.json` holds.
5
+ */
6
+ import { type ChildProcess, spawn } from 'node:child_process';
7
+ import { readFileSync, writeFileSync } from 'node:fs';
8
+ import { createRequire } from 'node:module';
9
+ import { createServer } from 'node:net';
10
+ import { dirname, join, resolve } from 'node:path';
11
+
12
+ import { keptIn } from '#src/tools/kept.ts';
13
+
14
+ /** `vb serve`'s own default, so `http://127.0.0.1:4100/api/board` is the board wherever it's free. */
15
+ const PORT = 4100;
16
+ /** How long a board may take to answer after it's started, or to be gone after it's stopped. */
17
+ const PATIENCE = 20_000;
18
+
19
+ export interface LocalOptions {
20
+ /**
21
+ * The port it listens on, on 127.0.0.1. By default 4100, or a free one where that's taken. One named here is
22
+ * the only one tried: taken, the board doesn't start.
23
+ */
24
+ port?: number;
25
+ /** Where its log is kept, from the project's root: `.deictic/board` by default. */
26
+ dir?: string;
27
+ /** `false` for no pages of the board's own (its inspector): the panel then links its tasks nowhere. */
28
+ inspect?: boolean;
29
+ /** More arguments for `vb serve`, as it takes them: `['--tailscale', 'box.tailnet.ts.net']`. */
30
+ args?: string[];
31
+ }
32
+
33
+ /** What `local()` answers, for the tasks plugin's `board` option. */
34
+ export interface LocalBoard {
35
+ local: LocalOptions;
36
+ }
37
+
38
+ /**
39
+ * The project's own board on this machine, as the tasks plugin's `board`: what it uses anyway with no
40
+ * `BOARD_URL`, here whatever the environment says, and with options.
41
+ */
42
+ export const local = (options: LocalOptions = {}): LocalBoard => ({ local: options });
43
+
44
+ /** What `.deictic/board.json` holds: the board the dev server started, for whoever works its tasks. */
45
+ export interface Running {
46
+ url: string;
47
+ pid: number;
48
+ /** The options it was started with, as one string to compare: other ones need another board. */
49
+ as: string;
50
+ }
51
+
52
+ export interface Local {
53
+ url: string;
54
+ /** Whether this call started it, rather than found it running. */
55
+ fresh: boolean;
56
+ /** Where its log is. */
57
+ dir: string;
58
+ /** Stops the board, where this call started it: one found running is left to what started it. */
59
+ stop: () => void;
60
+ }
61
+
62
+ /**
63
+ * The project's own board, started unless it's running: a dev server that restarts in its process (Vite, when
64
+ * its config changes) asks again, and so does a second dev server of the same project, and two boards mustn't
65
+ * write one log. One running with other options is stopped first, for the same reason.
66
+ */
67
+ export async function localBoard(root: string, options: LocalOptions = {}): Promise<Local> {
68
+ const file = keptIn(root, 'board.json');
69
+ const dir = options.dir === undefined ? keptIn(root, 'board') : resolve(root, options.dir);
70
+ const flags = [...(options.inspect === false ? ['--no-inspect'] : []), ...(options.args ?? [])];
71
+ const as = JSON.stringify([options.port ?? null, dir, flags]);
72
+
73
+ const running = read(file);
74
+ if (running !== undefined && alive(running.pid) && (await answers(running.url))) {
75
+ if (running.as === as) return { url: running.url, fresh: false, dir, stop: () => {} };
76
+ process.kill(running.pid);
77
+ await gone(running.url);
78
+ }
79
+
80
+ const port = options.port ?? (await free(PORT));
81
+ const url = `http://127.0.0.1:${port}/api/board`;
82
+ const child = spawn(process.execPath, [cli(), 'serve', '--port', String(port), '--no-open', '--dir', dir, ...flags], {
83
+ stdio: ['ignore', 'ignore', 'pipe'],
84
+ });
85
+ let said = '';
86
+ child.stderr.on('data', (chunk: Buffer) => (said += chunk.toString()));
87
+ const stop = () => void child.kill();
88
+ process.once('exit', stop);
89
+
90
+ try {
91
+ await started(child, url);
92
+ } catch (e) {
93
+ stop();
94
+ const fix = options.port === undefined ? 'set BOARD_URL to a board of your own' : `is port ${port} taken? name another, or none`;
95
+ throw new Error(`the board didn't start (${said.trim() || (e as Error).message}): ${fix}`, { cause: e });
96
+ }
97
+ writeFileSync(file, `${JSON.stringify({ url, pid: child.pid, as }, null, 2)}\n`);
98
+ // The board ends with this process, and mustn't be what keeps it from ending.
99
+ child.unref();
100
+ (child.stderr as { unref?: () => void }).unref?.();
101
+ return { url, fresh: true, dir, stop };
102
+ }
103
+
104
+ /** `vb`'s script in the project's `@vercel/board`, run with this process's own runtime: no shim, no shell. */
105
+ function cli(): string {
106
+ return join(dirname(createRequire(import.meta.url).resolve('@vercel/board/package.json')), 'dist', 'cli.mjs');
107
+ }
108
+
109
+ function read(file: string): Running | undefined {
110
+ try {
111
+ const { url, pid, as } = JSON.parse(readFileSync(file, 'utf8')) as Partial<Running>;
112
+ return typeof url === 'string' && typeof pid === 'number' ? { url, pid, as: as ?? '' } : undefined;
113
+ } catch {
114
+ return undefined;
115
+ }
116
+ }
117
+
118
+ function alive(pid: number): boolean {
119
+ try {
120
+ process.kill(pid, 0);
121
+ return true;
122
+ } catch {
123
+ return false;
124
+ }
125
+ }
126
+
127
+ /** Whether a board answers there: its discovery, which names its own URL. */
128
+ async function answers(url: string): Promise<boolean> {
129
+ try {
130
+ const res = await fetch(url, { signal: AbortSignal.timeout(2000) });
131
+ return res.ok && ((await res.json()) as { url?: unknown }).url === url;
132
+ } catch {
133
+ return false;
134
+ }
135
+ }
136
+
137
+ /** `wanted` where nothing listens on it (another project's board may), or else a port the system picks. */
138
+ async function free(wanted: number): Promise<number> {
139
+ const listen = (port: number) =>
140
+ new Promise<number>((done, failed) => {
141
+ const server = createServer();
142
+ server.once('error', failed);
143
+ server.listen(port, '127.0.0.1', () => {
144
+ const { port: got } = server.address() as { port: number };
145
+ server.close(() => done(got));
146
+ });
147
+ });
148
+ return listen(wanted).catch(() => listen(0));
149
+ }
150
+
151
+ const nap = () => new Promise((wake) => setTimeout(wake, 100));
152
+
153
+ /** Waits for the board to answer, or for its process to end without having. */
154
+ async function started(child: ChildProcess, url: string): Promise<void> {
155
+ let ended: string | undefined;
156
+ child.once('error', (e) => (ended = e.message));
157
+ child.once('exit', (code) => (ended ??= `exit ${code}`));
158
+ for (const until = Date.now() + PATIENCE; Date.now() < until; await nap()) {
159
+ if (ended !== undefined) throw new Error(ended);
160
+ if (await answers(url)) return;
161
+ }
162
+ throw new Error(`no answer at ${url} after ${PATIENCE / 1000}s`);
163
+ }
164
+
165
+ /** Waits for a stopped board to let go of its port and its log. */
166
+ async function gone(url: string): Promise<void> {
167
+ for (const until = Date.now() + PATIENCE; Date.now() < until; await nap()) if (!(await answers(url))) return;
168
+
169
+ throw new Error(`the board at ${url} is still running: stop it, then restart the dev server`);
170
+ }
@@ -47,9 +47,10 @@ export default defineClientPlugin<never, never, Voice>({
47
47
  const duration = Date.now() - started;
48
48
  const type = (recorder.mimeType || mimeType || 'audio/webm').split(';')[0]!;
49
49
  const res = await request('add', { method: 'POST', headers: { 'content-type': type }, body: new Blob(chunks, { type }) });
50
- const { id, problem } = (await res.json()) as { id?: string; problem?: string };
50
+ // `url`: where the clip is, said by what keeps it with no server to serve it from (a `standalone` build).
51
+ const { id, url, problem } = (await res.json()) as { id?: string; url?: string; problem?: string };
51
52
  if (id === undefined) throw new Error(`voice: ${problem ?? res.statusText}`);
52
- return { id, url: `${base}__deictic/plugins/voice/clip/${id}`, duration, type };
53
+ return { id, url: url ?? `${base}__deictic/plugins/voice/clip/${id}`, duration, type };
53
54
  },
54
55
  };
55
56
  },
@@ -36,9 +36,10 @@ export function prepare(options: DeicticOptions): { plugins: ServerPlugin[]; sho
36
36
 
37
37
  /**
38
38
  * The client module: the overlay, started with deictic's own shortcut and each plugin that has a half
39
- * in the page, with its shortcut, checked.
39
+ * in the page, with its shortcut, checked; and with `server`, a module of the page's that answers its requests
40
+ * where no dev server does.
40
41
  */
41
- export const clientModule = (plugins: ServerPlugin[], base: string, own?: Shortcut | false) => {
42
+ export const clientModule = (plugins: ServerPlugin[], base: string, own?: Shortcut | false, server?: string) => {
42
43
  const [shortcut, ...shortcuts] = checkShortcuts([{ name: OWN, shortcut: ownShortcut(own) }, ...plugins]);
43
44
  const paged = plugins.flatMap((p, i) =>
44
45
  p.client === undefined ? [] : [{ client: p.client, rest: { shortcut: shortcuts[i], options: p.clientOptions } }],
@@ -46,8 +47,9 @@ export const clientModule = (plugins: ServerPlugin[], base: string, own?: Shortc
46
47
  return [
47
48
  `import { start } from 'deictic/client';`,
48
49
  ...paged.map((p, i) => `import p${i} from ${JSON.stringify(p.client)};`),
50
+ ...(server === undefined ? [] : [`import server from ${JSON.stringify(server)};`]),
49
51
  // Its shortcut and options as JSON, where it has them: `JSON.stringify` leaves out what's undefined.
50
- `start({ base: ${JSON.stringify(base)}, shortcut: ${JSON.stringify(shortcut) ?? 'undefined'}, plugins: [${paged.map((p, i) => `{ plugin: p${i}, ...${JSON.stringify(p.rest)} }`).join(', ')}] });`,
52
+ `start({ base: ${JSON.stringify(base)}, shortcut: ${JSON.stringify(shortcut) ?? 'undefined'}, plugins: [${paged.map((p, i) => `{ plugin: p${i}, ...${JSON.stringify(p.rest)} }`).join(', ')}]${server === undefined ? '' : ', server'} });`,
51
53
  ].join('\n');
52
54
  };
53
55
 
package/src/tools/kept.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Where deictic keeps what it makes for a project: `.deictic/` at its root, beside `.board/` and the like,
3
- * rather than in `node_modules`, which an install may clear. The history is there, and the shots,
4
- * recordings and voice clips plugins keep. It ignores itself in git: the history holds whole files, and
3
+ * rather than in `node_modules`, which an install may clear. The history is there, the shots,
4
+ * recordings and voice clips plugins keep, and the tasks plugin's own board. It ignores itself in git: the history holds whole files, and
5
5
  * the rest is the page as it looked, neither of which belongs in a commit.
6
6
  */
7
7
  import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
package/src/vite.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `deictic/vite`: deictic in Vite's dev server. Nothing runs in a build.
2
+ * `deictic/vite`: deictic in Vite's dev server. Nothing runs in a build, unless `standalone` asks for it.
3
3
  *
4
4
  * Its transform runs `pre`, so each JSX module's host elements are marked with their place in the
5
5
  * source as written (`tools/locate.ts`). In the browser each marked module also imports the client
@@ -8,6 +8,8 @@
8
8
  * Vite's server, and a place opens through Vite's own `/__open-in-editor`, so the editor is whichever
9
9
  * Vite already launches. A write reaches the page through Vite's usual update for the file.
10
10
  */
11
+ import { resolve } from 'node:path';
12
+
11
13
  import type { Plugin } from 'vite';
12
14
 
13
15
  import { endpoints, nodeMiddleware, redirect } from './tools/endpoints.ts';
@@ -15,23 +17,35 @@ import { clientModule, type DeicticOptions, mark, markAstro, prepare } from './t
15
17
 
16
18
  export { clientModule, type DeicticOptions };
17
19
 
20
+ export interface ViteOptions extends DeicticOptions {
21
+ /**
22
+ * deictic in a build too, for a page that shows it with no dev server behind it (a deployed demo): a module of
23
+ * the page's, from the root, whose default export answers the overlay's requests there (a `Standalone`, from
24
+ * `deictic`). The build's elements are marked and the overlay is in its bundle. The dev server answers as ever.
25
+ * Without it, the default, nothing of deictic is in a build.
26
+ */
27
+ standalone?: string;
28
+ }
29
+
18
30
  /** The client module's ID, which a page can import itself where nothing it bundles is JSX (Astro's pages). */
19
31
  export const CLIENT = 'virtual:deictic/client';
20
32
  const CLIENT_ID = '\0deictic/client';
21
33
 
22
- export function deictic(options: DeicticOptions = {}): Plugin {
34
+ export function deictic(options: ViteOptions = {}): Plugin {
23
35
  const { plugins, shortcut } = prepare(options);
24
36
  let root = '';
25
37
  let base = '/';
38
+ let building = false;
26
39
  return {
27
40
  name: 'deictic',
28
41
  enforce: 'pre',
29
- apply: 'serve',
42
+ apply: (_, { command }) => command === 'serve' || options.standalone !== undefined,
30
43
  // The client is the app's to bundle as it changes, not a dependency to prebundle once.
31
44
  config: () => ({ optimizeDeps: { exclude: ['deictic'] } }),
32
45
  configResolved(config) {
33
46
  root = config.root;
34
47
  base = config.base;
48
+ building = config.command === 'build';
35
49
  },
36
50
  configureServer(server) {
37
51
  const handle = endpoints({
@@ -43,7 +57,12 @@ export function deictic(options: DeicticOptions = {}): Plugin {
43
57
  server.middlewares.use(nodeMiddleware(handle));
44
58
  },
45
59
  resolveId: (id) => (id === CLIENT ? CLIENT_ID : undefined),
46
- load: (id) => (id === CLIENT_ID ? clientModule(plugins, base, shortcut) : undefined),
60
+ load(id) {
61
+ if (id !== CLIENT_ID) return undefined;
62
+ // Only a build's page asks the module: the dev server is there to answer.
63
+ const server = building && options.standalone !== undefined ? resolve(root, options.standalone).replaceAll('\\', '/') : undefined;
64
+ return clientModule(plugins, base, shortcut, server);
65
+ },
47
66
  transform: {
48
67
  // First of all, not only first of the `pre` plugins: the React Compiler (`react({ compiler: true })`) is
49
68
  // `pre` too and compiles the JSX away, so after it there'd be no element to mark, wherever deictic is listed.
@@ -1 +0,0 @@
1
- {"version":3,"file":"endpoints.js","names":[],"sources":["../src/tools/source.ts","../src/tools/history.ts","../src/tools/endpoints.ts"],"sourcesContent":["/**\n * The source a server half reads: a target's file, parsed, and the opening tag the page's attribute\n * points at. Files are only ever read and written under the project's root, outside `node_modules`.\n */\nimport { readFileSync } from 'node:fs';\nimport { isAbsolute, relative, resolve, sep } from 'node:path';\n\nimport { Refusal, type Source, type Target, type TextEdit } from '#src/index.ts';\n\nimport { ASTRO, parseAstro, type Parsed } from './astro.ts';\nimport { isHost, lineStarts, offsetOf, openingsIn, parse } from './locate.ts';\n\n/** A file from the project's root, as an absolute path; refused anywhere the page has no business writing. */\nexport function resolveFile(root: string, file: string): string {\n const path = resolve(root, file);\n const from = relative(root, path);\n // `relative` gives an absolute path for another drive.\n if (from === '' || from.startsWith('..') || isAbsolute(from) || from.split(sep).includes('node_modules'))\n throw new Refusal(`${file} is not a file of this project's own`);\n return path;\n}\n\nexport function readSource(root: string, file: string): string {\n try {\n return readFileSync(resolveFile(root, file), 'utf8');\n } catch (e) {\n if (e instanceof Refusal) throw e;\n throw new Refusal(`can't read ${file}: has it moved since the page loaded?`, { cause: e });\n }\n}\n\n/** The target's file and element, as they are on disk now. */\nexport function sourceAt(root: string, target: Target): Source {\n const { file, line, column } = target.loc;\n const code = readSource(root, file);\n const offset = offsetOf(lineStarts(code), line, column);\n const { program, elements } = ASTRO.test(file) ? astro(root, file, code) : jsx(file, code);\n const element = elements.find((el) => el.start === offset && isHost(el));\n if (element === undefined || (element.name.type === 'JSXIdentifier' && element.name.name !== target.tag))\n throw new Refusal(`no <${target.tag}> at ${file}:${line}:${column} any more: the file changed since the page loaded, so reload it`);\n return { file, code, program, element, read: (other) => readSource(root, other) };\n}\n\nfunction jsx(file: string, code: string): Parsed {\n const { program, errors } = parse(file, code);\n if (errors.length > 0) throw new Refusal(`${file} doesn't parse: fix it first (${errors[0]!.message})`);\n return { program, elements: openingsIn(program) };\n}\n\nfunction astro(root: string, file: string, code: string): Parsed {\n const parsed = parseAstro(root, code);\n if ('problem' in parsed) throw new Refusal(`${file} can't be read: ${parsed.problem}`);\n return parsed;\n}\n\n/** Each file's text after its edits, which must not overlap. */\nexport function applyEdits(source: Source, edits: TextEdit[]): Map<string, string> {\n const byFile = Map.groupBy(edits, (e) => e.file ?? source.file);\n const out = new Map<string, string>();\n for (const [file, list] of byFile) {\n const sorted = list.toSorted((a, b) => b.start - a.start);\n let code = file === source.file ? source.code : source.read(file);\n let floor = Infinity;\n for (const edit of sorted) {\n if (edit.end > floor) throw new Error(`deictic: edits to ${file} overlap at ${edit.end}`);\n code = code.slice(0, edit.start) + edit.text + code.slice(edit.end);\n floor = edit.start;\n }\n out.set(file, code);\n }\n return out;\n}\n","/**\n * Every change deictic made, to undo and redo. A change to files holds each file's whole text\n * before and after: source files are small, and the texts make undo exact without a diff to go stale.\n * A change a plugin made itself (`Done`) holds the plugin's name and its record, and undoing it is the\n * plugin's `undo`.\n *\n * Each change has a scope, the plugin and the element it was made on, and the popup undoes and redoes\n * within its own: the latest change of this tab on this element, not the latest of all. So a change\n * is taken back out of order, with later ones to the same file still in it. Then only the lines the\n * change wrote go back to what they were, where they're still in the file as it wrote them, once.\n *\n * Anything else is refused, not merged: a file whose lines were edited since has the editor's own undo\n * for it; and a redo likewise. A plugin's undo refuses on its own terms. Kept under `.deictic`, so it\n * outlives a restart of the dev server and stays out of git.\n */\nimport { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\n\nimport { Refusal, type ServerPlugin } from '#src/index.ts';\n\nimport { keptIn } from './kept.ts';\nimport { resolveFile } from './source.ts';\n\nexport interface FileChange {\n file: string;\n /** The text before, or nothing for a file the change made. */\n before: string | null;\n after: string;\n}\n\n/** Whose a change is: the plugin whose tab made it, and the element it was open on, as `file:line:column`. */\nexport interface Scope {\n plugin: string;\n target: string;\n}\n\ninterface Base {\n id: number;\n at: string;\n label: string;\n /** None on a change made without one, which only an undo of the whole history reaches. */\n scope?: Scope;\n}\n\nexport type Change = Base & ({ files: FileChange[] } | { plugin: string; record: unknown });\n\n/** A change as the page lists it. `files` is empty for one a plugin made itself. */\nexport interface Summary {\n id: number;\n at: string;\n label: string;\n files: string[];\n}\n\nexport interface HistoryOptions {\n /** Whose `undo` and `redo` take back the changes they made themselves. */\n plugins?: ServerPlugin[];\n store?: string;\n}\n\nconst LIMIT = 200;\n\n/** Whether a change is in a scope: any is in none. */\nconst within = (scope: Scope | undefined) => (c: Change) =>\n scope === undefined || (c.scope?.plugin === scope.plugin && c.scope.target === scope.target);\n\nconst summary = (c: Change): Summary => ({ id: c.id, at: c.at, label: c.label, files: 'files' in c ? c.files.map((f) => f.file) : [] });\n\nexport class History {\n #done: Change[] = [];\n #undone: Change[] = [];\n readonly #root: string;\n readonly #store: string;\n readonly #plugins: Map<string, ServerPlugin>;\n\n constructor(root: string, { plugins = [], store = keptIn(root, 'history.json') }: HistoryOptions = {}) {\n this.#root = root;\n this.#store = store;\n this.#plugins = new Map(plugins.map((p) => [p.name, p]));\n if (!existsSync(store)) return;\n try {\n ({ done: this.#done, undone: this.#undone } = JSON.parse(readFileSync(store, 'utf8')) as { done: Change[]; undone: Change[] });\n } catch {\n // A history that doesn't read is one we start over, not one to stop the dev server for.\n }\n }\n\n /** Writes each file's new text and records it as one change. A redo after it, in its scope, is gone, as in any editor. */\n commit(label: string, texts: Map<string, string>, scope?: Scope): Summary {\n const files: FileChange[] = [];\n for (const [file, after] of texts) {\n const path = resolveFile(this.#root, file);\n const before = existsSync(path) ? readFileSync(path, 'utf8') : null;\n if (before !== after) files.push({ file, before, after });\n }\n if (files.length === 0) throw new Refusal('nothing to change: the source already says that');\n for (const f of files) write(resolveFile(this.#root, f.file), f.after);\n return this.#push({ label, files }, scope);\n }\n\n /** Records a change `plugin` made itself, with what its `undo` needs. */\n record(label: string, plugin: string, record: unknown, scope?: Scope): Summary {\n return this.#push({ label, plugin, record }, scope);\n }\n\n /** Takes back the latest change, of a scope where one is given. */\n async undo(scope?: Scope): Promise<Summary> {\n const change = this.#done.findLast(within(scope));\n if (change === undefined) throw new Refusal(scope === undefined ? 'nothing to undo' : 'nothing to undo here');\n if ('files' in change) this.#put(change, 'after', 'before');\n else change.record = (await this.#pluginOf(change, 'undo').undo!(change.record)) ?? change.record;\n this.#done = this.#done.filter((c) => c !== change);\n this.#undone.push(change);\n this.#save();\n return summary(change);\n }\n\n /** Makes the change last undone again, of a scope where one is given. */\n async redo(scope?: Scope): Promise<Summary> {\n const change = this.#undone.findLast(within(scope));\n if (change === undefined) throw new Refusal(scope === undefined ? 'nothing to redo' : 'nothing to redo here');\n if ('files' in change) this.#put(change, 'before', 'after');\n else change.record = await this.#pluginOf(change, 'redo').redo!(change.record);\n this.#undone = this.#undone.filter((c) => c !== change);\n this.#done.push(change);\n this.#save();\n return summary(change);\n }\n\n list(scope?: Scope): { done: Summary[]; undone: Summary[] } {\n return { done: this.#done.filter(within(scope)).map(summary), undone: this.#undone.filter(within(scope)).map(summary) };\n }\n\n #push(change: Omit<Base, 'id' | 'at'> & ({ files: FileChange[] } | { plugin: string; record: unknown }), scope?: Scope): Summary {\n const id = Math.max(0, ...[...this.#done, ...this.#undone].map((c) => c.id)) + 1;\n const made = { id, at: new Date().toISOString(), ...change, ...(scope === undefined ? {} : { scope }) };\n this.#done = [...this.#done, made].slice(-LIMIT);\n // What was undone in this scope can't be redone over the new change; another scope's still can.\n this.#undone = this.#undone.filter((c) => !within(scope)(c));\n this.#save();\n return summary(made);\n }\n\n #pluginOf(change: { label: string; plugin: string }, step: 'undo' | 'redo'): ServerPlugin {\n const plugin = this.#plugins.get(change.plugin);\n if (plugin?.[step] === undefined) {\n throw new Refusal(\n `can't ${step} \"${change.label}\": the ${change.plugin} plugin that made it isn't loaded, so add it back to \\`plugins\\``,\n );\n }\n return plugin;\n }\n\n /**\n * Puts each file's `to` text back, once every one of them still reads as its `from`, or still has the\n * lines that differ as `from` has them: then those lines alone change, and the rest stays as it is now.\n */\n #put(change: Base & { files: FileChange[] }, from: 'before' | 'after', to: 'before' | 'after'): void {\n const paths = change.files.map((f) => resolveFile(this.#root, f.file));\n const texts = change.files.map((f, i) => {\n const now = existsSync(paths[i]!) ? readFileSync(paths[i]!, 'utf8') : null;\n if (now === f[from]) return f[to];\n const text = now === null || f[from] === null || f[to] === null ? undefined : swapped(now, f[from], f[to]);\n if (text === undefined) {\n throw new Refusal(\n `${f.file} changed since \"${change.label}\" ${from === 'after' ? 'was made' : 'was undone'}: use the editor's undo there`,\n );\n }\n return text;\n });\n texts.forEach((text, i) => {\n if (text === null) rmSync(paths[i]!);\n else write(paths[i]!, text);\n });\n }\n\n #save(): void {\n write(this.#store, JSON.stringify({ done: this.#done, undone: this.#undone }));\n }\n}\n\n/**\n * `now` with the lines that differ between `from` and `to` put as `to` has them, where `now` has them as\n * `from` does, in one place only. Nothing where it doesn't (they were edited, or there are two of them), or\n * where `from` has no such lines to find (the change only removed some).\n */\nfunction swapped(now: string, from: string, to: string): string | undefined {\n const [a, b, lines] = [from.split('\\n'), to.split('\\n'), now.split('\\n')];\n let head = 0;\n while (head < a.length && head < b.length && a[head] === b[head]) head++;\n let tail = 0;\n while (tail < a.length - head && tail < b.length - head && a.at(-1 - tail) === b.at(-1 - tail)) tail++;\n const theirs = a.slice(head, a.length - tail);\n if (theirs.length === 0) return undefined;\n const found = lines.flatMap((_, i) => (theirs.every((line, j) => lines[i + j] === line) ? [i] : []));\n if (found.length !== 1) return undefined;\n return [...lines.slice(0, found[0]), ...b.slice(head, b.length - tail), ...lines.slice(found[0]! + theirs.length)].join('\\n');\n}\n\nfunction write(path: string, text: string): void {\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, text);\n}\n","/**\n * The dev server's half of deictic, under `/__deictic/`: `read` and `apply` an op through a\n * plugin, `undo`, `redo` and `history`, and `open`, which opens a place in the editor. Written over\n * `Request` and `Response`, so each integration mounts them its own way (Vite as middleware), and\n * served from the page's own origin, so no token travels to the page. `undo`, `redo` and `history` are a\n * plugin's on an element where the request names them (as the popup does: its tab, its element), and\n * the whole history's where it doesn't.\n *\n * Everything but `open` and `history` writes or may, so only the page itself may send it: a POST of\n * JSON from the same origin, which a form or a script on another site can't send without asking first.\n *\n * Each plugin's own `routes` are under `plugins/<name>/`. A `GET` there reaches the plugin as it\n * comes; anything else only from the page's own origin, in whatever type it sends (an image, say).\n * Nothing is answered before every plugin's `setup` has run.\n */\nimport type { IncomingMessage, ServerResponse } from 'node:http';\n\nimport { type Loc, Refusal, type ServerPlugin, type Target } from '#src/index.ts';\n\nimport { History, type Scope } from './history.ts';\nimport { setUp } from './plugins.ts';\nimport { applyEdits, resolveFile, sourceAt } from './source.ts';\n\nexport interface EndpointOptions {\n root: string;\n plugins: ServerPlugin[];\n /** The path the endpoints sit under, ending in `/`: `/` by default. */\n base?: string;\n /** Opens a place in the editor: a redirect to the dev server's own launcher. */\n open: (path: string, loc: Loc) => Response | Promise<Response>;\n history?: History;\n}\n\ninterface Body {\n plugin: string;\n target: Target;\n op?: unknown;\n}\n\nconst scopeOf = (plugin: string, { file, line, column }: Loc): Scope => ({ plugin, target: `${file}:${line}:${column}` });\n/** The scope an undo or a redo names, or none for the whole history. */\nconst scopeIn = ({ plugin, target }: Partial<Body>) =>\n plugin === undefined || target === undefined ? undefined : scopeOf(plugin, target.loc);\n\n/** Answers deictic's requests, and nothing for any other path. */\nexport function endpoints({ root, plugins, base = '/', open, history = new History(root, { plugins }) }: EndpointOptions) {\n const byName = new Map(plugins.map((p) => [p.name, p]));\n const prefix = `${base}__deictic/`;\n // Started now, awaited by every request: a plugin's API is there before anything asks for it.\n const ready = setUp(root, plugins);\n\n const pluginOf = (name: string) => {\n const plugin = byName.get(name);\n if (plugin === undefined) throw new Refusal(`no plugin \"${name}\" on the server: is it in the bundler plugin's \\`plugins\\`?`);\n return plugin;\n };\n\n const routes: Record<string, (body: Body) => Promise<unknown>> = {\n read: async ({ plugin, target }) => ({ model: await readOf(pluginOf(plugin), target) }),\n apply: async ({ plugin: name, target, op }) => {\n const plugin = pluginOf(name);\n if (plugin.apply === undefined) throw new Refusal(`${name} changes nothing from its panel: it has no \\`apply\\``);\n const source = sourceAt(root, target);\n const before = await readOf(plugin, target);\n const { file, line } = target.loc;\n const label = `${name} ${file}:${line}: ${plugin.describe?.(op, before) ?? 'edit'}`;\n const result = await plugin.apply(source, target, op);\n const scope = scopeOf(name, target.loc);\n const change = Array.isArray(result)\n ? history.commit(label, applyEdits(source, result), scope)\n : history.record(label, name, result.done, scope);\n return { model: await readOf(plugin, target), change };\n },\n undo: async (body) => ({ change: await history.undo(scopeIn(body)) }),\n redo: async (body) => ({ change: await history.redo(scopeIn(body)) }),\n };\n // A plugin without `read` has no model, and no need for its element to be where the page says.\n const readOf = (plugin: ServerPlugin, target: Target) => (plugin.read === undefined ? null : plugin.read(sourceAt(root, target), target));\n // One write at a time: a plugin's change may wait on the network, and an undo sent meanwhile must\n // take back that change, not the one before it.\n let queue: Promise<unknown> = Promise.resolve();\n const serially = <T>(run: () => Promise<T>): Promise<T> => {\n const next = queue.then(run, run);\n queue = next.catch(() => {});\n return next;\n };\n\n return async (req: Request): Promise<Response | undefined> => {\n const url = new URL(req.url);\n if (!url.pathname.startsWith(prefix)) return undefined;\n const route = url.pathname.slice(prefix.length);\n const origin = req.headers.get('origin');\n const sameOrigin = origin !== null && new URL(origin).host === url.host;\n try {\n const context = await ready;\n if (route.startsWith('plugins/')) {\n const [name = '', first = ''] = route.slice('plugins/'.length).split('/');\n const handle = byName.get(name)?.routes?.[first];\n if (handle === undefined) return new Response(`no endpoint ${url.pathname}`, { status: 404 });\n if (req.method !== 'GET' && req.method !== 'HEAD' && !sameOrigin)\n return Response.json({ problem: `only the page itself may ${req.method} to ${name}` }, { status: 403 });\n return await handle(req, context);\n }\n const loc = {\n file: url.searchParams.get('file') ?? '',\n line: Number(url.searchParams.get('line')),\n column: Number(url.searchParams.get('column')),\n };\n if (route === 'history') {\n const plugin = url.searchParams.get('plugin');\n return Response.json(history.list(plugin === null ? undefined : scopeOf(plugin, loc)));\n }\n if (route === 'open') return await open(resolveFile(root, loc.file), loc);\n const handler = routes[route];\n if (handler === undefined) return new Response(`no endpoint ${url.pathname}`, { status: 404 });\n if (req.method !== 'POST' || !sameOrigin || req.headers.get('content-type')?.startsWith('application/json') !== true)\n return Response.json({ problem: 'edits come from the page, as JSON' }, { status: 403 });\n const body = (await req.json()) as Body;\n return Response.json(await (route === 'read' ? handler(body) : serially(() => handler(body))));\n } catch (e) {\n if (e instanceof Refusal) return Response.json({ problem: e.message }, { status: 422 });\n return Response.json({ problem: e instanceof Error ? (e.stack ?? e.message) : String(e) }, { status: 500 });\n }\n };\n}\n\n/** A redirect within the page's origin, to a launcher the dev server answers itself. */\nexport const redirect = (path: string) => new Response(null, { status: 307, headers: { Location: path } });\n\n/**\n * The endpoints as Node middleware, for Vite's server. The request's host is the one the page was\n * served from: a proxy's `x-forwarded-host` before its own.\n */\nexport function nodeMiddleware(\n handle: (req: Request) => Promise<Response | undefined>,\n): (req: IncomingMessage, res: ServerResponse, next: () => void) => void {\n return (req, res, next) => {\n // Before reading the body, which a request for anything else leaves to whoever answers it.\n if (req.url?.includes('/__deictic/') !== true) return next();\n const forwarded = req.headers['x-forwarded-host'];\n const host = (Array.isArray(forwarded) ? forwarded[0] : forwarded) ?? req.headers.host ?? 'localhost';\n const headers = new Headers();\n for (const [name, value] of Object.entries(req.headers))\n for (const v of Array.isArray(value) ? value : value === undefined ? [] : [value]) headers.append(name, v);\n\n const chunks: Buffer[] = [];\n req.on('data', (chunk: Buffer) => chunks.push(chunk));\n req.on('end', () => {\n const body = req.method === 'GET' || req.method === 'HEAD' ? undefined : Buffer.concat(chunks);\n handle(new Request(`http://${host}${req.url}`, { method: req.method, headers, body }))\n .then(async (response) => {\n if (response === undefined) return next();\n res.statusCode = response.status;\n response.headers.forEach((value, name) => res.setHeader(name, value));\n res.end(Buffer.from(await response.arrayBuffer()));\n })\n .catch((e: unknown) => {\n res.statusCode = 500;\n res.end(e instanceof Error ? e.message : String(e));\n });\n });\n };\n}\n"],"mappings":";;;;;;;;;;;AAaA,SAAgB,YAAY,MAAc,MAAsB;CAC9D,MAAM,OAAO,QAAQ,MAAM,IAAI;CAC/B,MAAM,OAAO,SAAS,MAAM,IAAI;CAEhC,IAAI,SAAS,MAAM,KAAK,WAAW,IAAI,KAAK,WAAW,IAAI,KAAK,KAAK,MAAM,GAAG,CAAC,CAAC,SAAS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2
- * `deictic`: what a plugin is. Every plugin is optional: deictic itself is the glue (the
3
- * transform that ties elements to source, the dev server's endpoints, the history, shortcuts and the
4
- * overlay's panel), and each plugin adds what it does on top.
5
- *
6
- * A plugin has two halves, each optional that meet over the dev server's endpoints (`tools/endpoints.ts`). The
7
- * server half runs beside the bundler and is the only one that reads source: it turns the element
8
- * under the pointer into a model its panel can show, and an op from that panel into text edits. It
9
- * never writes files; deictic does, so every plugin's changes land in one history and undo the
10
- * same way. A change that isn't to a file (a task added to a board) the plugin makes itself and
11
- * answers with what it did (`Done`): the history keeps that beside the files' changes and hands it
12
- * back to the plugin's own `undo` and `redo`.
13
- * The client half is a module the page loads, named by the server half's `client`, which draws the
14
- * panel and previews an op on the page before it is applied.
15
- *
16
- * A plugin may have no panel at all, only an API for others (screenshots, a recording) and routes of
17
- * its own on the dev server. Each half's `setup` answers its API, and `use(name)` reaches another
18
- * plugin's, on the same side; `needs` names the plugins it can't do without.
19
- *
20
- * Both halves import from here, so the parser is imported for its types only: the browser must not load it.
21
- */
22
- import { C as Shortcut, S as Modifier, _ as Source, a as Done, b as defineClientPlugin, c as LightboxOptions, d as Refusal, f as Resumed, g as ServerPlugin, h as ServerContext, i as ClientPlugin, l as Loc, m as ServerApis, n as ClientApis, o as LightboxAction, p as Route, r as ClientContext, s as LightboxItem, t as ApiOf, u as PanelContext, v as Target, x as definePlugin, y as TextEdit } from "./index.js";
23
- export { ApiOf, ClientApis, ClientContext, ClientPlugin, Done, LightboxAction, LightboxItem, LightboxOptions, Loc, type Modifier, PanelContext, Refusal, Resumed, Route, ServerApis, ServerContext, ServerPlugin, type Shortcut, Source, Target, TextEdit, defineClientPlugin, definePlugin };
@@ -1 +0,0 @@
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;;;UAI5C;;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;EACA,QAAQ,iBAAiB,QAAQ;;;UAIlB;;EAEf;;EAEA;;;cAIW,WAAU;;;;;cAMV,QAAK,UAAa,mBAAsB;UAMpC,2BAA2B;;EAE1C,WAAW;;EAEX;;EAEA;;iBAOc,YAAY,UAAS,uCAAuB,kCAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index4.d.ts","names":[],"sources":["../src/plugins/recordings/marks.ts","../src/plugins/recordings/index.ts"],"mappings":";;;;;cAIa;;UCkBI;EACf;EACA;EACA;;EAEA,QAAQ;;;UAIO;EACf;EACA;EACA;;;UAIe;;;;;EAKf,UAAU,QAAQ;;EAElB;;;UAIe;;EAEf,KAAK;IAAe,MAAM,WAAW;IAAc;IAAc;;;;UAIlD;EACf;EACA;IAAY;IAAe;;;;;;EAK3B;EACA;EACA;EACA;;EAEA,QAAQ;;;YAIE;IACR,YAAY;;YAEJ;IACR,YAAY;;;UAIC,0BAA0B;;EAEzC;;EAEA;;iBAiBc,WAAW,UAAS,sCAAsB,kCAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index5.d.ts","names":[],"sources":["../src/plugins/tailwind/catalog.ts","../src/plugins/tailwind/index.ts"],"mappings":";;UAeiB;EACf;;EAEA;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf;;EAEA;EACA,OAAO;;EAEP;IAAW;IAAgB;IAAe;;;UCf3B;;EAEf;;EAEA;;;;;EAKA;;EAEA,WAAW;;KAGD;EAEN;EACA;;EAEA,SAAS;;EAET;EAAiB;;;UAGN;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe;EACf;;EAEA;;iBASc,SAAS,UAAS,oCAAoB,aAAA,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.d.ts","names":[],"sources":["../src/tools/integration.ts"],"mappings":";;;UAmBiB;;EAEf,UAAU;;;;;EAKV,WAAW;;;;;;cAcA,eAAY,SAAa,gBAAc,cAAc,MAAQ"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration.js","names":["OWN","OWN"],"sources":["../src/tools/locate.ts","../src/tools/astro.ts","../src/tools/plugins.ts","../src/tools/integration.ts"],"sourcesContent":["/**\n * Marks each host element in a JSX module with where its opening tag starts:\n * `<div data-deictic=\"src/App.tsx:12:5\">`. The page reads it back to know what was clicked.\n *\n * At build time and not from React's fibers at runtime: it works for any framework that compiles JSX,\n * for server components (which have no fiber in the browser), and it names the element's own tag\n * rather than the component that rendered it. Only host elements (`div`, `button`) are marked, since a\n * component may not pass the attribute on; a component's call site is reached from its elements.\n *\n * The transform must run on the source as written (`enforce: 'pre'` under Vite), so lines and columns\n * are the file's. It runs alike on the server and in the browser, so a hydrated page matches its HTML.\n */\nimport MagicString from 'magic-string';\nimport { type JSXOpeningElement, parseSync, type Program, Visitor } from 'oxc-parser';\n\nexport const ATTRIBUTE = 'data-deictic';\n/** Modules that may hold JSX: `.jsx` and `.tsx`, and plain `.js`, as many React projects write theirs. */\nexport const JSX = /\\.[cm]?(?:[jt]sx|js)$/;\n\n/** A module parsed, with JSX read in a `.js` file too, which the parser reads there only when told. */\nexport const parse = (file: string, code: string) => parseSync(file, code, /\\.[cm]?js$/.test(file) ? { lang: 'jsx' } : undefined);\n\nexport interface Located {\n code: string;\n map: ReturnType<MagicString['generateMap']>;\n}\n\n/** Whether an opening tag is a host element's, `<div>` or `<svg>`, not a component's or a namespaced one. */\nexport const isHost = (el: JSXOpeningElement) => el.name.type === 'JSXIdentifier' && /^[a-z]/.test(el.name.name);\n\n/**\n * `code` with every host element marked, `file` being its path from the project's root, and `append`\n * after it (the client's import, in the browser); nothing when there is nothing to mark, or the module\n * doesn't parse, which the framework's own transform reports better.\n */\nexport function locate(code: string, file: string, append = ''): Located | undefined {\n // No tag, no parse: most `.js` modules have none, and every one of the project's comes through here.\n if (!/<[a-z]/.test(code)) return undefined;\n const { program, errors } = parse(file, code);\n if (errors.length > 0) return undefined;\n return marked(code, file, openingsIn(program), append);\n}\n\n/** Every opening tag in a module, in its order. */\nexport function openingsIn(program: Program): JSXOpeningElement[] {\n const elements: JSXOpeningElement[] = [];\n new Visitor({ JSXOpeningElement: (el) => void elements.push(el) }).visit(program);\n return elements;\n}\n\n/**\n * `code` with a mark in each of `elements` that is a host element's and has none yet, and `append` after\n * it; nothing with none to mark.\n */\nexport function marked(code: string, file: string, elements: JSXOpeningElement[], append = ''): Located | undefined {\n const lines = lineStarts(code);\n const s = new MagicString(code);\n for (const el of elements) {\n if (!isHost(el) || el.attributes.some((a) => a.type === 'JSXAttribute' && nameOf(a.name) === ATTRIBUTE)) continue;\n const { line, column } = position(lines, el.start);\n s.appendLeft(el.name.end, ` ${ATTRIBUTE}=\"${file}:${line}:${column}\"`);\n }\n if (!s.hasChanged()) return undefined;\n if (append !== '') s.append(append);\n // A map's source is read from the module's own folder, so it's the file's name, not its path from the root.\n return { code: s.toString(), map: s.generateMap({ source: file.slice(file.lastIndexOf('/') + 1), hires: 'boundary' }) };\n}\n\nconst nameOf = (name: { type: string; name?: unknown }) => (name.type === 'JSXIdentifier' ? name.name : undefined);\n\n/** Where each line starts, by offset. */\nexport function lineStarts(code: string): number[] {\n const starts = [0];\n for (let i = code.indexOf('\\n'); i !== -1; i = code.indexOf('\\n', i + 1)) starts.push(i + 1);\n return starts;\n}\n\n/** An offset's line and column, from 1. */\nexport function position(lines: number[], offset: number): { line: number; column: number } {\n let lo = 0;\n let hi = lines.length - 1;\n while (lo < hi) {\n const mid = (lo + hi + 1) >> 1;\n if (lines[mid]! <= offset) lo = mid;\n else hi = mid - 1;\n }\n return { line: lo + 1, column: offset - lines[lo]! + 1 };\n}\n\n/** A line and column's offset, or nothing past the file's end. */\nexport function offsetOf(lines: number[], line: number, column: number): number | undefined {\n const start = lines[line - 1];\n return start === undefined ? undefined : start + column - 1;\n}\n","/**\n * `.astro` components. They aren't JSX modules, but Astro 7's own parser reads a template as JSX, into the\n * tree oxc makes (offsets in UTF-16, as ours are), so its host elements are marked as a JSX module's are,\n * before Astro compiles the file. The parser is the project's own Astro's (`@astrojs/compiler-rs`, found\n * through `astro`), so it reads a file exactly as the compiler will; an Astro before 7 has none like it,\n * and its `.astro` files are left unmarked.\n */\nimport { createRequire } from 'node:module';\nimport { join } from 'node:path';\n\nimport type { JSXOpeningElement, Program } from 'oxc-parser';\n\nimport { type Located, marked } from './locate.ts';\n\nexport const ASTRO = /\\.astro$/;\n\n/** A file parsed: its module (an `.astro` file's frontmatter), and each opening tag in it, in the file's order. */\nexport interface Parsed {\n program: Program;\n elements: JSXOpeningElement[];\n}\n\ninterface Tree {\n ast: { frontmatter: { program: Program }; body: unknown };\n diagnostics: { severity: string; text: string }[];\n}\ntype Parse = (code: string) => Tree;\n\nconst parsers = new Map<string, Parse | undefined>();\n\n/** The parser of the Astro installed for the project at `root`, loaded once; nothing without Astro 7. */\nfunction parserOf(root: string): Parse | undefined {\n if (!parsers.has(root)) parsers.set(root, load(root));\n return parsers.get(root);\n}\n\nfunction load(root: string): Parse | undefined {\n try {\n // Astro's own dependency, which a strict package manager doesn't put where the project could import it.\n const astro = createRequire(createRequire(join(root, 'package.json')).resolve('astro/package.json'));\n // An ES module, required: every Node that runs Astro 7 can, and reading a source stays synchronous.\n const compiler: { parse?: Parse } = astro('@astrojs/compiler-rs');\n return compiler.parse;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Astro gives a `<script>` or `<style>` with an attribute it doesn't know to the page as it is, unbundled and\n * unscoped, and a `<slot>` isn't an element at all: none of them can be pointed at, so none is marked.\n */\nconst OWN = new Set(['script', 'style', 'slot']);\n\nconst isOpening = (node: object): node is JSXOpeningElement => 'type' in node && node.type === 'JSXOpeningElement';\n\n/** An `.astro` file's text parsed, or the `problem` with it: no parser (an older Astro), or text that doesn't parse. */\nexport function parseAstro(root: string, code: string): Parsed | { problem: string } {\n const parse = parserOf(root);\n if (parse === undefined) return { problem: 'reading an .astro file takes Astro 7 or later, so update astro' };\n const { ast, diagnostics } = parse(code);\n const error = diagnostics.find((d) => d.severity === 'error');\n if (error !== undefined) return { problem: `fix it first (${error.text})` };\n const elements: JSXOpeningElement[] = [];\n const walk = (node: unknown): void => {\n if (Array.isArray(node)) return node.forEach(walk);\n if (node === null || typeof node !== 'object') return;\n if (isOpening(node) && !(node.name.type === 'JSXIdentifier' && OWN.has(node.name.name))) elements.push(node);\n Object.values(node).forEach(walk);\n };\n walk(ast.body);\n return { program: ast.frontmatter.program, elements };\n}\n\n/** An `.astro` file's text with every host element marked, as `locate` marks a JSX module; nothing where it can't be read. */\nexport function locateAstro(code: string, file: string, root: string): Located | undefined {\n // No tag, no parse.\n if (!/<[a-z]/.test(code)) return undefined;\n const parsed = parseAstro(root, code);\n return 'problem' in parsed ? undefined : marked(code, file, parsed.elements);\n}\n","/**\n * The plugins an integration was given: checked as it starts, so a wrong set fails the dev server with\n * what to write instead, and set up once before the endpoints answer anything.\n */\nimport type { ServerContext, ServerPlugin } from '#src/index.ts';\nimport { checkShortcuts, OWN, ownShortcut, type Shortcut } from '#src/shortcut.ts';\n\nconst NAME = /^[a-z][a-z0-9-]*$/;\n\n/** Throws what to fix in a set of plugins: names, what they need, and their shortcuts, beside deictic's own. */\nexport function checkPlugins(plugins: readonly ServerPlugin[], own?: Shortcut | false): void {\n const names = new Set<string>();\n for (const { name, client, shortcut } of plugins) {\n if (!NAME.test(name)) throw new Error(`deictic: a plugin is named \"${name}\": name it in lowercase letters, digits and -`);\n if (names.has(name)) throw new Error(`deictic: two plugins are named ${name}: load each once`);\n if (shortcut !== undefined && client === undefined)\n throw new Error(`deictic: ${name} has a shortcut but no \\`client\\` to draw its panel: give it one, or leave out its shortcut`);\n names.add(name);\n }\n for (const { name, needs = [] } of plugins) {\n const missing = needs.find((other) => !names.has(other));\n if (missing !== undefined) throw new Error(`deictic: ${name} needs the ${missing} plugin: add it to \\`plugins\\``);\n }\n checkShortcuts([{ name: OWN, shortcut: ownShortcut(own) }, ...plugins]);\n}\n\n/**\n * Runs every plugin's `setup`, all at once, and answers the context they share: `use` reads an API\n * when it's asked for, so setups may `use` each other's only after they've all run, from a route or an\n * op, never in `setup` itself.\n */\nexport async function setUp(root: string, plugins: readonly ServerPlugin[]): Promise<ServerContext> {\n const apis = new Map<string, unknown>();\n const context: ServerContext = { root, use: (name) => apis.get(name) as never };\n await Promise.all(\n plugins.map(async (p) => {\n if (p.setup !== undefined) apis.set(p.name, await p.setup(context));\n }),\n );\n return context;\n}\n","/**\n * What every bundler's integration shares: the options, the client module that starts the overlay, and\n * the transform that marks a JSX module. Each integration adds what its bundler does its own way: how a\n * module is transformed (a hook, a loader, `onLoad`), how the page loads the client (a virtual module\n * under Vite, a file in `.deictic/` elsewhere, as webpack, Turbopack and Bun have none), where the\n * endpoints are served, and what opens the editor.\n */\nimport { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { dirname, isAbsolute, relative } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport type { ServerPlugin } from '#src/index.ts';\nimport { checkShortcuts, OWN, ownShortcut, type Shortcut } from '#src/shortcut.ts';\n\nimport { ASTRO, locateAstro } from './astro.ts';\nimport { keptIn } from './kept.ts';\nimport { JSX, locate, type Located } from './locate.ts';\nimport { checkPlugins } from './plugins.ts';\n\nexport interface DeicticOptions {\n /** The plugins to load, server halves: `tailwind()`, `tasks()`, your own. None by default. */\n plugins?: ServerPlugin[];\n /**\n * What opens the popup on any plugin, at the tab used last: Alt and the left button by default, or\n * `false` for none, leaving only plugins' own shortcuts.\n */\n shortcut?: Shortcut | false;\n}\n\n/** The options with their defaults, checked now, so a wrong set stops the dev server as it starts, not the page. */\nexport function prepare(options: DeicticOptions): { plugins: ServerPlugin[]; shortcut: Shortcut | false | undefined } {\n const plugins = options.plugins ?? [];\n checkPlugins(plugins, options.shortcut);\n return { plugins, shortcut: options.shortcut };\n}\n\n/**\n * The client module: the overlay, started with deictic's own shortcut and each plugin that has a half\n * in the page, with its shortcut, checked.\n */\nexport const clientModule = (plugins: ServerPlugin[], base: string, own?: Shortcut | false) => {\n const [shortcut, ...shortcuts] = checkShortcuts([{ name: OWN, shortcut: ownShortcut(own) }, ...plugins]);\n const paged = plugins.flatMap((p, i) =>\n p.client === undefined ? [] : [{ client: p.client, rest: { shortcut: shortcuts[i], options: p.clientOptions } }],\n );\n return [\n `import { start } from 'deictic/client';`,\n ...paged.map((p, i) => `import p${i} from ${JSON.stringify(p.client)};`),\n // Its shortcut and options as JSON, where it has them: `JSON.stringify` leaves out what's undefined.\n `start({ base: ${JSON.stringify(base)}, shortcut: ${JSON.stringify(shortcut) ?? 'undefined'}, plugins: [${paged.map((p, i) => `{ plugin: p${i}, ...${JSON.stringify(p.rest)} }`).join(', ')}] });`,\n ].join('\\n');\n};\n\n/**\n * Writes the client module to `.deictic/client.js` for a bundler without virtual modules, and answers\n * its path. Its imports are bare (`deictic/client`, each plugin's), found from the project as its own\n * are. Written only when it changed, so a watching bundler doesn't rebuild for nothing.\n */\nexport function writeClient(root: string, plugins: ServerPlugin[], base: string, own?: Shortcut | false): string {\n const code = `// Written by deictic as the dev server starts: it starts the overlay in the page.\\n${clientModule(plugins, base, own)}\\n`;\n // Its own package: an ES module that runs for its effect. An app whose package.json says\n // `\"sideEffects\": false` would otherwise have webpack drop the import, which is only for its effect.\n const manifest = `${JSON.stringify({ private: true, type: 'module', sideEffects: true }, null, 2)}\\n`;\n writeIfChanged(keptIn(root, 'package.json'), manifest);\n return writeIfChanged(keptIn(root, 'client.js'), code);\n}\n\nfunction writeIfChanged(path: string, text: string): string {\n if (!existsSync(path) || readFileSync(path, 'utf8') !== text) writeFileSync(path, text);\n return path;\n}\n\n/** A module beside `url`, by its name: `.ts` from the source, `.js` from `dist`, as `url` is. */\nexport const beside = (url: string, name: string) =>\n fileURLToPath(new URL(`./${name}${url.endsWith('.ts') ? '.ts' : '.js'}`, url)).replaceAll('\\\\', '/');\n\n/**\n * The import of the written client module in the module at `from`, by a relative path with forward\n * slashes: Turbopack can't import a Windows path, and every bundler takes a relative one.\n */\nexport function importOf(path: string, from: string): string {\n const to = relative(dirname(from), path).replaceAll('\\\\', '/');\n return `\\nimport ${JSON.stringify(to.startsWith('.') ? to : `./${to}`)};\\n`;\n}\n\n/**\n * A module marked, by its absolute path: its host elements, and `append` after it (the client's import,\n * in the browser). Nothing for a file that isn't JSX, is a dependency's, or is outside the project.\n */\nexport function mark(code: string, path: string, root: string, append = ''): Located | undefined {\n const file = JSX.test(path) ? fileIn(path, root) : undefined;\n return file === undefined ? undefined : locate(code, file, append);\n}\n\n/** An `.astro` component marked, by its absolute path, as `mark` does a module. It's no module of the browser's, so nothing is appended. */\nexport function markAstro(code: string, path: string, root: string): Located | undefined {\n const file = ASTRO.test(path) ? fileIn(path, root) : undefined;\n return file === undefined ? undefined : locateAstro(code, file, root);\n}\n\n/** A project file's path from the root, as a mark has it; nothing for a dependency's or one outside the project. */\nfunction fileIn(path: string, root: string): string | undefined {\n if (/[\\\\/]node_modules[\\\\/]/.test(path) || !isAbsolute(path)) return undefined;\n const file = relative(root, path).replaceAll('\\\\', '/');\n return file.startsWith('..') || isAbsolute(file) ? undefined : file;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA,MAAa,YAAY;;AAEzB,MAAa,MAAM;;AAGnB,MAAa,SAAS,MAAc,SAAiB,UAAU,MAAM,MAAM,aAAa,KAAK,IAAI,IAAI,EAAE,MAAM,MAAM,IAAI,KAAA,CAAS;;AAQhI,MAAa,UAAU,OAA0B,GAAG,KAAK,SAAS,mBAAmB,SAAS,KAAK,GAAG,KAAK,IAAI;;;;;;AAO/G,SAAgB,OAAO,MAAc,MAAc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AY,KAAA,IAAY,YAAY,MAAM,MAAM,IAAI;AACtE;;AAGA,SAAS,OAAO,MAAc,MAAkC;CAC9D,IAAI,yBAAyB,KAAK,IAAI,KAAK,CAAC,WAAW,IAAI,GAAG,OAAO,KAAA;CACrE,MAAM,OAAO,SAAS,MAAM,IAAI,CAAC,CAAC,WAAW,MAAM,GAAG;CACtD,OAAO,KAAK,WAAW,IAAI,KAAK,WAAW,IAAI,IAAI,KAAA,IAAY;AACjE"}
package/dist/kept.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"kept.js","names":[],"sources":["../src/tools/kept.ts"],"sourcesContent":["/**\n * Where deictic keeps what it makes for a project: `.deictic/` at its root, beside `.board/` and the like,\n * rather than in `node_modules`, which an install may clear. The history is there, and the shots,\n * recordings and voice clips plugins keep. It ignores itself in git: the history holds whole files, and\n * the rest is the page as it looked, neither of which belongs in a commit.\n */\nimport { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\nconst IGNORE = \"# deictic's own: the history, and the shots, recordings and voice clips it keeps.\\n*\\n\";\n\n/** A path under the project's `.deictic/`, made with its `.gitignore` the first time. */\nexport function keptIn(root: string, ...parts: string[]): string {\n const dir = join(root, '.deictic');\n const ignore = join(dir, '.gitignore');\n if (!existsSync(ignore)) {\n mkdirSync(dir, { recursive: true });\n writeFileSync(ignore, IGNORE);\n }\n return join(dir, ...parts);\n}\n"],"mappings":";;;;;;;;;AASA,MAAM,SAAS;;AAGf,SAAgB,OAAO,MAAc,GAAG,OAAyB;CAC/D,MAAM,MAAM,KAAK,MAAM,UAAU;CACjC,MAAM,SAAS,KAAK,KAAK,YAAY;CACrC,IAAI,CAAC,WAAW,MAAM,GAAG;EACvB,UAAU,KAAK,EAAE,WAAW,KAAK,CAAC;EAClC,cAAc,QAAQ,MAAM;CAC9B;CACA,OAAO,KAAK,KAAK,GAAG,KAAK;AAC3B"}
package/dist/marks.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"marks.js","names":[],"sources":["../src/plugins/recordings/marks.ts"],"sourcesContent":["/**\n * The custom event's tag the marks go in: the page's annotations, as an SVG in page coordinates (`svg`),\n * and as the annotations themselves (`annotations`, absent from recordings made before it was added).\n */\nexport const MARKS = 'deictic.annotations';\n\n/**\n * The custom event a recording ends with: rrweb's timeline lasts as long as its events, so without it a\n * recording of a still page (a voice-over, say) would replay as a moment, and its voice never play.\n */\nexport const END = 'deictic.end';\n"],"mappings":";;;;;AAIA,MAAa,QAAQ;;;;;AAMrB,MAAa,MAAM"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"playwright.js","names":[],"sources":["../src/plugins/screenshots/playwright.ts"],"sourcesContent":["/**\n * The `rrweb()` renderer's server half: rebuilds a page's snapshot in a browser beside the dev server and\n * screenshots it at the page's viewport, scroll and pixel density, so text lays out as the page's does. The\n * browser is launched on the first shot and kept for the next; Playwright closes it with the process.\n *\n * The snapshot is rebuilt into a sandboxed iframe filling a blank page on the page's own origin, which\n * Playwright answers itself, so nothing asks the dev server for it: rrweb has made the snapshot's URLs\n * whole, and its stylesheets' fonts and images load from the dev server as the page's did.\n */\nimport { createRequire } from 'node:module';\n\nimport type { Browser } from 'playwright-core';\nimport type * as Rrweb from 'rrweb-snapshot';\n\nimport type { Box, BrowserOptions } from './index.ts';\n\n/** What the page sends: its snapshot and what's needed to show it as the page does. */\n/** A node of an rrweb snapshot, as `snapshot()` answers it. */\nexport type SnapshotNode = NonNullable<ReturnType<typeof Rrweb.snapshot>>;\n\nexport interface Snapshot {\n snapshot: SnapshotNode;\n url: string;\n viewport: { width: number; height: number };\n scroll: { x: number; y: number };\n scale: number;\n /** The part of the viewport to keep, for a shot of an element alone. */\n clip?: Box;\n /** An SVG the viewport's size, drawn over the page: the annotations, where there are any. */\n overlay?: string;\n}\n\nconst HOST = '<!doctype html><html><body style=\"margin:0\"></body></html>';\n\nconst browsers = new Map<string, Promise<Browser>>();\n\n/** A browser by the options, launched once: the one named, or Playwright's own Chromium, then Chrome, then Edge. */\nexport function browserOf(options: BrowserOptions): Promise<Browser> {\n const key = JSON.stringify(options);\n const known = browsers.get(key);\n if (known !== undefined) return known;\n const launched = launch(options);\n browsers.set(key, launched);\n // A launch that failed is tried again on the next shot, after the user installs what it said to.\n launched.catch(() => browsers.delete(key));\n return launched;\n}\n\nasync function launch({ executablePath, channel }: BrowserOptions): Promise<Browser> {\n const { chromium } = await import('playwright-core').catch((e: unknown) => {\n throw new Error('the rrweb() renderer needs playwright-core: add it to your devDependencies', { cause: e });\n });\n if (executablePath !== undefined || channel !== undefined) return chromium.launch({ executablePath, channel });\n const tried: string[] = [];\n for (const attempt of [{}, { channel: 'chrome' }, { channel: 'msedge' }]) {\n try {\n return await chromium.launch(attempt);\n } catch (e) {\n tried.push(\n `${'channel' in attempt ? attempt.channel : \"Playwright's Chromium\"}: ${(e instanceof Error ? e.message : String(e)).split('\\n', 1)[0]}`,\n );\n }\n }\n throw new Error(\n `the rrweb() renderer found no browser to render in (${tried.join('; ')}): run \\`npx playwright install chromium\\`, or pass rrweb({ executablePath })`,\n );\n}\n\n/** The rrweb-snapshot bundle that defines `rrwebSnapshot` in a page: its CommonJS entry is that bundle. */\nconst bundle = () => createRequire(import.meta.url).resolve('rrweb-snapshot');\n\nexport async function render(input: unknown, options: BrowserOptions): Promise<Uint8Array> {\n const shot = input as Snapshot;\n if (typeof shot?.url !== 'string' || typeof shot.snapshot !== 'object' || typeof shot.viewport?.width !== 'number')\n throw new Error('screenshots: that is not a snapshot the rrweb() renderer took');\n const browser = await browserOf(options);\n const context = await browser.newContext({ viewport: shot.viewport, deviceScaleFactor: shot.scale });\n try {\n const page = await context.newPage();\n const host = new URL('/__deictic/plugins/screenshots/host', shot.url).href;\n await page.route(host, (route) => route.fulfill({ contentType: 'text/html', body: HOST }));\n await page.goto(host);\n await page.addScriptTag({ path: bundle() });\n await page.evaluate(async ({ snapshot, scroll, overlay }) => {\n const { rebuildIntoSandboxedIframe, createCache, createMirror } = (globalThis as unknown as { rrwebSnapshot: typeof Rrweb })\n .rrwebSnapshot;\n const { iframe } = rebuildIntoSandboxedIframe(snapshot, {\n root: document.body,\n cache: createCache(),\n mirror: createMirror(),\n iframeAttributes: { style: 'border:0;position:fixed;inset:0;width:100vw;height:100vh' },\n });\n const doc = iframe.contentDocument;\n if (doc === null) throw new Error('screenshots: the snapshot was rebuilt where it cannot be read');\n await doc.fonts.ready;\n await Promise.all([...doc.images].map((img) => img.decode().catch(() => {})));\n iframe.contentWindow?.scrollTo(scroll.x, scroll.y);\n if (overlay === undefined) return;\n // Over the page and its scroll: the SVG is the viewport's, already where it scrolled to.\n const marks = document.createElement('div');\n marks.style.cssText = 'position:fixed;inset:0;z-index:1;pointer-events:none';\n marks.innerHTML = overlay;\n document.body.append(marks);\n }, shot);\n const clip = shot.clip === undefined ? undefined : clamp(shot.clip, shot.viewport);\n return new Uint8Array(await page.screenshot({ type: 'png', ...(clip === undefined ? {} : { clip }) }));\n } finally {\n await context.close();\n }\n}\n\n/** A box kept within the viewport: an element partly scrolled out of it shows only the part that's in. */\nfunction clamp(box: Box, viewport: { width: number; height: number }): Box | undefined {\n const x = Math.max(0, box.x);\n const y = Math.max(0, box.y);\n const width = Math.min(viewport.width, box.x + box.width) - x;\n const height = Math.min(viewport.height, box.y + box.height) - y;\n return width > 0 && height > 0 ? { x, y, width, height } : undefined;\n}\n"],"mappings":";;;;;;;;;;;AAgCA,MAAM,OAAO;AAEb,MAAM,2BAAW,IAAI,IAA8B;;AAGnD,SAAgB,UAAU,SAA2C;CACnE,MAAM,MAAM,KAAK,UAAU,OAAO;CAClC,MAAM,QAAQ,SAAS,IAAI,GAAG;CAC9B,IAAI,UAAU,KAAA,GAAW,OAAO;CAChC,MAAM,WAAW,OAAO,OAAO;CAC/B,SAAS,IAAI,KAAK,QAAQ;CAE1B,SAAS,YAAY,SAAS,OAAO,GAAG,CAAC;CACzC,OAAO;AACT;AAEA,eAAe,OAAO,EAAE,gBAAgB,WAA6C;CACnF,MAAM,EAAE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C/D,OAAO,QAAQ,KAAK,SAAS,IAAI;EAAE;EAAG;EAAG;EAAO;CAAO,IAAI,KAAA;AAC7D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"recordings.js","names":[],"sources":["../src/plugins/recordings/replay.ts","../src/plugins/recordings/index.ts"],"sourcesContent":["/**\n * The replay page, `replay/<id>`: rrweb's own player (`rrweb-player`), its timeline, speeds, skipping idle\n * stretches and fullscreen, sized to the window, with what it doesn't do drawn over it:\n *\n * - The page shows in the colour scheme it was recorded in, whatever the viewer's: the replay's iframe\n * answers `prefers-color-scheme` as the viewer's browser does, so the recorded CSS's queries are rewritten\n * before it's replayed, the recorded scheme's to always match and the other's never.\n * - The marks drawn while recording come as custom events, an SVG in page coordinates each; they're drawn\n * over the replay in the player's own scaled wrapper, moved with its scroll, rather than into its document,\n * which the replayer rebuilds. Each is a marker on the timeline.\n * - The voice clips play in step, at the player's speed. A recording with voice starts paused, as a browser\n * plays sound only after a click.\n *\n * `?t=<seconds>` opens it paused there, and `&bare` without the controls at the recorded size, 1:1, for a\n * screenshot; `?embed` is it filling a frame, with no header of its own (the lightbox's); `body[data-ready]` says\n * it's in place.\n */\nimport { MARKS } from './marks.ts';\n\nexport const REPLAY = `<!doctype html>\n<html lang=\"en\">\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>Recording · deictic</title>\n<link rel=\"stylesheet\" href=\"../player.css\">\n<style>\n :root { color-scheme: dark; --accent: #12b358; }\n body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: #18181b; color: #fafafa; font: 13px/1.4 system-ui, sans-serif; }\n header { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid #3f3f46; }\n header a { color: #a1a1aa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n main { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 16px; }\n body.bare header { display: none; }\n body.bare main { padding: 0; }\n body.embed header { display: none; }\n body.embed main { padding: 0; }\n body.embed #main .rr-player { box-shadow: none; border-radius: 0; }\n #marks { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 3; }\n #marks svg { position: absolute; left: 0; top: 0; overflow: visible; }\n .problem { color: #f87171; padding: 16px; }\n /* rrweb-player, in the dark of the rest of deictic. Its rules repeat Svelte's scoping class, so these start\n from #main, which outweighs any number of classes. */\n #main .rr-player { background: #27272a; box-shadow: 0 12px 32px rgb(0 0 0 / 0.5); border-radius: 8px; overflow: hidden; }\n body.bare #main .rr-player { box-shadow: none; border-radius: 0; }\n #main .rr-player .rr-player__frame { background: #fff; }\n #main .rr-player .rr-controller { background: #18181b; border-top: 1px solid #3f3f46; border-radius: 0; }\n #main .rr-player .rr-timeline__time { color: #a1a1aa; font: 12px ui-monospace, monospace; }\n #main .rr-player .rr-progress { background: #3f3f46; border-color: #18181b; }\n #main .rr-player .rr-progress__step { background: color-mix(in srgb, var(--accent) 45%, transparent); }\n #main .rr-player .rr-progress__handler { background: var(--accent); }\n #main .rr-player .rr-controller__btns button { color: #e4e4e7; }\n #main .rr-player .rr-controller__btns button:disabled { color: #52525b; }\n #main .rr-player .rr-controller__btns button svg { fill: currentColor; }\n #main .rr-player .rr-controller__btns button.active { color: #04130b; background: var(--accent); }\n #main .rr-player .rr-controller__btns button:active { background: color-mix(in srgb, var(--accent) 60%, transparent); }\n #main .rr-player .switch .label { color: #e4e4e7; }\n #main .rr-player .switch.disabled .label { color: #52525b; }\n #main .rr-player .switch label:before { background: #52525b; }\n #main .rr-player .switch input:checked + label:before { background: var(--accent); }\n</style>\n<header>\n <strong>Recording</strong>\n <a id=\"page\" target=\"_blank\" rel=\"noreferrer\"></a>\n</header>\n<main id=\"main\"></main>\n<script src=\"../player.js\"></script>\n<script>\n const params = new URLSearchParams(location.search);\n const bare = params.has('bare');\n const embed = params.has('embed');\n if (bare) document.body.classList.add('bare');\n if (embed) document.body.classList.add('embed');\n const id = location.pathname.split('/').at(-1);\n fetch('../recording/' + id).then((r) => (r.ok ? r.json() : r.text().then((t) => Promise.reject(new Error(t))))).then((kept) => {\n const scheme = kept.colorScheme ?? 'light';\n const events = JSON.parse(\n JSON.stringify(kept.events).replace(/\\\\(\\\\s*prefers-color-scheme\\\\s*:\\\\s*(light|dark)\\\\s*\\\\)/g, (_, s) =>\n s === scheme ? '(min-width: 0px)' : '(max-width: 0px) and (min-width: 1px)',\n ),\n );\n page.textContent = kept.page;\n page.href = kept.page;\n\n // A recording with the mic starts paused: a browser plays sound only after a click, which Play is.\n const clips = (kept.voice ?? []).map((c) => ({ ...c, audio: Object.assign(new Audio('../../voice/clip/' + c.id), { preload: 'auto' }) }));\n const t = Number.parseFloat(params.get('t') ?? '');\n // The player's frame, at most the window's room, the controls (80px) under it; 1:1 when bare.\n const size = () => bare\n ? { width: kept.viewport.width, height: kept.viewport.height }\n : embed\n ? { width: innerWidth, height: innerHeight - 80 }\n : { width: Math.min(kept.viewport.width, innerWidth - 32), height: Math.min(kept.viewport.height, innerHeight - 90 - 80 - 16) };\n const Player = rrwebPlayer.default ?? rrwebPlayer.Player ?? rrwebPlayer;\n const player = new Player({\n target: main,\n props: {\n events,\n ...size(),\n autoPlay: !Number.isFinite(t) && clips.length === 0,\n showController: !bare,\n speedOption: [1, 2, 4, 8],\n tags: { ${JSON.stringify(MARKS)}: '#12b358' },\n inactiveColor: '#3f3f46',\n mouseTail: false,\n },\n });\n addEventListener('resize', () => { player.$set(size()); player.triggerResize(); });\n const replayer = player.getReplayer();\n const total = player.getMetaData().totalTime;\n\n // The marks as they were at this point: the latest custom event's, in the player's scaled wrapper, moved with the replay's scroll.\n const marks = Object.assign(document.createElement('div'), { id: 'marks' });\n replayer.wrapper.append(marks);\n replayer.on('custom-event', (e) => { if (e.data.tag === ${JSON.stringify(MARKS)}) marks.innerHTML = e.data.payload.svg; });\n\n let playing = false;\n player.addEventListener('ui-update-player-state', (e) => { playing = e.payload === 'playing'; });\n const follow = () => {\n const win = replayer.iframe.contentWindow;\n if (win) marks.style.transform = 'translate(' + -win.scrollX + 'px,' + -win.scrollY + 'px)';\n const now = Math.min(replayer.getCurrentTime(), total);\n const speed = replayer.config.speed ?? 1;\n // Each clip plays while the replay is inside it, at its speed, kept within a few frames of the replay's time.\n for (const c of clips) {\n const into = now - c.at;\n if (!playing || into < 0 || into >= c.duration) { if (!c.audio.paused) c.audio.pause(); continue; }\n if (c.audio.playbackRate !== speed) c.audio.playbackRate = speed;\n if (Math.abs(c.audio.currentTime * 1000 - into) > 250 * speed) c.audio.currentTime = into / 1000;\n if (c.audio.paused) c.audio.play().catch(() => {});\n }\n requestAnimationFrame(follow);\n };\n follow();\n\n if (Number.isFinite(t)) player.goto(Math.min(Math.max(0, t * 1000), total), false);\n document.body.dataset.ready = '';\n }).catch((e) => { document.querySelector('main').innerHTML = '<p class=\"problem\"></p>'; document.querySelector('.problem').textContent = e.message; });\n</script>\n</html>\n`;\n","/**\n * `deictic/recordings`: records the page with rrweb, for other plugins to attach (tasks does). No tab of\n * its own: `use('recordings').record()` shows a toolbar on the page (drag it to any edge) with annotate\n * mode's tools, where that plugin is loaded, a mic where the voice plugin is, and Stop and Discard. What's drawn while recording is in the\n * recording too, as custom events the replay draws.\n *\n * Recordings are kept under `.deictic/recordings`, the latest `keep`, as JSON: rrweb's\n * events, with the page, its viewport and how long it ran. `replay/<id>` plays one back in the browser.\n */\nimport { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { dirname, join, resolve } from 'node:path';\n\nimport { definePlugin } from '#src/index.ts';\nimport type { Masking, ResolvedMasking } from '#src/plugins/screenshots/index.ts';\nimport { keptIn } from '#src/tools/kept.ts';\n\nimport { REPLAY } from './replay.ts';\n\nexport { MARKS } from './marks.ts';\n\n/** A recording as the page knows it: its ID, where it plays back, and how long it ran, in milliseconds. */\nexport interface Recording {\n id: string;\n url: string;\n duration: number;\n /** What the mic took while it was on, where the voice plugin is loaded. */\n voice?: VoiceClip[];\n}\n\n/** A stretch of the mic in a recording: the voice plugin's clip, and when it starts in the recording, in milliseconds. */\nexport interface VoiceClip {\n id: string;\n at: number;\n duration: number;\n}\n\n/** The page's half, for other plugins' page halves. */\nexport interface Recorder {\n /**\n * Records the page, with the toolbar, until Stop: answers the recording, kept by the dev server, or\n * nothing when it's discarded. Rejects while another is going, or when it couldn't be kept.\n */\n record(): Promise<Recording | undefined>;\n /** Whether one is going. */\n recording(): boolean;\n}\n\n/** The server's half, for other plugins' server halves. */\nexport interface Recordings {\n /** A recording's JSON, or nothing for one not kept (any more). */\n read(id: string): { data: Uint8Array<ArrayBuffer>; name: string; type: 'application/json' } | undefined;\n}\n\n/** What the page sends, and what's kept: rrweb's events and what they can't say. */\nexport interface Kept {\n page: string;\n viewport: { width: number; height: number };\n /**\n * The colour scheme the page was in, which rrweb doesn't record: the replay shows it in the same, or a\n * page styled by `prefers-color-scheme` would take the replay's.\n */\n colorScheme?: 'light' | 'dark';\n startedAt: number;\n duration: number;\n events: unknown[];\n /** The mic's clips, played along with the replay. */\n voice?: VoiceClip[];\n}\n\ndeclare module 'deictic' {\n interface ServerApis {\n recordings: Recordings;\n }\n interface ClientApis {\n recordings: Recorder;\n }\n}\n\nexport interface RecordingsOptions extends Masking {\n /** How many recordings to keep, the latest: 20 by default. */\n keep?: number;\n /** Where they're kept, from the project's root: `.deictic/recordings` by default. */\n dir?: string;\n}\n\nconst ID = /^[a-z0-9]+-[a-z0-9]+$/;\n/** What one recording may weigh: minutes of a busy page are a few MB. */\nconst MAX = 50 * 1024 * 1024;\n\n/** rrweb's player (`rrweb-player`), served to the replay page: its build for a script tag, and its styles. */\nconst player = (file: string) => {\n try {\n return join(dirname(createRequire(import.meta.url).resolve('rrweb-player')), file);\n } catch {\n // Not installed: `file` answers what to add.\n return '';\n }\n};\n\nexport function recordings(options: RecordingsOptions = {}) {\n const keep = options.keep ?? 20;\n let dir = '';\n let taken = 0;\n const pathOf = (id: string) => join(dir, `${id}.json`);\n const read: Recordings['read'] = (id) => {\n if (!ID.test(id) || !existsSync(pathOf(id))) return undefined;\n return { data: new Uint8Array(readFileSync(pathOf(id))), name: `recording-${id}.json`, type: 'application/json' };\n };\n const keepRecording = (data: Uint8Array) => {\n // Sorts by when it was made, which is what pruning keeps by: the count orders two in one millisecond.\n const id = `${Date.now().toString(36).padStart(9, '0')}${(taken++ % 1296).toString(36).padStart(2, '0')}-${crypto.randomUUID().slice(0, 8)}`;\n mkdirSync(dir, { recursive: true });\n writeFileSync(pathOf(id), data);\n const kept = readdirSync(dir)\n .filter((f) => f.endsWith('.json'))\n .toSorted();\n for (const old of kept.slice(0, Math.max(0, kept.length - keep))) rmSync(join(dir, old));\n return id;\n };\n const file = (path: string, type: string) => {\n if (!existsSync(path)) return new Response('rrweb-player is missing: add it to your devDependencies', { status: 404 });\n return new Response(readFileSync(path), { headers: { 'content-type': type } });\n };\n\n return definePlugin<never, never, never, Recordings>({\n name: 'recordings',\n client: 'deictic/recordings/client',\n clientOptions: {\n masking: {\n blockClass: options.blockClass ?? 'rr-block',\n blockSelector: options.blockSelector,\n maskTextClass: options.maskTextClass ?? 'rr-mask',\n maskTextSelector: options.maskTextSelector,\n maskAllInputs: options.maskAllInputs ?? false,\n } satisfies ResolvedMasking,\n },\n setup: ({ root }) => {\n dir = options.dir === undefined ? keptIn(root, 'recordings') : resolve(root, options.dir);\n return { read };\n },\n routes: {\n // What the page recorded, as JSON.\n add: async (req) => {\n if (!(req.headers.get('content-type') ?? '').startsWith('application/json'))\n return Response.json({ problem: 'send the recording as application/json' }, { status: 415 });\n const body = new Uint8Array(await req.arrayBuffer());\n if (body.byteLength > MAX)\n return Response.json({ problem: `a recording may weigh ${MAX / 1024 / 1024} MB at most` }, { status: 413 });\n let kept: Partial<Kept>;\n try {\n kept = JSON.parse(new TextDecoder().decode(body)) as Partial<Kept>;\n } catch {\n return Response.json({ problem: \"the recording isn't JSON\" }, { status: 400 });\n }\n if (!Array.isArray(kept.events) || kept.events.length === 0)\n return Response.json({ problem: 'the recording has no events: record for a moment longer' }, { status: 400 });\n return Response.json({ id: keepRecording(body) });\n },\n // `recording/<id>`: the JSON, for the replay page.\n recording: (req) => {\n const found = read(new URL(req.url).pathname.split('/').at(-1) ?? '');\n if (found === undefined) return new Response('no such recording, or not kept any more', { status: 404 });\n return new Response(found.data, { headers: { 'content-type': found.type, 'cache-control': 'no-store' } });\n },\n // `replay/<id>`: a page that plays it back.\n replay: () => new Response(REPLAY, { headers: { 'content-type': 'text/html; charset=utf-8' } }),\n 'player.js': () => file(player('rrweb-player.umd.min.cjs'), 'text/javascript'),\n 'player.css': () => file(player('style.css'), 'text/css'),\n },\n });\n}\n\nexport default recordings;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAa,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiFJ,KAAK,UAAU,KAAK,EAAE;;;;;;;;;;;;8DAYsB,KAAK,UAAU,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1BpF,MAAM,KAAK;;AAEX,MAAM,MAAM;;AAGZ,MAAM,UAAU,SAAiB;CAC/B,IAAI;EACF,OAAO,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC,CAAC,QAAQ,cAAc,CAAC,GAAG,IAAI;CACnF,QAAQ;EAEN,OAAO;CACT;AACF;AAEA,SAAgB,WAAW,UAA6B,CAAC,GAAG;CAC1D,MAAM,OAAO,QAAQ,QAAQ;CAC7B,IAAI,MAAM;CACV,IAAI,QAAQ;CACZ,MAAM,UAAU,OAAe,KAAK,KAAK,GAAG,GAAG,MAAM;CACrD,MAAM,QAA4B,OAAO;EACvC,IAAI,CAAC,GAAG,KAAK,EAAE,KAAK,CAAC,WAAW,OAAO,EAAE,CAAC,GAAG,OAAO,KAAA;EACpD,OAAO;GAAE,MAAM,IAAI,WAAW,aAAa,OAAO,EAAE,CAAC,CAAC;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1
- {"version":3,"file":"shortcut.js","names":[],"sources":["../src/shortcut.ts"],"sourcesContent":["/**\n * A gesture: the keys held to outline the element under the pointer, and the button that, with them\n * held, opens the popup there. deictic's own (`MASTER` by default) opens the tab used last; a\n * plugin's, which it takes as its `shortcut` option and has none by default, opens its tab. The\n * bundler's plugin checks them all as it starts, so a wrong one, or two alike, fails the dev server,\n * not the page. Both halves import it: it must\n * stay dependency-free.\n */\n\n/** A modifier key, as `KeyboardEvent.key` names it. */\nexport type Modifier = 'Alt' | 'Control' | 'Meta' | 'Shift';\n\nexport interface Shortcut {\n /** Held, and no other, to outline elements. */\n modifiers?: Modifier[];\n /** Pressed with them to open the panel. `'left'` unset. */\n button?: 'left' | 'middle' | 'right';\n}\n\nconst FLAGS = { Alt: 'altKey', Control: 'ctrlKey', Meta: 'metaKey', Shift: 'shiftKey' } as const;\nconst BUTTONS = { left: 0, middle: 1, right: 2 } as const;\n\n/** deictic's own shortcut, unless `deictic({ shortcut })` names another or `false`. */\nexport const MASTER: Required<Shortcut> = { modifiers: ['Alt'], button: 'left' };\n\n/** The name deictic's own shortcut goes by in a problem. */\nexport const OWN = 'deictic';\n\n/** deictic's own shortcut as given, with its default, before it's checked. */\nexport const ownShortcut = (given: Shortcut | false | undefined) => (given === false ? undefined : (given ?? MASTER));\n\n/** The shortcut with its button's default and its modifiers in one order, or an error saying what to write instead. */\nexport function checkShortcut(plugin: string, shortcut: Shortcut): Required<Shortcut> {\n const { modifiers = [], button = 'left' } = shortcut;\n const named = Object.keys(FLAGS).join(\"', '\");\n if (!Array.isArray(modifiers) || modifiers.length === 0) {\n throw new Error(\n `deictic: ${plugin}'s shortcut.modifiers is empty: hold at least one of '${named}', or every click would open the popup`,\n );\n }\n for (const m of modifiers)\n if (!Object.hasOwn(FLAGS, m)) throw new Error(`deictic: ${plugin}'s shortcut.modifiers has '${m}': name one of '${named}'`);\n\n if (!Object.hasOwn(BUTTONS, button))\n throw new Error(`deictic: ${plugin}'s shortcut.button is '${button}': name one of '${Object.keys(BUTTONS).join(\"', '\")}'`);\n\n const order = Object.keys(FLAGS);\n return { modifiers: [...new Set(modifiers)].toSorted((a, b) => order.indexOf(a) - order.indexOf(b)), button };\n}\n\n/**\n * Each shortcut checked, in order, or nothing where there's none: none may be another's, or only the\n * first would ever open. deictic's own goes first, named `OWN`.\n */\nexport function checkShortcuts(plugins: readonly { name: string; shortcut?: Shortcut }[]): (Required<Shortcut> | undefined)[] {\n const taken = new Map<string, string>();\n return plugins.map(({ name, shortcut }) => {\n if (shortcut === undefined) return undefined;\n const checked = checkShortcut(name, shortcut);\n const key = nameOf(checked);\n const other = taken.get(key);\n if (other !== undefined) throw new Error(`deictic: ${name} and ${other} both open on ${key}: give one of them another \\`shortcut\\``);\n taken.set(key, name);\n return checked;\n });\n}\n\n/** How a shortcut reads, for a problem or a label: `Alt+Shift`, `Control+right-click`. */\nexport const nameOf = ({ modifiers = [], button = 'left' }: Shortcut) =>\n [...modifiers, ...(button === 'left' ? [] : [`${button}-click`])].join('+');\n\nexport interface Gesture {\n /** Whether exactly the shortcut's modifiers are down: AltGr, which is Control and Alt, isn't Alt. */\n held: (e: MouseEvent | KeyboardEvent) => boolean;\n /** The shortcut's button, as `MouseEvent.button` numbers it. */\n button: number;\n}\n\nexport function gestureOf(shortcut: Required<Shortcut>): Gesture {\n const on = new Set<string>(shortcut.modifiers);\n const flags = Object.entries(FLAGS);\n return { held: (e) => flags.every(([key, flag]) => e[flag] === on.has(key)), button: BUTTONS[shortcut.button] };\n}\n"],"mappings":";AAmBA,MAAM,QAAQ;CAAE,KAAK;CAAU,SAAS;CAAW,MAAM;CAAW,OAAO;AAAW;AACtF,MAAM,UAAU;CAAE,MAAM;CAAG,QAAQ;CAAG,OAAO;AAAE;;AAG/C,MAAa,SAA6B;CAAE,WAAW,CAAC,KAAK;CAAG,QAAQ;AAAO;;AAG/E,MAAa,MAAM;;AAGnB,MAAa,eAAe,UAAyC,UAAU,QAAQ,KAAA,IAAa,SAAS;;AAG7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