@ingcreators/annot-mcp 0.1.1 → 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/CHANGELOG.md +46 -0
- package/dist/dsl/schema.d.ts +32 -0
- package/dist/index.js +725 -594
- package/dist/io/encode-output.d.ts +29 -0
- package/dist/tools/annotate-screenshot.d.ts +37 -0
- package/dist/tools/annotate-url.d.ts +37 -0
- package/dist/tools/compare-screenshots.d.ts +38 -0
- package/dist/tools/redact-screenshot.d.ts +37 -0
- package/dist/tools/redact-url.d.ts +36 -0
- package/package.json +2 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { EncodeOptions } from '@ingcreators/annot-annotator';
|
|
2
|
+
export interface EncodedToolOutput {
|
|
3
|
+
bytes: Uint8Array;
|
|
4
|
+
mimeType: "image/png" | "image/jpeg";
|
|
5
|
+
chosen: "png" | "jpeg";
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
reason?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Apply the agent-provided `encode` options to a PNG byte stream
|
|
12
|
+
* the tool just produced. Returns the original bytes verbatim
|
|
13
|
+
* when no options are passed (the fast path for back-compat).
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyEncodeOptions(pngBytes: Uint8Array, dimensions: {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}, encode: Partial<EncodeOptions> | undefined): Promise<EncodedToolOutput>;
|
|
19
|
+
/**
|
|
20
|
+
* Apply the agent-provided `encode` options to RGBA bytes (rather
|
|
21
|
+
* than already-encoded PNG bytes). Used by the annotate tools that
|
|
22
|
+
* go through `annotator.toEncoded()` directly — but currently
|
|
23
|
+
* unused because the tools opt for the "encode the PNG output"
|
|
24
|
+
* path via {@link applyEncodeOptions} for code uniformity.
|
|
25
|
+
*
|
|
26
|
+
* Exported for power callers who want to drive the pipeline
|
|
27
|
+
* themselves.
|
|
28
|
+
*/
|
|
29
|
+
export { decodeAndEncodeImage } from '@ingcreators/annot-annotator';
|
|
@@ -29,6 +29,10 @@ export declare const annotateScreenshotTool: {
|
|
|
29
29
|
readonly type: "string";
|
|
30
30
|
readonly description: string;
|
|
31
31
|
};
|
|
32
|
+
readonly encode: {
|
|
33
|
+
readonly $ref: "#/$defs/EncodeOptions";
|
|
34
|
+
readonly description: string;
|
|
35
|
+
};
|
|
32
36
|
};
|
|
33
37
|
readonly $defs: {
|
|
34
38
|
readonly BboxAnnotation: {
|
|
@@ -190,6 +194,38 @@ export declare const annotateScreenshotTool: {
|
|
|
190
194
|
};
|
|
191
195
|
})[];
|
|
192
196
|
};
|
|
197
|
+
readonly EncodeOptions: {
|
|
198
|
+
type: string;
|
|
199
|
+
additionalProperties: boolean;
|
|
200
|
+
properties: {
|
|
201
|
+
format: {
|
|
202
|
+
type: string;
|
|
203
|
+
enum: string[];
|
|
204
|
+
description: string;
|
|
205
|
+
};
|
|
206
|
+
saveSizePreset: {
|
|
207
|
+
type: string;
|
|
208
|
+
enum: string[];
|
|
209
|
+
description: string;
|
|
210
|
+
};
|
|
211
|
+
smartFallback: {
|
|
212
|
+
type: string;
|
|
213
|
+
enum: string[];
|
|
214
|
+
description: string;
|
|
215
|
+
};
|
|
216
|
+
smartColorThreshold: {
|
|
217
|
+
type: string;
|
|
218
|
+
minimum: number;
|
|
219
|
+
description: string;
|
|
220
|
+
};
|
|
221
|
+
jpegPercent: {
|
|
222
|
+
type: string;
|
|
223
|
+
minimum: number;
|
|
224
|
+
maximum: number;
|
|
225
|
+
description: string;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
193
229
|
readonly Locator: {
|
|
194
230
|
type: string;
|
|
195
231
|
minLength: number;
|
|
@@ -268,6 +304,7 @@ interface AnnotateScreenshotInput {
|
|
|
268
304
|
image?: unknown;
|
|
269
305
|
annotations?: unknown;
|
|
270
306
|
output?: unknown;
|
|
307
|
+
encode?: unknown;
|
|
271
308
|
}
|
|
272
309
|
/** MCP `tools/call` result content block. */
|
|
273
310
|
type ContentBlock = {
|
|
@@ -58,6 +58,10 @@ export declare const annotateUrlTool: {
|
|
|
58
58
|
readonly type: "string";
|
|
59
59
|
readonly description: string;
|
|
60
60
|
};
|
|
61
|
+
readonly encode: {
|
|
62
|
+
readonly $ref: "#/$defs/EncodeOptions";
|
|
63
|
+
readonly description: string;
|
|
64
|
+
};
|
|
61
65
|
};
|
|
62
66
|
readonly $defs: {
|
|
63
67
|
readonly LocatorAnnotation: {
|
|
@@ -259,6 +263,38 @@ export declare const annotateUrlTool: {
|
|
|
259
263
|
};
|
|
260
264
|
})[];
|
|
261
265
|
};
|
|
266
|
+
readonly EncodeOptions: {
|
|
267
|
+
type: string;
|
|
268
|
+
additionalProperties: boolean;
|
|
269
|
+
properties: {
|
|
270
|
+
format: {
|
|
271
|
+
type: string;
|
|
272
|
+
enum: string[];
|
|
273
|
+
description: string;
|
|
274
|
+
};
|
|
275
|
+
saveSizePreset: {
|
|
276
|
+
type: string;
|
|
277
|
+
enum: string[];
|
|
278
|
+
description: string;
|
|
279
|
+
};
|
|
280
|
+
smartFallback: {
|
|
281
|
+
type: string;
|
|
282
|
+
enum: string[];
|
|
283
|
+
description: string;
|
|
284
|
+
};
|
|
285
|
+
smartColorThreshold: {
|
|
286
|
+
type: string;
|
|
287
|
+
minimum: number;
|
|
288
|
+
description: string;
|
|
289
|
+
};
|
|
290
|
+
jpegPercent: {
|
|
291
|
+
type: string;
|
|
292
|
+
minimum: number;
|
|
293
|
+
maximum: number;
|
|
294
|
+
description: string;
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
};
|
|
262
298
|
readonly Locator: {
|
|
263
299
|
type: string;
|
|
264
300
|
minLength: number;
|
|
@@ -337,6 +373,7 @@ interface AnnotateUrlInput {
|
|
|
337
373
|
fullPage?: unknown;
|
|
338
374
|
waitFor?: unknown;
|
|
339
375
|
output?: unknown;
|
|
376
|
+
encode?: unknown;
|
|
340
377
|
}
|
|
341
378
|
export declare function handleAnnotateUrl(input: AnnotateUrlInput, deps: AnnotateUrlDeps): Promise<AnnotateToolResult>;
|
|
342
379
|
export {};
|
|
@@ -32,6 +32,43 @@ export declare const compareScreenshotsTool: {
|
|
|
32
32
|
readonly output: {
|
|
33
33
|
readonly type: "string";
|
|
34
34
|
};
|
|
35
|
+
readonly encode: {
|
|
36
|
+
readonly $ref: "#/$defs/EncodeOptions";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly $defs: {
|
|
40
|
+
readonly EncodeOptions: {
|
|
41
|
+
type: string;
|
|
42
|
+
additionalProperties: boolean;
|
|
43
|
+
properties: {
|
|
44
|
+
format: {
|
|
45
|
+
type: string;
|
|
46
|
+
enum: string[];
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
saveSizePreset: {
|
|
50
|
+
type: string;
|
|
51
|
+
enum: string[];
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
smartFallback: {
|
|
55
|
+
type: string;
|
|
56
|
+
enum: string[];
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
smartColorThreshold: {
|
|
60
|
+
type: string;
|
|
61
|
+
minimum: number;
|
|
62
|
+
description: string;
|
|
63
|
+
};
|
|
64
|
+
jpegPercent: {
|
|
65
|
+
type: string;
|
|
66
|
+
minimum: number;
|
|
67
|
+
maximum: number;
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
35
72
|
};
|
|
36
73
|
};
|
|
37
74
|
};
|
|
@@ -44,6 +81,7 @@ interface CompareScreenshotsInput {
|
|
|
44
81
|
threshold?: unknown;
|
|
45
82
|
includeChangeList?: unknown;
|
|
46
83
|
output?: unknown;
|
|
84
|
+
encode?: unknown;
|
|
47
85
|
}
|
|
48
86
|
export declare function handleCompareScreenshots(input: CompareScreenshotsInput, deps: CompareScreenshotsDeps): Promise<AnnotateToolResult>;
|
|
49
87
|
export {};
|
|
@@ -21,6 +21,10 @@ export declare const redactScreenshotTool: {
|
|
|
21
21
|
readonly output: {
|
|
22
22
|
readonly type: "string";
|
|
23
23
|
};
|
|
24
|
+
readonly encode: {
|
|
25
|
+
readonly $ref: "#/$defs/EncodeOptions";
|
|
26
|
+
readonly description: string;
|
|
27
|
+
};
|
|
24
28
|
};
|
|
25
29
|
readonly $defs: {
|
|
26
30
|
readonly BboxRedactRegion: {
|
|
@@ -40,6 +44,38 @@ export declare const redactScreenshotTool: {
|
|
|
40
44
|
};
|
|
41
45
|
};
|
|
42
46
|
};
|
|
47
|
+
readonly EncodeOptions: {
|
|
48
|
+
type: string;
|
|
49
|
+
additionalProperties: boolean;
|
|
50
|
+
properties: {
|
|
51
|
+
format: {
|
|
52
|
+
type: string;
|
|
53
|
+
enum: string[];
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
saveSizePreset: {
|
|
57
|
+
type: string;
|
|
58
|
+
enum: string[];
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
smartFallback: {
|
|
62
|
+
type: string;
|
|
63
|
+
enum: string[];
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
smartColorThreshold: {
|
|
67
|
+
type: string;
|
|
68
|
+
minimum: number;
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
jpegPercent: {
|
|
72
|
+
type: string;
|
|
73
|
+
minimum: number;
|
|
74
|
+
maximum: number;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
43
79
|
readonly Locator: {
|
|
44
80
|
type: string;
|
|
45
81
|
minLength: number;
|
|
@@ -111,6 +147,7 @@ interface RedactScreenshotInput {
|
|
|
111
147
|
image?: unknown;
|
|
112
148
|
regions?: unknown;
|
|
113
149
|
output?: unknown;
|
|
150
|
+
encode?: unknown;
|
|
114
151
|
}
|
|
115
152
|
export declare function handleRedactScreenshot(input: RedactScreenshotInput): Promise<AnnotateToolResult>;
|
|
116
153
|
export {};
|
|
@@ -53,6 +53,9 @@ export declare const redactUrlTool: {
|
|
|
53
53
|
readonly output: {
|
|
54
54
|
readonly type: "string";
|
|
55
55
|
};
|
|
56
|
+
readonly encode: {
|
|
57
|
+
readonly $ref: "#/$defs/EncodeOptions";
|
|
58
|
+
};
|
|
56
59
|
};
|
|
57
60
|
readonly $defs: {
|
|
58
61
|
readonly LocatorRedactRegion: {
|
|
@@ -77,6 +80,38 @@ export declare const redactUrlTool: {
|
|
|
77
80
|
required: string[];
|
|
78
81
|
}[];
|
|
79
82
|
};
|
|
83
|
+
readonly EncodeOptions: {
|
|
84
|
+
type: string;
|
|
85
|
+
additionalProperties: boolean;
|
|
86
|
+
properties: {
|
|
87
|
+
format: {
|
|
88
|
+
type: string;
|
|
89
|
+
enum: string[];
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
92
|
+
saveSizePreset: {
|
|
93
|
+
type: string;
|
|
94
|
+
enum: string[];
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
smartFallback: {
|
|
98
|
+
type: string;
|
|
99
|
+
enum: string[];
|
|
100
|
+
description: string;
|
|
101
|
+
};
|
|
102
|
+
smartColorThreshold: {
|
|
103
|
+
type: string;
|
|
104
|
+
minimum: number;
|
|
105
|
+
description: string;
|
|
106
|
+
};
|
|
107
|
+
jpegPercent: {
|
|
108
|
+
type: string;
|
|
109
|
+
minimum: number;
|
|
110
|
+
maximum: number;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
};
|
|
80
115
|
readonly Locator: {
|
|
81
116
|
type: string;
|
|
82
117
|
minLength: number;
|
|
@@ -154,6 +189,7 @@ interface RedactUrlInput {
|
|
|
154
189
|
fullPage?: unknown;
|
|
155
190
|
waitFor?: unknown;
|
|
156
191
|
output?: unknown;
|
|
192
|
+
encode?: unknown;
|
|
157
193
|
}
|
|
158
194
|
export declare function handleRedactUrl(input: RedactUrlInput, deps: RedactUrlDeps): Promise<AnnotateToolResult>;
|
|
159
195
|
export type RedactRegionStyle = RedactStyle;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ingcreators/annot-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Model Context Protocol server exposing the Annot headless annotator as agent-callable tools. Drop into Claude Desktop / Claude Code / Cursor and let an AI agent compose Annot with @playwright/mcp + GitHub MCP for one-turn bug-report autopilot, visual-diff PR review, and locator-first annotation workflows.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "ingcreators",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@napi-rs/canvas": "^0.1.0",
|
|
57
57
|
"pixelmatch": "^7.1.0",
|
|
58
58
|
"playwright-core": "^1.50.0",
|
|
59
|
-
"@ingcreators/annot-annotator": "0.
|
|
59
|
+
"@ingcreators/annot-annotator": "0.3.0"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "vite build",
|