@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.d.ts
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -3456,7 +3456,7 @@ const Type = TypeBuilder;
|
|
|
3456
3456
|
* 完全移除 MCP 依赖,直接注册工具
|
|
3457
3457
|
*/
|
|
3458
3458
|
const pluginId = 'beisen-ehr-plugin';
|
|
3459
|
-
const pluginVersion = '2.
|
|
3459
|
+
const pluginVersion = '2.2.0';
|
|
3460
3460
|
const defaultConfig = {
|
|
3461
3461
|
apiUrl: 'https://openapi.italent.cn',
|
|
3462
3462
|
};
|
|
@@ -3585,7 +3585,7 @@ async function register(api) {
|
|
|
3585
3585
|
const client = new BeisenClient(config);
|
|
3586
3586
|
// ============ 注册工具 ============
|
|
3587
3587
|
console.error('[BEISEN] 🔧 正在注册工具...');
|
|
3588
|
-
api.
|
|
3588
|
+
api.registerTool({
|
|
3589
3589
|
name: 'beisen_submit_overtime',
|
|
3590
3590
|
description: '提交加班申请到北森 EHR(推送数据并发起审批)',
|
|
3591
3591
|
parameters: Type.Object({
|
|
@@ -3595,7 +3595,7 @@ async function register(api) {
|
|
|
3595
3595
|
properties: Type.Optional(Type.String({ description: '自定义字段 JSON' })),
|
|
3596
3596
|
}),
|
|
3597
3597
|
async execute(_id, params) {
|
|
3598
|
-
console.error(`[BEISEN] 🔨
|
|
3598
|
+
console.error(`[BEISEN] 🔨 工具调用:beisen_submit_overtime`, JSON.stringify(params));
|
|
3599
3599
|
try {
|
|
3600
3600
|
const result = await client.submitOvertime({
|
|
3601
3601
|
staffId: config.staffId,
|
|
@@ -3622,12 +3622,12 @@ async function register(api) {
|
|
|
3622
3622
|
}
|
|
3623
3623
|
},
|
|
3624
3624
|
});
|
|
3625
|
-
api.
|
|
3625
|
+
api.registerTool({
|
|
3626
3626
|
name: 'beisen_get_leave_balance',
|
|
3627
3627
|
description: '查询假期余额(年假、调休假等)',
|
|
3628
3628
|
parameters: Type.Object({}),
|
|
3629
3629
|
async execute(_id, _params) {
|
|
3630
|
-
console.error(`[BEISEN] 🔨
|
|
3630
|
+
console.error(`[BEISEN] 🔨 工具调用:beisen_get_leave_balance`);
|
|
3631
3631
|
try {
|
|
3632
3632
|
const result = await client.getLeaveBalance(config.staffId, config.email);
|
|
3633
3633
|
let balanceText = `📊 假期余额\n\n员工:${config.email}\n\n`;
|
|
@@ -3650,7 +3650,7 @@ async function register(api) {
|
|
|
3650
3650
|
}
|
|
3651
3651
|
},
|
|
3652
3652
|
});
|
|
3653
|
-
api.
|
|
3653
|
+
api.registerTool({
|
|
3654
3654
|
name: 'beisen_query_attendance',
|
|
3655
3655
|
description: '查询员工考勤记录',
|
|
3656
3656
|
parameters: Type.Object({
|
|
@@ -3658,7 +3658,7 @@ async function register(api) {
|
|
|
3658
3658
|
endDate: Type.String({ description: '结束日期 (YYYY-MM-DD)' }),
|
|
3659
3659
|
}),
|
|
3660
3660
|
async execute(_id, params) {
|
|
3661
|
-
console.error(`[BEISEN] 🔨
|
|
3661
|
+
console.error(`[BEISEN] 🔨 工具调用:beisen_query_attendance`, JSON.stringify(params));
|
|
3662
3662
|
try {
|
|
3663
3663
|
const records = await client.getAttendanceRecords(params.startDate, params.endDate, config.staffId);
|
|
3664
3664
|
return {
|
|
@@ -3674,14 +3674,14 @@ async function register(api) {
|
|
|
3674
3674
|
}
|
|
3675
3675
|
},
|
|
3676
3676
|
});
|
|
3677
|
-
api.
|
|
3677
|
+
api.registerTool({
|
|
3678
3678
|
name: 'beisen_get_approval_status',
|
|
3679
3679
|
description: '查询审批状态',
|
|
3680
3680
|
parameters: Type.Object({
|
|
3681
3681
|
applicationId: Type.String({ description: '申请 ID' }),
|
|
3682
3682
|
}),
|
|
3683
3683
|
async execute(_id, params) {
|
|
3684
|
-
console.error(`[BEISEN] 🔨
|
|
3684
|
+
console.error(`[BEISEN] 🔨 工具调用:beisen_get_approval_status`, JSON.stringify(params));
|
|
3685
3685
|
try {
|
|
3686
3686
|
const status = await client.getApprovalStatus(params.applicationId);
|
|
3687
3687
|
return {
|
|
@@ -3700,13 +3700,8 @@ async function register(api) {
|
|
|
3700
3700
|
}
|
|
3701
3701
|
},
|
|
3702
3702
|
});
|
|
3703
|
-
console.error('[BEISEN] ✅ 已注册 4
|
|
3703
|
+
console.error('[BEISEN] ✅ 已注册 4 个工具');
|
|
3704
3704
|
console.error('[BEISEN] 🎉 插件加载完成,准备就绪!');
|
|
3705
|
-
console.error('[BEISEN] 📋 Hook 列表:');
|
|
3706
|
-
console.error('[BEISEN] - beisen_submit_overtime');
|
|
3707
|
-
console.error('[BEISEN] - beisen_get_leave_balance');
|
|
3708
|
-
console.error('[BEISEN] - beisen_query_attendance');
|
|
3709
|
-
console.error('[BEISEN] - beisen_get_approval_status');
|
|
3710
3705
|
}
|
|
3711
3706
|
async function unregister() {
|
|
3712
3707
|
console.error('[BEISEN] 🏢 插件已停用');
|