@julong/mono-rele2-core 1.4.0 → 1.5.0
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/README.md +12 -0
- package/dist/cli.js +9 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +29 -10
- package/dist/server.js +22 -8
- package/dist/skills/mono-rele2-core/skill.md +14 -5
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -87,6 +87,18 @@ mono-rele2-core envTool HOME # /Users/julong
|
|
|
87
87
|
mono-rele2-core envTool NODE_ENV # development
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
#### `uuidTool`
|
|
91
|
+
|
|
92
|
+
Generates a random UUID v4.
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
mono-rele2-core uuidTool
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
mono-rele2-core uuidTool # 550e8400-e29b-41d4-a716-446655440000
|
|
100
|
+
```
|
|
101
|
+
|
|
90
102
|
<!-- SKILLS:END -->
|
|
91
103
|
|
|
92
104
|
## MCP Server
|
package/dist/cli.js
CHANGED
|
@@ -71,6 +71,7 @@ import { z as z2 } from "zod";
|
|
|
71
71
|
|
|
72
72
|
// src/tools/system.ts
|
|
73
73
|
import { z as z3 } from "zod";
|
|
74
|
+
import { randomUUID } from "crypto";
|
|
74
75
|
var tools = {
|
|
75
76
|
echoTool: toolDef({
|
|
76
77
|
name: "echo",
|
|
@@ -108,11 +109,19 @@ var tools = {
|
|
|
108
109
|
{ args: ["NODE_ENV"], result: "development" }
|
|
109
110
|
],
|
|
110
111
|
guidelines: ["`envTool` returns an empty string when the variable is not set"]
|
|
112
|
+
}),
|
|
113
|
+
uuidTool: toolDef({
|
|
114
|
+
name: "uuid",
|
|
115
|
+
description: "Generates a random UUID v4",
|
|
116
|
+
inputSchema: {},
|
|
117
|
+
handler: async () => text(randomUUID()),
|
|
118
|
+
examples: [{ args: [], result: "550e8400-e29b-41d4-a716-446655440000" }]
|
|
111
119
|
})
|
|
112
120
|
};
|
|
113
121
|
var echoTool = defineTool(tools.echoTool);
|
|
114
122
|
var timestampTool = defineTool(tools.timestampTool);
|
|
115
123
|
var envTool = defineTool(tools.envTool);
|
|
124
|
+
var uuidTool = defineTool(tools.uuidTool);
|
|
116
125
|
|
|
117
126
|
// src/cli.ts
|
|
118
127
|
runCli(tools).catch(handleCliError);
|
package/dist/index.d.ts
CHANGED
|
@@ -67,6 +67,14 @@ declare const tools: {
|
|
|
67
67
|
examples?: ToolExample[];
|
|
68
68
|
guidelines?: string[];
|
|
69
69
|
};
|
|
70
|
+
uuidTool: {
|
|
71
|
+
name: string;
|
|
72
|
+
description: string;
|
|
73
|
+
inputSchema: {};
|
|
74
|
+
handler: (input: Record<string, never>) => Promise<ToolResult>;
|
|
75
|
+
examples?: ToolExample[];
|
|
76
|
+
guidelines?: string[];
|
|
77
|
+
};
|
|
70
78
|
};
|
|
71
79
|
|
|
72
80
|
declare function createCoreServer(): _modelcontextprotocol_sdk_server_mcp_js.McpServer;
|
package/dist/index.js
CHANGED
|
@@ -13,16 +13,20 @@ function text(content) {
|
|
|
13
13
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
14
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
15
15
|
function createMcpServer(config, tools2) {
|
|
16
|
-
const
|
|
16
|
+
const server2 = new McpServer(config);
|
|
17
17
|
for (const tool of tools2) {
|
|
18
|
-
|
|
18
|
+
server2.registerTool(
|
|
19
19
|
tool.name,
|
|
20
20
|
{ description: tool.description, inputSchema: tool.inputSchema },
|
|
21
21
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
22
|
tool.handler
|
|
23
23
|
);
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return server2;
|
|
26
|
+
}
|
|
27
|
+
async function startServer(server2) {
|
|
28
|
+
const transport = new StdioServerTransport();
|
|
29
|
+
await server2.connect(transport);
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
// ../common/kit/cli.ts
|
|
@@ -97,7 +101,7 @@ function renderExamples(binName, tools2) {
|
|
|
97
101
|
if (!tool.examples) continue;
|
|
98
102
|
for (const ex of tool.examples) {
|
|
99
103
|
const cmd = [binName, key, ...ex.args].join(" ");
|
|
100
|
-
lines.push(`- \`${cmd}\`
|
|
104
|
+
lines.push(`- \`${cmd}\` => \`${ex.result}\``);
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
107
|
return lines.join("\n");
|
|
@@ -163,17 +167,18 @@ function renderReadmeSkill(binName, key, tool) {
|
|
|
163
167
|
${lines.join("\n")}
|
|
164
168
|
\`\`\``;
|
|
165
169
|
}
|
|
170
|
+
const tableBlock = rows ? `
|
|
171
|
+
|
|
172
|
+
| arg | type | description |
|
|
173
|
+
|-----|------|-------------|
|
|
174
|
+
${rows}` : "";
|
|
166
175
|
return `#### \`${key}\`
|
|
167
176
|
|
|
168
177
|
${tool.description}.
|
|
169
178
|
|
|
170
179
|
\`\`\`sh
|
|
171
180
|
${usage}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
| arg | type | description |
|
|
175
|
-
|-----|------|-------------|
|
|
176
|
-
${rows}${exampleBlock}`;
|
|
181
|
+
\`\`\`${tableBlock}${exampleBlock}`;
|
|
177
182
|
}
|
|
178
183
|
function describeReadmeType(schema) {
|
|
179
184
|
let inner = schema;
|
|
@@ -209,6 +214,7 @@ function describeReadmeDesc(schema) {
|
|
|
209
214
|
|
|
210
215
|
// src/tools/system.ts
|
|
211
216
|
import { z as z3 } from "zod";
|
|
217
|
+
import { randomUUID } from "crypto";
|
|
212
218
|
var tools = {
|
|
213
219
|
echoTool: toolDef({
|
|
214
220
|
name: "echo",
|
|
@@ -246,19 +252,32 @@ var tools = {
|
|
|
246
252
|
{ args: ["NODE_ENV"], result: "development" }
|
|
247
253
|
],
|
|
248
254
|
guidelines: ["`envTool` returns an empty string when the variable is not set"]
|
|
255
|
+
}),
|
|
256
|
+
uuidTool: toolDef({
|
|
257
|
+
name: "uuid",
|
|
258
|
+
description: "Generates a random UUID v4",
|
|
259
|
+
inputSchema: {},
|
|
260
|
+
handler: async () => text(randomUUID()),
|
|
261
|
+
examples: [{ args: [], result: "550e8400-e29b-41d4-a716-446655440000" }]
|
|
249
262
|
})
|
|
250
263
|
};
|
|
251
264
|
var echoTool = defineTool(tools.echoTool);
|
|
252
265
|
var timestampTool = defineTool(tools.timestampTool);
|
|
253
266
|
var envTool = defineTool(tools.envTool);
|
|
267
|
+
var uuidTool = defineTool(tools.uuidTool);
|
|
254
268
|
|
|
255
269
|
// src/index.ts
|
|
256
270
|
function createCoreServer() {
|
|
257
271
|
return createMcpServer(
|
|
258
272
|
{ name: "mono-rele2-core", version: "1.0.0" },
|
|
259
|
-
[echoTool, timestampTool, envTool]
|
|
273
|
+
[echoTool, timestampTool, envTool, uuidTool]
|
|
260
274
|
);
|
|
261
275
|
}
|
|
276
|
+
var server = createCoreServer();
|
|
277
|
+
startServer(server).catch((err) => {
|
|
278
|
+
console.error("[core] server error:", err);
|
|
279
|
+
process.exit(1);
|
|
280
|
+
});
|
|
262
281
|
export {
|
|
263
282
|
createCoreServer,
|
|
264
283
|
generateReadmeSkills,
|
package/dist/server.js
CHANGED
|
@@ -15,20 +15,20 @@ function text(content) {
|
|
|
15
15
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
16
16
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
17
17
|
function createMcpServer(config, tools2) {
|
|
18
|
-
const
|
|
18
|
+
const server3 = new McpServer(config);
|
|
19
19
|
for (const tool of tools2) {
|
|
20
|
-
|
|
20
|
+
server3.registerTool(
|
|
21
21
|
tool.name,
|
|
22
22
|
{ description: tool.description, inputSchema: tool.inputSchema },
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
24
|
tool.handler
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return server3;
|
|
28
28
|
}
|
|
29
|
-
async function startServer(
|
|
29
|
+
async function startServer(server3) {
|
|
30
30
|
const transport = new StdioServerTransport();
|
|
31
|
-
await
|
|
31
|
+
await server3.connect(transport);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
// ../common/kit/cli.ts
|
|
@@ -39,6 +39,7 @@ import { z as z2 } from "zod";
|
|
|
39
39
|
|
|
40
40
|
// src/tools/system.ts
|
|
41
41
|
import { z as z3 } from "zod";
|
|
42
|
+
import { randomUUID } from "crypto";
|
|
42
43
|
var tools = {
|
|
43
44
|
echoTool: toolDef({
|
|
44
45
|
name: "echo",
|
|
@@ -76,23 +77,36 @@ var tools = {
|
|
|
76
77
|
{ args: ["NODE_ENV"], result: "development" }
|
|
77
78
|
],
|
|
78
79
|
guidelines: ["`envTool` returns an empty string when the variable is not set"]
|
|
80
|
+
}),
|
|
81
|
+
uuidTool: toolDef({
|
|
82
|
+
name: "uuid",
|
|
83
|
+
description: "Generates a random UUID v4",
|
|
84
|
+
inputSchema: {},
|
|
85
|
+
handler: async () => text(randomUUID()),
|
|
86
|
+
examples: [{ args: [], result: "550e8400-e29b-41d4-a716-446655440000" }]
|
|
79
87
|
})
|
|
80
88
|
};
|
|
81
89
|
var echoTool = defineTool(tools.echoTool);
|
|
82
90
|
var timestampTool = defineTool(tools.timestampTool);
|
|
83
91
|
var envTool = defineTool(tools.envTool);
|
|
92
|
+
var uuidTool = defineTool(tools.uuidTool);
|
|
84
93
|
|
|
85
94
|
// src/index.ts
|
|
86
95
|
function createCoreServer() {
|
|
87
96
|
return createMcpServer(
|
|
88
97
|
{ name: "mono-rele2-core", version: "1.0.0" },
|
|
89
|
-
[echoTool, timestampTool, envTool]
|
|
98
|
+
[echoTool, timestampTool, envTool, uuidTool]
|
|
90
99
|
);
|
|
91
100
|
}
|
|
92
|
-
|
|
93
|
-
// src/server.ts
|
|
94
101
|
var server = createCoreServer();
|
|
95
102
|
startServer(server).catch((err) => {
|
|
96
103
|
console.error("[core] server error:", err);
|
|
97
104
|
process.exit(1);
|
|
98
105
|
});
|
|
106
|
+
|
|
107
|
+
// src/server.ts
|
|
108
|
+
var server2 = createCoreServer();
|
|
109
|
+
startServer(server2).catch((err) => {
|
|
110
|
+
console.error("[core] server error:", err);
|
|
111
|
+
process.exit(1);
|
|
112
|
+
});
|
|
@@ -35,13 +35,22 @@ Returns the value of an environment variable
|
|
|
35
35
|
|-----|-------------|
|
|
36
36
|
| `key` | Environment variable name |
|
|
37
37
|
|
|
38
|
+
### uuidTool
|
|
39
|
+
|
|
40
|
+
Generates a random UUID v4
|
|
41
|
+
|
|
42
|
+
| arg | description |
|
|
43
|
+
|-----|-------------|
|
|
44
|
+
|
|
45
|
+
|
|
38
46
|
## Examples
|
|
39
47
|
|
|
40
|
-
- `mono-rele2-core echoTool "hello world"`
|
|
41
|
-
- `mono-rele2-core timestampTool`
|
|
42
|
-
- `mono-rele2-core timestampTool unix`
|
|
43
|
-
- `mono-rele2-core envTool HOME`
|
|
44
|
-
- `mono-rele2-core envTool NODE_ENV`
|
|
48
|
+
- `mono-rele2-core echoTool "hello world"` => `hello world`
|
|
49
|
+
- `mono-rele2-core timestampTool` => `2026-05-02T00:00:00.000Z`
|
|
50
|
+
- `mono-rele2-core timestampTool unix` => `1746144000000`
|
|
51
|
+
- `mono-rele2-core envTool HOME` => `/Users/julong`
|
|
52
|
+
- `mono-rele2-core envTool NODE_ENV` => `development`
|
|
53
|
+
- `mono-rele2-core uuidTool` => `550e8400-e29b-41d4-a716-446655440000`
|
|
45
54
|
|
|
46
55
|
## Guidelines
|
|
47
56
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@julong/mono-rele2-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Use this skill to invoke core system utility functions via the mono-rele2-core CLI. Handles message echo, UTC timestamp generation, and environment variable lookup.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"type": "module",
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"build": "tsup",
|
|
25
25
|
"typecheck": "tsc --noEmit",
|
|
26
|
-
"clean": "rimraf dist"
|
|
27
|
-
"update-readme": "node ../common/build/update-readme.mjs"
|
|
26
|
+
"clean": "rimraf dist"
|
|
28
27
|
},
|
|
29
28
|
"dependencies": {
|
|
30
29
|
"@modelcontextprotocol/sdk": "^1.29.0",
|