@ynhcj/xiaoyi-channel 0.0.149-next → 0.0.150-next

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.
@@ -17,6 +17,7 @@ export interface SendA2AResponseParams {
17
17
  }>;
18
18
  errorCode?: number | string;
19
19
  errorMessage?: string;
20
+ log?: boolean;
20
21
  }
21
22
  /**
22
23
  * Send an A2A artifact update response.
@@ -42,7 +42,7 @@ function buildTextPreview(text) {
42
42
  * Send an A2A artifact update response.
43
43
  */
44
44
  export async function sendA2AResponse(params) {
45
- const { config, sessionId, taskId, messageId, text, append, final, files, errorCode, errorMessage } = params;
45
+ const { config, sessionId, taskId, messageId, text, append, final, files, errorCode, errorMessage, log: shouldLog = true } = params;
46
46
  const log = logger.withContext(sessionId, taskId);
47
47
  // 审批桥接:将 OpenClaw 的审批提示翻译成用户友好的确认文案
48
48
  const bridgedText = text === undefined ? text : rewriteOutboundApprovalText(sessionId, text);
@@ -97,11 +97,14 @@ export async function sendA2AResponse(params) {
97
97
  taskId,
98
98
  msgDetail: JSON.stringify(jsonRpcResponse),
99
99
  };
100
- // Log complete response body
101
- const redactedText = redactSensitiveText(bridgedText ?? "");
102
- log.log(`[A2A_RESPONSE] Sending artifact-update, append=${append}, final=${final}, text=${buildTextPreview(redactedText)}, files=${files?.length ?? 0}, sensitive=${containsSensitiveInfo(bridgedText ?? "")}`);
100
+ if (shouldLog) {
101
+ const redactedText = redactSensitiveText(bridgedText ?? "");
102
+ log.log(`[A2A_RESPONSE] Sending artifact-update, append=${append}, final=${final}, text=${buildTextPreview(redactedText)}, files=${files?.length ?? 0}, sensitive=${containsSensitiveInfo(bridgedText ?? "")}`);
103
+ }
103
104
  await wsManager.sendMessage(sessionId, outboundMessage);
104
- log.log(`[A2A_RESPONSE] Message sent successfully`);
105
+ if (shouldLog) {
106
+ log.log(`[A2A_RESPONSE] Message sent successfully`);
107
+ }
105
108
  }
106
109
  /**
107
110
  * Send an A2A artifact-update with reasoningText part.
@@ -397,7 +397,6 @@ export function createXYReplyDispatcher(params) {
397
397
  const currentTaskId = getActiveTaskId();
398
398
  const currentMessageId = getActiveMessageId();
399
399
  const text = payload.text ?? "";
400
- scopedLog().log(`[REASONING-STREAM] text.length=${text.length}`);
401
400
  try {
402
401
  if (text.length > 0) {
403
402
  // 🔑 将模型真实的thinking/reasoning内容通过reasoningText转发
@@ -407,7 +406,7 @@ export function createXYReplyDispatcher(params) {
407
406
  taskId: currentTaskId,
408
407
  messageId: currentMessageId,
409
408
  text,
410
- append: true,
409
+ append: false,
411
410
  });
412
411
  }
413
412
  }
@@ -423,7 +422,6 @@ export function createXYReplyDispatcher(params) {
423
422
  const currentTaskId = getActiveTaskId();
424
423
  const currentMessageId = getActiveMessageId();
425
424
  const text = payload.text ?? "";
426
- scopedLog().log(`[PARTIAL-REPLY] text.length=${text.length}`);
427
425
  try {
428
426
  if (text.length > 0) {
429
427
  accumulatedText += text;
@@ -437,6 +435,7 @@ export function createXYReplyDispatcher(params) {
437
435
  text,
438
436
  append: false,
439
437
  final: false,
438
+ log: false,
440
439
  });
441
440
  }
442
441
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.149-next",
3
+ "version": "0.0.150-next",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",