@reus-able/frontend-helper-mcp 1.0.12 → 1.0.13
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.
- package/dist/index.js +9 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { McpServer as R } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
3
3
|
import { StdioServerTransport as v } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
4
|
import i from "fs/promises";
|
|
5
5
|
import a from "path";
|
|
6
|
-
import { fileURLToPath as
|
|
6
|
+
import { fileURLToPath as l } from "url";
|
|
7
7
|
import { ListPromptsRequestSchema as h, GetPromptRequestSchema as P, ListResourcesRequestSchema as S, ReadResourceRequestSchema as g, ListToolsRequestSchema as F, CallToolRequestSchema as M } from "@modelcontextprotocol/sdk/types.js";
|
|
8
8
|
import q from "fs";
|
|
9
9
|
function x(r) {
|
|
@@ -23,10 +23,10 @@ function p(r, e, o = 8) {
|
|
|
23
23
|
t = c;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function d() {
|
|
27
27
|
const r = process.env.MCP_COMMAND_PROMPTS_DIR ?? process.env.MCP_PROMPTS_DIR;
|
|
28
28
|
if (r) return r;
|
|
29
|
-
const e = a.dirname(
|
|
29
|
+
const e = a.dirname(l(import.meta.url)), o = p(
|
|
30
30
|
e,
|
|
31
31
|
"resources/command-prompts"
|
|
32
32
|
);
|
|
@@ -54,21 +54,21 @@ function u(r) {
|
|
|
54
54
|
return e === ".md" ? "text/markdown" : e === ".json" ? "application/json" : "text/plain";
|
|
55
55
|
}
|
|
56
56
|
const w = {
|
|
57
|
-
"code-refactor
|
|
57
|
+
"code-refactor": {
|
|
58
58
|
name: "代码重构",
|
|
59
59
|
description: "对代码进行结构调整,不改变功能逻辑"
|
|
60
60
|
},
|
|
61
|
-
"git-commit
|
|
61
|
+
"git-commit": {
|
|
62
62
|
name: "Git提交",
|
|
63
63
|
description: "符合约定式提交格式的Git提交"
|
|
64
64
|
},
|
|
65
|
-
"component-refactor
|
|
65
|
+
"component-refactor": {
|
|
66
66
|
name: "组件重构",
|
|
67
67
|
description: "对组件进行结构调整,不改变功能逻辑"
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
function C(r) {
|
|
71
|
-
const e =
|
|
71
|
+
const e = d();
|
|
72
72
|
r.server.setRequestHandler(h, async () => {
|
|
73
73
|
try {
|
|
74
74
|
return { prompts: (await m(e)).map((n) => {
|
|
@@ -104,7 +104,7 @@ function C(r) {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
function T(r) {
|
|
107
|
-
const e =
|
|
107
|
+
const e = d();
|
|
108
108
|
r.server.setRequestHandler(S, async () => {
|
|
109
109
|
try {
|
|
110
110
|
return { resources: (await m(e)).map((n) => {
|
|
@@ -155,7 +155,7 @@ function $(r) {
|
|
|
155
155
|
}));
|
|
156
156
|
}
|
|
157
157
|
async function D() {
|
|
158
|
-
const r = a.dirname(
|
|
158
|
+
const r = a.dirname(l(import.meta.url)), e = a.resolve(r, "../package.json"), o = JSON.parse(await i.readFile(e, "utf-8")), t = new R(
|
|
159
159
|
{
|
|
160
160
|
name: o.name,
|
|
161
161
|
version: o.version
|