Skip to content

Commit d80b648

Browse files
committed
feat(tools-user): user facing tools-as-plugins
1 parent 97f855a commit d80b648

File tree

10 files changed

+2050
-8
lines changed

10 files changed

+2050
-8
lines changed

jest.config.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,30 @@ export default {
2525
roots: ['src'],
2626
testMatch: ['<rootDir>/src/**/*.test.ts'],
2727
setupFilesAfterEnv: ['<rootDir>/jest.setupTests.ts'],
28-
...baseConfig
28+
...baseConfig,
29+
transform: {
30+
'^.+\\.(ts|tsx)$': [
31+
'ts-jest',
32+
{
33+
...tsConfig,
34+
diagnostics: {
35+
ignoreCodes: [1343]
36+
},
37+
astTransformers: {
38+
before: [
39+
{
40+
path: 'ts-jest-mock-import-meta',
41+
options: {
42+
metaObjectReplacement: {
43+
url: 'file:///mock/import-meta-url'
44+
}
45+
}
46+
}
47+
]
48+
}
49+
}
50+
]
51+
}
2952
},
3053
{
3154
displayName: 'e2e',

package-lock.json

Lines changed: 15 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
"description": "PatternFly documentation MCP server built with Node.js and TypeScript",
55
"main": "dist/index.js",
66
"type": "module",
7+
"imports": {
8+
"#toolsHost": "./dist/server.toolsHost.js"
9+
},
710
"exports": {
8-
".": "./dist/index.js"
11+
".": {
12+
"types": "./dist/index.d.ts",
13+
"default": "./dist/index.js"
14+
}
915
},
1016
"bin": {
1117
"patternfly-mcp": "dist/cli.js",
@@ -47,7 +53,7 @@
4753
"author": "Red Hat",
4854
"license": "MIT",
4955
"dependencies": {
50-
"@modelcontextprotocol/sdk": "1.24.2",
56+
"@modelcontextprotocol/sdk": "1.24.3",
5157
"@patternfly/patternfly-component-schemas": "1.2.0",
5258
"fastest-levenshtein": "1.0.16",
5359
"pid-port": "2.0.0",
@@ -64,6 +70,7 @@
6470
"jest": "^30.2.0",
6571
"pkgroll": "^2.20.1",
6672
"ts-jest": "29.4.4",
73+
"ts-jest-mock-import-meta": "^1.3.1",
6774
"ts-node": "^10.1.0",
6875
"tsx": "^4.21.0",
6976
"typescript": "^5.9.3",

src/__tests__/__snapshots__/options.defaults.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ exports[`options defaults should return specific properties: defaults 1`] = `
3737
"invokeTimeoutMs": 10000,
3838
"loadTimeoutMs": 5000,
3939
},
40+
"pluginIsolation": "none",
4041
"repoName": "patternfly-mcp",
4142
"resourceMemoOptions": {
4243
"default": {
@@ -70,6 +71,7 @@ exports[`options defaults should return specific properties: defaults 1`] = `
7071
"expire": 60000,
7172
},
7273
},
74+
"toolModules": [],
7375
"urlRegex": /\\^\\(https\\?:\\)\\\\/\\\\//i,
7476
"version": "0.0.0",
7577
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2+
3+
exports[`composeTools should handle IPC errors gracefully: warn 1`] = `
4+
[
5+
[
6+
"Failed to resolve file path: ./test-module.js TypeError: {(intermediate value)}.resolve is not a function",
7+
],
8+
]
9+
`;
10+
11+
exports[`composeTools should handle spawn errors gracefully: warn 1`] = `
12+
[
13+
[
14+
"Failed to resolve file path: ./test-module.js TypeError: {(intermediate value)}.resolve is not a function",
15+
],
16+
]
17+
`;
18+
19+
exports[`composeTools should log warnings and errors from load: warn 1`] = `
20+
[
21+
[
22+
"Failed to resolve file path: ./test-module.js TypeError: {(intermediate value)}.resolve is not a function",
23+
],
24+
]
25+
`;

0 commit comments

Comments
 (0)