deictic 0.0.1 → 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 (176) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +167 -0
  3. package/dist/annotations/client.d.ts +4 -0
  4. package/dist/annotations/client.d.ts.map +1 -0
  5. package/dist/annotations/client.js +497 -0
  6. package/dist/annotations/client.js.map +1 -0
  7. package/dist/annotations/index.d.ts +110 -0
  8. package/dist/annotations/index.d.ts.map +1 -0
  9. package/dist/annotations/index.js +22 -0
  10. package/dist/annotations/index.js.map +1 -0
  11. package/dist/astro.d.ts +29 -0
  12. package/dist/astro.d.ts.map +1 -0
  13. package/dist/astro.js +24 -0
  14. package/dist/astro.js.map +1 -0
  15. package/dist/bun.d.ts +12 -0
  16. package/dist/bun.d.ts.map +1 -0
  17. package/dist/bun.js +67 -0
  18. package/dist/bun.js.map +1 -0
  19. package/dist/client/index.d.ts +95 -0
  20. package/dist/client/index.d.ts.map +1 -0
  21. package/dist/client/index.js +1333 -0
  22. package/dist/client/index.js.map +1 -0
  23. package/dist/index.d.ts +23 -0
  24. package/dist/index.js +10 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/loader.d.ts +15 -0
  27. package/dist/loader.d.ts.map +1 -0
  28. package/dist/loader.js +17 -0
  29. package/dist/loader.js.map +1 -0
  30. package/dist/next.d.ts +17 -0
  31. package/dist/next.d.ts.map +1 -0
  32. package/dist/next.js +150 -0
  33. package/dist/next.js.map +1 -0
  34. package/dist/recommended/index.d.ts +25 -0
  35. package/dist/recommended/index.d.ts.map +1 -0
  36. package/dist/recommended/index.js +19 -0
  37. package/dist/recommended/index.js.map +1 -0
  38. package/dist/recordings/client.d.ts +4 -0
  39. package/dist/recordings/client.d.ts.map +1 -0
  40. package/dist/recordings/client.js +376 -0
  41. package/dist/recordings/client.js.map +1 -0
  42. package/dist/recordings/index.d.ts +2 -0
  43. package/dist/recordings/index.js +3 -0
  44. package/dist/screenshots/client.d.ts +23 -0
  45. package/dist/screenshots/client.d.ts.map +1 -0
  46. package/dist/screenshots/client.js +76 -0
  47. package/dist/screenshots/client.js.map +1 -0
  48. package/dist/screenshots/dom.d.ts +4 -0
  49. package/dist/screenshots/dom.d.ts.map +1 -0
  50. package/dist/screenshots/dom.js +92 -0
  51. package/dist/screenshots/dom.js.map +1 -0
  52. package/dist/screenshots/index.d.ts +2 -0
  53. package/dist/screenshots/index.js +98 -0
  54. package/dist/screenshots/index.js.map +1 -0
  55. package/dist/screenshots/rrweb.d.ts +9 -0
  56. package/dist/screenshots/rrweb.d.ts.map +1 -0
  57. package/dist/screenshots/rrweb.js +60 -0
  58. package/dist/screenshots/rrweb.js.map +1 -0
  59. package/dist/shared/endpoints.js +354 -0
  60. package/dist/shared/endpoints.js.map +1 -0
  61. package/dist/shared/index.d.ts +226 -0
  62. package/dist/shared/index.d.ts.map +1 -0
  63. package/dist/shared/index2.d.ts +98 -0
  64. package/dist/shared/index2.d.ts.map +1 -0
  65. package/dist/shared/index3.d.ts +86 -0
  66. package/dist/shared/index3.d.ts.map +1 -0
  67. package/dist/shared/index4.d.ts +184 -0
  68. package/dist/shared/index4.d.ts.map +1 -0
  69. package/dist/shared/index5.d.ts +70 -0
  70. package/dist/shared/index5.d.ts.map +1 -0
  71. package/dist/shared/integration.d.ts +20 -0
  72. package/dist/shared/integration.d.ts.map +1 -0
  73. package/dist/shared/integration.js +279 -0
  74. package/dist/shared/integration.js.map +1 -0
  75. package/dist/shared/kept.js +23 -0
  76. package/dist/shared/kept.js.map +1 -0
  77. package/dist/shared/marks.js +14 -0
  78. package/dist/shared/marks.js.map +1 -0
  79. package/dist/shared/playwright.js +105 -0
  80. package/dist/shared/playwright.js.map +1 -0
  81. package/dist/shared/recordings.js +246 -0
  82. package/dist/shared/recordings.js.map +1 -0
  83. package/dist/shared/shortcut.js +63 -0
  84. package/dist/shared/shortcut.js.map +1 -0
  85. package/dist/shared/tasks.js +521 -0
  86. package/dist/shared/tasks.js.map +1 -0
  87. package/dist/shared/waveform.js +93 -0
  88. package/dist/shared/waveform.js.map +1 -0
  89. package/dist/tailwind/client.d.ts +4 -0
  90. package/dist/tailwind/client.d.ts.map +1 -0
  91. package/dist/tailwind/client.js +613 -0
  92. package/dist/tailwind/client.js.map +1 -0
  93. package/dist/tailwind/index.d.ts +2 -0
  94. package/dist/tailwind/index.js +557 -0
  95. package/dist/tailwind/index.js.map +1 -0
  96. package/dist/tasks/client.d.ts +6 -0
  97. package/dist/tasks/client.d.ts.map +1 -0
  98. package/dist/tasks/client.js +642 -0
  99. package/dist/tasks/client.js.map +1 -0
  100. package/dist/tasks/index.d.ts +2 -0
  101. package/dist/tasks/index.js +1 -0
  102. package/dist/vite.d.ts +16 -0
  103. package/dist/vite.d.ts.map +1 -0
  104. package/dist/vite.js +61 -0
  105. package/dist/vite.js.map +1 -0
  106. package/dist/voice/client.d.ts +4 -0
  107. package/dist/voice/client.d.ts.map +1 -0
  108. package/dist/voice/client.js +66 -0
  109. package/dist/voice/client.js.map +1 -0
  110. package/dist/voice/index.d.ts +47 -0
  111. package/dist/voice/index.d.ts.map +1 -0
  112. package/dist/voice/index.js +74 -0
  113. package/dist/voice/index.js.map +1 -0
  114. package/dist/webpack.d.ts +50 -0
  115. package/dist/webpack.d.ts.map +1 -0
  116. package/dist/webpack.js +78 -0
  117. package/dist/webpack.js.map +1 -0
  118. package/package.json +307 -7
  119. package/skills/deictic/SKILL.md +47 -0
  120. package/skills/deictic/references/install.md +96 -0
  121. package/skills/deictic/references/recordings.md +83 -0
  122. package/skills/deictic/references/tasks.md +79 -0
  123. package/skills/deictic/references/watch.md +43 -0
  124. package/skills/deictic/scripts/frame.mjs +62 -0
  125. package/skills/deictic/scripts/lib.mjs +211 -0
  126. package/skills/deictic/scripts/recording.mjs +186 -0
  127. package/skills/deictic/scripts/task.mjs +84 -0
  128. package/skills/deictic/scripts/transcribe.mjs +93 -0
  129. package/skills/deictic/scripts/voice.mjs +50 -0
  130. package/skills/deictic/scripts/watch.mjs +51 -0
  131. package/src/astro.ts +34 -0
  132. package/src/bun.ts +79 -0
  133. package/src/client/index.ts +846 -0
  134. package/src/client/lightbox.ts +256 -0
  135. package/src/client/style.ts +243 -0
  136. package/src/client/tooltip.ts +78 -0
  137. package/src/client/waveform.ts +98 -0
  138. package/src/index.ts +247 -0
  139. package/src/loader.ts +28 -0
  140. package/src/next.ts +133 -0
  141. package/src/plugins/annotations/client.ts +301 -0
  142. package/src/plugins/annotations/draw.ts +169 -0
  143. package/src/plugins/annotations/index.ts +105 -0
  144. package/src/plugins/annotations/svg.ts +61 -0
  145. package/src/plugins/recommended/index.ts +35 -0
  146. package/src/plugins/recordings/client.ts +316 -0
  147. package/src/plugins/recordings/index.ts +175 -0
  148. package/src/plugins/recordings/marks.ts +11 -0
  149. package/src/plugins/recordings/ours.ts +70 -0
  150. package/src/plugins/recordings/replay.ts +165 -0
  151. package/src/plugins/screenshots/client.ts +64 -0
  152. package/src/plugins/screenshots/dom.ts +79 -0
  153. package/src/plugins/screenshots/index.ts +194 -0
  154. package/src/plugins/screenshots/playwright.ts +119 -0
  155. package/src/plugins/screenshots/rrweb.ts +45 -0
  156. package/src/plugins/tailwind/catalog.ts +396 -0
  157. package/src/plugins/tailwind/client.ts +669 -0
  158. package/src/plugins/tailwind/index.ts +267 -0
  159. package/src/plugins/tasks/client.ts +622 -0
  160. package/src/plugins/tasks/index.ts +557 -0
  161. package/src/plugins/tasks/local.ts +170 -0
  162. package/src/plugins/voice/client.ts +58 -0
  163. package/src/plugins/voice/index.ts +114 -0
  164. package/src/shortcut.ts +83 -0
  165. package/src/tools/astro.ts +81 -0
  166. package/src/tools/editor.ts +22 -0
  167. package/src/tools/endpoints.ts +163 -0
  168. package/src/tools/history.ts +203 -0
  169. package/src/tools/integration.ts +108 -0
  170. package/src/tools/kept.ts +21 -0
  171. package/src/tools/locate.ts +94 -0
  172. package/src/tools/plugins.ts +41 -0
  173. package/src/tools/source.ts +72 -0
  174. package/src/vite.ts +81 -0
  175. package/src/webpack.ts +107 -0
  176. package/index.js +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Gokhan Kurt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,167 @@
1
+ # deictic
2
+
3
+ Point at an element in your running app and leave a task about it, for you, a teammate or an agent to work.
4
+
5
+ Hold **Alt** and point: the element is outlined with its tag and the file and line that rendered it. **Alt-click**,
6
+ say what should change, and attach a screenshot to draw on, a screen recording or a voice note. The task goes to a
7
+ [Vercel Board](https://vercel.com/docs/board) with everything an agent needs to find the code: the element's
8
+ `file:line:column`, the page and the viewport.
9
+
10
+ It runs in your dev server only. A production build has none of it.
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npm install -D deictic @vercel/board rrweb rrweb-player rrweb-snapshot playwright-core
16
+ ```
17
+
18
+ Then add it to your bundler. `recommended()` is the plugins for tasks: tasks, screenshots, annotations, recordings
19
+ and voice.
20
+
21
+ ```ts
22
+ // vite.config.ts (and anything on Vite: React Router, TanStack Start…)
23
+ import { recommended } from 'deictic/recommended';
24
+ import { deictic } from 'deictic/vite';
25
+
26
+ export default defineConfig({
27
+ plugins: [react(), deictic({ plugins: recommended() })],
28
+ });
29
+ ```
30
+
31
+ | Bundler | Setup |
32
+ | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
33
+ | Next.js (`next dev`) | `export default withDeictic(nextConfig, { plugins: recommended() })`, from `deictic/next` |
34
+ | webpack 5, Rspack | `plugins: [new DeicticPlugin({ plugins: recommended() })]`, from `deictic/webpack` (`launch-editor` to open files) |
35
+ | Astro | `integrations: [deictic({ plugins: recommended() })]`, from `deictic/astro` (`.astro` components with Astro 7; JSX islands with any) |
36
+ | Bun (`Bun.serve`, HTML imports) | `deictic({ plugins: recommended() })` from `deictic/bun`, named in `bunfig.toml`'s `[serve.static] plugins`, its `routes` spread into `Bun.serve`'s |
37
+
38
+ Screenshots render in a Chromium: Playwright's (`npx playwright install chromium`), else Chrome or Edge. React
39
+ Native isn't supported: there's no DOM to point at.
40
+
41
+ ## Tasks
42
+
43
+ Tasks go to a board the dev server starts on your machine, with nothing to set up: `http://127.0.0.1:4100/`, kept
44
+ in `.deictic/board`. For a board of your own, name it, or pass your team's:
45
+
46
+ ```bash
47
+ BOARD_URL=https://team.example/api/board vite # any board, by its URL
48
+ ```
49
+
50
+ ```ts
51
+ recommended({ tasks: { board: board() } }); // your team's, from `@vercel/board`, after `vercel login`
52
+ recommended({ tasks: { board: local({ port: 4200 }) } }); // the one on your machine, from `deictic/tasks`
53
+ ```
54
+
55
+ `local()` is the default board whatever `BOARD_URL` says, with options: `port`, `dir` (its folder, from the root),
56
+ `inspect: false` for none of its own pages, and `args`, more of `vb serve`'s.
57
+
58
+ Whoever works the channel (`deictic` by default) takes it from there. For an agent, deictic comes with a skill that
59
+ watches the channel and works each task as it arrives, with scripts that read a task, turn a recording into a
60
+ timeline, screenshot it at any moment, and transcribe its voice notes:
61
+
62
+ ```bash
63
+ npx skills add ./node_modules/deictic
64
+ ```
65
+
66
+ In the Task tab, **Attach** adds a screenshot of the page, **Annotate** opens it to draw boxes, arrows and notes on,
67
+ **Record** records the page as you use it (drawing as you go, with the mic on if you like), and **Voice** records a
68
+ note. Each is a chip that opens in a lightbox. The panel lists the tasks already about the element: each one's ID opens it
69
+ on the board, and one no one has claimed yet can be edited or deleted there (deleting cancels it on the board). Undo
70
+ takes any of it back. The page hears of each task added as a `deictic:task` event on `window`, its `detail` the task's ID,
71
+ title, element and what was attached.
72
+
73
+ ## Options
74
+
75
+ Each plugin takes its options under its name, and `false` leaves one out. Other plugins, your own included, go
76
+ beside the preset:
77
+
78
+ ```ts
79
+ deictic({
80
+ shortcut: { modifiers: ['Control', 'Shift'] }, // instead of Alt; `false` for none
81
+ plugins: recommended({
82
+ tasks: { channel: 'ui', project: 'storefront', labels: { team: 'web' } },
83
+ screenshots: { maskAllInputs: true },
84
+ voice: false,
85
+ }),
86
+ });
87
+ ```
88
+
89
+ A task is the words typed and its attachments (with none typed, a line naming what's attached); the rest is labels: `deictic.project` (the `project` option, or by
90
+ default your `package.json`'s name, to tell projects apart on one board), `deictic.at`, `deictic.url`,
91
+ `deictic.viewport` and more, and your own `labels` beside them.
92
+
93
+ Screenshots and recordings hide what [rrweb](https://github.com/rrweb-io/rrweb) would, by its names: `rr-block`
94
+ blanks an element, `rr-mask` masks its text, `maskAllInputs` masks every field (passwords always are). Nothing of
95
+ deictic's own UI is in them. What a project keeps (the history, shots, recordings, voice notes) is in `.deictic/`,
96
+ which ignores itself in git.
97
+
98
+ A build has nothing of deictic. To show it on a deployed page with no dev server (a demo), `deictic/vite` takes
99
+ `standalone`, a module of the page's whose default export answers the overlay's requests there:
100
+
101
+ ```ts
102
+ // vite.config.ts
103
+ deictic({ plugins, standalone: 'src/standalone.ts' });
104
+
105
+ // src/standalone.ts: a request the dev server would get under `/__deictic/`, and its answer
106
+ import type { Standalone } from 'deictic';
107
+ export default (async (request) => Response.json({ model: null })) satisfies Standalone;
108
+ ```
109
+
110
+ What a plugin's `add` route would keep, the module keeps, and answers with the `url` it's at. A recording's is a
111
+ replay page for the build to publish: `replayPage({ player, source })` from `deictic/recordings` is its HTML.
112
+
113
+ ## How it works
114
+
115
+ - A transform that runs before the framework's own adds `data-deictic="src/App.tsx:12:5"` to every host element
116
+ (`div`, `button`) in `.jsx`, `.tsx` and `.js` modules and in `.astro` components, so it works for any framework
117
+ that compiles JSX, server components too, and points at the element's own tag rather than the component around it.
118
+ - Its endpoints are on the dev server's own origin, `/__deictic/*`, and take writes only as same-origin JSON, so no
119
+ other site can make them and no token reaches the page.
120
+ - Every change goes into one history in `.deictic/history.json`. The popup's undo and redo walk the part of it that
121
+ is the open tab's on the element it's open on. A plugin's own change, a task, is undone by the plugin.
122
+
123
+ ## Writing a plugin
124
+
125
+ A plugin has a server half, which runs beside the bundler, and a page half, which can draw a tab in the popup.
126
+ Every part is optional but its `name`.
127
+
128
+ ```ts
129
+ // my-plugin/index.ts
130
+ import { definePlugin } from 'deictic';
131
+
132
+ export const notes = () =>
133
+ definePlugin<Model, Op>({
134
+ name: 'notes',
135
+ client: 'my-plugin/client', // the page half, which the page imports
136
+ read: ({ element }) => ({ … }), // what the tab shows for the element
137
+ apply: (source, target, op) => [{ start, end, text }], // edits to the file, written by deictic, undoable
138
+ });
139
+
140
+ // my-plugin/client.ts
141
+ import { defineClientPlugin } from 'deictic';
142
+
143
+ export default defineClientPlugin<Model, Op>({
144
+ name: 'notes',
145
+ label: 'Notes',
146
+ mount(panel, { model, element, apply }) {
147
+ // draw into `panel`; `apply(op)` writes, and answers the model read again
148
+ },
149
+ });
150
+ ```
151
+
152
+ Plugins add routes to the dev server (`routes`), set up an API for others (`setup`), and reach each other's with
153
+ `context.use(name)`: that's how tasks attaches screenshots and recordings. A change that isn't to a file answers
154
+ `{ done: record }`, and the plugin's `undo` and `redo` get the record back. The types in `deictic`'s index document
155
+ each part.
156
+
157
+ ## Develop
158
+
159
+ ```bash
160
+ bun install
161
+ bun dev # build, then the site on http://localhost:5180, with a board on this machine for its tasks
162
+ bun run test # bun test, on the source
163
+ bun run checks # lint + format check + type check + test
164
+ ```
165
+
166
+ `examples/` has the same page on Vite, Next, Rspack and Bun (`bun run dev` in each, after a build). `/internal/` on
167
+ the site pins deictic's own popup open at each tab, to leave tasks about deictic itself.
@@ -0,0 +1,4 @@
1
+ import { Annotations } from "./index.js";
2
+ declare const _default: import("deictic").ClientPlugin<null, never, Annotations>;
3
+ export { _default as default };
4
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","names":[],"sources":["../../src/plugins/annotations/client.ts"],"mappings":";cA+PA,4B"}