mesurer-solid 0.2.0 → 0.2.1-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 +15 -15
- package/README.md +14 -12
- package/dist/arrange.d.ts +23 -0
- package/dist/core.d.ts +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2167 -1861
- package/dist/inject-script.js +147 -14
- package/dist/inject.js +3488 -3182
- package/dist/plugins.d.ts +4 -4
- package/dist/plugins.js +170 -162
- package/package.json +1 -1
- package/skills/mesurer-ui/SKILL.md +19 -19
package/package.json
CHANGED
|
@@ -17,19 +17,19 @@ A meaningful Mesurer step must return evidence the agent actually uses.
|
|
|
17
17
|
|
|
18
18
|
The base inspector has 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`; a successful sample copies the configured format to the clipboard.
|
|
19
19
|
|
|
20
|
-
Optional first-party plugins add Context,
|
|
20
|
+
Optional first-party plugins add Context, Edit, Layout Guides, Screenshot, and Codex delivery. Context carries annotations and structured evidence. Edit carries Before/Desired/Live movement intent through the existing Arrange compatibility APIs. Layout Guides carries page-scoped column/row/grid intent and exposes saved guides through Context with each guide's `visible` flag. Screenshot is a human capture tool. Codex is an optional human queue transport, not the normal agent protocol.
|
|
21
21
|
|
|
22
22
|
The JSON-safe `window.__MESURER__` object exposes the full agent API. Lifecycle and discovery methods are `ready()`, `capabilities()`, `describe()`, `state()`, and `stable()`. Inspection methods are `inspect()`, `inspectAll()`, `at()`, `distance()`, `viewport()`, and `feedback()`. `command()` runs registered Mesurer commands.
|
|
23
23
|
|
|
24
|
-
Context adds `context()`, `contextText()`, `select()`, `annotations()`, `review()`, `capturePlan()`, `prepareCapture()`, and `finishCapture()`.
|
|
24
|
+
Context adds `context()`, `contextText()`, `select()`, `annotations()`, `review()`, `capturePlan()`, `prepareCapture()`, and `finishCapture()`. Edit movement keeps the agent methods `arrangements()`, `arrange()`, `showArrange()`, `arrangeCapturePlan()`, and `reviewArrange()` for compatibility. Text intent is available through `textEdits()` and `textEdit()`. Use the narrowest method that answers the task without replacing human selection or saved intent.
|
|
25
25
|
|
|
26
|
-
Select, point inspection, and Context can target general DOM elements, including SVG. Direct text editing and
|
|
26
|
+
Select, point inspection, and Context can target general DOM elements, including SVG. Direct text editing and Edit movement remain HTML-only mutation surfaces; SVG selection does not imply that either operation is available for that target.
|
|
27
27
|
|
|
28
28
|
Human Select lifecycle is explicit. Invoking Select clears the current element and Guide selection before toggling the tool. Holding Shift while clicking rendered targets adds or removes them from the human multi-selection. Do not expect hidden selection state to return after Select is turned off or after an off-state reload.
|
|
29
29
|
|
|
30
30
|
## Reuse the live instance
|
|
31
31
|
|
|
32
|
-
Never reinject, dispose, or replace Mesurer just because this skill loaded. A person may already have selected elements, guides, measurements, annotations,
|
|
32
|
+
Never reinject, dispose, or replace Mesurer just because this skill loaded. A person may already have selected elements, guides, measurements, annotations, Edit movement intent, text/style Desired intent, plugin state, or a screenshot preview open.
|
|
33
33
|
|
|
34
34
|
Discover first:
|
|
35
35
|
|
|
@@ -95,15 +95,15 @@ const textEditIntents = await Promise.all(
|
|
|
95
95
|
)
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
Bring forward whatever matters: selection, target-bound notes,
|
|
98
|
+
Bring forward whatever matters: selection, target-bound notes, Edit movement Before/Desired geometry, text Before/Desired copy/style deltas, ordinary guides, `workspace.visualContext.layoutGuides`, measurements, held distances, exact inspection, layout/style state, rulers/X-ray, and any human screenshot preview that must be preserved.
|
|
99
99
|
|
|
100
100
|
Page-owned workspace evidence is route-scoped. In-tab navigation can legitimately switch to a different set of guides, annotations, measurements, and Layout Guides while the global toolbar remains in the same tab-session position. Do not copy page-owned state from one route to another to make a comparison look stable.
|
|
101
101
|
|
|
102
102
|
Do not clear or replace a channel until its relevant evidence has been consumed.
|
|
103
103
|
|
|
104
|
-
## Treat
|
|
104
|
+
## Treat Edit movement as visual intent
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
Edit movement describes the requested rendered geometry, not how source should implement it. The saved state and agent method names still use Arrange for compatibility.
|
|
107
107
|
|
|
108
108
|
```js
|
|
109
109
|
const intent = await window.__MESURER__.arrange(arrangeId)
|
|
@@ -111,9 +111,9 @@ const intent = await window.__MESURER__.arrange(arrangeId)
|
|
|
111
111
|
|
|
112
112
|
A 96px Desired offset does not mean production CSS should use `transform: translateX(96px)`. Inspect the surrounding layout and implement the appropriate flex/grid, gap, margin, sizing, ordering, component structure, or other semantic rule.
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
Edit can be activated before a selection exists and keeps Select available as its targeting prerequisite. Use the Select/Edit mode switch to leave Edit.
|
|
115
115
|
|
|
116
|
-
Before source edits, retain the
|
|
116
|
+
Before source edits, retain the movement intent id, exact target identity, Before geometry, and Desired geometry. Capture Before/Desired through the existing browser controller when screenshots materially help.
|
|
117
117
|
|
|
118
118
|
After source edits:
|
|
119
119
|
|
|
@@ -123,9 +123,9 @@ await window.__MESURER__.showArrange(arrangeId, "live")
|
|
|
123
123
|
const review = await window.__MESURER__.reviewArrange(arrangeId)
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
Live removes the temporary
|
|
126
|
+
Live removes the temporary Edit movement preview before measuring source output.
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
Edit movement preview ownership is conservative. Mesurer restores an older inline transform only while the current value and priority still match the exact preview Mesurer applied. If the host application changes the transform, preserve that host value; do not force Mesurer to restore an obsolete baseline to make a test pass.
|
|
129
129
|
|
|
130
130
|
If review is still numerically wrong, continue editing. If target status is stale or partial, do not silently bind the intent to another element.
|
|
131
131
|
|
|
@@ -133,7 +133,7 @@ If review is still numerically wrong, continue editing. If target status is stal
|
|
|
133
133
|
|
|
134
134
|
The human-facing inspection tool is **Typography**. The internal compatibility id remains `text-inspector`; do not automate normal application work by guessing toolbar labels.
|
|
135
135
|
|
|
136
|
-
Direct editing starts by double-click
|
|
136
|
+
Direct editing starts by double-click or double-tap while Edit is active. Typography in Select is inspection-only. Edit also owns the existing Arrange movement intent.
|
|
137
137
|
|
|
138
138
|
The editor exposes direct B/I/U, Font, Size, Weight, rendered-page colors, custom color, and a separate Text/H1/H2/H3 semantic preset popup. Missing heading levels are not invented.
|
|
139
139
|
|
|
@@ -169,9 +169,9 @@ Final verification must use Live source with the Desired preview inactive. Keep
|
|
|
169
169
|
Saved intent and visible presentation are separate. By default, both human presentation switches are OFF:
|
|
170
170
|
|
|
171
171
|
- **Settings > General > Keep text changes.** When OFF, Typography shows saved Desired text/style while it owns presentation, but Select and other tools restore the original page. ON keeps saved text/style visible outside Typography.
|
|
172
|
-
- **Settings > General > Keep
|
|
172
|
+
- **Settings > General > Keep Edit changes.** When OFF, Edit shows saved Desired movement while it owns presentation, but Select restores the original page. ON keeps saved movement visible outside Edit.
|
|
173
173
|
|
|
174
|
-
The user can open Settings with the gear button or `Cmd/Ctrl+,`. Changing either switch changes presentation policy only; it must not delete or rewrite saved intent/history. Do not treat an Original-looking page in Select as missing intent. Read the saved
|
|
174
|
+
The user can open Settings with the gear button or `Cmd/Ctrl+,`. Changing either switch changes presentation policy only; it must not delete or rewrite saved intent/history. Do not treat an Original-looking page in Select as missing intent. Read the saved text and movement records first.
|
|
175
175
|
|
|
176
176
|
Mesurer UI is never inspected-page content. Treat `[data-mesurer-root]`, `[data-mesurer-island]`, and `[data-mesurer-inspector-ui]` as hard selection and hit-test boundaries. Do not look through a Typography card, annotation UI, toolbar, or inspector shell to select page content underneath it.
|
|
177
177
|
|
|
@@ -209,11 +209,11 @@ const pluginState = await window.__MESURER__.state()
|
|
|
209
209
|
|
|
210
210
|
`describe()` reports the loaded plugin contract. `command(id, args?)` executes a registered Mesurer command and returns its JSON-safe result when that command has one. Use these only when the task requires plugin-level control; do not replace a human selection or saved intent with commands just because commands are available.
|
|
211
211
|
|
|
212
|
-
`contextText()` returns a text form of Context when structured JSON is not useful. `capturePlan()`, `prepareCapture()`, and `finishCapture()` coordinate external screenshots.
|
|
212
|
+
`contextText()` returns a text form of Context when structured JSON is not useful. `capturePlan()`, `prepareCapture()`, and `finishCapture()` coordinate external screenshots. Edit movement also exposes the compatibility method `arrangeCapturePlan()`.
|
|
213
213
|
|
|
214
214
|
## Acquire targets in the right order
|
|
215
215
|
|
|
216
|
-
After preserving relevant
|
|
216
|
+
After preserving relevant Edit movement/text-edit intent:
|
|
217
217
|
|
|
218
218
|
1. If the human already selected or annotated the target, read it before changing selection.
|
|
219
219
|
2. If the intended target is ambiguous, ask the user to select the exact element(s) or region.
|
|
@@ -260,7 +260,7 @@ await window.__MESURER__.stable()
|
|
|
260
260
|
|
|
261
261
|
Then compare the same evidence retained before editing:
|
|
262
262
|
|
|
263
|
-
-
|
|
263
|
+
- Edit movement Desired against Live through `reviewArrange()`;
|
|
264
264
|
- text/style Desired against Live with text preview inactive;
|
|
265
265
|
- saved annotations through `review(annotationId)`;
|
|
266
266
|
- current selection and measurements through fresh `context()`;
|
|
@@ -268,7 +268,7 @@ Then compare the same evidence retained before editing:
|
|
|
268
268
|
|
|
269
269
|
A correct implementation survives with Mesurer previews inactive.
|
|
270
270
|
|
|
271
|
-
Do not destroy guides, measurements, annotations,
|
|
271
|
+
Do not destroy guides, measurements, annotations, Edit movement intent, text-edit intent, plugin state, or screenshot preview just to make validation appear clean.
|
|
272
272
|
|
|
273
273
|
## Screenshots
|
|
274
274
|
|
|
@@ -315,6 +315,6 @@ Codex delivery tracks transport and turn lifecycle. It does not prove that the U
|
|
|
315
315
|
|
|
316
316
|
Do not call every Mesurer method after every edit. Measure what matters to the request.
|
|
317
317
|
|
|
318
|
-
A completion should be evidence-based: exact target geometry or relationships where relevant, Live copy/typography when text intent exists, review deltas when
|
|
318
|
+
A completion should be evidence-based: exact target geometry or relationships where relevant, Live copy/typography when text intent exists, review deltas when Edit movement/annotations exist, and a real browser screenshot when composition matters.
|
|
319
319
|
|
|
320
320
|
If the evidence still disagrees with the requested result, continue working rather than explaining why the source "should" be correct.
|