@visulima/dev-toolbar 1.0.0-alpha.4 → 1.0.0-alpha.40

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 (175) hide show
  1. package/CHANGELOG.md +321 -0
  2. package/LICENSE.md +137 -5
  3. package/README.md +75 -18
  4. package/bin/mcp.js +29 -0
  5. package/dist/apps/a11y/index.d.ts +3 -2
  6. package/dist/apps/a11y/index.js +21 -2
  7. package/dist/apps/annotations/index.d.ts +4 -0
  8. package/dist/apps/annotations/index.js +18 -0
  9. package/dist/apps/assets/index.d.ts +4 -0
  10. package/dist/apps/assets/index.js +16 -0
  11. package/dist/apps/inspector/index.d.ts +3 -2
  12. package/dist/apps/inspector/index.js +30 -1
  13. package/dist/apps/module-graph/index.d.ts +3 -2
  14. package/dist/apps/module-graph/index.js +20 -1
  15. package/dist/apps/performance/index.d.ts +3 -2
  16. package/dist/apps/performance/index.js +17 -1
  17. package/dist/apps/seo/index.d.ts +3 -2
  18. package/dist/apps/seo/index.js +17 -1
  19. package/dist/apps/settings/index.d.ts +3 -2
  20. package/dist/apps/settings/index.js +17 -1
  21. package/dist/apps/tailwind/index.d.ts +3 -2
  22. package/dist/apps/tailwind/index.js +5 -5
  23. package/dist/apps/timeline/index.d.ts +3 -2
  24. package/dist/apps/timeline/index.js +18 -1
  25. package/dist/apps/vite-config/index.d.ts +3 -2
  26. package/dist/apps/vite-config/index.js +16 -1
  27. package/dist/client/overlay.d.ts +1 -1
  28. package/dist/client/overlay.js +1 -1
  29. package/dist/index.d.ts +133 -8
  30. package/dist/index.js +1 -1
  31. package/dist/mcp/server.d.ts +2 -0
  32. package/dist/mcp/server.js +1 -0
  33. package/dist/packem_chunks/inject-source.js +7 -1
  34. package/dist/packem_shared/Alert-CZq7C43v.js +1 -0
  35. package/dist/packem_shared/Badge-PpblpNWg.js +1 -0
  36. package/dist/packem_shared/Button-CAKvtfij.js +1 -0
  37. package/dist/packem_shared/Card-BSy2oRiS.js +1 -0
  38. package/dist/packem_shared/Icon-0XYV-4AL.js +1 -0
  39. package/dist/packem_shared/Input-Dc1WiT01.js +1 -0
  40. package/dist/packem_shared/Label-BZh8XxUb.js +1 -0
  41. package/dist/packem_shared/Popover-DuiU8EPg.js +1 -0
  42. package/dist/packem_shared/Progress-C90LC--2.js +1 -0
  43. package/dist/packem_shared/Select-CwD-d0pi.js +1 -0
  44. package/dist/packem_shared/Separator-PSjfhX_W.js +1 -0
  45. package/dist/packem_shared/Skeleton-BAFrGUR1.js +1 -0
  46. package/dist/packem_shared/Switch-Wpsp5M3p.js +1 -0
  47. package/dist/packem_shared/Tabs-BdNFQd3c.js +1 -0
  48. package/dist/packem_shared/Textarea-DP9gpte-.js +1 -0
  49. package/dist/packem_shared/Tooltip-DVeuszoY.js +1 -0
  50. package/dist/packem_shared/annotation-settings-DlLZO5Zp.js +1 -0
  51. package/dist/packem_shared/annotation-store-CXMIg0dM.js +1 -0
  52. package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
  53. package/dist/packem_shared/clsx-CtZWcPHt.js +1 -0
  54. package/dist/packem_shared/createClientRPCContext-80V9c3Qu.js +1 -0
  55. package/dist/packem_shared/createDevToolbarHook-CzejbqD2.js +1 -0
  56. package/dist/packem_shared/createServerRPCContext-C30tqEfQ.js +1 -0
  57. package/dist/packem_shared/getGlobalHook-GRSqUNJ3.js +1 -0
  58. package/dist/packem_shared/getTimelineStore-BT5sImVb.js +1 -0
  59. package/dist/packem_shared/global-api.d-DeaCvII9.d.ts +546 -0
  60. package/dist/packem_shared/loadSettings-C0pUyx9j.js +1 -0
  61. package/dist/packem_shared/server.d-ZkcY0pge.d.ts +39 -0
  62. package/dist/packem_shared/sharedToolbarStylesheet-DNABzHAf.js +2 -0
  63. package/dist/packem_shared/store-Dqy0FbGw.js +1 -0
  64. package/dist/packem_shared/use-theme-DIqZkPAe.js +1 -0
  65. package/dist/toolbar/index.d.ts +152 -49
  66. package/dist/toolbar/index.js +3 -3
  67. package/dist/ui/index.d.ts +382 -17
  68. package/dist/ui/index.js +1 -1
  69. package/dist/vite-plugin.d.ts +183 -141
  70. package/dist/vite-plugin.js +5 -2
  71. package/package.json +41 -22
  72. package/dist/apps/a11y/a11y-app.d.ts +0 -5
  73. package/dist/apps/a11y/a11y-store.d.ts +0 -42
  74. package/dist/apps/a11y/a11y-tooltip.d.ts +0 -11
  75. package/dist/apps/inspector/inspector-app.d.ts +0 -12
  76. package/dist/apps/module-graph/module-graph-app.d.ts +0 -5
  77. package/dist/apps/more/index.d.ts +0 -3
  78. package/dist/apps/more/index.js +0 -2
  79. package/dist/apps/more/more-app.d.ts +0 -5
  80. package/dist/apps/performance/performance-app.d.ts +0 -5
  81. package/dist/apps/performance/performance-tooltip.d.ts +0 -5
  82. package/dist/apps/seo/seo-app.d.ts +0 -5
  83. package/dist/apps/settings/settings-app.d.ts +0 -4
  84. package/dist/apps/tailwind/tailwind-app.d.ts +0 -5
  85. package/dist/apps/timeline/timeline-app.d.ts +0 -5
  86. package/dist/apps/vite-config/vite-config-app.d.ts +0 -5
  87. package/dist/hooks/create-hook.d.ts +0 -12
  88. package/dist/hooks/events.d.ts +0 -7
  89. package/dist/hooks/global-hook.d.ts +0 -15
  90. package/dist/hooks/index.d.ts +0 -6
  91. package/dist/packem_shared/Alert-H-x1JuZ0.js +0 -1
  92. package/dist/packem_shared/Badge-C30mDKKG.js +0 -1
  93. package/dist/packem_shared/Button-DODNCTPZ.js +0 -1
  94. package/dist/packem_shared/Card-DdI7Wn3t.js +0 -1
  95. package/dist/packem_shared/Icon-DWFLZkwW.js +0 -1
  96. package/dist/packem_shared/Input-GfbOwAkK.js +0 -1
  97. package/dist/packem_shared/Label-Bzi47aUf.js +0 -1
  98. package/dist/packem_shared/Popover-CLt7YhUF.js +0 -1
  99. package/dist/packem_shared/Progress-vGfFpxRn.js +0 -1
  100. package/dist/packem_shared/Separator-DQGeJPQg.js +0 -1
  101. package/dist/packem_shared/Skeleton-BYXau6jM.js +0 -1
  102. package/dist/packem_shared/Switch-BeC78S_T.js +0 -1
  103. package/dist/packem_shared/Tabs-CXERaeAp.js +0 -1
  104. package/dist/packem_shared/Textarea-DvbSX13V.js +0 -1
  105. package/dist/packem_shared/Tooltip-tlBN-NdK.js +0 -1
  106. package/dist/packem_shared/cn-DWLJYh3h.js +0 -1
  107. package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +0 -1
  108. package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +0 -1
  109. package/dist/packem_shared/createServerRPCContext-CEm1Ymkn.js +0 -1
  110. package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +0 -1
  111. package/dist/packem_shared/loadSettings-hvjR4fcS.js +0 -1
  112. package/dist/packem_shared/setupGlobalHook-CCf9Logv.js +0 -1
  113. package/dist/packem_shared/sharedToolbarStylesheet-DOV-Jwcm.js +0 -2
  114. package/dist/packem_shared/store-DaUtLjf3.js +0 -1
  115. package/dist/packem_shared/use-theme-BOw3dPpY.js +0 -1
  116. package/dist/performance/monitor.d.ts +0 -116
  117. package/dist/rpc/client.d.ts +0 -9
  118. package/dist/rpc/functions/module-graph.d.ts +0 -17
  119. package/dist/rpc/functions/open-in-editor.d.ts +0 -16
  120. package/dist/rpc/functions/tailwind-config.d.ts +0 -15
  121. package/dist/rpc/functions/vite-config.d.ts +0 -9
  122. package/dist/rpc/server.d.ts +0 -15
  123. package/dist/timeline/capture.d.ts +0 -8
  124. package/dist/timeline/index.d.ts +0 -8
  125. package/dist/timeline/store.d.ts +0 -42
  126. package/dist/toolbar/app-manager.d.ts +0 -104
  127. package/dist/toolbar/components/app-button.d.ts +0 -19
  128. package/dist/toolbar/components/app-canvas.d.ts +0 -12
  129. package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -12
  130. package/dist/toolbar/components/first-visit-hint.d.ts +0 -16
  131. package/dist/toolbar/components/index.d.ts +0 -4
  132. package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -22
  133. package/dist/toolbar/components/toolbar-bar.d.ts +0 -14
  134. package/dist/toolbar/components/toolbar-container.d.ts +0 -55
  135. package/dist/toolbar/components/vite-overlay-button.d.ts +0 -14
  136. package/dist/toolbar/context/index.d.ts +0 -2
  137. package/dist/toolbar/context/toolbar-context.d.ts +0 -107
  138. package/dist/toolbar/global-api.d.ts +0 -24
  139. package/dist/toolbar/helpers.d.ts +0 -8
  140. package/dist/toolbar/hooks/index.d.ts +0 -10
  141. package/dist/toolbar/hooks/use-apps.d.ts +0 -15
  142. package/dist/toolbar/hooks/use-frame-state.d.ts +0 -100
  143. package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -23
  144. package/dist/toolbar/hooks/use-position.d.ts +0 -24
  145. package/dist/toolbar/hooks/use-theme.d.ts +0 -15
  146. package/dist/toolbar/hooks/use-toolbar.d.ts +0 -16
  147. package/dist/toolbar/settings.d.ts +0 -17
  148. package/dist/toolbar/stylesheet.d.ts +0 -3
  149. package/dist/toolbar/utils/index.d.ts +0 -12
  150. package/dist/types/app.d.ts +0 -175
  151. package/dist/types/global-api.d.ts +0 -91
  152. package/dist/types/hooks.d.ts +0 -86
  153. package/dist/types/index.d.ts +0 -12
  154. package/dist/types/messaging.d.ts +0 -43
  155. package/dist/types/rpc.d.ts +0 -97
  156. package/dist/types/timeline.d.ts +0 -62
  157. package/dist/types/toolbar.d.ts +0 -56
  158. package/dist/ui/components/alert.d.ts +0 -20
  159. package/dist/ui/components/badge.d.ts +0 -10
  160. package/dist/ui/components/button.d.ts +0 -12
  161. package/dist/ui/components/card.d.ts +0 -17
  162. package/dist/ui/components/icon.d.ts +0 -20
  163. package/dist/ui/components/input.d.ts +0 -8
  164. package/dist/ui/components/label.d.ts +0 -8
  165. package/dist/ui/components/popover.d.ts +0 -27
  166. package/dist/ui/components/progress.d.ts +0 -8
  167. package/dist/ui/components/separator.d.ts +0 -9
  168. package/dist/ui/components/skeleton.d.ts +0 -7
  169. package/dist/ui/components/switch.d.ts +0 -12
  170. package/dist/ui/components/tabs.d.ts +0 -29
  171. package/dist/ui/components/textarea.d.ts +0 -8
  172. package/dist/ui/components/tooltip.d.ts +0 -19
  173. package/dist/utils/cn.d.ts +0 -8
  174. package/dist/vite/inject-source.d.ts +0 -24
  175. package/dist/vite/matcher.d.ts +0 -6
@@ -0,0 +1,546 @@
1
+ import { D as DevToolbarApp, T as ToolbarSettings } from "./app.d-SmKEDxsI.js";
2
+ import { ViteDevServer } from 'vite';
3
+ /**
4
+ * Severity levels for timeline events.
5
+ */
6
+ type TimelineEventLevel = "info" | "warning" | "error";
7
+ /**
8
+ * A single captured event displayed in the timeline panel.
9
+ */
10
+ interface TimelineEvent {
11
+ /**
12
+ * Optional event data
13
+ */
14
+ data?: Record<string, any>;
15
+ /**
16
+ * Optional duration (milliseconds)
17
+ */
18
+ duration?: number;
19
+ /**
20
+ * Unique event ID
21
+ */
22
+ id: string;
23
+ /**
24
+ * Event level
25
+ */
26
+ level?: TimelineEventLevel;
27
+ /**
28
+ * Optional subtitle
29
+ */
30
+ subtitle?: string;
31
+ /**
32
+ * Timestamp (milliseconds since epoch)
33
+ */
34
+ time: number;
35
+ /**
36
+ * Event title
37
+ */
38
+ title: string;
39
+ }
40
+ /**
41
+ * A named group that holds related timeline events.
42
+ */
43
+ interface TimelineGroup {
44
+ /**
45
+ * Group color (hex or CSS color)
46
+ */
47
+ color?: string;
48
+ /**
49
+ * Events in this group
50
+ */
51
+ events: TimelineEvent[];
52
+ /**
53
+ * Group ID
54
+ */
55
+ id: string;
56
+ /**
57
+ * Group label
58
+ */
59
+ label: string;
60
+ }
61
+ /**
62
+ * Default timeline groups
63
+ */
64
+ declare const DEFAULT_TIMELINE_GROUPS: ReadonlyArray<TimelineGroup>;
65
+ /**
66
+ * Hook event definitions
67
+ */
68
+ interface HookEvents {
69
+ [key: string]: (...args: any[]) => void;
70
+ /**
71
+ * App error occurred.
72
+ * @param error Error object.
73
+ * @param appId Optional app ID where error occurred.
74
+ */
75
+ "app:error": (error: Error, appId?: string) => void;
76
+ /**
77
+ * DevTools closed.
78
+ */
79
+ "devtools:close": () => void;
80
+ /**
81
+ * DevTools initialized.
82
+ */
83
+ "devtools:init": () => void;
84
+ /**
85
+ * DevTools opened.
86
+ * @param appId ID of the opened app.
87
+ */
88
+ "devtools:open": (appId: string) => void;
89
+ /**
90
+ * Timeline event added.
91
+ * @param event Timeline event.
92
+ */
93
+ "timeline:event": (event: TimelineEvent) => void;
94
+ }
95
+ /**
96
+ * Dev toolbar hook interface.
97
+ * Exposed as window.__DEV_TOOLBAR_HOOK__
98
+ */
99
+ interface DevToolbarHook {
100
+ /**
101
+ * Adds a timeline event.
102
+ * @param groupId Timeline group ID.
103
+ * @param event Timeline event.
104
+ */
105
+ addTimelineEvent: (groupId: string, event: TimelineEvent) => void;
106
+ /**
107
+ * Emits an event.
108
+ * @param event Event name.
109
+ * @param args Event arguments.
110
+ */
111
+ emit: <T extends keyof HookEvents>(event: T, ...args: Parameters<HookEvents[T]>) => void;
112
+ /**
113
+ * Unsubscribes from an event.
114
+ * @param event Event name.
115
+ * @param handler Optional specific handler to remove.
116
+ */
117
+ off: <T extends keyof HookEvents>(event: T, handler?: HookEvents[T]) => void;
118
+ /**
119
+ * Subscribes to an event.
120
+ * @param event Event name.
121
+ * @param handler Event handler.
122
+ * @returns Unsubscribe function.
123
+ */
124
+ on: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => () => void;
125
+ /**
126
+ * Subscribes to an event once.
127
+ * @param event Event name.
128
+ * @param handler Event handler.
129
+ */
130
+ once: <T extends keyof HookEvents>(event: T, handler: HookEvents[T]) => void;
131
+ /**
132
+ * Registers a custom app.
133
+ * @param app App definition.
134
+ */
135
+ registerApp: (app: DevToolbarApp) => void;
136
+ }
137
+ /**
138
+ * Global hook declaration
139
+ */
140
+ declare global$1 {
141
+ interface Window {
142
+ /**
143
+ * Dev toolbar hook for library integrations.
144
+ */
145
+ __DEV_TOOLBAR_HOOK__?: DevToolbarHook;
146
+ }
147
+ }
148
+ interface StaticAsset {
149
+ /** Last-modified timestamp (ms since epoch) */
150
+ mtime: number;
151
+ /** Public URL path (e.g. "/images/logo.png") */
152
+ publicPath: string;
153
+ /** File size in bytes */
154
+ size: number;
155
+ /** Asset type category */
156
+ type: "audio" | "font" | "image" | "other" | "text" | "video";
157
+ }
158
+ interface SerializableModuleNode {
159
+ id: string;
160
+ importerCount: number;
161
+ importerUrls: string[];
162
+ url: string;
163
+ }
164
+ interface TailwindConfigResult {
165
+ /** CSS files that \@import tailwindcss */
166
+ cssFiles: string[];
167
+ /** User-defined \@theme overrides/extensions */
168
+ customTheme: Record<string, string>;
169
+ /** Full default Tailwind theme tokens */
170
+ defaultTheme: Record<string, string>;
171
+ /** Detected Tailwind version */
172
+ version: "v3" | "v4" | "unknown";
173
+ }
174
+ /**
175
+ * Annotation intent — describes what the user wants to communicate.
176
+ */
177
+ type AnnotationIntent = "approve" | "change" | "fix" | "question";
178
+ /**
179
+ * Annotation severity — how urgent or important the annotation is.
180
+ */
181
+ type AnnotationSeverity = "blocking" | "important" | "suggestion";
182
+ /**
183
+ * Annotation status — lifecycle state.
184
+ */
185
+ type AnnotationStatus = "acknowledged" | "dismissed" | "pending" | "resolved";
186
+ /**
187
+ * A single message in a conversation thread attached to an annotation.
188
+ */
189
+ interface ThreadMessage {
190
+ /** Message text */
191
+ content: string;
192
+ /** Unique message identifier */
193
+ id?: string;
194
+ /** Who wrote it — e.g. "human", "agent", or a specific agent name */
195
+ role: string;
196
+ /** ISO 8601 timestamp */
197
+ timestamp: string;
198
+ }
199
+ /**
200
+ * Bounding box of the annotated element relative to the viewport.
201
+ */
202
+ interface BoundingBox {
203
+ height: number;
204
+ width: number;
205
+ x: number;
206
+ y: number;
207
+ }
208
+ /**
209
+ * Detected framework component information.
210
+ */
211
+ interface FrameworkContext {
212
+ /** Component name */
213
+ componentName?: string;
214
+ /** Full component stack (e.g. ["App", "Layout", "Header", "Button"]) */
215
+ componentStack?: string[];
216
+ /** Additional framework-specific data (e.g. props) */
217
+ data?: Record<string, unknown>;
218
+ /** Framework identifier (react, vue, svelte, etc.) */
219
+ framework: string;
220
+ /** Source file path */
221
+ sourceFile?: string;
222
+ /** Source line number */
223
+ sourceLine?: number;
224
+ }
225
+ /**
226
+ * Captured accessibility attributes for an element.
227
+ */
228
+ interface AccessibilityInfo {
229
+ /** aria-describedby content */
230
+ ariaDescribedBy?: string;
231
+ /** aria-label value */
232
+ ariaLabel?: string;
233
+ /** Whether the element is focusable */
234
+ focusable: boolean;
235
+ /** ARIA role (explicit or implicit) */
236
+ role?: string;
237
+ /** tabindex value */
238
+ tabindex?: number;
239
+ }
240
+ /**
241
+ * A visual annotation placed on a page element during development.
242
+ * Stored in `.devtoolbar/annotations.json`.
243
+ */
244
+ interface Annotation {
245
+ /** Captured accessibility attributes */
246
+ accessibility?: AccessibilityInfo;
247
+ /** Element bounding box at annotation time */
248
+ boundingBox?: BoundingBox;
249
+ /** User feedback / description */
250
+ comment: string;
251
+ /** Key computed CSS properties for forensic context */
252
+ computedStyles?: string;
253
+ /** ISO 8601 creation timestamp */
254
+ createdAt: string;
255
+ /** CSS classes on the annotated element (module hashes cleaned) */
256
+ cssClasses?: string;
257
+ /** Bounding boxes for multi-select annotations */
258
+ elementBoundingBoxes?: BoundingBox[];
259
+ /** Human-readable element label (e.g. 'button "Submit"') */
260
+ elementLabel?: string;
261
+ /** CSS selector path to the element */
262
+ elementPath?: string;
263
+ /** HTML tag name of the annotated element */
264
+ elementTag: string;
265
+ /** Detected framework component context */
266
+ frameworkContext?: FrameworkContext;
267
+ /** Full DOM ancestry path (e.g. "body > main > article > p") */
268
+ fullPath?: string;
269
+ /** Unique identifier (crypto.randomUUID) */
270
+ id: string;
271
+ /** What the user wants — fix, change, question, or approve */
272
+ intent: AnnotationIntent;
273
+ /** Whether the element has fixed/sticky positioning */
274
+ isFixed?: boolean;
275
+ /** Whether this is a multi-select (drag) annotation */
276
+ isMultiSelect?: boolean;
277
+ /** Sibling elements for spatial context */
278
+ nearbyElements?: string;
279
+ /** Text near the annotated element for additional context */
280
+ nearbyText?: string;
281
+ /** ISO 8601 resolution timestamp */
282
+ resolvedAt?: string;
283
+ /** Who resolved it — "human" or "agent" (or a specific agent name) */
284
+ resolvedBy?: string;
285
+ /** Path to screenshot file relative to .devtoolbar/ (e.g. "screenshots/&lt;id>.png") */
286
+ screenshot?: string;
287
+ /** Text the user had selected when annotating */
288
+ selectedText?: string;
289
+ /** Severity level */
290
+ severity: AnnotationSeverity;
291
+ /** Source file location from data-vdt-source (file:line:col) */
292
+ source?: string;
293
+ /** Lifecycle status */
294
+ status: AnnotationStatus;
295
+ /** Conversation thread (human ↔ AI agent) */
296
+ thread?: ThreadMessage[];
297
+ /** ISO 8601 last-updated timestamp */
298
+ updatedAt: string;
299
+ /** Page URL where the annotation was created */
300
+ url: string;
301
+ /** Click X as percentage of viewport width (0-100) — survives resize */
302
+ x: number;
303
+ /**
304
+ * Click Y as absolute page position (pixels from document top) — survives scroll.
305
+ * For fixed/sticky elements, Y is viewport-relative instead.
306
+ */
307
+ y: number;
308
+ }
309
+ /**
310
+ * Data required to create a new annotation (server-generated fields omitted).
311
+ */
312
+ type CreateAnnotationData = Omit<Annotation, "createdAt" | "id" | "resolvedAt" | "resolvedBy" | "status" | "thread" | "updatedAt">;
313
+ /**
314
+ * Fields that can be updated on an existing annotation.
315
+ */
316
+ interface UpdateAnnotationData {
317
+ /** Updated comment text */
318
+ comment?: string;
319
+ /** Updated intent */
320
+ intent?: AnnotationIntent;
321
+ /** Who resolved the annotation */
322
+ resolvedBy?: string;
323
+ /** Updated severity */
324
+ severity?: AnnotationSeverity;
325
+ /** New status */
326
+ status?: AnnotationStatus;
327
+ /** Append a thread message */
328
+ threadMessage?: ThreadMessage;
329
+ }
330
+ /**
331
+ * Server-side RPC functions
332
+ * These can be called from the client
333
+ */
334
+ interface ServerFunctions {
335
+ /**
336
+ * Extension point for custom server functions
337
+ */
338
+ [key: string]: (...args: any[]) => Promise<any>;
339
+ /**
340
+ * Create a new annotation
341
+ * @param data Annotation data (id, timestamps, status are generated server-side)
342
+ */
343
+ createAnnotation: (data: CreateAnnotationData) => Promise<Annotation>;
344
+ /**
345
+ * Delete an annotation and its screenshot
346
+ * @param id Annotation ID
347
+ */
348
+ deleteAnnotation: (id: string) => Promise<boolean>;
349
+ /**
350
+ * Get all annotations
351
+ */
352
+ getAnnotations: () => Promise<Annotation[]>;
353
+ /**
354
+ * Get module dependency graph
355
+ */
356
+ getModuleGraph: () => Promise<SerializableModuleNode[]>;
357
+ /**
358
+ * Get a screenshot as a base64 data URL
359
+ * @param annotationId Annotation ID
360
+ */
361
+ getScreenshot: (annotationId: string) => Promise<string | null>;
362
+ /**
363
+ * Get all static assets from the public directory
364
+ */
365
+ getStaticAssets: () => Promise<StaticAsset[]>;
366
+ /**
367
+ * Get full Tailwind CSS theme (default + user overrides)
368
+ */
369
+ getTailwindConfig: () => Promise<TailwindConfigResult>;
370
+ /**
371
+ * Get Vite configuration
372
+ */
373
+ getViteConfig: () => Promise<Record<string, any>>;
374
+ /**
375
+ * Open file in editor
376
+ * @param file File path
377
+ * @param line Line number (1-based)
378
+ * @param column Column number (1-based)
379
+ */
380
+ openInEditor: (file: string, line?: number, column?: number) => Promise<void>;
381
+ /**
382
+ * Read file contents
383
+ * @param path File path
384
+ */
385
+ readFile: (path: string) => Promise<string>;
386
+ /**
387
+ * Save a screenshot for an annotation
388
+ * @param annotationId Annotation ID
389
+ * @param dataUrl Base64 data URL (PNG, JPEG, WebP, or SVG)
390
+ * @returns Relative path within .devtoolbar/
391
+ */
392
+ saveScreenshot: (annotationId: string, dataUrl: string) => Promise<string>;
393
+ /**
394
+ * Update an existing annotation
395
+ * @param id Annotation ID
396
+ * @param data Fields to update
397
+ */
398
+ updateAnnotation: (id: string, data: UpdateAnnotationData) => Promise<Annotation | null>;
399
+ }
400
+ /**
401
+ * Client-side RPC functions
402
+ * These can be called from the server
403
+ */
404
+ interface ClientFunctions {
405
+ [key: string]: (...args: any[]) => void;
406
+ /**
407
+ * Notify client of config change
408
+ * @param config New Vite config
409
+ */
410
+ onConfigChange: (config: Record<string, unknown>) => void;
411
+ /**
412
+ * Notify client of HMR update
413
+ * @param payload HMR payload
414
+ */
415
+ onHMRUpdate: (payload: unknown) => void;
416
+ /**
417
+ * Notify client of module update
418
+ * @param module Updated module node
419
+ */
420
+ onModuleUpdate: (module: SerializableModuleNode) => void;
421
+ }
422
+ /**
423
+ * RPC context for server-side
424
+ */
425
+ interface ServerRPCContext {
426
+ /**
427
+ * Call a client function
428
+ * @param name Function name
429
+ * @param args Function arguments
430
+ */
431
+ callClient: <K extends keyof ClientFunctions>(name: K, ...args: Parameters<ClientFunctions[K]>) => void;
432
+ /**
433
+ * Register a server function
434
+ * @param name Function name
435
+ * @param fn Function implementation
436
+ */
437
+ registerFunction: <K extends keyof ServerFunctions>(name: K, function_: ServerFunctions[K]) => void;
438
+ /**
439
+ * Vite dev server instance
440
+ */
441
+ server: ViteDevServer;
442
+ }
443
+ /**
444
+ * RPC context for client-side
445
+ */
446
+ interface ClientRPCContext {
447
+ /**
448
+ * Call a server function
449
+ * @param name Function name
450
+ * @param args Function arguments
451
+ */
452
+ callServer: <K extends keyof ServerFunctions>(name: K, ...args: Parameters<ServerFunctions[K]>) => Promise<ReturnType<ServerFunctions[K]>>;
453
+ /**
454
+ * Register a client function
455
+ * @param name Function name
456
+ * @param function_ Function implementation
457
+ */
458
+ registerFunction: <K extends keyof ClientFunctions>(name: K, function_: ClientFunctions[K]) => void;
459
+ }
460
+ /**
461
+ * Global DevTools API interface.
462
+ * Exposed as window.__VISULIMA_DEVTOOLS__
463
+ */
464
+ interface VisulimaDevTools {
465
+ /**
466
+ * Clears notification for an app.
467
+ */
468
+ clearNotification: (appId: string) => void;
469
+ /**
470
+ * Closes the currently active app.
471
+ */
472
+ closeApp: () => Promise<void>;
473
+ /**
474
+ * Gets the currently active app ID.
475
+ */
476
+ getActiveApp: () => string | undefined;
477
+ /**
478
+ * Gets all registered apps.
479
+ */
480
+ getApps: () => DevToolbarApp[];
481
+ /**
482
+ * Gets current toolbar settings.
483
+ */
484
+ getSettings: () => ToolbarSettings;
485
+ /**
486
+ * Hides the toolbar.
487
+ */
488
+ hide: () => void;
489
+ /**
490
+ * Hook instance for event subscriptions.
491
+ */
492
+ hook: DevToolbarHook;
493
+ /**
494
+ * Shows a notification for an app.
495
+ */
496
+ notify: (appId: string, level: "info" | "warning" | "error") => void;
497
+ /**
498
+ * Opens an app by ID.
499
+ */
500
+ openApp: (appId: string) => Promise<void>;
501
+ /**
502
+ * Registers a custom app.
503
+ */
504
+ registerApp: (app: DevToolbarApp) => void;
505
+ /**
506
+ * RPC client for calling server functions.
507
+ */
508
+ rpc: ServerFunctions;
509
+ /**
510
+ * Directly sets the active state of an action button without invoking callbacks.
511
+ * Useful for deactivating a button from async work running outside the toolbar.
512
+ */
513
+ setAppActive: (appId: string, active: boolean) => void;
514
+ /**
515
+ * Shows the toolbar.
516
+ */
517
+ show: () => void;
518
+ /**
519
+ * Toggles toolbar visibility.
520
+ */
521
+ toggle: () => void;
522
+ /**
523
+ * Unregisters an app by ID.
524
+ */
525
+ unregisterApp: (appId: string) => void;
526
+ /**
527
+ * Updates toolbar settings.
528
+ */
529
+ updateSettings: (settings: Partial<ToolbarSettings>) => void;
530
+ /**
531
+ * Package version.
532
+ */
533
+ version: string;
534
+ }
535
+ /**
536
+ * Global API declaration
537
+ */
538
+ declare global {
539
+ interface Window {
540
+ /**
541
+ * Visulima DevTools global API.
542
+ */
543
+ __VISULIMA_DEVTOOLS__?: VisulimaDevTools;
544
+ }
545
+ }
546
+ export { AccessibilityInfo as A, BoundingBox as B, ClientFunctions as C, DevToolbarHook as D, FrameworkContext as F, HookEvents as H, ServerFunctions as S, TimelineEvent as T, UpdateAnnotationData as U, VisulimaDevTools as V, ServerRPCContext as a, ClientRPCContext as b, TimelineGroup as c, Annotation as d, AnnotationIntent as e, AnnotationSeverity as f, AnnotationStatus as g, CreateAnnotationData as h, DEFAULT_TIMELINE_GROUPS as i, ThreadMessage as j, TimelineEventLevel as k };
@@ -0,0 +1 @@
1
+ const e={defaultVisible:!0,placement:"bottom-center",showNotifications:!0},n="__v_dt__settings",s=()=>{if(globalThis.window===void 0)return{...e};try{const t=localStorage.getItem(n);if(t){const o=JSON.parse(t);return{...e,...o}}}catch(t){console.warn("[dev-toolbar] Failed to load settings:",t)}return{...e}},i=t=>{if(globalThis.window!==void 0)try{localStorage.setItem(n,JSON.stringify(t))}catch(o){console.warn("[dev-toolbar] Failed to save settings:",o)}},a=t=>{const o={...s(),...t};return i(o),o};export{s as loadSettings,i as saveSettings,a as updateSettings};
@@ -0,0 +1,39 @@
1
+ import { ViteDevServer } from 'vite';
2
+ import { S as ServerFunctions, a as ServerRPCContext } from "./global-api.d-DeaCvII9.js";
3
+ /**
4
+ * Configuration for the `readFile` RPC endpoint.
5
+ */
6
+ interface ReadFileOptions {
7
+ /**
8
+ * Lower-cased file extensions (without the dot) the `readFile` RPC may return.
9
+ * Defaults to a curated list of source/markup/text formats — set this to widen
10
+ * or narrow the surface. Sensitive formats (`.env`, `.pem`, lockfiles) are not
11
+ * in the default list.
12
+ */
13
+ extensions?: string[];
14
+ }
15
+ /**
16
+ * Options accepted by {@link createServerRPCContext}.
17
+ */
18
+ interface ServerRPCOptions {
19
+ /** Editor to use for "open in editor" functionality. */
20
+ editor?: string;
21
+ /**
22
+ * `readFile` RPC behaviour. Set to `false` to remove the endpoint entirely,
23
+ * or pass an object to customise the allowed extensions.
24
+ * @default { extensions: curated source/text list }
25
+ */
26
+ readFile?: ReadFileOptions | false;
27
+ }
28
+ /**
29
+ * Creates server-side RPC context.
30
+ * @param server Vite dev server instance.
31
+ * @param customFunctions Custom server functions to register.
32
+ * @param options Additional options (e.g. which editor to launch, readFile policy).
33
+ * @param options.editor Editor to use for "open in editor" functionality.
34
+ * @param options.readFile `readFile` RPC policy — `false` disables it, or pass an
35
+ * object to override the allowed extension list.
36
+ * @returns Server RPC context.
37
+ */
38
+ declare const createServerRPCContext: (server: ViteDevServer, customFunctions?: Partial<ServerFunctions>, options?: ServerRPCOptions) => ServerRPCContext;
39
+ export { ReadFileOptions as R, ServerRPCOptions as S, createServerRPCContext as c };