@vrs-soft/wecom-aibot-mcp 2.4.18 → 2.4.19
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/client.js +5 -5
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -26,7 +26,7 @@ function buildApprovalCard(title, description, taskId, detailUrl) {
|
|
|
26
26
|
const truncated = description.length > APPROVAL_DESC_MAX
|
|
27
27
|
? description.slice(0, APPROVAL_DESC_MAX) + '…(已截断,点击「详情」查看完整内容)'
|
|
28
28
|
: description;
|
|
29
|
-
const subTitle = truncated
|
|
29
|
+
const subTitle = truncated;
|
|
30
30
|
const card = {
|
|
31
31
|
card_type: 'button_interaction',
|
|
32
32
|
main_title: { title },
|
|
@@ -252,8 +252,8 @@ class WecomClient extends EventEmitter {
|
|
|
252
252
|
: eventKey === 'allow-always' ? '✅ 已允许(永久)'
|
|
253
253
|
: '❌ 已拒绝';
|
|
254
254
|
const toolInfo = approval.toolName ? `: ${approval.toolName}` : '';
|
|
255
|
-
const desc =
|
|
256
|
-
const descSnippet = desc ? `\n
|
|
255
|
+
const desc = approval.description || '';
|
|
256
|
+
const descSnippet = desc ? `\n${desc.slice(0, 100)}${desc.length > 100 ? '…' : ''}` : '';
|
|
257
257
|
const content = `**审批结果**${toolInfo}\n\n${resultText}${descSnippet}`;
|
|
258
258
|
this.sendText(content).catch(err => {
|
|
259
259
|
logger.error('wecom', `发送审批确认失败: ${err}`);
|
|
@@ -462,8 +462,8 @@ class WecomClient extends EventEmitter {
|
|
|
462
462
|
const resultText = result === 'deny' ? '❌ 已拒绝' : '✅ 已允许';
|
|
463
463
|
const reasonText = reason ? `\n\n原因:${reason}` : '';
|
|
464
464
|
const toolInfo = approval.toolName ? `: ${approval.toolName}` : '';
|
|
465
|
-
const desc =
|
|
466
|
-
const descBlock = desc ? `\n\n
|
|
465
|
+
const desc = approval.description || '';
|
|
466
|
+
const descBlock = desc ? `\n\n\`\`\`\n${desc}\n\`\`\`` : '';
|
|
467
467
|
this.sendText(`**审批结果(超时自动决策)**${toolInfo}\n\n${resultText}${reasonText}${descBlock}`).catch(err => {
|
|
468
468
|
logger.error('[wecom] 发送审批确认失败:', err);
|
|
469
469
|
});
|