@julong/mono-rele2-utils 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 CHANGED
@@ -1,4 +1,7 @@
1
- export { cn } from './cn.js';
2
- export { cnTool, caseConvertTool, truncateTool } from './tools/index.js';
3
- export declare function createUtilsServer(): import("@modelcontextprotocol/sdk/server/mcp").McpServer;
4
- //# sourceMappingURL=index.d.ts.map
1
+ import * as _modelcontextprotocol_sdk_server_mcp from '@modelcontextprotocol/sdk/server/mcp';
2
+
3
+ declare function cn(...classes: (string | undefined | null | false)[]): string;
4
+
5
+ declare function createUtilsServer(): _modelcontextprotocol_sdk_server_mcp.McpServer;
6
+
7
+ export { cn, createUtilsServer };
package/dist/index.js CHANGED
@@ -1,8 +1,94 @@
1
- import { createMcpServer } from '@julong/mono-rele2-common';
2
- import { cnTool, caseConvertTool, truncateTool } from './tools/index.js';
3
- export { cn } from './cn.js';
4
- export { cnTool, caseConvertTool, truncateTool } from './tools/index.js';
5
- export function createUtilsServer() {
6
- return createMcpServer({ name: 'mono-rele2-utils', version: '1.0.0' }, [cnTool, caseConvertTool, truncateTool]);
7
- }
8
- //# sourceMappingURL=index.js.map
1
+ // ../common/mcp/tool.ts
2
+ function defineTool(tool) {
3
+ return tool;
4
+ }
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/text.ts
26
+ import { z } from "zod";
27
+
28
+ // src/cn.ts
29
+ function cn(...classes) {
30
+ return classes.filter(Boolean).join(" ");
31
+ }
32
+
33
+ // src/tools/text.ts
34
+ var cnTool = defineTool({
35
+ name: "cn",
36
+ description: "Merges class names, filtering out falsy values",
37
+ inputSchema: {
38
+ classes: z.array(z.string()).describe("List of class names to merge")
39
+ },
40
+ handler: async ({ classes }) => text(cn(...classes))
41
+ });
42
+ var caseConvertTool = defineTool({
43
+ name: "case_convert",
44
+ description: "Converts text to the specified case format",
45
+ inputSchema: {
46
+ input: z.string().describe("Text to convert"),
47
+ to: z.enum(["upper", "lower", "capitalize", "camel", "snake", "kebab"]).describe("Target case format")
48
+ },
49
+ handler: async ({ input, to }) => {
50
+ const result = convert(input, to);
51
+ return text(result);
52
+ }
53
+ });
54
+ var truncateTool = defineTool({
55
+ name: "truncate",
56
+ description: "Truncates text to a maximum length and appends a suffix",
57
+ inputSchema: {
58
+ input: z.string().describe("Text to truncate"),
59
+ maxLength: z.number().int().positive().describe("Maximum character length"),
60
+ suffix: z.string().default("...").describe("Suffix to append when truncated")
61
+ },
62
+ handler: async ({ input, maxLength, suffix }) => {
63
+ const result = input.length <= maxLength ? input : input.slice(0, maxLength - suffix.length) + suffix;
64
+ return text(result);
65
+ }
66
+ });
67
+ function convert(input, to) {
68
+ switch (to) {
69
+ case "upper":
70
+ return input.toUpperCase();
71
+ case "lower":
72
+ return input.toLowerCase();
73
+ case "capitalize":
74
+ return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
75
+ case "camel":
76
+ return input.replace(/[-_\s]+(.)/g, (_, c) => c.toUpperCase()).replace(/^(.)/, (c) => c.toLowerCase());
77
+ case "snake":
78
+ return input.replace(/([A-Z])/g, "_$1").replace(/[-\s]+/g, "_").toLowerCase().replace(/^_/, "");
79
+ case "kebab":
80
+ return input.replace(/([A-Z])/g, "-$1").replace(/[_\s]+/g, "-").toLowerCase().replace(/^-/, "");
81
+ }
82
+ }
83
+
84
+ // src/index.ts
85
+ function createUtilsServer() {
86
+ return createMcpServer(
87
+ { name: "mono-rele2-utils", version: "1.0.0" },
88
+ [cnTool, caseConvertTool, truncateTool]
89
+ );
90
+ }
91
+ export {
92
+ cn,
93
+ createUtilsServer
94
+ };
package/dist/server.js CHANGED
@@ -1,9 +1,103 @@
1
1
  #!/usr/bin/env node
2
- import { startServer } from '@julong/mono-rele2-common';
3
- import { createUtilsServer } from './index.js';
4
- const server = createUtilsServer();
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/text.ts
32
+ import { z } from "zod";
33
+
34
+ // src/cn.ts
35
+ function cn(...classes) {
36
+ return classes.filter(Boolean).join(" ");
37
+ }
38
+
39
+ // src/tools/text.ts
40
+ var cnTool = defineTool({
41
+ name: "cn",
42
+ description: "Merges class names, filtering out falsy values",
43
+ inputSchema: {
44
+ classes: z.array(z.string()).describe("List of class names to merge")
45
+ },
46
+ handler: async ({ classes }) => text(cn(...classes))
47
+ });
48
+ var caseConvertTool = defineTool({
49
+ name: "case_convert",
50
+ description: "Converts text to the specified case format",
51
+ inputSchema: {
52
+ input: z.string().describe("Text to convert"),
53
+ to: z.enum(["upper", "lower", "capitalize", "camel", "snake", "kebab"]).describe("Target case format")
54
+ },
55
+ handler: async ({ input, to }) => {
56
+ const result = convert(input, to);
57
+ return text(result);
58
+ }
59
+ });
60
+ var truncateTool = defineTool({
61
+ name: "truncate",
62
+ description: "Truncates text to a maximum length and appends a suffix",
63
+ inputSchema: {
64
+ input: z.string().describe("Text to truncate"),
65
+ maxLength: z.number().int().positive().describe("Maximum character length"),
66
+ suffix: z.string().default("...").describe("Suffix to append when truncated")
67
+ },
68
+ handler: async ({ input, maxLength, suffix }) => {
69
+ const result = input.length <= maxLength ? input : input.slice(0, maxLength - suffix.length) + suffix;
70
+ return text(result);
71
+ }
72
+ });
73
+ function convert(input, to) {
74
+ switch (to) {
75
+ case "upper":
76
+ return input.toUpperCase();
77
+ case "lower":
78
+ return input.toLowerCase();
79
+ case "capitalize":
80
+ return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
81
+ case "camel":
82
+ return input.replace(/[-_\s]+(.)/g, (_, c) => c.toUpperCase()).replace(/^(.)/, (c) => c.toLowerCase());
83
+ case "snake":
84
+ return input.replace(/([A-Z])/g, "_$1").replace(/[-\s]+/g, "_").toLowerCase().replace(/^_/, "");
85
+ case "kebab":
86
+ return input.replace(/([A-Z])/g, "-$1").replace(/[_\s]+/g, "-").toLowerCase().replace(/^-/, "");
87
+ }
88
+ }
89
+
90
+ // src/index.ts
91
+ function createUtilsServer() {
92
+ return createMcpServer(
93
+ { name: "mono-rele2-utils", version: "1.0.0" },
94
+ [cnTool, caseConvertTool, truncateTool]
95
+ );
96
+ }
97
+
98
+ // src/server.ts
99
+ var server = createUtilsServer();
5
100
  startServer(server).catch((err) => {
6
- console.error('[utils] server error:', err);
7
- process.exit(1);
101
+ console.error("[utils] server error:", err);
102
+ process.exit(1);
8
103
  });
9
- //# sourceMappingURL=server.js.map
package/package.json CHANGED
@@ -1,39 +1,32 @@
1
1
  {
2
2
  "name": "@julong/mono-rele2-utils",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
8
- "import": "./src/index.ts",
9
- "types": "./src/index.ts"
8
+ "import": "./dist/index.js",
9
+ "types": "./dist/index.d.ts"
10
10
  }
11
11
  },
12
12
  "bin": {
13
13
  "mcp-utils": "./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": "tsc --build && chmod 755 dist/server.js",
22
+ "build": "tsup",
26
23
  "typecheck": "tsc --noEmit",
27
- "clean": "rimraf dist tsconfig.tsbuildinfo"
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
  }
@@ -1,4 +0,0 @@
1
-
2
- > @julong/mono-rele2-utils@1.1.0 build /home/runner/work/mono-rele2/mono-rele2/packages/utils
3
- > tsc --build && chmod 755 dist/server.js
4
-
package/CHANGELOG.md DELETED
@@ -1,29 +0,0 @@
1
- ## @julong/mono-rele2-utils [1.1.1](https://github.com/mss-julong/mono-rele2/compare/@julong/mono-rele2-utils@1.1.0...@julong/mono-rele2-utils@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-utils [1.1.0](https://github.com/mss-julong/mono-rele2/compare/@julong/mono-rele2-utils@1.0.1...@julong/mono-rele2-utils@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-utils [1.0.1](https://github.com/mss-julong/mono-rele2/compare/@julong/mono-rele2-utils@1.0.0...@julong/mono-rele2-utils@1.0.1) (2026-04-30)
20
-
21
- ### Bug Fixes
22
-
23
- * 오류 수정 ([a420e11](https://github.com/mss-julong/mono-rele2/commit/a420e11fe5874980c85b2a0d404162af8336423e))
24
-
25
- ## @julong/mono-rele2-utils 1.0.0 (2026-04-30)
26
-
27
- ### Features
28
-
29
- * 프로젝트 초기화 ([4786372](https://github.com/mss-julong/mono-rele2/commit/47863729484561d11757409bde78dd63baad8c8c))
package/dist/cn.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare function cn(...classes: (string | undefined | null | false)[]): string;
2
- //# sourceMappingURL=cn.d.ts.map
package/dist/cn.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../src/cn.ts"],"names":[],"mappings":"AAAA,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,EAAE,GAAG,MAAM,CAE5E"}
package/dist/cn.js DELETED
@@ -1,5 +0,0 @@
1
- export function cn(...classes) {
2
- return classes.filter(Boolean).join(' ');
3
- }
4
- // 테스트
5
- //# sourceMappingURL=cn.js.map
package/dist/cn.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cn.js","sourceRoot":"","sources":["../src/cn.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,EAAE,CAAC,GAAG,OAA8C;IAClE,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1C,CAAC;AACD,MAAM"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAExE,wBAAgB,iBAAiB,6DAKhC"}
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,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAExE,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAExE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,eAAe,CACpB,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE,EAC9C,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,CACxC,CAAA;AACH,CAAC"}
package/dist/server.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=server.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":""}
@@ -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,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAA;AAElC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAChC,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAA;IAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export { cnTool, caseConvertTool, truncateTool } from './text.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA"}
@@ -1,2 +0,0 @@
1
- export { cnTool, caseConvertTool, truncateTool } from './text.js';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA"}
@@ -1,4 +0,0 @@
1
- export declare const cnTool: import("@julong/mono-rele2-common").AnyToolDef;
2
- export declare const caseConvertTool: import("@julong/mono-rele2-common").AnyToolDef;
3
- export declare const truncateTool: import("@julong/mono-rele2-common").AnyToolDef;
4
- //# sourceMappingURL=text.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/tools/text.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,gDAOjB,CAAA;AAEF,eAAO,MAAM,eAAe,gDAa1B,CAAA;AAEF,eAAO,MAAM,YAAY,gDAYvB,CAAA"}
@@ -1,59 +0,0 @@
1
- import { defineTool, text } from '@julong/mono-rele2-common';
2
- import { z } from 'zod';
3
- import { cn } from '../cn.js';
4
- export const cnTool = defineTool({
5
- name: 'cn',
6
- description: 'Merges class names, filtering out falsy values',
7
- inputSchema: {
8
- classes: z.array(z.string()).describe('List of class names to merge'),
9
- },
10
- handler: async ({ classes }) => text(cn(...classes)),
11
- });
12
- export const caseConvertTool = defineTool({
13
- name: 'case_convert',
14
- description: 'Converts text to the specified case format',
15
- inputSchema: {
16
- input: z.string().describe('Text to convert'),
17
- to: z
18
- .enum(['upper', 'lower', 'capitalize', 'camel', 'snake', 'kebab'])
19
- .describe('Target case format'),
20
- },
21
- handler: async ({ input, to }) => {
22
- const result = convert(input, to);
23
- return text(result);
24
- },
25
- });
26
- export const truncateTool = defineTool({
27
- name: 'truncate',
28
- description: 'Truncates text to a maximum length and appends a suffix',
29
- inputSchema: {
30
- input: z.string().describe('Text to truncate'),
31
- maxLength: z.number().int().positive().describe('Maximum character length'),
32
- suffix: z.string().default('...').describe('Suffix to append when truncated'),
33
- },
34
- handler: async ({ input, maxLength, suffix }) => {
35
- const result = input.length <= maxLength ? input : input.slice(0, maxLength - suffix.length) + suffix;
36
- return text(result);
37
- },
38
- });
39
- function convert(input, to) {
40
- switch (to) {
41
- case 'upper': return input.toUpperCase();
42
- case 'lower': return input.toLowerCase();
43
- case 'capitalize': return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
44
- case 'camel': return input
45
- .replace(/[-_\s]+(.)/g, (_, c) => c.toUpperCase())
46
- .replace(/^(.)/, (c) => c.toLowerCase());
47
- case 'snake': return input
48
- .replace(/([A-Z])/g, '_$1')
49
- .replace(/[-\s]+/g, '_')
50
- .toLowerCase()
51
- .replace(/^_/, '');
52
- case 'kebab': return input
53
- .replace(/([A-Z])/g, '-$1')
54
- .replace(/[_\s]+/g, '-')
55
- .toLowerCase()
56
- .replace(/^-/, '');
57
- }
58
- }
59
- //# sourceMappingURL=text.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/tools/text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAA;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AE,EAAE,CAAC,CAAA;QACtB,KAAK,OAAO,CAAC,CAAC,OAAO,KAAK;aACrB,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC;aAC1B,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;aACvB,WAAW,EAAE;aACb,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACxB,CAAC;AACH,CAAC"}
package/src/cn.ts DELETED
@@ -1,4 +0,0 @@
1
- export function cn(...classes: (string | undefined | null | false)[]): string {
2
- return classes.filter(Boolean).join(' ')
3
- }
4
- // 테스트
package/src/index.ts DELETED
@@ -1,12 +0,0 @@
1
- import { createMcpServer } from '@julong/mono-rele2-common'
2
- import { cnTool, caseConvertTool, truncateTool } from './tools/index.js'
3
-
4
- export { cn } from './cn.js'
5
- export { cnTool, caseConvertTool, truncateTool } from './tools/index.js'
6
-
7
- export function createUtilsServer() {
8
- return createMcpServer(
9
- { name: 'mono-rele2-utils', version: '1.0.0' },
10
- [cnTool, caseConvertTool, truncateTool],
11
- )
12
- }
package/src/server.ts DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- import { startServer } from '@julong/mono-rele2-common'
3
- import { createUtilsServer } from './index.js'
4
-
5
- const server = createUtilsServer()
6
-
7
- startServer(server).catch((err) => {
8
- console.error('[utils] server error:', err)
9
- process.exit(1)
10
- })
@@ -1 +0,0 @@
1
- export { cnTool, caseConvertTool, truncateTool } from './text.js'
package/src/tools/text.ts DELETED
@@ -1,62 +0,0 @@
1
- import { defineTool, text } from '@julong/mono-rele2-common'
2
- import { z } from 'zod'
3
- import { cn } from '../cn.js'
4
-
5
- export const cnTool = defineTool({
6
- name: 'cn',
7
- description: 'Merges class names, filtering out falsy values',
8
- inputSchema: {
9
- classes: z.array(z.string()).describe('List of class names to merge'),
10
- },
11
- handler: async ({ classes }) => text(cn(...classes)),
12
- })
13
-
14
- export const caseConvertTool = defineTool({
15
- name: 'case_convert',
16
- description: 'Converts text to the specified case format',
17
- inputSchema: {
18
- input: z.string().describe('Text to convert'),
19
- to: z
20
- .enum(['upper', 'lower', 'capitalize', 'camel', 'snake', 'kebab'])
21
- .describe('Target case format'),
22
- },
23
- handler: async ({ input, to }) => {
24
- const result = convert(input, to)
25
- return text(result)
26
- },
27
- })
28
-
29
- export const truncateTool = defineTool({
30
- name: 'truncate',
31
- description: 'Truncates text to a maximum length and appends a suffix',
32
- inputSchema: {
33
- input: z.string().describe('Text to truncate'),
34
- maxLength: z.number().int().positive().describe('Maximum character length'),
35
- suffix: z.string().default('...').describe('Suffix to append when truncated'),
36
- },
37
- handler: async ({ input, maxLength, suffix }) => {
38
- const result = input.length <= maxLength ? input : input.slice(0, maxLength - suffix.length) + suffix
39
- return text(result)
40
- },
41
- })
42
-
43
- function convert(input: string, to: 'upper' | 'lower' | 'capitalize' | 'camel' | 'snake' | 'kebab'): string {
44
- switch (to) {
45
- case 'upper': return input.toUpperCase()
46
- case 'lower': return input.toLowerCase()
47
- case 'capitalize': return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase()
48
- case 'camel': return input
49
- .replace(/[-_\s]+(.)/g, (_, c: string) => c.toUpperCase())
50
- .replace(/^(.)/, (c) => c.toLowerCase())
51
- case 'snake': return input
52
- .replace(/([A-Z])/g, '_$1')
53
- .replace(/[-\s]+/g, '_')
54
- .toLowerCase()
55
- .replace(/^_/, '')
56
- case 'kebab': return input
57
- .replace(/([A-Z])/g, '-$1')
58
- .replace(/[_\s]+/g, '-')
59
- .toLowerCase()
60
- .replace(/^-/, '')
61
- }
62
- }
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
- }
@@ -1 +0,0 @@
1
- {"root":["./src/cn.ts","./src/index.ts","./src/server.ts","./src/tools/index.ts","./src/tools/text.ts"],"version":"5.9.3"}