|
3 | 3 | module MCP |
4 | 4 | module Content |
5 | 5 | class Text |
6 | | - attr_reader :text, :annotations |
| 6 | + attr_reader :text, :annotations, :meta |
7 | 7 |
|
8 | | - def initialize(text, annotations: nil) |
| 8 | + def initialize(text, annotations: nil, meta: nil) |
9 | 9 | @text = text |
10 | 10 | @annotations = annotations |
| 11 | + @meta = meta |
11 | 12 | end |
12 | 13 |
|
13 | 14 | def to_h |
14 | | - { text: text, annotations: annotations, type: "text" }.compact |
| 15 | + { text: text, annotations: annotations, _meta: meta, type: "text" }.compact |
15 | 16 | end |
16 | 17 | end |
17 | 18 |
|
18 | 19 | class Image |
19 | | - attr_reader :data, :mime_type, :annotations |
| 20 | + attr_reader :data, :mime_type, :annotations, :meta |
20 | 21 |
|
21 | | - def initialize(data, mime_type, annotations: nil) |
| 22 | + def initialize(data, mime_type, annotations: nil, meta: nil) |
22 | 23 | @data = data |
23 | 24 | @mime_type = mime_type |
24 | 25 | @annotations = annotations |
| 26 | + @meta = meta |
25 | 27 | end |
26 | 28 |
|
27 | 29 | def to_h |
28 | | - { data: data, mimeType: mime_type, annotations: annotations, type: "image" }.compact |
| 30 | + { data: data, mimeType: mime_type, annotations: annotations, _meta: meta, type: "image" }.compact |
29 | 31 | end |
30 | 32 | end |
31 | 33 |
|
32 | 34 | class Audio |
33 | | - attr_reader :data, :mime_type, :annotations |
| 35 | + attr_reader :data, :mime_type, :annotations, :meta |
34 | 36 |
|
35 | | - def initialize(data, mime_type, annotations: nil) |
| 37 | + def initialize(data, mime_type, annotations: nil, meta: nil) |
36 | 38 | @data = data |
37 | 39 | @mime_type = mime_type |
38 | 40 | @annotations = annotations |
| 41 | + @meta = meta |
39 | 42 | end |
40 | 43 |
|
41 | 44 | def to_h |
42 | | - { data: data, mimeType: mime_type, annotations: annotations, type: "audio" }.compact |
| 45 | + { data: data, mimeType: mime_type, annotations: annotations, _meta: meta, type: "audio" }.compact |
43 | 46 | end |
44 | 47 | end |
45 | 48 |
|
46 | 49 | class EmbeddedResource |
47 | | - attr_reader :resource, :annotations |
| 50 | + attr_reader :resource, :annotations, :meta |
48 | 51 |
|
49 | | - def initialize(resource, annotations: nil) |
| 52 | + def initialize(resource, annotations: nil, meta: nil) |
50 | 53 | @resource = resource |
51 | 54 | @annotations = annotations |
| 55 | + @meta = meta |
52 | 56 | end |
53 | 57 |
|
54 | 58 | def to_h |
55 | | - { resource: resource.to_h, annotations: annotations, type: "resource" }.compact |
| 59 | + { resource: resource.to_h, annotations: annotations, _meta: meta, type: "resource" }.compact |
56 | 60 | end |
57 | 61 | end |
58 | 62 | end |
|
0 commit comments