deictic 0.8.0 → 0.9.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 (112) hide show
  1. package/API.md +73 -18
  2. package/README.md +1 -1
  3. package/dist/annotations/client.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/cli.js.map +1 -1
  6. package/dist/client/index.d.ts +13 -13
  7. package/dist/client/index.d.ts.map +1 -1
  8. package/dist/client/index.js +11 -7
  9. package/dist/client/index.js.map +1 -1
  10. package/dist/react/client.d.ts +19 -0
  11. package/dist/react/client.d.ts.map +1 -0
  12. package/dist/react/client.js +504 -0
  13. package/dist/react/client.js.map +1 -0
  14. package/dist/react/index.d.ts +2 -0
  15. package/dist/react/index.js +1 -0
  16. package/dist/recommended/index.d.ts +15 -7
  17. package/dist/recommended/index.d.ts.map +1 -1
  18. package/dist/recommended/index.js +1 -1
  19. package/dist/recordings/client.d.ts.map +1 -1
  20. package/dist/recordings/client.js +48 -5
  21. package/dist/recordings/client.js.map +1 -1
  22. package/dist/screenshots/client.d.ts +9 -1
  23. package/dist/screenshots/client.d.ts.map +1 -1
  24. package/dist/screenshots/rrweb.d.ts +0 -6
  25. package/dist/screenshots/rrweb.d.ts.map +1 -1
  26. package/dist/screenshots/rrweb.js +53 -10
  27. package/dist/screenshots/rrweb.js.map +1 -1
  28. package/dist/shared/board.js +1 -1
  29. package/dist/shared/canvas.js +30 -0
  30. package/dist/shared/canvas.js.map +1 -0
  31. package/dist/shared/client.js +44 -2
  32. package/dist/shared/client.js.map +1 -1
  33. package/dist/shared/dom.js +7 -1
  34. package/dist/shared/dom.js.map +1 -1
  35. package/dist/shared/drawer.js +1 -1
  36. package/dist/shared/endpoints.js +1 -1
  37. package/dist/shared/find.js +6 -1
  38. package/dist/shared/find.js.map +1 -1
  39. package/dist/shared/frame.js +5 -2
  40. package/dist/shared/frame.js.map +1 -1
  41. package/dist/shared/index.d.ts +6 -0
  42. package/dist/shared/index.d.ts.map +1 -1
  43. package/dist/shared/index10.d.ts +70 -0
  44. package/dist/shared/index10.d.ts.map +1 -0
  45. package/dist/shared/index3.d.ts +11 -0
  46. package/dist/shared/index3.d.ts.map +1 -1
  47. package/dist/shared/index7.d.ts +92 -312
  48. package/dist/shared/index7.d.ts.map +1 -1
  49. package/dist/shared/index8.d.ts +324 -47
  50. package/dist/shared/index8.d.ts.map +1 -1
  51. package/dist/shared/index9.d.ts +45 -63
  52. package/dist/shared/index9.d.ts.map +1 -1
  53. package/dist/shared/init.js +15 -11
  54. package/dist/shared/init.js.map +1 -1
  55. package/dist/shared/marks.js +7 -1
  56. package/dist/shared/marks.js.map +1 -1
  57. package/dist/shared/package.js +3 -1
  58. package/dist/shared/packages.js +1 -1
  59. package/dist/shared/playwright.js +59 -3
  60. package/dist/shared/playwright.js.map +1 -1
  61. package/dist/shared/react.js +25 -0
  62. package/dist/shared/react.js.map +1 -0
  63. package/dist/shared/recommended.js +6 -3
  64. package/dist/shared/recommended.js.map +1 -1
  65. package/dist/shared/recording.js +80 -3
  66. package/dist/shared/recording.js.map +1 -1
  67. package/dist/shared/recordings.js +30 -2
  68. package/dist/shared/recordings.js.map +1 -1
  69. package/dist/shared/screenshots.js.map +1 -1
  70. package/dist/shared/src.js.map +1 -1
  71. package/dist/shared/task.js +1 -0
  72. package/dist/shared/task.js.map +1 -1
  73. package/dist/shared/tasks.js +11 -0
  74. package/dist/shared/tasks.js.map +1 -1
  75. package/dist/tailwind/client.d.ts +1 -1
  76. package/dist/tailwind/index.d.ts +1 -1
  77. package/dist/tasks/client.d.ts +1 -1
  78. package/dist/tasks/client.js +45 -19
  79. package/dist/tasks/client.js.map +1 -1
  80. package/dist/tasks/index.d.ts +1 -1
  81. package/dist/voice/client.d.ts +1 -1
  82. package/dist/voice/client.js +1 -1
  83. package/dist/voice/index.d.ts +1 -1
  84. package/package.json +25 -1
  85. package/src/cli/bun.ts +2 -2
  86. package/src/cli/find.ts +5 -1
  87. package/src/cli/frame.ts +6 -3
  88. package/src/cli/init.ts +14 -9
  89. package/src/cli/recording.ts +90 -4
  90. package/src/cli/task.ts +4 -0
  91. package/src/cli.ts +13 -6
  92. package/src/client/dom.ts +14 -0
  93. package/src/client/index.ts +21 -14
  94. package/src/index.ts +6 -0
  95. package/src/plugins/react/client.ts +162 -0
  96. package/src/plugins/react/index.ts +130 -0
  97. package/src/plugins/react/renders.ts +219 -0
  98. package/src/plugins/react/serialize.ts +139 -0
  99. package/src/plugins/react/timeline.ts +143 -0
  100. package/src/plugins/recommended/index.ts +17 -5
  101. package/src/plugins/recordings/client.ts +64 -4
  102. package/src/plugins/recordings/marks.ts +7 -0
  103. package/src/plugins/recordings/replay.ts +30 -2
  104. package/src/plugins/screenshots/canvas.ts +27 -0
  105. package/src/plugins/screenshots/client.ts +42 -2
  106. package/src/plugins/screenshots/index.ts +11 -0
  107. package/src/plugins/screenshots/playwright.ts +90 -4
  108. package/src/plugins/screenshots/rrweb.ts +57 -9
  109. package/src/plugins/screenshots/states.ts +26 -0
  110. package/src/plugins/tasks/client.ts +41 -6
  111. package/src/plugins/tasks/composer.ts +24 -7
  112. package/src/plugins/tasks/index.ts +16 -2
package/API.md CHANGED
@@ -26,19 +26,19 @@ the page point at that plugin's code, not the file.
26
26
  ```ts
27
27
  // Vite, and anything on it (React Router, TanStack Start…): vite.config.ts
28
28
  import { deictic } from 'deictic/vite';
29
- export default defineConfig({ plugins: [deictic({ plugins: recommended() }), react()] });
29
+ export default defineConfig({ plugins: [deictic({ plugins: deicticRecommended() }), react()] });
30
30
 
31
31
  // Next.js (`next dev`, Turbopack or webpack): next.config.ts
32
32
  import { withDeictic } from 'deictic/next';
33
- export default withDeictic(nextConfig, { plugins: recommended() });
33
+ export default withDeictic(nextConfig, { plugins: deicticRecommended() });
34
34
 
35
35
  // webpack 5, Rspack (`launch-editor` opens files in your editor)
36
36
  import { DeicticPlugin } from 'deictic/webpack';
37
- export default { plugins: [new DeicticPlugin({ plugins: recommended() })] };
37
+ export default { plugins: [new DeicticPlugin({ plugins: deicticRecommended() })] };
38
38
 
39
39
  // Astro: astro.config.ts
40
40
  import { deictic } from 'deictic/astro';
41
- export default defineConfig({ integrations: [deictic({ plugins: recommended() })] });
41
+ export default defineConfig({ integrations: [deictic({ plugins: deicticRecommended() })] });
42
42
  ```
43
43
 
44
44
  Astro marks `.astro` components with Astro 7 or later, and JSX islands with any version.
@@ -48,7 +48,7 @@ Bun (`Bun.serve` with HTML imports) takes one module for both the bundler plugin
48
48
  ```ts
49
49
  // deictic.plugin.ts
50
50
  import { deictic } from 'deictic/bun';
51
- export default deictic({ plugins: recommended() });
51
+ export default deictic({ plugins: deicticRecommended() });
52
52
  ```
53
53
 
54
54
  ```toml
@@ -70,7 +70,7 @@ React Native isn't supported: there's no DOM to point at.
70
70
  ```ts
71
71
  deictic({
72
72
  shortcut: { modifiers: ['Control', 'Shift'] }, // instead of Alt; `false` for none
73
- plugins: recommended({
73
+ plugins: deicticRecommended({
74
74
  tasks: { channel: 'ui', project: 'storefront', labels: { team: 'web' } },
75
75
  screenshots: { maskAllInputs: true },
76
76
  voice: false,
@@ -136,11 +136,12 @@ keys work while the shortcut's are held, and while a tool has the page:
136
136
  | `S` | A screenshot of the window, with what's drawn on it (screenshots) |
137
137
  | `R`, `Shift+R` | Starts a recording, and stops it; discards it (recordings) |
138
138
  | `K` | The mic: a voice note, or a recording's voice (voice) |
139
+ | `P` | While a recording goes, whether React's commits go in it (react) |
139
140
  | `T` | A task about a point: the next press on the page opens the Task tab there |
140
141
 
141
142
  A recording, the mic and a drawing tool keep the panel up: stop them (`R`, `K`, `Esc`) and it goes with the keys.
142
- While a recording goes, Screenshot, the mic and Task step aside for its own controls: its time, its mic, Stop and
143
- Discard.
143
+ While a recording goes, Screenshot, the mic and Task step aside for its own controls: its time, its mic, React
144
+ (where [React state](#react-state) is loaded), Stop and Discard.
144
145
  What the tools make (shots, recordings, voice notes) waits for the next task, whichever element it's about: the Task
145
146
  tool counts them, and the Task tab lists each as a chip, to open or to leave out, and the drawer has them meanwhile. Marks stay on the
146
147
  page until a task takes them.
@@ -148,10 +149,11 @@ page until a task takes them.
148
149
  A task about a point is pinned on that point, not on an element's corner, and a shot taken as it goes has the point
149
150
  circled. It still names an element, the marked one under the point or the nearest to it, for its file and line.
150
151
 
151
- `recommended()`, from `deictic/recommended`, is tasks, screenshots, annotations, recordings and voice, and logs and
152
- network, which put the page's console and its requests in a recording. Each takes its
153
- options under its name, and `false` leaves it out (`recommended({ logs: false, network: false })`). Other plugins, your own included, go beside it:
154
- `plugins: [...recommended(), notes()]`. Each plugin is also its own import (`deictic/tasks`, `deictic/screenshots`…),
152
+ `deicticRecommended()`, from `deictic/recommended`, is tasks, screenshots, annotations, recordings and voice, and logs and
153
+ network, which put the page's console and its requests in a recording, and, where the project has React,
154
+ [React state](#react-state). Each takes its options under its name, and `false` leaves it out
155
+ (`deicticRecommended({ logs: false, react: false })`). Other plugins, your own included, go beside it:
156
+ `plugins: [...deicticRecommended(), notes()]`. It was `recommended()`. Each plugin is also its own import (`deictic/tasks`, `deictic/screenshots`…),
155
157
  to pick them one by one.
156
158
 
157
159
  What a project keeps (the history, shots, recordings, voice notes) is in `.deictic/`, which ignores itself in git.
@@ -186,8 +188,8 @@ BOARD_URL=https://team.example/api/board vite # any board, by its URL
186
188
  import { board } from '@vercel/board';
187
189
  import { local } from 'deictic/tasks';
188
190
 
189
- recommended({ tasks: { board: board() } }); // your team's, after `vercel login`
190
- recommended({ tasks: { board: local({ port: 4200 }) } }); // the one on your machine, whatever BOARD_URL says
191
+ deicticRecommended({ tasks: { board: board() } }); // your team's, after `vercel login`
192
+ deicticRecommended({ tasks: { board: local({ port: 4200 }) } }); // the one on your machine, whatever BOARD_URL says
191
193
  ```
192
194
 
193
195
  `local()` takes `port`, `dir` (its folder, from the root), `inspect: false` for none of the board's own pages, and
@@ -210,7 +212,9 @@ order, and `deictic.text` its text: the pins find it by its text, then by its pl
210
212
  component's line is the same wherever it's used; these say where: with React in development the components that use
211
213
  it, three at most, and otherwise the files around it). The element's HTML as it rendered is attached as `element.html`,
212
214
  masked as screenshots are, for whoever can't open the page as you had it: a file, so the task stays short.
213
- Untick **Attach HTML snapshot** for a task without it; `html: false` takes the box away. A screenshot attached by the
215
+ With [`reactState()`](#react-state) loaded, the props, state and hooks of the components that wrote it go beside it,
216
+ as `react.json` (`react.2.json` for the second element). Untick **Attach HTML snapshot** for a task without either;
217
+ `html: false` takes the box away. A screenshot attached by the
214
218
  button has the element outlined in it, or the point circled; one you drew on is as you drew it, and one taken from
215
219
  the tool panel is the window as it was.
216
220
 
@@ -260,7 +264,8 @@ The Task tab is for a new task. The ones there are, are in the drawer. In the ta
260
264
 
261
265
  deictic ships a skill that watches the channel and works each task as it arrives. What it runs is the package's own
262
266
  `deictic` command, so it reads tasks and recordings with the version that wrote them: `deictic watch`, `deictic task`,
263
- `deictic recording` (a timeline), `deictic frame` (a screenshot at any moment), `deictic voice` and
267
+ `deictic recording` (a timeline of what the person did and what went wrong, the page's other requests, console lines
268
+ and React commits counted, for the agent to ask for with `--only` or `--all`), `deictic frame` (a screenshot at any moment), `deictic voice` and
264
269
  `deictic transcribe`, and `deictic vb`, the board's CLI on the dev server's board (`npx deictic --help` lists them).
265
270
  Its watch ends once the channel has been quiet for 20 minutes, and the agent then stops and says so, so none watches
266
271
  for ever. `init` offers to add it; otherwise `npx skills add gkurt/deictic`.
@@ -289,7 +294,14 @@ screenshots({ renderer: dom() }); // drawn in the page with modern-screenshot: n
289
294
  ```
290
295
 
291
296
  `rrweb()` uses Playwright's Chromium (`npx playwright install chromium`), else Chrome or Edge; `channel` or
292
- `executablePath` names one.
297
+ `executablePath` names one. A shot has what a `<canvas>` shows, WebGL's included: `rrweb()` has a WebGL canvas keep
298
+ its drawing buffer unless the page says otherwise.
299
+
300
+ With `rrweb()`, a task's screenshot is the page as it was when you Alt-clicked, not as it is when you add the task: a
301
+ tooltip, a hover card, a menu or a toast that the popup's pointer and focus close, or that time takes away, is still
302
+ in it. The page is taken as the press goes down and rendered while you type. What's hovered and focused shows as it
303
+ was (`:hover`, `:focus`, `:focus-visible`, `:focus-within`, Tailwind's `hover:` classes too), which a copy of the page
304
+ otherwise loses. Another element attached later is shot as it's attached; `dom()` takes the page as the task goes.
293
305
 
294
306
  Masking follows [rrweb](https://github.com/rrweb-io/rrweb)'s names and defaults: `rr-block` blanks an element
295
307
  (`blockClass`, `blockSelector`), `rr-mask` masks its text (`maskTextClass`, `maskTextSelector`), and `maskAllInputs`
@@ -317,9 +329,49 @@ and a body's fields where the body is JSON or a form; `mask: ['email']` adds nam
317
329
  dropped, a body is cut at 10,000 characters, and `ignore: ['/analytics']` leaves requests out whole. A secret under a
318
330
  name that says nothing isn't found, which is why headers and bodies are kept only when asked for.
319
331
 
332
+ ## React state
333
+
334
+ In `deicticRecommended()` where React is installed (found from where the dev server starts), under `react`, or
335
+ `reactState()` from `deictic/react` on its own. It attaches what React's DevTools would show of the element
336
+ a task is about, as `react.json`: the component that wrote it, and the ones that wrote that, each with its props and its
337
+ state (a class's, or a function's hooks, named as your code names them: `chosen`, not `State`). For a task whose change
338
+ depends on what the page held: the plan that was picked, the list that was empty. It reads React's fibers with
339
+ [bippy](https://github.com/aidenybai/bippy), in development only.
340
+
341
+ ```ts
342
+ deicticRecommended({ react: { components: 2, mask: ['email'] } });
343
+ deicticRecommended({ react: false }); // none
344
+ ```
345
+
346
+ | Option | Default | What it is |
347
+ | ------------ | ------- | ----------------------------------------------------------------------------- |
348
+ | `components` | `4` | How many components, out from the one that wrote the element |
349
+ | `mask` | none | More names whose values are blanked, as `network`'s `mask` |
350
+ | `names` | `true` | Whether hooks are named from the source and its map, fetched as DevTools does |
351
+ | `renders` | `true` | Whether each component's renders are counted, timed and explained |
352
+
353
+ Values are your page's, so they're masked as requests are: a value whose name says it's a secret (`token`, `password`,
354
+ `auth` and the like) is `***`. What JSON can't hold says what it was, in brackets (`[function onClick]`, `[<Button>]`,
355
+ `[circular]`), and what's deep or long is cut, saying so. Effects are left out.
356
+
357
+ Each component also says how it rendered, as DevTools' profiler would: how many times, how many in the 10 seconds
358
+ before the task (a loop, a burst on each keystroke), how long ago, how long the last render took (`lastMs`, with what
359
+ it rendered, and `selfMs`, its own part), and why (`mounted`, `props changed: chosen`, `state changed`, `context
360
+ changed`, `its parent rendered`). React tells them to DevTools' hook, which React Refresh installs in development, so
361
+ they're counted from when the page started deictic, not from its first render.
362
+
363
+ A recording can have React's commits too, as DevTools' profiler has them: press **React** (`P`) among its controls.
364
+ It's off until you do, stays as you leave it, for the next recording too, and carries on over a page load. Commits a
365
+ frame apart are one entry: how long they took, React's priority (`immediate` for a click or a key), and the
366
+ components that rendered, the slowest first, each with its time, where its JSX is and why. Past ten entries in a second,
367
+ the rest of that second is one entry at its end (`40 commits over 0.8s, slowest 31ms`), so a page that animates is
368
+ eleven entries a second at most. The replay
369
+ lists them beside the page under **React**, a slow one marked on the timeline; `deictic recording` lists the slow
370
+ ones and counts the rest, `--only react` lists them all, `--full` with each component's line, and `--problems` has those slower than a frame.
371
+
320
372
  ## Tailwind
321
373
 
322
- Not in `recommended()`. `tailwind()`, from `deictic/tailwind`, adds a tab that edits the element's classes in place,
374
+ Not in `deicticRecommended()`. `tailwind()`, from `deictic/tailwind`, adds a tab that edits the element's classes in place,
323
375
  with completion, previews and undo, and writes them to the source. It needs Tailwind v4.
324
376
 
325
377
  ```ts
@@ -414,6 +466,9 @@ export default defineClientPlugin<Model, Op>({
414
466
  tasks do. Text edits without it are refused.
415
467
  - `pointing(context)` on the page half draws what the plugin has on the page while a shortcut's keys are held, and
416
468
  answers what takes it away: tasks pins each task where its element is.
469
+ - `pressed(context, element)` on the page half hears a shortcut's press on a marked element as it goes down, before
470
+ the page's own handlers and before the popup takes the pointer and the focus: screenshots keeps the page as it is
471
+ then. Keep it quick: the press waits on it.
417
472
  - `context.open(plugin, element, at?)` opens the popup on another element, or on a point in it (`at`, in CSS pixels
418
473
  from its top left, which the panel then gets as `context.at`). Not while the open one holds something `unsaved`:
419
474
  its button shakes, and it answers false.
package/README.md CHANGED
@@ -59,7 +59,7 @@ In the config `init` wrote, each plugin takes its options under its name, and `f
59
59
  ```ts
60
60
  deictic({
61
61
  shortcut: { modifiers: ['Control', 'Shift'] }, // instead of Alt
62
- plugins: recommended({
62
+ plugins: deicticRecommended({
63
63
  tasks: { channel: 'ui', labels: { team: 'web' } },
64
64
  screenshots: { maskAllInputs: true },
65
65
  voice: false,
@@ -1,4 +1,4 @@
1
- import { n as MOD, r as controlFor, u as toolButton } from "../shared/dom.js";
1
+ import { a as controlFor, f as toolButton, n as MOD } from "../shared/dom.js";
2
2
  import { n as defineClientPlugin } from "../shared/src.js";
3
3
  const PAD = 6;
4
4
  const guess = (text) => text.length * 14 * .6;
package/dist/cli.js CHANGED
@@ -29,7 +29,7 @@ program.commandsGroup("For the agent that works the tasks (the skill):");
29
29
  program.command("vb").description("the board on the dev server: deictic vb whoami, deictic vb tasks claim 68 --lease 30m").argument("[args...]", "anything vb takes").helpOption(false).allowUnknownOption().passThroughOptions().action(async (args) => (await import("./shared/vb.js")).run(args));
30
30
  program.command("watch").description("a line per new task, reply and cancellation").argument("[channel]", "the channel", "deictic").option("--idle <time>", "ends once the channel has had nothing for this long: 30m, 45s, 1h", "20m").option("--once", "ends at the first thing to act on").option("--label <key=value>", "only tasks with this label (repeatable)", all).action(async (channel, options) => (await import("./shared/watch.js")).run(channel, options));
31
31
  program.command("task").description("a task briefly: what was asked, by whom, who holds it, what is attached").argument("<id>", "the task: 68 or #68").option("--out <dir>", "downloads what is attached here").action(async (id, options) => (await import("./shared/task.js")).run(id, options));
32
- program.command("recording").description("a recording as a timeline, or the part of it asked for").argument("<recording>", RECORDING).option("--nth <n>", "a task's nth recording", "1").option("--only <kinds>", "these kinds of line: console, request, page, click, input, scroll, resize, marks, voice (repeatable)", all).option("--problems", "errors, warnings and requests that failed").option("--from <seconds>", "from this far in").option("--to <seconds>", "to this far in").option("--around <seconds>", "the 3 seconds either side of this").option("--grep <text>", "lines with this in them, in any case").option("--full", "all of each line: where it was logged from, a request's headers and bodies").option("--json", "as JSON").action(async (ref, options) => (await import("./shared/recording.js")).run(ref, options));
32
+ program.command("recording").description("a recording as a timeline: what the person did and what went wrong, with a count of the page's other requests, console lines and React commits; or the part of it asked for").argument("<recording>", RECORDING).option("--nth <n>", "a task's nth recording", "1").option("--only <kinds>", "these kinds of line: console, request, react, page, click, input, scroll, resize, marks, voice (repeatable)", all).option("--all", "every line: every request, console line and React commit too").option("--problems", "errors, warnings, requests that failed and React commits slower than a frame").option("--from <seconds>", "from this far in").option("--to <seconds>", "to this far in").option("--around <seconds>", "every line of the 3 seconds either side of this").option("--grep <text>", "lines with this in them, in any case, of every line").option("--full", "all of each line: where it was logged from, a request's headers and bodies, a React commit's components").option("--json", "as JSON").action(async (ref, options) => (await import("./shared/recording.js")).run(ref, options));
33
33
  program.command("frame").description("PNGs of a recording, as the replay draws it, marks and all (needs the dev server)").argument("<recording>", RECORDING).option("--nth <n>", "a task's nth recording", "1").option("--at <seconds>", "a frame this far in (repeatable); by default after each change to the marks, and the end", all).option("--every <seconds>", "a frame this often").option("--out <dir>", "where the PNGs go, a temporary folder by default").option("--base <url>", "the dev server, where it's not the recorded page's origin").action(async (ref, options) => (await import("./shared/frame.js")).run(ref, options));
34
34
  program.command("voice").description("when speech happens in voice clips, in the recording's time").argument("<clip>", CLIP).option("--noise <dB>", "what counts as silence; lower hears quieter speech", "-35").option("--gap <seconds>", "the shortest silence between stretches of speech", "0.4").option("--wav <dir>", "also writes each clip here as 16 kHz WAV").option("--json", "as JSON").action(async (ref, options) => (await import("./shared/voice2.js")).run(ref, options));
35
35
  program.command("transcribe").description("what was said in voice clips, on this machine, with when").argument("[clip]", CLIP).option("--setup", "installs it, outside the project: ask the person first").option("--model <size>", "tiny, base, small, large-v3-turbo, or a model ID", "base").option("--language <code>", "the language spoken (en), rather than guessed").option("--json", "as JSON").action(async (ref, options) => (await import("./shared/transcribe.js")).run(ref, options));
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * The `deictic` command. `init` sets a project up and `clean` deletes what it kept, for the person; the rest are for\n * the agent that works the tasks, as the skill says: the board, a watch, a task, and what a task carries. Each is\n * declared here, its arguments and options with what they do, which is all `--help` needs; what it runs is in `cli/`,\n * imported only when it's run, so `deictic task` doesn't load the parser `init` edits configs with. Run in the\n * project, where its board and `.deictic/` are: `npx deictic <command>`.\n */\nimport { Argument, Command } from 'commander';\n\n/** A repeatable option's values, in order. */\nconst all = (value: string, previous: string[] | undefined) => [...(previous ?? []), value];\nconst RECORDING = 'a task (68), a replay URL, a recording ID or a JSON file';\nconst CLIP = 'a task, a replay URL, a recording ID, an audio file or a clip ID';\n\nconst program = new Command('deictic')\n .usage('<command> [options]')\n .enablePositionalOptions()\n .helpOption('-h, --help', 'says what a command takes')\n .showHelpAfterError('(add --help for what it takes)')\n .addHelpText('after', '\\nRun in the project. deictic help <command>, or <command> --help, says what it takes.');\n\nprogram.commandsGroup('Setting up and cleaning up:');\n// Here, not under a heading of its own, which a lone `help` would get.\nprogram.helpCommand('help [command]', 'says what a command takes');\n\nprogram\n .command('init')\n .description('sets deictic up in this project')\n .option('--dry-run', 'says what it would do, and does none of it')\n .option('--no-install', \"doesn't install: says the command instead\")\n .option('--skill', 'adds the agent skill without asking')\n .option('--no-skill', \"doesn't add the agent skill: says the command instead\")\n .action(async (options) => (await import('./cli/init.ts')).run(options));\n\nprogram\n .command('clean')\n .description('deletes what deictic kept, after saying what and how big and asking')\n .addArgument(\n new Argument('[parts...]', 'what to delete: shots, recordings and voice clips by default').choices([\n 'screenshots',\n 'recordings',\n 'voice',\n 'history',\n 'board',\n 'all',\n 'transcribe',\n ]),\n )\n .option('-y, --yes', \"deletes without asking: with no terminal to ask on, it doesn't delete without it\")\n .addHelpText(\n 'after',\n '\\nhistory (undo) and board (the local board, its tasks) only with the dev server stopped. all is everything in' +\n \"\\nthe project's .deictic/; transcribe is the transcription model, outside it, which every project shares.\",\n )\n .action(async (parts: string[], options) => (await import('./cli/clean.ts')).run(parts, options));\n\nprogram.commandsGroup('For the agent that works the tasks (the skill):');\n\nprogram\n .command('vb')\n .description('the board on the dev server: deictic vb whoami, deictic vb tasks claim 68 --lease 30m')\n .argument('[args...]', 'anything vb takes')\n // All of it is vb's, --help too.\n .helpOption(false)\n .allowUnknownOption()\n .passThroughOptions()\n .action(async (args: string[]) => (await import('./cli/vb.ts')).run(args));\n\nprogram\n .command('watch')\n .description('a line per new task, reply and cancellation')\n .argument('[channel]', 'the channel', 'deictic')\n .option('--idle <time>', 'ends once the channel has had nothing for this long: 30m, 45s, 1h', '20m')\n .option('--once', 'ends at the first thing to act on')\n .option('--label <key=value>', 'only tasks with this label (repeatable)', all)\n .action(async (channel: string, options) => (await import('./cli/watch.ts')).run(channel, options));\n\nprogram\n .command('task')\n .description('a task briefly: what was asked, by whom, who holds it, what is attached')\n .argument('<id>', 'the task: 68 or #68')\n .option('--out <dir>', 'downloads what is attached here')\n .action(async (id: string, options) => (await import('./cli/task.ts')).run(id, options));\n\nprogram\n .command('recording')\n .description('a recording as a timeline, or the part of it asked for')\n .argument('<recording>', RECORDING)\n .option('--nth <n>', \"a task's nth recording\", '1')\n .option('--only <kinds>', 'these kinds of line: console, request, page, click, input, scroll, resize, marks, voice (repeatable)', all)\n .option('--problems', 'errors, warnings and requests that failed')\n .option('--from <seconds>', 'from this far in')\n .option('--to <seconds>', 'to this far in')\n .option('--around <seconds>', 'the 3 seconds either side of this')\n .option('--grep <text>', 'lines with this in them, in any case')\n .option('--full', \"all of each line: where it was logged from, a request's headers and bodies\")\n .option('--json', 'as JSON')\n .action(async (ref: string, options) => (await import('./cli/recording.ts')).run(ref, options));\n\nprogram\n .command('frame')\n .description('PNGs of a recording, as the replay draws it, marks and all (needs the dev server)')\n .argument('<recording>', RECORDING)\n .option('--nth <n>', \"a task's nth recording\", '1')\n .option('--at <seconds>', 'a frame this far in (repeatable); by default after each change to the marks, and the end', all)\n .option('--every <seconds>', 'a frame this often')\n .option('--out <dir>', 'where the PNGs go, a temporary folder by default')\n .option('--base <url>', \"the dev server, where it's not the recorded page's origin\")\n .action(async (ref: string, options) => (await import('./cli/frame.ts')).run(ref, options));\n\nprogram\n .command('voice')\n .description(\"when speech happens in voice clips, in the recording's time\")\n .argument('<clip>', CLIP)\n .option('--noise <dB>', 'what counts as silence; lower hears quieter speech', '-35')\n .option('--gap <seconds>', 'the shortest silence between stretches of speech', '0.4')\n .option('--wav <dir>', 'also writes each clip here as 16 kHz WAV')\n .option('--json', 'as JSON')\n .action(async (ref: string, options) => (await import('./cli/voice.ts')).run(ref, options));\n\nprogram\n .command('transcribe')\n .description('what was said in voice clips, on this machine, with when')\n .argument('[clip]', CLIP)\n .option('--setup', 'installs it, outside the project: ask the person first')\n .option('--model <size>', 'tiny, base, small, large-v3-turbo, or a model ID', 'base')\n .option('--language <code>', 'the language spoken (en), rather than guessed')\n .option('--json', 'as JSON')\n .action(async (ref: string | undefined, options) => (await import('./cli/transcribe.ts')).run(ref, options));\n\nif (process.argv.length <= 2) {\n program.outputHelp();\n process.exit(0);\n}\nawait program.parseAsync();\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,OAAO,OAAe,aAAmC,CAAC,GAAI,YAAY,CAAC,GAAI,KAAK;AAC1F,MAAM,YAAY;AAClB,MAAM,OAAO;AAEb,MAAM,UAAU,IAAI,QAAQ,SAAS,CAAC,CACnC,MAAM,qBAAqB,CAAC,CAC5B,wBAAwB,CAAC,CACzB,WAAW,cAAc,2BAA2B,CAAC,CACrD,mBAAmB,gCAAgC,CAAC,CACpD,YAAY,SAAS,wFAAwF;AAEhH,QAAQ,cAAc,6BAA6B;AAEnD,QAAQ,YAAY,kBAAkB,2BAA2B;AAEjE,QACG,QAAQ,MAAM,CAAC,CACf,YAAY,iCAAiC,CAAC,CAC9C,OAAO,aAAa,4CAA4C,CAAC,CACjE,OAAO,gBA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AAO,WAAW,wDAAwD,CAAC,CAC3E,OAAO,kBAAkB,oDAAoD,MAAM,CAAC,CACpF,OAAO,qBAAqB,+CAA+C,CAAC,CAC5E,OAAO,UAAU,SAAS,CAAC,CAC3B,OAAO,OAAO,KAAyB,aAAa,MAAM,OAAO,0BAAA,CAAwB,IAAI,KAAK,OAAO,CAAC;AAE7G,IAAI,QAAQ,KAAK,UAAU,GAAG;CAC5B,QAAQ,WAAW;CACnB,QAAQ,KAAK,CAAC;AAChB;AACA,MAAM,QAAQ,WAAW"}
1
+ {"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * The `deictic` command. `init` sets a project up and `clean` deletes what it kept, for the person; the rest are for\n * the agent that works the tasks, as the skill says: the board, a watch, a task, and what a task carries. Each is\n * declared here, its arguments and options with what they do, which is all `--help` needs; what it runs is in `cli/`,\n * imported only when it's run, so `deictic task` doesn't load the parser `init` edits configs with. Run in the\n * project, where its board and `.deictic/` are: `npx deictic <command>`.\n */\nimport { Argument, Command } from 'commander';\n\n/** A repeatable option's values, in order. */\nconst all = (value: string, previous: string[] | undefined) => [...(previous ?? []), value];\nconst RECORDING = 'a task (68), a replay URL, a recording ID or a JSON file';\nconst CLIP = 'a task, a replay URL, a recording ID, an audio file or a clip ID';\n\nconst program = new Command('deictic')\n .usage('<command> [options]')\n .enablePositionalOptions()\n .helpOption('-h, --help', 'says what a command takes')\n .showHelpAfterError('(add --help for what it takes)')\n .addHelpText('after', '\\nRun in the project. deictic help <command>, or <command> --help, says what it takes.');\n\nprogram.commandsGroup('Setting up and cleaning up:');\n// Here, not under a heading of its own, which a lone `help` would get.\nprogram.helpCommand('help [command]', 'says what a command takes');\n\nprogram\n .command('init')\n .description('sets deictic up in this project')\n .option('--dry-run', 'says what it would do, and does none of it')\n .option('--no-install', \"doesn't install: says the command instead\")\n .option('--skill', 'adds the agent skill without asking')\n .option('--no-skill', \"doesn't add the agent skill: says the command instead\")\n .action(async (options) => (await import('./cli/init.ts')).run(options));\n\nprogram\n .command('clean')\n .description('deletes what deictic kept, after saying what and how big and asking')\n .addArgument(\n new Argument('[parts...]', 'what to delete: shots, recordings and voice clips by default').choices([\n 'screenshots',\n 'recordings',\n 'voice',\n 'history',\n 'board',\n 'all',\n 'transcribe',\n ]),\n )\n .option('-y, --yes', \"deletes without asking: with no terminal to ask on, it doesn't delete without it\")\n .addHelpText(\n 'after',\n '\\nhistory (undo) and board (the local board, its tasks) only with the dev server stopped. all is everything in' +\n \"\\nthe project's .deictic/; transcribe is the transcription model, outside it, which every project shares.\",\n )\n .action(async (parts: string[], options) => (await import('./cli/clean.ts')).run(parts, options));\n\nprogram.commandsGroup('For the agent that works the tasks (the skill):');\n\nprogram\n .command('vb')\n .description('the board on the dev server: deictic vb whoami, deictic vb tasks claim 68 --lease 30m')\n .argument('[args...]', 'anything vb takes')\n // All of it is vb's, --help too.\n .helpOption(false)\n .allowUnknownOption()\n .passThroughOptions()\n .action(async (args: string[]) => (await import('./cli/vb.ts')).run(args));\n\nprogram\n .command('watch')\n .description('a line per new task, reply and cancellation')\n .argument('[channel]', 'the channel', 'deictic')\n .option('--idle <time>', 'ends once the channel has had nothing for this long: 30m, 45s, 1h', '20m')\n .option('--once', 'ends at the first thing to act on')\n .option('--label <key=value>', 'only tasks with this label (repeatable)', all)\n .action(async (channel: string, options) => (await import('./cli/watch.ts')).run(channel, options));\n\nprogram\n .command('task')\n .description('a task briefly: what was asked, by whom, who holds it, what is attached')\n .argument('<id>', 'the task: 68 or #68')\n .option('--out <dir>', 'downloads what is attached here')\n .action(async (id: string, options) => (await import('./cli/task.ts')).run(id, options));\n\nprogram\n .command('recording')\n .description(\n \"a recording as a timeline: what the person did and what went wrong, with a count of the page's other requests, console lines and React commits; or the part of it asked for\",\n )\n .argument('<recording>', RECORDING)\n .option('--nth <n>', \"a task's nth recording\", '1')\n .option(\n '--only <kinds>',\n 'these kinds of line: console, request, react, page, click, input, scroll, resize, marks, voice (repeatable)',\n all,\n )\n .option('--all', 'every line: every request, console line and React commit too')\n .option('--problems', 'errors, warnings, requests that failed and React commits slower than a frame')\n .option('--from <seconds>', 'from this far in')\n .option('--to <seconds>', 'to this far in')\n .option('--around <seconds>', 'every line of the 3 seconds either side of this')\n .option('--grep <text>', 'lines with this in them, in any case, of every line')\n .option('--full', \"all of each line: where it was logged from, a request's headers and bodies, a React commit's components\")\n .option('--json', 'as JSON')\n .action(async (ref: string, options) => (await import('./cli/recording.ts')).run(ref, options));\n\nprogram\n .command('frame')\n .description('PNGs of a recording, as the replay draws it, marks and all (needs the dev server)')\n .argument('<recording>', RECORDING)\n .option('--nth <n>', \"a task's nth recording\", '1')\n .option('--at <seconds>', 'a frame this far in (repeatable); by default after each change to the marks, and the end', all)\n .option('--every <seconds>', 'a frame this often')\n .option('--out <dir>', 'where the PNGs go, a temporary folder by default')\n .option('--base <url>', \"the dev server, where it's not the recorded page's origin\")\n .action(async (ref: string, options) => (await import('./cli/frame.ts')).run(ref, options));\n\nprogram\n .command('voice')\n .description(\"when speech happens in voice clips, in the recording's time\")\n .argument('<clip>', CLIP)\n .option('--noise <dB>', 'what counts as silence; lower hears quieter speech', '-35')\n .option('--gap <seconds>', 'the shortest silence between stretches of speech', '0.4')\n .option('--wav <dir>', 'also writes each clip here as 16 kHz WAV')\n .option('--json', 'as JSON')\n .action(async (ref: string, options) => (await import('./cli/voice.ts')).run(ref, options));\n\nprogram\n .command('transcribe')\n .description('what was said in voice clips, on this machine, with when')\n .argument('[clip]', CLIP)\n .option('--setup', 'installs it, outside the project: ask the person first')\n .option('--model <size>', 'tiny, base, small, large-v3-turbo, or a model ID', 'base')\n .option('--language <code>', 'the language spoken (en), rather than guessed')\n .option('--json', 'as JSON')\n .action(async (ref: string | undefined, options) => (await import('./cli/transcribe.ts')).run(ref, options));\n\nif (process.argv.length <= 2) {\n program.outputHelp();\n process.exit(0);\n}\nawait program.parseAsync();\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,OAAO,OAAe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OAAO,qBAAA,CAAmB,IAAI,KAAK,OAAO,CAAC;AAE5F,QACG,QAAQ,OAAO,CAAC,CAChB,YAAY,6DAA6D,CAAC,CAC1E,SAAS,UAAU,IAAI,CAAC,CACxB,OAAO,gBAAgB,sDAAsD,KAAK,CAAC,CACnF,OAAO,mBAAmB,oDAAoD,KAAK,CAAC,CACpF,OAAO,eAAe,0CAA0C,CAAC,CACjE,OAAO,UAAU,SAAS,CAAC,CAC3B,OAAO,OAAO,KAAa,aAAa,MAAM,OAAO,sBAAA,CAAmB,IAAI,KAAK,OAAO,CAAC;AAE5F,QACG,QAAQ,YAAY,CAAC,CACrB,YAAY,0DAA0D,CAAC,CACvE,SAAS,UAAU,IAAI,CAAC,CACxB,OAAO,WAAW,wDAAwD,CAAC,CAC3E,OAAO,kBAAkB,oDAAoD,MAAM,CAAC,CACpF,OAAO,qBAAqB,+CAA+C,CAAC,CAC5E,OAAO,UAAU,SAAS,CAAC,CAC3B,OAAO,OAAO,KAAyB,aAAa,MAAM,OAAO,0BAAA,CAAwB,IAAI,KAAK,OAAO,CAAC;AAE7G,IAAI,QAAQ,KAAK,UAAU,GAAG;CAC5B,QAAQ,WAAW;CACnB,QAAQ,KAAK,CAAC;AAChB;AACA,MAAM,QAAQ,WAAW"}
@@ -37,6 +37,18 @@ export declare function drawBars(canvas: HTMLCanvasElement, peaks: readonly numb
37
37
  export declare function liveWaveform(canvas: HTMLCanvasElement, stream: MediaStream, colors: Colors): () => void;
38
38
  /** An element's place in the source, as its mark has it, or nothing for one with none. */
39
39
  export declare function targetOf(el: Element): Target | undefined;
40
+ /**
41
+ * What the page hears on `window` as the popup opens over it on an element (its `detail` a `PopupOpened`) and as
42
+ * it closes: for a page that moves on its own to hold still meanwhile, as deictic's site does. Not for one pinned.
43
+ */
44
+ export declare const POPUP_OPENED = "deictic:open";
45
+ export declare const POPUP_CLOSED = "deictic:close";
46
+ interface PopupOpened {
47
+ /** The element it's open on. */
48
+ element: Element;
49
+ /** The plugin whose tab it opened at. */
50
+ tab: string;
51
+ }
40
52
  export interface StartOptions {
41
53
  /** The dev server's base URL, ending in `/`. */
42
54
  base: string;
@@ -51,18 +63,6 @@ export interface StartOptions {
51
63
  /** What answers the requests where there's no dev server to: a `standalone` build's. */
52
64
  server?: Standalone;
53
65
  }
54
- /**
55
- * What the page hears on `window` as the popup opens over it on an element (its `detail` a `PopupOpened`) and as
56
- * it closes: for a page that moves on its own to hold still meanwhile, as deictic's site does. Not for one pinned.
57
- */
58
- export declare const POPUP_OPENED = "deictic:open";
59
- export declare const POPUP_CLOSED = "deictic:close";
60
- export interface PopupOpened {
61
- /** The element it's open on. */
62
- element: Element;
63
- /** The plugin whose tab it opened at. */
64
- tab: string;
65
- }
66
66
  /**
67
67
  * Opens the popup over the page on `element`, as deictic's own shortcut does: at `tab` (a plugin's name), or at the
68
68
  * tab used last. For a page that opens it from a gesture of its own, as deictic's site does on a plain click.
@@ -92,5 +92,5 @@ export declare function lightboxIn(container: Element, items: LightboxItem[], {
92
92
  }): () => void;
93
93
  /** Starts the overlay, once per page: the client module runs again when a module importing it is replaced. */
94
94
  export declare function start({ base, shortcut: own, plugins: given, server }: StartOptions): void;
95
- export type { Colors };
95
+ export type { Colors, PopupOpened };
96
96
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/client/waveform.ts","../../src/client/dom.ts","../../src/client/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAUsB,QAAQ,aAAa,eAAe;EAAU;EAAiB;;UAsBpE;;EAEf;;EAEA;;;wBAIc,SAAS,QAAQ,mBAAmB,0BAA0B,kBAAkB,QAAQ;;;;;wBAoBxF,aAAa,QAAQ,mBAAmB,QAAQ,aAAa,QAAQ;;wBCrDrE,SAAS,IAAI,UAAU;iBCgCtB;;EAEf;;EAEA,WAAW,SAAS;;EAEpB;IAAW,QAAQ;IAAc,WAAW,SAAS;IAAW;;;EAEhE,SAAS;;;;;;qBAyDE;qBACA;iBAEI;;EAEf,SAAS;;EAET;;;;;;;wBAQc,UAAU,SAAS,WAAW;EAAS;;;;;;;;;wBAYvC,QAAQ,WAAW,WAAW,KAAK,MAAM;EAAa;EAAc,SAAS;;;;;;;wBAiD7E,WAAW,WAAW,SAAS,OAAO,kBAAkB;EAAQ;;;wBAchE,QAAQ,MAAM,UAAU,KAAK,SAAS,OAAO,UAAU"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/client/waveform.ts","../../src/client/dom.ts","../../src/client/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;wBAUsB,QAAQ,aAAa,eAAe;EAAU;EAAiB;;UAsBpE;;EAEf;;EAEA;;;wBAIc,SAAS,QAAQ,mBAAmB,0BAA0B,kBAAkB,QAAQ;;;;;wBAoBxF,aAAa,QAAQ,mBAAmB,QAAQ,aAAa,QAAQ;;wBCrDrE,SAAS,IAAI,UAAU;;;;;qBAoE1B;qBACA;UAEI;;EAEf,SAAS;;EAET;;iBC3Ce;;EAEf;;EAEA,WAAW,SAAS;;EAEpB;IAAW,QAAQ;IAAc,WAAW,SAAS;IAAW;;;EAEhE,SAAS;;;;;;;wBA6DK,UAAU,SAAS,WAAW;EAAS;;;;;;;;;wBAYvC,QAAQ,WAAW,WAAW,KAAK,MAAM;EAAa;EAAc,SAAS;;;;;;;wBAiD7E,WAAW,WAAW,SAAS,OAAO,kBAAkB;EAAQ;;;wBAchE,QAAQ,MAAM,UAAU,KAAK,SAAS,OAAO,UAAU"}
@@ -1,6 +1,6 @@
1
1
  import { r as gestureOf } from "../shared/shortcut.js";
2
2
  import { a as tell, r as named } from "../shared/component.js";
3
- import { a as nameOf, c as sameAs, i as div, l as targetOf, o as place$1, r as controlFor, s as reduced, t as ATTRIBUTE } from "../shared/dom.js";
3
+ import { a as controlFor, c as place$1, d as targetOf, i as POPUP_OPENED, l as reduced, o as div, r as POPUP_CLOSED, s as nameOf, t as ATTRIBUTE, u as sameAs } from "../shared/dom.js";
4
4
  import { t as drawerIn } from "../shared/drawer.js";
5
5
  import { n as liveWaveform, r as peaksOf, t as drawBars } from "../shared/waveform.js";
6
6
  // src/client/away.ts
@@ -1426,12 +1426,6 @@ function icon(path, width = 2) {
1426
1426
  }
1427
1427
  let started;
1428
1428
  /**
1429
- * What the page hears on `window` as the popup opens over it on an element (its `detail` a `PopupOpened`) and as
1430
- * it closes: for a page that moves on its own to hold still meanwhile, as deictic's site does. Not for one pinned.
1431
- */
1432
- const POPUP_OPENED = "deictic:open";
1433
- const POPUP_CLOSED = "deictic:close";
1434
- /**
1435
1429
  * Opens the popup over the page on `element`, as deictic's own shortcut does: at `tab` (a plugin's name), or at the
1436
1430
  * tab used last. For a page that opens it from a gesture of its own, as deictic's site does on a plain click.
1437
1431
  * Answers whether it opened: not where no plugin has a tab, or `element` has no mark. The overlay must have started.
@@ -1756,6 +1750,16 @@ function start({ base, shortcut: own, plugins: given, server }) {
1756
1750
  });
1757
1751
  let press = {};
1758
1752
  let opened;
1753
+ window.addEventListener("pointerdown", (e) => {
1754
+ if (e.composedPath().includes(host) || pressedBy(e) === void 0) return;
1755
+ const hit = hitAt(e.clientX, e.clientY);
1756
+ if (hit === void 0) return;
1757
+ for (const { plugin } of given) try {
1758
+ plugin.pressed?.(contextOf(plugin.name), hit.el);
1759
+ } catch (e) {
1760
+ report(failed(plugin.name, "keep what the page showed as it was pressed", e));
1761
+ }
1762
+ }, true);
1759
1763
  window.addEventListener("mousedown", (e) => {
1760
1764
  press = {};
1761
1765
  if (e.composedPath().includes(host)) return;