@ynhcj/xiaoyi-channel 0.0.182-beta → 0.0.183-beta

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.
@@ -19,7 +19,8 @@ const GATEWAY_TIMEOUT_MS = 60_000;
19
19
  */
20
20
  export async function handleCronQueryEvent(context, cfg) {
21
21
  const { action, jobId, params, sessionId, taskId, messageId } = context;
22
- logger.log(`[CRON-QUERY] Received event: action=${action}, jobId=${jobId ?? "(none)"}`);
22
+ const log = logger.withContext(sessionId ?? "", taskId ?? "");
23
+ log.log(`[CRON-QUERY] Received event: action=${action}, jobId=${jobId ?? "(none)"}`);
23
24
  let result;
24
25
  let error;
25
26
  try {
@@ -62,17 +63,17 @@ export async function handleCronQueryEvent(context, cfg) {
62
63
  break;
63
64
  default:
64
65
  error = `Unknown action: ${context.action}`;
65
- logger.error(`[CRON-QUERY] ${error}`);
66
+ log.error(`[CRON-QUERY] ${error}`);
66
67
  result = { error };
67
68
  }
68
69
  }
69
70
  catch (err) {
70
71
  error = err instanceof Error ? err.message : String(err);
71
- logger.error(`[CRON-QUERY] RPC call failed for action=${action}:`, err);
72
+ log.error(`[CRON-QUERY] RPC call failed for action=${action}:`, err);
72
73
  result = { error };
73
74
  }
74
75
  // Log the result
75
- logger.log(`[CRON-QUERY] RPC result for action=${action}: ${JSON.stringify(result, null, 2)}`);
76
+ log.log(`[CRON-QUERY] RPC result for action=${action}: ${JSON.stringify(result, null, 2)}`);
76
77
  // Send result back via sendCommand as System.CronQuery with payload.ans
77
78
  if (cfg && sessionId && taskId && messageId) {
78
79
  try {
@@ -93,16 +94,16 @@ export async function handleCronQueryEvent(context, cfg) {
93
94
  taskId,
94
95
  messageId,
95
96
  command,
96
- final: true,
97
+ final: sessionId.toLowerCase().endsWith("cronquery"),
97
98
  });
98
- logger.log(`[CRON-QUERY] Sent response via sendCommand, action=${action}`);
99
+ log.log(`[CRON-QUERY] Sent response via sendCommand, action=${action}`);
99
100
  }
100
101
  catch (sendErr) {
101
- logger.error(`[CRON-QUERY] Failed to send response via sendCommand:`, sendErr);
102
+ log.error(`[CRON-QUERY] Failed to send response via sendCommand:`, sendErr);
102
103
  }
103
104
  }
104
105
  else {
105
- logger.warn(`[CRON-QUERY] Missing cfg/sessionId/taskId/messageId, skipping sendCommand`);
106
+ log.warn(`[CRON-QUERY] Missing cfg/sessionId/taskId/messageId, skipping sendCommand`);
106
107
  }
107
108
  }
108
109
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ynhcj/xiaoyi-channel",
3
- "version": "0.0.182-beta",
3
+ "version": "0.0.183-beta",
4
4
  "description": "OpenClaw Xiaoyi Channel plugin - Xiaoyi A2A protocol integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",