gm-mcp 1.0.10 → 1.1.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.
@@ -0,0 +1 @@
1
+ export declare function searchLike(query: string, list: string[]): string[];
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.searchLike = searchLike;
4
+ function searchLike(query, list) {
5
+ if (!query)
6
+ return list;
7
+ const searchTerm = query.toLowerCase().trim();
8
+ return list
9
+ .map((company) => {
10
+ const companyLower = company.toLowerCase();
11
+ let score = 0;
12
+ // Exact match gets highest score
13
+ if (companyLower === searchTerm) {
14
+ score = 1000;
15
+ }
16
+ // Starts with search term
17
+ else if (companyLower.startsWith(searchTerm)) {
18
+ score = 500;
19
+ }
20
+ // Contains search term
21
+ else if (companyLower.includes(searchTerm)) {
22
+ score = 250;
23
+ }
24
+ // Check if all characters exist in order
25
+ else {
26
+ let pos = 0;
27
+ for (let char of searchTerm) {
28
+ pos = companyLower.indexOf(char, pos);
29
+ if (pos === -1)
30
+ break;
31
+ score += 10;
32
+ pos++;
33
+ }
34
+ }
35
+ return { company, score };
36
+ })
37
+ .filter((item) => item.score > 0)
38
+ .sort((a, b) => b.score - a.score)
39
+ .map((item) => item.company);
40
+ }
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
19
19
  const tools_1 = require("./tools");
20
20
  const zod_1 = __importDefault(require("zod"));
21
21
  const env_1 = require("./env");
22
+ const lark_tool_1 = require("./tools/lark-tool");
22
23
  exports.server = new mcp_js_1.McpServer({
23
24
  name: "mcp-server",
24
25
  version: "1.0.0",
@@ -68,6 +69,13 @@ exports.server.tool("statistic_salary_x3_in_range", "Get statistic salary x3 wit
68
69
  sendMessageToLark: (0, env_1.getEnv)().SEND_MESSAGE_TO_LARK,
69
70
  });
70
71
  }));
72
+ exports.server.tool("debt_collection_by_month", "The company's debt collection rate by month", {
73
+ month: zod_1.default.string({ description: "Month to get data, month must be represented with format MM/yyyy" }),
74
+ company_name: zod_1.default.string({ description: "Company name to get data" }),
75
+ }, (args) => __awaiter(void 0, void 0, void 0, function* () {
76
+ const { month, company_name } = args;
77
+ return (0, lark_tool_1.debtCollectionRateTool)({ sendMessageToLark: true, monthDate: month, companyName: company_name });
78
+ }));
71
79
  function bootstap() {
72
80
  (0, env_1.ensureEnvVariables)();
73
81
  const transport = new stdio_js_1.StdioServerTransport();
@@ -0,0 +1,150 @@
1
+ export declare const REPORT_COLUMS: ({
2
+ field_id: string;
3
+ field_name: string;
4
+ is_hidden: boolean;
5
+ is_primary: boolean;
6
+ property: null;
7
+ type: number;
8
+ ui_type: string;
9
+ } | {
10
+ field_id: string;
11
+ field_name: string;
12
+ is_hidden: boolean;
13
+ is_primary: boolean;
14
+ property: {
15
+ options: {
16
+ color: number;
17
+ id: string;
18
+ name: string;
19
+ }[];
20
+ formatter?: undefined;
21
+ auto_fill?: undefined;
22
+ date_formatter?: undefined;
23
+ multiple?: undefined;
24
+ filter_info?: undefined;
25
+ formula?: undefined;
26
+ roll_up?: undefined;
27
+ target_field?: undefined;
28
+ formula_expression?: undefined;
29
+ type?: undefined;
30
+ };
31
+ type: number;
32
+ ui_type: string;
33
+ } | {
34
+ field_id: string;
35
+ field_name: string;
36
+ is_hidden: boolean;
37
+ is_primary: boolean;
38
+ property: {
39
+ formatter: string;
40
+ options?: undefined;
41
+ auto_fill?: undefined;
42
+ date_formatter?: undefined;
43
+ multiple?: undefined;
44
+ filter_info?: undefined;
45
+ formula?: undefined;
46
+ roll_up?: undefined;
47
+ target_field?: undefined;
48
+ formula_expression?: undefined;
49
+ type?: undefined;
50
+ };
51
+ type: number;
52
+ ui_type: string;
53
+ } | {
54
+ field_id: string;
55
+ field_name: string;
56
+ is_hidden: boolean;
57
+ is_primary: boolean;
58
+ property: {
59
+ auto_fill: boolean;
60
+ date_formatter: string;
61
+ options?: undefined;
62
+ formatter?: undefined;
63
+ multiple?: undefined;
64
+ filter_info?: undefined;
65
+ formula?: undefined;
66
+ roll_up?: undefined;
67
+ target_field?: undefined;
68
+ formula_expression?: undefined;
69
+ type?: undefined;
70
+ };
71
+ type: number;
72
+ ui_type: string;
73
+ } | {
74
+ field_id: string;
75
+ field_name: string;
76
+ is_hidden: boolean;
77
+ is_primary: boolean;
78
+ property: {
79
+ multiple: boolean;
80
+ options?: undefined;
81
+ formatter?: undefined;
82
+ auto_fill?: undefined;
83
+ date_formatter?: undefined;
84
+ filter_info?: undefined;
85
+ formula?: undefined;
86
+ roll_up?: undefined;
87
+ target_field?: undefined;
88
+ formula_expression?: undefined;
89
+ type?: undefined;
90
+ };
91
+ type: number;
92
+ ui_type: string;
93
+ } | {
94
+ field_id: string;
95
+ field_name: string;
96
+ is_hidden: boolean;
97
+ is_primary: boolean;
98
+ property: {
99
+ filter_info: {
100
+ conditions: {
101
+ children: {
102
+ field_id: string;
103
+ field_type: number;
104
+ operator: string;
105
+ value: null;
106
+ }[];
107
+ conjunction: string;
108
+ };
109
+ target_table: string;
110
+ };
111
+ formatter: string;
112
+ formula: string;
113
+ roll_up: number;
114
+ target_field: string;
115
+ options?: undefined;
116
+ auto_fill?: undefined;
117
+ date_formatter?: undefined;
118
+ multiple?: undefined;
119
+ formula_expression?: undefined;
120
+ type?: undefined;
121
+ };
122
+ type: number;
123
+ ui_type: string;
124
+ } | {
125
+ field_id: string;
126
+ field_name: string;
127
+ is_hidden: boolean;
128
+ is_primary: boolean;
129
+ property: {
130
+ formatter: string;
131
+ formula_expression: string;
132
+ type: {
133
+ data_type: number;
134
+ ui_property: {
135
+ formatter: string;
136
+ };
137
+ ui_type: string;
138
+ };
139
+ options?: undefined;
140
+ auto_fill?: undefined;
141
+ date_formatter?: undefined;
142
+ multiple?: undefined;
143
+ filter_info?: undefined;
144
+ formula?: undefined;
145
+ roll_up?: undefined;
146
+ target_field?: undefined;
147
+ };
148
+ type: number;
149
+ ui_type: string;
150
+ })[];