@ingcreators/annot-mcp 0.1.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.
@@ -0,0 +1,342 @@
1
+ import { Annotator } from '@ingcreators/annot-annotator';
2
+ import { BrowserPool } from '../browser/pool.js';
3
+ import { AnnotateToolResult } from './annotate-screenshot.js';
4
+ export declare const ANNOTATE_URL_TOOL_NAME = "annot_annotate_url";
5
+ export declare const annotateUrlTool: {
6
+ readonly name: "annot_annotate_url";
7
+ readonly description: string;
8
+ readonly inputSchema: {
9
+ readonly type: "object";
10
+ readonly required: readonly ["url", "annotations"];
11
+ readonly additionalProperties: false;
12
+ readonly properties: {
13
+ readonly url: {
14
+ readonly type: "string";
15
+ readonly format: "uri";
16
+ readonly description: "Page URL to capture.";
17
+ };
18
+ readonly annotations: {
19
+ readonly type: "array";
20
+ readonly items: {
21
+ readonly $ref: "#/$defs/LocatorAnnotation";
22
+ };
23
+ readonly description: string;
24
+ };
25
+ readonly viewport: {
26
+ readonly type: "object";
27
+ readonly additionalProperties: false;
28
+ readonly properties: {
29
+ readonly width: {
30
+ readonly type: "integer";
31
+ readonly minimum: 1;
32
+ readonly default: 1280;
33
+ };
34
+ readonly height: {
35
+ readonly type: "integer";
36
+ readonly minimum: 1;
37
+ readonly default: 800;
38
+ };
39
+ readonly deviceScaleFactor: {
40
+ readonly type: "number";
41
+ readonly minimum: 0.1;
42
+ readonly default: 1;
43
+ };
44
+ };
45
+ readonly description: "Viewport size. Default 1280×800 at 1× device pixel ratio.";
46
+ };
47
+ readonly fullPage: {
48
+ readonly type: "boolean";
49
+ readonly default: false;
50
+ readonly description: string;
51
+ };
52
+ readonly waitFor: {
53
+ readonly type: "string";
54
+ readonly enum: readonly ["load", "domcontentloaded", "networkidle"];
55
+ readonly default: "load";
56
+ };
57
+ readonly output: {
58
+ readonly type: "string";
59
+ readonly description: string;
60
+ };
61
+ };
62
+ readonly $defs: {
63
+ readonly LocatorAnnotation: {
64
+ oneOf: ({
65
+ type: string;
66
+ required: string[];
67
+ additionalProperties: boolean;
68
+ properties: {
69
+ type: {
70
+ const: string;
71
+ };
72
+ svgFragment: {
73
+ type: string;
74
+ };
75
+ };
76
+ } | {
77
+ type: string;
78
+ required: string[];
79
+ additionalProperties: boolean;
80
+ properties: {
81
+ type: {
82
+ const: string;
83
+ };
84
+ bbox: {
85
+ $ref: string;
86
+ };
87
+ locator: {
88
+ $ref: string;
89
+ };
90
+ intent: {
91
+ $ref: string;
92
+ };
93
+ stroke: {
94
+ type: string;
95
+ };
96
+ strokeWidth: {
97
+ type: string;
98
+ minimum: number;
99
+ };
100
+ fill: {
101
+ type: string;
102
+ };
103
+ color: {
104
+ type: string;
105
+ };
106
+ };
107
+ anyOf: {
108
+ required: string[];
109
+ }[];
110
+ } | {
111
+ type: string;
112
+ required: string[];
113
+ additionalProperties: boolean;
114
+ properties: {
115
+ type: {
116
+ const: string;
117
+ };
118
+ center: {
119
+ $ref: string;
120
+ };
121
+ radius: {
122
+ type: string;
123
+ minimum: number;
124
+ };
125
+ locator: {
126
+ $ref: string;
127
+ };
128
+ intent: {
129
+ $ref: string;
130
+ };
131
+ stroke: {
132
+ type: string;
133
+ };
134
+ strokeWidth: {
135
+ type: string;
136
+ minimum: number;
137
+ };
138
+ fill: {
139
+ type: string;
140
+ };
141
+ color: {
142
+ type: string;
143
+ };
144
+ };
145
+ anyOf: {
146
+ required: string[];
147
+ }[];
148
+ } | {
149
+ type: string;
150
+ required: string[];
151
+ additionalProperties: boolean;
152
+ properties: {
153
+ type: {
154
+ const: string;
155
+ };
156
+ from: {
157
+ $ref: string;
158
+ };
159
+ fromLocator: {
160
+ $ref: string;
161
+ };
162
+ to: {
163
+ $ref: string;
164
+ };
165
+ toLocator: {
166
+ $ref: string;
167
+ };
168
+ intent: {
169
+ $ref: string;
170
+ };
171
+ stroke: {
172
+ type: string;
173
+ };
174
+ strokeWidth: {
175
+ type: string;
176
+ minimum: number;
177
+ };
178
+ color: {
179
+ type: string;
180
+ };
181
+ };
182
+ allOf: {
183
+ anyOf: {
184
+ required: string[];
185
+ }[];
186
+ }[];
187
+ } | {
188
+ type: string;
189
+ required: string[];
190
+ additionalProperties: boolean;
191
+ properties: {
192
+ type: {
193
+ const: string;
194
+ };
195
+ at: {
196
+ $ref: string;
197
+ };
198
+ locator: {
199
+ $ref: string;
200
+ };
201
+ content: {
202
+ type: string;
203
+ };
204
+ fontSize: {
205
+ type: string;
206
+ minimum: number;
207
+ };
208
+ anchor: {
209
+ type: string;
210
+ enum: string[];
211
+ };
212
+ intent: {
213
+ $ref: string;
214
+ };
215
+ color: {
216
+ type: string;
217
+ };
218
+ };
219
+ anyOf: {
220
+ required: string[];
221
+ }[];
222
+ } | {
223
+ type: string;
224
+ required: string[];
225
+ additionalProperties: boolean;
226
+ properties: {
227
+ type: {
228
+ const: string;
229
+ };
230
+ at: {
231
+ $ref: string;
232
+ };
233
+ atLocator: {
234
+ $ref: string;
235
+ };
236
+ targetBbox: {
237
+ $ref: string;
238
+ };
239
+ targetLocator: {
240
+ $ref: string;
241
+ };
242
+ content: {
243
+ type: string;
244
+ };
245
+ intent: {
246
+ $ref: string;
247
+ };
248
+ stroke: {
249
+ type: string;
250
+ };
251
+ color: {
252
+ type: string;
253
+ };
254
+ };
255
+ allOf: {
256
+ anyOf: {
257
+ required: string[];
258
+ }[];
259
+ }[];
260
+ })[];
261
+ };
262
+ readonly BBox: {
263
+ type: string;
264
+ required: string[];
265
+ additionalProperties: boolean;
266
+ properties: {
267
+ x: {
268
+ type: string;
269
+ };
270
+ y: {
271
+ type: string;
272
+ };
273
+ width: {
274
+ type: string;
275
+ minimum: number;
276
+ };
277
+ height: {
278
+ type: string;
279
+ minimum: number;
280
+ };
281
+ };
282
+ };
283
+ readonly Point: {
284
+ type: string;
285
+ required: string[];
286
+ additionalProperties: boolean;
287
+ properties: {
288
+ x: {
289
+ type: string;
290
+ };
291
+ y: {
292
+ type: string;
293
+ };
294
+ };
295
+ };
296
+ readonly Intent: {
297
+ type: string;
298
+ enum: string[];
299
+ };
300
+ readonly AnnotationStyle: {
301
+ type: string;
302
+ additionalProperties: boolean;
303
+ properties: {
304
+ intent: {
305
+ $ref: string;
306
+ };
307
+ stroke: {
308
+ type: string;
309
+ };
310
+ strokeWidth: {
311
+ type: string;
312
+ minimum: number;
313
+ };
314
+ fill: {
315
+ type: string;
316
+ };
317
+ color: {
318
+ type: string;
319
+ };
320
+ };
321
+ };
322
+ readonly Locator: {
323
+ type: string;
324
+ minLength: number;
325
+ };
326
+ };
327
+ };
328
+ };
329
+ export interface AnnotateUrlDeps {
330
+ annotator: Annotator;
331
+ pool: BrowserPool;
332
+ }
333
+ interface AnnotateUrlInput {
334
+ url?: unknown;
335
+ annotations?: unknown;
336
+ viewport?: unknown;
337
+ fullPage?: unknown;
338
+ waitFor?: unknown;
339
+ output?: unknown;
340
+ }
341
+ export declare function handleAnnotateUrl(input: AnnotateUrlInput, deps: AnnotateUrlDeps): Promise<AnnotateToolResult>;
342
+ export {};
@@ -0,0 +1,49 @@
1
+ import { Annotator } from '@ingcreators/annot-annotator';
2
+ import { AnnotateToolResult } from './annotate-screenshot.js';
3
+ export declare const COMPARE_SCREENSHOTS_TOOL_NAME = "annot_compare_screenshots";
4
+ export declare const compareScreenshotsTool: {
5
+ readonly name: "annot_compare_screenshots";
6
+ readonly description: string;
7
+ readonly inputSchema: {
8
+ readonly type: "object";
9
+ readonly required: readonly ["before", "after"];
10
+ readonly additionalProperties: false;
11
+ readonly properties: {
12
+ readonly before: {
13
+ readonly type: "string";
14
+ readonly description: "`data:image/png;base64,...` URL or absolute filesystem path.";
15
+ };
16
+ readonly after: {
17
+ readonly type: "string";
18
+ readonly description: "`data:image/png;base64,...` URL or absolute filesystem path.";
19
+ };
20
+ readonly threshold: {
21
+ readonly type: "number";
22
+ readonly minimum: 0;
23
+ readonly maximum: 1;
24
+ readonly default: 0.1;
25
+ readonly description: "Pixelmatch sensitivity (0 = strict, 1 = permissive).";
26
+ };
27
+ readonly includeChangeList: {
28
+ readonly type: "boolean";
29
+ readonly default: false;
30
+ readonly description: string;
31
+ };
32
+ readonly output: {
33
+ readonly type: "string";
34
+ };
35
+ };
36
+ };
37
+ };
38
+ export interface CompareScreenshotsDeps {
39
+ annotator: Annotator;
40
+ }
41
+ interface CompareScreenshotsInput {
42
+ before?: unknown;
43
+ after?: unknown;
44
+ threshold?: unknown;
45
+ includeChangeList?: unknown;
46
+ output?: unknown;
47
+ }
48
+ export declare function handleCompareScreenshots(input: CompareScreenshotsInput, deps: CompareScreenshotsDeps): Promise<AnnotateToolResult>;
49
+ export {};
@@ -0,0 +1,116 @@
1
+ import { AnnotateToolResult } from './annotate-screenshot.js';
2
+ export declare const REDACT_SCREENSHOT_TOOL_NAME = "annot_redact_screenshot";
3
+ export declare const redactScreenshotTool: {
4
+ readonly name: "annot_redact_screenshot";
5
+ readonly description: string;
6
+ readonly inputSchema: {
7
+ readonly type: "object";
8
+ readonly required: readonly ["image", "regions"];
9
+ readonly additionalProperties: false;
10
+ readonly properties: {
11
+ readonly image: {
12
+ readonly type: "string";
13
+ readonly description: "`data:image/png;base64,...` URL or absolute filesystem path.";
14
+ };
15
+ readonly regions: {
16
+ readonly type: "array";
17
+ readonly items: {
18
+ readonly $ref: "#/$defs/BboxRedactRegion";
19
+ };
20
+ };
21
+ readonly output: {
22
+ readonly type: "string";
23
+ };
24
+ };
25
+ readonly $defs: {
26
+ readonly BboxRedactRegion: {
27
+ type: string;
28
+ required: string[];
29
+ additionalProperties: boolean;
30
+ properties: {
31
+ bbox: {
32
+ $ref: string;
33
+ };
34
+ style: {
35
+ type: string;
36
+ enum: string[];
37
+ };
38
+ color: {
39
+ type: string;
40
+ };
41
+ };
42
+ };
43
+ readonly BBox: {
44
+ type: string;
45
+ required: string[];
46
+ additionalProperties: boolean;
47
+ properties: {
48
+ x: {
49
+ type: string;
50
+ };
51
+ y: {
52
+ type: string;
53
+ };
54
+ width: {
55
+ type: string;
56
+ minimum: number;
57
+ };
58
+ height: {
59
+ type: string;
60
+ minimum: number;
61
+ };
62
+ };
63
+ };
64
+ readonly Point: {
65
+ type: string;
66
+ required: string[];
67
+ additionalProperties: boolean;
68
+ properties: {
69
+ x: {
70
+ type: string;
71
+ };
72
+ y: {
73
+ type: string;
74
+ };
75
+ };
76
+ };
77
+ readonly Intent: {
78
+ type: string;
79
+ enum: string[];
80
+ };
81
+ readonly AnnotationStyle: {
82
+ type: string;
83
+ additionalProperties: boolean;
84
+ properties: {
85
+ intent: {
86
+ $ref: string;
87
+ };
88
+ stroke: {
89
+ type: string;
90
+ };
91
+ strokeWidth: {
92
+ type: string;
93
+ minimum: number;
94
+ };
95
+ fill: {
96
+ type: string;
97
+ };
98
+ color: {
99
+ type: string;
100
+ };
101
+ };
102
+ };
103
+ readonly Locator: {
104
+ type: string;
105
+ minLength: number;
106
+ };
107
+ };
108
+ };
109
+ };
110
+ interface RedactScreenshotInput {
111
+ image?: unknown;
112
+ regions?: unknown;
113
+ output?: unknown;
114
+ }
115
+ export declare function handleRedactScreenshot(input: RedactScreenshotInput): Promise<AnnotateToolResult>;
116
+ export {};
@@ -0,0 +1,160 @@
1
+ import { BrowserPool } from '../browser/pool.js';
2
+ import { RedactStyle } from '../dsl/types.js';
3
+ import { AnnotateToolResult } from './annotate-screenshot.js';
4
+ export declare const REDACT_URL_TOOL_NAME = "annot_redact_url";
5
+ export declare const redactUrlTool: {
6
+ readonly name: "annot_redact_url";
7
+ readonly description: string;
8
+ readonly inputSchema: {
9
+ readonly type: "object";
10
+ readonly required: readonly ["url", "regions"];
11
+ readonly additionalProperties: false;
12
+ readonly properties: {
13
+ readonly url: {
14
+ readonly type: "string";
15
+ readonly format: "uri";
16
+ };
17
+ readonly regions: {
18
+ readonly type: "array";
19
+ readonly items: {
20
+ readonly $ref: "#/$defs/LocatorRedactRegion";
21
+ };
22
+ };
23
+ readonly viewport: {
24
+ readonly type: "object";
25
+ readonly additionalProperties: false;
26
+ readonly properties: {
27
+ readonly width: {
28
+ readonly type: "integer";
29
+ readonly minimum: 1;
30
+ readonly default: 1280;
31
+ };
32
+ readonly height: {
33
+ readonly type: "integer";
34
+ readonly minimum: 1;
35
+ readonly default: 800;
36
+ };
37
+ readonly deviceScaleFactor: {
38
+ readonly type: "number";
39
+ readonly minimum: 0.1;
40
+ readonly default: 1;
41
+ };
42
+ };
43
+ };
44
+ readonly fullPage: {
45
+ readonly type: "boolean";
46
+ readonly default: false;
47
+ };
48
+ readonly waitFor: {
49
+ readonly type: "string";
50
+ readonly enum: readonly ["load", "domcontentloaded", "networkidle"];
51
+ readonly default: "load";
52
+ };
53
+ readonly output: {
54
+ readonly type: "string";
55
+ };
56
+ };
57
+ readonly $defs: {
58
+ readonly LocatorRedactRegion: {
59
+ type: string;
60
+ additionalProperties: boolean;
61
+ properties: {
62
+ bbox: {
63
+ $ref: string;
64
+ };
65
+ locator: {
66
+ $ref: string;
67
+ };
68
+ style: {
69
+ type: string;
70
+ enum: string[];
71
+ };
72
+ color: {
73
+ type: string;
74
+ };
75
+ };
76
+ anyOf: {
77
+ required: string[];
78
+ }[];
79
+ };
80
+ readonly BBox: {
81
+ type: string;
82
+ required: string[];
83
+ additionalProperties: boolean;
84
+ properties: {
85
+ x: {
86
+ type: string;
87
+ };
88
+ y: {
89
+ type: string;
90
+ };
91
+ width: {
92
+ type: string;
93
+ minimum: number;
94
+ };
95
+ height: {
96
+ type: string;
97
+ minimum: number;
98
+ };
99
+ };
100
+ };
101
+ readonly Point: {
102
+ type: string;
103
+ required: string[];
104
+ additionalProperties: boolean;
105
+ properties: {
106
+ x: {
107
+ type: string;
108
+ };
109
+ y: {
110
+ type: string;
111
+ };
112
+ };
113
+ };
114
+ readonly Intent: {
115
+ type: string;
116
+ enum: string[];
117
+ };
118
+ readonly AnnotationStyle: {
119
+ type: string;
120
+ additionalProperties: boolean;
121
+ properties: {
122
+ intent: {
123
+ $ref: string;
124
+ };
125
+ stroke: {
126
+ type: string;
127
+ };
128
+ strokeWidth: {
129
+ type: string;
130
+ minimum: number;
131
+ };
132
+ fill: {
133
+ type: string;
134
+ };
135
+ color: {
136
+ type: string;
137
+ };
138
+ };
139
+ };
140
+ readonly Locator: {
141
+ type: string;
142
+ minLength: number;
143
+ };
144
+ };
145
+ };
146
+ };
147
+ export interface RedactUrlDeps {
148
+ pool: BrowserPool;
149
+ }
150
+ interface RedactUrlInput {
151
+ url?: unknown;
152
+ regions?: unknown;
153
+ viewport?: unknown;
154
+ fullPage?: unknown;
155
+ waitFor?: unknown;
156
+ output?: unknown;
157
+ }
158
+ export declare function handleRedactUrl(input: RedactUrlInput, deps: RedactUrlDeps): Promise<AnnotateToolResult>;
159
+ export type RedactRegionStyle = RedactStyle;
160
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Boot the Annot MCP server over stdio. Resolves when the
3
+ * transport closes (client disconnect, SIGTERM, etc.).
4
+ *
5
+ * Called by `bin/annot-mcp.mjs`. Exported so embedding callers
6
+ * can also use the standalone server.
7
+ */
8
+ export declare function runStdioServer(): Promise<void>;