deictic 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. package/API.md +26 -17
  2. package/README.md +6 -26
  3. package/dist/annotations/client.d.ts +1 -1
  4. package/dist/annotations/client.js +1 -1
  5. package/dist/annotations/index.d.ts +2 -101
  6. package/dist/annotations/index.js +1 -22
  7. package/dist/astro.d.ts +1 -1
  8. package/dist/astro.js +1 -1
  9. package/dist/cli.d.ts +1 -0
  10. package/dist/cli.js +37 -0
  11. package/dist/cli.js.map +1 -0
  12. package/dist/index.js +1 -10
  13. package/dist/logs/client.d.ts +1 -1
  14. package/dist/logs/client.js +1 -1
  15. package/dist/logs/index.d.ts +2 -18
  16. package/dist/logs/index.js +1 -21
  17. package/dist/network/client.d.ts +1 -1
  18. package/dist/network/client.js +1 -1
  19. package/dist/network/index.d.ts +1 -1
  20. package/dist/network/index.js +1 -37
  21. package/dist/recommended/index.d.ts +7 -7
  22. package/dist/recommended/index.js +1 -26
  23. package/dist/recordings/client.d.ts +1 -1
  24. package/dist/recordings/client.js +1 -1
  25. package/dist/recordings/index.d.ts +1 -1
  26. package/dist/screenshots/client.d.ts +1 -1
  27. package/dist/screenshots/client.js +1 -108
  28. package/dist/screenshots/dom.d.ts +1 -1
  29. package/dist/screenshots/dom.js +1 -1
  30. package/dist/screenshots/index.d.ts +1 -1
  31. package/dist/screenshots/index.js +1 -103
  32. package/dist/screenshots/rrweb.d.ts +1 -1
  33. package/dist/screenshots/rrweb.js +1 -1
  34. package/dist/shared/annotations.js +22 -0
  35. package/dist/shared/annotations.js.map +1 -0
  36. package/dist/shared/board.js +190 -0
  37. package/dist/shared/board.js.map +1 -0
  38. package/dist/shared/client.js +108 -0
  39. package/dist/shared/endpoints.js +4 -1
  40. package/dist/shared/endpoints.js.map +1 -1
  41. package/dist/shared/find.js +156 -0
  42. package/dist/shared/find.js.map +1 -0
  43. package/dist/shared/frame.js +75 -0
  44. package/dist/shared/frame.js.map +1 -0
  45. package/dist/shared/index.d.ts +5 -0
  46. package/dist/shared/index.d.ts.map +1 -1
  47. package/dist/shared/index2.d.ts +85 -88
  48. package/dist/shared/index2.d.ts.map +1 -1
  49. package/dist/shared/index3.d.ts +83 -89
  50. package/dist/shared/index3.d.ts.map +1 -1
  51. package/dist/shared/index4.d.ts +98 -50
  52. package/dist/shared/index4.d.ts.map +1 -1
  53. package/dist/shared/index5.d.ts +13 -219
  54. package/dist/shared/index5.d.ts.map +1 -1
  55. package/dist/shared/index6.d.ts +55 -61
  56. package/dist/shared/index6.d.ts.map +1 -1
  57. package/dist/shared/index7.d.ts +224 -0
  58. package/dist/shared/index7.d.ts.map +1 -0
  59. package/dist/shared/index8.d.ts +52 -0
  60. package/dist/shared/index8.d.ts.map +1 -0
  61. package/dist/shared/index9.d.ts +70 -0
  62. package/dist/shared/index9.d.ts.map +1 -0
  63. package/dist/shared/init.js +472 -0
  64. package/dist/shared/init.js.map +1 -0
  65. package/dist/shared/local.js +165 -0
  66. package/dist/shared/local.js.map +1 -0
  67. package/dist/shared/logs.js +22 -0
  68. package/dist/shared/logs.js.map +1 -0
  69. package/dist/shared/network.js +39 -0
  70. package/dist/shared/network.js.map +1 -0
  71. package/dist/shared/packages.js +125 -0
  72. package/dist/shared/packages.js.map +1 -0
  73. package/dist/shared/recommended.js +26 -0
  74. package/dist/shared/recommended.js.map +1 -0
  75. package/dist/shared/recording.js +316 -0
  76. package/dist/shared/recording.js.map +1 -0
  77. package/dist/shared/recordings.js +2 -1
  78. package/dist/shared/recordings.js.map +1 -1
  79. package/dist/shared/screenshots.js +108 -0
  80. package/dist/shared/screenshots.js.map +1 -0
  81. package/dist/shared/src.js +10 -0
  82. package/dist/shared/src.js.map +1 -0
  83. package/dist/shared/task.js +108 -0
  84. package/dist/shared/task.js.map +1 -0
  85. package/dist/shared/tasks.js +7 -180
  86. package/dist/shared/tasks.js.map +1 -1
  87. package/dist/shared/transcribe.js +128 -0
  88. package/dist/shared/transcribe.js.map +1 -0
  89. package/dist/shared/vb.js +13 -0
  90. package/dist/shared/vb.js.map +1 -0
  91. package/dist/shared/vite.d.ts +16 -0
  92. package/dist/shared/vite.d.ts.map +1 -0
  93. package/dist/shared/vite.js +61 -0
  94. package/dist/shared/vite.js.map +1 -0
  95. package/dist/shared/voice.js +84 -0
  96. package/dist/{voice/index.js.map → shared/voice.js.map} +1 -1
  97. package/dist/shared/voice2.js +90 -0
  98. package/dist/shared/voice2.js.map +1 -0
  99. package/dist/shared/watch.js +209 -0
  100. package/dist/shared/watch.js.map +1 -0
  101. package/dist/shared/watchers.js +62 -0
  102. package/dist/shared/watchers.js.map +1 -0
  103. package/dist/tailwind/client.d.ts +1 -1
  104. package/dist/tailwind/client.js +1 -1
  105. package/dist/tailwind/index.d.ts +1 -1
  106. package/dist/tailwind/index.js +1 -1
  107. package/dist/tasks/client.d.ts +1 -1
  108. package/dist/tasks/client.js +1 -1
  109. package/dist/tasks/index.d.ts +1 -1
  110. package/dist/tasks/index.js +3 -1
  111. package/dist/vite.d.ts +2 -15
  112. package/dist/vite.js +2 -60
  113. package/dist/voice/client.d.ts +1 -1
  114. package/dist/voice/client.js +1 -1
  115. package/dist/voice/index.d.ts +2 -52
  116. package/dist/voice/index.js +1 -84
  117. package/package.json +6 -9
  118. package/skills/deictic/SKILL.md +27 -42
  119. package/skills/deictic/references/recordings.md +9 -108
  120. package/skills/deictic/references/tasks.md +21 -112
  121. package/skills/deictic/references/watch.md +13 -68
  122. package/src/cli/board.ts +204 -0
  123. package/src/cli/bun.ts +133 -0
  124. package/src/cli/edit.ts +56 -0
  125. package/src/cli/find.ts +147 -0
  126. package/src/cli/frame.ts +90 -0
  127. package/src/cli/init.ts +388 -0
  128. package/src/cli/recording.ts +383 -0
  129. package/src/cli/task.ts +126 -0
  130. package/src/cli/transcribe.ts +129 -0
  131. package/src/cli/vb.ts +11 -0
  132. package/src/cli/voice.ts +59 -0
  133. package/src/cli/watch.ts +221 -0
  134. package/src/cli.ts +37 -0
  135. package/src/index.ts +5 -0
  136. package/src/plugins/logs/index.ts +1 -0
  137. package/src/plugins/network/index.ts +1 -0
  138. package/src/plugins/recordings/index.ts +1 -0
  139. package/src/plugins/screenshots/index.ts +5 -1
  140. package/src/plugins/tasks/index.ts +3 -2
  141. package/src/plugins/tasks/local.ts +19 -6
  142. package/src/plugins/tasks/watchers.ts +41 -6
  143. package/src/tools/endpoints.ts +3 -0
  144. package/src/tools/packages.ts +107 -0
  145. package/dist/annotations/index.d.ts.map +0 -1
  146. package/dist/annotations/index.js.map +0 -1
  147. package/dist/index.js.map +0 -1
  148. package/dist/logs/index.d.ts.map +0 -1
  149. package/dist/logs/index.js.map +0 -1
  150. package/dist/network/index.js.map +0 -1
  151. package/dist/recommended/index.js.map +0 -1
  152. package/dist/screenshots/index.js.map +0 -1
  153. package/dist/vite.d.ts.map +0 -1
  154. package/dist/vite.js.map +0 -1
  155. package/dist/voice/index.d.ts.map +0 -1
  156. package/skills/deictic/references/install.md +0 -103
  157. package/skills/deictic/scripts/frame.mjs +0 -62
  158. package/skills/deictic/scripts/lib.mjs +0 -283
  159. package/skills/deictic/scripts/recording.mjs +0 -266
  160. package/skills/deictic/scripts/task.mjs +0 -120
  161. package/skills/deictic/scripts/transcribe.mjs +0 -93
  162. package/skills/deictic/scripts/vb.mjs +0 -12
  163. package/skills/deictic/scripts/voice.mjs +0 -50
  164. package/skills/deictic/scripts/watch.mjs +0 -152
  165. /package/dist/{screenshots → shared}/client.js.map +0 -0
package/API.md CHANGED
@@ -15,7 +15,12 @@ types are the full reference: every option is documented where it's declared.
15
15
 
16
16
  ## Bundlers
17
17
 
18
- Every integration takes the same options and runs in the dev server only.
18
+ `npx deictic init` sets a project up: it installs deictic and what its plugins use with the project's package manager,
19
+ adds it to the bundler's config, and offers the agent skill (`--dry-run`, `--no-install`, `--skill`, `--no-skill`).
20
+ For Bun it writes `deictic.plugin.ts`, names it in `bunfig.toml` and spreads its routes into `Bun.serve`'s, where a
21
+ server of the project's has Bun bundle an HTML page (a Bun project that runs Vite or Next.js is theirs). This is what
22
+ it adds, and what to add by hand where it can't (a config it can't read). Every integration takes the same options
23
+ and runs in the dev server only.
19
24
 
20
25
  ```ts
21
26
  // Vite, and anything on it (React Router, TanStack Start…): vite.config.ts
@@ -26,7 +31,7 @@ export default defineConfig({ plugins: [react(), deictic({ plugins: recommended(
26
31
  import { withDeictic } from 'deictic/next';
27
32
  export default withDeictic(nextConfig, { plugins: recommended() });
28
33
 
29
- // webpack 5, Rspack: add `launch-editor` to open files in your editor
34
+ // webpack 5, Rspack (`launch-editor` opens files in your editor)
30
35
  import { DeicticPlugin } from 'deictic/webpack';
31
36
  export default { plugins: [new DeicticPlugin({ plugins: recommended() })] };
32
37
 
@@ -149,24 +154,26 @@ In the Task tab:
149
154
 
150
155
  ### The agent skill
151
156
 
152
- deictic ships a skill that watches the channel and works each task as it arrives, with scripts that read a task,
153
- turn a recording into a timeline, screenshot it at any moment and transcribe its voice notes. Its watch ends once
154
- the channel has been quiet for 20 minutes, and the agent then stops and says so, so none watches for ever:
155
-
156
- ```bash
157
- npx skills add gkurt/deictic
158
- ```
157
+ deictic ships a skill that watches the channel and works each task as it arrives. What it runs is the package's own
158
+ `deictic` command, so it reads tasks and recordings with the version that wrote them: `deictic watch`, `deictic task`,
159
+ `deictic recording` (a timeline), `deictic frame` (a screenshot at any moment), `deictic voice` and
160
+ `deictic transcribe`, and `deictic vb`, the board's CLI on the dev server's board (`npx deictic --help` lists them).
161
+ Its watch ends once the channel has been quiet for 20 minutes, and the agent then stops and says so, so none watches
162
+ for ever. `init` offers to add it; otherwise `npx skills add gkurt/deictic`.
159
163
 
160
164
  ## Screenshots, recordings and voice
161
165
 
162
- | Plugin | Needs | Options |
163
- | --------------------- | -------------------------------------------------------------- | ------------------------------------------------- |
164
- | `deictic/screenshots` | `rrweb-snapshot` and `playwright-core`, or `modern-screenshot` | `renderer`, `keep` (100), `dir`, masking |
165
- | `deictic/annotations` | nothing | `color`, `shortcut` |
166
- | `deictic/recordings` | `rrweb`, `rrweb-player` | `keep` (20), `dir`, `canvas`, masking |
167
- | `deictic/voice` | nothing | `keep` (50), `dir` |
168
- | `deictic/logs` | `@rrweb/rrweb-plugin-console-record` | `levels` |
169
- | `deictic/network` | `@rrweb/rrweb-plugin-network-record` | `headers`, `body`, `mask`, `ignore`, `initiators` |
166
+ | Plugin | Options |
167
+ | --------------------- | ------------------------------------------------- |
168
+ | `deictic/screenshots` | `renderer`, `keep` (100), `dir`, masking |
169
+ | `deictic/annotations` | `color`, `shortcut` |
170
+ | `deictic/recordings` | `keep` (20), `dir`, `canvas`, masking |
171
+ | `deictic/voice` | `keep` (50), `dir` |
172
+ | `deictic/logs` | `levels` |
173
+ | `deictic/network` | `headers`, `body`, `mask`, `ignore`, `initiators` |
174
+
175
+ `init` installs what they use. Where something's missing (`modern-screenshot`, for `dom()` below), the dev server
176
+ says so as it starts, with the command that installs it.
170
177
 
171
178
  Screenshots have two renderers:
172
179
 
@@ -285,6 +292,8 @@ export default defineClientPlugin<Model, Op>({
285
292
  ```
286
293
 
287
294
  - `routes` adds routes to the dev server, which the page half reaches with `request(route)`.
295
+ - `packages` names what it imports that the project installs itself (its optional peers): as the dev server starts,
296
+ one that's missing is said, with the command that installs it.
288
297
  - `setup` answers an API for other plugins, which reach it with `context.use(name)`. That's how tasks attaches
289
298
  screenshots and recordings.
290
299
  - A change that isn't to a file answers `{ done: record }`, and the plugin's `undo` and `redo` get the record back.
package/README.md CHANGED
@@ -40,39 +40,19 @@ The task goes to a [Vercel Board](https://vercel.com/docs/board), for you, a tea
40
40
 
41
41
  ## How
42
42
 
43
- Install it with what its plugins use:
43
+ In your project:
44
44
 
45
45
  ```bash
46
- npm install -D deictic @vercel/board rrweb rrweb-player rrweb-snapshot playwright-core \
47
- @rrweb/rrweb-plugin-console-record @rrweb/rrweb-plugin-network-record
46
+ npx deictic init
48
47
  ```
49
48
 
50
- Add it to your bundler:
51
-
52
- ```ts
53
- // vite.config.ts
54
- import { recommended } from 'deictic/recommended';
55
- import { deictic } from 'deictic/vite';
56
-
57
- export default defineConfig({
58
- plugins: [react(), deictic({ plugins: recommended() })],
59
- });
60
- ```
61
-
62
- Next.js, webpack, Rspack, Astro and Bun are [in the API](API.md#bundlers).
63
-
64
- Start your dev server and Alt-click something. Tasks go to a board the dev server starts on your machine, with
65
- nothing to set up: `http://127.0.0.1:4100/`.
66
-
67
- To have your agent work them, add the skill and mention `/deictic`:
68
-
69
- ```bash
70
- npx skills add gkurt/deictic
71
- ```
49
+ It installs deictic with your package manager, adds it to your bundler's config, and offers the agent skill. Then
50
+ start your dev server and Alt-click something. Tasks go to a board the dev server starts on your machine:
51
+ `http://127.0.0.1:4100/`. To have your agent work them, mention `/deictic`.
72
52
 
73
53
  ### Options
74
54
 
75
- Each plugin takes its options under its name, and `false` leaves one out:
55
+ In the config `init` wrote, each plugin takes its options under its name, and `false` leaves one out:
76
56
 
77
57
  ```ts
78
58
  deictic({
@@ -1,4 +1,4 @@
1
- import { Annotations } from "./index.js";
1
+ import { r as Annotations } from "../shared/index2.js";
2
2
  declare const _default: import("deictic").ClientPlugin<null, never, Annotations>;
3
3
  export { _default as default };
4
4
  //# sourceMappingURL=client.d.ts.map
@@ -1,4 +1,4 @@
1
- import { defineClientPlugin } from "../index.js";
1
+ import { n as defineClientPlugin } from "../shared/src.js";
2
2
  const PAD = 6;
3
3
  const guess = (text) => text.length * 14 * .6;
4
4
  const escape = (text) => text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;");
@@ -7,104 +7,5 @@
7
7
  * over the page (`svg(area)`), tasks repeat their notes, and a recording can keep each change as it
8
8
  * happens (`subscribe`). Nothing of it runs on the server.
9
9
  */
10
- import { w as Shortcut } from "../shared/index.js";
11
- /** A point in page coordinates: CSS pixels from the document's top left, so it stays put as the page scrolls. */
12
- export interface Point {
13
- x: number;
14
- y: number;
15
- }
16
- /** A rectangle: in page coordinates for a shape, in viewport coordinates for an area to draw. */
17
- export interface Area {
18
- x: number;
19
- y: number;
20
- width: number;
21
- height: number;
22
- }
23
- export type Shape = ({
24
- kind: 'box';
25
- } & Area) | {
26
- kind: 'arrow';
27
- from: Point;
28
- to: Point;
29
- } | {
30
- kind: 'pen';
31
- points: Point[];
32
- } | {
33
- kind: 'note';
34
- at: Point;
35
- text: string;
36
- };
37
- export interface Annotation {
38
- id: string;
39
- color: string;
40
- shape: Shape;
41
- /** When it was made, as `Date.now()`. */
42
- at: number;
43
- }
44
- /** A change, as `subscribe` hears it: what a recording keeps, to show the marks as they were made. */
45
- export type AnnotationEvent = {
46
- type: 'add';
47
- annotation: Annotation;
48
- } | {
49
- type: 'remove';
50
- id: string;
51
- } | {
52
- type: 'clear';
53
- };
54
- /** The page's half, for other plugins' page halves. */
55
- export interface Annotations {
56
- /** Every annotation on this page, oldest first. */
57
- list(): Annotation[];
58
- add(shape: Shape, color?: string): Annotation;
59
- remove(id: string): void;
60
- clear(): void;
61
- /** Hears every change from now on; answers what stops it. */
62
- subscribe(listener: (event: AnnotationEvent) => void): () => void;
63
- /**
64
- * The annotations over a part of the viewport, in viewport CSS pixels, as an SVG that size: what a
65
- * screenshot of that area draws over it. Nothing when there are none.
66
- */
67
- svg(area: Area): string | undefined;
68
- /**
69
- * Opens a picture (a screenshot, most often) over everything, with the toolbar, to draw on: answers the
70
- * marks, in the picture's CSS pixels, on Save, and nothing on Cancel, Esc or `signal`. It starts from
71
- * `marks`, to edit them again. They're the picture's alone, not the page's.
72
- */
73
- edit(picture: Picture, marks?: readonly Annotation[], options?: {
74
- signal?: AbortSignal;
75
- }): Promise<Annotation[] | undefined>;
76
- /** The picture with the marks drawn over it, as a PNG at the picture's own resolution. */
77
- flatten(picture: Picture, marks: readonly Annotation[]): Promise<Blob>;
78
- /**
79
- * Annotate mode's tools, for another plugin's UI to show (a recording's toolbar): a pointer tool, picked
80
- * to start with, leaves the page usable; while a drawing tool is picked, the page is drawn on. What's
81
- * drawn is its own `marks`, not the page's: shown while it's open, kept by nothing, gone on `close`.
82
- */
83
- tools(): {
84
- element: HTMLElement;
85
- marks: MarkSet;
86
- close: () => void;
87
- };
88
- }
89
- /** A set of marks on the page: the page's own, kept for the session, or a toolbar's, kept by nothing. */
90
- export type MarkSet = Pick<Annotations, 'list' | 'add' | 'remove' | 'clear' | 'subscribe' | 'svg'>;
91
- /** An image to draw on: where it loads from (the page's origin, so a canvas may read it), and its size in CSS pixels, which marks on it are in. */
92
- export interface Picture {
93
- url: string;
94
- width: number;
95
- height: number;
96
- }
97
- declare module 'deictic' {
98
- interface ClientApis {
99
- annotations: Annotations;
100
- }
101
- }
102
- export interface AnnotationsOptions {
103
- /** What opens its tab directly, beside deictic's own shortcut, which opens any: none by default. */
104
- shortcut?: Shortcut;
105
- /** The colour marks are drawn in: a red that deictic's own green isn't. */
106
- color?: string;
107
- }
108
- export declare function annotations(options?: AnnotationsOptions): import("deictic").ServerPlugin<unknown, unknown, unknown, unknown>;
109
- export { annotations as default };
110
- //# sourceMappingURL=index.d.ts.map
10
+ import { a as Area, c as Point, i as AnnotationsOptions, l as Shape, n as AnnotationEvent, o as MarkSet, r as Annotations, s as Picture, t as Annotation, u as annotations } from "../shared/index2.js";
11
+ export { Annotation, AnnotationEvent, Annotations, AnnotationsOptions, Area, MarkSet, Picture, Point, Shape, annotations, annotations as default };
@@ -1,22 +1 @@
1
- import { definePlugin } from "../index.js";
2
- // src/plugins/annotations/index.ts
3
- /**
4
- * `deictic/annotations`: mark up the page itself. Its tab is annotate
5
- * mode over the page: boxes, arrows, a pen and notes, drawn where the page is, so they stay with
6
- * it as it scrolls. They're kept for the tab's session, per page, until cleared.
7
- *
8
- * They're data other plugins build on, through `use('annotations')` in the page: screenshots draw them
9
- * over the page (`svg(area)`), tasks repeat their notes, and a recording can keep each change as it
10
- * happens (`subscribe`). Nothing of it runs on the server.
11
- */
12
- function annotations(options = {}) {
13
- return definePlugin({
14
- name: "annotations",
15
- client: "deictic/annotations/client",
16
- shortcut: options.shortcut,
17
- clientOptions: { color: options.color ?? "#ef4444" }
18
- });
19
- }
20
- export { annotations, annotations as default };
21
-
22
- //# sourceMappingURL=index.js.map
1
+ export { t as annotations, t as default } from "../shared/annotations.js";
package/dist/astro.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * too (`tools/astro.ts`).
9
9
  */
10
10
  import { t as DeicticOptions } from "./shared/integration.js";
11
- import "./vite.js";
11
+ import "./shared/vite.js";
12
12
  /** What the integration reads of Astro's setup hook: Astro's own types, as far as they're used here. */
13
13
  interface Setup {
14
14
  command: 'dev' | 'build' | 'preview' | 'sync';
package/dist/astro.js CHANGED
@@ -1,4 +1,4 @@
1
- import deictic$1, { CLIENT } from "./vite.js";
1
+ import { n as deictic$1, t as CLIENT } from "./shared/vite.js";
2
2
  // src/astro.ts
3
3
  /**
4
4
  * `deictic/astro`: the Vite plugin (`vite.ts`) in `astro dev`, and the overlay on every page.
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {}
package/dist/cli.js ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ // src/cli.ts
3
+ /**
4
+ * The `deictic` command. `init` sets a project up, for the person; the rest are for the agent that works the tasks,
5
+ * as the skill says: the board, a watch, a task, and what a task carries. Each in `cli/`, loaded when it's run, so
6
+ * `deictic task` doesn't load the parser `init` edits configs with. Run in the project, where its board and
7
+ * `.deictic/` are: `npx deictic <command>`.
8
+ */
9
+ const COMMANDS = {
10
+ init: () => import("./shared/init.js"),
11
+ vb: () => import("./shared/vb.js"),
12
+ watch: () => import("./shared/watch.js"),
13
+ task: () => import("./shared/task.js"),
14
+ recording: () => import("./shared/recording.js"),
15
+ frame: () => import("./shared/frame.js"),
16
+ voice: () => import("./shared/voice2.js"),
17
+ transcribe: () => import("./shared/transcribe.js")
18
+ };
19
+ const isName = (name) => name !== void 0 && Object.hasOwn(COMMANDS, name);
20
+ async function help() {
21
+ const lines = await Promise.all(Object.values(COMMANDS).map(async (load) => ` ${(await load()).usage}`));
22
+ return `Usage: deictic <command>\n\nSetting up:\n${lines[0]}\n\nFor the agent that works the tasks (the skill):\n${lines.slice(1).join("\n")}\n`;
23
+ }
24
+ const [name, ...args] = process.argv.slice(2);
25
+ if (!isName(name)) {
26
+ const asked = name === void 0 || name === "-h" || name === "--help" || name === "help";
27
+ (asked ? process.stdout : process.stderr).write(`${asked ? "" : `deictic: no command "${name}"\n\n`}${await help()}`);
28
+ process.exit(asked ? 0 : 1);
29
+ }
30
+ if (name !== "vb" && (args.includes("-h") || args.includes("--help"))) {
31
+ process.stdout.write(`Usage: deictic ${(await COMMANDS[name]()).usage}\n`);
32
+ process.exit(0);
33
+ }
34
+ await (await COMMANDS[name]()).run(args);
35
+ export {};
36
+
37
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +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, for the person; the rest are for the agent that works the tasks,\n * as the skill says: the board, a watch, a task, and what a task carries. Each in `cli/`, loaded when it's run, so\n * `deictic task` doesn't load the parser `init` edits configs with. Run in the project, where its board and\n * `.deictic/` are: `npx deictic <command>`.\n */\nconst COMMANDS = {\n init: () => import('./cli/init.ts'),\n vb: () => import('./cli/vb.ts'),\n watch: () => import('./cli/watch.ts'),\n task: () => import('./cli/task.ts'),\n recording: () => import('./cli/recording.ts'),\n frame: () => import('./cli/frame.ts'),\n voice: () => import('./cli/voice.ts'),\n transcribe: () => import('./cli/transcribe.ts'),\n};\n\ntype Name = keyof typeof COMMANDS;\nconst isName = (name: string | undefined): name is Name => name !== undefined && Object.hasOwn(COMMANDS, name);\n\nasync function help(): Promise<string> {\n const lines = await Promise.all(Object.values(COMMANDS).map(async (load) => ` ${(await load()).usage}`));\n return `Usage: deictic <command>\\n\\nSetting up:\\n${lines[0]}\\n\\nFor the agent that works the tasks (the skill):\\n${lines.slice(1).join('\\n')}\\n`;\n}\n\nconst [name, ...args] = process.argv.slice(2);\nif (!isName(name)) {\n const asked = name === undefined || name === '-h' || name === '--help' || name === 'help';\n (asked ? process.stdout : process.stderr).write(`${asked ? '' : `deictic: no command \"${name}\"\\n\\n`}${await help()}`);\n process.exit(asked ? 0 : 1);\n}\nif (name !== 'vb' && (args.includes('-h') || args.includes('--help'))) {\n process.stdout.write(`Usage: deictic ${(await COMMANDS[name]()).usage}\\n`);\n process.exit(0);\n}\nawait (await COMMANDS[name]()).run(args);\n"],"mappings":";;;;;;;;AAOA,MAAM,WAAW;CACf,YAAY,OAAO;CACnB,UAAU,OAAO;CACjB,aAAa,OAAO;CACpB,YAAY,OAAO;CACnB,iBAAiB,OAAO;CACxB,aAAa,OAAO;CACpB,aAAa,OAAO;CACpB,kBAAkB,OAAO;AAC3B;AAGA,MAAM,UAAU,SAA2C,SAAS,KAAA,KAAa,OAAO,OAAO,UAAU,IAAI;AAE7G,eAAe,OAAwB;CACrC,MAAM,QAAQ,MAAM,QAAQ,IAAI,OAAO,OAAO,QAAQ,CAAC,CAAC,IAAI,OAAO,SAAS,MAAM,MAAM,KAAK,EAAA,CAAG,OAAO,CAAC;CACxG,OAAO,4CAA4C,MAAM,GAAG,uDAAuD,MAAM,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;AAC/I;AAEA,MAAM,CAAC,MAAM,GAAG,QAAQ,QAAQ,KAAK,MAAM,CAAC;AAC5C,IAAI,CAAC,OAAO,IAAI,GAAG;CACjB,MAAM,QAAQ,SAAS,KAAA,KAAa,SAAS,QAAQ,SAAS,YAAY,SAAS;CACnF,CAAC,QAAQ,QAAQ,SAAS,QAAQ,OAAA,CAAQ,MAAM,GAAG,QAAQ,KAAK,wBAAwB,KAAK,SAAS,MAAM,KAAK,GAAG;CACpH,QAAQ,KAAK,QAAQ,IAAI,CAAC;AAC5B;AACA,IAAI,SAAS,SAAS,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,QAAQ,IAAI;CACrE,QAAQ,OAAO,MAAM,mBAAmB,MAAM,SAAS,KAAK,CAAC,EAAA,CAAG,MAAM,GAAG;CACzE,QAAQ,KAAK,CAAC;AAChB;AACA,OAAO,MAAM,SAAS,KAAK,CAAC,EAAA,CAAG,IAAI,IAAI"}
package/dist/index.js CHANGED
@@ -1,10 +1 @@
1
- // src/index.ts
2
- /** An op a plugin won't make. The message says why and what to do instead; the panel shows it. */
3
- var Refusal = class extends Error {
4
- name = "Refusal";
5
- };
6
- const definePlugin = (plugin) => plugin;
7
- const defineClientPlugin = (plugin) => plugin;
8
- export { Refusal, defineClientPlugin, definePlugin };
9
-
10
- //# sourceMappingURL=index.js.map
1
+ export { t as Refusal, n as defineClientPlugin, r as definePlugin } from "./shared/src.js";
@@ -1,4 +1,4 @@
1
- import { i as Recorded } from "../shared/index3.js";
1
+ import { i as Recorded } from "../shared/index4.js";
2
2
  declare const _default: import("deictic").ClientPlugin<never, never, Recorded>;
3
3
  export { _default as default };
4
4
  //# sourceMappingURL=client.d.ts.map
@@ -1,4 +1,4 @@
1
- import { defineClientPlugin } from "../index.js";
1
+ import { n as defineClientPlugin } from "../shared/src.js";
2
2
  // src/plugins/logs/client.ts
3
3
  /** The logs plugin's page half: rrweb's console plugin, imported as a recording first asks for it. */
4
4
  var client_default = defineClientPlugin({
@@ -1,18 +1,2 @@
1
- import { i as Recorded } from "../shared/index3.js";
2
- /** What of the console is kept: its methods, by name. */
3
- export type Level = 'assert' | 'count' | 'countReset' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'info' | 'log' | 'table' | 'time' | 'timeEnd' | 'timeLog' | 'trace' | 'warn';
4
- export interface LogsOptions {
5
- /**
6
- * The console's methods kept, `['warn', 'error']` for the least: every one that says something by default. Errors
7
- * nothing caught, and rejections nothing handled, come with `error`.
8
- */
9
- levels?: Level[];
10
- }
11
- declare module 'deictic' {
12
- interface ClientApis {
13
- logs: Recorded;
14
- }
15
- }
16
- export declare function logs(options?: LogsOptions): import("deictic").ServerPlugin<never, never, unknown, unknown>;
17
- export { logs as default };
18
- //# sourceMappingURL=index.d.ts.map
1
+ import { n as LogsOptions, r as logs, t as Level } from "../shared/index5.js";
2
+ export { Level, LogsOptions, logs as default, logs };
@@ -1,21 +1 @@
1
- import { definePlugin } from "../index.js";
2
- // src/plugins/logs/index.ts
3
- /**
4
- * `deictic/logs`: what the page logs while it's recorded, and the errors nothing caught, in the recording, each at
5
- * its moment. No tab, and nothing of its own: it hands the recordings plugin rrweb's console plugin
6
- * (`@rrweb/rrweb-plugin-console-record`, an optional peer), whose events are rrweb's (`rrweb/console@1`).
7
- *
8
- * A wrapped console names the wrapper, not the caller, as each line's source in the browser's tools. rrweb wraps it
9
- * as a recording starts and puts it back as it stops, so it's the page's own the rest of the time. Leave the plugin
10
- * out and it never is.
11
- */
12
- function logs(options = {}) {
13
- return definePlugin({
14
- name: "logs",
15
- client: "deictic/logs/client",
16
- clientOptions: { levels: options.levels }
17
- });
18
- }
19
- export { logs as default, logs };
20
-
21
- //# sourceMappingURL=index.js.map
1
+ export { t as default, t as logs } from "../shared/logs.js";
@@ -1,4 +1,4 @@
1
- import { i as Recorded } from "../shared/index3.js";
1
+ import { i as Recorded } from "../shared/index4.js";
2
2
  declare const _default: import("deictic").ClientPlugin<never, never, Recorded>;
3
3
  export { _default as default };
4
4
  //# sourceMappingURL=client.d.ts.map
@@ -1,4 +1,4 @@
1
- import { defineClientPlugin } from "../index.js";
1
+ import { n as defineClientPlugin } from "../shared/src.js";
2
2
  import { i as maskRequest } from "../shared/mask.js";
3
3
  // src/plugins/network/client.ts
4
4
  /**
@@ -1,2 +1,2 @@
1
- import { a as maskBody, c as maskUrl, i as MASKED, l as sensitive, n as Resolved, o as maskHeaders, r as network, s as maskRequest, t as NetworkOptions } from "../shared/index4.js";
1
+ import { a as maskBody, c as maskUrl, i as MASKED, l as sensitive, n as Resolved, o as maskHeaders, r as network, s as maskRequest, t as NetworkOptions } from "../shared/index6.js";
2
2
  export { MASKED, NetworkOptions, Resolved, network as default, network, maskBody, maskHeaders, maskRequest, maskUrl, sensitive };
@@ -1,39 +1,3 @@
1
- import { definePlugin } from "../index.js";
2
1
  import { a as maskUrl, i as maskRequest, n as maskBody, o as sensitive, r as maskHeaders, t as MASKED } from "../shared/mask.js";
3
- // src/plugins/network/index.ts
4
- /**
5
- * `deictic/network`: the requests the page makes while it's recorded, in the recording, each as it ends. No tab,
6
- * and nothing of its own: it hands the recordings plugin rrweb's network plugin
7
- * (`@rrweb/rrweb-plugin-network-record`, an optional peer), whose events are rrweb's (`rrweb/network@1`).
8
- *
9
- * By default a request is its URL, its status and its timing, which the browser reports of itself
10
- * (`PerformanceObserver`): nothing of the page's is wrapped, and no method is known. `headers` and `body` add those
11
- * and the method, for which rrweb wraps `fetch` and `XMLHttpRequest` while a recording is going, and only then.
12
- *
13
- * Everything kept is masked first (`mask.ts`): a secret in a URL's query, a header or a body's field is blanked by
14
- * its name, and deictic's own requests are left out.
15
- */
16
- /** The bodies kept with `body: true`: what reads as text. */
17
- const TEXT = [
18
- "application/json",
19
- "+json",
20
- "text/",
21
- "application/x-www-form-urlencoded",
22
- "application/xml"
23
- ];
24
- function network(options = {}) {
25
- return definePlugin({
26
- name: "network",
27
- client: "deictic/network/client",
28
- clientOptions: {
29
- initiators: options.initiators ?? ["fetch", "xmlhttprequest"],
30
- headers: options.headers ?? false,
31
- body: options.body === true ? TEXT : options.body ?? false,
32
- mask: options.mask ?? [],
33
- ignore: options.ignore ?? []
34
- }
35
- });
36
- }
2
+ import { t as network } from "../shared/network.js";
37
3
  export { MASKED, network as default, network, maskBody, maskHeaders, maskRequest, maskUrl, sensitive };
38
-
39
- //# sourceMappingURL=index.js.map
@@ -7,13 +7,13 @@
7
7
  * outside the preset (Tailwind, your own) goes beside it: `plugins: [...recommended(), tailwind()]`.
8
8
  */
9
9
  import { g as ServerPlugin } from "../shared/index.js";
10
- import { AnnotationsOptions } from "../annotations/index.js";
11
- import { LogsOptions } from "../logs/index.js";
12
- import { t as NetworkOptions } from "../shared/index4.js";
13
- import { c as RecordingsOptions } from "../shared/index3.js";
14
- import { l as ScreenshotsOptions } from "../shared/index2.js";
15
- import { p as TasksOptions } from "../shared/index5.js";
16
- import { VoiceOptions } from "../voice/index.js";
10
+ import { i as AnnotationsOptions } from "../shared/index2.js";
11
+ import { n as LogsOptions } from "../shared/index5.js";
12
+ import { t as NetworkOptions } from "../shared/index6.js";
13
+ import { c as RecordingsOptions } from "../shared/index4.js";
14
+ import { l as ScreenshotsOptions } from "../shared/index3.js";
15
+ import { p as TasksOptions } from "../shared/index7.js";
16
+ import { a as VoiceOptions } from "../shared/index8.js";
17
17
  /** Each plugin's options, by its name, or `false` to leave it out. */
18
18
  export interface RecommendedOptions {
19
19
  tasks?: TasksOptions | false;
@@ -1,26 +1 @@
1
- import { annotations } from "../annotations/index.js";
2
- import logs from "../logs/index.js";
3
- import network from "../network/index.js";
4
- import { t as recordings } from "../shared/recordings.js";
5
- import screenshots from "../screenshots/index.js";
6
- import { t as tasks } from "../shared/tasks.js";
7
- import voice from "../voice/index.js";
8
- // src/plugins/recommended/index.ts
9
- /**
10
- * Tasks, screenshots, annotations, recordings and voice, in that order, the order of their tabs, then what a
11
- * recording has besides the page: logs and network.
12
- */
13
- function recommended(options = {}) {
14
- const plugins = [];
15
- if (options.tasks !== false) plugins.push(tasks(options.tasks));
16
- if (options.screenshots !== false) plugins.push(screenshots(options.screenshots));
17
- if (options.annotations !== false) plugins.push(annotations(options.annotations));
18
- if (options.recordings !== false) plugins.push(recordings(options.recordings));
19
- if (options.voice !== false) plugins.push(voice(options.voice));
20
- if (options.recordings !== false && options.logs !== false) plugins.push(logs(options.logs));
21
- if (options.recordings !== false && options.network !== false) plugins.push(network(options.network));
22
- return plugins;
23
- }
24
- export { recommended as default, recommended };
25
-
26
- //# sourceMappingURL=index.js.map
1
+ export { t as default, t as recommended } from "../shared/recommended.js";
@@ -1,4 +1,4 @@
1
- import { a as Recorder } from "../shared/index3.js";
1
+ import { a as Recorder } from "../shared/index4.js";
2
2
  declare const _default: import("deictic").ClientPlugin<never, never, Recorder>;
3
3
  export { _default as default };
4
4
  //# sourceMappingURL=client.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { n as liveWaveform } from "../shared/waveform.js";
2
- import { defineClientPlugin } from "../index.js";
2
+ import { n as defineClientPlugin } from "../shared/src.js";
3
3
  import { n as MARKS, r as PAGE, t as END } from "../shared/marks.js";
4
4
  // src/plugins/recordings/ours.ts
5
5
  /** rrweb's numbers: an incremental snapshot, and the sources whose data is a list of pointer positions. */
@@ -1,2 +1,2 @@
1
- import { a as Recorder, c as RecordingsOptions, d as ReplaySources, f as replayPage, i as Recorded, l as VoiceClip, n as Meta, o as Recording, p as MARKS, r as RecordPlugin, s as Recordings, t as Kept, u as recordings } from "../shared/index3.js";
1
+ import { a as Recorder, c as RecordingsOptions, d as ReplaySources, f as replayPage, i as Recorded, l as VoiceClip, n as Meta, o as Recording, p as MARKS, r as RecordPlugin, s as Recordings, t as Kept, u as recordings } from "../shared/index4.js";
2
2
  export { Kept, MARKS, Meta, RecordPlugin, Recorded, Recorder, Recording, Recordings, RecordingsOptions, type ReplaySources, VoiceClip, recordings as default, recordings, replayPage };
@@ -1,4 +1,4 @@
1
- import { i as CaptureOptions, r as Capture, s as ResolvedMasking, t as Box } from "../shared/index2.js";
1
+ import { i as CaptureOptions, r as Capture, s as ResolvedMasking, t as Box } from "../shared/index3.js";
2
2
  /**
3
3
  * What a renderer's page half makes of the element: a body for `add`, its type, and where the element is
4
4
  * in the shot. `overlay(area)` is what's drawn over the page in that part of the viewport, in viewport CSS