Skip to content

Commit 734d392

Browse files
renovate[bot]yifancong
authored andcommitted
chore(deps): change package/ai from cjs to esm & update dependency @rslib/core to ^0.6.9
chore: change package/ai from cjs to esm feat: change package/ai from cjs to esm release: @rsdoctor/mcp-server 0.0.1-beta.4 release: @rsdoctor/mcp-server 0.0.1-next.1 chore: add some logs for e2e fix: the test log fix: change the version chore: update the pnpm lock fix: the resource path chore: update dependency chore: update dependency chore: update dependency chore: update dependency
1 parent 87fca39 commit 734d392

File tree

11 files changed

+262
-632
lines changed

11 files changed

+262
-632
lines changed

packages/ai/bin/rsdoctor-mcp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
const { runServer } = require('../dist/server/server.js');
3+
import { runServer } from '../dist/index.cjs';
44

55

66
runServer().catch((error) => {

packages/ai/package.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,21 @@
1616
"bin": {
1717
"rsdoctor-mcp": "./bin/rsdoctor-mcp"
1818
},
19+
"type": "module",
1920
"scripts": {
2021
"build": "rslib build",
2122
"dev": "rslib build --watch",
2223
"test": "vitest run",
2324
"client": "npm run build && node dist/mcp/index.js"
2425
},
2526
"devDependencies": {
26-
"@coze/api": "^1.2.0",
27-
"@rsdoctor/types": "workspace:*",
28-
"@rslib/core": "^0.2.2",
27+
"@modelcontextprotocol/sdk": "1.4.1",
28+
"@rslib/core": "^0.6.9",
2929
"@types/node": "^22.8.1",
30-
"dotenv": "^16.4.7",
31-
"langchain": "^0.3.26",
32-
"openai": "^4.77.0",
3330
"typescript": "^5.2.2",
34-
"vitest": "3.0.9"
35-
},
36-
"dependencies": {
37-
"@modelcontextprotocol/sdk": "1.4.1",
31+
"vitest": "3.0.9",
3832
"@rsdoctor/utils": "workspace:*",
33+
"@rsdoctor/types": "workspace:*",
3934
"axios": "^1.9.0",
4035
"socket.io-client": "4.6.1",
4136
"zod": "^3.24.4"
File renamed without changes.
File renamed without changes.

packages/ai/rslib.config.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ export default defineConfig({
55
{
66
source: {
77
entry: {
8-
index: './src',
8+
index: './src/server/server.ts',
99
},
10+
tsconfigPath: './tsconfig.build.json',
1011
},
1112
output: {
1213
distPath: {
1314
root: './dist/',
1415
},
1516
},
16-
bundle: false,
17+
bundle: true,
1718
dts: true,
1819
format: 'cjs',
1920
syntax: 'es2021',
@@ -25,7 +26,7 @@ export default defineConfig({
2526
'utf-8-validate': 'utf-8-validate',
2627
},
2728
copy: {
28-
patterns: [{ from: 'src/resources', to: 'resources' }],
29+
patterns: [{ from: 'resources', to: 'resources' }],
2930
},
3031
},
3132
});

packages/ai/src/server/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { runServer } from './server.ts';
1+
import { runServer } from './server.js';
22

33
runServer().catch((error) => {
44
console.error('Fatal error running server:', error);

packages/ai/src/server/resource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const readMarkdownResource: ReadResourceCallback = async (
1515
) => {
1616
// Read the contents of the Markdown file
1717
const contents = await readFileAsync(
18-
path.join(__dirname, '../resources', uri.pathname),
18+
path.join(__dirname, './resources', uri.pathname),
1919
'utf-8',
2020
);
2121

@@ -38,7 +38,7 @@ const readMarkdownResource: ReadResourceCallback = async (
3838
* @param {Object} resourcesData - The resources data object containing static resources
3939
*/
4040
function registerStaticResources(server: McpServer) {
41-
const resourcesDir = path.join(__dirname, '../resources/');
41+
const resourcesDir = path.join(__dirname, './resources/');
4242
fs.readdirSync(resourcesDir).forEach((file) => {
4343
if (file.endsWith('.md')) {
4444
const uri = `file://rsdoctor/${file}`;

packages/ai/src/utils/chunks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {
33
FilteredModule,
44
SimpleChunk,
55
SimpleModule,
6-
} from '@/types/index';
6+
} from '@/types/index.js';
77

88
export const getMedianChunkSize = (list: Chunk[]): number => {
99
const sortedList = list.sort((a, b) => a.size - b.size);
@@ -69,7 +69,7 @@ export const getSimpleChunk = (
6969
name: chunk.name,
7070
size: chunk.size,
7171
modules: chunk.modules
72-
.map((mId) => {
72+
.map((mId: number) => {
7373
const m = modules.find((m) => m.id === mId);
7474
if (!m) {
7575
return null;

packages/ai/src/utils/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './chunks';
1+
export * from './chunks.js';

packages/ai/tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"forceConsistentCasingInFileNames": true,
1010
"resolveJsonModule": true,
1111
"outDir": "./dist",
12-
"rootDir": ".",
12+
"rootDir": "./src",
1313
"paths": {
1414
"@/*": ["./src/*"]
1515
}
1616
},
1717
"include": ["src/**/*.ts"],
18-
"exclude": ["node_modules"]
18+
"exclude": ["node_modules", "dist", "src/resources/**/*"]
1919
}

0 commit comments

Comments
 (0)