@ingcreators/annot-mcp 0.1.0 → 0.1.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,12 @@
1
1
  # @ingcreators/annot-mcp
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [92378f9]
8
+ - @ingcreators/annot-annotator@0.2.0
9
+
3
10
  ## 0.1.0
4
11
 
5
12
  ### Minor Changes
package/README.md CHANGED
@@ -17,18 +17,14 @@ browser-driven workflows:
17
17
  single MCP call; the server handles capture + locator
18
18
  resolution + render.
19
19
 
20
- > **Status:** under construction. Phases 1–5 + 7 of
21
- > [`docs/plans/agent-mcp-integration.md`](../../docs/plans/agent-mcp-integration.md)
22
- > have landed; the package is `private: true` in the workspace
23
- > until Phase 8 (gated on
24
- > [`docs/plans/headless-annotator-publish.md`](../../docs/plans/headless-annotator-publish.md))
25
- > flips it for the first npm publish. Phase 6 (PPTX export) is
26
- > deferred indefinitely per the plan.
20
+ > Phase 6 (PPTX export) is deferred indefinitely per the
21
+ > design plan in
22
+ > [`docs/plans/_done/agent-mcp-integration.md`](../../docs/plans/_done/agent-mcp-integration.md),
23
+ > pending the `pptx-export` `ImageRecord[]`-driven refactor noted
24
+ > in [`CLAUDE.md`](../../CLAUDE.md) §2.
27
25
 
28
26
  ## Installation
29
27
 
30
- After Phase 8 publish:
31
-
32
28
  ```sh
33
29
  # Once globally (or via npx per-call)
34
30
  npm install -g @ingcreators/annot-mcp
@@ -329,7 +325,7 @@ The agent sees these as MCP tool errors and can correct + retry.
329
325
  - [`docs/ai-agents.md`](../../docs/ai-agents.md) — short intro
330
326
  guide + "which doc do I want?" map; start here if you're new
331
327
  to the MCP integration.
332
- - [`docs/plans/agent-mcp-integration.md`](../../docs/plans/agent-mcp-integration.md)
328
+ - [`docs/plans/_done/agent-mcp-integration.md`](../../docs/plans/_done/agent-mcp-integration.md)
333
329
  — full design + phase ledger.
334
330
  - [`@ingcreators/annot-annotator`](../annotator/README.md) — the
335
331
  underlying Tier A headless renderer.
@@ -1,7 +1,15 @@
1
- /** Common shared subschemas referenced from `$defs` in each tool's
2
- * inputSchema. Spread these into the tool's `$defs` object at
3
- * registration time. */
1
+ export { BBOX_ANNOTATION_SCHEMA, BBOX_REDACT_REGION_SCHEMA, } from '@ingcreators/annot-annotator';
2
+ /**
3
+ * `$defs` to spread into every MCP tool inputSchema. Combines the
4
+ * annotator's bbox-flavour `SHARED_DEFS` (`BBox`, `Point`,
5
+ * `Intent`, `AnnotationStyle`) with the mcp-only `Locator` shape
6
+ * referenced by every `LOCATOR_*` schema in this file.
7
+ */
4
8
  export declare const SHARED_DEFS: {
9
+ Locator: {
10
+ type: string;
11
+ minLength: number;
12
+ };
5
13
  BBox: {
6
14
  type: string;
7
15
  required: string[];
@@ -62,184 +70,9 @@ export declare const SHARED_DEFS: {
62
70
  };
63
71
  };
64
72
  };
65
- Locator: {
66
- type: string;
67
- minLength: number;
68
- };
69
- };
70
- export declare const BBOX_ANNOTATION_SCHEMA: {
71
- oneOf: ({
72
- type: string;
73
- required: string[];
74
- additionalProperties: boolean;
75
- properties: {
76
- type: {
77
- const: string;
78
- };
79
- bbox: {
80
- $ref: string;
81
- };
82
- intent: {
83
- $ref: string;
84
- };
85
- stroke: {
86
- type: string;
87
- };
88
- strokeWidth: {
89
- type: string;
90
- minimum: number;
91
- };
92
- fill: {
93
- type: string;
94
- };
95
- color: {
96
- type: string;
97
- };
98
- };
99
- } | {
100
- type: string;
101
- required: string[];
102
- additionalProperties: boolean;
103
- properties: {
104
- type: {
105
- const: string;
106
- };
107
- center: {
108
- $ref: string;
109
- };
110
- radius: {
111
- type: string;
112
- minimum: number;
113
- };
114
- intent: {
115
- $ref: string;
116
- };
117
- stroke: {
118
- type: string;
119
- };
120
- strokeWidth: {
121
- type: string;
122
- minimum: number;
123
- };
124
- fill: {
125
- type: string;
126
- };
127
- color: {
128
- type: string;
129
- };
130
- };
131
- } | {
132
- type: string;
133
- required: string[];
134
- additionalProperties: boolean;
135
- properties: {
136
- type: {
137
- const: string;
138
- };
139
- from: {
140
- $ref: string;
141
- };
142
- to: {
143
- $ref: string;
144
- };
145
- intent: {
146
- $ref: string;
147
- };
148
- stroke: {
149
- type: string;
150
- };
151
- strokeWidth: {
152
- type: string;
153
- minimum: number;
154
- };
155
- color: {
156
- type: string;
157
- };
158
- };
159
- } | {
160
- type: string;
161
- required: string[];
162
- additionalProperties: boolean;
163
- properties: {
164
- type: {
165
- const: string;
166
- };
167
- at: {
168
- $ref: string;
169
- };
170
- content: {
171
- type: string;
172
- };
173
- fontSize: {
174
- type: string;
175
- minimum: number;
176
- };
177
- anchor: {
178
- type: string;
179
- enum: string[];
180
- };
181
- intent: {
182
- $ref: string;
183
- };
184
- color: {
185
- type: string;
186
- };
187
- };
188
- } | {
189
- type: string;
190
- required: string[];
191
- additionalProperties: boolean;
192
- properties: {
193
- type: {
194
- const: string;
195
- };
196
- at: {
197
- $ref: string;
198
- };
199
- targetBbox: {
200
- $ref: string;
201
- };
202
- content: {
203
- type: string;
204
- };
205
- intent: {
206
- $ref: string;
207
- };
208
- stroke: {
209
- type: string;
210
- };
211
- color: {
212
- type: string;
213
- };
214
- };
215
- } | {
216
- type: string;
217
- required: string[];
218
- additionalProperties: boolean;
219
- properties: {
220
- type: {
221
- const: string;
222
- };
223
- svgFragment: {
224
- type: string;
225
- };
226
- };
227
- })[];
228
73
  };
229
74
  export declare const LOCATOR_ANNOTATION_SCHEMA: {
230
75
  oneOf: ({
231
- type: string;
232
- required: string[];
233
- additionalProperties: boolean;
234
- properties: {
235
- type: {
236
- const: string;
237
- };
238
- svgFragment: {
239
- type: string;
240
- };
241
- };
242
- } | {
243
76
  type: string;
244
77
  required: string[];
245
78
  additionalProperties: boolean;
@@ -423,24 +256,19 @@ export declare const LOCATOR_ANNOTATION_SCHEMA: {
423
256
  required: string[];
424
257
  }[];
425
258
  }[];
426
- })[];
427
- };
428
- export declare const BBOX_REDACT_REGION_SCHEMA: {
429
- type: string;
430
- required: string[];
431
- additionalProperties: boolean;
432
- properties: {
433
- bbox: {
434
- $ref: string;
435
- };
436
- style: {
437
- type: string;
438
- enum: string[];
439
- };
440
- color: {
441
- type: string;
259
+ } | {
260
+ type: string;
261
+ required: string[];
262
+ additionalProperties: boolean;
263
+ properties: {
264
+ type: {
265
+ const: string;
266
+ };
267
+ svgFragment: {
268
+ type: string;
269
+ };
442
270
  };
443
- };
271
+ })[];
444
272
  };
445
273
  export declare const LOCATOR_REDACT_REGION_SCHEMA: {
446
274
  type: string;
@@ -1,62 +1,5 @@
1
- /** Axis-aligned bounding box. Coordinates are page pixels. */
2
- export interface BBox {
3
- x: number;
4
- y: number;
5
- width: number;
6
- height: number;
7
- }
8
- /** Point in page pixels. */
9
- export interface Point {
10
- x: number;
11
- y: number;
12
- }
13
- /**
14
- * Semantic colour shorthand. Resolves to the Annot design system's
15
- * matching token (e.g. `intent: "error"` → `--annot-color-error`).
16
- * Explicit `stroke` / `color` / `fill` on an annotation override
17
- * the intent-derived defaults.
18
- */
19
- export type Intent = "info" | "warning" | "error" | "success" | "neutral";
20
- /** Style overrides shared across most annotation shapes. */
21
- export interface AnnotationStyle {
22
- intent?: Intent;
23
- stroke?: string;
24
- strokeWidth?: number;
25
- fill?: string;
26
- color?: string;
27
- }
28
- export type BboxRectAnnotation = AnnotationStyle & {
29
- type: "rect";
30
- bbox: BBox;
31
- };
32
- export type BboxCircleAnnotation = AnnotationStyle & {
33
- type: "circle";
34
- center: Point;
35
- radius: number;
36
- };
37
- export type BboxArrowAnnotation = AnnotationStyle & {
38
- type: "arrow";
39
- from: Point;
40
- to: Point;
41
- };
42
- export type BboxTextAnnotation = AnnotationStyle & {
43
- type: "text";
44
- at: Point;
45
- content: string;
46
- fontSize?: number;
47
- anchor?: "start" | "middle" | "end";
48
- };
49
- export type BboxCalloutAnnotation = AnnotationStyle & {
50
- type: "callout";
51
- at: Point;
52
- targetBbox: BBox;
53
- content: string;
54
- };
55
- export interface RawAnnotation {
56
- type: "raw";
57
- svgFragment: string;
58
- }
59
- export type BboxAnnotation = BboxRectAnnotation | BboxCircleAnnotation | BboxArrowAnnotation | BboxTextAnnotation | BboxCalloutAnnotation | RawAnnotation;
1
+ import { AnnotationStyle, BBox, Point } from '@ingcreators/annot-annotator';
2
+ export type { AnnotationStyle, BBox, BboxAnnotation, BboxArrowAnnotation, BboxCalloutAnnotation, BboxCircleAnnotation, BboxRectAnnotation, BboxRedactRegion, BboxTextAnnotation, Intent, Point, RawAnnotation, RedactStyle, } from '@ingcreators/annot-annotator';
60
3
  /**
61
4
  * Playwright locator string. Follows the standard locator grammar:
62
5
  * CSS selectors (`button.primary`), text engines (`text=Submit`,
@@ -110,17 +53,13 @@ export type LocatorCalloutAnnotation = AnnotationStyle & {
110
53
  targetLocator?: Locator;
111
54
  content: string;
112
55
  };
113
- export type LocatorAnnotation = LocatorRectAnnotation | LocatorCircleAnnotation | LocatorArrowAnnotation | LocatorTextAnnotation | LocatorCalloutAnnotation | RawAnnotation;
114
- export type RedactStyle = "solid" | "mosaic" | "blur";
115
- export interface BboxRedactRegion {
116
- bbox: BBox;
117
- style?: RedactStyle;
118
- /** CSS colour, applied only when `style` is `"solid"`. */
119
- color?: string;
120
- }
56
+ export type LocatorAnnotation = LocatorRectAnnotation | LocatorCircleAnnotation | LocatorArrowAnnotation | LocatorTextAnnotation | LocatorCalloutAnnotation | {
57
+ type: "raw";
58
+ svgFragment: string;
59
+ };
121
60
  export type LocatorRedactRegion = {
122
61
  bbox?: BBox;
123
62
  locator?: Locator;
124
- style?: RedactStyle;
63
+ style?: import('@ingcreators/annot-annotator').RedactStyle;
125
64
  color?: string;
126
65
  };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
+ export { arrowBetween, bboxAnnotationsToSvg, rectForBoundingBox, textAt, } from '@ingcreators/annot-annotator';
1
2
  export { type CapturePageOptions, type CapturePageResult, capturePage, type PageHandle, type ViewportOptions, } from './browser/capture.js';
2
3
  export { type BrowserLauncher, type BrowserLike, BrowserPool, type BrowserPoolOptions, ChromiumUnavailableError, createChromiumPool, } from './browser/pool.js';
3
4
  export { type LocatorLike, LocatorResolutionError, type PageLike, resolveLocator, resolveLocatorAnnotation, resolveLocatorAnnotations, } from './browser/resolve-locator.js';
4
5
  export { aggregateDiffRegions } from './compare/aggregate.js';
5
6
  export { type DiffOptions, type DiffResult, DimensionMismatchError, diffScreenshots, } from './compare/diff.js';
6
7
  export { BBOX_ANNOTATION_SCHEMA, BBOX_REDACT_REGION_SCHEMA, LOCATOR_ANNOTATION_SCHEMA, LOCATOR_REDACT_REGION_SCHEMA, SHARED_DEFS, } from './dsl/schema.js';
7
- export { bboxAnnotationsToSvg } from './dsl/to-svg.js';
8
8
  export type { AnnotationStyle, BBox, BboxAnnotation, BboxArrowAnnotation, BboxCalloutAnnotation, BboxCircleAnnotation, BboxRectAnnotation, BboxRedactRegion, BboxTextAnnotation, Intent, Locator, LocatorAnnotation, LocatorArrowAnnotation, LocatorCalloutAnnotation, LocatorCircleAnnotation, LocatorRectAnnotation, LocatorRedactRegion, LocatorTextAnnotation, Point, RawAnnotation, RedactStyle, } from './dsl/types.js';
9
9
  export { InvalidPngError, type PngDimensions, readPngDimensions, } from './io/png-dimensions.js';
10
10
  export { InvalidImageInputError, type ResolvedImage, resolveImageInput, } from './io/read-image.js';