@julong/mono-rele2-core 1.1.1 → 1.1.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.
- package/dist/index.d.ts +5 -3
- package/dist/index.js +63 -6
- package/dist/server.js +71 -6
- package/package.json +11 -18
- package/.turbo/turbo-build.log +0 -4
- package/CHANGELOG.md +0 -29
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/server.d.ts +0 -3
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/tools/index.d.ts +0 -2
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -2
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/system.d.ts +0 -4
- package/dist/tools/system.d.ts.map +0 -1
- package/dist/tools/system.js +0 -30
- package/dist/tools/system.js.map +0 -1
- package/src/index.ts +0 -11
- package/src/server.ts +0 -10
- package/src/tools/index.ts +0 -1
- package/src/tools/system.ts +0 -32
- package/tsconfig.json +0 -19
- package/tsconfig.tsbuildinfo +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import * as _modelcontextprotocol_sdk_server_mcp from '@modelcontextprotocol/sdk/server/mcp';
|
|
2
|
+
|
|
3
|
+
declare function createCoreServer(): _modelcontextprotocol_sdk_server_mcp.McpServer;
|
|
4
|
+
|
|
5
|
+
export { createCoreServer };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export function createCoreServer() {
|
|
5
|
-
return createMcpServer({ name: 'mono-rele2-core', version: '1.0.0' }, [echoTool, timestampTool, envTool]);
|
|
1
|
+
// ../common/mcp/tool.ts
|
|
2
|
+
function defineTool(tool) {
|
|
3
|
+
return tool;
|
|
6
4
|
}
|
|
7
|
-
|
|
5
|
+
function text(content) {
|
|
6
|
+
return { content: [{ type: "text", text: content }] };
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// ../common/mcp/server.ts
|
|
10
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
12
|
+
function createMcpServer(config, tools) {
|
|
13
|
+
const server = new McpServer(config);
|
|
14
|
+
for (const tool of tools) {
|
|
15
|
+
server.registerTool(
|
|
16
|
+
tool.name,
|
|
17
|
+
{ description: tool.description, inputSchema: tool.inputSchema },
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
tool.handler
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return server;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/tools/system.ts
|
|
26
|
+
import { z } from "zod";
|
|
27
|
+
var echoTool = defineTool({
|
|
28
|
+
name: "echo",
|
|
29
|
+
description: "Returns the message as-is",
|
|
30
|
+
inputSchema: {
|
|
31
|
+
message: z.string().describe("Message to echo")
|
|
32
|
+
},
|
|
33
|
+
handler: async ({ message }) => text(message)
|
|
34
|
+
});
|
|
35
|
+
var timestampTool = defineTool({
|
|
36
|
+
name: "timestamp",
|
|
37
|
+
description: "Returns the current UTC timestamp",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
format: z.enum(["iso", "unix"]).default("iso").describe("Timestamp format")
|
|
40
|
+
},
|
|
41
|
+
handler: async ({ format }) => {
|
|
42
|
+
const value = format === "unix" ? String(Date.now()) : (/* @__PURE__ */ new Date()).toISOString();
|
|
43
|
+
return text(value);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
var envTool = defineTool({
|
|
47
|
+
name: "env",
|
|
48
|
+
description: "Returns the value of an environment variable",
|
|
49
|
+
inputSchema: {
|
|
50
|
+
key: z.string().describe("Environment variable name")
|
|
51
|
+
},
|
|
52
|
+
handler: async ({ key }) => text(process.env[key] ?? "")
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// src/index.ts
|
|
56
|
+
function createCoreServer() {
|
|
57
|
+
return createMcpServer(
|
|
58
|
+
{ name: "mono-rele2-core", version: "1.0.0" },
|
|
59
|
+
[echoTool, timestampTool, envTool]
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
createCoreServer
|
|
64
|
+
};
|
package/dist/server.js
CHANGED
|
@@ -1,9 +1,74 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
|
|
3
|
+
// ../common/mcp/tool.ts
|
|
4
|
+
function defineTool(tool) {
|
|
5
|
+
return tool;
|
|
6
|
+
}
|
|
7
|
+
function text(content) {
|
|
8
|
+
return { content: [{ type: "text", text: content }] };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// ../common/mcp/server.ts
|
|
12
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
13
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
14
|
+
function createMcpServer(config, tools) {
|
|
15
|
+
const server2 = new McpServer(config);
|
|
16
|
+
for (const tool of tools) {
|
|
17
|
+
server2.registerTool(
|
|
18
|
+
tool.name,
|
|
19
|
+
{ description: tool.description, inputSchema: tool.inputSchema },
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
tool.handler
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
return server2;
|
|
25
|
+
}
|
|
26
|
+
async function startServer(server2) {
|
|
27
|
+
const transport = new StdioServerTransport();
|
|
28
|
+
await server2.connect(transport);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/tools/system.ts
|
|
32
|
+
import { z } from "zod";
|
|
33
|
+
var echoTool = defineTool({
|
|
34
|
+
name: "echo",
|
|
35
|
+
description: "Returns the message as-is",
|
|
36
|
+
inputSchema: {
|
|
37
|
+
message: z.string().describe("Message to echo")
|
|
38
|
+
},
|
|
39
|
+
handler: async ({ message }) => text(message)
|
|
40
|
+
});
|
|
41
|
+
var timestampTool = defineTool({
|
|
42
|
+
name: "timestamp",
|
|
43
|
+
description: "Returns the current UTC timestamp",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
format: z.enum(["iso", "unix"]).default("iso").describe("Timestamp format")
|
|
46
|
+
},
|
|
47
|
+
handler: async ({ format }) => {
|
|
48
|
+
const value = format === "unix" ? String(Date.now()) : (/* @__PURE__ */ new Date()).toISOString();
|
|
49
|
+
return text(value);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
var envTool = defineTool({
|
|
53
|
+
name: "env",
|
|
54
|
+
description: "Returns the value of an environment variable",
|
|
55
|
+
inputSchema: {
|
|
56
|
+
key: z.string().describe("Environment variable name")
|
|
57
|
+
},
|
|
58
|
+
handler: async ({ key }) => text(process.env[key] ?? "")
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// src/index.ts
|
|
62
|
+
function createCoreServer() {
|
|
63
|
+
return createMcpServer(
|
|
64
|
+
{ name: "mono-rele2-core", version: "1.0.0" },
|
|
65
|
+
[echoTool, timestampTool, envTool]
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/server.ts
|
|
70
|
+
var server = createCoreServer();
|
|
5
71
|
startServer(server).catch((err) => {
|
|
6
|
-
|
|
7
|
-
|
|
72
|
+
console.error("[core] server error:", err);
|
|
73
|
+
process.exit(1);
|
|
8
74
|
});
|
|
9
|
-
//# sourceMappingURL=server.js.map
|
package/package.json
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@julong/mono-rele2-core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"import": "./
|
|
9
|
-
"types": "./
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts"
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"bin": {
|
|
13
13
|
"mcp-core": "./dist/server.js"
|
|
14
14
|
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
15
18
|
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
17
|
-
"exports": {
|
|
18
|
-
".": {
|
|
19
|
-
"import": "./dist/index.js",
|
|
20
|
-
"types": "./dist/index.d.ts"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
19
|
+
"access": "public"
|
|
23
20
|
},
|
|
24
21
|
"scripts": {
|
|
25
|
-
"build": "
|
|
22
|
+
"build": "tsup",
|
|
26
23
|
"typecheck": "tsc --noEmit",
|
|
27
|
-
"clean": "rimraf dist
|
|
28
|
-
},
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"@julong/mono-rele2-common": "1.1.0",
|
|
31
|
-
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
32
|
-
"@types/node": "^25.6.0",
|
|
33
|
-
"zod": "^3.24.0"
|
|
24
|
+
"clean": "rimraf dist"
|
|
34
25
|
},
|
|
35
26
|
"devDependencies": {
|
|
27
|
+
"@julong/mono-rele2-common": "1.1.2",
|
|
36
28
|
"rimraf": "^6.0.1",
|
|
29
|
+
"tsup": "^8.5.1",
|
|
37
30
|
"typescript": "^5.6.3"
|
|
38
31
|
}
|
|
39
32
|
}
|
package/.turbo/turbo-build.log
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
## @julong/mono-rele2-core [1.1.1](https://github.com/mss-julong/mono-rele2/compare/@julong/mono-rele2-core@1.1.0...@julong/mono-rele2-core@1.1.1) (2026-04-30)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Dependencies
|
|
5
|
-
|
|
6
|
-
* **@julong/mono-rele2-common:** upgraded to 1.1.0
|
|
7
|
-
|
|
8
|
-
## @julong/mono-rele2-core [1.1.0](https://github.com/mss-julong/mono-rele2/compare/@julong/mono-rele2-core@1.0.1...@julong/mono-rele2-core@1.1.0) (2026-04-30)
|
|
9
|
-
|
|
10
|
-
### Features
|
|
11
|
-
|
|
12
|
-
* mcp서버 추가 ([2d00087](https://github.com/mss-julong/mono-rele2/commit/2d0008777d5a0b3b032d93ef7e18c9ea13e0d619))
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Dependencies
|
|
16
|
-
|
|
17
|
-
* **@julong/mono-rele2-common:** upgraded to 1.0.0
|
|
18
|
-
|
|
19
|
-
## @julong/mono-rele2-core [1.0.1](https://github.com/mss-julong/mono-rele2/compare/@julong/mono-rele2-core@1.0.0...@julong/mono-rele2-core@1.0.1) (2026-04-30)
|
|
20
|
-
|
|
21
|
-
### Bug Fixes
|
|
22
|
-
|
|
23
|
-
* 코어 배포 테스트 ([f64e484](https://github.com/mss-julong/mono-rele2/commit/f64e4841d4c40d9a47d2dfe142d2802ad1d7803d))
|
|
24
|
-
|
|
25
|
-
## @julong/mono-rele2-core 1.0.0 (2026-04-30)
|
|
26
|
-
|
|
27
|
-
### Features
|
|
28
|
-
|
|
29
|
-
* 프로젝트 초기화 ([4786372](https://github.com/mss-julong/mono-rele2/commit/47863729484561d11757409bde78dd63baad8c8c))
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEnE,wBAAgB,gBAAgB,6DAK/B"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEnE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEnE,MAAM,UAAU,gBAAgB;IAC9B,OAAO,eAAe,CACpB,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO,EAAE,EAC7C,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,CACnC,CAAA;AACH,CAAC"}
|
package/dist/server.d.ts
DELETED
package/dist/server.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":""}
|
package/dist/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAA;AAEjC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAChC,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAA;IAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
package/dist/tools/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/tools/index.js
DELETED
package/dist/tools/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA"}
|
package/dist/tools/system.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const echoTool: import("@julong/mono-rele2-common").AnyToolDef;
|
|
2
|
-
export declare const timestampTool: import("@julong/mono-rele2-common").AnyToolDef;
|
|
3
|
-
export declare const envTool: import("@julong/mono-rele2-common").AnyToolDef;
|
|
4
|
-
//# sourceMappingURL=system.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/tools/system.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,gDAOnB,CAAA;AAEF,eAAO,MAAM,aAAa,gDAUxB,CAAA;AAEF,eAAO,MAAM,OAAO,gDAOlB,CAAA"}
|
package/dist/tools/system.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { defineTool, text } from '@julong/mono-rele2-common';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
export const echoTool = defineTool({
|
|
4
|
-
name: 'echo',
|
|
5
|
-
description: 'Returns the message as-is',
|
|
6
|
-
inputSchema: {
|
|
7
|
-
message: z.string().describe('Message to echo'),
|
|
8
|
-
},
|
|
9
|
-
handler: async ({ message }) => text(message),
|
|
10
|
-
});
|
|
11
|
-
export const timestampTool = defineTool({
|
|
12
|
-
name: 'timestamp',
|
|
13
|
-
description: 'Returns the current UTC timestamp',
|
|
14
|
-
inputSchema: {
|
|
15
|
-
format: z.enum(['iso', 'unix']).default('iso').describe('Timestamp format'),
|
|
16
|
-
},
|
|
17
|
-
handler: async ({ format }) => {
|
|
18
|
-
const value = format === 'unix' ? String(Date.now()) : new Date().toISOString();
|
|
19
|
-
return text(value);
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
export const envTool = defineTool({
|
|
23
|
-
name: 'env',
|
|
24
|
-
description: 'Returns the value of an environment variable',
|
|
25
|
-
inputSchema: {
|
|
26
|
-
key: z.string().describe('Environment variable name'),
|
|
27
|
-
},
|
|
28
|
-
handler: async ({ key }) => text(process.env[key] ?? ''),
|
|
29
|
-
});
|
|
30
|
-
//# sourceMappingURL=system.js.map
|
package/dist/tools/system.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/tools/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;IACjC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE;QACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;KAChD;IACD,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;CAC9C,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,mCAAmC;IAChD,WAAW,EAAE;QACX,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;KAC5E;IACD,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5B,MAAM,KAAK,GAAG,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;QAC/E,OAAO,IAAI,CAAC,KAAK,CAAC,CAAA;IACpB,CAAC;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;IAChC,IAAI,EAAE,KAAK;IACX,WAAW,EAAE,8CAA8C;IAC3D,WAAW,EAAE;QACX,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;KACtD;IACD,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;CACzD,CAAC,CAAA"}
|
package/src/index.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createMcpServer } from '@julong/mono-rele2-common'
|
|
2
|
-
import { echoTool, envTool, timestampTool } from './tools/index.js'
|
|
3
|
-
|
|
4
|
-
export { echoTool, envTool, timestampTool } from './tools/index.js'
|
|
5
|
-
|
|
6
|
-
export function createCoreServer() {
|
|
7
|
-
return createMcpServer(
|
|
8
|
-
{ name: 'mono-rele2-core', version: '1.0.0' },
|
|
9
|
-
[echoTool, timestampTool, envTool],
|
|
10
|
-
)
|
|
11
|
-
}
|
package/src/server.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { startServer } from '@julong/mono-rele2-common'
|
|
3
|
-
import { createCoreServer } from './index.js'
|
|
4
|
-
|
|
5
|
-
const server = createCoreServer()
|
|
6
|
-
|
|
7
|
-
startServer(server).catch((err) => {
|
|
8
|
-
console.error('[core] server error:', err)
|
|
9
|
-
process.exit(1)
|
|
10
|
-
})
|
package/src/tools/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { echoTool, timestampTool, envTool } from './system.js'
|
package/src/tools/system.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { defineTool, text } from '@julong/mono-rele2-common'
|
|
2
|
-
import { z } from 'zod'
|
|
3
|
-
|
|
4
|
-
export const echoTool = defineTool({
|
|
5
|
-
name: 'echo',
|
|
6
|
-
description: 'Returns the message as-is',
|
|
7
|
-
inputSchema: {
|
|
8
|
-
message: z.string().describe('Message to echo'),
|
|
9
|
-
},
|
|
10
|
-
handler: async ({ message }) => text(message),
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
export const timestampTool = defineTool({
|
|
14
|
-
name: 'timestamp',
|
|
15
|
-
description: 'Returns the current UTC timestamp',
|
|
16
|
-
inputSchema: {
|
|
17
|
-
format: z.enum(['iso', 'unix']).default('iso').describe('Timestamp format'),
|
|
18
|
-
},
|
|
19
|
-
handler: async ({ format }) => {
|
|
20
|
-
const value = format === 'unix' ? String(Date.now()) : new Date().toISOString()
|
|
21
|
-
return text(value)
|
|
22
|
-
},
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
export const envTool = defineTool({
|
|
26
|
-
name: 'env',
|
|
27
|
-
description: 'Returns the value of an environment variable',
|
|
28
|
-
inputSchema: {
|
|
29
|
-
key: z.string().describe('Environment variable name'),
|
|
30
|
-
},
|
|
31
|
-
handler: async ({ key }) => text(process.env[key] ?? ''),
|
|
32
|
-
})
|
package/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ES2022",
|
|
5
|
-
"lib": ["ES2022"],
|
|
6
|
-
"module": "NodeNext",
|
|
7
|
-
"moduleResolution": "NodeNext",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"resolveJsonModule": true,
|
|
12
|
-
"declaration": true,
|
|
13
|
-
"declarationMap": true,
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"outDir": "dist",
|
|
16
|
-
"rootDir": "src"
|
|
17
|
-
},
|
|
18
|
-
"include": ["src"]
|
|
19
|
-
}
|
package/tsconfig.tsbuildinfo
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"root":["./src/index.ts","./src/server.ts","./src/tools/index.ts","./src/tools/system.ts"],"version":"5.9.3"}
|