@iflow-mcp/andrewhopper-facts-server 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/build/cli.js +43 -0
  2. package/package.json +1 -1
  3. package/src/cli.js +43 -0
package/build/cli.js ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from 'child_process';
3
+
4
+ // 自动生成 Prisma Client
5
+ const prismaGenerate = () => {
6
+ return new Promise((resolve) => {
7
+ const npxPrisma = spawn('npx', ['prisma', 'generate'], {
8
+ stdio: ['ignore', 'pipe', 'pipe'],
9
+ shell: true
10
+ });
11
+
12
+ let output = '';
13
+ npxPrisma.stdout.on('data', (data) => {
14
+ output += data.toString();
15
+ });
16
+
17
+ npxPrisma.stderr.on('data', (data) => {
18
+ output += data.toString();
19
+ });
20
+
21
+ npxPrisma.on('close', (code) => {
22
+ if (code === 0) {
23
+ resolve();
24
+ } else {
25
+ console.warn('Warning: Prisma generate failed (this is ok if client already exists)');
26
+ resolve();
27
+ }
28
+ });
29
+
30
+ // 30秒超时
31
+ setTimeout(() => {
32
+ npxPrisma.kill();
33
+ console.warn('Warning: Prisma generate timeout (this is ok if client already exists)');
34
+ resolve();
35
+ }, 30000);
36
+ });
37
+ };
38
+
39
+ // 等待 Prisma Client 生成
40
+ await prismaGenerate();
41
+
42
+ // 动态导入实际的MCP服务器
43
+ const { default: server } = await import('./index.js');
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@iflow-mcp/andrewhopper-facts-server", "version": "1.0.2", "description": "MCP server for managing documentation facts and acceptance criteria", "type": "module", "main": "build/index.js", "bin": {"iflow-mcp-andrewhopper-facts-server": "build/index.js"}, "scripts": {"build": "prisma generate && tsc && chmod +x build/index.js", "postinstall": "prisma generate", "dev": "node --inspect -r ts-node/register --loader ts-node/esm src/index.ts", "start": "node build/index.js"}, "keywords": ["mcp", "documentation", "validation"], "author": "Andrew Hopper (andrewhopper.com)", "license": "MIT", "dependencies": {"@modelcontextprotocol/sdk": "^1.5.0", "@prisma/client": "^6.4.1", "sqlite-vec": "^0.1.7-alpha.2", "sqlite3": "^5.1.7"}, "devDependencies": {"prisma": "^6.4.1", "ts-node": "^10.9.2", "typescript": "^5.3.3"}}
1
+ {"name": "@iflow-mcp/andrewhopper-facts-server", "version": "1.0.3", "description": "MCP server for managing documentation facts and acceptance criteria", "type": "module", "main": "build/cli.js", "bin": {"iflow-mcp-andrewhopper-facts-server": "build/cli.js"}, "scripts": {"build": "cp src/cli.js build/cli.js && chmod +x build/cli.js && tsc && chmod +x build/index.js", "dev": "node --inspect src/cli.js", "start": "node build/cli.js", "prisma:generate": "prisma generate"}, "keywords": ["mcp", "documentation", "validation"], "author": "Andrew Hopper (andrewhopper.com)", "license": "MIT", "dependencies": {"@modelcontextprotocol/sdk": "^1.5.0", "@prisma/client": "^6.4.1", "sqlite-vec": "^0.1.7-alpha.2", "sqlite3": "^5.1.7", "prisma": "^6.4.1"}, "devDependencies": {"ts-node": "^10.9.2", "typescript": "^5.3.3"}}
package/src/cli.js ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from 'child_process';
3
+
4
+ // 自动生成 Prisma Client
5
+ const prismaGenerate = () => {
6
+ return new Promise((resolve) => {
7
+ const npxPrisma = spawn('npx', ['prisma', 'generate'], {
8
+ stdio: ['ignore', 'pipe', 'pipe'],
9
+ shell: true
10
+ });
11
+
12
+ let output = '';
13
+ npxPrisma.stdout.on('data', (data) => {
14
+ output += data.toString();
15
+ });
16
+
17
+ npxPrisma.stderr.on('data', (data) => {
18
+ output += data.toString();
19
+ });
20
+
21
+ npxPrisma.on('close', (code) => {
22
+ if (code === 0) {
23
+ resolve();
24
+ } else {
25
+ console.warn('Warning: Prisma generate failed (this is ok if client already exists)');
26
+ resolve();
27
+ }
28
+ });
29
+
30
+ // 30秒超时
31
+ setTimeout(() => {
32
+ npxPrisma.kill();
33
+ console.warn('Warning: Prisma generate timeout (this is ok if client already exists)');
34
+ resolve();
35
+ }, 30000);
36
+ });
37
+ };
38
+
39
+ // 等待 Prisma Client 生成
40
+ await prismaGenerate();
41
+
42
+ // 动态导入实际的MCP服务器
43
+ const { default: server } = await import('./index.js');