@oyerinde/caliper 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/preset.js ADDED
@@ -0,0 +1,31 @@
1
+ import { createOverlay } from './chunk-XYBNY4BT.js';
2
+ export { caliperProps } from './chunk-XYBNY4BT.js';
3
+ export { CaliperAgentStateSchema, CaliperBridge } from './chunk-ACV6FK43.js';
4
+
5
+ /**
6
+ * @name @oyerinde/caliper
7
+ * @author Daniel Oyerinde
8
+ * @license MIT
9
+ *
10
+ * Caliper - Browser Measurement Tool
11
+ *
12
+ * This source code is licensed under the MIT license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+
16
+ // src/preset.ts
17
+ function init(configuration, extensions = []) {
18
+ const caliperInstance = createOverlay(configuration);
19
+ if (extensions && Array.isArray(extensions)) {
20
+ extensions.forEach((extension) => {
21
+ if (typeof extension === "function") {
22
+ extension(caliperInstance);
23
+ } else if (extension && typeof extension.install === "function") {
24
+ caliperInstance.use(extension);
25
+ }
26
+ });
27
+ }
28
+ return caliperInstance;
29
+ }
30
+
31
+ export { init };
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * @name @oyerinde/caliper
5
+ * @author Daniel Oyerinde
6
+ * @license MIT
7
+ *
8
+ * Caliper - Browser Measurement Tool
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+
14
+ // src/preset.server.ts
15
+ function CaliperBridge(_configuration) {
16
+ return {
17
+ name: "agent-bridge-stub",
18
+ install: () => {
19
+ },
20
+ dispose: () => {
21
+ }
22
+ };
23
+ }
24
+ async function init(_configuration, _extensions = []) {
25
+ return {
26
+ mount: () => {
27
+ },
28
+ dispose: () => {
29
+ },
30
+ getSystems: () => null,
31
+ waitForSystems: () => new Promise(() => {
32
+ }),
33
+ use: () => ({}),
34
+ mounted: false
35
+ };
36
+ }
37
+ var caliperProps = (marker) => ({
38
+ "data-caliper-marker": marker
39
+ });
40
+
41
+ exports.CaliperBridge = CaliperBridge;
42
+ exports.caliperProps = caliperProps;
43
+ exports.init = init;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @name @oyerinde/caliper
3
+ * @author Daniel Oyerinde
4
+ * @license MIT
5
+ *
6
+ * Caliper - Browser Measurement Tool
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */
11
+
12
+ // src/preset.server.ts
13
+ function CaliperBridge(_configuration) {
14
+ return {
15
+ name: "agent-bridge-stub",
16
+ install: () => {
17
+ },
18
+ dispose: () => {
19
+ }
20
+ };
21
+ }
22
+ async function init(_configuration, _extensions = []) {
23
+ return {
24
+ mount: () => {
25
+ },
26
+ dispose: () => {
27
+ },
28
+ getSystems: () => null,
29
+ waitForSystems: () => new Promise(() => {
30
+ }),
31
+ use: () => ({}),
32
+ mounted: false
33
+ };
34
+ }
35
+ var caliperProps = (marker) => ({
36
+ "data-caliper-marker": marker
37
+ });
38
+
39
+ export { CaliperBridge, caliperProps, init };
package/dist/version.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "0.1.4",
3
- "timestamp": "2026-01-16T21:21:40.318Z"
2
+ "version": "0.2.0",
3
+ "timestamp": "2026-02-12T22:43:35.307Z"
4
4
  }
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@oyerinde/caliper",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "High-precision browser measurements, projections, and layout auditing",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
+ "bin": {
10
+ "caliper": "./dist/mcp.js"
11
+ },
9
12
  "author": "Daniel Oyerinde <oyerinde.daniel@yahoo.com> (https://danieloyerinde.com)",
10
13
  "homepage": "https://github.com/oyerindedaniel/caliper#readme",
11
14
  "repository": {
@@ -43,9 +46,33 @@
43
46
  }
44
47
  }
45
48
  },
46
- "./iife": {
47
- "types": "./dist/index.d.ts",
48
- "default": "./dist/index.global.js"
49
+ "./bridge": {
50
+ "node": {
51
+ "import": "./dist/bridge.server.js",
52
+ "require": "./dist/bridge.server.cjs"
53
+ },
54
+ "import": {
55
+ "types": "./dist/bridge.d.ts",
56
+ "default": "./dist/bridge.js"
57
+ },
58
+ "require": {
59
+ "types": "./dist/bridge.d.cts",
60
+ "default": "./dist/bridge.cjs"
61
+ }
62
+ },
63
+ "./preset": {
64
+ "node": {
65
+ "import": "./dist/preset.server.js",
66
+ "require": "./dist/preset.server.cjs"
67
+ },
68
+ "import": {
69
+ "types": "./dist/preset.d.ts",
70
+ "default": "./dist/preset.js"
71
+ },
72
+ "require": {
73
+ "types": "./dist/preset.d.cts",
74
+ "default": "./dist/preset.cjs"
75
+ }
49
76
  }
50
77
  },
51
78
  "files": [
@@ -72,10 +99,16 @@
72
99
  "browser-tools"
73
100
  ],
74
101
  "license": "MIT",
102
+ "dependencies": {
103
+ "ws": "8.19.0",
104
+ "zod": "4.3.5",
105
+ "@modelcontextprotocol/sdk": "1.25.3"
106
+ },
75
107
  "devDependencies": {
76
108
  "@babel/core": "^7.24.0",
77
109
  "@babel/preset-typescript": "^7.28.5",
78
- "@types/node": "^22.15.3",
110
+ "@microsoft/api-extractor": "^7.56.3",
111
+ "@types/node": "^24.10.9",
79
112
  "babel-preset-solid": "^1.9.10",
80
113
  "cross-env": "^10.1.0",
81
114
  "esbuild-plugin-babel": "^0.2.3",
@@ -84,14 +117,19 @@
84
117
  "solid-js": "^1.9.10",
85
118
  "tsup": "^8.5.1",
86
119
  "typescript": "5.9.3",
87
- "@caliper/overlay": "0.0.0",
120
+ "@oyerinde/caliper-schema": "0.1.0",
88
121
  "@caliper/core": "0.0.0",
122
+ "@caliper/overlay": "0.0.0",
89
123
  "@repo/eslint-config": "0.0.0",
90
- "@repo/typescript-config": "0.0.0"
124
+ "@oyerinde/caliper-bridge": "0.1.0",
125
+ "@repo/typescript-config": "0.0.0",
126
+ "@oyerinde/caliper-mcp": "0.1.0"
91
127
  },
92
128
  "scripts": {
93
129
  "prebuild": "node scripts/write-version.mjs",
94
- "build": "pnpm run clean && pnpm run prebuild && cross-env NODE_ENV=production tsup",
130
+ "build": "pnpm run clean && pnpm run prebuild && cross-env NODE_ENV=production tsup && pnpm run build:dts",
131
+ "build:dts": "api-extractor run --local --verbose && api-extractor run --local --verbose --config api-extractor.bridge.json && api-extractor run --local --verbose --config api-extractor.preset.json && pnpm run post:dts",
132
+ "post:dts": "node -e \"const fs=require('fs'); ['index','bridge','preset'].forEach(f => { const s='dist/'+f+'.d.ts'; if(fs.existsSync(s)) fs.copyFileSync(s, 'dist/'+f+'.d.cts'); });\"",
95
133
  "build:watch": "tsup --watch",
96
134
  "lint": "eslint . --max-warnings 0",
97
135
  "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",