yoke-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,370 @@
1
+ export declare const SERVER_NAME = "yoke";
2
+ export declare const SERVER_VERSION = "0.1.0";
3
+ export declare const PROTOCOL_VERSION = "2024-11-05";
4
+ /**
5
+ * The label on the group holding tabs yoke opened.
6
+ *
7
+ * Decided here rather than in the extension because it is policy, and policy
8
+ * belongs where it can be changed and tested without reloading a browser. The
9
+ * extension keeps the same value as a fallback, for a caller that names nothing.
10
+ */
11
+ export declare const DEFAULT_GROUP_TITLE = "yoke";
12
+ export interface ToolResult {
13
+ content: Array<{
14
+ type: 'text';
15
+ text: string;
16
+ }>;
17
+ /** Present only for tools that return an image, such as screenshot. */
18
+ images?: Array<{
19
+ format: string;
20
+ base64: string;
21
+ }>;
22
+ isError?: boolean;
23
+ }
24
+ interface JsonRpcRequest {
25
+ jsonrpc?: string;
26
+ id?: string | number;
27
+ method: string;
28
+ params?: {
29
+ name?: string;
30
+ arguments?: Record<string, unknown>;
31
+ };
32
+ }
33
+ /** origin and path only, so a tab listing never leaks a token in a query string. */
34
+ export declare function shownUrl(url: string, full?: boolean): string;
35
+ export declare const TOOLS: readonly [{
36
+ readonly name: "list_tabs";
37
+ readonly description: string;
38
+ readonly inputSchema: {
39
+ readonly type: "object";
40
+ readonly properties: {
41
+ readonly full_urls: {
42
+ readonly type: "boolean";
43
+ readonly default: false;
44
+ readonly description: "Return raw URLs instead of origin and path.";
45
+ };
46
+ };
47
+ };
48
+ }, {
49
+ readonly name: "list_tab_groups";
50
+ readonly description: string;
51
+ readonly inputSchema: {
52
+ readonly type: "object";
53
+ readonly properties: {};
54
+ };
55
+ }, {
56
+ readonly name: "navigate";
57
+ readonly description: string;
58
+ readonly inputSchema: {
59
+ readonly type: "object";
60
+ readonly required: readonly ["tab_id", "url"];
61
+ readonly properties: {
62
+ readonly tab_id: {
63
+ readonly type: "number";
64
+ readonly description: "From list_tabs.";
65
+ };
66
+ readonly url: {
67
+ readonly type: "string";
68
+ readonly description: "http and https only.";
69
+ };
70
+ readonly timeout_ms: {
71
+ readonly type: "number";
72
+ readonly description: "How long to wait for the load. Default 20000.";
73
+ };
74
+ };
75
+ };
76
+ }, {
77
+ readonly name: "open_tab";
78
+ readonly description: string;
79
+ readonly inputSchema: {
80
+ readonly type: "object";
81
+ readonly properties: {
82
+ readonly url: {
83
+ readonly type: "string";
84
+ };
85
+ readonly active: {
86
+ readonly type: "boolean";
87
+ readonly default: false;
88
+ readonly description: "Focus the new tab.";
89
+ };
90
+ readonly group_title: {
91
+ readonly type: "string";
92
+ readonly default: "yoke";
93
+ readonly description: "The label on the group. Defaults to yoke, so the tab strip names what is driving it.";
94
+ };
95
+ };
96
+ };
97
+ }, {
98
+ readonly name: "close_tab";
99
+ readonly description: "Close one tab by id.";
100
+ readonly inputSchema: {
101
+ readonly type: "object";
102
+ readonly required: readonly ["tab_id"];
103
+ readonly properties: {
104
+ readonly tab_id: {
105
+ readonly type: "number";
106
+ };
107
+ };
108
+ };
109
+ }, {
110
+ readonly name: "read_page";
111
+ readonly description: string;
112
+ readonly inputSchema: {
113
+ readonly type: "object";
114
+ readonly required: readonly ["tab_id"];
115
+ readonly properties: {
116
+ readonly tab_id: {
117
+ readonly type: "number";
118
+ };
119
+ readonly max_elements: {
120
+ readonly type: "number";
121
+ readonly description: "Default 200.";
122
+ };
123
+ };
124
+ };
125
+ }, {
126
+ readonly name: "find";
127
+ readonly description: string;
128
+ readonly inputSchema: {
129
+ readonly type: "object";
130
+ readonly required: readonly ["tab_id", "text"];
131
+ readonly properties: {
132
+ readonly tab_id: {
133
+ readonly type: "number";
134
+ };
135
+ readonly text: {
136
+ readonly type: "string";
137
+ };
138
+ };
139
+ };
140
+ }, {
141
+ readonly name: "click";
142
+ readonly description: string;
143
+ readonly inputSchema: {
144
+ readonly type: "object";
145
+ readonly required: readonly ["tab_id", "ref"];
146
+ readonly properties: {
147
+ readonly tab_id: {
148
+ readonly type: "number";
149
+ };
150
+ readonly ref: {
151
+ readonly type: "string";
152
+ readonly description: "From read_page.";
153
+ };
154
+ readonly button: {
155
+ readonly type: "string";
156
+ readonly enum: readonly ["left", "right", "middle"];
157
+ readonly default: "left";
158
+ };
159
+ readonly click_count: {
160
+ readonly type: "number";
161
+ readonly default: 1;
162
+ readonly description: "2 for a double click.";
163
+ };
164
+ };
165
+ };
166
+ }, {
167
+ readonly name: "type_text";
168
+ readonly description: string;
169
+ readonly inputSchema: {
170
+ readonly type: "object";
171
+ readonly required: readonly ["tab_id", "text"];
172
+ readonly properties: {
173
+ readonly tab_id: {
174
+ readonly type: "number";
175
+ };
176
+ readonly text: {
177
+ readonly type: "string";
178
+ };
179
+ readonly ref: {
180
+ readonly type: "string";
181
+ readonly description: "Focus this element first.";
182
+ };
183
+ readonly press_enter: {
184
+ readonly type: "boolean";
185
+ readonly default: false;
186
+ };
187
+ };
188
+ };
189
+ }, {
190
+ readonly name: "press_key";
191
+ readonly description: "Press one named key: Enter, Tab, Escape, Backspace or an arrow.";
192
+ readonly inputSchema: {
193
+ readonly type: "object";
194
+ readonly required: readonly ["tab_id", "key"];
195
+ readonly properties: {
196
+ readonly tab_id: {
197
+ readonly type: "number";
198
+ };
199
+ readonly key: {
200
+ readonly type: "string";
201
+ };
202
+ readonly ref: {
203
+ readonly type: "string";
204
+ readonly description: "Focus this element first.";
205
+ };
206
+ };
207
+ };
208
+ }, {
209
+ readonly name: "scroll";
210
+ readonly description: "Scroll a page, or scroll an element into view by ref.";
211
+ readonly inputSchema: {
212
+ readonly type: "object";
213
+ readonly required: readonly ["tab_id"];
214
+ readonly properties: {
215
+ readonly tab_id: {
216
+ readonly type: "number";
217
+ };
218
+ readonly dy: {
219
+ readonly type: "number";
220
+ readonly default: 400;
221
+ readonly description: "Positive scrolls down.";
222
+ };
223
+ readonly dx: {
224
+ readonly type: "number";
225
+ readonly default: 0;
226
+ };
227
+ readonly ref: {
228
+ readonly type: "string";
229
+ };
230
+ };
231
+ };
232
+ }, {
233
+ readonly name: "screenshot";
234
+ readonly description: string;
235
+ readonly inputSchema: {
236
+ readonly type: "object";
237
+ readonly required: readonly ["tab_id"];
238
+ readonly properties: {
239
+ readonly tab_id: {
240
+ readonly type: "number";
241
+ };
242
+ readonly format: {
243
+ readonly type: "string";
244
+ readonly enum: readonly ["png", "jpeg"];
245
+ readonly default: "png";
246
+ };
247
+ readonly quality: {
248
+ readonly type: "number";
249
+ readonly description: "JPEG only, 0 to 100.";
250
+ };
251
+ };
252
+ };
253
+ }, {
254
+ readonly name: "run_javascript";
255
+ readonly description: string;
256
+ readonly inputSchema: {
257
+ readonly type: "object";
258
+ readonly required: readonly ["tab_id", "expression"];
259
+ readonly properties: {
260
+ readonly tab_id: {
261
+ readonly type: "number";
262
+ };
263
+ readonly expression: {
264
+ readonly type: "string";
265
+ };
266
+ };
267
+ };
268
+ }, {
269
+ readonly name: "read_console";
270
+ readonly description: string;
271
+ readonly inputSchema: {
272
+ readonly type: "object";
273
+ readonly required: readonly ["tab_id"];
274
+ readonly properties: {
275
+ readonly tab_id: {
276
+ readonly type: "number";
277
+ };
278
+ readonly limit: {
279
+ readonly type: "number";
280
+ readonly default: 100;
281
+ };
282
+ };
283
+ };
284
+ }, {
285
+ readonly name: "read_network";
286
+ readonly description: string;
287
+ readonly inputSchema: {
288
+ readonly type: "object";
289
+ readonly required: readonly ["tab_id"];
290
+ readonly properties: {
291
+ readonly tab_id: {
292
+ readonly type: "number";
293
+ };
294
+ readonly limit: {
295
+ readonly type: "number";
296
+ readonly default: 100;
297
+ };
298
+ };
299
+ };
300
+ }, {
301
+ readonly name: "group_tabs";
302
+ readonly description: string;
303
+ readonly inputSchema: {
304
+ readonly type: "object";
305
+ readonly required: readonly ["tab_ids"];
306
+ readonly properties: {
307
+ readonly tab_ids: {
308
+ readonly type: "array";
309
+ readonly items: {
310
+ readonly type: "number";
311
+ };
312
+ };
313
+ readonly title: {
314
+ readonly type: "string";
315
+ readonly description: "The group label. Defaults to yoke.";
316
+ };
317
+ readonly color: {
318
+ readonly type: "string";
319
+ readonly enum: readonly ["grey", "blue", "red", "yellow", "green", "pink", "purple", "cyan", "orange"];
320
+ };
321
+ };
322
+ };
323
+ }, {
324
+ readonly name: "ungroup_tabs";
325
+ readonly description: string;
326
+ readonly inputSchema: {
327
+ readonly type: "object";
328
+ readonly required: readonly ["tab_ids"];
329
+ readonly properties: {
330
+ readonly tab_ids: {
331
+ readonly type: "array";
332
+ readonly items: {
333
+ readonly type: "number";
334
+ };
335
+ };
336
+ };
337
+ };
338
+ }, {
339
+ readonly name: "release_tab";
340
+ readonly description: string;
341
+ readonly inputSchema: {
342
+ readonly type: "object";
343
+ readonly required: readonly ["tab_id"];
344
+ readonly properties: {
345
+ readonly tab_id: {
346
+ readonly type: "number";
347
+ };
348
+ };
349
+ };
350
+ }, {
351
+ readonly name: "get_page_text";
352
+ readonly description: string;
353
+ readonly inputSchema: {
354
+ readonly type: "object";
355
+ readonly required: readonly ["tab_id"];
356
+ readonly properties: {
357
+ readonly tab_id: {
358
+ readonly type: "number";
359
+ };
360
+ readonly max_chars: {
361
+ readonly type: "number";
362
+ readonly description: "Truncate beyond this. Default 200000.";
363
+ };
364
+ };
365
+ };
366
+ }];
367
+ export declare function callTool(name: string, args: Record<string, unknown>): Promise<ToolResult>;
368
+ export declare function handle(request: JsonRpcRequest): Promise<unknown>;
369
+ export declare function main(): void;
370
+ export {};