@opentiny/next-sdk 0.1.15-beta.4 → 0.1.15-beta.5

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.
@@ -68,13 +68,7 @@ export declare class WebMcpClient {
68
68
  * Sends a ping to the server to check if it is still connected.
69
69
  */
70
70
  ping(options?: RequestOptions): Promise<{
71
- _meta?: {
72
- [x: string]: unknown;
73
- "io.modelcontextprotocol/related-task"?: {
74
- [x: string]: unknown;
75
- taskId: string;
76
- } | undefined;
77
- } | undefined;
71
+ _meta?: Record<string, unknown> | undefined;
78
72
  }>;
79
73
  /**
80
74
  * Sends a completion request to the server.
@@ -87,25 +81,13 @@ export declare class WebMcpClient {
87
81
  total?: number | undefined;
88
82
  hasMore?: boolean | undefined;
89
83
  };
90
- _meta?: {
91
- [x: string]: unknown;
92
- "io.modelcontextprotocol/related-task"?: {
93
- [x: string]: unknown;
94
- taskId: string;
95
- } | undefined;
96
- } | undefined;
84
+ _meta?: Record<string, unknown> | undefined;
97
85
  }>;
98
86
  /**
99
87
  * Sends a request for setting the logging level to the server.
100
88
  */
101
89
  setLoggingLevel(level: LoggingLevel, options?: RequestOptions): Promise<{
102
- _meta?: {
103
- [x: string]: unknown;
104
- "io.modelcontextprotocol/related-task"?: {
105
- [x: string]: unknown;
106
- taskId: string;
107
- } | undefined;
108
- } | undefined;
90
+ _meta?: Record<string, unknown> | undefined;
109
91
  }>;
110
92
  /**
111
93
  * Gets the prompt with the given params from the server.
@@ -117,37 +99,22 @@ export declare class WebMcpClient {
117
99
  content: {
118
100
  type: "text";
119
101
  text: string;
120
- annotations?: {
121
- audience?: ("user" | "assistant")[] | undefined;
122
- priority?: number | undefined;
123
- lastModified?: string | undefined;
124
- } | undefined;
125
- _meta?: Record<string, unknown> | undefined;
102
+ _meta
103
+ /**
104
+ * Sends a ping to the server to check if it is still connected.
105
+ */
106
+ ? /**
107
+ * Sends a ping to the server to check if it is still connected.
108
+ */: Record<string, unknown> | undefined;
126
109
  } | {
127
110
  type: "image";
128
111
  data: string;
129
112
  mimeType: string;
130
- annotations?: {
131
- audience?: ("user" | "assistant")[] | undefined;
132
- priority?: number | undefined;
133
- lastModified?: string | undefined;
134
- } | undefined;
135
113
  _meta?: Record<string, unknown> | undefined;
136
114
  } | {
137
115
  type: "audio";
138
116
  data: string;
139
117
  mimeType: string;
140
- annotations
141
- /**
142
- * Unsubscribes from a resource on the server.
143
- */
144
- ? /**
145
- * Unsubscribes from a resource on the server.
146
- */: {
147
- audience?: ("user" | "assistant")[] | undefined;
148
- priority?: number | undefined;
149
- lastModified?: string | undefined;
150
- } | undefined;
151
118
  _meta?: Record<string, unknown> | undefined;
152
119
  } | {
153
120
  type: "resource";
@@ -162,11 +129,6 @@ export declare class WebMcpClient {
162
129
  mimeType?: string | undefined;
163
130
  _meta?: Record<string, unknown> | undefined;
164
131
  };
165
- annotations?: {
166
- audience?: ("user" | "assistant")[] | undefined;
167
- priority?: number | undefined;
168
- lastModified?: string | undefined;
169
- } | undefined;
170
132
  _meta?: Record<string, unknown> | undefined;
171
133
  } | {
172
134
  uri: string;
@@ -174,11 +136,6 @@ export declare class WebMcpClient {
174
136
  type: "resource_link";
175
137
  description?: string | undefined;
176
138
  mimeType?: string | undefined;
177
- annotations?: {
178
- audience?: ("user" | "assistant")[] | undefined;
179
- priority?: number | undefined;
180
- lastModified?: string | undefined;
181
- } | undefined;
182
139
  _meta?: {
183
140
  [x: string]: unknown;
184
141
  } | undefined;
@@ -190,13 +147,7 @@ export declare class WebMcpClient {
190
147
  title?: string | undefined;
191
148
  };
192
149
  }[];
193
- _meta?: {
194
- [x: string]: unknown;
195
- "io.modelcontextprotocol/related-task"?: {
196
- [x: string]: unknown;
197
- taskId: string;
198
- } | undefined;
199
- } | undefined;
150
+ _meta?: Record<string, unknown> | undefined;
200
151
  description?: string | undefined;
201
152
  }>;
202
153
  /**
@@ -220,17 +171,9 @@ export declare class WebMcpClient {
220
171
  mimeType?: string | undefined;
221
172
  sizes?: string[] | undefined;
222
173
  }[] | undefined;
223
- title? /**
224
- * Registers a handler for the elicitation request.
225
- */: string | undefined;
174
+ title?: string | undefined;
226
175
  }[];
227
- _meta?: {
228
- [x: string]: unknown;
229
- "io.modelcontextprotocol/related-task"?: {
230
- [x: string]: unknown;
231
- taskId: string;
232
- } | undefined;
233
- } | undefined;
176
+ _meta?: Record<string, unknown> | undefined;
234
177
  nextCursor?: string | undefined;
235
178
  }>;
236
179
  /**
@@ -243,11 +186,6 @@ export declare class WebMcpClient {
243
186
  name: string;
244
187
  description?: string | undefined;
245
188
  mimeType?: string | undefined;
246
- annotations?: {
247
- audience?: ("user" | "assistant")[] | undefined;
248
- priority?: number | undefined;
249
- lastModified?: string | undefined;
250
- } | undefined;
251
189
  _meta?: {
252
190
  [x: string]: unknown;
253
191
  } | undefined;
@@ -258,13 +196,7 @@ export declare class WebMcpClient {
258
196
  }[] | undefined;
259
197
  title?: string | undefined;
260
198
  }[];
261
- _meta?: {
262
- [x: string]: unknown;
263
- "io.modelcontextprotocol/related-task"?: {
264
- [x: string]: unknown;
265
- taskId: string;
266
- } | undefined;
267
- } | undefined;
199
+ _meta?: Record<string, unknown> | undefined;
268
200
  nextCursor?: string | undefined;
269
201
  }>;
270
202
  /**
@@ -275,13 +207,12 @@ export declare class WebMcpClient {
275
207
  resourceTemplates: {
276
208
  uriTemplate: string;
277
209
  name: string;
278
- description?: string | undefined;
210
+ description? /**
211
+ * Registers a handler to invoke when this protocol object receives a request with the given method.
212
+ *
213
+ * Note that this will replace any previous request handler for the same method.
214
+ */: string | undefined;
279
215
  mimeType?: string | undefined;
280
- annotations?: {
281
- audience?: ("user" | "assistant")[] | undefined;
282
- priority?: number | undefined;
283
- lastModified?: string | undefined;
284
- } | undefined;
285
216
  _meta?: {
286
217
  [x: string]: unknown;
287
218
  } | undefined;
@@ -292,13 +223,7 @@ export declare class WebMcpClient {
292
223
  }[] | undefined;
293
224
  title?: string | undefined;
294
225
  }[];
295
- _meta?: {
296
- [x: string]: unknown;
297
- "io.modelcontextprotocol/related-task"?: {
298
- [x: string]: unknown;
299
- taskId: string;
300
- } | undefined;
301
- } | undefined;
226
+ _meta?: Record<string, unknown> | undefined;
302
227
  nextCursor?: string | undefined;
303
228
  }>;
304
229
  /**
@@ -317,37 +242,19 @@ export declare class WebMcpClient {
317
242
  mimeType?: string | undefined;
318
243
  _meta?: Record<string, unknown> | undefined;
319
244
  })[];
320
- _meta?: {
321
- [x: string]: unknown;
322
- "io.modelcontextprotocol/related-task"?: {
323
- [x: string]: unknown;
324
- taskId: string;
325
- } | undefined;
326
- } | undefined;
245
+ _meta?: Record<string, unknown> | undefined;
327
246
  }>;
328
247
  /**
329
248
  * Subscribes to a resource on the server.
330
249
  */
331
250
  subscribeResource(params: SubscribeRequest['params'], options?: RequestOptions): Promise<{
332
- _meta?: {
333
- [x: string]: unknown;
334
- "io.modelcontextprotocol/related-task"?: {
335
- [x: string]: unknown;
336
- taskId: string;
337
- } | undefined;
338
- } | undefined;
251
+ _meta?: Record<string, unknown> | undefined;
339
252
  }>;
340
253
  /**
341
254
  * Unsubscribes from a resource on the server.
342
255
  */
343
256
  unsubscribeResource(params: UnsubscribeRequest['params'], options?: RequestOptions): Promise<{
344
- _meta?: {
345
- [x: string]: unknown;
346
- "io.modelcontextprotocol/related-task"?: {
347
- [x: string]: unknown;
348
- taskId: string;
349
- } | undefined;
350
- } | undefined;
257
+ _meta?: Record<string, unknown> | undefined;
351
258
  }>;
352
259
  /**
353
260
  * Calls a tool on the server with the given parameters.
@@ -357,31 +264,16 @@ export declare class WebMcpClient {
357
264
  content: ({
358
265
  type: "text";
359
266
  text: string;
360
- annotations?: {
361
- audience?: ("user" | "assistant")[] | undefined;
362
- priority?: number | undefined;
363
- lastModified?: string | undefined;
364
- } | undefined;
365
267
  _meta?: Record<string, unknown> | undefined;
366
268
  } | {
367
269
  type: "image";
368
270
  data: string;
369
271
  mimeType: string;
370
- annotations?: {
371
- audience?: ("user" | "assistant")[] | undefined;
372
- priority?: number | undefined;
373
- lastModified?: string | undefined;
374
- } | undefined;
375
272
  _meta?: Record<string, unknown> | undefined;
376
273
  } | {
377
274
  type: "audio";
378
275
  data: string;
379
276
  mimeType: string;
380
- annotations?: {
381
- audience?: ("user" | "assistant")[] | undefined;
382
- priority?: number | undefined;
383
- lastModified?: string | undefined;
384
- } | undefined;
385
277
  _meta?: Record<string, unknown> | undefined;
386
278
  } | {
387
279
  type: "resource";
@@ -396,11 +288,6 @@ export declare class WebMcpClient {
396
288
  mimeType?: string | undefined;
397
289
  _meta?: Record<string, unknown> | undefined;
398
290
  };
399
- annotations?: {
400
- audience?: ("user" | "assistant")[] | undefined;
401
- priority?: number | undefined;
402
- lastModified?: string | undefined;
403
- } | undefined;
404
291
  _meta?: Record<string, unknown> | undefined;
405
292
  } | {
406
293
  uri: string;
@@ -408,11 +295,6 @@ export declare class WebMcpClient {
408
295
  type: "resource_link";
409
296
  description?: string | undefined;
410
297
  mimeType?: string | undefined;
411
- annotations?: {
412
- audience?: ("user" | "assistant")[] | undefined;
413
- priority?: number | undefined;
414
- lastModified?: string | undefined;
415
- } | undefined;
416
298
  _meta?: {
417
299
  [x: string]: unknown;
418
300
  } | undefined;
@@ -423,25 +305,13 @@ export declare class WebMcpClient {
423
305
  }[] | undefined;
424
306
  title?: string | undefined;
425
307
  })[];
426
- _meta?: {
427
- [x: string]: unknown;
428
- "io.modelcontextprotocol/related-task"?: {
429
- [x: string]: unknown;
430
- taskId: string;
431
- } | undefined;
432
- } | undefined;
308
+ _meta?: Record<string, unknown> | undefined;
433
309
  structuredContent?: Record<string, unknown> | undefined;
434
310
  isError?: boolean | undefined;
435
311
  } | {
436
312
  [x: string]: unknown;
437
313
  toolResult: unknown;
438
- _meta?: {
439
- [x: string]: unknown;
440
- "io.modelcontextprotocol/related-task"?: {
441
- [x: string]: unknown;
442
- taskId: string;
443
- } | undefined;
444
- } | undefined;
314
+ _meta?: Record<string, unknown> | undefined;
445
315
  }>;
446
316
  /**
447
317
  * Lists all tools available on the server.
@@ -470,9 +340,6 @@ export declare class WebMcpClient {
470
340
  idempotentHint?: boolean | undefined;
471
341
  openWorldHint?: boolean | undefined;
472
342
  } | undefined;
473
- execution?: {
474
- taskSupport?: "optional" | "required" | "forbidden" | undefined;
475
- } | undefined;
476
343
  _meta?: Record<string, unknown> | undefined;
477
344
  icons?: {
478
345
  src: string;
@@ -481,13 +348,7 @@ export declare class WebMcpClient {
481
348
  }[] | undefined;
482
349
  title?: string | undefined;
483
350
  }[];
484
- _meta?: {
485
- [x: string]: unknown;
486
- "io.modelcontextprotocol/related-task"?: {
487
- [x: string]: unknown;
488
- taskId: string;
489
- } | undefined;
490
- } | undefined;
351
+ _meta?: Record<string, unknown> | undefined;
491
352
  nextCursor?: string | undefined;
492
353
  }>;
493
354
  /**
@@ -98,13 +98,7 @@ export declare class WebMcpServer {
98
98
  * Sends a ping to the client to check if it is still connected.
99
99
  */
100
100
  ping(): Promise<{
101
- _meta?: {
102
- [x: string]: unknown;
103
- "io.modelcontextprotocol/related-task"?: {
104
- [x: string]: unknown;
105
- taskId: string;
106
- } | undefined;
107
- } | undefined;
101
+ _meta?: Record<string, unknown> | undefined;
108
102
  }>;
109
103
  /**
110
104
  * Creates a LLM message to be sent to the client.
@@ -116,46 +110,169 @@ export declare class WebMcpServer {
116
110
  content: {
117
111
  type: "text";
118
112
  text: string;
119
- annotations?: {
120
- audience?: ("user" | "assistant")[] | undefined;
121
- priority?: number | undefined;
122
- lastModified?: string | undefined;
123
- } | undefined;
124
- _meta?: {
125
- [x: string]: unknown;
126
- } | undefined;
113
+ _meta?: Record<string, unknown> | undefined;
127
114
  } | {
128
115
  type: "image";
129
116
  data: string;
130
117
  mimeType: string;
131
- annotations?: {
132
- audience?: ("user" | "assistant")[] | undefined;
133
- priority?: number | undefined;
134
- lastModified?: string | undefined;
118
+ _meta?: Record<string, unknown> | undefined;
119
+ } | {
120
+ type: "audio";
121
+ data: string;
122
+ mimeType: string;
123
+ _meta?: Record<string, unknown> | undefined;
124
+ } | {
125
+ [x: string]: unknown;
126
+ type: "tool_use";
127
+ name: string;
128
+ id: string;
129
+ input: {
130
+ [x: string]: unknown;
131
+ };
132
+ _meta?: {
133
+ [x: string]: unknown;
135
134
  } | undefined;
135
+ } | {
136
+ [x: string]: unknown;
137
+ type: "tool_result";
138
+ toolUseId: string;
139
+ content: ({
140
+ type: "text";
141
+ text: string;
142
+ _meta?: Record<string, unknown> | undefined;
143
+ } | {
144
+ type: "image";
145
+ data: string;
146
+ mimeType: string;
147
+ _meta?: Record<string, unknown> | undefined;
148
+ } | {
149
+ type: "audio";
150
+ data: string;
151
+ mimeType: string;
152
+ _meta?: Record<string, unknown> | undefined;
153
+ } | {
154
+ type: "resource";
155
+ resource: {
156
+ uri: string;
157
+ text: string;
158
+ mimeType?: string | undefined;
159
+ _meta?: Record<string, unknown> | undefined;
160
+ } | {
161
+ uri: string;
162
+ blob: string;
163
+ mimeType?: string | undefined;
164
+ _meta?: Record<string, unknown> | undefined;
165
+ };
166
+ _meta?: Record<string, unknown> | undefined;
167
+ } | {
168
+ uri: string;
169
+ name: string;
170
+ type: "resource_link";
171
+ description?: string | undefined;
172
+ mimeType?: string | undefined;
173
+ _meta?: {
174
+ [x: string]: unknown;
175
+ } | undefined;
176
+ icons?: {
177
+ src: string;
178
+ mimeType?: string | undefined;
179
+ sizes?: string[] | undefined;
180
+ }[] | undefined;
181
+ title?: string | undefined;
182
+ })[];
183
+ structuredContent?: {
184
+ [x: string]: unknown;
185
+ } | undefined;
186
+ isError?: boolean | undefined;
136
187
  _meta?: {
137
188
  [x: string]: unknown;
138
189
  } | undefined;
190
+ } | ({
191
+ type: "text";
192
+ text: string;
193
+ _meta?: Record<string, unknown> | undefined;
194
+ } | {
195
+ type: "image";
196
+ data: string;
197
+ mimeType: string;
198
+ _meta?: Record<string, unknown> | undefined;
139
199
  } | {
140
200
  type: "audio";
141
201
  data: string;
142
202
  mimeType: string;
143
- annotations?: {
144
- audience?: ("user" | "assistant")[] | undefined;
145
- priority?: number | undefined;
146
- lastModified?: string | undefined;
147
- } | undefined;
203
+ _meta?: Record<string, unknown> | undefined;
204
+ } | {
205
+ [x: string]: unknown;
206
+ type: "tool_use";
207
+ name: string;
208
+ id: string;
209
+ input: {
210
+ [x: string]: unknown;
211
+ };
148
212
  _meta?: {
149
213
  [x: string]: unknown;
150
214
  } | undefined;
151
- };
152
- _meta?: {
215
+ } | {
153
216
  [x: string]: unknown;
154
- "io.modelcontextprotocol/related-task"?: {
217
+ type: "tool_result";
218
+ toolUseId: string;
219
+ content: ({
220
+ type: "text";
221
+ text: string;
222
+ _meta?: Record<string, unknown> | undefined;
223
+ } | {
224
+ type: "image";
225
+ data: string;
226
+ mimeType: string;
227
+ _meta?: Record<string, unknown> | undefined;
228
+ } | {
229
+ type: "audio";
230
+ data: string;
231
+ mimeType: string;
232
+ _meta?: Record<string, unknown> | undefined;
233
+ } | {
234
+ type: "resource";
235
+ resource: {
236
+ uri: string;
237
+ text: string;
238
+ mimeType?: string | undefined;
239
+ _meta?: Record<string, unknown> | undefined;
240
+ } | {
241
+ uri: string;
242
+ blob: string;
243
+ mimeType?: string | undefined;
244
+ _meta?: Record<string, unknown> | undefined;
245
+ };
246
+ _meta?: Record<string, unknown> | undefined;
247
+ } | {
248
+ uri: string;
249
+ name: string;
250
+ type: "resource_link";
251
+ description?: string | undefined;
252
+ mimeType?: string | undefined;
253
+ _meta? /**
254
+ * Registers a handler to invoke when this protocol object receives a notification with the given method.
255
+ *
256
+ * Note that this will replace any previous notification handler for the same method.
257
+ */: {
258
+ [x: string]: unknown;
259
+ } | undefined;
260
+ icons?: {
261
+ src: string;
262
+ mimeType?: string | undefined;
263
+ sizes?: string[] | undefined;
264
+ }[] | undefined;
265
+ title?: string | undefined;
266
+ })[];
267
+ structuredContent?: {
268
+ [x: string]: unknown;
269
+ } | undefined;
270
+ isError?: boolean | undefined;
271
+ _meta?: {
155
272
  [x: string]: unknown;
156
- taskId: string;
157
273
  } | undefined;
158
- } | undefined;
274
+ })[];
275
+ _meta?: Record<string, unknown> | undefined;
159
276
  stopReason?: string | undefined;
160
277
  }>;
161
278
  /**
@@ -172,13 +289,7 @@ export declare class WebMcpServer {
172
289
  name?: string | undefined;
173
290
  _meta?: Record<string, unknown> | undefined;
174
291
  }[];
175
- _meta?: {
176
- [x: string]: unknown;
177
- "io.modelcontextprotocol/related-task"?: {
178
- [x: string]: unknown;
179
- taskId: string;
180
- } | undefined;
181
- } | undefined;
292
+ _meta?: Record<string, unknown> | undefined;
182
293
  }>;
183
294
  /**
184
295
  * Sends a logging message to the client.