Skip to content

Commit 67fe21f

Browse files
committed
Merge branch 'main' into justin/new-http-transport
2 parents fe418dd + eb4abdf commit 67fe21f

File tree

2 files changed

+86
-142
lines changed

2 files changed

+86
-142
lines changed

schema/draft/schema.json

Lines changed: 25 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"definitions": {
4-
"Annotated": {
5-
"description": "Base for objects that include optional annotations for the client. The client can use annotations to inform how objects are used or displayed",
4+
"Annotations": {
5+
"description": "Optional annotations for the client. The client can use annotations to inform how objects are used or displayed",
66
"properties": {
7-
"annotations": {
8-
"properties": {
9-
"audience": {
10-
"description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., `[\"user\", \"assistant\"]`).",
11-
"items": {
12-
"$ref": "#/definitions/Role"
13-
},
14-
"type": "array"
15-
},
16-
"priority": {
17-
"description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
18-
"maximum": 1,
19-
"minimum": 0,
20-
"type": "number"
21-
}
7+
"audience": {
8+
"description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., `[\"user\", \"assistant\"]`).",
9+
"items": {
10+
"$ref": "#/definitions/Role"
2211
},
23-
"type": "object"
12+
"type": "array"
13+
},
14+
"priority": {
15+
"description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
16+
"maximum": 1,
17+
"minimum": 0,
18+
"type": "number"
2419
}
2520
},
2621
"type": "object"
@@ -29,22 +24,8 @@
2924
"description": "Audio provided to or from an LLM.",
3025
"properties": {
3126
"annotations": {
32-
"properties": {
33-
"audience": {
34-
"description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., `[\"user\", \"assistant\"]`).",
35-
"items": {
36-
"$ref": "#/definitions/Role"
37-
},
38-
"type": "array"
39-
},
40-
"priority": {
41-
"description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
42-
"maximum": 1,
43-
"minimum": 0,
44-
"type": "number"
45-
}
46-
},
47-
"type": "object"
27+
"$ref": "#/definitions/Annotations",
28+
"description": "Optional annotations for the client."
4829
},
4930
"data": {
5031
"description": "The base64-encoded audio data.",
@@ -487,22 +468,8 @@
487468
"description": "The contents of a resource, embedded into a prompt or tool call result.\n\nIt is up to the client how best to render embedded resources for the benefit\nof the LLM and/or the user.",
488469
"properties": {
489470
"annotations": {
490-
"properties": {
491-
"audience": {
492-
"description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., `[\"user\", \"assistant\"]`).",
493-
"items": {
494-
"$ref": "#/definitions/Role"
495-
},
496-
"type": "array"
497-
},
498-
"priority": {
499-
"description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
500-
"maximum": 1,
501-
"minimum": 0,
502-
"type": "number"
503-
}
504-
},
505-
"type": "object"
471+
"$ref": "#/definitions/Annotations",
472+
"description": "Optional annotations for the client."
506473
},
507474
"resource": {
508475
"anyOf": [
@@ -589,22 +556,8 @@
589556
"description": "An image provided to or from an LLM.",
590557
"properties": {
591558
"annotations": {
592-
"properties": {
593-
"audience": {
594-
"description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., `[\"user\", \"assistant\"]`).",
595-
"items": {
596-
"$ref": "#/definitions/Role"
597-
},
598-
"type": "array"
599-
},
600-
"priority": {
601-
"description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
602-
"maximum": 1,
603-
"minimum": 0,
604-
"type": "number"
605-
}
606-
},
607-
"type": "object"
559+
"$ref": "#/definitions/Annotations",
560+
"description": "Optional annotations for the client."
608561
},
609562
"data": {
610563
"description": "The base64-encoded image data.",
@@ -1533,22 +1486,8 @@
15331486
"description": "A known resource that the server is capable of reading.",
15341487
"properties": {
15351488
"annotations": {
1536-
"properties": {
1537-
"audience": {
1538-
"description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., `[\"user\", \"assistant\"]`).",
1539-
"items": {
1540-
"$ref": "#/definitions/Role"
1541-
},
1542-
"type": "array"
1543-
},
1544-
"priority": {
1545-
"description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
1546-
"maximum": 1,
1547-
"minimum": 0,
1548-
"type": "number"
1549-
}
1550-
},
1551-
"type": "object"
1489+
"$ref": "#/definitions/Annotations",
1490+
"description": "Optional annotations for the client."
15521491
},
15531492
"description": {
15541493
"description": "A description of what this resource represents.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.",
@@ -1639,22 +1578,8 @@
16391578
"description": "A template description for resources available on the server.",
16401579
"properties": {
16411580
"annotations": {
1642-
"properties": {
1643-
"audience": {
1644-
"description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., `[\"user\", \"assistant\"]`).",
1645-
"items": {
1646-
"$ref": "#/definitions/Role"
1647-
},
1648-
"type": "array"
1649-
},
1650-
"priority": {
1651-
"description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
1652-
"maximum": 1,
1653-
"minimum": 0,
1654-
"type": "number"
1655-
}
1656-
},
1657-
"type": "object"
1581+
"$ref": "#/definitions/Annotations",
1582+
"description": "Optional annotations for the client."
16581583
},
16591584
"description": {
16601585
"description": "A description of what this template is for.\n\nThis can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a \"hint\" to the model.",
@@ -1975,22 +1900,8 @@
19751900
"description": "Text provided to or from an LLM.",
19761901
"properties": {
19771902
"annotations": {
1978-
"properties": {
1979-
"audience": {
1980-
"description": "Describes who the intended customer of this object or data is.\n\nIt can include multiple entries to indicate content useful for multiple audiences (e.g., `[\"user\", \"assistant\"]`).",
1981-
"items": {
1982-
"$ref": "#/definitions/Role"
1983-
},
1984-
"type": "array"
1985-
},
1986-
"priority": {
1987-
"description": "Describes how important this data is for operating the server.\n\nA value of 1 means \"most important,\" and indicates that the data is\neffectively required, while 0 means \"least important,\" and indicates that\nthe data is entirely optional.",
1988-
"maximum": 1,
1989-
"minimum": 0,
1990-
"type": "number"
1991-
}
1992-
},
1993-
"type": "object"
1903+
"$ref": "#/definitions/Annotations",
1904+
"description": "Optional annotations for the client."
19941905
},
19951906
"text": {
19961907
"description": "The text content of the message.",

schema/draft/schema.ts

Lines changed: 61 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export interface ResourceUpdatedNotification extends Notification {
432432
/**
433433
* A known resource that the server is capable of reading.
434434
*/
435-
export interface Resource extends Annotated {
435+
export interface Resource {
436436
/**
437437
* The URI of this resource.
438438
*
@@ -458,12 +458,17 @@ export interface Resource extends Annotated {
458458
* The MIME type of this resource, if known.
459459
*/
460460
mimeType?: string;
461+
462+
/**
463+
* Optional annotations for the client.
464+
*/
465+
annotations?: Annotations;
461466
}
462467

463468
/**
464469
* A template description for resources available on the server.
465470
*/
466-
export interface ResourceTemplate extends Annotated {
471+
export interface ResourceTemplate {
467472
/**
468473
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
469474
*
@@ -489,6 +494,11 @@ export interface ResourceTemplate extends Annotated {
489494
* The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
490495
*/
491496
mimeType?: string;
497+
498+
/**
499+
* Optional annotations for the client.
500+
*/
501+
annotations?: Annotations;
492502
}
493503

494504
/**
@@ -624,9 +634,14 @@ export interface PromptMessage {
624634
* It is up to the client how best to render embedded resources for the benefit
625635
* of the LLM and/or the user.
626636
*/
627-
export interface EmbeddedResource extends Annotated {
637+
export interface EmbeddedResource {
628638
type: "resource";
629639
resource: TextResourceContents | BlobResourceContents;
640+
641+
/**
642+
* Optional annotations for the client.
643+
*/
644+
annotations?: Annotations;
630645
}
631646

632647
/**
@@ -824,76 +839,94 @@ export interface SamplingMessage {
824839
}
825840

826841
/**
827-
* Base for objects that include optional annotations for the client. The client can use annotations to inform how objects are used or displayed
842+
* Optional annotations for the client. The client can use annotations to inform how objects are used or displayed
828843
*/
829-
export interface Annotated {
830-
annotations?: {
831-
/**
832-
* Describes who the intended customer of this object or data is.
833-
*
834-
* It can include multiple entries to indicate content useful for multiple audiences (e.g., `["user", "assistant"]`).
835-
*/
836-
audience?: Role[];
844+
export interface Annotations {
845+
/**
846+
* Describes who the intended customer of this object or data is.
847+
*
848+
* It can include multiple entries to indicate content useful for multiple audiences (e.g., `["user", "assistant"]`).
849+
*/
850+
audience?: Role[];
837851

838-
/**
839-
* Describes how important this data is for operating the server.
840-
*
841-
* A value of 1 means "most important," and indicates that the data is
842-
* effectively required, while 0 means "least important," and indicates that
843-
* the data is entirely optional.
844-
*
845-
* @TJS-type number
846-
* @minimum 0
847-
* @maximum 1
848-
*/
849-
priority?: number;
850-
}
852+
/**
853+
* Describes how important this data is for operating the server.
854+
*
855+
* A value of 1 means "most important," and indicates that the data is
856+
* effectively required, while 0 means "least important," and indicates that
857+
* the data is entirely optional.
858+
*
859+
* @TJS-type number
860+
* @minimum 0
861+
* @maximum 1
862+
*/
863+
priority?: number;
851864
}
852865

853866
/**
854867
* Text provided to or from an LLM.
855868
*/
856-
export interface TextContent extends Annotated {
869+
export interface TextContent {
857870
type: "text";
871+
858872
/**
859873
* The text content of the message.
860874
*/
861875
text: string;
876+
877+
/**
878+
* Optional annotations for the client.
879+
*/
880+
annotations?: Annotations;
862881
}
863882

864883
/**
865884
* An image provided to or from an LLM.
866885
*/
867-
export interface ImageContent extends Annotated {
886+
export interface ImageContent {
868887
type: "image";
888+
869889
/**
870890
* The base64-encoded image data.
871891
*
872892
* @format byte
873893
*/
874894
data: string;
895+
875896
/**
876897
* The MIME type of the image. Different providers may support different image types.
877898
*/
878899
mimeType: string;
900+
901+
/**
902+
* Optional annotations for the client.
903+
*/
904+
annotations?: Annotations;
879905
}
880906

881907

882908
/**
883909
* Audio provided to or from an LLM.
884910
*/
885-
export interface AudioContent extends Annotated {
911+
export interface AudioContent {
886912
type: "audio";
913+
887914
/**
888915
* The base64-encoded audio data.
889916
*
890917
* @format byte
891918
*/
892919
data: string;
920+
893921
/**
894922
* The MIME type of the audio. Different providers may support different audio types.
895923
*/
896924
mimeType: string;
925+
926+
/**
927+
* Optional annotations for the client.
928+
*/
929+
annotations?: Annotations;
897930
}
898931

899932

0 commit comments

Comments
 (0)