@effect/ai 0.18.12 → 0.18.13
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/McpSchema/package.json +6 -0
- package/McpServer/package.json +6 -0
- package/dist/cjs/AiTool.js +61 -3
- package/dist/cjs/AiTool.js.map +1 -1
- package/dist/cjs/McpSchema.js +1555 -0
- package/dist/cjs/McpSchema.js.map +1 -0
- package/dist/cjs/McpServer.js +708 -0
- package/dist/cjs/McpServer.js.map +1 -0
- package/dist/cjs/index.js +5 -1
- package/dist/dts/AiTool.d.ts +50 -4
- package/dist/dts/AiTool.d.ts.map +1 -1
- package/dist/dts/McpSchema.d.ts +2527 -0
- package/dist/dts/McpSchema.d.ts.map +1 -0
- package/dist/dts/McpServer.d.ts +366 -0
- package/dist/dts/McpServer.d.ts.map +1 -0
- package/dist/dts/index.d.ts +8 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/esm/AiTool.js +54 -2
- package/dist/esm/AiTool.js.map +1 -1
- package/dist/esm/McpSchema.js +1471 -0
- package/dist/esm/McpSchema.js.map +1 -0
- package/dist/esm/McpServer.js +691 -0
- package/dist/esm/McpServer.js.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +24 -5
- package/src/AiTool.ts +89 -6
- package/src/McpSchema.ts +1903 -0
- package/src/McpServer.ts +1078 -0
- package/src/index.ts +10 -0
|
@@ -0,0 +1,1471 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import * as Rpc from "@effect/rpc/Rpc";
|
|
5
|
+
import * as RpcGroup from "@effect/rpc/RpcGroup";
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
// =============================================================================
|
|
8
|
+
// Common
|
|
9
|
+
// =============================================================================
|
|
10
|
+
/**
|
|
11
|
+
* A uniquely identifying ID for a request in JSON-RPC.
|
|
12
|
+
*
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
* @category Common
|
|
15
|
+
*/
|
|
16
|
+
export const RequestId = /*#__PURE__*/Schema.Union(Schema.String, Schema.Number);
|
|
17
|
+
/**
|
|
18
|
+
* A progress token, used to associate progress notifications with the original
|
|
19
|
+
* request.
|
|
20
|
+
*
|
|
21
|
+
* @since 1.0.0
|
|
22
|
+
* @category Common
|
|
23
|
+
*/
|
|
24
|
+
export const ProgressToken = /*#__PURE__*/Schema.Union(Schema.String, Schema.Number);
|
|
25
|
+
/**
|
|
26
|
+
* @since 1.0.0
|
|
27
|
+
* @category Common
|
|
28
|
+
*/
|
|
29
|
+
export class RequestMeta extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/RequestMeta")({
|
|
30
|
+
_meta: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({
|
|
31
|
+
/**
|
|
32
|
+
* If specified, the caller is requesting out-of-band progress notifications
|
|
33
|
+
* for this request (as represented by notifications/progress). The value of
|
|
34
|
+
* this parameter is an opaque token that will be attached to any subsequent
|
|
35
|
+
* notifications. The receiver is not obligated to provide these
|
|
36
|
+
* notifications.
|
|
37
|
+
*/
|
|
38
|
+
progressToken: /*#__PURE__*/Schema.optional(ProgressToken)
|
|
39
|
+
}))
|
|
40
|
+
}) {}
|
|
41
|
+
/**
|
|
42
|
+
* @since 1.0.0
|
|
43
|
+
* @category Common
|
|
44
|
+
*/
|
|
45
|
+
export class ResultMeta extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ResultMeta")({
|
|
46
|
+
/**
|
|
47
|
+
* This result property is reserved by the protocol to allow clients and
|
|
48
|
+
* servers to attach additional metadata to their responses.
|
|
49
|
+
*/
|
|
50
|
+
_meta: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
51
|
+
key: Schema.String,
|
|
52
|
+
value: Schema.Unknown
|
|
53
|
+
}))
|
|
54
|
+
}) {}
|
|
55
|
+
/**
|
|
56
|
+
* @since 1.0.0
|
|
57
|
+
* @category Common
|
|
58
|
+
*/
|
|
59
|
+
export class NotificationMeta extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/NotificationMeta")({
|
|
60
|
+
/**
|
|
61
|
+
* This parameter name is reserved by MCP to allow clients and servers to
|
|
62
|
+
* attach additional metadata to their notifications.
|
|
63
|
+
*/
|
|
64
|
+
_meta: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
65
|
+
key: Schema.String,
|
|
66
|
+
value: Schema.Unknown
|
|
67
|
+
}))
|
|
68
|
+
}) {}
|
|
69
|
+
/**
|
|
70
|
+
* An opaque token used to represent a cursor for pagination.
|
|
71
|
+
*
|
|
72
|
+
* @since 1.0.0
|
|
73
|
+
* @category Common
|
|
74
|
+
*/
|
|
75
|
+
export const Cursor = Schema.String;
|
|
76
|
+
/**
|
|
77
|
+
* @since 1.0.0
|
|
78
|
+
* @category Common
|
|
79
|
+
*/
|
|
80
|
+
export class PaginatedRequestMeta extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/PaginatedRequestMeta")({
|
|
81
|
+
...RequestMeta.fields,
|
|
82
|
+
/**
|
|
83
|
+
* An opaque token representing the current pagination position.
|
|
84
|
+
* If provided, the server should return results starting after this cursor.
|
|
85
|
+
*/
|
|
86
|
+
cursor: /*#__PURE__*/Schema.optional(Cursor)
|
|
87
|
+
}) {}
|
|
88
|
+
/**
|
|
89
|
+
* @since 1.0.0
|
|
90
|
+
* @category Common
|
|
91
|
+
*/
|
|
92
|
+
export class PaginatedResultMeta extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/PaginatedResultMeta")({
|
|
93
|
+
...ResultMeta.fields,
|
|
94
|
+
/**
|
|
95
|
+
* An opaque token representing the pagination position after the last returned result.
|
|
96
|
+
* If present, there may be more results available.
|
|
97
|
+
*/
|
|
98
|
+
nextCursor: /*#__PURE__*/Schema.optional(Cursor)
|
|
99
|
+
}) {}
|
|
100
|
+
/**
|
|
101
|
+
* The sender or recipient of messages and data in a conversation.
|
|
102
|
+
* @since 1.0.0
|
|
103
|
+
* @category Common
|
|
104
|
+
*/
|
|
105
|
+
export const Role = /*#__PURE__*/Schema.Literal("user", "assistant");
|
|
106
|
+
/**
|
|
107
|
+
* Optional annotations for the client. The client can use annotations to
|
|
108
|
+
* inform how objects are used or displayed
|
|
109
|
+
*
|
|
110
|
+
* @since 1.0.0
|
|
111
|
+
* @category Common
|
|
112
|
+
*/
|
|
113
|
+
export class Annotations extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Annotations")({
|
|
114
|
+
/**
|
|
115
|
+
* Describes who the intended customer of this object or data is.
|
|
116
|
+
*
|
|
117
|
+
* It can include multiple entries to indicate content useful for multiple
|
|
118
|
+
* audiences (e.g., `["user", "assistant"]`).
|
|
119
|
+
*/
|
|
120
|
+
audience: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Role)),
|
|
121
|
+
/**
|
|
122
|
+
* Describes how important this data is for operating the server.
|
|
123
|
+
*
|
|
124
|
+
* A value of 1 means "most important," and indicates that the data is
|
|
125
|
+
* effectively required, while 0 means "least important," and indicates that
|
|
126
|
+
* the data is entirely optional.
|
|
127
|
+
*/
|
|
128
|
+
priority: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1)))
|
|
129
|
+
}) {}
|
|
130
|
+
/**
|
|
131
|
+
* Describes the name and version of an MCP implementation.
|
|
132
|
+
*
|
|
133
|
+
* @since 1.0.0
|
|
134
|
+
* @category Common
|
|
135
|
+
*/
|
|
136
|
+
export class Implementation extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Implementation")({
|
|
137
|
+
name: Schema.String,
|
|
138
|
+
version: Schema.String
|
|
139
|
+
}) {}
|
|
140
|
+
/**
|
|
141
|
+
* Capabilities a client may support. Known capabilities are defined here, in
|
|
142
|
+
* this schema, but this is not a closed set: any client can define its own,
|
|
143
|
+
* additional capabilities.
|
|
144
|
+
*
|
|
145
|
+
* @since 1.0.0
|
|
146
|
+
* @category Common
|
|
147
|
+
*/
|
|
148
|
+
export class ClientCapabilities extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ClientCapabilities")({
|
|
149
|
+
/**
|
|
150
|
+
* Experimental, non-standard capabilities that the client supports.
|
|
151
|
+
*/
|
|
152
|
+
experimental: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
153
|
+
key: Schema.String,
|
|
154
|
+
value: /*#__PURE__*/Schema.Struct({})
|
|
155
|
+
})),
|
|
156
|
+
/**
|
|
157
|
+
* Present if the client supports listing roots.
|
|
158
|
+
*/
|
|
159
|
+
roots: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({
|
|
160
|
+
/**
|
|
161
|
+
* Whether the client supports notifications for changes to the roots list.
|
|
162
|
+
*/
|
|
163
|
+
listChanged: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
164
|
+
})),
|
|
165
|
+
/**
|
|
166
|
+
* Present if the client supports sampling from an LLM.
|
|
167
|
+
*/
|
|
168
|
+
sampling: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({}))
|
|
169
|
+
}) {}
|
|
170
|
+
/**
|
|
171
|
+
* Capabilities that a server may support. Known capabilities are defined
|
|
172
|
+
* here, in this schema, but this is not a closed set: any server can define
|
|
173
|
+
* its own, additional capabilities.
|
|
174
|
+
*
|
|
175
|
+
* @since 1.0.0
|
|
176
|
+
* @category Common
|
|
177
|
+
*/
|
|
178
|
+
export class ServerCapabilities extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ServerCapabilities")({
|
|
179
|
+
/**
|
|
180
|
+
* Experimental, non-standard capabilities that the server supports.
|
|
181
|
+
*/
|
|
182
|
+
experimental: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
183
|
+
key: Schema.String,
|
|
184
|
+
value: /*#__PURE__*/Schema.Struct({})
|
|
185
|
+
})),
|
|
186
|
+
/**
|
|
187
|
+
* Present if the server supports sending log messages to the client.
|
|
188
|
+
*/
|
|
189
|
+
logging: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({})),
|
|
190
|
+
/**
|
|
191
|
+
* Present if the server supports argument autocompletion suggestions.
|
|
192
|
+
*/
|
|
193
|
+
completions: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({})),
|
|
194
|
+
/**
|
|
195
|
+
* Present if the server offers any prompt templates.
|
|
196
|
+
*/
|
|
197
|
+
prompts: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({
|
|
198
|
+
/**
|
|
199
|
+
* Whether this server supports notifications for changes to the prompt list.
|
|
200
|
+
*/
|
|
201
|
+
listChanged: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
202
|
+
})),
|
|
203
|
+
/**
|
|
204
|
+
* Present if the server offers any resources to read.
|
|
205
|
+
*/
|
|
206
|
+
resources: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({
|
|
207
|
+
/**
|
|
208
|
+
* Whether this server supports subscribing to resource updates.
|
|
209
|
+
*/
|
|
210
|
+
subscribe: /*#__PURE__*/Schema.optional(Schema.Boolean),
|
|
211
|
+
/**
|
|
212
|
+
* Whether this server supports notifications for changes to the resource list.
|
|
213
|
+
*/
|
|
214
|
+
listChanged: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
215
|
+
})),
|
|
216
|
+
/**
|
|
217
|
+
* Present if the server offers any tools to call.
|
|
218
|
+
*/
|
|
219
|
+
tools: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({
|
|
220
|
+
/**
|
|
221
|
+
* Whether this server supports notifications for changes to the tool list.
|
|
222
|
+
*/
|
|
223
|
+
listChanged: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
224
|
+
}))
|
|
225
|
+
}) {}
|
|
226
|
+
// =============================================================================
|
|
227
|
+
// Errors
|
|
228
|
+
// =============================================================================
|
|
229
|
+
/**
|
|
230
|
+
* @since 1.0.0
|
|
231
|
+
* @category Errors
|
|
232
|
+
*/
|
|
233
|
+
export class McpError extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/McpError")({
|
|
234
|
+
/**
|
|
235
|
+
* The error type that occurred.
|
|
236
|
+
*/
|
|
237
|
+
code: Schema.Number,
|
|
238
|
+
/**
|
|
239
|
+
* A short description of the error. The message SHOULD be limited to a
|
|
240
|
+
* concise single sentence.
|
|
241
|
+
*/
|
|
242
|
+
message: Schema.String,
|
|
243
|
+
/**
|
|
244
|
+
* Additional information about the error. The value of this member is
|
|
245
|
+
* defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
246
|
+
*/
|
|
247
|
+
data: /*#__PURE__*/Schema.optional(Schema.Unknown)
|
|
248
|
+
}) {}
|
|
249
|
+
/**
|
|
250
|
+
* @since 1.0.0
|
|
251
|
+
* @category Errors
|
|
252
|
+
*/
|
|
253
|
+
export const INVALID_REQUEST_ERROR_CODE = -32600;
|
|
254
|
+
/**
|
|
255
|
+
* @since 1.0.0
|
|
256
|
+
* @category Errors
|
|
257
|
+
*/
|
|
258
|
+
export const METHOD_NOT_FOUND_ERROR_CODE = -32601;
|
|
259
|
+
/**
|
|
260
|
+
* @since 1.0.0
|
|
261
|
+
* @category Errors
|
|
262
|
+
*/
|
|
263
|
+
export const INVALID_PARAMS_ERROR_CODE = -32602;
|
|
264
|
+
/**
|
|
265
|
+
* @since 1.0.0
|
|
266
|
+
* @category Errors
|
|
267
|
+
*/
|
|
268
|
+
export const INTERNAL_ERROR_CODE = -32603;
|
|
269
|
+
/**
|
|
270
|
+
* @since 1.0.0
|
|
271
|
+
* @category Errors
|
|
272
|
+
*/
|
|
273
|
+
export const PARSE_ERROR_CODE = -32700;
|
|
274
|
+
/**
|
|
275
|
+
* @since 1.0.0
|
|
276
|
+
* @category Errors
|
|
277
|
+
*/
|
|
278
|
+
export class ParseError extends /*#__PURE__*/Schema.TaggedError()("ParseError", {
|
|
279
|
+
...McpError.fields,
|
|
280
|
+
code: /*#__PURE__*/Schema.tag(PARSE_ERROR_CODE)
|
|
281
|
+
}) {}
|
|
282
|
+
/**
|
|
283
|
+
* @since 1.0.0
|
|
284
|
+
* @category Errors
|
|
285
|
+
*/
|
|
286
|
+
export class InvalidRequest extends /*#__PURE__*/Schema.TaggedError()("InvalidRequest", {
|
|
287
|
+
...McpError.fields,
|
|
288
|
+
code: /*#__PURE__*/Schema.tag(INVALID_REQUEST_ERROR_CODE)
|
|
289
|
+
}) {}
|
|
290
|
+
/**
|
|
291
|
+
* @since 1.0.0
|
|
292
|
+
* @category Errors
|
|
293
|
+
*/
|
|
294
|
+
export class MethodNotFound extends /*#__PURE__*/Schema.TaggedError()("MethodNotFound", {
|
|
295
|
+
...McpError.fields,
|
|
296
|
+
code: /*#__PURE__*/Schema.tag(METHOD_NOT_FOUND_ERROR_CODE)
|
|
297
|
+
}) {}
|
|
298
|
+
/**
|
|
299
|
+
* @since 1.0.0
|
|
300
|
+
* @category Errors
|
|
301
|
+
*/
|
|
302
|
+
export class InvalidParams extends /*#__PURE__*/Schema.TaggedError()("InvalidParams", {
|
|
303
|
+
...McpError.fields,
|
|
304
|
+
code: /*#__PURE__*/Schema.tag(INVALID_PARAMS_ERROR_CODE)
|
|
305
|
+
}) {}
|
|
306
|
+
/**
|
|
307
|
+
* @since 1.0.0
|
|
308
|
+
* @category Errors
|
|
309
|
+
*/
|
|
310
|
+
export class InternalError extends /*#__PURE__*/Schema.TaggedError()("InternalError", {
|
|
311
|
+
...McpError.fields,
|
|
312
|
+
code: /*#__PURE__*/Schema.tag(INTERNAL_ERROR_CODE)
|
|
313
|
+
}) {
|
|
314
|
+
static notImplemented = /*#__PURE__*/new InternalError({
|
|
315
|
+
message: "Not implemented"
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
// =============================================================================
|
|
319
|
+
// Ping
|
|
320
|
+
// =============================================================================
|
|
321
|
+
/**
|
|
322
|
+
* A ping, issued by either the server or the client, to check that the other
|
|
323
|
+
* party is still alive. The receiver must promptly respond, or else may be
|
|
324
|
+
* disconnected.
|
|
325
|
+
*
|
|
326
|
+
* @since 1.0.0
|
|
327
|
+
* @category Ping
|
|
328
|
+
*/
|
|
329
|
+
export class Ping extends /*#__PURE__*/Rpc.make("ping", {
|
|
330
|
+
success: /*#__PURE__*/Schema.Struct({}),
|
|
331
|
+
error: McpError,
|
|
332
|
+
payload: RequestMeta
|
|
333
|
+
}) {}
|
|
334
|
+
// =============================================================================
|
|
335
|
+
// Initialization
|
|
336
|
+
// =============================================================================
|
|
337
|
+
/**
|
|
338
|
+
* After receiving an initialize request from the client, the server sends this
|
|
339
|
+
* response.
|
|
340
|
+
*
|
|
341
|
+
* @since 1.0.0
|
|
342
|
+
* @category Initialization
|
|
343
|
+
*/
|
|
344
|
+
export class InitializeResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/InitializeResult")({
|
|
345
|
+
...ResultMeta.fields,
|
|
346
|
+
/**
|
|
347
|
+
* The version of the Model Context Protocol that the server wants to use.
|
|
348
|
+
* This may not match the version that the client requested. If the client
|
|
349
|
+
* cannot support this version, it MUST disconnect.
|
|
350
|
+
*/
|
|
351
|
+
protocolVersion: Schema.String,
|
|
352
|
+
capabilities: ServerCapabilities,
|
|
353
|
+
serverInfo: Implementation,
|
|
354
|
+
/**
|
|
355
|
+
* Instructions describing how to use the server and its features.
|
|
356
|
+
*
|
|
357
|
+
* This can be used by clients to improve the LLM's understanding of available
|
|
358
|
+
* tools, resources, etc. It can be thought of like a "hint" to the model.
|
|
359
|
+
* For example, this information MAY be added to the system prompt.
|
|
360
|
+
*/
|
|
361
|
+
instructions: /*#__PURE__*/Schema.optional(Schema.String)
|
|
362
|
+
}) {}
|
|
363
|
+
/**
|
|
364
|
+
* This request is sent from the client to the server when it first connects,
|
|
365
|
+
* asking it to begin initialization.
|
|
366
|
+
*
|
|
367
|
+
* @since 1.0.0
|
|
368
|
+
* @category Initialization
|
|
369
|
+
*/
|
|
370
|
+
export class Initialize extends /*#__PURE__*/Rpc.make("initialize", {
|
|
371
|
+
success: InitializeResult,
|
|
372
|
+
error: McpError,
|
|
373
|
+
payload: {
|
|
374
|
+
...RequestMeta.fields,
|
|
375
|
+
/**
|
|
376
|
+
* The latest version of the Model Context Protocol that the client
|
|
377
|
+
* supports. The client MAY decide to support older versions as well.
|
|
378
|
+
*/
|
|
379
|
+
protocolVersion: Schema.String,
|
|
380
|
+
/**
|
|
381
|
+
* Capabilities a client may support. Known capabilities are defined here,
|
|
382
|
+
* in this schema, but this is not a closed set: any client can define its
|
|
383
|
+
* own, additional capabilities.
|
|
384
|
+
*/
|
|
385
|
+
capabilities: ClientCapabilities,
|
|
386
|
+
/**
|
|
387
|
+
* Describes the name and version of an MCP implementation.
|
|
388
|
+
*/
|
|
389
|
+
clientInfo: Implementation
|
|
390
|
+
}
|
|
391
|
+
}) {}
|
|
392
|
+
/**
|
|
393
|
+
* This notification is sent from the client to the server after initialization
|
|
394
|
+
* has finished.
|
|
395
|
+
*
|
|
396
|
+
* @since 1.0.0
|
|
397
|
+
* @category Initialization
|
|
398
|
+
*/
|
|
399
|
+
export class InitializedNotification extends /*#__PURE__*/Rpc.make("notifications/initialized", {
|
|
400
|
+
payload: NotificationMeta
|
|
401
|
+
}) {}
|
|
402
|
+
// =============================================================================
|
|
403
|
+
// Cancellation
|
|
404
|
+
// =============================================================================
|
|
405
|
+
/**
|
|
406
|
+
* @since 1.0.0
|
|
407
|
+
* @category Cancellation
|
|
408
|
+
*/
|
|
409
|
+
export class CancelledNotification extends /*#__PURE__*/Rpc.make("notifications/cancelled", {
|
|
410
|
+
payload: {
|
|
411
|
+
...NotificationMeta.fields,
|
|
412
|
+
/**
|
|
413
|
+
* The ID of the request to cancel.
|
|
414
|
+
*
|
|
415
|
+
* This MUST correspond to the ID of a request previously issued in the
|
|
416
|
+
* same direction.
|
|
417
|
+
*/
|
|
418
|
+
requestId: RequestId,
|
|
419
|
+
/**
|
|
420
|
+
* An optional string describing the reason for the cancellation. This MAY
|
|
421
|
+
* be logged or presented to the user.
|
|
422
|
+
*/
|
|
423
|
+
reason: /*#__PURE__*/Schema.optional(Schema.String)
|
|
424
|
+
}
|
|
425
|
+
}) {}
|
|
426
|
+
// =============================================================================
|
|
427
|
+
// Progress
|
|
428
|
+
// =============================================================================
|
|
429
|
+
/**
|
|
430
|
+
* An out-of-band notification used to inform the receiver of a progress update
|
|
431
|
+
* for a long-running request.
|
|
432
|
+
*
|
|
433
|
+
* @since 1.0.0
|
|
434
|
+
* @category Progress
|
|
435
|
+
*/
|
|
436
|
+
export class ProgressNotification extends /*#__PURE__*/Rpc.make("notifications/progress", {
|
|
437
|
+
payload: {
|
|
438
|
+
...NotificationMeta.fields,
|
|
439
|
+
/**
|
|
440
|
+
* The progress token which was given in the initial request, used to
|
|
441
|
+
* associate this notification with the request that is proceeding.
|
|
442
|
+
*/
|
|
443
|
+
progressToken: ProgressToken,
|
|
444
|
+
/**
|
|
445
|
+
* The progress thus far. This should increase every time progress is made,
|
|
446
|
+
* even if the total is unknown.
|
|
447
|
+
*/
|
|
448
|
+
progress: /*#__PURE__*/Schema.optional(Schema.Number),
|
|
449
|
+
/**
|
|
450
|
+
* Total number of items to process (or total progress required), if known.
|
|
451
|
+
*/
|
|
452
|
+
total: /*#__PURE__*/Schema.optional(Schema.Number),
|
|
453
|
+
/**
|
|
454
|
+
* An optional message describing the current progress.
|
|
455
|
+
*/
|
|
456
|
+
message: /*#__PURE__*/Schema.optional(Schema.String)
|
|
457
|
+
}
|
|
458
|
+
}) {}
|
|
459
|
+
// =============================================================================
|
|
460
|
+
// Resources
|
|
461
|
+
// =============================================================================
|
|
462
|
+
/**
|
|
463
|
+
* A known resource that the server is capable of reading.
|
|
464
|
+
*
|
|
465
|
+
* @since 1.0.0
|
|
466
|
+
* @category Resources
|
|
467
|
+
*/
|
|
468
|
+
export class Resource extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Resource")({
|
|
469
|
+
/**
|
|
470
|
+
* The URI of this resource.
|
|
471
|
+
*/
|
|
472
|
+
uri: Schema.String,
|
|
473
|
+
/**
|
|
474
|
+
* A human-readable name for this resource.
|
|
475
|
+
*
|
|
476
|
+
* This can be used by clients to populate UI elements.
|
|
477
|
+
*/
|
|
478
|
+
name: Schema.String,
|
|
479
|
+
/**
|
|
480
|
+
* A description of what this resource represents.
|
|
481
|
+
*
|
|
482
|
+
* This can be used by clients to improve the LLM's understanding of available
|
|
483
|
+
* resources. It can be thought of like a "hint" to the model.
|
|
484
|
+
*/
|
|
485
|
+
description: /*#__PURE__*/Schema.optional(Schema.String),
|
|
486
|
+
/**
|
|
487
|
+
* The MIME type of this resource, if known.
|
|
488
|
+
*/
|
|
489
|
+
mimeType: /*#__PURE__*/Schema.optional(Schema.String),
|
|
490
|
+
/**
|
|
491
|
+
* Optional annotations for the client.
|
|
492
|
+
*/
|
|
493
|
+
annotations: /*#__PURE__*/Schema.optional(Annotations),
|
|
494
|
+
/**
|
|
495
|
+
* The size of the raw resource content, in bytes (i.e., before base64
|
|
496
|
+
* encoding or any tokenization), if known.
|
|
497
|
+
*
|
|
498
|
+
* This can be used by Hosts to display file sizes and estimate context
|
|
499
|
+
* window usage.
|
|
500
|
+
*/
|
|
501
|
+
size: /*#__PURE__*/Schema.optional(Schema.Number)
|
|
502
|
+
}) {}
|
|
503
|
+
/**
|
|
504
|
+
* A template description for resources available on the server.
|
|
505
|
+
*
|
|
506
|
+
* @since 1.0.0
|
|
507
|
+
* @category Resources
|
|
508
|
+
*/
|
|
509
|
+
export class ResourceTemplate extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ResourceTemplate")({
|
|
510
|
+
/**
|
|
511
|
+
* A URI template (according to RFC 6570) that can be used to construct
|
|
512
|
+
* resource URIs.
|
|
513
|
+
*/
|
|
514
|
+
uriTemplate: Schema.String,
|
|
515
|
+
/**
|
|
516
|
+
* A human-readable name for the type of resource this template refers to.
|
|
517
|
+
*
|
|
518
|
+
* This can be used by clients to populate UI elements.
|
|
519
|
+
*/
|
|
520
|
+
name: Schema.String,
|
|
521
|
+
/**
|
|
522
|
+
* A description of what this template is for.
|
|
523
|
+
*
|
|
524
|
+
* This can be used by clients to improve the LLM's understanding of available
|
|
525
|
+
* resources. It can be thought of like a "hint" to the model.
|
|
526
|
+
*/
|
|
527
|
+
description: /*#__PURE__*/Schema.optional(Schema.String),
|
|
528
|
+
/**
|
|
529
|
+
* The MIME type for all resources that match this template. This should only
|
|
530
|
+
* be included if all resources matching this template have the same type.
|
|
531
|
+
*/
|
|
532
|
+
mimeType: /*#__PURE__*/Schema.optional(Schema.String),
|
|
533
|
+
/**
|
|
534
|
+
* Optional annotations for the client.
|
|
535
|
+
*/
|
|
536
|
+
annotations: /*#__PURE__*/Schema.optional(Annotations)
|
|
537
|
+
}) {}
|
|
538
|
+
/**
|
|
539
|
+
* The contents of a specific resource or sub-resource.
|
|
540
|
+
*
|
|
541
|
+
* @since 1.0.0
|
|
542
|
+
* @category Resources
|
|
543
|
+
*/
|
|
544
|
+
export class ResourceContents extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ResourceContents")({
|
|
545
|
+
/**
|
|
546
|
+
* The URI of this resource.
|
|
547
|
+
*/
|
|
548
|
+
uri: Schema.String,
|
|
549
|
+
/**
|
|
550
|
+
* The MIME type of this resource, if known.
|
|
551
|
+
*/
|
|
552
|
+
mimeType: /*#__PURE__*/Schema.optional(Schema.String)
|
|
553
|
+
}) {}
|
|
554
|
+
/**
|
|
555
|
+
* The contents of a text resource, which can be represented as a string.
|
|
556
|
+
*
|
|
557
|
+
* @since 1.0.0
|
|
558
|
+
* @category Resources
|
|
559
|
+
*/
|
|
560
|
+
export class TextResourceContents extends /*#__PURE__*/ResourceContents.extend("@effect/ai/McpSchema/TextResourceContents")({
|
|
561
|
+
/**
|
|
562
|
+
* The text of the item. This must only be set if the item can actually be
|
|
563
|
+
* represented as text (not binary data).
|
|
564
|
+
*/
|
|
565
|
+
text: Schema.String
|
|
566
|
+
}) {}
|
|
567
|
+
/**
|
|
568
|
+
* The contents of a binary resource, which can be represented as an Uint8Array
|
|
569
|
+
*
|
|
570
|
+
* @since 1.0.0
|
|
571
|
+
* @category Resources
|
|
572
|
+
*/
|
|
573
|
+
export class BlobResourceContents extends /*#__PURE__*/ResourceContents.extend("@effect/ai/McpSchema/BlobResourceContents")({
|
|
574
|
+
/**
|
|
575
|
+
* The binary data of the item decoded from a base64-encoded string.
|
|
576
|
+
*/
|
|
577
|
+
blob: Schema.Uint8ArrayFromBase64
|
|
578
|
+
}) {}
|
|
579
|
+
/**
|
|
580
|
+
* The server's response to a resources/list request from the client.
|
|
581
|
+
*
|
|
582
|
+
* @since 1.0.0
|
|
583
|
+
* @category Resources
|
|
584
|
+
*/
|
|
585
|
+
export class ListResourcesResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListResourcesResult")({
|
|
586
|
+
...PaginatedResultMeta.fields,
|
|
587
|
+
resources: /*#__PURE__*/Schema.Array(Resource)
|
|
588
|
+
}) {}
|
|
589
|
+
/**
|
|
590
|
+
* Sent from the client to request a list of resources the server has.
|
|
591
|
+
*
|
|
592
|
+
* @since 1.0.0
|
|
593
|
+
* @category Resources
|
|
594
|
+
*/
|
|
595
|
+
export class ListResources extends /*#__PURE__*/Rpc.make("resources/list", {
|
|
596
|
+
success: ListResourcesResult,
|
|
597
|
+
error: McpError,
|
|
598
|
+
payload: PaginatedRequestMeta
|
|
599
|
+
}) {}
|
|
600
|
+
/**
|
|
601
|
+
* The server's response to a resources/templates/list request from the client.
|
|
602
|
+
*
|
|
603
|
+
* @since 1.0.0
|
|
604
|
+
* @category Resources
|
|
605
|
+
*/
|
|
606
|
+
export class ListResourceTemplatesResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListResourceTemplatesResult")({
|
|
607
|
+
...PaginatedResultMeta.fields,
|
|
608
|
+
resourceTemplates: /*#__PURE__*/Schema.Array(ResourceTemplate)
|
|
609
|
+
}) {}
|
|
610
|
+
/**
|
|
611
|
+
* Sent from the client to request a list of resource templates the server has.
|
|
612
|
+
*
|
|
613
|
+
* @since 1.0.0
|
|
614
|
+
* @category Resources
|
|
615
|
+
*/
|
|
616
|
+
export class ListResourceTemplates extends /*#__PURE__*/Rpc.make("resources/templates/list", {
|
|
617
|
+
success: ListResourceTemplatesResult,
|
|
618
|
+
error: McpError,
|
|
619
|
+
payload: PaginatedRequestMeta
|
|
620
|
+
}) {}
|
|
621
|
+
/**
|
|
622
|
+
* The server's response to a resources/read request from the client.
|
|
623
|
+
*
|
|
624
|
+
* @since 1.0.0
|
|
625
|
+
* @category Resources
|
|
626
|
+
*/
|
|
627
|
+
export class ReadResourceResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ReadResourceResult")({
|
|
628
|
+
...ResultMeta.fields,
|
|
629
|
+
contents: /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Union(TextResourceContents, BlobResourceContents))
|
|
630
|
+
}) {}
|
|
631
|
+
/**
|
|
632
|
+
* Sent from the client to the server, to read a specific resource URI.
|
|
633
|
+
*
|
|
634
|
+
* @since 1.0.0
|
|
635
|
+
* @category Resources
|
|
636
|
+
*/
|
|
637
|
+
export class ReadResource extends /*#__PURE__*/Rpc.make("resources/read", {
|
|
638
|
+
success: ReadResourceResult,
|
|
639
|
+
error: McpError,
|
|
640
|
+
payload: {
|
|
641
|
+
...RequestMeta.fields,
|
|
642
|
+
/**
|
|
643
|
+
* The URI of the resource to read. The URI can use any protocol; it is up
|
|
644
|
+
* to the server how to interpret it.
|
|
645
|
+
*/
|
|
646
|
+
uri: Schema.String
|
|
647
|
+
}
|
|
648
|
+
}) {}
|
|
649
|
+
/**
|
|
650
|
+
* An optional notification from the server to the client, informing it that the
|
|
651
|
+
* list of resources it can read from has changed. This may be issued by servers
|
|
652
|
+
* without any previous subscription from the client.
|
|
653
|
+
*
|
|
654
|
+
* @since 1.0.0
|
|
655
|
+
* @category Resources
|
|
656
|
+
*/
|
|
657
|
+
export class ResourceListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/resources/list_changed", {
|
|
658
|
+
payload: NotificationMeta
|
|
659
|
+
}) {}
|
|
660
|
+
/**
|
|
661
|
+
* Sent from the client to request resources/updated notifications from the
|
|
662
|
+
* server whenever a particular resource changes.
|
|
663
|
+
*
|
|
664
|
+
* @since 1.0.0
|
|
665
|
+
* @category Resources
|
|
666
|
+
*/
|
|
667
|
+
export class Subscribe extends /*#__PURE__*/Rpc.make("resources/subscribe", {
|
|
668
|
+
error: McpError,
|
|
669
|
+
payload: {
|
|
670
|
+
...RequestMeta.fields,
|
|
671
|
+
/**
|
|
672
|
+
* The URI of the resource to subscribe to. The URI can use any protocol;
|
|
673
|
+
* it is up to the server how to interpret it.
|
|
674
|
+
*/
|
|
675
|
+
uri: Schema.String
|
|
676
|
+
}
|
|
677
|
+
}) {}
|
|
678
|
+
/**
|
|
679
|
+
* Sent from the client to request cancellation of resources/updated
|
|
680
|
+
* notifications from the server. This should follow a previous
|
|
681
|
+
* resources/subscribe request.
|
|
682
|
+
*
|
|
683
|
+
* @since 1.0.0
|
|
684
|
+
* @category Resources
|
|
685
|
+
*/
|
|
686
|
+
export class Unsubscribe extends /*#__PURE__*/Rpc.make("resources/unsubscribe", {
|
|
687
|
+
error: McpError,
|
|
688
|
+
payload: {
|
|
689
|
+
...RequestMeta.fields,
|
|
690
|
+
/**
|
|
691
|
+
* The URI of the resource to subscribe to. The URI can use any protocol;
|
|
692
|
+
* it is up to the server how to interpret it.
|
|
693
|
+
*/
|
|
694
|
+
uri: Schema.String
|
|
695
|
+
}
|
|
696
|
+
}) {}
|
|
697
|
+
/**
|
|
698
|
+
* @since 1.0.0
|
|
699
|
+
* @category Resources
|
|
700
|
+
*/
|
|
701
|
+
export class ResourceUpdatedNotification extends /*#__PURE__*/Rpc.make("notifications/resources/updated", {
|
|
702
|
+
payload: {
|
|
703
|
+
...NotificationMeta.fields,
|
|
704
|
+
/**
|
|
705
|
+
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
|
706
|
+
*/
|
|
707
|
+
uri: Schema.String
|
|
708
|
+
}
|
|
709
|
+
}) {}
|
|
710
|
+
// =============================================================================
|
|
711
|
+
// Prompts
|
|
712
|
+
// =============================================================================
|
|
713
|
+
/**
|
|
714
|
+
* Describes an argument that a prompt can accept.
|
|
715
|
+
*
|
|
716
|
+
* @since 1.0.0
|
|
717
|
+
* @category Prompts
|
|
718
|
+
*/
|
|
719
|
+
export class PromptArgument extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/PromptArgument")({
|
|
720
|
+
/**
|
|
721
|
+
* The name of the argument.
|
|
722
|
+
*/
|
|
723
|
+
name: Schema.String,
|
|
724
|
+
/**
|
|
725
|
+
* A human-readable description of the argument.
|
|
726
|
+
*/
|
|
727
|
+
description: /*#__PURE__*/Schema.optional(Schema.String),
|
|
728
|
+
/**
|
|
729
|
+
* Whether this argument must be provided.
|
|
730
|
+
*/
|
|
731
|
+
required: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
732
|
+
}) {}
|
|
733
|
+
/**
|
|
734
|
+
* A prompt or prompt template that the server offers.
|
|
735
|
+
*
|
|
736
|
+
* @since 1.0.0
|
|
737
|
+
* @category Prompts
|
|
738
|
+
*/
|
|
739
|
+
export class Prompt extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Prompt")({
|
|
740
|
+
/**
|
|
741
|
+
* The name of the prompt or prompt template.
|
|
742
|
+
*/
|
|
743
|
+
name: Schema.String,
|
|
744
|
+
/**
|
|
745
|
+
* An optional description of what this prompt provides
|
|
746
|
+
*/
|
|
747
|
+
description: /*#__PURE__*/Schema.optional(Schema.String),
|
|
748
|
+
/**
|
|
749
|
+
* A list of arguments to use for templating the prompt.
|
|
750
|
+
*/
|
|
751
|
+
arguments: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(PromptArgument))
|
|
752
|
+
}) {}
|
|
753
|
+
/**
|
|
754
|
+
* Text provided to or from an LLM.
|
|
755
|
+
*
|
|
756
|
+
* @since 1.0.0
|
|
757
|
+
* @category Prompts
|
|
758
|
+
*/
|
|
759
|
+
export class TextContent extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/TextContent")({
|
|
760
|
+
type: /*#__PURE__*/Schema.tag("text"),
|
|
761
|
+
/**
|
|
762
|
+
* The text content of the message.
|
|
763
|
+
*/
|
|
764
|
+
text: Schema.String,
|
|
765
|
+
/**
|
|
766
|
+
* Optional annotations for the client.
|
|
767
|
+
*/
|
|
768
|
+
annotations: /*#__PURE__*/Schema.optional(Annotations)
|
|
769
|
+
}) {}
|
|
770
|
+
/**
|
|
771
|
+
* An image provided to or from an LLM.
|
|
772
|
+
*
|
|
773
|
+
* @since 1.0.0
|
|
774
|
+
* @category Prompts
|
|
775
|
+
*/
|
|
776
|
+
export class ImageContent extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ImageContent")({
|
|
777
|
+
type: /*#__PURE__*/Schema.tag("image"),
|
|
778
|
+
/**
|
|
779
|
+
* The image data.
|
|
780
|
+
*/
|
|
781
|
+
data: Schema.Uint8ArrayFromBase64,
|
|
782
|
+
/**
|
|
783
|
+
* The MIME type of the image. Different providers may support different
|
|
784
|
+
* image types.
|
|
785
|
+
*/
|
|
786
|
+
mimeType: Schema.String,
|
|
787
|
+
/**
|
|
788
|
+
* Optional annotations for the client.
|
|
789
|
+
*/
|
|
790
|
+
annotations: /*#__PURE__*/Schema.optional(Annotations)
|
|
791
|
+
}) {}
|
|
792
|
+
/**
|
|
793
|
+
* Audio provided to or from an LLM.
|
|
794
|
+
*
|
|
795
|
+
* @since 1.0.0
|
|
796
|
+
* @category Prompts
|
|
797
|
+
*/
|
|
798
|
+
export class AudioContent extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/AudioContent")({
|
|
799
|
+
type: /*#__PURE__*/Schema.tag("audio"),
|
|
800
|
+
/**
|
|
801
|
+
* The audio data.
|
|
802
|
+
*/
|
|
803
|
+
data: Schema.Uint8ArrayFromBase64,
|
|
804
|
+
/**
|
|
805
|
+
* The MIME type of the audio. Different providers may support different
|
|
806
|
+
* audio types.
|
|
807
|
+
*/
|
|
808
|
+
mimeType: Schema.String,
|
|
809
|
+
/**
|
|
810
|
+
* Optional annotations for the client.
|
|
811
|
+
*/
|
|
812
|
+
annotations: /*#__PURE__*/Schema.optional(Annotations)
|
|
813
|
+
}) {}
|
|
814
|
+
/**
|
|
815
|
+
* The contents of a resource, embedded into a prompt or tool call result.
|
|
816
|
+
*
|
|
817
|
+
* It is up to the client how best to render embedded resources for the benefit
|
|
818
|
+
* of the LLM and/or the user.
|
|
819
|
+
*
|
|
820
|
+
* @since 1.0.0
|
|
821
|
+
* @category Prompts
|
|
822
|
+
*/
|
|
823
|
+
export class EmbeddedResource extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/EmbeddedResource")({
|
|
824
|
+
type: /*#__PURE__*/Schema.tag("resource"),
|
|
825
|
+
resource: /*#__PURE__*/Schema.Union(TextResourceContents, BlobResourceContents),
|
|
826
|
+
/**
|
|
827
|
+
* Optional annotations for the client.
|
|
828
|
+
*/
|
|
829
|
+
annotations: /*#__PURE__*/Schema.optional(Annotations)
|
|
830
|
+
}) {}
|
|
831
|
+
/**
|
|
832
|
+
* Describes a message returned as part of a prompt.
|
|
833
|
+
*
|
|
834
|
+
* This is similar to `SamplingMessage`, but also supports the embedding of
|
|
835
|
+
* resources from the MCP server.
|
|
836
|
+
*
|
|
837
|
+
* @since 1.0.0
|
|
838
|
+
* @category Prompts
|
|
839
|
+
*/
|
|
840
|
+
export class PromptMessage extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/PromptMessage")({
|
|
841
|
+
role: Role,
|
|
842
|
+
content: /*#__PURE__*/Schema.Union(TextContent, ImageContent, AudioContent, EmbeddedResource)
|
|
843
|
+
}) {}
|
|
844
|
+
/**
|
|
845
|
+
* The server's response to a prompts/list request from the client.
|
|
846
|
+
*
|
|
847
|
+
* @since 1.0.0
|
|
848
|
+
* @category Prompts
|
|
849
|
+
*/
|
|
850
|
+
export class ListPromptsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListPromptsResult")({
|
|
851
|
+
...PaginatedResultMeta.fields,
|
|
852
|
+
prompts: /*#__PURE__*/Schema.Array(Prompt)
|
|
853
|
+
}) {}
|
|
854
|
+
/**
|
|
855
|
+
* Sent from the client to request a list of prompts and prompt templates the
|
|
856
|
+
* server has.
|
|
857
|
+
*
|
|
858
|
+
* @since 1.0.0
|
|
859
|
+
* @category Prompts
|
|
860
|
+
*/
|
|
861
|
+
export class ListPrompts extends /*#__PURE__*/Rpc.make("prompts/list", {
|
|
862
|
+
success: ListPromptsResult,
|
|
863
|
+
error: McpError,
|
|
864
|
+
payload: PaginatedRequestMeta
|
|
865
|
+
}) {}
|
|
866
|
+
/**
|
|
867
|
+
* The server's response to a prompts/get request from the client.
|
|
868
|
+
*
|
|
869
|
+
* @since 1.0.0
|
|
870
|
+
* @category Prompts
|
|
871
|
+
*/
|
|
872
|
+
export class GetPromptResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/GetPromptResult")({
|
|
873
|
+
...ResultMeta.fields,
|
|
874
|
+
messages: /*#__PURE__*/Schema.Array(PromptMessage),
|
|
875
|
+
/**
|
|
876
|
+
* An optional description for the prompt.
|
|
877
|
+
*/
|
|
878
|
+
description: /*#__PURE__*/Schema.optional(Schema.String)
|
|
879
|
+
}) {}
|
|
880
|
+
/**
|
|
881
|
+
* Used by the client to get a prompt provided by the server.
|
|
882
|
+
*
|
|
883
|
+
* @since 1.0.0
|
|
884
|
+
* @category Prompts
|
|
885
|
+
*/
|
|
886
|
+
export class GetPrompt extends /*#__PURE__*/Rpc.make("prompts/get", {
|
|
887
|
+
success: GetPromptResult,
|
|
888
|
+
error: McpError,
|
|
889
|
+
payload: {
|
|
890
|
+
...RequestMeta.fields,
|
|
891
|
+
/**
|
|
892
|
+
* The name of the prompt or prompt template.
|
|
893
|
+
*/
|
|
894
|
+
name: Schema.String,
|
|
895
|
+
/**
|
|
896
|
+
* Arguments to use for templating the prompt.
|
|
897
|
+
*/
|
|
898
|
+
arguments: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
899
|
+
key: Schema.String,
|
|
900
|
+
value: Schema.String
|
|
901
|
+
}))
|
|
902
|
+
}
|
|
903
|
+
}) {}
|
|
904
|
+
/**
|
|
905
|
+
* An optional notification from the server to the client, informing it that
|
|
906
|
+
* the list of prompts it offers has changed. This may be issued by servers
|
|
907
|
+
* without any previous subscription from the client.
|
|
908
|
+
*
|
|
909
|
+
* @since 1.0.0
|
|
910
|
+
* @category Prompts
|
|
911
|
+
*/
|
|
912
|
+
export class PromptListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/prompts/list_changed", {
|
|
913
|
+
payload: NotificationMeta
|
|
914
|
+
}) {}
|
|
915
|
+
// =============================================================================
|
|
916
|
+
// Tools
|
|
917
|
+
// =============================================================================
|
|
918
|
+
/**
|
|
919
|
+
* Additional properties describing a Tool to clients.
|
|
920
|
+
*
|
|
921
|
+
* NOTE: all properties in ToolAnnotations are **hints**. They are not
|
|
922
|
+
* guaranteed to provide a faithful description of tool behavior (including
|
|
923
|
+
* descriptive properties like `title`).
|
|
924
|
+
*
|
|
925
|
+
* Clients should never make tool use decisions based on ToolAnnotations
|
|
926
|
+
* received from untrusted servers.
|
|
927
|
+
*
|
|
928
|
+
* @since 1.0.0
|
|
929
|
+
* @category Tools
|
|
930
|
+
*/
|
|
931
|
+
export class ToolAnnotations extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ToolAnnotations")({
|
|
932
|
+
/**
|
|
933
|
+
* A human-readable title for the tool.
|
|
934
|
+
*/
|
|
935
|
+
title: /*#__PURE__*/Schema.optional(Schema.String),
|
|
936
|
+
/**
|
|
937
|
+
* If true, the tool does not modify its environment.
|
|
938
|
+
*
|
|
939
|
+
* Default: `false`
|
|
940
|
+
*/
|
|
941
|
+
readOnlyHint: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
|
|
942
|
+
default: () => false
|
|
943
|
+
}),
|
|
944
|
+
/**
|
|
945
|
+
* If true, the tool may perform destructive updates to its environment.
|
|
946
|
+
* If false, the tool performs only additive updates.
|
|
947
|
+
*
|
|
948
|
+
* (This property is meaningful only when `readOnlyHint == false`)
|
|
949
|
+
*
|
|
950
|
+
* Default: `true`
|
|
951
|
+
*/
|
|
952
|
+
destructiveHint: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
|
|
953
|
+
default: () => true
|
|
954
|
+
}),
|
|
955
|
+
/**
|
|
956
|
+
* If true, calling the tool repeatedly with the same arguments
|
|
957
|
+
* will have no additional effect on the its environment.
|
|
958
|
+
*
|
|
959
|
+
* (This property is meaningful only when `readOnlyHint == false`)
|
|
960
|
+
*
|
|
961
|
+
* Default: `false`
|
|
962
|
+
*/
|
|
963
|
+
idempotentHint: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
|
|
964
|
+
default: () => false
|
|
965
|
+
}),
|
|
966
|
+
/**
|
|
967
|
+
* If true, this tool may interact with an "open world" of external
|
|
968
|
+
* entities. If false, the tool's domain of interaction is closed.
|
|
969
|
+
* For example, the world of a web search tool is open, whereas that
|
|
970
|
+
* of a memory tool is not.
|
|
971
|
+
*
|
|
972
|
+
* Default: `true`
|
|
973
|
+
*/
|
|
974
|
+
openWorldHint: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
|
|
975
|
+
default: () => true
|
|
976
|
+
})
|
|
977
|
+
}) {}
|
|
978
|
+
/**
|
|
979
|
+
* Definition for a tool the client can call.
|
|
980
|
+
*
|
|
981
|
+
* @since 1.0.0
|
|
982
|
+
* @category Tools
|
|
983
|
+
*/
|
|
984
|
+
export class Tool extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Tool")({
|
|
985
|
+
/**
|
|
986
|
+
* The name of the tool.
|
|
987
|
+
*/
|
|
988
|
+
name: Schema.String,
|
|
989
|
+
/**
|
|
990
|
+
* A human-readable description of the tool.
|
|
991
|
+
*
|
|
992
|
+
* This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.
|
|
993
|
+
*/
|
|
994
|
+
description: /*#__PURE__*/Schema.optional(Schema.String),
|
|
995
|
+
/**
|
|
996
|
+
* A JSON Schema object defining the expected parameters for the tool.
|
|
997
|
+
*/
|
|
998
|
+
inputSchema: Schema.Unknown,
|
|
999
|
+
/**
|
|
1000
|
+
* Optional additional tool information.
|
|
1001
|
+
*/
|
|
1002
|
+
annotations: /*#__PURE__*/Schema.optional(ToolAnnotations)
|
|
1003
|
+
}) {}
|
|
1004
|
+
/**
|
|
1005
|
+
* The server's response to a tools/list request from the client.
|
|
1006
|
+
*
|
|
1007
|
+
* @since 1.0.0
|
|
1008
|
+
* @category Tools
|
|
1009
|
+
*/
|
|
1010
|
+
export class ListToolsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListToolsResult")({
|
|
1011
|
+
...PaginatedResultMeta.fields,
|
|
1012
|
+
tools: /*#__PURE__*/Schema.Array(Tool)
|
|
1013
|
+
}) {}
|
|
1014
|
+
/**
|
|
1015
|
+
* Sent from the client to request a list of tools the server has.
|
|
1016
|
+
*
|
|
1017
|
+
* @since 1.0.0
|
|
1018
|
+
* @category Tools
|
|
1019
|
+
*/
|
|
1020
|
+
export class ListTools extends /*#__PURE__*/Rpc.make("tools/list", {
|
|
1021
|
+
success: ListToolsResult,
|
|
1022
|
+
error: McpError,
|
|
1023
|
+
payload: PaginatedRequestMeta
|
|
1024
|
+
}) {}
|
|
1025
|
+
/**
|
|
1026
|
+
* The server's response to a tool call.
|
|
1027
|
+
*
|
|
1028
|
+
* Any errors that originate from the tool SHOULD be reported inside the result
|
|
1029
|
+
* object, with `isError` set to true, _not_ as an MCP protocol-level error
|
|
1030
|
+
* response. Otherwise, the LLM would not be able to see that an error occurred
|
|
1031
|
+
* and self-correct.
|
|
1032
|
+
*
|
|
1033
|
+
* However, any errors in _finding_ the tool, an error indicating that the
|
|
1034
|
+
* server does not support tool calls, or any other exceptional conditions,
|
|
1035
|
+
* should be reported as an MCP error response.
|
|
1036
|
+
*
|
|
1037
|
+
* @since 1.0.0
|
|
1038
|
+
* @category Tools
|
|
1039
|
+
*/
|
|
1040
|
+
export class CallToolResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/CallToolResult")({
|
|
1041
|
+
...ResultMeta.fields,
|
|
1042
|
+
content: /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Union(TextContent, ImageContent, AudioContent, EmbeddedResource)),
|
|
1043
|
+
/**
|
|
1044
|
+
* Whether the tool call ended in an error.
|
|
1045
|
+
*
|
|
1046
|
+
* If not set, this is assumed to be false (the call was successful).
|
|
1047
|
+
*/
|
|
1048
|
+
isError: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
1049
|
+
}) {}
|
|
1050
|
+
/**
|
|
1051
|
+
* Used by the client to invoke a tool provided by the server.
|
|
1052
|
+
*
|
|
1053
|
+
* @since 1.0.0
|
|
1054
|
+
* @category Tools
|
|
1055
|
+
*/
|
|
1056
|
+
export class CallTool extends /*#__PURE__*/Rpc.make("tools/call", {
|
|
1057
|
+
success: CallToolResult,
|
|
1058
|
+
error: McpError,
|
|
1059
|
+
payload: {
|
|
1060
|
+
...RequestMeta.fields,
|
|
1061
|
+
name: Schema.String,
|
|
1062
|
+
arguments: /*#__PURE__*/Schema.Record({
|
|
1063
|
+
key: Schema.String,
|
|
1064
|
+
value: Schema.Unknown
|
|
1065
|
+
})
|
|
1066
|
+
}
|
|
1067
|
+
}) {}
|
|
1068
|
+
/**
|
|
1069
|
+
* An optional notification from the server to the client, informing it that
|
|
1070
|
+
* the list of tools it offers has changed. This may be issued by servers
|
|
1071
|
+
* without any previous subscription from the client.
|
|
1072
|
+
*
|
|
1073
|
+
* @since 1.0.0
|
|
1074
|
+
* @category Tools
|
|
1075
|
+
*/
|
|
1076
|
+
export class ToolListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/tools/list_changed", {
|
|
1077
|
+
payload: NotificationMeta
|
|
1078
|
+
}) {}
|
|
1079
|
+
// =============================================================================
|
|
1080
|
+
// Logging
|
|
1081
|
+
// =============================================================================
|
|
1082
|
+
/**
|
|
1083
|
+
* The severity of a log message.
|
|
1084
|
+
*
|
|
1085
|
+
* These map to syslog message severities, as specified in RFC-5424:
|
|
1086
|
+
* https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1
|
|
1087
|
+
*
|
|
1088
|
+
* @since 1.0.0
|
|
1089
|
+
* @category Logging
|
|
1090
|
+
*/
|
|
1091
|
+
export const LoggingLevel = /*#__PURE__*/Schema.Literal("debug", "info", "notice", "warning", "error", "critical", "alert", "emergency");
|
|
1092
|
+
/**
|
|
1093
|
+
* A request from the client to the server, to enable or adjust logging.
|
|
1094
|
+
*
|
|
1095
|
+
* @since 1.0.0
|
|
1096
|
+
* @category Logging
|
|
1097
|
+
*/
|
|
1098
|
+
export class SetLevel extends /*#__PURE__*/Rpc.make("logging/setLevel", {
|
|
1099
|
+
payload: {
|
|
1100
|
+
...RequestMeta.fields,
|
|
1101
|
+
/**
|
|
1102
|
+
* The level of logging that the client wants to receive from the server.
|
|
1103
|
+
* The server should send all logs at this level and higher (i.e., more
|
|
1104
|
+
* severe) to the client as notifications/message.
|
|
1105
|
+
*/
|
|
1106
|
+
level: LoggingLevel
|
|
1107
|
+
},
|
|
1108
|
+
error: McpError
|
|
1109
|
+
}) {}
|
|
1110
|
+
/**
|
|
1111
|
+
* @since 1.0.0
|
|
1112
|
+
* @category Logging
|
|
1113
|
+
*/
|
|
1114
|
+
export class LoggingMessageNotification extends /*#__PURE__*/Rpc.make("notifications/message", {
|
|
1115
|
+
payload: /*#__PURE__*/Schema.Struct({
|
|
1116
|
+
...NotificationMeta.fields,
|
|
1117
|
+
/**
|
|
1118
|
+
* The severity of this log message.
|
|
1119
|
+
*/
|
|
1120
|
+
level: LoggingLevel,
|
|
1121
|
+
/**
|
|
1122
|
+
* An optional name of the logger issuing this message.
|
|
1123
|
+
*/
|
|
1124
|
+
logger: /*#__PURE__*/Schema.optional(Schema.String),
|
|
1125
|
+
/**
|
|
1126
|
+
* The data to be logged, such as a string message or an object. Any JSON
|
|
1127
|
+
* serializable type is allowed here.
|
|
1128
|
+
*/
|
|
1129
|
+
data: Schema.Unknown
|
|
1130
|
+
})
|
|
1131
|
+
}) {}
|
|
1132
|
+
// =============================================================================
|
|
1133
|
+
// Sampling
|
|
1134
|
+
// =============================================================================
|
|
1135
|
+
/**
|
|
1136
|
+
* Describes a message issued to or received from an LLM API.
|
|
1137
|
+
*
|
|
1138
|
+
* @since 1.0.0
|
|
1139
|
+
* @category Sampling
|
|
1140
|
+
*/
|
|
1141
|
+
export class SamplingMessage extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/SamplingMessage")({
|
|
1142
|
+
role: Role,
|
|
1143
|
+
content: /*#__PURE__*/Schema.Union(TextContent, ImageContent, AudioContent)
|
|
1144
|
+
}) {}
|
|
1145
|
+
/**
|
|
1146
|
+
* Hints to use for model selection.
|
|
1147
|
+
*
|
|
1148
|
+
* Keys not declared here are currently left unspecified by the spec and are up
|
|
1149
|
+
* to the client to interpret.
|
|
1150
|
+
*
|
|
1151
|
+
* @since 1.0.0
|
|
1152
|
+
* @category Sampling
|
|
1153
|
+
*/
|
|
1154
|
+
export class ModelHint extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ModelHint")({
|
|
1155
|
+
/**
|
|
1156
|
+
* A hint for a model name.
|
|
1157
|
+
*
|
|
1158
|
+
* The client SHOULD treat this as a substring of a model name; for example:
|
|
1159
|
+
* - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
|
|
1160
|
+
* - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.
|
|
1161
|
+
* - `claude` should match any Claude model
|
|
1162
|
+
*
|
|
1163
|
+
* The client MAY also map the string to a different provider's model name or
|
|
1164
|
+
* a different model family, as long as it fills a similar niche; for example:
|
|
1165
|
+
* - `gemini-1.5-flash` could match `claude-3-haiku-20240307`
|
|
1166
|
+
*/
|
|
1167
|
+
name: /*#__PURE__*/Schema.optional(Schema.String)
|
|
1168
|
+
}) {}
|
|
1169
|
+
/**
|
|
1170
|
+
* The server's preferences for model selection, requested of the client during sampling.
|
|
1171
|
+
*
|
|
1172
|
+
* Because LLMs can vary along multiple dimensions, choosing the "best" model is
|
|
1173
|
+
* rarely straightforward. Different models excel in different areas—some are
|
|
1174
|
+
* faster but less capable, others are more capable but more expensive, and so
|
|
1175
|
+
* on. This interface allows servers to express their priorities across multiple
|
|
1176
|
+
* dimensions to help clients make an appropriate selection for their use case.
|
|
1177
|
+
*
|
|
1178
|
+
* These preferences are always advisory. The client MAY ignore them. It is also
|
|
1179
|
+
* up to the client to decide how to interpret these preferences and how to
|
|
1180
|
+
* balance them against other considerations.
|
|
1181
|
+
*
|
|
1182
|
+
* @since 1.0.0
|
|
1183
|
+
* @category Sampling
|
|
1184
|
+
*/
|
|
1185
|
+
export class ModelPreferences extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ModelPreferences")({
|
|
1186
|
+
/**
|
|
1187
|
+
* Optional hints to use for model selection.
|
|
1188
|
+
*
|
|
1189
|
+
* If multiple hints are specified, the client MUST evaluate them in order
|
|
1190
|
+
* (such that the first match is taken).
|
|
1191
|
+
*
|
|
1192
|
+
* The client SHOULD prioritize these hints over the numeric priorities, but
|
|
1193
|
+
* MAY still use the priorities to select from ambiguous matches.
|
|
1194
|
+
*/
|
|
1195
|
+
hints: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(ModelHint)),
|
|
1196
|
+
/**
|
|
1197
|
+
* How much to prioritize cost when selecting a model. A value of 0 means cost
|
|
1198
|
+
* is not important, while a value of 1 means cost is the most important
|
|
1199
|
+
* factor.
|
|
1200
|
+
*/
|
|
1201
|
+
costPriority: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1))),
|
|
1202
|
+
/**
|
|
1203
|
+
* How much to prioritize sampling speed (latency) when selecting a model. A
|
|
1204
|
+
* value of 0 means speed is not important, while a value of 1 means speed is
|
|
1205
|
+
* the most important factor.
|
|
1206
|
+
*/
|
|
1207
|
+
speedPriority: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1))),
|
|
1208
|
+
/**
|
|
1209
|
+
* How much to prioritize intelligence and capabilities when selecting a
|
|
1210
|
+
* model. A value of 0 means intelligence is not important, while a value of 1
|
|
1211
|
+
* means intelligence is the most important factor.
|
|
1212
|
+
*/
|
|
1213
|
+
intelligencePriority: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1)))
|
|
1214
|
+
}) {}
|
|
1215
|
+
/**
|
|
1216
|
+
* The client's response to a sampling/create_message request from the server.
|
|
1217
|
+
* The client should inform the user before returning the sampled message, to
|
|
1218
|
+
* allow them to inspect the response (human in the loop) and decide whether to
|
|
1219
|
+
* allow the server to see it.
|
|
1220
|
+
*
|
|
1221
|
+
* @since 1.0.0
|
|
1222
|
+
* @category Sampling
|
|
1223
|
+
*/
|
|
1224
|
+
export class CreateMessageResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/CreateMessageResult")({
|
|
1225
|
+
/**
|
|
1226
|
+
* The name of the model that generated the message.
|
|
1227
|
+
*/
|
|
1228
|
+
model: Schema.String,
|
|
1229
|
+
/**
|
|
1230
|
+
* The reason why sampling stopped, if known.
|
|
1231
|
+
*/
|
|
1232
|
+
stopReason: /*#__PURE__*/Schema.optional(Schema.String)
|
|
1233
|
+
}) {}
|
|
1234
|
+
/**
|
|
1235
|
+
* A request from the server to sample an LLM via the client. The client has
|
|
1236
|
+
* full discretion over which model to select. The client should also inform the
|
|
1237
|
+
* user before beginning sampling, to allow them to inspect the request (human
|
|
1238
|
+
* in the loop) and decide whether to approve it.
|
|
1239
|
+
*
|
|
1240
|
+
* @since 1.0.0
|
|
1241
|
+
* @category Sampling
|
|
1242
|
+
*/
|
|
1243
|
+
export class CreateMessage extends /*#__PURE__*/Rpc.make("sampling/createMessage", {
|
|
1244
|
+
success: CreateMessageResult,
|
|
1245
|
+
error: McpError,
|
|
1246
|
+
payload: {
|
|
1247
|
+
messages: /*#__PURE__*/Schema.Array(SamplingMessage),
|
|
1248
|
+
/**
|
|
1249
|
+
* The server's preferences for which model to select. The client MAY ignore
|
|
1250
|
+
* these preferences.
|
|
1251
|
+
*/
|
|
1252
|
+
modelPreferences: /*#__PURE__*/Schema.optional(ModelPreferences),
|
|
1253
|
+
/**
|
|
1254
|
+
* An optional system prompt the server wants to use for sampling. The
|
|
1255
|
+
* client MAY modify or omit this prompt.
|
|
1256
|
+
*/
|
|
1257
|
+
systemPrompt: /*#__PURE__*/Schema.optional(Schema.String),
|
|
1258
|
+
/**
|
|
1259
|
+
* A request to include context from one or more MCP servers (including the
|
|
1260
|
+
* caller), to be attached to the prompt. The client MAY ignore this request.
|
|
1261
|
+
*/
|
|
1262
|
+
includeContext: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literal("none", "thisServer", "allServers")),
|
|
1263
|
+
temperature: /*#__PURE__*/Schema.optional(Schema.Number),
|
|
1264
|
+
/**
|
|
1265
|
+
* The maximum number of tokens to sample, as requested by the server. The
|
|
1266
|
+
* client MAY choose to sample fewer tokens than requested.
|
|
1267
|
+
*/
|
|
1268
|
+
maxTokens: Schema.Number,
|
|
1269
|
+
stopSequences: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String)),
|
|
1270
|
+
/**
|
|
1271
|
+
* Optional metadata to pass through to the LLM provider. The format of
|
|
1272
|
+
* this metadata is provider-specific.
|
|
1273
|
+
*/
|
|
1274
|
+
metadata: Schema.Unknown
|
|
1275
|
+
}
|
|
1276
|
+
}) {}
|
|
1277
|
+
// =============================================================================
|
|
1278
|
+
// Autocomplete
|
|
1279
|
+
// =============================================================================
|
|
1280
|
+
/**
|
|
1281
|
+
* A reference to a resource or resource template definition.
|
|
1282
|
+
*
|
|
1283
|
+
* @since 1.0.0
|
|
1284
|
+
* @category Autocomplete
|
|
1285
|
+
*/
|
|
1286
|
+
export class ResourceReference extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ResourceReference")({
|
|
1287
|
+
type: /*#__PURE__*/Schema.tag("ref/resource"),
|
|
1288
|
+
/**
|
|
1289
|
+
* The URI or URI template of the resource.
|
|
1290
|
+
*/
|
|
1291
|
+
uri: Schema.String
|
|
1292
|
+
}) {}
|
|
1293
|
+
/**
|
|
1294
|
+
* Identifies a prompt.
|
|
1295
|
+
*
|
|
1296
|
+
* @since 1.0.0
|
|
1297
|
+
* @category Autocomplete
|
|
1298
|
+
*/
|
|
1299
|
+
export class PromptReference extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/PromptReference")({
|
|
1300
|
+
type: /*#__PURE__*/Schema.tag("ref/prompt"),
|
|
1301
|
+
/**
|
|
1302
|
+
* The name of the prompt or prompt template
|
|
1303
|
+
*/
|
|
1304
|
+
name: Schema.String
|
|
1305
|
+
}) {}
|
|
1306
|
+
/**
|
|
1307
|
+
* The server's response to a completion/complete request
|
|
1308
|
+
*
|
|
1309
|
+
* @since 1.0.0
|
|
1310
|
+
* @category Autocomplete
|
|
1311
|
+
*/
|
|
1312
|
+
export class CompleteResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/CompleteResult")({
|
|
1313
|
+
completion: /*#__PURE__*/Schema.Struct({
|
|
1314
|
+
/**
|
|
1315
|
+
* An array of completion values. Must not exceed 100 items.
|
|
1316
|
+
*/
|
|
1317
|
+
values: /*#__PURE__*/Schema.Array(Schema.String),
|
|
1318
|
+
/**
|
|
1319
|
+
* The total number of completion options available. This can exceed the
|
|
1320
|
+
* number of values actually sent in the response.
|
|
1321
|
+
*/
|
|
1322
|
+
total: /*#__PURE__*/Schema.optional(Schema.Number),
|
|
1323
|
+
/**
|
|
1324
|
+
* Indicates whether there are additional completion options beyond those
|
|
1325
|
+
* provided in the current response, even if the exact total is unknown.
|
|
1326
|
+
*/
|
|
1327
|
+
hasMore: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
1328
|
+
})
|
|
1329
|
+
}) {
|
|
1330
|
+
/**
|
|
1331
|
+
* @since 1.0.0
|
|
1332
|
+
*/
|
|
1333
|
+
static empty = /*#__PURE__*/new CompleteResult({
|
|
1334
|
+
completion: {
|
|
1335
|
+
values: [],
|
|
1336
|
+
total: 0,
|
|
1337
|
+
hasMore: false
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* A request from the client to the server, to ask for completion options.
|
|
1343
|
+
*
|
|
1344
|
+
* @since 1.0.0
|
|
1345
|
+
* @category Autocomplete
|
|
1346
|
+
*/
|
|
1347
|
+
export class Complete extends /*#__PURE__*/Rpc.make("completion/complete", {
|
|
1348
|
+
success: CompleteResult,
|
|
1349
|
+
error: McpError,
|
|
1350
|
+
payload: {
|
|
1351
|
+
ref: /*#__PURE__*/Schema.Union(PromptReference, ResourceReference),
|
|
1352
|
+
/**
|
|
1353
|
+
* The argument's information
|
|
1354
|
+
*/
|
|
1355
|
+
argument: /*#__PURE__*/Schema.Struct({
|
|
1356
|
+
/**
|
|
1357
|
+
* The name of the argument
|
|
1358
|
+
*/
|
|
1359
|
+
name: Schema.String,
|
|
1360
|
+
/**
|
|
1361
|
+
* The value of the argument to use for completion matching.
|
|
1362
|
+
*/
|
|
1363
|
+
value: Schema.String
|
|
1364
|
+
})
|
|
1365
|
+
}
|
|
1366
|
+
}) {}
|
|
1367
|
+
// =============================================================================
|
|
1368
|
+
// Roots
|
|
1369
|
+
// =============================================================================
|
|
1370
|
+
/**
|
|
1371
|
+
* Represents a root directory or file that the server can operate on.
|
|
1372
|
+
*
|
|
1373
|
+
* @since 1.0.0
|
|
1374
|
+
* @category Roots
|
|
1375
|
+
*/
|
|
1376
|
+
export class Root extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/Root")({
|
|
1377
|
+
/**
|
|
1378
|
+
* The URI identifying the root. This *must* start with file:// for now.
|
|
1379
|
+
* This restriction may be relaxed in future versions of the protocol to allow
|
|
1380
|
+
* other URI schemes.
|
|
1381
|
+
*/
|
|
1382
|
+
uri: Schema.String,
|
|
1383
|
+
/**
|
|
1384
|
+
* An optional name for the root. This can be used to provide a human-readable
|
|
1385
|
+
* identifier for the root, which may be useful for display purposes or for
|
|
1386
|
+
* referencing the root in other parts of the application.
|
|
1387
|
+
*/
|
|
1388
|
+
name: /*#__PURE__*/Schema.optional(Schema.String)
|
|
1389
|
+
}) {}
|
|
1390
|
+
/**
|
|
1391
|
+
* The client's response to a roots/list request from the server. This result
|
|
1392
|
+
* contains an array of Root objects, each representing a root directory or file
|
|
1393
|
+
* that the server can operate on.
|
|
1394
|
+
*
|
|
1395
|
+
* @since 1.0.0
|
|
1396
|
+
* @category Roots
|
|
1397
|
+
*/
|
|
1398
|
+
export class ListRootsResult extends /*#__PURE__*/Schema.Class("@effect/ai/McpSchema/ListRootsResult")({
|
|
1399
|
+
roots: /*#__PURE__*/Schema.Array(Root)
|
|
1400
|
+
}) {}
|
|
1401
|
+
/**
|
|
1402
|
+
* Sent from the server to request a list of root URIs from the client. Roots
|
|
1403
|
+
* allow servers to ask for specific directories or files to operate on. A
|
|
1404
|
+
* common example for roots is providing a set of repositories or directories a
|
|
1405
|
+
* server should operate
|
|
1406
|
+
* on.
|
|
1407
|
+
*
|
|
1408
|
+
* This request is typically used when the server needs to understand the file
|
|
1409
|
+
* system structure or access specific locations that the client has permission
|
|
1410
|
+
* to read from.
|
|
1411
|
+
*
|
|
1412
|
+
* @since 1.0.0
|
|
1413
|
+
* @category Roots
|
|
1414
|
+
*/
|
|
1415
|
+
export class ListRoots extends /*#__PURE__*/Rpc.make("roots/list", {
|
|
1416
|
+
success: ListRootsResult,
|
|
1417
|
+
error: McpError,
|
|
1418
|
+
payload: RequestMeta
|
|
1419
|
+
}) {}
|
|
1420
|
+
/**
|
|
1421
|
+
* A notification from the client to the server, informing it that the list of
|
|
1422
|
+
* roots has changed. This notification should be sent whenever the client adds,
|
|
1423
|
+
* removes, or modifies any root. The server should then request an updated list
|
|
1424
|
+
* of roots using the ListRootsRequest.
|
|
1425
|
+
*
|
|
1426
|
+
* @since 1.0.0
|
|
1427
|
+
* @category Roots
|
|
1428
|
+
*/
|
|
1429
|
+
export class RootsListChangedNotification extends /*#__PURE__*/Rpc.make("notifications/roots/list_changed", {
|
|
1430
|
+
payload: NotificationMeta
|
|
1431
|
+
}) {}
|
|
1432
|
+
/**
|
|
1433
|
+
* @since 1.0.0
|
|
1434
|
+
* @category Protocol
|
|
1435
|
+
*/
|
|
1436
|
+
export class ClientRequestRpcs extends /*#__PURE__*/RpcGroup.make(Ping, Initialize, Complete, SetLevel, GetPrompt, ListPrompts, ListResources, ListResourceTemplates, ReadResource, Subscribe, Unsubscribe, CallTool, ListTools) {}
|
|
1437
|
+
/**
|
|
1438
|
+
* @since 1.0.0
|
|
1439
|
+
* @category Protocol
|
|
1440
|
+
*/
|
|
1441
|
+
export class ClientNotificationRpcs extends /*#__PURE__*/RpcGroup.make(CancelledNotification, ProgressNotification, InitializedNotification, RootsListChangedNotification) {}
|
|
1442
|
+
/**
|
|
1443
|
+
* @since 1.0.0
|
|
1444
|
+
* @category Protocol
|
|
1445
|
+
*/
|
|
1446
|
+
export class ClientRpcs extends /*#__PURE__*/ClientRequestRpcs.merge(ClientNotificationRpcs) {}
|
|
1447
|
+
/**
|
|
1448
|
+
* @since 1.0.0
|
|
1449
|
+
* @category Protocol
|
|
1450
|
+
*/
|
|
1451
|
+
export class ServerRequestRpcs extends /*#__PURE__*/RpcGroup.make(Ping, CreateMessage, ListRoots) {}
|
|
1452
|
+
/**
|
|
1453
|
+
* @since 1.0.0
|
|
1454
|
+
* @category Protocol
|
|
1455
|
+
*/
|
|
1456
|
+
export class ServerNotificationRpcs extends /*#__PURE__*/RpcGroup.make(CancelledNotification, ProgressNotification, LoggingMessageNotification, ResourceUpdatedNotification, ResourceListChangedNotification, ToolListChangedNotification, PromptListChangedNotification) {}
|
|
1457
|
+
/**
|
|
1458
|
+
* @since 1.0.0
|
|
1459
|
+
* @category Parameters
|
|
1460
|
+
*/
|
|
1461
|
+
export const ParamAnnotation = /*#__PURE__*/Symbol.for("@effect/ai/McpSchema/ParamNameId");
|
|
1462
|
+
/**
|
|
1463
|
+
* Helper to create a param for a resource URI template.
|
|
1464
|
+
*
|
|
1465
|
+
* @since 1.0.0
|
|
1466
|
+
* @category Parameters
|
|
1467
|
+
*/
|
|
1468
|
+
export const param = (id, schema) => schema.annotations({
|
|
1469
|
+
[ParamAnnotation]: id
|
|
1470
|
+
});
|
|
1471
|
+
//# sourceMappingURL=McpSchema.js.map
|