mesurer-solid 0.2.1-beta.9 → 0.2.2-beta.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/AGENT_INTEGRATION.md +23 -14
- package/README.md +16 -10
- package/codex/codex-bridge.mjs +2649 -0
- package/codex/codex-connect.mjs +421 -0
- package/codex/codex-lifecycle.mjs +51 -0
- package/dist/context.d.ts +1 -0
- package/dist/core.d.ts +2 -0
- package/dist/index.js +7556 -5530
- package/dist/inject-script.js +88 -24
- package/dist/inject.js +7551 -5525
- package/dist/plugins/codex/index.d.ts +4 -0
- package/dist/plugins.js +3139 -2544
- package/package.json +8 -2
- package/plugins/codex/bridge.d.ts +2 -0
- package/plugins/codex/bridge.mjs +225 -62
- package/scripts/codex-bridge.mjs +2 -0
- package/scripts/codex-connect.mjs +2 -0
- package/scripts/codex-lifecycle.mjs +2 -0
- package/scripts/install-skill.mjs +10 -1
- package/skills/mesurer-ui/SKILL.md +27 -5
package/AGENT_INTEGRATION.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Mesurer agent integration
|
|
2
2
|
|
|
3
|
-
Mesurer's agent integration is the rendered page itself. The coding agent reads `window.__MESURER__` through the browser control it already has, consumes human visual intent, edits normal application source, and verifies the real Live result.
|
|
3
|
+
Mesurer's agent integration is the rendered page itself. This guide matches `mesurer-solid@0.2.1` stable. The coding agent reads `window.__MESURER__` through the browser control it already has, consumes human visual intent, edits normal application source, and verifies the real Live result.
|
|
4
4
|
|
|
5
|
-
The normal agent workflow requires no Mesurer MCP server,
|
|
5
|
+
The normal agent workflow requires no Mesurer MCP server, Send-to-agent callback, or special browser transport. The optional `codex()` plugin is a separate human convenience path for sending Context feedback into local Codex threads; it does not replace the browser-state contract described here. In Electron it can use the native preload bridge. In an ordinary browser it can use the local Mesurer Codex Bridge companion on loopback. Neither path is the Mesurer Solid ChatGPT/Codex agent plugin.
|
|
6
6
|
|
|
7
7
|
## Install the agent skill
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx --yes --package=mesurer-solid mesurer-skill install
|
|
10
|
+
npx --yes --package=mesurer-solid@latest mesurer-skill install
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
|
|
@@ -18,16 +18,27 @@ The installer writes a self-contained skill and injection artifact:
|
|
|
18
18
|
├── SKILL.md
|
|
19
19
|
└── assets/
|
|
20
20
|
├── mediabunny-vendor.js
|
|
21
|
-
|
|
21
|
+
├── inject-script.js
|
|
22
|
+
├── codex-bridge.mjs
|
|
23
|
+
├── codex-connect.mjs
|
|
24
|
+
└── codex-lifecycle.mjs
|
|
22
25
|
```
|
|
23
26
|
|
|
24
27
|
## Know the available capabilities
|
|
25
28
|
|
|
26
|
-
The base inspector includes Select, X-ray, Rulers, Typography, Guides, Distance, and Settings. Color Picker uses application-local host capture when available and otherwise uses a working browser `EyeDropper`.
|
|
29
|
+
The base inspector includes Select, X-ray, Color Picker, Rulers, Typography, Guides, Distance, and Settings. Color Picker uses application-local host capture when available and otherwise uses a working browser `EyeDropper`.
|
|
27
30
|
|
|
28
|
-
First-party plugins add Context, Edit, Screenshot, Recording, and optional Codex delivery. Recording is a human video-capture workflow with a typed `recording:v1` service; it is not the normal coding-agent evidence channel. Edit movement preserves the existing Arrange agent method names for compatibility. The complete public map, including the low-level inspection methods and plugin host, is in [Capabilities](../../docs/CAPABILITIES.md).
|
|
31
|
+
First-party plugins add Context, Edit, Layout Guides, Screenshot, Recording, and optional Codex delivery. Recording is a human video-capture workflow with a typed `recording:v1` service; it is not the normal coding-agent evidence channel. Edit movement preserves the existing Arrange agent method names for compatibility. The complete public map, including the low-level inspection methods and plugin host, is in [Capabilities](../../docs/CAPABILITIES.md).
|
|
29
32
|
|
|
30
|
-
For normal coding-agent work, use `window.__MESURER__`. Use `window.__MESURER_INSTANCE__` only when the task requires mounted-instance or plugin-host operations.
|
|
33
|
+
Rulers, ordinary Guides, and Layout Guides remain available while the human is in Edit; X-ray, Color Picker, Typography, Screenshot, and Recording remain Select-lane tools. For normal coding-agent work, use `window.__MESURER__`. Use `window.__MESURER_INSTANCE__` only when the task requires mounted-instance or plugin-host operations.
|
|
34
|
+
|
|
35
|
+
## Use the visible Mesurer UI when it is the best interface
|
|
36
|
+
|
|
37
|
+
Mesurer does not require an agent-specific transport for ordinary interaction. A browser or computer-use harness can click and drag the live Mesurer interface exactly as a person can. Use that path for exploratory visual work, mode/tool changes, Guides/Layout Guides, Edit movement, Typography, Screenshot, Recording, Settings, and other inspector UI.
|
|
38
|
+
|
|
39
|
+
Use `window.__MESURER__` when the answer is better represented as exact structured evidence: selectors, geometry, distances, computed styles, Context, saved intent, or review deltas.
|
|
40
|
+
|
|
41
|
+
Stable Mesurer-owned automation hooks are documented in [Browser and agent integration](../../docs/BROWSER_HARNESS.md). The optional local ChatGPT/Codex plugin adds semantic MCP shortcuts over this same contract; it does not replace browser control. See [ChatGPT and Codex plugin](../../docs/CHATGPT_CODEX_PLUGIN.md).
|
|
31
42
|
|
|
32
43
|
## Reuse a live instance
|
|
33
44
|
|
|
@@ -246,17 +257,15 @@ The optional human `screenshot()` plugin from `mesurer-solid/plugins` is a separ
|
|
|
246
257
|
|
|
247
258
|
## Optional human-to-Codex delivery
|
|
248
259
|
|
|
249
|
-
The first-party `codex()` plugin
|
|
250
|
-
|
|
251
|
-
Native hosts expose `window.__MESURER_HOST__.codexBridge(request)`. Electron main can install `installMesurerCodexHost()`, and a bundled preload can expose `createMesurerCodexPreloadBridge()`. Turning Codex on waits for a native lease and transport readiness. Turning it off waits for lease release before Mesurer removes the plugin. Shared sessions use Codex's existing local app-server. When the host inherits both `CODEX_THREAD_ID` and `CODEX_APP_TOOLS_PIPE_PATH` from Codex Desktop, Mesurer exposes only that exact Desktop thread, queues once through Codex's native queue command, and wakes the same thread with `codex://threads/<id>`. The app-tools pipe is an ownership signal only and is never opened. There is no Mesurer Codex daemon, localhost listener, marketplace plugin, or Codex SessionStart/SessionEnd hook.
|
|
260
|
+
The first-party `codex()` plugin is Mesurer's **Settings -> Codex** feature. It is not the OpenAI Mesurer Solid agent plugin.
|
|
252
261
|
|
|
253
|
-
|
|
262
|
+
Electron hosts with `window.__MESURER_HOST__.codexBridge(request)` can use the in-process native bridge and start Codex enabled. Browser hosts still show Codex in Settings but start with it off. When enabled, the browser plugin talks to the local Mesurer Codex Bridge companion at `127.0.0.1:47365`, verifies its versioned capabilities before use, and reconnects automatically when a compatible helper appears. Missing, outdated, or conflicting helpers remain explicit fail-closed states.
|
|
254
263
|
|
|
255
|
-
|
|
264
|
+
The optional local **Mesurer Codex Bridge** helper can be installed into Codex so SessionStart starts or reuses the loopback companion and registers the current local Codex session; SessionEnd unregisters that ownership. Compatible protocol/capability versions are reused across checkouts even when their source hashes differ. An incompatible helper is replaced only when it proves it is idle, and an ownerless helper remains alive until queued/working Mesurer deliveries become terminal. Non-terminal delivery receipts are retained across long restarts without an age TTL; only terminal history is TTL-pruned. The npm package also exposes `mesurer-codex` and `mesurer-codex-connect` for diagnostics.
|
|
256
265
|
|
|
257
|
-
|
|
266
|
+
Both renderer transports expose the same `codex:v1` service. Shared sessions queue through Codex's local app-server. Exact Desktop-current-thread delivery can use one durable Codex queue operation plus the native `codex://threads/<id>` wake. The private app-tools pipe is never opened.
|
|
258
267
|
|
|
259
|
-
|
|
268
|
+
Browser companion state and the native Electron bridge are local-machine transports only. Neither is a hosted Mesurer relay, and neither changes how coding agents consume `window.__MESURER__`. Turning the human Codex plugin off cleans only resources owned by that Mesurer renderer: browser polling/tools or the Electron renderer lease. It does not stop shared Codex infrastructure.
|
|
260
269
|
|
|
261
270
|
## Revalidate after source edits
|
|
262
271
|
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ Framework-agnostic UI inspection, measurement, visual intent, and agent-readable
|
|
|
4
4
|
|
|
5
5
|
Mesurer Solid ships its own isolated Solid 2 renderer. Host applications can use Solid 1 or 2, React, Vue, Svelte, vanilla DOM, or an Electron renderer without providing Solid.
|
|
6
6
|
|
|
7
|
+
**Current stable:** `mesurer-solid@0.2.1` on the `latest` dist-tag.
|
|
8
|
+
|
|
7
9
|
<p align="center">
|
|
8
10
|
<img src="https://raw.githubusercontent.com/jhomra21/mesurer-solid/main/docs/assets/readme/hero-multi-spacing.png" alt="Mesurer Solid measuring spacing between selected elements" width="100%">
|
|
9
11
|
</p>
|
|
@@ -16,13 +18,13 @@ Mesurer Solid ships its own isolated Solid 2 renderer. Host applications can use
|
|
|
16
18
|
## Installation
|
|
17
19
|
|
|
18
20
|
```bash
|
|
19
|
-
bun add -d mesurer-solid
|
|
21
|
+
bun add -d mesurer-solid@latest
|
|
20
22
|
```
|
|
21
23
|
|
|
22
24
|
or:
|
|
23
25
|
|
|
24
26
|
```bash
|
|
25
|
-
npm install -D mesurer-solid
|
|
27
|
+
npm install -D mesurer-solid@latest
|
|
26
28
|
```
|
|
27
29
|
|
|
28
30
|
|
|
@@ -42,7 +44,7 @@ if (import.meta.env.DEV) {
|
|
|
42
44
|
}
|
|
43
45
|
```
|
|
44
46
|
|
|
45
|
-
For Vite, put this in the existing browser entry such as `src/main.tsx`, `src/main.ts`, or `src/index.tsx`. In Electron, use the renderer entry and keep privileged Electron work in preload/main. If preload exposes `window.__MESURER_HOST__.captureScreenshot`, Screenshot uses native capture and Color Picker samples the current application window through that same capability. If preload exposes `window.__MESURER_HOST__.codexBridge`, Codex starts enabled and
|
|
47
|
+
For Vite, put this in the existing browser entry such as `src/main.tsx`, `src/main.ts`, or `src/index.tsx`. In Electron, use the renderer entry and keep privileged Electron work in preload/main. If preload exposes `window.__MESURER_HOST__.captureScreenshot`, Screenshot uses native capture and Color Picker samples the current application window through that same capability. If preload exposes `window.__MESURER_HOST__.codexBridge`, Codex starts enabled and uses the native transport. Browser-only hosts still list Codex in Settings, start with it off, and connect through a verified local Mesurer Codex Bridge companion when enabled. Missing, outdated, and conflicting companions are explicit fail-closed states, and the browser reconnects automatically when a compatible helper appears. Renderer configuration remains runtime-neutral. In SSR applications, mount from a client-only module or lifecycle.
|
|
46
48
|
|
|
47
49
|
`src/dev/mesurer.ts` is an optional organization pattern, not a required filename or directory. Do not mount Mesurer from `vite.config.ts`, server/API code, Node-only scripts, an Electron main process, or a module that also executes during SSR.
|
|
48
50
|
|
|
@@ -70,7 +72,7 @@ const mesurer = mountMesurer({
|
|
|
70
72
|
})
|
|
71
73
|
```
|
|
72
74
|
|
|
73
|
-
The base inspector includes Select, X-ray, Rulers, Typography, Guides, Distance, Settings, plugin hosting, direct text editing, and the low-level inspection API. First-party Recording uses MediaBunny for encoded video, trim, resize, and WebM/MP4 export; its capture adapters only acquire pixels. Electron apps should import `mesurer-solid/electron` once from the main-process entrypoint before creating BrowserWindows; Mesurer then owns its narrow Recording preload/IPC automatically, so the app does not add Recording code to its own preload. The toolbar groups those controls into Select and Edit. Typography stays read-only in Select; Edit owns movement and direct text/style changes. Color Picker uses application-local capture when `window.__MESURER_HOST__.captureScreenshot` is available; other supported browser hosts use an operational `EyeDropper`. A successful sample is copied to the clipboard using `colorPickerClickFormat`.
|
|
75
|
+
The base inspector includes Select, X-ray, Color Picker, Rulers, Typography, Guides, Distance, Settings, plugin hosting, direct text editing, and the low-level inspection API. First-party Recording uses MediaBunny for encoded video, trim, resize, and WebM/MP4 export; its capture adapters only acquire pixels. Electron apps should import `mesurer-solid/electron` once from the main-process entrypoint before creating BrowserWindows; Mesurer then owns its narrow Recording preload/IPC automatically, so the app does not add Recording code to its own preload. The toolbar groups those controls into Select and Edit. Typography stays read-only in Select; Edit owns movement and direct text/style changes. Color Picker uses application-local capture when `window.__MESURER_HOST__.captureScreenshot` is available; other supported browser hosts use an operational `EyeDropper`. A successful sample is copied to the clipboard using `colorPickerClickFormat`.
|
|
74
76
|
|
|
75
77
|
`mesurer-solid/plugins` also exports the built-in factories for lower-level composition. Normal mounts already include the built-ins. Use `excludeBuiltins` with names such as `"xray"`, `"typography"`, and `"colorPicker"` when a mount should omit one.
|
|
76
78
|
|
|
@@ -103,15 +105,15 @@ Programmatic injection reuses an existing connected instance by default. Lifecyc
|
|
|
103
105
|
- Add page-scoped columns, rows, or pixel grids with the optional `layoutGuides()` plugin. Guide edits participate in plugin undo/redo, and Context includes the current page's saved guides with their visibility state.
|
|
104
106
|
- Inspect rendered typography in Select. Edit previews reversible direct copy and style changes.
|
|
105
107
|
- Use Edit to move selected UI and change direct text, typography, and text color without changing source.
|
|
106
|
-
- Capture page regions through the optional Screenshot plugin. It selects native host capture, the Chromium extension adapter, or browser display capture internally.
|
|
107
|
-
- Record selected regions through the optional Recording plugin. Browser and
|
|
108
|
+
- Capture page regions through the optional Screenshot plugin. It selects native host capture, the Chromium extension adapter, or browser display capture internally, and flattens transparent native captures against the renderer backdrop before preview, copy, or save.
|
|
109
|
+
- Record adjustable selected regions through the optional Recording plugin at 60 fps by default or 120 fps when selected and supported. Browser, extension, and Electron APIs only acquire the stream; MediaBunny owns encoding, inspection, trim, 1×/2×/3× resize, and WebM/MP4 export.
|
|
108
110
|
- Read selection, measurements, guides, annotations, layout, styles, and saved human intent through Context and agent APIs.
|
|
109
111
|
- Keep saved annotations across same-tab reloads and conservatively rebind them to their original DOM targets; markers, cards, and ownership evidence stay attached through scrolling, repeated-note markers stay local, Add Note remains available while a note is open, and cards/composers occlude Select hover and selection chrome.
|
|
110
112
|
- Extend the runtime with tools, settings, overlays, commands, hooks, state, and services.
|
|
111
113
|
- Compact the toolbar to active controls without changing tool state or order.
|
|
112
114
|
- Choose System, Light, or Dark appearance while keeping the same theme across isolated and document-backed Mesurer UI.
|
|
113
115
|
|
|
114
|
-
Use `1` for Select and `2` for Edit. Select
|
|
116
|
+
Use `1` for Select and `2` for Edit. Select owns X-ray, Color Picker, Typography, Screenshot, and Recording. Edit owns movement and direct text/style changes. Rulers, Guides, and Layout Guides remain usable in both modes; Context and Codex remain visible in both modes. The grouped toolbar changes modes in 150 ms. `Shift+A` still enters Edit as a compatibility shortcut.
|
|
115
117
|
|
|
116
118
|
Toolbar dragging starts after the pointer crosses the drag threshold. Dragging from Settings, Guide, or plugin triggers closes the open menu or panel. Pointer activity inside menus, dialogs, form controls, editable regions, and sliders does not drag the toolbar.
|
|
117
119
|
|
|
@@ -156,6 +158,7 @@ Global shortcuts are enabled by default. Turn them off from **Settings > General
|
|
|
156
158
|
| `Cmd/Ctrl + ,` | Settings |
|
|
157
159
|
| `Shift + A` | Edit compatibility shortcut |
|
|
158
160
|
| `Shift + S` | Screenshot |
|
|
161
|
+
| `Shift + R` | Recording |
|
|
159
162
|
| `C` | Copy Context |
|
|
160
163
|
| `Shift + C` | Copy Selection |
|
|
161
164
|
| `N` | Add Note |
|
|
@@ -174,7 +177,7 @@ const selected = await mesurer.select("#pricing-card")
|
|
|
174
177
|
Install the portable Agent Skill with:
|
|
175
178
|
|
|
176
179
|
```bash
|
|
177
|
-
npx --yes --package=mesurer-solid mesurer-skill install
|
|
180
|
+
npx --yes --package=mesurer-solid@latest mesurer-skill install
|
|
178
181
|
```
|
|
179
182
|
|
|
180
183
|
The skill preserves existing human state, reads Edit movement, text, and annotation intent before source changes, and verifies the real Live result after implementation.
|
|
@@ -183,9 +186,9 @@ See [Agent integration](https://github.com/jhomra21/mesurer-solid/blob/main/pack
|
|
|
183
186
|
|
|
184
187
|
### Queue to Codex
|
|
185
188
|
|
|
186
|
-
Codex
|
|
189
|
+
Codex is Mesurer's own local delivery integration and is separate from the Mesurer Solid ChatGPT/Codex agent plugin. Browser-only hosts list it in **Settings -> Plugins**, start with it off, and use the local Mesurer Codex Bridge companion when enabled. A missing helper leaves the plugin enabled with an unavailable/retry state instead of producing an Electron-preload error.
|
|
187
190
|
|
|
188
|
-
Native applications install `installMesurerCodexHost()` in Electron main and expose `createMesurerCodexPreloadBridge()` from a bundled preload.
|
|
191
|
+
Native applications can install `installMesurerCodexHost()` in Electron main and expose `createMesurerCodexPreloadBridge()` from a bundled preload. That path uses an in-process native bridge and renderer-scoped lease instead of loopback HTTP. Both transports expose the same `codex:v1` service and **Queue to Codex** UI.
|
|
189
192
|
|
|
190
193
|
**Queue to Codex** remains one runtime-neutral API. Shared delivery tracks Queued, Working, Finished, or Interrupted through the shared app-server. Desktop current-thread delivery keeps the durable queued submission and wake result visible without fabricating private Desktop lifecycle state. It does not create threads or invoke Steer.
|
|
191
194
|
|
|
@@ -201,12 +204,15 @@ See [Queue Context feedback to Codex](https://github.com/jhomra21/mesurer-solid/
|
|
|
201
204
|
- [Edit](https://github.com/jhomra21/mesurer-solid/blob/main/docs/EDIT.md) and [Layout Guides](https://github.com/jhomra21/mesurer-solid/blob/main/docs/LAYOUT_GUIDES.md)
|
|
202
205
|
- [Measurements and distance geometry](https://github.com/jhomra21/mesurer-solid/blob/main/docs/MEASUREMENTS.md)
|
|
203
206
|
- [Screenshots](https://github.com/jhomra21/mesurer-solid/blob/main/docs/SCREENSHOTS.md)
|
|
207
|
+
- [Recording](https://github.com/jhomra21/mesurer-solid/blob/main/docs/RECORDING.md)
|
|
204
208
|
- [Electron renderer example](https://github.com/jhomra21/mesurer-solid/blob/main/examples/electron-renderer/README.md)
|
|
205
209
|
- [Context workflow](https://github.com/jhomra21/mesurer-solid/blob/main/docs/CONTEXT_WORKFLOW.md)
|
|
206
210
|
- [Queue Context feedback to Codex](https://github.com/jhomra21/mesurer-solid/blob/main/docs/CODEX.md)
|
|
207
211
|
- [Browser and agent integration](https://github.com/jhomra21/mesurer-solid/blob/main/docs/BROWSER_HARNESS.md)
|
|
208
212
|
- [Host isolation](https://github.com/jhomra21/mesurer-solid/blob/main/docs/HOST_ISOLATION.md)
|
|
209
213
|
- [Trusted Types](https://github.com/jhomra21/mesurer-solid/blob/main/docs/TRUSTED_TYPES.md)
|
|
214
|
+
- [Browser extension](https://github.com/jhomra21/mesurer-solid/blob/main/extension/README.md)
|
|
215
|
+
- [Upstream parity](https://github.com/jhomra21/mesurer-solid/blob/main/docs/UPSTREAM_PARITY.md)
|
|
210
216
|
|
|
211
217
|
Mesurer Solid is a source-first Solid port and extension of [Mesurer](https://github.com/ibelick/mesurer). Upstream adoption and deliberate differences are tracked in [Upstream parity](https://github.com/jhomra21/mesurer-solid/blob/main/docs/UPSTREAM_PARITY.md).
|
|
212
218
|
|