@julong/mono-rele2-core 1.11.1 → 1.13.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/dist/cli.js CHANGED
@@ -32,7 +32,8 @@ ${paramLines}`;
32
32
  return "Available skills:\n\n" + sections.join("\n\n");
33
33
  }
34
34
  async function runCli(tools2) {
35
- const [, , toolName, ...rawArgs] = process.argv;
35
+ const [, , cliName, toolName, ...rawArgs] = process.argv;
36
+ console.log(process.argv);
36
37
  if (!toolName || !(toolName in tools2)) {
37
38
  if (toolName) console.error(`Unknown skill: "${toolName}"
38
39
  `);
@@ -69,25 +70,25 @@ function handleCliError(err) {
69
70
  // ../common/kit/skill.ts
70
71
  import { z as z2 } from "zod";
71
72
 
72
- // src/tools/index.ts
73
+ // src/tools/system.ts
73
74
  import { z as z3 } from "zod";
74
75
  import { randomUUID } from "crypto";
75
76
  var tools = {
76
77
  echoTool: toolDef({
77
78
  name: "echo",
78
79
  description: "Returns the message as-is",
79
- inputSchema: z3.object({
80
+ inputSchema: {
80
81
  message: z3.string().describe("Message to echo")
81
- }),
82
+ },
82
83
  handler: async ({ message }) => text(message),
83
84
  examples: [{ args: [`"hello world"`], result: "hello world" }]
84
85
  }),
85
86
  timestampTool: toolDef({
86
87
  name: "timestamp",
87
88
  description: "Returns the current UTC timestamp",
88
- inputSchema: z3.object({
89
+ inputSchema: {
89
90
  format: z3.enum(["iso", "unix"]).default("iso").describe("Timestamp format")
90
- }),
91
+ },
91
92
  handler: async ({ format }) => {
92
93
  const value = format === "unix" ? String(Date.now()) : (/* @__PURE__ */ new Date()).toISOString();
93
94
  return text(value);
@@ -100,9 +101,9 @@ var tools = {
100
101
  envTool: toolDef({
101
102
  name: "env",
102
103
  description: "Returns the value of an environment variable",
103
- inputSchema: z3.object({
104
+ inputSchema: {
104
105
  key: z3.string().describe("Environment variable name")
105
- }),
106
+ },
106
107
  handler: async ({ key }) => text(process.env[key] ?? ""),
107
108
  examples: [
108
109
  { args: ["HOME"], result: "/Users/julong" },
@@ -113,7 +114,7 @@ var tools = {
113
114
  uuidTool: toolDef({
114
115
  name: "uuid",
115
116
  description: "Generates a random UUID v4",
116
- inputSchema: z3.object({}),
117
+ inputSchema: {},
117
118
  handler: async () => text(randomUUID()),
118
119
  examples: [{ args: [], result: "550e8400-e29b-41d4-a716-446655440000" }]
119
120
  })
package/dist/index.d.ts CHANGED
@@ -31,9 +31,9 @@ declare const tools: {
31
31
  echoTool: {
32
32
  name: string;
33
33
  description: string;
34
- inputSchema: z.ZodObject<{
35
- message: z.ZodString;
36
- }, z.core.$strip>;
34
+ inputSchema: {
35
+ readonly message: z.ZodString;
36
+ };
37
37
  handler: (input: {
38
38
  message: string;
39
39
  }) => Promise<ToolResult>;
@@ -43,12 +43,12 @@ declare const tools: {
43
43
  timestampTool: {
44
44
  name: string;
45
45
  description: string;
46
- inputSchema: z.ZodObject<{
47
- format: z.ZodDefault<z.ZodEnum<{
46
+ inputSchema: {
47
+ readonly format: z.ZodDefault<z.ZodEnum<{
48
48
  iso: "iso";
49
49
  unix: "unix";
50
50
  }>>;
51
- }, z.core.$strip>;
51
+ };
52
52
  handler: (input: {
53
53
  format: "iso" | "unix";
54
54
  }) => Promise<ToolResult>;
@@ -58,9 +58,9 @@ declare const tools: {
58
58
  envTool: {
59
59
  name: string;
60
60
  description: string;
61
- inputSchema: z.ZodObject<{
62
- key: z.ZodString;
63
- }, z.core.$strip>;
61
+ inputSchema: {
62
+ readonly key: z.ZodString;
63
+ };
64
64
  handler: (input: {
65
65
  key: string;
66
66
  }) => Promise<ToolResult>;
@@ -70,7 +70,7 @@ declare const tools: {
70
70
  uuidTool: {
71
71
  name: string;
72
72
  description: string;
73
- inputSchema: z.ZodObject<{}, z.core.$strip>;
73
+ inputSchema: {};
74
74
  handler: (input: Record<string, never>) => Promise<ToolResult>;
75
75
  examples?: ToolExample[];
76
76
  guidelines?: string[];
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 server = new McpServer(config);
16
+ const server2 = new McpServer(config);
17
17
  for (const tool of tools2) {
18
- server.registerTool(
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 server;
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
@@ -208,25 +212,25 @@ function describeReadmeDesc(schema) {
208
212
  return baseDesc;
209
213
  }
210
214
 
211
- // src/tools/index.ts
215
+ // src/tools/system.ts
212
216
  import { z as z3 } from "zod";
213
217
  import { randomUUID } from "crypto";
214
218
  var tools = {
215
219
  echoTool: toolDef({
216
220
  name: "echo",
217
221
  description: "Returns the message as-is",
218
- inputSchema: z3.object({
222
+ inputSchema: {
219
223
  message: z3.string().describe("Message to echo")
220
- }),
224
+ },
221
225
  handler: async ({ message }) => text(message),
222
226
  examples: [{ args: [`"hello world"`], result: "hello world" }]
223
227
  }),
224
228
  timestampTool: toolDef({
225
229
  name: "timestamp",
226
230
  description: "Returns the current UTC timestamp",
227
- inputSchema: z3.object({
231
+ inputSchema: {
228
232
  format: z3.enum(["iso", "unix"]).default("iso").describe("Timestamp format")
229
- }),
233
+ },
230
234
  handler: async ({ format }) => {
231
235
  const value = format === "unix" ? String(Date.now()) : (/* @__PURE__ */ new Date()).toISOString();
232
236
  return text(value);
@@ -239,9 +243,9 @@ var tools = {
239
243
  envTool: toolDef({
240
244
  name: "env",
241
245
  description: "Returns the value of an environment variable",
242
- inputSchema: z3.object({
246
+ inputSchema: {
243
247
  key: z3.string().describe("Environment variable name")
244
- }),
248
+ },
245
249
  handler: async ({ key }) => text(process.env[key] ?? ""),
246
250
  examples: [
247
251
  { args: ["HOME"], result: "/Users/julong" },
@@ -252,7 +256,7 @@ var tools = {
252
256
  uuidTool: toolDef({
253
257
  name: "uuid",
254
258
  description: "Generates a random UUID v4",
255
- inputSchema: z3.object({}),
259
+ inputSchema: {},
256
260
  handler: async () => text(randomUUID()),
257
261
  examples: [{ args: [], result: "550e8400-e29b-41d4-a716-446655440000" }]
258
262
  })
@@ -266,6 +270,11 @@ var uuidTool = defineTool(tools.uuidTool);
266
270
  function createCoreServer() {
267
271
  return createMcpServer({ name: "mono-rele2-core", version: "1.0.0" }, [echoTool, timestampTool, envTool, uuidTool]);
268
272
  }
273
+ var server = createCoreServer();
274
+ startServer(server).catch((err) => {
275
+ console.error("[core] server error:", err);
276
+ process.exit(1);
277
+ });
269
278
  export {
270
279
  createCoreServer,
271
280
  generateReadmeSkills,
@@ -17,22 +17,7 @@ Returns the message as-is
17
17
 
18
18
  | arg | description |
19
19
  |-----|-------------|
20
- | `toJSONSchema` | |
21
- | `def` | |
22
- | `type` | |
23
- | `parse` | |
24
- | `safeParse` | |
25
- | `parseAsync` | |
26
- | `safeParseAsync` | |
27
- | `spa` | |
28
- | `encode` | |
29
- | `decode` | |
30
- | `encodeAsync` | |
31
- | `decodeAsync` | |
32
- | `safeEncode` | |
33
- | `safeDecode` | |
34
- | `safeEncodeAsync` | |
35
- | `safeDecodeAsync` | |
20
+ | `message` | Message to echo |
36
21
 
37
22
  ### timestampTool
38
23
 
@@ -40,22 +25,7 @@ Returns the current UTC timestamp
40
25
 
41
26
  | arg | description |
42
27
  |-----|-------------|
43
- | `toJSONSchema` | |
44
- | `def` | |
45
- | `type` | |
46
- | `parse` | |
47
- | `safeParse` | |
48
- | `parseAsync` | |
49
- | `safeParseAsync` | |
50
- | `spa` | |
51
- | `encode` | |
52
- | `decode` | |
53
- | `encodeAsync` | |
54
- | `decodeAsync` | |
55
- | `safeEncode` | |
56
- | `safeDecode` | |
57
- | `safeEncodeAsync` | |
58
- | `safeDecodeAsync` | |
28
+ | `format` | Timestamp format — `iso` \| `unix` — default: `iso` |
59
29
 
60
30
  ### envTool
61
31
 
@@ -63,22 +33,7 @@ Returns the value of an environment variable
63
33
 
64
34
  | arg | description |
65
35
  |-----|-------------|
66
- | `toJSONSchema` | |
67
- | `def` | |
68
- | `type` | |
69
- | `parse` | |
70
- | `safeParse` | |
71
- | `parseAsync` | |
72
- | `safeParseAsync` | |
73
- | `spa` | |
74
- | `encode` | |
75
- | `decode` | |
76
- | `encodeAsync` | |
77
- | `decodeAsync` | |
78
- | `safeEncode` | |
79
- | `safeDecode` | |
80
- | `safeEncodeAsync` | |
81
- | `safeDecodeAsync` | |
36
+ | `key` | Environment variable name |
82
37
 
83
38
  ### uuidTool
84
39
 
@@ -86,22 +41,7 @@ Generates a random UUID v4
86
41
 
87
42
  | arg | description |
88
43
  |-----|-------------|
89
- | `toJSONSchema` | |
90
- | `def` | |
91
- | `type` | |
92
- | `parse` | |
93
- | `safeParse` | |
94
- | `parseAsync` | |
95
- | `safeParseAsync` | |
96
- | `spa` | |
97
- | `encode` | |
98
- | `decode` | |
99
- | `encodeAsync` | |
100
- | `decodeAsync` | |
101
- | `safeEncode` | |
102
- | `safeDecode` | |
103
- | `safeEncodeAsync` | |
104
- | `safeDecodeAsync` | |
44
+
105
45
 
106
46
  ## Examples
107
47
 
@@ -115,5 +55,6 @@ Generates a random UUID v4
115
55
  ## Guidelines
116
56
 
117
57
  - Arguments are positional — pass them in the order listed in each skill's table
58
+ - Optional args with defaults may be omitted
118
59
  - `envTool` returns an empty string when the variable is not set
119
60
  - Run `mono-rele2-core` with no args to list all available skills
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@julong/mono-rele2-core",
3
- "version": "1.11.1",
3
+ "version": "1.13.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",
@@ -11,7 +11,7 @@
11
11
  }
12
12
  },
13
13
  "bin": {
14
- "mono-rele2-core": "./dist/server.js",
14
+ "mono-rele2-core": "./dist/index.js",
15
15
  "mono-rele2-core-cli": "./dist/cli.js"
16
16
  },
17
17
  "files": [
package/dist/server.js DELETED
@@ -1,104 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // ../common/kit/tool.ts
4
- function toolDef(def) {
5
- return def;
6
- }
7
- function defineTool(tool) {
8
- return tool;
9
- }
10
- function text(content) {
11
- return { content: [{ type: "text", text: content }] };
12
- }
13
-
14
- // ../common/kit/server.ts
15
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
16
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
17
- function createMcpServer(config, tools2) {
18
- const server2 = new McpServer(config);
19
- for (const tool of tools2) {
20
- server2.registerTool(
21
- tool.name,
22
- { description: tool.description, inputSchema: tool.inputSchema },
23
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
- tool.handler
25
- );
26
- }
27
- return server2;
28
- }
29
- async function startServer(server2) {
30
- const transport = new StdioServerTransport();
31
- await server2.connect(transport);
32
- }
33
-
34
- // ../common/kit/cli.ts
35
- import { z } from "zod";
36
-
37
- // ../common/kit/skill.ts
38
- import { z as z2 } from "zod";
39
-
40
- // src/tools/index.ts
41
- import { z as z3 } from "zod";
42
- import { randomUUID } from "crypto";
43
- var tools = {
44
- echoTool: toolDef({
45
- name: "echo",
46
- description: "Returns the message as-is",
47
- inputSchema: z3.object({
48
- message: z3.string().describe("Message to echo")
49
- }),
50
- handler: async ({ message }) => text(message),
51
- examples: [{ args: [`"hello world"`], result: "hello world" }]
52
- }),
53
- timestampTool: toolDef({
54
- name: "timestamp",
55
- description: "Returns the current UTC timestamp",
56
- inputSchema: z3.object({
57
- format: z3.enum(["iso", "unix"]).default("iso").describe("Timestamp format")
58
- }),
59
- handler: async ({ format }) => {
60
- const value = format === "unix" ? String(Date.now()) : (/* @__PURE__ */ new Date()).toISOString();
61
- return text(value);
62
- },
63
- examples: [
64
- { args: [], result: "2026-05-02T00:00:00.000Z" },
65
- { args: ["unix"], result: "1746144000000" }
66
- ]
67
- }),
68
- envTool: toolDef({
69
- name: "env",
70
- description: "Returns the value of an environment variable",
71
- inputSchema: z3.object({
72
- key: z3.string().describe("Environment variable name")
73
- }),
74
- handler: async ({ key }) => text(process.env[key] ?? ""),
75
- examples: [
76
- { args: ["HOME"], result: "/Users/julong" },
77
- { args: ["NODE_ENV"], result: "development" }
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: z3.object({}),
85
- handler: async () => text(randomUUID()),
86
- examples: [{ args: [], result: "550e8400-e29b-41d4-a716-446655440000" }]
87
- })
88
- };
89
- var echoTool = defineTool(tools.echoTool);
90
- var timestampTool = defineTool(tools.timestampTool);
91
- var envTool = defineTool(tools.envTool);
92
- var uuidTool = defineTool(tools.uuidTool);
93
-
94
- // src/index.ts
95
- function createCoreServer() {
96
- return createMcpServer({ name: "mono-rele2-core", version: "1.0.0" }, [echoTool, timestampTool, envTool, uuidTool]);
97
- }
98
-
99
- // src/server.ts
100
- var server = createCoreServer();
101
- startServer(server).catch((err) => {
102
- console.error("[core] server error:", err);
103
- process.exit(1);
104
- });