@ingcreators/annot-mcp 0.2.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # @ingcreators/annot-mcp
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [5778902]
8
+ - Updated dependencies [96e7625]
9
+ - Updated dependencies [85d40e6]
10
+ - @ingcreators/annot-product-docs@0.3.0
11
+
12
+ ## 0.3.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 806badc: Retire the `@ingcreators/annot-imagequant` (GPL-3.0) dynamic-import
17
+ boundary that gated PNG-8 output in the headless annotator and the
18
+ MCP server. `Annotator.toEncoded()`'s smart mode now routes PNG-8
19
+ through the pure-TS Median Cut + Floyd–Steinberg dither at
20
+ `@ingcreators/annot-core/encode/quantize-median-cut` directly.
21
+
22
+ ### Removed public API
23
+ - `isImagequantAvailable()` is no longer exported from
24
+ `@ingcreators/annot-annotator`. PNG-8 is now unconditionally
25
+ available — callers that previously gated `format: "smart"` on
26
+ this can drop the check.
27
+ - `Annotator.toEncoded()` no longer emits
28
+ `EncodeResult.reason === "imagequant-missing"`. The
29
+ graceful-PNG-32-fallback path that produced this reason is
30
+ unreachable.
31
+
32
+ ### Removed dependency
33
+ - `@ingcreators/annot-imagequant` is dropped from
34
+ `@ingcreators/annot-annotator`'s `dependencies`. Consumers
35
+ that previously installed it as a side-effect of installing
36
+ `annot-annotator` will save the WASM payload from their
37
+ `node_modules`. `annot-mcp` inherits the removal transitively.
38
+
39
+ Phase 3 of `docs/plans/replace-libimagequant-with-median-cut.md`.
40
+ Phase 4 deletes the `@ingcreators/annot-imagequant` workspace
41
+ package and deprecates the published 0.1.0 on npm.
42
+
43
+ ### Patch Changes
44
+
45
+ - Updated dependencies [806badc]
46
+ - Updated dependencies [df1a429]
47
+ - Updated dependencies [2e92c97]
48
+ - Updated dependencies [657a685]
49
+ - @ingcreators/annot-annotator@0.5.0
50
+ - @ingcreators/annot-product-docs@0.2.0
51
+
3
52
  ## 0.2.0
4
53
 
5
54
  ### Minor Changes
package/README.md CHANGED
@@ -129,6 +129,43 @@ highlighted as `warning`-intent rects.
129
129
  content block listing the changed-region bboxes.
130
130
  - `output` (optional).
131
131
 
132
+ ### `annot_aria_snapshot`
133
+
134
+ Open a URL and return Playwright's AI-mode aria-snapshot
135
+ (YAML format with `[ref=eN]` markers). The same primitive
136
+ `playwright-mcp` and `playwright-cli` use. Foundational
137
+ input for the product-docs workflow (see
138
+ [`docs/plans/_done/living-product-docs.md`](../../docs/plans/_done/living-product-docs.md)).
139
+
140
+ **Inputs:**
141
+ - `url` — page URL to snapshot.
142
+ - `viewport` (optional) — `{ width, height, deviceScaleFactor }`.
143
+ - `waitFor` (optional) — `"load"` / `"domcontentloaded"` /
144
+ `"networkidle"`. Default `"load"`.
145
+ - `rootSelector` (optional, default `"body"`) — locator
146
+ selector whose subtree is snapshotted. Narrow to e.g.
147
+ `"main"` or `'[data-testid="login-form"]'` when only part
148
+ of the page is relevant.
149
+ - `timeout` (optional) — forwarded to
150
+ `locator.ariaSnapshot({ timeout })`. Default 30 s.
151
+ - `output` (optional, absolute path) — when set, the YAML is
152
+ written here and the tool returns a text confirmation;
153
+ otherwise the YAML is returned inline.
154
+
155
+ **Important:** refs (`eN`) are session-local. They identify
156
+ elements within THIS snapshot only. Do NOT persist refs
157
+ across sessions or runs. Persistent identifiers should use
158
+ `role + name` (with tree-path disambiguation for duplicates).
159
+
160
+ **Example output:**
161
+
162
+ ```yaml
163
+ - textbox "Email" [ref=e3]
164
+ - textbox "Password" [ref=e5]
165
+ - checkbox "Remember me" [ref=e7]
166
+ - button "Sign in" [ref=e9]
167
+ ```
168
+
132
169
  ## The annotation DSL
133
170
 
134
171
  Two flavours. `BboxAnnotation` (used by `_screenshot` tools)
@@ -285,6 +322,7 @@ is the composable primitive.
285
322
  | `src/tools/redact-screenshot.ts` | `annot_redact_screenshot` |
286
323
  | `src/tools/redact-url.ts` | `annot_redact_url` |
287
324
  | `src/tools/compare-screenshots.ts` | `annot_compare_screenshots` |
325
+ | `src/tools/aria-snapshot.ts` | `annot_aria_snapshot` |
288
326
 
289
327
  ## Runtime dependencies
290
328
 
@@ -0,0 +1,37 @@
1
+ import { BrowserPool } from './pool.js';
2
+ export interface AriaSnapshotOptions {
3
+ url: string;
4
+ viewport?: {
5
+ width: number;
6
+ height: number;
7
+ deviceScaleFactor?: number;
8
+ };
9
+ waitFor?: "load" | "domcontentloaded" | "networkidle";
10
+ /**
11
+ * Selector for the locator whose subtree is snapshotted.
12
+ * Defaults to `"body"` (whole page).
13
+ */
14
+ rootSelector?: string;
15
+ /**
16
+ * Pass-through to Playwright's `ariaSnapshot({ timeout })`.
17
+ * Defaults to Playwright's own default (30 s).
18
+ */
19
+ timeout?: number;
20
+ }
21
+ export interface AriaSnapshotResult {
22
+ /**
23
+ * YAML-formatted accessibility tree. When `mode: "ai"` is used
24
+ * (which `captureAriaSnapshot` always does), each interactive
25
+ * element carries a `[ref=eN]` marker.
26
+ */
27
+ yaml: string;
28
+ }
29
+ /**
30
+ * Acquire a browser, open a context + page, navigate to the URL,
31
+ * take an AI-mode aria-snapshot of the root locator's subtree,
32
+ * and close everything.
33
+ *
34
+ * On any error after browser acquisition, the page + context are
35
+ * closed and the browser is released before the error propagates.
36
+ */
37
+ export declare function captureAriaSnapshot(pool: BrowserPool, options: AriaSnapshotOptions): Promise<AriaSnapshotResult>;