@peninsula-med/beisen-ehr-plugin 2.1.0 → 2.2.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/index.cjs.js +10 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +10 -15
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3460,7 +3460,7 @@ const Type = TypeBuilder;
|
|
|
3460
3460
|
* 完全移除 MCP 依赖,直接注册工具
|
|
3461
3461
|
*/
|
|
3462
3462
|
const pluginId = 'beisen-ehr-plugin';
|
|
3463
|
-
const pluginVersion = '2.
|
|
3463
|
+
const pluginVersion = '2.2.0';
|
|
3464
3464
|
const defaultConfig = {
|
|
3465
3465
|
apiUrl: 'https://openapi.italent.cn',
|
|
3466
3466
|
};
|
|
@@ -3589,7 +3589,7 @@ async function register(api) {
|
|
|
3589
3589
|
const client = new BeisenClient(config);
|
|
3590
3590
|
// ============ 注册工具 ============
|
|
3591
3591
|
console.error('[BEISEN] 🔧 正在注册工具...');
|
|
3592
|
-
api.
|
|
3592
|
+
api.registerTool({
|
|
3593
3593
|
name: 'beisen_submit_overtime',
|
|
3594
3594
|
description: '提交加班申请到北森 EHR(推送数据并发起审批)',
|
|
3595
3595
|
parameters: Type.Object({
|
|
@@ -3599,7 +3599,7 @@ async function register(api) {
|
|
|
3599
3599
|
properties: Type.Optional(Type.String({ description: '自定义字段 JSON' })),
|
|
3600
3600
|
}),
|
|
3601
3601
|
async execute(_id, params) {
|
|
3602
|
-
console.error(`[BEISEN] 🔨
|
|
3602
|
+
console.error(`[BEISEN] 🔨 工具调用:beisen_submit_overtime`, JSON.stringify(params));
|
|
3603
3603
|
try {
|
|
3604
3604
|
const result = await client.submitOvertime({
|
|
3605
3605
|
staffId: config.staffId,
|
|
@@ -3626,12 +3626,12 @@ async function register(api) {
|
|
|
3626
3626
|
}
|
|
3627
3627
|
},
|
|
3628
3628
|
});
|
|
3629
|
-
api.
|
|
3629
|
+
api.registerTool({
|
|
3630
3630
|
name: 'beisen_get_leave_balance',
|
|
3631
3631
|
description: '查询假期余额(年假、调休假等)',
|
|
3632
3632
|
parameters: Type.Object({}),
|
|
3633
3633
|
async execute(_id, _params) {
|
|
3634
|
-
console.error(`[BEISEN] 🔨
|
|
3634
|
+
console.error(`[BEISEN] 🔨 工具调用:beisen_get_leave_balance`);
|
|
3635
3635
|
try {
|
|
3636
3636
|
const result = await client.getLeaveBalance(config.staffId, config.email);
|
|
3637
3637
|
let balanceText = `📊 假期余额\n\n员工:${config.email}\n\n`;
|
|
@@ -3654,7 +3654,7 @@ async function register(api) {
|
|
|
3654
3654
|
}
|
|
3655
3655
|
},
|
|
3656
3656
|
});
|
|
3657
|
-
api.
|
|
3657
|
+
api.registerTool({
|
|
3658
3658
|
name: 'beisen_query_attendance',
|
|
3659
3659
|
description: '查询员工考勤记录',
|
|
3660
3660
|
parameters: Type.Object({
|
|
@@ -3662,7 +3662,7 @@ async function register(api) {
|
|
|
3662
3662
|
endDate: Type.String({ description: '结束日期 (YYYY-MM-DD)' }),
|
|
3663
3663
|
}),
|
|
3664
3664
|
async execute(_id, params) {
|
|
3665
|
-
console.error(`[BEISEN] 🔨
|
|
3665
|
+
console.error(`[BEISEN] 🔨 工具调用:beisen_query_attendance`, JSON.stringify(params));
|
|
3666
3666
|
try {
|
|
3667
3667
|
const records = await client.getAttendanceRecords(params.startDate, params.endDate, config.staffId);
|
|
3668
3668
|
return {
|
|
@@ -3678,14 +3678,14 @@ async function register(api) {
|
|
|
3678
3678
|
}
|
|
3679
3679
|
},
|
|
3680
3680
|
});
|
|
3681
|
-
api.
|
|
3681
|
+
api.registerTool({
|
|
3682
3682
|
name: 'beisen_get_approval_status',
|
|
3683
3683
|
description: '查询审批状态',
|
|
3684
3684
|
parameters: Type.Object({
|
|
3685
3685
|
applicationId: Type.String({ description: '申请 ID' }),
|
|
3686
3686
|
}),
|
|
3687
3687
|
async execute(_id, params) {
|
|
3688
|
-
console.error(`[BEISEN] 🔨
|
|
3688
|
+
console.error(`[BEISEN] 🔨 工具调用:beisen_get_approval_status`, JSON.stringify(params));
|
|
3689
3689
|
try {
|
|
3690
3690
|
const status = await client.getApprovalStatus(params.applicationId);
|
|
3691
3691
|
return {
|
|
@@ -3704,13 +3704,8 @@ async function register(api) {
|
|
|
3704
3704
|
}
|
|
3705
3705
|
},
|
|
3706
3706
|
});
|
|
3707
|
-
console.error('[BEISEN] ✅ 已注册 4
|
|
3707
|
+
console.error('[BEISEN] ✅ 已注册 4 个工具');
|
|
3708
3708
|
console.error('[BEISEN] 🎉 插件加载完成,准备就绪!');
|
|
3709
|
-
console.error('[BEISEN] 📋 Hook 列表:');
|
|
3710
|
-
console.error('[BEISEN] - beisen_submit_overtime');
|
|
3711
|
-
console.error('[BEISEN] - beisen_get_leave_balance');
|
|
3712
|
-
console.error('[BEISEN] - beisen_query_attendance');
|
|
3713
|
-
console.error('[BEISEN] - beisen_get_approval_status');
|
|
3714
3709
|
}
|
|
3715
3710
|
async function unregister() {
|
|
3716
3711
|
console.error('[BEISEN] 🏢 插件已停用');
|