Skip to content

Commit 8668ff5

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 8668ff5

20 files changed

+1209
-57
lines changed
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
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+
"list": undefined,
51+
},
52+
"_uriTemplate": UriTemplate {
53+
"parts": [
54+
"test://uri/meta",
55+
{
56+
"exploded": false,
57+
"name": "version",
58+
"names": [
59+
"version",
60+
],
61+
"operator": "?",
62+
},
63+
],
64+
"template": "test://uri/meta{?version}",
65+
},
66+
},
67+
{
68+
"description": "Discovery manual for Test.",
69+
"mimeType": "text/markdown",
70+
"title": "Test Metadata",
71+
},
72+
[Function],
73+
]
74+
`;
75+
76+
exports[`setMetaResources should attempt to return a resource, metaConfig is a template string 1`] = `
77+
[
78+
"test-resource-meta",
79+
ResourceTemplate {
80+
"_callbacks": {
81+
"list": undefined,
82+
},
83+
"_uriTemplate": UriTemplate {
84+
"parts": [
85+
"test://uri/meta",
86+
{
87+
"exploded": false,
88+
"name": "version",
89+
"names": [
90+
"version",
91+
],
92+
"operator": "?",
93+
},
94+
],
95+
"template": "test://uri/meta{?version}",
96+
},
97+
},
98+
{
99+
"description": "Discovery manual for Test.",
100+
"mimeType": "text/markdown",
101+
"title": "Test Metadata",
102+
},
103+
[Function],
104+
]
105+
`;
106+
107+
exports[`setMetaResources should attempt to return a resource, metaConfig is almost a template 1`] = `
108+
[
109+
"test-resource-meta",
110+
ResourceTemplate {
111+
"_callbacks": {
112+
"list": undefined,
113+
},
114+
"_uriTemplate": UriTemplate {
115+
"parts": [
116+
"test://lorem-ipsum/meta",
117+
],
118+
"template": "test://lorem-ipsum/meta",
119+
},
120+
},
121+
{
122+
"description": "Discovery manual for Test.",
123+
"mimeType": "text/markdown",
124+
"title": "Test Metadata",
125+
},
126+
[Function],
127+
]
128+
`;
129+
130+
exports[`setMetaResources should attempt to return a resource, metaConfig is empty 1`] = `
131+
[
132+
"test-resource-meta",
133+
"test://uri/meta",
134+
{
135+
"description": "Discovery manual for Test.",
136+
"mimeType": "text/markdown",
137+
"title": "Test Metadata",
138+
},
139+
[Function],
140+
]
141+
`;
142+
143+
exports[`setMetaResources should attempt to return a resource, metaConfig is undefined 1`] = `
144+
[
145+
"test-resource",
146+
"test://uri",
147+
{
148+
"description": "Test",
149+
"title": "Test",
150+
},
151+
[MockFunction],
152+
{
153+
"metaConfig": undefined,
154+
},
155+
]
156+
`;
157+
158+
exports[`setMetaResources should attempt to return a resource, metaConfig is unique 1`] = `
159+
[
160+
"test-resource-meta",
161+
"test://lorem-ipsum/meta",
162+
{
163+
"description": "Discovery manual for Test.",
164+
"mimeType": "text/markdown",
165+
"title": "Test Metadata",
166+
},
167+
[Function],
168+
]
169+
`;

0 commit comments

Comments
 (0)