@oyerinde/caliper 0.2.0 → 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.
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { VERSION, caliperProps, getConfig, createOverlay as init, setConfig } from './chunk-XYBNY4BT.js';
1
+ export { VERSION, caliperProps, getConfig, createOverlay as init, setConfig } from './chunk-MTIWXK3P.js';
package/dist/mcp.cjs CHANGED
@@ -1634,7 +1634,7 @@ var CaliperMcpServer = class {
1634
1634
  this.port = port2;
1635
1635
  this.server = new mcp_js.McpServer({
1636
1636
  name: "caliper-mcp-server",
1637
- version: "0.2.0"
1637
+ version: "0.2.1"
1638
1638
  });
1639
1639
  this.registerTools();
1640
1640
  this.registerResources();
package/dist/mcp.js CHANGED
@@ -1632,7 +1632,7 @@ var CaliperMcpServer = class {
1632
1632
  this.port = port2;
1633
1633
  this.server = new McpServer({
1634
1634
  name: "caliper-mcp-server",
1635
- version: "0.2.0"
1635
+ version: "0.2.1"
1636
1636
  });
1637
1637
  this.registerTools();
1638
1638
  this.registerResources();
package/dist/preset.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkOSQHATBH_cjs = require('./chunk-OSQHATBH.cjs');
4
- var chunk3W2YKDGV_cjs = require('./chunk-3W2YKDGV.cjs');
3
+ var chunkP37B6G5P_cjs = require('./chunk-P37B6G5P.cjs');
4
+ var chunkPYAVLOZM_cjs = require('./chunk-PYAVLOZM.cjs');
5
5
 
6
6
  /**
7
7
  * @name @oyerinde/caliper
@@ -16,7 +16,7 @@ var chunk3W2YKDGV_cjs = require('./chunk-3W2YKDGV.cjs');
16
16
 
17
17
  // src/preset.ts
18
18
  function init(configuration, extensions = []) {
19
- const caliperInstance = chunkOSQHATBH_cjs.createOverlay(configuration);
19
+ const caliperInstance = chunkP37B6G5P_cjs.createOverlay(configuration);
20
20
  if (extensions && Array.isArray(extensions)) {
21
21
  extensions.forEach((extension) => {
22
22
  if (typeof extension === "function") {
@@ -31,14 +31,14 @@ function init(configuration, extensions = []) {
31
31
 
32
32
  Object.defineProperty(exports, "caliperProps", {
33
33
  enumerable: true,
34
- get: function () { return chunkOSQHATBH_cjs.caliperProps; }
34
+ get: function () { return chunkP37B6G5P_cjs.caliperProps; }
35
35
  });
36
36
  Object.defineProperty(exports, "CaliperAgentStateSchema", {
37
37
  enumerable: true,
38
- get: function () { return chunk3W2YKDGV_cjs.CaliperAgentStateSchema; }
38
+ get: function () { return chunkPYAVLOZM_cjs.CaliperAgentStateSchema; }
39
39
  });
40
40
  Object.defineProperty(exports, "CaliperBridge", {
41
41
  enumerable: true,
42
- get: function () { return chunk3W2YKDGV_cjs.CaliperBridge; }
42
+ get: function () { return chunkPYAVLOZM_cjs.CaliperBridge; }
43
43
  });
44
44
  exports.init = init;
package/dist/preset.d.cts CHANGED
@@ -7,6 +7,8 @@ export declare interface AgentBridgeConfig {
7
7
  wsPort?: number;
8
8
  /** Callback for agent state changes */
9
9
  onStateChange?: (state: CaliperAgentState) => void;
10
+ /** Name of a global window function to call on state changes (IIFE/CDN-safe, JSON-serializable) */
11
+ onStateChangeGlobal?: string;
10
12
  }
11
13
 
12
14
  export declare interface AnimationConfig {
@@ -488,9 +490,15 @@ export declare const CaliperAgentStateSchema: z.ZodObject<{
488
490
  */
489
491
  export declare function CaliperBridge(config: AgentBridgeConfig): CaliperPlugin;
490
492
 
491
- export declare interface CaliperCoreSystems {
492
- measurementSystem: MeasurementSystem;
493
- selectionSystem: SelectionSystem;
493
+ export declare interface CaliperConfig {
494
+ /** Customize the visual appearance of the overlay (colors, shadows). */
495
+ theme?: ThemeConfig;
496
+ /** Customize keyboard shortcuts for all interactions. */
497
+ commands?: CommandsConfig;
498
+ /** Control the boundary box lerp animation behavior. */
499
+ animation?: AnimationConfig;
500
+ /** Enable debug logging (default: true). All logs are stripped from production builds. */
501
+ debug?: boolean;
494
502
  }
495
503
 
496
504
  /**
@@ -571,7 +579,7 @@ export declare type Extension = ((instance: OverlayInstance) => void) | CaliperP
571
579
  * @param extensions - An array of functions or plugin objects to install immediately.
572
580
  * @returns The initialized Caliper OverlayInstance.
573
581
  */
574
- export declare function init(configuration?: OverlayConfig, extensions?: Array<Extension>): OverlayInstance;
582
+ export declare function init(configuration?: CaliperConfig, extensions?: Array<Extension>): OverlayInstance;
575
583
 
576
584
  declare type MeasurementResult = Remap<MeasurementResult_2, {
577
585
  primary: DOMRect;
@@ -746,19 +754,6 @@ declare interface MeasurementSystem {
746
754
 
747
755
  declare type MeasurementSystemListener = () => void;
748
756
 
749
- export declare interface OverlayConfig {
750
- /** Customize the visual appearance of the overlay (colors, shadows). */
751
- theme?: ThemeConfig;
752
- /** Customize keyboard shortcuts for all interactions. */
753
- commands?: CommandsConfig;
754
- /** Control the boundary box lerp animation behavior. */
755
- animation?: AnimationConfig;
756
- /** Configure the Agent Bridge for AI/MCP integration. */
757
- bridge?: AgentBridgeConfig;
758
- /** Enable debug logging (default: true). All logs are stripped from production builds. */
759
- debug?: boolean;
760
- }
761
-
762
757
  /**
763
758
  * Handle to a running Caliper overlay.
764
759
  */
@@ -775,12 +770,12 @@ export declare interface OverlayInstance {
775
770
  /**
776
771
  * Synchronously returns the internal systems if they are initialized.
777
772
  */
778
- getSystems: () => CaliperCoreSystems | null;
773
+ getSystems: () => Systems | null;
779
774
  /**
780
775
  * Asynchronous helper that resolves when the internal systems are ready.
781
776
  * Useful for plugins that need to interact with the DOM or state immediately.
782
777
  */
783
- waitForSystems: () => Promise<CaliperCoreSystems>;
778
+ waitForSystems: () => Promise<Systems>;
784
779
  /**
785
780
  * Registers a plugin with this instance.
786
781
  */
@@ -949,6 +944,11 @@ declare interface SelectionSystem {
949
944
  updateRect: (rect: DOMRect) => void;
950
945
  }
951
946
 
947
+ export declare interface Systems {
948
+ measurementSystem: MeasurementSystem;
949
+ selectionSystem: SelectionSystem;
950
+ }
951
+
952
952
  export declare interface ThemeConfig {
953
953
  primary?: string;
954
954
  secondary?: string;
package/dist/preset.d.ts CHANGED
@@ -7,6 +7,8 @@ export declare interface AgentBridgeConfig {
7
7
  wsPort?: number;
8
8
  /** Callback for agent state changes */
9
9
  onStateChange?: (state: CaliperAgentState) => void;
10
+ /** Name of a global window function to call on state changes (IIFE/CDN-safe, JSON-serializable) */
11
+ onStateChangeGlobal?: string;
10
12
  }
11
13
 
12
14
  export declare interface AnimationConfig {
@@ -488,9 +490,15 @@ export declare const CaliperAgentStateSchema: z.ZodObject<{
488
490
  */
489
491
  export declare function CaliperBridge(config: AgentBridgeConfig): CaliperPlugin;
490
492
 
491
- export declare interface CaliperCoreSystems {
492
- measurementSystem: MeasurementSystem;
493
- selectionSystem: SelectionSystem;
493
+ export declare interface CaliperConfig {
494
+ /** Customize the visual appearance of the overlay (colors, shadows). */
495
+ theme?: ThemeConfig;
496
+ /** Customize keyboard shortcuts for all interactions. */
497
+ commands?: CommandsConfig;
498
+ /** Control the boundary box lerp animation behavior. */
499
+ animation?: AnimationConfig;
500
+ /** Enable debug logging (default: true). All logs are stripped from production builds. */
501
+ debug?: boolean;
494
502
  }
495
503
 
496
504
  /**
@@ -571,7 +579,7 @@ export declare type Extension = ((instance: OverlayInstance) => void) | CaliperP
571
579
  * @param extensions - An array of functions or plugin objects to install immediately.
572
580
  * @returns The initialized Caliper OverlayInstance.
573
581
  */
574
- export declare function init(configuration?: OverlayConfig, extensions?: Array<Extension>): OverlayInstance;
582
+ export declare function init(configuration?: CaliperConfig, extensions?: Array<Extension>): OverlayInstance;
575
583
 
576
584
  declare type MeasurementResult = Remap<MeasurementResult_2, {
577
585
  primary: DOMRect;
@@ -746,19 +754,6 @@ declare interface MeasurementSystem {
746
754
 
747
755
  declare type MeasurementSystemListener = () => void;
748
756
 
749
- export declare interface OverlayConfig {
750
- /** Customize the visual appearance of the overlay (colors, shadows). */
751
- theme?: ThemeConfig;
752
- /** Customize keyboard shortcuts for all interactions. */
753
- commands?: CommandsConfig;
754
- /** Control the boundary box lerp animation behavior. */
755
- animation?: AnimationConfig;
756
- /** Configure the Agent Bridge for AI/MCP integration. */
757
- bridge?: AgentBridgeConfig;
758
- /** Enable debug logging (default: true). All logs are stripped from production builds. */
759
- debug?: boolean;
760
- }
761
-
762
757
  /**
763
758
  * Handle to a running Caliper overlay.
764
759
  */
@@ -775,12 +770,12 @@ export declare interface OverlayInstance {
775
770
  /**
776
771
  * Synchronously returns the internal systems if they are initialized.
777
772
  */
778
- getSystems: () => CaliperCoreSystems | null;
773
+ getSystems: () => Systems | null;
779
774
  /**
780
775
  * Asynchronous helper that resolves when the internal systems are ready.
781
776
  * Useful for plugins that need to interact with the DOM or state immediately.
782
777
  */
783
- waitForSystems: () => Promise<CaliperCoreSystems>;
778
+ waitForSystems: () => Promise<Systems>;
784
779
  /**
785
780
  * Registers a plugin with this instance.
786
781
  */
@@ -949,6 +944,11 @@ declare interface SelectionSystem {
949
944
  updateRect: (rect: DOMRect) => void;
950
945
  }
951
946
 
947
+ export declare interface Systems {
948
+ measurementSystem: MeasurementSystem;
949
+ selectionSystem: SelectionSystem;
950
+ }
951
+
952
952
  export declare interface ThemeConfig {
953
953
  primary?: string;
954
954
  secondary?: string;
package/dist/preset.js CHANGED
@@ -1,6 +1,6 @@
1
- import { createOverlay } from './chunk-XYBNY4BT.js';
2
- export { caliperProps } from './chunk-XYBNY4BT.js';
3
- export { CaliperAgentStateSchema, CaliperBridge } from './chunk-ACV6FK43.js';
1
+ import { createOverlay } from './chunk-MTIWXK3P.js';
2
+ export { caliperProps } from './chunk-MTIWXK3P.js';
3
+ export { CaliperAgentStateSchema, CaliperBridge } from './chunk-L47FGEH6.js';
4
4
 
5
5
  /**
6
6
  * @name @oyerinde/caliper
package/dist/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "0.2.0",
3
- "timestamp": "2026-02-12T22:43:35.307Z"
2
+ "version": "0.2.1",
3
+ "timestamp": "2026-02-16T00:51:24.222Z"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oyerinde/caliper",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "High-precision browser measurements, projections, and layout auditing",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -10,7 +10,7 @@
10
10
  "caliper": "./dist/mcp.js"
11
11
  },
12
12
  "author": "Daniel Oyerinde <oyerinde.daniel@yahoo.com> (https://danieloyerinde.com)",
13
- "homepage": "https://github.com/oyerindedaniel/caliper#readme",
13
+ "homepage": "https://caliper.danieloyerinde.com",
14
14
  "repository": {
15
15
  "type": "git",
16
16
  "url": "git+https://github.com/oyerindedaniel/caliper.git",
@@ -117,11 +117,11 @@
117
117
  "solid-js": "^1.9.10",
118
118
  "tsup": "^8.5.1",
119
119
  "typescript": "5.9.3",
120
- "@oyerinde/caliper-schema": "0.1.0",
121
120
  "@caliper/core": "0.0.0",
122
121
  "@caliper/overlay": "0.0.0",
123
- "@repo/eslint-config": "0.0.0",
122
+ "@oyerinde/caliper-schema": "0.1.0",
124
123
  "@oyerinde/caliper-bridge": "0.1.0",
124
+ "@repo/eslint-config": "0.0.0",
125
125
  "@repo/typescript-config": "0.0.0",
126
126
  "@oyerinde/caliper-mcp": "0.1.0"
127
127
  },