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