@oyerinde/caliper 0.1.4 → 0.2.1

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.
@@ -0,0 +1,1651 @@
1
+ import { z } from 'zod';
2
+ import * as z_2 from 'zod/v4';
3
+
4
+ declare interface AgentBridgeConfig {
5
+ /** Enable the agentic bridge for AI integration (default: false) */
6
+ enabled?: boolean;
7
+ /** WebSocket port for the MCP relay (default: 9876) */
8
+ wsPort?: number;
9
+ /** Callback for agent state changes */
10
+ onStateChange?: (state: CaliperAgentState) => void;
11
+ /** Name of a global window function to call on state changes (IIFE/CDN-safe, JSON-serializable) */
12
+ onStateChangeGlobal?: string;
13
+ }
14
+
15
+ declare interface CalculatorIntegration {
16
+ getState: () => CalculatorState;
17
+ open: (baseValue: number) => void;
18
+ handleInput: (key: string) => void;
19
+ handleBackspace: () => void;
20
+ handleDelete: () => void;
21
+ handleEnter: () => void;
22
+ close: () => void;
23
+ syncValue: (value: number) => void;
24
+ getResult: () => number | null;
25
+ }
26
+
27
+ /**
28
+ * Calculator state machine
29
+ */
30
+ declare type CalculatorOperation = "+" | "-" | "*" | "/";
31
+
32
+ declare interface CalculatorState {
33
+ baseValue: number;
34
+ operation: CalculatorOperation | null;
35
+ inputValue: string;
36
+ result: number | null;
37
+ isActive: boolean;
38
+ }
39
+
40
+ export declare const CALIPER_METHODS: {
41
+ readonly SELECT: "CALIPER_SELECT";
42
+ readonly MEASURE: "CALIPER_MEASURE";
43
+ readonly INSPECT: "CALIPER_INSPECT";
44
+ readonly FREEZE: "CALIPER_FREEZE";
45
+ readonly CLEAR: "CALIPER_CLEAR";
46
+ readonly WALK_DOM: "CALIPER_WALK_DOM";
47
+ readonly WALK_AND_MEASURE: "CALIPER_WALK_AND_MEASURE";
48
+ readonly GET_CONTEXT: "CALIPER_GET_CONTEXT";
49
+ readonly REGISTER_TAB: "caliper/registerTab";
50
+ readonly TAB_UPDATE: "caliper/tabUpdate";
51
+ readonly STATE_UPDATE: "caliper/stateUpdate";
52
+ };
53
+
54
+ export declare type CaliperActionResult = z.infer<typeof CaliperActionResultSchema>;
55
+
56
+ export declare const CaliperActionResultSchema: z.ZodUnion<readonly [z.ZodObject<{
57
+ success: z.ZodLiteral<true>;
58
+ method: z.ZodLiteral<"CALIPER_SELECT">;
59
+ selector: z.ZodString;
60
+ selection: z.ZodObject<{
61
+ rect: z.ZodNullable<z.ZodObject<{
62
+ top: z.ZodNumber;
63
+ right: z.ZodNumber;
64
+ bottom: z.ZodNumber;
65
+ left: z.ZodNumber;
66
+ width: z.ZodNumber;
67
+ height: z.ZodNumber;
68
+ x: z.ZodNumber;
69
+ y: z.ZodNumber;
70
+ }, z.core.$strip>>;
71
+ scrollHierarchy: z.ZodArray<z.ZodObject<{
72
+ initialScrollTop: z.ZodNumber;
73
+ initialScrollLeft: z.ZodNumber;
74
+ containerRect: z.ZodNullable<z.ZodObject<{
75
+ top: z.ZodNumber;
76
+ right: z.ZodNumber;
77
+ bottom: z.ZodNumber;
78
+ left: z.ZodNumber;
79
+ width: z.ZodNumber;
80
+ height: z.ZodNumber;
81
+ x: z.ZodNumber;
82
+ y: z.ZodNumber;
83
+ }, z.core.$strip>>;
84
+ absoluteDepth: z.ZodNumber;
85
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
86
+ }, z.core.$strip>>;
87
+ position: z.ZodEnum<{
88
+ static: "static";
89
+ relative: "relative";
90
+ absolute: "absolute";
91
+ fixed: "fixed";
92
+ sticky: "sticky";
93
+ }>;
94
+ stickyConfig: z.ZodOptional<z.ZodObject<{
95
+ top: z.ZodNullable<z.ZodNumber>;
96
+ bottom: z.ZodNullable<z.ZodNumber>;
97
+ left: z.ZodNullable<z.ZodNumber>;
98
+ right: z.ZodNullable<z.ZodNumber>;
99
+ naturalTop: z.ZodNumber;
100
+ naturalLeft: z.ZodNumber;
101
+ containerWidth: z.ZodNumber;
102
+ containerHeight: z.ZodNumber;
103
+ elementWidth: z.ZodNumber;
104
+ elementHeight: z.ZodNumber;
105
+ anchorAbsoluteDepth: z.ZodNumber;
106
+ }, z.core.$strip>>;
107
+ initialWindowX: z.ZodNumber;
108
+ initialWindowY: z.ZodNumber;
109
+ depth: z.ZodNumber;
110
+ hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
111
+ }, z.core.$strip>;
112
+ timestamp: z.ZodNumber;
113
+ }, z.core.$strip>, z.ZodObject<{
114
+ success: z.ZodLiteral<true>;
115
+ method: z.ZodLiteral<"CALIPER_MEASURE">;
116
+ selector: z.ZodString;
117
+ measurement: z.ZodObject<{
118
+ context: z.ZodNullable<z.ZodEnum<{
119
+ parent: "parent";
120
+ child: "child";
121
+ sibling: "sibling";
122
+ }>>;
123
+ lines: z.ZodArray<z.ZodObject<{
124
+ type: z.ZodEnum<{
125
+ top: "top";
126
+ right: "right";
127
+ bottom: "bottom";
128
+ left: "left";
129
+ distance: "distance";
130
+ }>;
131
+ value: z.ZodNumber;
132
+ start: z.ZodObject<{
133
+ x: z.ZodNumber;
134
+ y: z.ZodNumber;
135
+ }, z.core.$strip>;
136
+ end: z.ZodObject<{
137
+ x: z.ZodNumber;
138
+ y: z.ZodNumber;
139
+ }, z.core.$strip>;
140
+ startSync: z.ZodOptional<z.ZodEnum<{
141
+ primary: "primary";
142
+ secondary: "secondary";
143
+ }>>;
144
+ endSync: z.ZodOptional<z.ZodEnum<{
145
+ primary: "primary";
146
+ secondary: "secondary";
147
+ }>>;
148
+ }, z.core.$strip>>;
149
+ primary: z.ZodObject<{
150
+ top: z.ZodNumber;
151
+ right: z.ZodNumber;
152
+ bottom: z.ZodNumber;
153
+ left: z.ZodNumber;
154
+ width: z.ZodNumber;
155
+ height: z.ZodNumber;
156
+ x: z.ZodNumber;
157
+ y: z.ZodNumber;
158
+ }, z.core.$strip>;
159
+ secondary: z.ZodNullable<z.ZodObject<{
160
+ top: z.ZodNumber;
161
+ right: z.ZodNumber;
162
+ bottom: z.ZodNumber;
163
+ left: z.ZodNumber;
164
+ width: z.ZodNumber;
165
+ height: z.ZodNumber;
166
+ x: z.ZodNumber;
167
+ y: z.ZodNumber;
168
+ }, z.core.$strip>>;
169
+ timestamp: z.ZodNumber;
170
+ primaryHierarchy: z.ZodArray<z.ZodObject<{
171
+ initialScrollTop: z.ZodNumber;
172
+ initialScrollLeft: z.ZodNumber;
173
+ containerRect: z.ZodNullable<z.ZodObject<{
174
+ top: z.ZodNumber;
175
+ right: z.ZodNumber;
176
+ bottom: z.ZodNumber;
177
+ left: z.ZodNumber;
178
+ width: z.ZodNumber;
179
+ height: z.ZodNumber;
180
+ x: z.ZodNumber;
181
+ y: z.ZodNumber;
182
+ }, z.core.$strip>>;
183
+ absoluteDepth: z.ZodNumber;
184
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
185
+ }, z.core.$strip>>;
186
+ secondaryHierarchy: z.ZodArray<z.ZodObject<{
187
+ initialScrollTop: z.ZodNumber;
188
+ initialScrollLeft: z.ZodNumber;
189
+ containerRect: z.ZodNullable<z.ZodObject<{
190
+ top: z.ZodNumber;
191
+ right: z.ZodNumber;
192
+ bottom: z.ZodNumber;
193
+ left: z.ZodNumber;
194
+ width: z.ZodNumber;
195
+ height: z.ZodNumber;
196
+ x: z.ZodNumber;
197
+ y: z.ZodNumber;
198
+ }, z.core.$strip>>;
199
+ absoluteDepth: z.ZodNumber;
200
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
201
+ }, z.core.$strip>>;
202
+ primaryPosition: z.ZodEnum<{
203
+ static: "static";
204
+ relative: "relative";
205
+ absolute: "absolute";
206
+ fixed: "fixed";
207
+ sticky: "sticky";
208
+ }>;
209
+ secondaryPosition: z.ZodEnum<{
210
+ static: "static";
211
+ relative: "relative";
212
+ absolute: "absolute";
213
+ fixed: "fixed";
214
+ sticky: "sticky";
215
+ }>;
216
+ primaryWinX: z.ZodNumber;
217
+ primaryWinY: z.ZodNumber;
218
+ secondaryWinX: z.ZodNumber;
219
+ secondaryWinY: z.ZodNumber;
220
+ primarySticky: z.ZodOptional<z.ZodObject<{
221
+ top: z.ZodNullable<z.ZodNumber>;
222
+ bottom: z.ZodNullable<z.ZodNumber>;
223
+ left: z.ZodNullable<z.ZodNumber>;
224
+ right: z.ZodNullable<z.ZodNumber>;
225
+ naturalTop: z.ZodNumber;
226
+ naturalLeft: z.ZodNumber;
227
+ containerWidth: z.ZodNumber;
228
+ containerHeight: z.ZodNumber;
229
+ elementWidth: z.ZodNumber;
230
+ elementHeight: z.ZodNumber;
231
+ anchorAbsoluteDepth: z.ZodNumber;
232
+ }, z.core.$strip>>;
233
+ secondarySticky: z.ZodOptional<z.ZodObject<{
234
+ top: z.ZodNullable<z.ZodNumber>;
235
+ bottom: z.ZodNullable<z.ZodNumber>;
236
+ left: z.ZodNullable<z.ZodNumber>;
237
+ right: z.ZodNullable<z.ZodNumber>;
238
+ naturalTop: z.ZodNumber;
239
+ naturalLeft: z.ZodNumber;
240
+ containerWidth: z.ZodNumber;
241
+ containerHeight: z.ZodNumber;
242
+ elementWidth: z.ZodNumber;
243
+ elementHeight: z.ZodNumber;
244
+ anchorAbsoluteDepth: z.ZodNumber;
245
+ }, z.core.$strip>>;
246
+ primaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
247
+ secondaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
248
+ }, z.core.$strip>;
249
+ timestamp: z.ZodNumber;
250
+ }, z.core.$strip>, z.ZodObject<{
251
+ success: z.ZodLiteral<true>;
252
+ method: z.ZodLiteral<"CALIPER_INSPECT">;
253
+ selector: z.ZodString;
254
+ distances: z.ZodObject<{
255
+ top: z.ZodNumber;
256
+ right: z.ZodNumber;
257
+ bottom: z.ZodNumber;
258
+ left: z.ZodNumber;
259
+ horizontal: z.ZodNumber;
260
+ vertical: z.ZodNumber;
261
+ }, z.core.$strip>;
262
+ computedStyles: z.ZodObject<{
263
+ display: z.ZodOptional<z.ZodString>;
264
+ visibility: z.ZodOptional<z.ZodString>;
265
+ position: z.ZodOptional<z.ZodString>;
266
+ boxSizing: z.ZodOptional<z.ZodString>;
267
+ padding: z.ZodOptional<z.ZodObject<{
268
+ top: z.ZodNumber;
269
+ right: z.ZodNumber;
270
+ bottom: z.ZodNumber;
271
+ left: z.ZodNumber;
272
+ }, z.core.$strip>>;
273
+ margin: z.ZodOptional<z.ZodObject<{
274
+ top: z.ZodNumber;
275
+ right: z.ZodNumber;
276
+ bottom: z.ZodNumber;
277
+ left: z.ZodNumber;
278
+ }, z.core.$strip>>;
279
+ border: z.ZodOptional<z.ZodObject<{
280
+ top: z.ZodNumber;
281
+ right: z.ZodNumber;
282
+ bottom: z.ZodNumber;
283
+ left: z.ZodNumber;
284
+ }, z.core.$strip>>;
285
+ gap: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
286
+ flexDirection: z.ZodOptional<z.ZodString>;
287
+ justifyContent: z.ZodOptional<z.ZodString>;
288
+ alignItems: z.ZodOptional<z.ZodString>;
289
+ fontSize: z.ZodOptional<z.ZodNumber>;
290
+ fontWeight: z.ZodOptional<z.ZodString>;
291
+ fontFamily: z.ZodOptional<z.ZodString>;
292
+ lineHeight: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
293
+ letterSpacing: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
294
+ color: z.ZodOptional<z.ZodString>;
295
+ backgroundColor: z.ZodOptional<z.ZodString>;
296
+ borderColor: z.ZodOptional<z.ZodString>;
297
+ borderRadius: z.ZodOptional<z.ZodString>;
298
+ boxShadow: z.ZodOptional<z.ZodString>;
299
+ opacity: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
300
+ outline: z.ZodOptional<z.ZodString>;
301
+ outlineColor: z.ZodOptional<z.ZodString>;
302
+ zIndex: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
303
+ overflow: z.ZodOptional<z.ZodString>;
304
+ overflowX: z.ZodOptional<z.ZodString>;
305
+ overflowY: z.ZodOptional<z.ZodString>;
306
+ contentVisibility: z.ZodOptional<z.ZodString>;
307
+ }, z.core.$strip>;
308
+ selection: z.ZodObject<{
309
+ rect: z.ZodNullable<z.ZodObject<{
310
+ top: z.ZodNumber;
311
+ right: z.ZodNumber;
312
+ bottom: z.ZodNumber;
313
+ left: z.ZodNumber;
314
+ width: z.ZodNumber;
315
+ height: z.ZodNumber;
316
+ x: z.ZodNumber;
317
+ y: z.ZodNumber;
318
+ }, z.core.$strip>>;
319
+ scrollHierarchy: z.ZodArray<z.ZodObject<{
320
+ initialScrollTop: z.ZodNumber;
321
+ initialScrollLeft: z.ZodNumber;
322
+ containerRect: z.ZodNullable<z.ZodObject<{
323
+ top: z.ZodNumber;
324
+ right: z.ZodNumber;
325
+ bottom: z.ZodNumber;
326
+ left: z.ZodNumber;
327
+ width: z.ZodNumber;
328
+ height: z.ZodNumber;
329
+ x: z.ZodNumber;
330
+ y: z.ZodNumber;
331
+ }, z.core.$strip>>;
332
+ absoluteDepth: z.ZodNumber;
333
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
334
+ }, z.core.$strip>>;
335
+ position: z.ZodEnum<{
336
+ static: "static";
337
+ relative: "relative";
338
+ absolute: "absolute";
339
+ fixed: "fixed";
340
+ sticky: "sticky";
341
+ }>;
342
+ stickyConfig: z.ZodOptional<z.ZodObject<{
343
+ top: z.ZodNullable<z.ZodNumber>;
344
+ bottom: z.ZodNullable<z.ZodNumber>;
345
+ left: z.ZodNullable<z.ZodNumber>;
346
+ right: z.ZodNullable<z.ZodNumber>;
347
+ naturalTop: z.ZodNumber;
348
+ naturalLeft: z.ZodNumber;
349
+ containerWidth: z.ZodNumber;
350
+ containerHeight: z.ZodNumber;
351
+ elementWidth: z.ZodNumber;
352
+ elementHeight: z.ZodNumber;
353
+ anchorAbsoluteDepth: z.ZodNumber;
354
+ }, z.core.$strip>>;
355
+ initialWindowX: z.ZodNumber;
356
+ initialWindowY: z.ZodNumber;
357
+ depth: z.ZodNumber;
358
+ hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
359
+ }, z.core.$strip>;
360
+ immediateChildCount: z.ZodOptional<z.ZodNumber>;
361
+ descendantCount: z.ZodOptional<z.ZodNumber>;
362
+ descendantsTruncated: z.ZodOptional<z.ZodBoolean>;
363
+ sourceHints: z.ZodOptional<z.ZodObject<{
364
+ stableAnchors: z.ZodArray<z.ZodString>;
365
+ suggestedGrep: z.ZodOptional<z.ZodString>;
366
+ textContent: z.ZodOptional<z.ZodString>;
367
+ accessibleName: z.ZodOptional<z.ZodString>;
368
+ unstableClasses: z.ZodArray<z.ZodString>;
369
+ tagName: z.ZodString;
370
+ }, z.core.$strip>>;
371
+ timestamp: z.ZodNumber;
372
+ }, z.core.$strip>, z.ZodObject<{
373
+ success: z.ZodLiteral<true>;
374
+ method: z.ZodLiteral<"CALIPER_FREEZE">;
375
+ timestamp: z.ZodNumber;
376
+ }, z.core.$strip>, z.ZodObject<{
377
+ success: z.ZodLiteral<true>;
378
+ method: z.ZodLiteral<"CALIPER_CLEAR">;
379
+ timestamp: z.ZodNumber;
380
+ }, z.core.$strip>, z.ZodObject<{
381
+ success: z.ZodLiteral<true>;
382
+ method: z.ZodLiteral<"CALIPER_WALK_DOM">;
383
+ selector: z.ZodString;
384
+ domContext: z.ZodObject<{
385
+ element: z.ZodObject<{
386
+ tagName: z.ZodString;
387
+ id: z.ZodOptional<z.ZodString>;
388
+ classList: z.ZodArray<z.ZodString>;
389
+ agentId: z.ZodOptional<z.ZodString>;
390
+ text: z.ZodOptional<z.ZodString>;
391
+ }, z.core.$strip>;
392
+ parent: z.ZodNullable<z.ZodObject<{
393
+ tagName: z.ZodString;
394
+ id: z.ZodOptional<z.ZodString>;
395
+ classList: z.ZodArray<z.ZodString>;
396
+ agentId: z.ZodOptional<z.ZodString>;
397
+ text: z.ZodOptional<z.ZodString>;
398
+ }, z.core.$strip>>;
399
+ children: z.ZodArray<z.ZodObject<{
400
+ tagName: z.ZodString;
401
+ id: z.ZodOptional<z.ZodString>;
402
+ classList: z.ZodArray<z.ZodString>;
403
+ agentId: z.ZodOptional<z.ZodString>;
404
+ text: z.ZodOptional<z.ZodString>;
405
+ }, z.core.$strip>>;
406
+ }, z.core.$strip>;
407
+ timestamp: z.ZodNumber;
408
+ }, z.core.$strip>, z.ZodObject<{
409
+ success: z.ZodLiteral<true>;
410
+ method: z.ZodLiteral<"CALIPER_WALK_AND_MEASURE">;
411
+ selector: z.ZodString;
412
+ walkResult: z.ZodObject<{
413
+ root: z.ZodOptional<z.ZodType<CaliperNode, unknown, z.core.$ZodTypeInternals<CaliperNode, unknown>>>;
414
+ nodeCount: z.ZodNumber;
415
+ maxDepthReached: z.ZodNumber;
416
+ walkDurationMs: z.ZodNumber;
417
+ hasMore: z.ZodOptional<z.ZodBoolean>;
418
+ batchInstructions: z.ZodOptional<z.ZodString>;
419
+ continuationToken: z.ZodOptional<z.ZodString>;
420
+ }, z.core.$strip>;
421
+ timestamp: z.ZodNumber;
422
+ binaryPayload: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
423
+ }, z.core.$strip>, z.ZodObject<{
424
+ success: z.ZodLiteral<true>;
425
+ method: z.ZodLiteral<"CALIPER_GET_CONTEXT">;
426
+ context: z.ZodObject<{
427
+ rootFontSize: z.ZodNumber;
428
+ devicePixelRatio: z.ZodNumber;
429
+ viewportWidth: z.ZodNumber;
430
+ viewportHeight: z.ZodNumber;
431
+ visualViewportWidth: z.ZodOptional<z.ZodNumber>;
432
+ visualViewportHeight: z.ZodOptional<z.ZodNumber>;
433
+ scrollX: z.ZodNumber;
434
+ scrollY: z.ZodNumber;
435
+ documentWidth: z.ZodNumber;
436
+ documentHeight: z.ZodNumber;
437
+ orientation: z.ZodEnum<{
438
+ portrait: "portrait";
439
+ landscape: "landscape";
440
+ }>;
441
+ preferences: z.ZodObject<{
442
+ colorScheme: z.ZodEnum<{
443
+ light: "light";
444
+ dark: "dark";
445
+ "no-preference": "no-preference";
446
+ }>;
447
+ reducedMotion: z.ZodBoolean;
448
+ }, z.core.$strip>;
449
+ }, z.core.$strip>;
450
+ timestamp: z.ZodNumber;
451
+ }, z.core.$strip>, z.ZodObject<{
452
+ success: z.ZodLiteral<false>;
453
+ method: z.ZodEnum<{
454
+ CALIPER_SELECT: "CALIPER_SELECT";
455
+ CALIPER_MEASURE: "CALIPER_MEASURE";
456
+ CALIPER_INSPECT: "CALIPER_INSPECT";
457
+ CALIPER_FREEZE: "CALIPER_FREEZE";
458
+ CALIPER_CLEAR: "CALIPER_CLEAR";
459
+ CALIPER_WALK_DOM: "CALIPER_WALK_DOM";
460
+ CALIPER_WALK_AND_MEASURE: "CALIPER_WALK_AND_MEASURE";
461
+ CALIPER_GET_CONTEXT: "CALIPER_GET_CONTEXT";
462
+ "caliper/registerTab": "caliper/registerTab";
463
+ "caliper/tabUpdate": "caliper/tabUpdate";
464
+ "caliper/stateUpdate": "caliper/stateUpdate";
465
+ }>;
466
+ selector: z.ZodOptional<z.ZodString>;
467
+ error: z.ZodString;
468
+ timestamp: z.ZodNumber;
469
+ binaryPayload: z.ZodOptional<z.ZodCustom<Uint8Array<ArrayBufferLike>, Uint8Array<ArrayBufferLike>>>;
470
+ }, z.core.$strip>]>;
471
+
472
+ export declare type CaliperAgentState = z.infer<typeof CaliperAgentStateSchema>;
473
+
474
+ export declare const CaliperAgentStateSchema: z.ZodObject<{
475
+ viewport: z.ZodObject<{
476
+ width: z.ZodNumber;
477
+ height: z.ZodNumber;
478
+ scrollX: z.ZodNumber;
479
+ scrollY: z.ZodNumber;
480
+ }, z.core.$strip>;
481
+ activeSelection: z.ZodNullable<z.ZodObject<{
482
+ rect: z.ZodNullable<z.ZodObject<{
483
+ top: z.ZodNumber;
484
+ right: z.ZodNumber;
485
+ bottom: z.ZodNumber;
486
+ left: z.ZodNumber;
487
+ width: z.ZodNumber;
488
+ height: z.ZodNumber;
489
+ x: z.ZodNumber;
490
+ y: z.ZodNumber;
491
+ }, z.core.$strip>>;
492
+ scrollHierarchy: z.ZodArray<z.ZodObject<{
493
+ initialScrollTop: z.ZodNumber;
494
+ initialScrollLeft: z.ZodNumber;
495
+ containerRect: z.ZodNullable<z.ZodObject<{
496
+ top: z.ZodNumber;
497
+ right: z.ZodNumber;
498
+ bottom: z.ZodNumber;
499
+ left: z.ZodNumber;
500
+ width: z.ZodNumber;
501
+ height: z.ZodNumber;
502
+ x: z.ZodNumber;
503
+ y: z.ZodNumber;
504
+ }, z.core.$strip>>;
505
+ absoluteDepth: z.ZodNumber;
506
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
507
+ }, z.core.$strip>>;
508
+ position: z.ZodEnum<{
509
+ static: "static";
510
+ relative: "relative";
511
+ absolute: "absolute";
512
+ fixed: "fixed";
513
+ sticky: "sticky";
514
+ }>;
515
+ stickyConfig: z.ZodOptional<z.ZodObject<{
516
+ top: z.ZodNullable<z.ZodNumber>;
517
+ bottom: z.ZodNullable<z.ZodNumber>;
518
+ left: z.ZodNullable<z.ZodNumber>;
519
+ right: z.ZodNullable<z.ZodNumber>;
520
+ naturalTop: z.ZodNumber;
521
+ naturalLeft: z.ZodNumber;
522
+ containerWidth: z.ZodNumber;
523
+ containerHeight: z.ZodNumber;
524
+ elementWidth: z.ZodNumber;
525
+ elementHeight: z.ZodNumber;
526
+ anchorAbsoluteDepth: z.ZodNumber;
527
+ }, z.core.$strip>>;
528
+ initialWindowX: z.ZodNumber;
529
+ initialWindowY: z.ZodNumber;
530
+ depth: z.ZodNumber;
531
+ hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
532
+ }, z.core.$strip>>;
533
+ selectionFingerprint: z.ZodNullable<z.ZodObject<{
534
+ selector: z.ZodString;
535
+ tag: z.ZodString;
536
+ timestamp: z.ZodNumber;
537
+ id: z.ZodOptional<z.ZodString>;
538
+ text: z.ZodOptional<z.ZodString>;
539
+ classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
540
+ tabId: z.ZodOptional<z.ZodString>;
541
+ nthChild: z.ZodOptional<z.ZodNumber>;
542
+ x: z.ZodOptional<z.ZodNumber>;
543
+ y: z.ZodOptional<z.ZodNumber>;
544
+ depth: z.ZodOptional<z.ZodNumber>;
545
+ marker: z.ZodOptional<z.ZodString>;
546
+ scrollHierarchy: z.ZodOptional<z.ZodArray<z.ZodObject<{
547
+ initialScrollTop: z.ZodNumber;
548
+ initialScrollLeft: z.ZodNumber;
549
+ containerRect: z.ZodNullable<z.ZodObject<{
550
+ top: z.ZodNumber;
551
+ right: z.ZodNumber;
552
+ bottom: z.ZodNumber;
553
+ left: z.ZodNumber;
554
+ width: z.ZodNumber;
555
+ height: z.ZodNumber;
556
+ x: z.ZodNumber;
557
+ y: z.ZodNumber;
558
+ }, z.core.$strip>>;
559
+ absoluteDepth: z.ZodNumber;
560
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
561
+ }, z.core.$strip>>>;
562
+ position: z.ZodOptional<z.ZodEnum<{
563
+ static: "static";
564
+ relative: "relative";
565
+ absolute: "absolute";
566
+ fixed: "fixed";
567
+ sticky: "sticky";
568
+ }>>;
569
+ stickyConfig: z.ZodOptional<z.ZodObject<{
570
+ top: z.ZodNullable<z.ZodNumber>;
571
+ bottom: z.ZodNullable<z.ZodNumber>;
572
+ left: z.ZodNullable<z.ZodNumber>;
573
+ right: z.ZodNullable<z.ZodNumber>;
574
+ naturalTop: z.ZodNumber;
575
+ naturalLeft: z.ZodNumber;
576
+ containerWidth: z.ZodNumber;
577
+ containerHeight: z.ZodNumber;
578
+ elementWidth: z.ZodNumber;
579
+ elementHeight: z.ZodNumber;
580
+ anchorAbsoluteDepth: z.ZodNumber;
581
+ }, z.core.$strip>>;
582
+ initialWindowX: z.ZodOptional<z.ZodNumber>;
583
+ initialWindowY: z.ZodOptional<z.ZodNumber>;
584
+ hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
585
+ rect: z.ZodOptional<z.ZodObject<{
586
+ top: z.ZodNumber;
587
+ right: z.ZodNumber;
588
+ bottom: z.ZodNumber;
589
+ left: z.ZodNumber;
590
+ width: z.ZodNumber;
591
+ height: z.ZodNumber;
592
+ x: z.ZodNumber;
593
+ y: z.ZodNumber;
594
+ }, z.core.$strip>>;
595
+ }, z.core.$strip>>;
596
+ lastMeasurement: z.ZodNullable<z.ZodObject<{
597
+ context: z.ZodNullable<z.ZodEnum<{
598
+ parent: "parent";
599
+ child: "child";
600
+ sibling: "sibling";
601
+ }>>;
602
+ lines: z.ZodArray<z.ZodObject<{
603
+ type: z.ZodEnum<{
604
+ top: "top";
605
+ right: "right";
606
+ bottom: "bottom";
607
+ left: "left";
608
+ distance: "distance";
609
+ }>;
610
+ value: z.ZodNumber;
611
+ start: z.ZodObject<{
612
+ x: z.ZodNumber;
613
+ y: z.ZodNumber;
614
+ }, z.core.$strip>;
615
+ end: z.ZodObject<{
616
+ x: z.ZodNumber;
617
+ y: z.ZodNumber;
618
+ }, z.core.$strip>;
619
+ startSync: z.ZodOptional<z.ZodEnum<{
620
+ primary: "primary";
621
+ secondary: "secondary";
622
+ }>>;
623
+ endSync: z.ZodOptional<z.ZodEnum<{
624
+ primary: "primary";
625
+ secondary: "secondary";
626
+ }>>;
627
+ }, z.core.$strip>>;
628
+ primary: z.ZodObject<{
629
+ top: z.ZodNumber;
630
+ right: z.ZodNumber;
631
+ bottom: z.ZodNumber;
632
+ left: z.ZodNumber;
633
+ width: z.ZodNumber;
634
+ height: z.ZodNumber;
635
+ x: z.ZodNumber;
636
+ y: z.ZodNumber;
637
+ }, z.core.$strip>;
638
+ secondary: z.ZodNullable<z.ZodObject<{
639
+ top: z.ZodNumber;
640
+ right: z.ZodNumber;
641
+ bottom: z.ZodNumber;
642
+ left: z.ZodNumber;
643
+ width: z.ZodNumber;
644
+ height: z.ZodNumber;
645
+ x: z.ZodNumber;
646
+ y: z.ZodNumber;
647
+ }, z.core.$strip>>;
648
+ timestamp: z.ZodNumber;
649
+ primaryHierarchy: z.ZodArray<z.ZodObject<{
650
+ initialScrollTop: z.ZodNumber;
651
+ initialScrollLeft: z.ZodNumber;
652
+ containerRect: z.ZodNullable<z.ZodObject<{
653
+ top: z.ZodNumber;
654
+ right: z.ZodNumber;
655
+ bottom: z.ZodNumber;
656
+ left: z.ZodNumber;
657
+ width: z.ZodNumber;
658
+ height: z.ZodNumber;
659
+ x: z.ZodNumber;
660
+ y: z.ZodNumber;
661
+ }, z.core.$strip>>;
662
+ absoluteDepth: z.ZodNumber;
663
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
664
+ }, z.core.$strip>>;
665
+ secondaryHierarchy: z.ZodArray<z.ZodObject<{
666
+ initialScrollTop: z.ZodNumber;
667
+ initialScrollLeft: z.ZodNumber;
668
+ containerRect: z.ZodNullable<z.ZodObject<{
669
+ top: z.ZodNumber;
670
+ right: z.ZodNumber;
671
+ bottom: z.ZodNumber;
672
+ left: z.ZodNumber;
673
+ width: z.ZodNumber;
674
+ height: z.ZodNumber;
675
+ x: z.ZodNumber;
676
+ y: z.ZodNumber;
677
+ }, z.core.$strip>>;
678
+ absoluteDepth: z.ZodNumber;
679
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
680
+ }, z.core.$strip>>;
681
+ primaryPosition: z.ZodEnum<{
682
+ static: "static";
683
+ relative: "relative";
684
+ absolute: "absolute";
685
+ fixed: "fixed";
686
+ sticky: "sticky";
687
+ }>;
688
+ secondaryPosition: z.ZodEnum<{
689
+ static: "static";
690
+ relative: "relative";
691
+ absolute: "absolute";
692
+ fixed: "fixed";
693
+ sticky: "sticky";
694
+ }>;
695
+ primaryWinX: z.ZodNumber;
696
+ primaryWinY: z.ZodNumber;
697
+ secondaryWinX: z.ZodNumber;
698
+ secondaryWinY: z.ZodNumber;
699
+ primarySticky: z.ZodOptional<z.ZodObject<{
700
+ top: z.ZodNullable<z.ZodNumber>;
701
+ bottom: z.ZodNullable<z.ZodNumber>;
702
+ left: z.ZodNullable<z.ZodNumber>;
703
+ right: z.ZodNullable<z.ZodNumber>;
704
+ naturalTop: z.ZodNumber;
705
+ naturalLeft: z.ZodNumber;
706
+ containerWidth: z.ZodNumber;
707
+ containerHeight: z.ZodNumber;
708
+ elementWidth: z.ZodNumber;
709
+ elementHeight: z.ZodNumber;
710
+ anchorAbsoluteDepth: z.ZodNumber;
711
+ }, z.core.$strip>>;
712
+ secondarySticky: z.ZodOptional<z.ZodObject<{
713
+ top: z.ZodNullable<z.ZodNumber>;
714
+ bottom: z.ZodNullable<z.ZodNumber>;
715
+ left: z.ZodNullable<z.ZodNumber>;
716
+ right: z.ZodNullable<z.ZodNumber>;
717
+ naturalTop: z.ZodNumber;
718
+ naturalLeft: z.ZodNumber;
719
+ containerWidth: z.ZodNumber;
720
+ containerHeight: z.ZodNumber;
721
+ elementWidth: z.ZodNumber;
722
+ elementHeight: z.ZodNumber;
723
+ anchorAbsoluteDepth: z.ZodNumber;
724
+ }, z.core.$strip>>;
725
+ primaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
726
+ secondaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
727
+ }, z.core.$strip>>;
728
+ measurementFingerprint: z.ZodNullable<z.ZodObject<{
729
+ primary: z.ZodObject<{
730
+ selector: z.ZodString;
731
+ tag: z.ZodString;
732
+ timestamp: z.ZodNumber;
733
+ id: z.ZodOptional<z.ZodString>;
734
+ text: z.ZodOptional<z.ZodString>;
735
+ classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
736
+ tabId: z.ZodOptional<z.ZodString>;
737
+ nthChild: z.ZodOptional<z.ZodNumber>;
738
+ x: z.ZodOptional<z.ZodNumber>;
739
+ y: z.ZodOptional<z.ZodNumber>;
740
+ depth: z.ZodOptional<z.ZodNumber>;
741
+ marker: z.ZodOptional<z.ZodString>;
742
+ scrollHierarchy: z.ZodOptional<z.ZodArray<z.ZodObject<{
743
+ initialScrollTop: z.ZodNumber;
744
+ initialScrollLeft: z.ZodNumber;
745
+ containerRect: z.ZodNullable<z.ZodObject<{
746
+ top: z.ZodNumber;
747
+ right: z.ZodNumber;
748
+ bottom: z.ZodNumber;
749
+ left: z.ZodNumber;
750
+ width: z.ZodNumber;
751
+ height: z.ZodNumber;
752
+ x: z.ZodNumber;
753
+ y: z.ZodNumber;
754
+ }, z.core.$strip>>;
755
+ absoluteDepth: z.ZodNumber;
756
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
757
+ }, z.core.$strip>>>;
758
+ position: z.ZodOptional<z.ZodEnum<{
759
+ static: "static";
760
+ relative: "relative";
761
+ absolute: "absolute";
762
+ fixed: "fixed";
763
+ sticky: "sticky";
764
+ }>>;
765
+ stickyConfig: z.ZodOptional<z.ZodObject<{
766
+ top: z.ZodNullable<z.ZodNumber>;
767
+ bottom: z.ZodNullable<z.ZodNumber>;
768
+ left: z.ZodNullable<z.ZodNumber>;
769
+ right: z.ZodNullable<z.ZodNumber>;
770
+ naturalTop: z.ZodNumber;
771
+ naturalLeft: z.ZodNumber;
772
+ containerWidth: z.ZodNumber;
773
+ containerHeight: z.ZodNumber;
774
+ elementWidth: z.ZodNumber;
775
+ elementHeight: z.ZodNumber;
776
+ anchorAbsoluteDepth: z.ZodNumber;
777
+ }, z.core.$strip>>;
778
+ initialWindowX: z.ZodOptional<z.ZodNumber>;
779
+ initialWindowY: z.ZodOptional<z.ZodNumber>;
780
+ hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
781
+ rect: z.ZodOptional<z.ZodObject<{
782
+ top: z.ZodNumber;
783
+ right: z.ZodNumber;
784
+ bottom: z.ZodNumber;
785
+ left: z.ZodNumber;
786
+ width: z.ZodNumber;
787
+ height: z.ZodNumber;
788
+ x: z.ZodNumber;
789
+ y: z.ZodNumber;
790
+ }, z.core.$strip>>;
791
+ }, z.core.$strip>;
792
+ secondary: z.ZodObject<{
793
+ selector: z.ZodString;
794
+ tag: z.ZodString;
795
+ timestamp: z.ZodNumber;
796
+ id: z.ZodOptional<z.ZodString>;
797
+ text: z.ZodOptional<z.ZodString>;
798
+ classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
799
+ tabId: z.ZodOptional<z.ZodString>;
800
+ nthChild: z.ZodOptional<z.ZodNumber>;
801
+ x: z.ZodOptional<z.ZodNumber>;
802
+ y: z.ZodOptional<z.ZodNumber>;
803
+ depth: z.ZodOptional<z.ZodNumber>;
804
+ marker: z.ZodOptional<z.ZodString>;
805
+ scrollHierarchy: z.ZodOptional<z.ZodArray<z.ZodObject<{
806
+ initialScrollTop: z.ZodNumber;
807
+ initialScrollLeft: z.ZodNumber;
808
+ containerRect: z.ZodNullable<z.ZodObject<{
809
+ top: z.ZodNumber;
810
+ right: z.ZodNumber;
811
+ bottom: z.ZodNumber;
812
+ left: z.ZodNumber;
813
+ width: z.ZodNumber;
814
+ height: z.ZodNumber;
815
+ x: z.ZodNumber;
816
+ y: z.ZodNumber;
817
+ }, z.core.$strip>>;
818
+ absoluteDepth: z.ZodNumber;
819
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
820
+ }, z.core.$strip>>>;
821
+ position: z.ZodOptional<z.ZodEnum<{
822
+ static: "static";
823
+ relative: "relative";
824
+ absolute: "absolute";
825
+ fixed: "fixed";
826
+ sticky: "sticky";
827
+ }>>;
828
+ stickyConfig: z.ZodOptional<z.ZodObject<{
829
+ top: z.ZodNullable<z.ZodNumber>;
830
+ bottom: z.ZodNullable<z.ZodNumber>;
831
+ left: z.ZodNullable<z.ZodNumber>;
832
+ right: z.ZodNullable<z.ZodNumber>;
833
+ naturalTop: z.ZodNumber;
834
+ naturalLeft: z.ZodNumber;
835
+ containerWidth: z.ZodNumber;
836
+ containerHeight: z.ZodNumber;
837
+ elementWidth: z.ZodNumber;
838
+ elementHeight: z.ZodNumber;
839
+ anchorAbsoluteDepth: z.ZodNumber;
840
+ }, z.core.$strip>>;
841
+ initialWindowX: z.ZodOptional<z.ZodNumber>;
842
+ initialWindowY: z.ZodOptional<z.ZodNumber>;
843
+ hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
844
+ rect: z.ZodOptional<z.ZodObject<{
845
+ top: z.ZodNumber;
846
+ right: z.ZodNumber;
847
+ bottom: z.ZodNumber;
848
+ left: z.ZodNumber;
849
+ width: z.ZodNumber;
850
+ height: z.ZodNumber;
851
+ x: z.ZodNumber;
852
+ y: z.ZodNumber;
853
+ }, z.core.$strip>>;
854
+ }, z.core.$strip>;
855
+ }, z.core.$strip>>;
856
+ lastUpdated: z.ZodNumber;
857
+ }, z.core.$strip>;
858
+
859
+ /**
860
+ * @caliper/agent-bridge
861
+ * Enables AI agents to use Caliper's high-precision measurement engine
862
+ *
863
+ * @example
864
+ * ```typescript
865
+ * import { createMeasurementSystem, createSelectionSystem } from "@oyerinde/caliper/core";
866
+ * import { bridge } from "@oyerinde/caliper-bridge";
867
+ *
868
+ * const measurementSystem = createMeasurementSystem();
869
+ * const selectionSystem = createSelectionSystem();
870
+ *
871
+ * const cleanup = bridge({
872
+ * enabled: true,
873
+ * systems: { measurementSystem, selectionSystem }
874
+ * });
875
+ * ```
876
+ */
877
+
878
+ /**
879
+ * CaliperBridge Plugin Factory
880
+ *
881
+ * Creates a Caliper plugin that enables AI agents to interact with the overlay via
882
+ * a WebSocket bridge (local MCP relay) or direct global intent dispatching.
883
+ *
884
+ * When installed, this plugin:
885
+ * 1. Starts a local WebSocket server (or connects to one) to receive agent commands.
886
+ * 2. Exposes `window.dispatchCaliperIntent` for manual/in-page agentic calls.
887
+ * 3. Syncs the overlay state (camera, selection, measurements) back to the agent.
888
+ *
889
+ * @example
890
+ * ```ts
891
+ * import { init } from "@oyerinde/caliper/preset";
892
+ * import { CaliperBridge } from "@oyerinde/caliper/bridge";
893
+ *
894
+ * init({ ... }, [
895
+ * new CaliperBridge({
896
+ * enabled: true,
897
+ * wsPort: 3010,
898
+ * onStateChange: (state) => console.log("New Agent State:", state)
899
+ * })
900
+ * ]);
901
+ * ```
902
+ *
903
+ * @param config - The bridge configuration settings.
904
+ * @returns A CaliperPlugin that can be used with `caliper.use()` or in `init()`.
905
+ */
906
+ export declare function CaliperBridge(config: AgentBridgeConfig): CaliperPlugin;
907
+
908
+ /**
909
+ * All relevant computed styles extracted from getComputedStyle().
910
+ * Values are parsed to numbers where applicable.
911
+ */
912
+ declare const CaliperComputedStylesSchema: z.ZodObject<{
913
+ display: z.ZodOptional<z.ZodString>;
914
+ visibility: z.ZodOptional<z.ZodString>;
915
+ position: z.ZodOptional<z.ZodString>;
916
+ boxSizing: z.ZodOptional<z.ZodString>;
917
+ padding: z.ZodOptional<z.ZodObject<{
918
+ top: z.ZodNumber;
919
+ right: z.ZodNumber;
920
+ bottom: z.ZodNumber;
921
+ left: z.ZodNumber;
922
+ }, z.core.$strip>>;
923
+ margin: z.ZodOptional<z.ZodObject<{
924
+ top: z.ZodNumber;
925
+ right: z.ZodNumber;
926
+ bottom: z.ZodNumber;
927
+ left: z.ZodNumber;
928
+ }, z.core.$strip>>;
929
+ border: z.ZodOptional<z.ZodObject<{
930
+ top: z.ZodNumber;
931
+ right: z.ZodNumber;
932
+ bottom: z.ZodNumber;
933
+ left: z.ZodNumber;
934
+ }, z.core.$strip>>;
935
+ gap: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
936
+ flexDirection: z.ZodOptional<z.ZodString>;
937
+ justifyContent: z.ZodOptional<z.ZodString>;
938
+ alignItems: z.ZodOptional<z.ZodString>;
939
+ fontSize: z.ZodOptional<z.ZodNumber>;
940
+ fontWeight: z.ZodOptional<z.ZodString>;
941
+ fontFamily: z.ZodOptional<z.ZodString>;
942
+ lineHeight: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
943
+ letterSpacing: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
944
+ color: z.ZodOptional<z.ZodString>;
945
+ backgroundColor: z.ZodOptional<z.ZodString>;
946
+ borderColor: z.ZodOptional<z.ZodString>;
947
+ borderRadius: z.ZodOptional<z.ZodString>;
948
+ boxShadow: z.ZodOptional<z.ZodString>;
949
+ opacity: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
950
+ outline: z.ZodOptional<z.ZodString>;
951
+ outlineColor: z.ZodOptional<z.ZodString>;
952
+ zIndex: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
953
+ overflow: z.ZodOptional<z.ZodString>;
954
+ overflowX: z.ZodOptional<z.ZodString>;
955
+ overflowY: z.ZodOptional<z.ZodString>;
956
+ contentVisibility: z.ZodOptional<z.ZodString>;
957
+ }, z.core.$strip>;
958
+
959
+ declare interface CaliperCoreSystems {
960
+ measurementSystem: MeasurementSystem;
961
+ selectionSystem: SelectionSystem;
962
+ }
963
+
964
+ export declare type CaliperGetContextPayload = z.infer<typeof CaliperGetContextPayloadSchema>;
965
+
966
+ export declare const CaliperGetContextPayloadSchema: z.ZodObject<{}, z.core.$strip>;
967
+
968
+ export declare type CaliperInspectPayload = z.infer<typeof CaliperInspectPayloadSchema>;
969
+
970
+ export declare const CaliperInspectPayloadSchema: z.ZodObject<{
971
+ selector: z.ZodString;
972
+ }, z.core.$strip>;
973
+
974
+ export declare type CaliperIntent = JsonRpcRequest & ({
975
+ method: typeof CALIPER_METHODS.SELECT;
976
+ params: CaliperSelectPayload;
977
+ } | {
978
+ method: typeof CALIPER_METHODS.MEASURE;
979
+ params: CaliperMeasurePayload;
980
+ } | {
981
+ method: typeof CALIPER_METHODS.INSPECT;
982
+ params: CaliperInspectPayload;
983
+ } | {
984
+ method: typeof CALIPER_METHODS.FREEZE;
985
+ params: {};
986
+ } | {
987
+ method: typeof CALIPER_METHODS.CLEAR;
988
+ params: {};
989
+ } | {
990
+ method: typeof CALIPER_METHODS.WALK_DOM;
991
+ params: CaliperWalkDomPayload;
992
+ } | {
993
+ method: typeof CALIPER_METHODS.WALK_AND_MEASURE;
994
+ params: CaliperWalkAndMeasurePayload;
995
+ } | {
996
+ method: typeof CALIPER_METHODS.GET_CONTEXT;
997
+ params: CaliperGetContextPayload;
998
+ });
999
+
1000
+ /**
1001
+ * All structural measurements for a node.
1002
+ */
1003
+ declare const CaliperMeasurementsSchema: z.ZodObject<{
1004
+ toParent: z.ZodObject<{
1005
+ top: z.ZodNumber;
1006
+ left: z.ZodNumber;
1007
+ bottom: z.ZodNumber;
1008
+ right: z.ZodNumber;
1009
+ }, z.core.$strip>;
1010
+ toPreviousSibling: z.ZodNullable<z.ZodObject<{
1011
+ distance: z.ZodNumber;
1012
+ direction: z.ZodNullable<z.ZodEnum<{
1013
+ right: "right";
1014
+ left: "left";
1015
+ above: "above";
1016
+ below: "below";
1017
+ }>>;
1018
+ }, z.core.$strip>>;
1019
+ toNextSibling: z.ZodNullable<z.ZodObject<{
1020
+ distance: z.ZodNumber;
1021
+ direction: z.ZodNullable<z.ZodEnum<{
1022
+ right: "right";
1023
+ left: "left";
1024
+ above: "above";
1025
+ below: "below";
1026
+ }>>;
1027
+ }, z.core.$strip>>;
1028
+ indexInParent: z.ZodNumber;
1029
+ siblingCount: z.ZodNumber;
1030
+ }, z.core.$strip>;
1031
+
1032
+ export declare type CaliperMeasurePayload = z.infer<typeof CaliperMeasurePayloadSchema>;
1033
+
1034
+ export declare const CaliperMeasurePayloadSchema: z.ZodObject<{
1035
+ primarySelector: z.ZodString;
1036
+ secondarySelector: z.ZodString;
1037
+ }, z.core.$strip>;
1038
+
1039
+ export declare interface CaliperNode {
1040
+ agentId: string;
1041
+ selector: string;
1042
+ tag: string;
1043
+ htmlId?: string;
1044
+ classes: string[];
1045
+ textContent?: string;
1046
+ rect: z.infer<typeof RectSchema>;
1047
+ viewportRect: {
1048
+ top: number;
1049
+ left: number;
1050
+ };
1051
+ styles: z.infer<typeof CaliperComputedStylesSchema>;
1052
+ measurements: z.infer<typeof CaliperMeasurementsSchema>;
1053
+ depth: number;
1054
+ parentAgentId?: string;
1055
+ childCount: number;
1056
+ children: CaliperNode[];
1057
+ marker?: string;
1058
+ ariaHidden?: boolean;
1059
+ }
1060
+
1061
+ /**
1062
+ * A plugin allows extending Caliper's functionality by accessing the
1063
+ * OverlayInstance and internal systems.
1064
+ */
1065
+ declare interface CaliperPlugin {
1066
+ /** Unique identifier for the plugin. Used for deduplication. */
1067
+ name: string;
1068
+ /** Called when the plugin is installed on an overlay instance. */
1069
+ install: (instance: OverlayInstance) => void;
1070
+ /** Optional cleanup logic called when the overlay is disposed. */
1071
+ dispose?: () => void;
1072
+ }
1073
+
1074
+ export declare type CaliperSelectorInput = z.infer<typeof CaliperSelectorInputSchema>;
1075
+
1076
+ /**
1077
+ * The input data structure for a Caliper selection copy.
1078
+ */
1079
+ declare const CaliperSelectorInputSchema: z.ZodObject<{
1080
+ selector: z.ZodString;
1081
+ tag: z.ZodString;
1082
+ timestamp: z.ZodNumber;
1083
+ id: z.ZodOptional<z.ZodString>;
1084
+ text: z.ZodOptional<z.ZodString>;
1085
+ classes: z.ZodOptional<z.ZodArray<z.ZodString>>;
1086
+ tabId: z.ZodOptional<z.ZodString>;
1087
+ nthChild: z.ZodOptional<z.ZodNumber>;
1088
+ x: z.ZodOptional<z.ZodNumber>;
1089
+ y: z.ZodOptional<z.ZodNumber>;
1090
+ depth: z.ZodOptional<z.ZodNumber>;
1091
+ marker: z.ZodOptional<z.ZodString>;
1092
+ scrollHierarchy: z.ZodOptional<z.ZodArray<z.ZodObject<{
1093
+ initialScrollTop: z.ZodNumber;
1094
+ initialScrollLeft: z.ZodNumber;
1095
+ containerRect: z.ZodNullable<z.ZodObject<{
1096
+ top: z.ZodNumber;
1097
+ right: z.ZodNumber;
1098
+ bottom: z.ZodNumber;
1099
+ left: z.ZodNumber;
1100
+ width: z.ZodNumber;
1101
+ height: z.ZodNumber;
1102
+ x: z.ZodNumber;
1103
+ y: z.ZodNumber;
1104
+ }, z.core.$strip>>;
1105
+ absoluteDepth: z.ZodNumber;
1106
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
1107
+ }, z.core.$strip>>>;
1108
+ position: z.ZodOptional<z.ZodEnum<{
1109
+ static: "static";
1110
+ relative: "relative";
1111
+ absolute: "absolute";
1112
+ fixed: "fixed";
1113
+ sticky: "sticky";
1114
+ }>>;
1115
+ stickyConfig: z.ZodOptional<z.ZodObject<{
1116
+ top: z.ZodNullable<z.ZodNumber>;
1117
+ bottom: z.ZodNullable<z.ZodNumber>;
1118
+ left: z.ZodNullable<z.ZodNumber>;
1119
+ right: z.ZodNullable<z.ZodNumber>;
1120
+ naturalTop: z.ZodNumber;
1121
+ naturalLeft: z.ZodNumber;
1122
+ containerWidth: z.ZodNumber;
1123
+ containerHeight: z.ZodNumber;
1124
+ elementWidth: z.ZodNumber;
1125
+ elementHeight: z.ZodNumber;
1126
+ anchorAbsoluteDepth: z.ZodNumber;
1127
+ }, z.core.$strip>>;
1128
+ initialWindowX: z.ZodOptional<z.ZodNumber>;
1129
+ initialWindowY: z.ZodOptional<z.ZodNumber>;
1130
+ hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
1131
+ rect: z.ZodOptional<z.ZodObject<{
1132
+ top: z.ZodNumber;
1133
+ right: z.ZodNumber;
1134
+ bottom: z.ZodNumber;
1135
+ left: z.ZodNumber;
1136
+ width: z.ZodNumber;
1137
+ height: z.ZodNumber;
1138
+ x: z.ZodNumber;
1139
+ y: z.ZodNumber;
1140
+ }, z.core.$strip>>;
1141
+ }, z.core.$strip>;
1142
+
1143
+ export declare type CaliperSelectPayload = z.infer<typeof CaliperSelectPayloadSchema>;
1144
+
1145
+ export declare const CaliperSelectPayloadSchema: z.ZodObject<{
1146
+ selector: z.ZodString;
1147
+ }, z.core.$strip>;
1148
+
1149
+ export declare type CaliperWalkAndMeasurePayload = z.infer<typeof CaliperWalkAndMeasurePayloadSchema>;
1150
+
1151
+ export declare const CaliperWalkAndMeasurePayloadSchema: z.ZodObject<{
1152
+ maxDepth: z.ZodOptional<z.ZodNumber>;
1153
+ maxNodes: z.ZodOptional<z.ZodNumber>;
1154
+ continueFrom: z.ZodOptional<z.ZodString>;
1155
+ minElementSize: z.ZodOptional<z.ZodNumber>;
1156
+ ignoreSelectors: z.ZodOptional<z.ZodArray<z.ZodString>>;
1157
+ selector: z.ZodString;
1158
+ }, z.core.$strip>;
1159
+
1160
+ export declare type CaliperWalkDomPayload = z.infer<typeof CaliperWalkDomPayloadSchema>;
1161
+
1162
+ export declare const CaliperWalkDomPayloadSchema: z.ZodObject<{
1163
+ selector: z.ZodString;
1164
+ depth: z.ZodOptional<z.ZodNumber>;
1165
+ }, z.core.$strip>;
1166
+
1167
+ export declare type CursorContext = Prettify<z.infer<typeof CursorContextSchema>>;
1168
+
1169
+ declare const CursorContextSchema: z.ZodEnum<{
1170
+ parent: "parent";
1171
+ child: "child";
1172
+ sibling: "sibling";
1173
+ }>;
1174
+
1175
+ /**
1176
+ * Dispatches a high-level intent to the Caliper engine.
1177
+ *
1178
+ * This function is used to programmatically trigger Caliper actions (like measuring between elements)
1179
+ * using the standardized intent format. Requires a `CaliperBridge` to be installed and active.
1180
+ *
1181
+ * @param intent - The action to perform (e.g., 'measure', 'select', 'inspect').
1182
+ * @returns A promise resolving to the result of the action, containing success status and metrics.
1183
+ */
1184
+ export declare function dispatchCaliperIntent(intent: CaliperIntent): Promise<CaliperActionResult>;
1185
+
1186
+ declare type Flatten<T> = T extends Primitive ? T : T extends Array<infer U> ? Array<Flatten<U>> : T extends Set<infer U> ? Set<Flatten<U>> : T extends Map<infer K, infer V> ? Map<Flatten<K>, Flatten<V>> : T extends object ? {
1187
+ [K in keyof T]: Flatten<T[K]>;
1188
+ } : T;
1189
+
1190
+ declare type Infer<Schema extends z_2.ZodTypeAny> = Flatten<z_2.infer<Schema>>;
1191
+
1192
+ export declare type JSONRPCRequest = Infer<typeof JSONRPCRequestSchema>;
1193
+
1194
+ declare type JsonRpcRequest = JSONRPCRequest;
1195
+
1196
+ /**
1197
+ * A request that expects a response.
1198
+ */
1199
+ declare const JSONRPCRequestSchema: z_2.ZodObject<{
1200
+ method: z_2.ZodString;
1201
+ params: z_2.ZodOptional<z_2.ZodObject<{
1202
+ _meta: z_2.ZodOptional<z_2.ZodObject<{
1203
+ /**
1204
+ * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
1205
+ */
1206
+ progressToken: z_2.ZodOptional<z_2.ZodUnion<readonly [z_2.ZodString, z_2.ZodNumber]>>;
1207
+ /**
1208
+ * If specified, this request is related to the provided task.
1209
+ */
1210
+ "io.modelcontextprotocol/related-task": z_2.ZodOptional<z_2.ZodObject<{
1211
+ taskId: z_2.ZodString;
1212
+ }, z_2.core.$strip>>;
1213
+ }, z_2.core.$loose>>;
1214
+ }, z_2.core.$loose>>;
1215
+ jsonrpc: z_2.ZodLiteral<"2.0">;
1216
+ id: z_2.ZodUnion<readonly [z_2.ZodString, z_2.ZodNumber]>;
1217
+ }, z_2.core.$strict>;
1218
+
1219
+ export declare type MeasurementLine = Prettify<z.infer<typeof MeasurementLineSchema>>;
1220
+
1221
+ declare const MeasurementLineSchema: z.ZodObject<{
1222
+ type: z.ZodEnum<{
1223
+ top: "top";
1224
+ right: "right";
1225
+ bottom: "bottom";
1226
+ left: "left";
1227
+ distance: "distance";
1228
+ }>;
1229
+ value: z.ZodNumber;
1230
+ start: z.ZodObject<{
1231
+ x: z.ZodNumber;
1232
+ y: z.ZodNumber;
1233
+ }, z.core.$strip>;
1234
+ end: z.ZodObject<{
1235
+ x: z.ZodNumber;
1236
+ y: z.ZodNumber;
1237
+ }, z.core.$strip>;
1238
+ startSync: z.ZodOptional<z.ZodEnum<{
1239
+ primary: "primary";
1240
+ secondary: "secondary";
1241
+ }>>;
1242
+ endSync: z.ZodOptional<z.ZodEnum<{
1243
+ primary: "primary";
1244
+ secondary: "secondary";
1245
+ }>>;
1246
+ }, z.core.$strip>;
1247
+
1248
+ export declare type MeasurementResult = Prettify<z.infer<typeof MeasurementResultSchema>>;
1249
+
1250
+ declare type MeasurementResult_2 = Remap<MeasurementResult, {
1251
+ primary: DOMRect;
1252
+ secondary: DOMRect | null;
1253
+ primaryHierarchy: ScrollState_2[];
1254
+ secondaryHierarchy: ScrollState_2[];
1255
+ secondaryElement: Element | null;
1256
+ }>;
1257
+
1258
+ declare const MeasurementResultSchema: z.ZodObject<{
1259
+ context: z.ZodNullable<z.ZodEnum<{
1260
+ parent: "parent";
1261
+ child: "child";
1262
+ sibling: "sibling";
1263
+ }>>;
1264
+ lines: z.ZodArray<z.ZodObject<{
1265
+ type: z.ZodEnum<{
1266
+ top: "top";
1267
+ right: "right";
1268
+ bottom: "bottom";
1269
+ left: "left";
1270
+ distance: "distance";
1271
+ }>;
1272
+ value: z.ZodNumber;
1273
+ start: z.ZodObject<{
1274
+ x: z.ZodNumber;
1275
+ y: z.ZodNumber;
1276
+ }, z.core.$strip>;
1277
+ end: z.ZodObject<{
1278
+ x: z.ZodNumber;
1279
+ y: z.ZodNumber;
1280
+ }, z.core.$strip>;
1281
+ startSync: z.ZodOptional<z.ZodEnum<{
1282
+ primary: "primary";
1283
+ secondary: "secondary";
1284
+ }>>;
1285
+ endSync: z.ZodOptional<z.ZodEnum<{
1286
+ primary: "primary";
1287
+ secondary: "secondary";
1288
+ }>>;
1289
+ }, z.core.$strip>>;
1290
+ primary: z.ZodObject<{
1291
+ top: z.ZodNumber;
1292
+ right: z.ZodNumber;
1293
+ bottom: z.ZodNumber;
1294
+ left: z.ZodNumber;
1295
+ width: z.ZodNumber;
1296
+ height: z.ZodNumber;
1297
+ x: z.ZodNumber;
1298
+ y: z.ZodNumber;
1299
+ }, z.core.$strip>;
1300
+ secondary: z.ZodNullable<z.ZodObject<{
1301
+ top: z.ZodNumber;
1302
+ right: z.ZodNumber;
1303
+ bottom: z.ZodNumber;
1304
+ left: z.ZodNumber;
1305
+ width: z.ZodNumber;
1306
+ height: z.ZodNumber;
1307
+ x: z.ZodNumber;
1308
+ y: z.ZodNumber;
1309
+ }, z.core.$strip>>;
1310
+ timestamp: z.ZodNumber;
1311
+ primaryHierarchy: z.ZodArray<z.ZodObject<{
1312
+ initialScrollTop: z.ZodNumber;
1313
+ initialScrollLeft: z.ZodNumber;
1314
+ containerRect: z.ZodNullable<z.ZodObject<{
1315
+ top: z.ZodNumber;
1316
+ right: z.ZodNumber;
1317
+ bottom: z.ZodNumber;
1318
+ left: z.ZodNumber;
1319
+ width: z.ZodNumber;
1320
+ height: z.ZodNumber;
1321
+ x: z.ZodNumber;
1322
+ y: z.ZodNumber;
1323
+ }, z.core.$strip>>;
1324
+ absoluteDepth: z.ZodNumber;
1325
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
1326
+ }, z.core.$strip>>;
1327
+ secondaryHierarchy: z.ZodArray<z.ZodObject<{
1328
+ initialScrollTop: z.ZodNumber;
1329
+ initialScrollLeft: z.ZodNumber;
1330
+ containerRect: z.ZodNullable<z.ZodObject<{
1331
+ top: z.ZodNumber;
1332
+ right: z.ZodNumber;
1333
+ bottom: z.ZodNumber;
1334
+ left: z.ZodNumber;
1335
+ width: z.ZodNumber;
1336
+ height: z.ZodNumber;
1337
+ x: z.ZodNumber;
1338
+ y: z.ZodNumber;
1339
+ }, z.core.$strip>>;
1340
+ absoluteDepth: z.ZodNumber;
1341
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
1342
+ }, z.core.$strip>>;
1343
+ primaryPosition: z.ZodEnum<{
1344
+ static: "static";
1345
+ relative: "relative";
1346
+ absolute: "absolute";
1347
+ fixed: "fixed";
1348
+ sticky: "sticky";
1349
+ }>;
1350
+ secondaryPosition: z.ZodEnum<{
1351
+ static: "static";
1352
+ relative: "relative";
1353
+ absolute: "absolute";
1354
+ fixed: "fixed";
1355
+ sticky: "sticky";
1356
+ }>;
1357
+ primaryWinX: z.ZodNumber;
1358
+ primaryWinY: z.ZodNumber;
1359
+ secondaryWinX: z.ZodNumber;
1360
+ secondaryWinY: z.ZodNumber;
1361
+ primarySticky: z.ZodOptional<z.ZodObject<{
1362
+ top: z.ZodNullable<z.ZodNumber>;
1363
+ bottom: z.ZodNullable<z.ZodNumber>;
1364
+ left: z.ZodNullable<z.ZodNumber>;
1365
+ right: z.ZodNullable<z.ZodNumber>;
1366
+ naturalTop: z.ZodNumber;
1367
+ naturalLeft: z.ZodNumber;
1368
+ containerWidth: z.ZodNumber;
1369
+ containerHeight: z.ZodNumber;
1370
+ elementWidth: z.ZodNumber;
1371
+ elementHeight: z.ZodNumber;
1372
+ anchorAbsoluteDepth: z.ZodNumber;
1373
+ }, z.core.$strip>>;
1374
+ secondarySticky: z.ZodOptional<z.ZodObject<{
1375
+ top: z.ZodNullable<z.ZodNumber>;
1376
+ bottom: z.ZodNullable<z.ZodNumber>;
1377
+ left: z.ZodNullable<z.ZodNumber>;
1378
+ right: z.ZodNullable<z.ZodNumber>;
1379
+ naturalTop: z.ZodNumber;
1380
+ naturalLeft: z.ZodNumber;
1381
+ containerWidth: z.ZodNumber;
1382
+ containerHeight: z.ZodNumber;
1383
+ elementWidth: z.ZodNumber;
1384
+ elementHeight: z.ZodNumber;
1385
+ anchorAbsoluteDepth: z.ZodNumber;
1386
+ }, z.core.$strip>>;
1387
+ primaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
1388
+ secondaryHasContainingBlock: z.ZodOptional<z.ZodBoolean>;
1389
+ }, z.core.$strip>;
1390
+
1391
+ /**
1392
+ * Measurement state machine
1393
+ * IDLE → ARMED → MEASURING → FROZEN → IDLE
1394
+ */
1395
+ declare type MeasurementState = "IDLE" | "ARMED" | "MEASURING" | "FROZEN";
1396
+
1397
+ declare interface MeasurementSystem {
1398
+ measure: (selectedElement: Element, cursor: {
1399
+ x: number;
1400
+ y: number;
1401
+ }) => void;
1402
+ abort: () => void;
1403
+ stop: () => void;
1404
+ freeze: () => void;
1405
+ unfreeze: (isAltDown: boolean) => void;
1406
+ cleanup: () => void;
1407
+ getState: () => MeasurementState;
1408
+ getCurrentResult: () => MeasurementResult_2 | null;
1409
+ getSecondaryElement: () => Element | null;
1410
+ getCalculator: () => CalculatorIntegration;
1411
+ getProjection: () => ProjectionSystem;
1412
+ getRuler: () => RulerSystem;
1413
+ onStateChange: (listener: MeasurementSystemListener) => () => void;
1414
+ updatePrimaryRect: (rect: DOMRect) => void;
1415
+ updateSecondaryRect: (rect: DOMRect) => void;
1416
+ applyResult: (result: MeasurementResult_2) => void;
1417
+ }
1418
+
1419
+ declare type MeasurementSystemListener = () => void;
1420
+
1421
+ /**
1422
+ * Handle to a running Caliper overlay.
1423
+ */
1424
+ declare interface OverlayInstance {
1425
+ /**
1426
+ * Mounts the overlay into the DOM.
1427
+ * By default, it mounts into document.documentElement (safe for Shadow DOM).
1428
+ */
1429
+ mount: (container?: HTMLElement) => void;
1430
+ /**
1431
+ * Removes the overlay from the DOM and cleans up all event listeners and systems.
1432
+ */
1433
+ dispose: () => void;
1434
+ /**
1435
+ * Synchronously returns the internal systems if they are initialized.
1436
+ */
1437
+ getSystems: () => CaliperCoreSystems | null;
1438
+ /**
1439
+ * Asynchronous helper that resolves when the internal systems are ready.
1440
+ * Useful for plugins that need to interact with the DOM or state immediately.
1441
+ */
1442
+ waitForSystems: () => Promise<CaliperCoreSystems>;
1443
+ /**
1444
+ * Registers a plugin with this instance.
1445
+ */
1446
+ use: (plugin: CaliperPlugin) => OverlayInstance;
1447
+ /** Whether the overlay is currently mounted in the document. */
1448
+ mounted: boolean;
1449
+ }
1450
+
1451
+ export declare type PositionMode = Prettify<z.infer<typeof PositionModeSchema>>;
1452
+
1453
+ declare const PositionModeSchema: z.ZodEnum<{
1454
+ static: "static";
1455
+ relative: "relative";
1456
+ absolute: "absolute";
1457
+ fixed: "fixed";
1458
+ sticky: "sticky";
1459
+ }>;
1460
+
1461
+ declare type Prettify<T> = {
1462
+ [K in keyof T]: T[K];
1463
+ } & {};
1464
+
1465
+ declare type Prettify_2<T> = {
1466
+ [K in keyof T]: T[K];
1467
+ } & {};
1468
+
1469
+ declare type Primitive = string | number | boolean | bigint | null | undefined;
1470
+
1471
+ declare type ProjectionDirection = "top" | "right" | "bottom" | "left";
1472
+
1473
+ declare type ProjectionListener = (state: ProjectionState) => void;
1474
+
1475
+ declare interface ProjectionState {
1476
+ direction: ProjectionDirection | null;
1477
+ value: string;
1478
+ element: HTMLElement | null;
1479
+ }
1480
+
1481
+ declare interface ProjectionSystem {
1482
+ getState: () => ProjectionState;
1483
+ setDirection: (direction: ProjectionDirection | null) => void;
1484
+ setElement: (element: HTMLElement | null) => void;
1485
+ appendValue: (char: string, max?: number) => void;
1486
+ capValue: (max: number) => void;
1487
+ backspace: () => void;
1488
+ clear: () => void;
1489
+ onUpdate: (listener: ProjectionListener) => () => void;
1490
+ }
1491
+
1492
+ export declare type Rect = Prettify<z.infer<typeof RectSchema>>;
1493
+
1494
+ declare const RectSchema: z.ZodObject<{
1495
+ top: z.ZodNumber;
1496
+ right: z.ZodNumber;
1497
+ bottom: z.ZodNumber;
1498
+ left: z.ZodNumber;
1499
+ width: z.ZodNumber;
1500
+ height: z.ZodNumber;
1501
+ x: z.ZodNumber;
1502
+ y: z.ZodNumber;
1503
+ }, z.core.$strip>;
1504
+
1505
+ declare type Remap<T, U> = Prettify_2<Omit<T, keyof U> & U>;
1506
+
1507
+ declare interface RulerLine {
1508
+ id: string;
1509
+ type: "horizontal" | "vertical";
1510
+ position: number;
1511
+ }
1512
+
1513
+ declare type RulerListener = (state: RulerState) => void;
1514
+
1515
+ declare interface RulerState {
1516
+ lines: RulerLine[];
1517
+ }
1518
+
1519
+ declare interface RulerSystem {
1520
+ getState: () => RulerState;
1521
+ addPair: (x: number, y: number) => string | null;
1522
+ updateLine: (id: string, position: number) => void;
1523
+ removeLine: (id: string) => void;
1524
+ clear: () => void;
1525
+ onUpdate: (listener: RulerListener) => () => void;
1526
+ }
1527
+
1528
+ export declare type ScrollState = Prettify<z.infer<typeof ScrollStateSchema>>;
1529
+
1530
+ declare interface ScrollState_2 extends ScrollState {
1531
+ element?: HTMLElement;
1532
+ containerRect: DOMRect | null;
1533
+ }
1534
+
1535
+ declare const ScrollStateSchema: z.ZodObject<{
1536
+ initialScrollTop: z.ZodNumber;
1537
+ initialScrollLeft: z.ZodNumber;
1538
+ containerRect: z.ZodNullable<z.ZodObject<{
1539
+ top: z.ZodNumber;
1540
+ right: z.ZodNumber;
1541
+ bottom: z.ZodNumber;
1542
+ left: z.ZodNumber;
1543
+ width: z.ZodNumber;
1544
+ height: z.ZodNumber;
1545
+ x: z.ZodNumber;
1546
+ y: z.ZodNumber;
1547
+ }, z.core.$strip>>;
1548
+ absoluteDepth: z.ZodNumber;
1549
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
1550
+ }, z.core.$strip>;
1551
+
1552
+ export declare type SelectionMetadata = Prettify<z.infer<typeof SelectionMetadataSchema>>;
1553
+
1554
+ /**
1555
+ * Selection system for tracking selected elements
1556
+ */
1557
+ declare type SelectionMetadata_2 = Remap<SelectionMetadata, {
1558
+ element: Element | null;
1559
+ rect: DOMRect | null;
1560
+ scrollHierarchy: ScrollState_2[];
1561
+ }>;
1562
+
1563
+ declare const SelectionMetadataSchema: z.ZodObject<{
1564
+ rect: z.ZodNullable<z.ZodObject<{
1565
+ top: z.ZodNumber;
1566
+ right: z.ZodNumber;
1567
+ bottom: z.ZodNumber;
1568
+ left: z.ZodNumber;
1569
+ width: z.ZodNumber;
1570
+ height: z.ZodNumber;
1571
+ x: z.ZodNumber;
1572
+ y: z.ZodNumber;
1573
+ }, z.core.$strip>>;
1574
+ scrollHierarchy: z.ZodArray<z.ZodObject<{
1575
+ initialScrollTop: z.ZodNumber;
1576
+ initialScrollLeft: z.ZodNumber;
1577
+ containerRect: z.ZodNullable<z.ZodObject<{
1578
+ top: z.ZodNumber;
1579
+ right: z.ZodNumber;
1580
+ bottom: z.ZodNumber;
1581
+ left: z.ZodNumber;
1582
+ width: z.ZodNumber;
1583
+ height: z.ZodNumber;
1584
+ x: z.ZodNumber;
1585
+ y: z.ZodNumber;
1586
+ }, z.core.$strip>>;
1587
+ absoluteDepth: z.ZodNumber;
1588
+ hasStickyAncestor: z.ZodOptional<z.ZodBoolean>;
1589
+ }, z.core.$strip>>;
1590
+ position: z.ZodEnum<{
1591
+ static: "static";
1592
+ relative: "relative";
1593
+ absolute: "absolute";
1594
+ fixed: "fixed";
1595
+ sticky: "sticky";
1596
+ }>;
1597
+ stickyConfig: z.ZodOptional<z.ZodObject<{
1598
+ top: z.ZodNullable<z.ZodNumber>;
1599
+ bottom: z.ZodNullable<z.ZodNumber>;
1600
+ left: z.ZodNullable<z.ZodNumber>;
1601
+ right: z.ZodNullable<z.ZodNumber>;
1602
+ naturalTop: z.ZodNumber;
1603
+ naturalLeft: z.ZodNumber;
1604
+ containerWidth: z.ZodNumber;
1605
+ containerHeight: z.ZodNumber;
1606
+ elementWidth: z.ZodNumber;
1607
+ elementHeight: z.ZodNumber;
1608
+ anchorAbsoluteDepth: z.ZodNumber;
1609
+ }, z.core.$strip>>;
1610
+ initialWindowX: z.ZodNumber;
1611
+ initialWindowY: z.ZodNumber;
1612
+ depth: z.ZodNumber;
1613
+ hasContainingBlock: z.ZodOptional<z.ZodBoolean>;
1614
+ }, z.core.$strip>;
1615
+
1616
+ declare interface SelectionSystem {
1617
+ select: (element: Element | null) => void;
1618
+ getSelected: () => Element | null;
1619
+ getSelectedRect: () => DOMRect | null;
1620
+ getMetadata: () => SelectionMetadata_2;
1621
+ clear: () => void;
1622
+ onUpdate: (callback: (metadata: SelectionMetadata_2) => void) => () => void;
1623
+ updateRect: (rect: DOMRect) => void;
1624
+ }
1625
+
1626
+ export declare type StickyConfig = Prettify<z.infer<typeof StickyConfigSchema>>;
1627
+
1628
+ declare const StickyConfigSchema: z.ZodObject<{
1629
+ top: z.ZodNullable<z.ZodNumber>;
1630
+ bottom: z.ZodNullable<z.ZodNumber>;
1631
+ left: z.ZodNullable<z.ZodNumber>;
1632
+ right: z.ZodNullable<z.ZodNumber>;
1633
+ naturalTop: z.ZodNumber;
1634
+ naturalLeft: z.ZodNumber;
1635
+ containerWidth: z.ZodNumber;
1636
+ containerHeight: z.ZodNumber;
1637
+ elementWidth: z.ZodNumber;
1638
+ elementHeight: z.ZodNumber;
1639
+ anchorAbsoluteDepth: z.ZodNumber;
1640
+ }, z.core.$strip>;
1641
+
1642
+ declare const ViewportSchema: z.ZodObject<{
1643
+ width: z.ZodNumber;
1644
+ height: z.ZodNumber;
1645
+ scrollX: z.ZodNumber;
1646
+ scrollY: z.ZodNumber;
1647
+ }, z.core.$strip>;
1648
+
1649
+ export declare type ViewportState = z.infer<typeof ViewportSchema>;
1650
+
1651
+ export { }