Skip to content

Commit 653a90c

Browse files
committed
feat(resources): generate meta resources
* docs.json, remove dup section, expand unit test * mcpSdk, relocate helpers to server.helpers * resources, clean up descriptions, activate meta resources for indexes * server.helpers, centralize listAllCombos, listIncrementalCombos, splitUri * server.resourceMeta, meta resources generator * server, expand mcp resource typings, allow generated meta resources * e2e, cover meta resources
1 parent 365e318 commit 653a90c

20 files changed

+1506
-87
lines changed
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2+
3+
exports[`generateMarkdownTable should generate a markdown table, simple table 1`] = `
4+
"| Col1 | Col2 |
5+
| :--- | :--- |
6+
| Val1 | Val2 |
7+
| Val3 | Val4 |"
8+
`;
9+
10+
exports[`generateMarkdownTable should generate a markdown table, with wrapped contents 1`] = `
11+
"| Param | Values |
12+
| :--- | :--- |
13+
| \`p1\` | \`v1\`, \`v2\` |"
14+
`;
15+
16+
exports[`generateMetaContent should generate standardized meta content: meta-content 1`] = `
17+
"# Test Title
18+
Test Description
19+
20+
## Available Parameters
21+
22+
| Parameter | Valid Values | Description |
23+
| :--- | :--- | :--- |
24+
| \`category\` | \`c1\`, \`c2\` | Filter by category |
25+
26+
## Available Patterns
27+
- **Base**: \`test://uri\`"
28+
`;
29+
30+
exports[`getUriVariations should get URI variations, allCombos=false 1`] = `
31+
[
32+
"test://uri",
33+
"test://uri?v1=...",
34+
"test://uri?v1=...&v2=...",
35+
]
36+
`;
37+
38+
exports[`getUriVariations should get URI variations, allCombos=true 1`] = `
39+
[
40+
"test://uri",
41+
"test://uri?v1=...",
42+
]
43+
`;
44+
45+
exports[`setMetaResources should attempt to return a resource, metaConfig is a template 1`] = `
46+
[
47+
"test-resource-meta",
48+
ResourceTemplate {
49+
"_callbacks": {
50+
"complete": {
51+
"version": [MockFunction],
52+
},
53+
"list": undefined,
54+
},
55+
"_uriTemplate": UriTemplate {
56+
"parts": [
57+
"test://uri/meta",
58+
{
59+
"exploded": false,
60+
"name": "version",
61+
"names": [
62+
"version",
63+
],
64+
"operator": "?",
65+
},
66+
],
67+
"template": "test://uri/meta{?version}",
68+
},
69+
},
70+
{
71+
"description": "Discovery manual for Test.",
72+
"mimeType": "text/markdown",
73+
"title": "Test Metadata",
74+
},
75+
[Function],
76+
]
77+
`;
78+
79+
exports[`setMetaResources should attempt to return a resource, metaConfig is a template string with complete 1`] = `
80+
[
81+
"test-resource-meta",
82+
ResourceTemplate {
83+
"_callbacks": {
84+
"complete": {
85+
"version": [MockFunction],
86+
},
87+
"list": undefined,
88+
},
89+
"_uriTemplate": UriTemplate {
90+
"parts": [
91+
"test://uri/meta",
92+
{
93+
"exploded": false,
94+
"name": "version",
95+
"names": [
96+
"version",
97+
],
98+
"operator": "?",
99+
},
100+
],
101+
"template": "test://uri/meta{?version}",
102+
},
103+
},
104+
{
105+
"description": "Discovery manual for Test.",
106+
"mimeType": "text/markdown",
107+
"title": "Test Metadata",
108+
},
109+
[Function],
110+
]
111+
`;
112+
113+
exports[`setMetaResources should attempt to return a resource, metaConfig is a template string with complete undefined 1`] = `
114+
[
115+
"test-resource-meta",
116+
ResourceTemplate {
117+
"_callbacks": {
118+
"list": undefined,
119+
},
120+
"_uriTemplate": UriTemplate {
121+
"parts": [
122+
"test://uri/meta",
123+
{
124+
"exploded": false,
125+
"name": "version",
126+
"names": [
127+
"version",
128+
],
129+
"operator": "?",
130+
},
131+
],
132+
"template": "test://uri/meta{?version}",
133+
},
134+
},
135+
{
136+
"description": "Discovery manual for Test.",
137+
"mimeType": "text/markdown",
138+
"title": "Test Metadata",
139+
},
140+
[Function],
141+
]
142+
`;
143+
144+
exports[`setMetaResources should attempt to return a resource, metaConfig is almost a template 1`] = `
145+
[
146+
"test-resource-meta",
147+
"test://lorem-ipsum/meta",
148+
{
149+
"description": "Discovery manual for Test.",
150+
"mimeType": "text/markdown",
151+
"title": "Test Metadata",
152+
},
153+
[Function],
154+
]
155+
`;
156+
157+
exports[`setMetaResources should attempt to return a resource, metaConfig is empty 1`] = `
158+
[
159+
"test-resource-meta",
160+
"test://uri/meta",
161+
{
162+
"description": "Discovery manual for Test.",
163+
"mimeType": "text/markdown",
164+
"title": "Test Metadata",
165+
},
166+
[Function],
167+
]
168+
`;
169+
170+
exports[`setMetaResources should attempt to return a resource, metaConfig is undefined 1`] = `
171+
[
172+
"test-resource",
173+
"test://uri",
174+
{
175+
"description": "Test",
176+
"title": "Test",
177+
},
178+
[MockFunction],
179+
{
180+
"complete": undefined,
181+
"metaConfig": undefined,
182+
},
183+
]
184+
`;
185+
186+
exports[`setMetaResources should attempt to return a resource, metaConfig is unique 1`] = `
187+
[
188+
"test-resource-meta",
189+
"test://lorem-ipsum/meta",
190+
{
191+
"description": "Discovery manual for Test.",
192+
"mimeType": "text/markdown",
193+
"title": "Test Metadata",
194+
},
195+
[Function],
196+
]
197+
`;

0 commit comments

Comments
 (0)