mcp-user-system 1.0.4 → 2.0.1

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,198 @@
1
+ import { apiGet, apiGetPage } from "./client.js";
2
+ export const tools = [
3
+ {
4
+ name: "team_tree",
5
+ description: "获取团队组织架构树",
6
+ inputSchema: { type: "object", properties: {}, required: [] },
7
+ },
8
+ {
9
+ name: "team_auth_info",
10
+ description: "获取企业认证信息",
11
+ inputSchema: { type: "object", properties: {}, required: [] },
12
+ },
13
+ {
14
+ name: "team_dissolve_info",
15
+ description: "查询团队解散信息",
16
+ inputSchema: {
17
+ type: "object",
18
+ properties: {
19
+ deptId: { type: "string", description: "部门ID" },
20
+ },
21
+ required: ["deptId"],
22
+ },
23
+ },
24
+ {
25
+ name: "team_ip_whitelist",
26
+ description: "获取IP白名单列表",
27
+ inputSchema: {
28
+ type: "object",
29
+ properties: {
30
+ deptId: { type: "string", description: "部门ID" },
31
+ },
32
+ required: ["deptId"],
33
+ },
34
+ },
35
+ {
36
+ name: "team_ip_whitelist_by_user",
37
+ description: "通过用户ID查询IP白名单",
38
+ inputSchema: {
39
+ type: "object",
40
+ properties: {
41
+ userId: { type: "string", description: "用户ID" },
42
+ },
43
+ required: ["userId"],
44
+ },
45
+ },
46
+ {
47
+ name: "team_members",
48
+ description: "团队成员列表(分页)",
49
+ inputSchema: {
50
+ type: "object",
51
+ properties: {
52
+ keyword: { type: "string", description: "搜索关键字" },
53
+ deptId: { type: "string", description: "部门ID" },
54
+ roleId: { type: "string", description: "角色ID" },
55
+ status: { type: "string", description: "成员状态" },
56
+ },
57
+ required: [],
58
+ },
59
+ },
60
+ {
61
+ name: "team_members_all",
62
+ description: "团队成员列表(全量,不分页)",
63
+ inputSchema: {
64
+ type: "object",
65
+ properties: {
66
+ keyword: { type: "string", description: "搜索关键字" },
67
+ deptId: { type: "string", description: "部门ID" },
68
+ roleId: { type: "string", description: "角色ID" },
69
+ status: { type: "string", description: "成员状态" },
70
+ },
71
+ required: [],
72
+ },
73
+ },
74
+ {
75
+ name: "team_member_detail",
76
+ description: "获取成员详情",
77
+ inputSchema: {
78
+ type: "object",
79
+ properties: {
80
+ userId: { type: "string", description: "用户ID" },
81
+ },
82
+ required: ["userId"],
83
+ },
84
+ },
85
+ {
86
+ name: "team_member_usage_trend",
87
+ description: "获取成员使用趋势",
88
+ inputSchema: {
89
+ type: "object",
90
+ properties: {
91
+ userId: { type: "string", description: "用户ID" },
92
+ range: { type: "string", description: "时间范围(默认30d)" },
93
+ },
94
+ required: ["userId"],
95
+ },
96
+ },
97
+ {
98
+ name: "team_member_pending_requests",
99
+ description: "获取待审批的成员加入申请",
100
+ inputSchema: {
101
+ type: "object",
102
+ properties: {
103
+ deptId: { type: "string", description: "部门ID" },
104
+ phoneNumber: { type: "string", description: "手机号" },
105
+ status: { type: "string", description: "状态" },
106
+ },
107
+ required: [],
108
+ },
109
+ },
110
+ {
111
+ name: "team_member_audit_requests",
112
+ description: "获取已审核的成员申请列表",
113
+ inputSchema: {
114
+ type: "object",
115
+ properties: {
116
+ deptId: { type: "string", description: "部门ID" },
117
+ phoneNumber: { type: "string", description: "手机号" },
118
+ status: { type: "string", description: "状态" },
119
+ },
120
+ required: [],
121
+ },
122
+ },
123
+ {
124
+ name: "team_invite_links",
125
+ description: "邀请链接列表",
126
+ inputSchema: {
127
+ type: "object",
128
+ properties: {
129
+ deptId: { type: "string", description: "部门ID" },
130
+ roleId: { type: "string", description: "角色ID" },
131
+ status: { type: "string", description: "状态" },
132
+ keyword: { type: "string", description: "关键字" },
133
+ },
134
+ required: [],
135
+ },
136
+ },
137
+ {
138
+ name: "team_roles",
139
+ description: "获取团队角色列表",
140
+ inputSchema: { type: "object", properties: {}, required: [] },
141
+ },
142
+ {
143
+ name: "team_join_info",
144
+ description: "查询邀请码信息",
145
+ inputSchema: {
146
+ type: "object",
147
+ properties: {
148
+ inviteCode: { type: "string", description: "邀请码" },
149
+ },
150
+ required: ["inviteCode"],
151
+ },
152
+ },
153
+ ];
154
+ export async function handle(name, args) {
155
+ switch (name) {
156
+ case "team_tree":
157
+ return apiGet("/console/team/tree");
158
+ case "team_auth_info":
159
+ return apiGet("/console/team/authInfo");
160
+ case "team_dissolve_info":
161
+ return apiGet("/console/team/dissolve/info", { deptId: args.deptId });
162
+ case "team_ip_whitelist":
163
+ return apiGet("/console/team/ip-whitelist", { deptId: args.deptId });
164
+ case "team_ip_whitelist_by_user":
165
+ return apiGet("/console/team/ip-whitelist/user", { userId: args.userId });
166
+ case "team_members":
167
+ return apiGetPage("/console/team/members", {
168
+ keyword: args.keyword, deptId: args.deptId, roleId: args.roleId, status: args.status,
169
+ });
170
+ case "team_members_all":
171
+ return apiGet("/console/team/members/all", {
172
+ keyword: args.keyword, deptId: args.deptId, roleId: args.roleId, status: args.status,
173
+ });
174
+ case "team_member_detail":
175
+ return apiGet(`/console/team/members/${args.userId}`);
176
+ case "team_member_usage_trend":
177
+ return apiGet(`/console/team/members/${args.userId}/usage-trend`, { range: args.range });
178
+ case "team_member_pending_requests":
179
+ return apiGet("/console/team/members/pending-requests", {
180
+ deptId: args.deptId, phoneNumber: args.phoneNumber, status: args.status,
181
+ });
182
+ case "team_member_audit_requests":
183
+ return apiGet("/console/team/members/audit-requests", {
184
+ deptId: args.deptId, phoneNumber: args.phoneNumber, status: args.status,
185
+ });
186
+ case "team_invite_links":
187
+ return apiGet("/console/team/invite-links", {
188
+ deptId: args.deptId, roleId: args.roleId, status: args.status, keyword: args.keyword,
189
+ });
190
+ case "team_roles":
191
+ return apiGet("/console/team/roles");
192
+ case "team_join_info":
193
+ return apiGet("/console/team/join/info", { inviteCode: args.inviteCode });
194
+ default:
195
+ throw new Error(`Unknown tool: ${name}`);
196
+ }
197
+ }
198
+ //# sourceMappingURL=team.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/tools/team.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAA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EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QAC5E;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
@@ -0,0 +1,109 @@
1
+ export declare const tools: ({
2
+ name: string;
3
+ description: string;
4
+ inputSchema: {
5
+ type: "object";
6
+ properties: {
7
+ status: {
8
+ type: string;
9
+ description: string;
10
+ };
11
+ name: {
12
+ type: string;
13
+ description: string;
14
+ };
15
+ pageNum?: undefined;
16
+ pageSize?: undefined;
17
+ deptId?: undefined;
18
+ ruleMonth?: undefined;
19
+ id?: undefined;
20
+ };
21
+ required: never[];
22
+ };
23
+ } | {
24
+ name: string;
25
+ description: string;
26
+ inputSchema: {
27
+ type: "object";
28
+ properties: {
29
+ status: {
30
+ type: string;
31
+ description: string;
32
+ };
33
+ name: {
34
+ type: string;
35
+ description: string;
36
+ };
37
+ pageNum: {
38
+ type: string;
39
+ description: string;
40
+ };
41
+ pageSize: {
42
+ type: string;
43
+ description: string;
44
+ };
45
+ deptId?: undefined;
46
+ ruleMonth?: undefined;
47
+ id?: undefined;
48
+ };
49
+ required: never[];
50
+ };
51
+ } | {
52
+ name: string;
53
+ description: string;
54
+ inputSchema: {
55
+ type: "object";
56
+ properties: {
57
+ status?: undefined;
58
+ name?: undefined;
59
+ pageNum?: undefined;
60
+ pageSize?: undefined;
61
+ deptId?: undefined;
62
+ ruleMonth?: undefined;
63
+ id?: undefined;
64
+ };
65
+ required: never[];
66
+ };
67
+ } | {
68
+ name: string;
69
+ description: string;
70
+ inputSchema: {
71
+ type: "object";
72
+ properties: {
73
+ deptId: {
74
+ type: string;
75
+ description: string;
76
+ };
77
+ ruleMonth: {
78
+ type: string;
79
+ description: string;
80
+ };
81
+ status?: undefined;
82
+ name?: undefined;
83
+ pageNum?: undefined;
84
+ pageSize?: undefined;
85
+ id?: undefined;
86
+ };
87
+ required: never[];
88
+ };
89
+ } | {
90
+ name: string;
91
+ description: string;
92
+ inputSchema: {
93
+ type: "object";
94
+ properties: {
95
+ id: {
96
+ type: string;
97
+ description: string;
98
+ };
99
+ status?: undefined;
100
+ name?: undefined;
101
+ pageNum?: undefined;
102
+ pageSize?: undefined;
103
+ deptId?: undefined;
104
+ ruleMonth?: undefined;
105
+ };
106
+ required: string[];
107
+ };
108
+ })[];
109
+ export declare function handle(name: string, args: Record<string, string>): Promise<unknown>;
@@ -0,0 +1,83 @@
1
+ import { apiGet, apiGetPage } from "./client.js";
2
+ export const tools = [
3
+ {
4
+ name: "tokens_list",
5
+ description: "获取全部API密钥列表(带权限校验)",
6
+ inputSchema: {
7
+ type: "object",
8
+ properties: {
9
+ status: { type: "string", description: "密钥状态" },
10
+ name: { type: "string", description: "密钥名称" },
11
+ },
12
+ required: [],
13
+ },
14
+ },
15
+ {
16
+ name: "tokens_list_page",
17
+ description: "分页获取API密钥列表",
18
+ inputSchema: {
19
+ type: "object",
20
+ properties: {
21
+ status: { type: "string", description: "密钥状态" },
22
+ name: { type: "string", description: "密钥名称" },
23
+ pageNum: { type: "string", description: "页码" },
24
+ pageSize: { type: "string", description: "每页条数" },
25
+ },
26
+ required: [],
27
+ },
28
+ },
29
+ {
30
+ name: "tokens_stats",
31
+ description: "密钥统计概览",
32
+ inputSchema: { type: "object", properties: {}, required: [] },
33
+ },
34
+ {
35
+ name: "tokens_configurable_models",
36
+ description: "获取可配置AI模型列表(含定价与功能)",
37
+ inputSchema: {
38
+ type: "object",
39
+ properties: {
40
+ deptId: { type: "string", description: "部门ID(可选)" },
41
+ ruleMonth: { type: "string", description: "规则月份(可选)" },
42
+ },
43
+ required: [],
44
+ },
45
+ },
46
+ {
47
+ name: "tag_list",
48
+ description: "获取所有启用的标签列表",
49
+ inputSchema: { type: "object", properties: {}, required: [] },
50
+ },
51
+ {
52
+ name: "tag_detail",
53
+ description: "获取标签详情",
54
+ inputSchema: {
55
+ type: "object",
56
+ properties: {
57
+ id: { type: "string", description: "标签ID" },
58
+ },
59
+ required: ["id"],
60
+ },
61
+ },
62
+ ];
63
+ export async function handle(name, args) {
64
+ switch (name) {
65
+ case "tokens_list":
66
+ return apiGet("/console/tokens/list", { status: args.status, name: args.name });
67
+ case "tokens_list_page":
68
+ return apiGetPage("/console/tokens/listPage", {
69
+ status: args.status, name: args.name, pageNum: args.pageNum, pageSize: args.pageSize,
70
+ });
71
+ case "tokens_stats":
72
+ return apiGet("/console/tokens/stats");
73
+ case "tokens_configurable_models":
74
+ return apiGet("/console/tokens/configurable-models", { deptId: args.deptId, ruleMonth: args.ruleMonth });
75
+ case "tag_list":
76
+ return apiGet("/console/tag/list");
77
+ case "tag_detail":
78
+ return apiGet(`/console/tag/${args.id}`);
79
+ default:
80
+ throw new Error(`Unknown tool: ${name}`);
81
+ }
82
+ }
83
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../src/tools/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,oBAAoB;QACjC,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE;gBAC/C,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE;aAC9C;YACD,QAAQ,EAAE,EAAE;SACb;KACF;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,aAAa;QAC1B,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE;gBAC/C,IAAI,EAAE,EAAE,IAA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AAM,CAAC,sBAAsB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAClF,KAAK,kBAAkB;YACrB,OAAO,UAAU,CAAC,0BAA0B,EAAE;gBAC5C,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACrF,CAAC,CAAC;QACL,KAAK,cAAc;YACjB,OAAO,MAAM,CAAC,uBAAuB,CAAC,CAAC;QACzC,KAAK,4BAA4B;YAC/B,OAAO,MAAM,CAAC,qCAAqC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QAC3G,KAAK,UAAU;YACb,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACrC,KAAK,YAAY;YACf,OAAO,MAAM,CAAC,gBAAgB,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3C;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ export declare const tools: ({
2
+ name: string;
3
+ description: string;
4
+ inputSchema: {
5
+ type: "object";
6
+ properties: {
7
+ deptId?: undefined;
8
+ };
9
+ required: never[];
10
+ };
11
+ } | {
12
+ name: string;
13
+ description: string;
14
+ inputSchema: {
15
+ type: "object";
16
+ properties: {
17
+ deptId: {
18
+ type: string;
19
+ description: string;
20
+ };
21
+ };
22
+ required: string[];
23
+ };
24
+ })[];
25
+ export declare function handle(name: string, args: Record<string, string>): Promise<unknown>;
@@ -0,0 +1,60 @@
1
+ import { apiGet } from "./client.js";
2
+ // ---- 工具定义 ----
3
+ export const tools = [
4
+ {
5
+ name: "get_user_info",
6
+ description: "获取当前登录用户信息(含角色、权限)",
7
+ inputSchema: { type: "object", properties: {}, required: [] },
8
+ },
9
+ {
10
+ name: "get_user_profile",
11
+ description: "获取个人资料详情",
12
+ inputSchema: { type: "object", properties: {}, required: [] },
13
+ },
14
+ {
15
+ name: "get_user_role_list",
16
+ description: "获取用户角色列表",
17
+ inputSchema: { type: "object", properties: {}, required: [] },
18
+ },
19
+ {
20
+ name: "get_user_workbench",
21
+ description: "获取工作台列表(可切换的团队/部门)",
22
+ inputSchema: { type: "object", properties: {}, required: [] },
23
+ },
24
+ {
25
+ name: "get_user_auth_info",
26
+ description: "获取用户实名认证信息",
27
+ inputSchema: { type: "object", properties: {}, required: [] },
28
+ },
29
+ {
30
+ name: "switch_workbench",
31
+ description: "切换工作台(切换当前操作的团队/部门视图)",
32
+ inputSchema: {
33
+ type: "object",
34
+ properties: {
35
+ deptId: { type: "string", description: "目标部门ID" },
36
+ },
37
+ required: ["deptId"],
38
+ },
39
+ },
40
+ ];
41
+ // ---- 处理函数 ----
42
+ export async function handle(name, args) {
43
+ switch (name) {
44
+ case "get_user_info":
45
+ return apiGet("/getInfo");
46
+ case "get_user_profile":
47
+ return apiGet("/system/user/profile");
48
+ case "get_user_role_list":
49
+ return apiGet("/console/user/roleList");
50
+ case "get_user_workbench":
51
+ return apiGet("/console/user/workbench");
52
+ case "get_user_auth_info":
53
+ return apiGet("/console/user/authInfo");
54
+ case "switch_workbench":
55
+ return apiGet(`/console/user/workbench/${args.deptId}/switch`);
56
+ default:
57
+ throw new Error(`Unknown tool: ${name}`);
58
+ }
59
+ }
60
+ //# sourceMappingURL=user.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/tools/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,iBAAiB;AACjB,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,oBAA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